Computer Networks and Applications Solutions to Sample Questions on Link Layer 1) What are some of the possible services that a link-layer protocol can offer to the network layer? Which of these link-layer services have corresponding services in IP and TCP? Answer: framing: there is also framing in IP and TCP; link access; reliable delivery: there is also reliable delivery in TCP; flow control: there is also flow control in TCP; error detection: there is also error detection in IP and TCP; error correction; full duplex: TCP is also full duplex. 2) Show by a virtue of an example other than the one in Figure 5.5 of the textbook that two-dimensional parity checks can correct and detect a single bit error. Also, show an example of a double-bit error that can be detected but not corrected. Answer: Suppose we begin with the initial two-dimensional parity matrix: 0000 1111 0101 1010 With a bit error in row 2, column 3, the parity of row 2 and column 3 is now wrong in the matrix below: 0000 1101 0101 1010 Now, suppose there is a bit error in row 2, column 2 and column 3. The parity of row 2 is now correct! The parity of columns 2 and 3 is wrong, but we can't detect in which rows the error occurred! 0000 1001 0101 1010 The above example shows that a double bit error can be detected (if not corrected). 3) Consider the slotted ALOHA protocol. Assume that there are a total of N nodes and that all the nodes always have frames to transmit. Assume that each node transmits with a probability p during each slot. Computer Networks and Applications (a) We have already seen that the efficiency of slotted ALOHA is Np(1-p)N-1. Find the value of p that maximizes this expression. Answer: E ( p ) = Np(1 ! p ) N !1 Taking the derivative with respect to p, E ' ( p ) = N (1 ! p ) N !1 ! Np( N ! 1)(1 ! p ) N !2 = N (1 ! p ) N !2 ((1 ! p ) ! p( N ! 1)) E ' ( p ) = 0 ! p* = 1 N (b) Using the value of p found in (a), find the efficiency of slotted ALOHA by letting N approach infinity. Hint: (1-1/N)n approaches 1/e as N approaches infinity. Answer: 1 N ) 1 1 N !1 1 N !1 N E ( p*) = N (1 ! ) = (1 ! ) = 1 N N N 1! N 1 1 1 lim (1 ! ) N = Note that, lim (1 ! ) = 1 and N # " N #" N e N (1 ! Thus, lim E ( p*) = N "! 1 e 4) Why would the token passing protocol be inefficient if a LAN had a very large perimeter? Answer: When a node transmits a frame, the node has to wait for the frame to propagate around the entire ring before the node can release the token. Thus, if L/R is small as compared to tprop, then the protocol will be inefficient. 5) How big is the MAC address space, the IPv4 address space and the IPv6 address space? Answer: 248 MAC addresses; 232 IPv4 addresses; 2128 IPv6 addresses. 6) Why is an ARP query sent within a broadcast frame? Why is an ARP response sent within a frame with a specific destination MAC address? Computer Networks and Applications Answer: An ARP query is sent in a broadcast frame because the querying host does not which adapter address corresponds to the IP address in question. For the response, the sending node knows the adapter address to which the response should be sent, so there is no need to send a broadcast frame (which would have to be processed by all the other nodes on the LAN). 7) Suppose nodes A and B are on the same 10 Mbps Ethernet segment, and the propagation delay between the two nodes is 225 bit times. Suppose node A begins transmitting a frame and, before it finishes, node B begins transmitting a frame. Can A finish transmitting before it detects that B has transmitted? Why or why not? If the answer is yes, then A incorrectly believes that its frame was successfully transmitted without a collision. Answer: In the worst-case assume that A is transmitting the smallest possible frame of size 64 bytes (512 bits). At t = 0 A transmits. At t = 512 bit time, A would finish transmitting. In the worst case, B begins transmitting at time t = 224 bit time. At time t = 224 + 225 = 449 bit time, B 's first bit arrives at A . Because 449 < 512, A aborts before completing the transmission of the packet, as it is supposed to do. 8) Suppose that you had to design a 100 Mbps CSMA/CD protocol in which the maximum one-way propagation delay between any two hosts is 100 x 10-6 sec. What will you use as the minimum size of a transmitted frame if you wish the transmitting node to detect a collision before completing the transmission of the frame? Answer: The minimum size of the frame should be such that the transmission of a frame will take at least 2 x 100 x 10-6 sec, the round trip propagation delay. The minimum frame size therefore is 200 x 100 x 10-6 bits or 2500 bytes. 9) In CSMA/CD, after the fifth collision, what is the probability that a node chooses K=4? The result K=4 corresponds to a delay of how many seconds on a 10Mbps Ethernet? Answer: After the 5th collision, the adapter chooses from {0, 1, 2, …, 31}. The probability that it chooses 4 is 1/32. It waits 204.8 microseconds. 10) Suppose nodes A, B and C each attach to the same broadcast LAN through their adapters, If A sends thousands of IP datagrams to B with each encapsulating frame addressed to the MAC address of B, will C’s adapter process these frames? If so, will C’s adapter pass the IP datagrams in these frames to C (that is, the adapter’s parent node)? How would your answers change if A sent frames with the MAC broadcast address? Answer: C’s adapter will process the frames, but the adapter will not pass the datagrams up the protocol stack. If the LAN broadcast address is used, then C’s adapter will both process the frames and pass the datagrams up the protocol stack. Computer Networks and Applications 11) Consider a network with 6 nodes connected in a star topology (all nodes directly connect to a switch) to a central switch. Suppose that (i) A sends a frame to D, (ii) D replies with a frame to A, (iii) C sends a frame to D, (iv) D replies with a frame to C. The switch table is initially empty. Show the state of the switch table before and after each of these events. For each of these events, identify the link(s) on which the transmitted frame will be forwarded, and briefly justify your answers. Answer: Action Switch Table State Link(s) packet is forwarded to B, C, D, E, and F A sends a frame to D Switch learns interface corresponding to MAC address of A D replies with a frame to A Switch learns interface corresponding to MAC address of D A C sends a frame to D Switch learns the interface corresponding to MAC address of C D D replies with a frame to C Switch table state remains the same as before C Explanation Since switch table is empty, so switch does not know the interface corresponding to MAC address of D Since switch already knows interface corresponding to MAC address of A Since switch already knows the interface corresponding to MAC address of D Since switch already knows the interface corresponding to MAC address of C
© Copyright 2025 Paperzz