COMPUTER NETWORKS MIDTERM SOLUTION
Time Allowed – 1:15 Hrs. MM-26
Q1. i. In the following figure, A wants to send a 5MB file to C in chunks of 500-byte packets. To prevent any
packet loss, when A sends a 500-byte packet to C, it responds with a 50-byte acknowledgement (Ack) to
A (through B), acknowledging the packets that are successfully received. After receiving the Ack, A
sends the next packet.
a. How long will it take to send 500 byte packet from A to C. Assume data travels through the links at the speed
of light (3x108 m/s) ? [2]
a. What is the total delay for the Ack packet from C to A? [2]
b. Assume Queuing Delay =1ms and Propagation Delay as negligible, what is the total latency for 500-byte packet
and 50-byte Ack packet in the communication? [2]
ii. What is the need of ATM network [2] and explain its working [2].
ATM stands for Asynchronous Transfer Mode. It is a switching technique that uses time division multiplexing
(TDM) for data communications. ATM networks are connection oriented networks for cell relay that supports
voice, video and data communications. It encodes data into small fixed - size cells so that they are suitable for
TDM and transmits them over a physical medium.
The size of an ATM cell is 53 bytes: 5 byte header and 48 byte payload. There are two different cell formats -
user-network interface (UNI) and network-network interface (NNI).
The below image represents the Functional Reference Model of the Asynchronous Transfer Mode.
Why we need ATM ?
• It provides the dynamic bandwidth that is particularly suited for bursty traffic.
• Since all data are encoded into identical cells, data transmission is simple, uniform and predictable.
• Uniform packet size ensures that mixed traffic is handled efficiently.
• Small sized header reduces packet overload, thus ensuring effective bandwidth usage.
• ATM networks are scalable both in size and speed.
Working of ATM
ATM reference model comprises of three layers
• Physical Layer − This layer corresponds to physical layer of OSI model. At this layer, the cells are
converted into bit streams and transmitted over the physical medium. This layer has two sub layers: PMD
sub layer (Physical Medium Dependent) and TC (Transmission Convergence) sub layer.
• ATM Layer −This layer is comparable to data link layer of OSI model. It accepts the 48 byte segments
from the upper layer, adds a 5 byte header to each segment and converts into 53 byte cells. This layer is
responsible for routing of each cell, traffic management, multiplexing and switching.
• ATM Adaptation Layer (AAL) −This layer corresponds to network layer of OSI model. It provides
facilities to the existing packet switched networks to connect to ATM network and use its services. It
accepts the data and converts them into fixed sized segments. The transmissions can be of fixed or
variable data rate. This layer has two sub layers − Convergence sub layer and Segmentation and
Reassembly sub layer.
• ATM endpoints − It contains ATM network interface adaptor. Examples of endpoints are workstations,
routers, CODECs, LAN switches, etc.
• ATM switch −It transmits cells through the ATM networks. It accepts the incoming cells from ATM
endpoints (UNI) or another switch (NNI), updates cell header and retransmits cell towards destination.
Two types of connection use the Asynchronous transfer mode (ATM). A virtual path can be created end-to-end
across an ATM network, as it does not route the cells to a particular virtual circuit. In case of major failure, all
cells belonging to a particular virtual path are routed the same way through the ATM network, thus helping faster
recovery.
Switches connected to subscribers use both VPIs and VCIs to switch the cells, which are Virtual Path and Virtual
Connection switches that can have different virtual channel connections between them, serving the purpose of
creating a virtual trunk between the switches, which can be handled as a single entity. Its basic operation is
straightforward looking up the connection value in the local translation table, determining the outgoing port of
the connection, and the new VPI/VCI value of the connection on that link.
iii. What is Cut-Through switching [2] and what is the condition when there is no difference between
the Cut-Through switching and Store & Forward switching? [1]
Cut-through is a packet-switching method, where the switch forwards a packet as soon as the destination address
is processed without waiting for the entire packet to be received. In cut-through switching, whenever a packet
arrives at the switching device, data transmission is started as soon as the destination address is processed. The
switch performs a look–up operation in the address table to check whether the destination address is valid or not.
If the address is valid and the outgoing link is available then the switching device immediately transmits the
frame to the destination port.
When a transmission is already going on output link, the packet has to wait before being transmitted and thus
stored & forwarded before transmission.
Q2. i. Explain how a frame is transmitted from source to destination within the LAN and off the
LAN. Use a figure to demonstrate the same. [7]
Nodes in LANs send frames to each other over a broadcast channel. This means that when a node in
a LAN transmits a frame, every other node connected to the LAN receives the frame. But usually, a
node in the LAN doesn't want to send a frame to all of the other LAN nodes but instead wants to
send to some particular LAN node. To provide this functionality, the nodes on the LAN need to be
able to address each other when sending frames, i.e., the nodes need LAN addresses and the frame
needs a field for a destination LAN address. In this manner, when a node receives a frame it can
determine whether the frame was intended for it or for some other node in the LAN:
• If the destination address of the frame matches a receiving node's LAN address, then the node
extracts the network-layer datagram from the data link layer frame and passes the datagram
up the protocol stack.
• If the destination address does not match the address of the receiving node, the node simply
discards the frame.
Figure 1: Each adapter connected to a LAN has a unique LAN address.
When an adapter wants to send a frame to some destination adapter on the same LAN, the sending
adapter inserts the destination LAN address into the frame. When the destination adapter receives
the frame, it extracts the enclosed datagram and passes the datagram up the protocol stack. All the
other adapters on the LAN also receive the frame; but these other adapters discard the frame without
passing the network-layer datagram up the protocol stack. Thus, these other adapters do not have to
interrupt their hosts when they receive datagrams destined to other hosts. Having said this,
sometimes a sending adapter does want all the other adapters on the LAN to receive and process the
frame it is about to send. In this case, the sending adapter inserts a special LAN broadcast
address into the destination address field of the frame. For LANs that use the six-byte addresses
(such as Ethernet and token-passing LANs), the broadcast address is a string of 48 consecutive 1s
(i.e., FF-FF-FF-FF-FF-FF in hexadecimal notation).
Address Resolution Protocol
Because there are both network-layer addresses (e.g.., Internet IP addresses) and link-layer addresses
(i.e., LAN addresses), there is a need to translate between them. For the Internet, this is the job of
the Address Resolution Protocol (ARP). Every Internet host and router on a LAN has an ARP
module. To motivate ARP, consider the network shown in Figure 2. In this figure each node has an
IP address and each node's adapter has a LAN address. As usual, IP addresses are shown in dotted-
decimal notation and LAN addresses are shown in hexadecimal notation. Now suppose that the node
with IP address 222.222.222.220 wants to send an IP datagram to node 222.222.222.222. To
accomplish this task, the sending node must give its adapter not only the IP datagram but also the
LAN address for node 222.222.222.222. When passed the IP datagram and the LAN address, the
sending node's adapter can construct a data link layer frame and broadcast the frame into the LAN.
But how does the sending node determine the LAN address for the node with IP address
222.222.222.222? It does this by providing its ARP module with the IP address 222.222.222.222.
ARP then responds with the corresponding LAN address, namely, 49-BD-D2-C7-56-2A .
Figure 2: Each node on a LAN has an IP address, and each node's adapter has a LAN address.
So we see that ARP resolves an IP address to a LAN address. In many ways it is analogous to DNS ,
which resolves hostnames to IP addresses. However, one important difference between the two
resolvers is that DNS resolves hostnames for hosts anywhere in the Internet, whereas ARP only
resolves IP addresses for nodes on the same LAN.
The ARP module in each node has a table in its RAM called an ARP table. This table contains the
mappings of IP addresses to LAN addresses. Figure 3 shows what an ARP table in node
222.222.222.220 might look like. For each address mapping the table also contains a time-to-live
(TTL) entry, which indicates when the entry will be deleted. Note that the table does not necessarily
contain an entry for every node on the LAN; some nodes may have had entries that expired over
time, whereas other nodes may have never been entered into the table. We note that a typical
expiration time for an entry is 20 minutes from when an entry is placed in an ARP table.
IP address LAN address TTL
222.222.222.221 88-B2-2F-54-1A-0F 13:45:00
222.222.222.223 5C-66-AB-90-75-B1 13:52:00
Figure 3: A possible ARP table in node 222.222.222.220.
Now suppose that node 222.222.222.220 wants to send a datagram that is IP-addressed to another
node on that LAN. As we indicated above, the sending node needs to obtain the LAN address of the
destination node, given the IP address of that node. This task is easy if the destination node has an
entry in the sending node's ARP table. But what if the destination node does not currently have an
entry in the ARP table? In particular, suppose node 222.222.222.220 wants to send a datagram to
node 222.222.222.222. In this case, the sending node uses the ARP protocol to resolve the address.
First, the sending node constructs a special packet called an ARP packet. An ARP packet has
several fields, including the sending and receiving IP and LAN addresses. Both ARP query and
response packets have the same format. The purpose of the ARP query packet to is to query all the
other nodes on the LAN to determine the LAN address corresponding to the IP address that is being
resolved.
Returning to the example, node 222.222.222.220 passes an ARP query packet to the adapter along
with an indication that the adapter should send the packet to the LAN broadcast address, namely,
FF-FF-FF-FF-FF-FF. The adapter encapsulates the ARP packet in a data link frame, uses the
broadcast address for the frame's destination address, and transmits the frame into the LAN. The
frame containing the ARP query is received by all the other adapters on the LAN, and (because of
the broadcast address) each adapter passes the ARP packet within the frame up to its parent node.
Each node that receives the ARP packet checks to see if its IP address matches the destination IP
address in the ARP packet. The one node with a match sends back to the querying node a response
ARP packet with the desired mapping. The querying node (222.222.222.220) can then update its
ARP table and send its IP datagram.
There are a couple of interesting things to note about the ARP protocol. First, the query ARP
message is sent within a broadcast frame whereas the response ARP message is sent within a
standard frameSecond, ARP is plug-and-play, that is, a node's ARP table gets built automatically --
it doesn't have to be configured by a systems administrator. And if a node is disconnected from the
LAN, its entry is eventually deleted from the table.
Sending a Datagram to a Node Off the LAN
Let us discuss this issue in the context of Figure 4, which shows a simple network consisting of two
LANs interconnected by a router.
Figure 4: Two LANs interconnected by a router.
There are two types of nodes: hosts and routers. Each host has exactly one IP address and one
adapter. Each router interface also has its own ARP module (in the router) and its own adapter.
Because the router in Figure 4 has two interfaces, it has two IP addresses, two ARP modules and
two adapters. Of course, each adapter in the network has its own LAN address.
Also note that all of the interfaces connected to LAN 1 have addresses of the form 111.111.111.xxx
and all of the interfaces connected to LAN 2 have the form 222.222.222.xxx . Thus, in this example,
the first three bytes of the IP address specifies the "network" whereas the last byte specifies the
specific interface on a network.
Now suppose that host 111.111.111.111 wants to send an IP datagram to host 222.222.222.222. The
sending host passes the datagram to its adapter, as usual. But the sending host must also indicate to
its adapter an appropriate destination LAN address. What LAN address should the adapter use? One
might venture to guess that the appropriate LAN address is the address of the adapter for host
222.222.222.222, namely, 49-BD-D2-C7-58-2A. This guess is, however, wrong. If the sending
adapter were to use that LAN address, then none of the adapters on LAN 1 would bother to pass the
IP datagram up to its network layer; the datagram would just die.
If we look carefully at Figure 4, we see that in order for a datagram to go from 111.111.111.111 to a
node on LAN 2, the datagram must first be sent to the router interface 111.111.111.110. Thus, the
appropriate LAN address for the frame is the address of the adapter for router interface
111.111.111.110, namely, E6-E9-00-17-BB-4B. How does the sending host acquire the LAN
address of 111.111.111.110? By using ARP, of course! Once the sending adapter has this LAN
address, it creates a frame and sends the frame into LAN 1. The router adapter on LAN 1 sees that
the data link frame is addressed to it, and therefore passes the frame to the network layer of the
router. The IP datagram has successfully been moved from source host to the router! But we are not
done. We still have to move the datagram from the router to the destination! The router now has to
determine the correct interface on which the datagram is to be forwarded. This is done by consulting
a routing table in the router. The routing table tells the router that the datagram is to be forwarded
router interface 222.222.222.220. This interface then passes the datagram to its adapter, which
encapsulates the datagram in a new frame and sends the frame into LAN 2. This time, the
destination LAN address of the frame is indeed the LAN address of the ultimate destination. And
how does the router obtain this destination LAN address? From ARP, of course!
ii. A bit string given below, needs to be transmitted at the data link layer. What is the string actually
transmitted after bit stuffing? [3]
01111110 010111110001111101011110 01111110
iii. In CSMA/CD, the node senses the link/medium before it starts to transmit. Explain why collision
can still occur and what is it dependent on? [3]
When multiple nodes sense the link at the same time and find it idle, they start transmitting and collision occurs.
The possibility of collision still exists because of propagation delay; when a station sends a frame, other stations
are yet to sense that. Thus, a station may sense the medium and find it idle, only because the first bit sent by
another station has not yet been received.