Skip to content

Instantly share code, notes, and snippets.

@cardasac
Last active May 14, 2019 09:04
Show Gist options
  • Save cardasac/e5ae38bcb35bcd45165d47016cdcde1c to your computer and use it in GitHub Desktop.
Save cardasac/e5ae38bcb35bcd45165d47016cdcde1c to your computer and use it in GitHub Desktop.
DC-2018

1.

Use this to design your own diagram in the exam.

SR

Use this to visualize hosts stored frames

Frames

i)

The numbers are not inclusive so I(1, 4) means to start sending from 4 onward. Same for Host B must send from 2 onward including 2. The last frame from host B to host A is 3 because it is asking for frame 4 onward including 4.

ii)

I(4, 2), I(5, 2), I(6, 2)

iii)

SREJ(5), frame 4 and 6 are still stored on Host A since Selective-reject does not discard frames received unlike Go-back-N.

iv)

RNR(5) which tells host A that host B has received frames until frame 5 and now stop transmitting anymore.

Explanation for RNR

The mechanism so far described provides a form of flow control: The receiver must only be able to accommodate seven frames beyond the one it has last acknowledged. Most data link control protocols also allow a station to cut off the flow of frames from the other side by sending a Receive Not Ready (RNR) message, which acknowledges former frames but forbids transfer of future frames. Thus, RNR 5 means, “I have received all frames up through number 4 but am unable to accept any more at this time.” At some subsequent point, the station must send a normal acknowledgment to reopen the window.

2.

i)

Public IP can be accessed from outside the internal network across the world.

Private IP cannot be accessed from outside the network.

ii)

An ISP will allocate a customer one IP address but customers have multiple devices. NAT allows for multiple devices that wish to connect to the internet to share a single IP address.

NAT makes use of special IP addresses which reside in the “Private” IP Address space:

Range Total
10.0.0.0 to 10.255.255.255 2 ^ 24
172.16.0.0 to 172.31.255.255 2 ^ 20
192.168.0.0 to 192.168.255.255 2 ^ 16

iii)

Host Source Destination
A 192.168.0.55 147.252.25.70
B 114.24.10.1 147.252.25.70
C 147.252.25.70 114.24.10.1
D 192.168.0.1 192.168.0.55

iv)

Because 147.252.25.70 is a public IP that cannot communicate directly with the private IP 192.168.0.55. It must first arrive at the router. Private IP addresses cannot be used on the Public Internet.

In effect the internal network on the customer’s premises are isolated from the public network by the router. All datagrams leaving the customer’s network can only contain Public IP addresses.

Likewise, all datagrams arriving at a host on the customer’s network must only contain Private IP addresses in the Destination field.

3.

i)

Datagrams that need to traverse a network that has a MTU value smaller than the size of the datagram need to be dealt with. To resolve this problem, IP routers use a technique known as Fragmentation.

Fragmentation involves splitting or fragmenting the datagram into smaller 'pieces'

  • Typically routers make this decision.
  • The router uses the network MTU and the datagram header size to calculate:
    • the maximum amount of data that can be sent within each fragment
    • the number of fragments that will be required
    • the next slide shows an overview of the process

Frag

ii)

Fragmentation process

  • Create copies of the original datagram header
  • Each copy becomes the header for a fragment
  • The Data field of the original datagram is divided with each division going to a separate fragment

Changes are then made to some of the fields in the header section of each of the fragments in particular to:

  • The Flags field
  • The Fragment Offset field
  • The Identification field

It s important to note that each fragment contains the same source and destination IP address as the original datagram. Only header MAC address changes.

Fragment Offset

  • This field is used to determine when each of the "data splits" belongs in relation to the data field of the original datagram.
  • It is measured in units of 8 bytes.

Frag_off

Re-assembly

The Destination host is not responsible for the reassembly of the fragments.

This is appropriate for two reasons:

  • IP does not necessarily route all datagrams belonging to a single message along the same path.

  • The routes taken by each datagram can change dynamically depending on network conditions.

  • The Destination host checks the Flags field to determine if the datagram is a fragment and if so, whether it is the last fragment.

  • The Identification field is used to uniquely identity fragments belonging to a single datagram.

  • The Offset field is used to reconstruct the original datagram data field.

  • In the event of a lost fragment, the destination host saves the fragments for a fixed period of time only.

  • In essence, the reassembly process is all-or-nothing.

iv)

  • It would fragment the fragmented part. When a fragment arrives at a network that has a smaller MTU, it can be further fragmented.
  • The destination host does not know whether a fragment is derived directly from a datagram or from another fragment.

4

i)

Range of hosts from 190.100.0.1 to 190.100.255.254

2^16 -2 = 65534 addresses

ii)

200 + 2 since you need the network address and the broadcast address also.

Determine the power of 2 to provide for 200 hosts > 2 ^ 8 =256. We don't borrow any bits. 190.255.0.0 /24 customers and 190.255.255.0/16 hosts.

iii)

Sub-network Network Address Host Addresses Broadcast Address Mask
0 190.100.0.0 190.100.0.1-254 190.100.0.255 255.255.255.0
1 190.100.1.0 190.100.1.1-254 190.100.1.255 255.255.255.0
2 190.100.2.0 190.100.2.1-254 190.100.2.255 255.255.255.0

5

i)

Switched-LAN's provide improved performance because there is no contention. Single station transmitting without contention on a Bus LAN experiences full LAN throughput of 100Mbps.

ii)

Draw a line through the middle of the frames. Now stations transmitting with contention on a Bus LAN experiences reduced LAN throughput of approx. 50Mbps.

This is due to each station now has to compete for resources and so the speed is now split in half. First come first served basis, suited for burst traffic and short/sporadic transmissions.

iii)

  • The stations listens to the medium before attempting to transmit.
  • During transmission, the stations continues to listen to the medium for a collision, known as Collision Detection
    • if present, the station ceases transmission immediately
    • the station then transmits a brief jamming signal to inform all other stations of the collision
    • the station waits a random amount of time (delta) before attempting to re-transmit
  • Additional collisions are dealt with using a binary exponential back-off (multiplies by 2 each time)

The use of CSMA/CD is beneficial because it reduces the "down-time" of the LAN segment and "Link Utilization" is improved while also the time to deliver multiple frames is improved.

However, frame size (length) is critical:

  • Short frames do not allow for collisions to be detected
  • Frames have to be a minimum length.
  • The MAC frame format includes a special field called PAD where extra octets can be added to the frame prior to transmission.

No collisions

Advantage of using bridges:

  • Collisions are not copied between LANs and so the Collision Domains are smaller reducing the likelihood of collisions occurring and contention is therefore reduced also.

6

a)

Lecture 17

  • Different frame formats
  • Different electrical characteristics (voltage, wiring types etc.)
  • Different addressing schemes

b) (Incomplete)

The header within each transmitted frame contains the addresses of the sender and receiver. Different addressing schemes are employed on different LAN topologies.

Role of Router

Similar to bridges but with extra functionality i.e. used to interconnect different LAN technologies. For any given LAN implementation, host computers can only communicate with other hosts attached to the same networking technology.

The IP addresses inside the Datagram and the Datagram itself remain the same, only the MAC addresses in the headers will change as the packet travels from one network to another and gets encapsulated in the corresponding frame structure.

As the packet is forwarded across the physical network, the router must decide where the next hop is. The next hop IP address is translated to an equivalent hardware/MAC address before the frame can be transmitted any further. This translation is known as Address Resolution(Protocol).

  • Once translated, the IP address is said to be resolved.
  • The address Resolution is local to a network.
  • Any host connected to a LAN can only resolve the IP addresses of other stations/routers connected to the same LAN.

ARP is performed before encapsulation.

Host A to Host B Datagram is encapsulated inside an 802.3 frame. The router takes the datagram and de-encapsulates it and makes a routing decision for the next hop. Having made a routing decision and deciding host B is destination.

ARP Definition

Anytime a node has an IP datagram to send to another node in a link, it has the IP address of the receiving node. The source host knows the IP address of the default router. Each router except the last one in the path gets the IP address of the next router by using its forwarding table. The last router knows the IP address of the destination host. However, the IP address of the next node is not helpful in moving a frame through a link; we need the link-layer address of the next node. This is the time when the Address Resolution Protocol (ARP) becomes helpful. The ARP protocol is one of the auxiliary protocols defined in the network layer. It belongs to the network layer, but we discuss it in this chapter because it maps an IP address to a logical-link address. ARP accepts an IP address from the IP protocol, maps the address to the corresponding link-layer address, and passes it to the data-link layer.

Anytime a host or a router needs to find the link-layer address of another host or router in its network, it sends an ARP request packet. The packet includes the link-layer and IP addresses of the sender and the IP address of the receiver. Because the sender does not know the link-layer address of the receiver, the query is broadcast over the link using the link-layer broadcast address, which we discuss for each protocol later (see Figure 9.7).

ARP A host with IP address N1 and MAC address L1 has a packet to send to another host with IP address N2 and physical address L2 (which is unknown to the first host). The two hosts are on the same net- work. Figure 9.9 shows the ARP request and response messages.

More ARP Every host or router on the network receives and processes the ARP request packet, but only the intended recipient recognizes its IP address and sends back an ARP response packet. The response packet contains the recipient’s IP and link-layer addresses. The packet is unicast directly to the node that sent the request packet. In Figure 9.7a, the system on the left (A) has a packet that needs to be delivered to another system (B) with IP address N2. System A needs to pass the packet to its data-link layer for the actual delivery, but it does not know the physical address of the recipient. It uses the services of ARP by asking the ARP protocol to send a broadcast ARP request packet to ask for the physical address of a system with an IP address of N2.

This packet is received by every system on the physical network, but only system B will answer it, as shown in Figure 9.7b. System B sends an ARP reply packet that includes its physical address. Now system A can send all the packets it has for this destination using the physical address it received.

@cardasac
Copy link
Author

ARP

image

@cardasac
Copy link
Author

Overdoing it at this stage

image

@mohammedkadiri
Copy link

https://www.youtube.com/watch?v=_iNTKJO5cbg&list=PLcxPetO_cDzs1_C-lh9RNnGJfqxMJVbIN

Check out his playlist for Routing and IP addressing very good resource

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment