Computer Network (2012 Spring) Homework Answer Chapter2 Question 6 Suppose the following sequence of bits arrives over a link: 1101011111010111110010111110110 Show the resulting frame after any stuffed bits have been removed. Indicate any errors that might have been introduced into the frame. The frame Flag of HDLC or PPP protocol is 01111110. Bit stuffing is used to identify the start or the end of a frame by inserting additional 0. If there are five consecutive 1, the sender will insert one 0 as stuffed bit. If the receiver gets seven consecutive 1, there must be an error of the end of frame (EOF). We indicate the 0 after five 1s with red color. Received sequence: 1101011111010111110010111110110 Removing stuffed 0: 1101011111^1011111^01011111^110 There is no seven consecutive 1 not interrupted by stuffed 0, so the receiver does not detect any error. Question 18 Suppose we want to transmit the message 11001001 and protect it from errors using the CRC polynomial x 3 + 1. (a) Use polynomial long division to determine the message that should be transmitted. (b) Suppose the leftmost bit of the message is inverted due to noise on the transmission link. What is the result of the receiver s CRC calculation? How does the receiver know that an error has occurred? (a) The original message is M=11001001 The CRC polynomial is C(x)=x 3 +1, which is in order of 3, C=1001 Then we append 000 to M, and get T=11001001000, Divide T by C, 1 / 6
Dept. of Electronics and Information Eng., Huazhong University of Science and Technology The quotient is 11010011, the remainder is R=011 What hat we transmit is the M with R appended, i.e., 11001001011 (b) The received message is T =01001001011 =01001001011 The CRC polynomial C=1001 Then we divide T by C, The quotient is 01000001, the remainder is 010 010. Since the T is not exactly divisible by C, i.e, the remainder is not zero, from this CRC calculation result, the receiver can know there must be some error in the received message. Question 24 Suppose you are designing a sliding window protocol for a 1-Mbps point-to-point link to the moon, which has a one-way way latency of 1.25 seconds. Assuming that each frame carries 1 KB of data, what is the minimum number of bits you need for the sequence number? The he bandwidth x delay product is 1Mbps * ( 2 * 1.25 sec) = 2.5Mb = 312500 Byte This equals to 312500B / 1024 (B/pkt) = 305.2 pkt The he sliding window should be larger than 305 packets, and the resulting sequence number 2/6
range should be twice, i.e., 610 packets. Since 2 9 < 610 < 2 10, then at least 10 bits are required to indicate the sequence number. Question 29 Give some details of how you might augment the sliding window protocol with flow control by having ACKs carry additional information that reduces the SWS as the receiver runs out of buffer space. Illustrate your protocol with a timeline for a transmission; assume the initial SWS and RWS are 4, the link speed is instantaneous, and the receiver can free buffers at the rate of one per second (i.e., the receiver is the bottleneck). Show what happens at T = 0, T = 1,..., T = 4 seconds. We assume ACKs carry an additional variable k, which indicate the available buffer space of the receiver. After receiving k, the sender can use it as the maximum sending SWSS (sliding window size). If k = 0, the sender will stop. In this case, the sending rate in the sender side is controlled by the available buffer size in the receiver side, realizing the function of flow control. T=0, Sender sends Frame1-Frame4. In short order, ACK1...ACK4 are received. Sender set SWS to 3, 2, 1, and 0 respectively. T=1, Receiver frees first buffer; sends ACK4/k=1. Sender slides window forward and sendss Frame5. Receiver sends ACK5/k=0. T=2, Receiver frees second buffer; sends ACK5/k=1. Sender sends Frame6; receiver sends ACK6/k=0. 3 / 6
T=3, Receiver frees third buffer; sends ACK6/k=1. Sender sends Frame7; receiver sends ACK7/k=0. T=4, Receiver frees fouth buffer; sends ACK7/k=1. Sender sends Frame8; receiver sends ACK8/k=0. Question 35 Suppose that we run the sliding window algorithm with SWS = 5 and RWS = 3, and no out-of-order arrivals. (a) Find the smallest value for MaxSeqNum. You may assume that it suffices to find the smallest MaxSeqNum such that if DATA[MaxSeqNum] is in the receive window, then DATA[0] can no longer arrive. (b) Give an example showing that MaxSeqNum 1 is not sufficient. (c) State a general rule for the minimum MaxSeqNum in terms of SWS and RWS. (a) The smallest value for MaxSeqNum is 8. Proof: We assume DATA[8] is in the receive window, since RWS = 3, then the earliest possible receive window is { DATA[6], DATA[7], DATA[8] }. ௨旐 Then ACK[6] has been sent by the receiver. ௨旐 Then ACK[6] has been received by the sender. ௨旐 Then DATA[5] has been sent by the receiver. ௨旐 Since SWS = 5, then the earliest possible send window is {DATA[1],DATA[2],,DATA[5]} ௨旐 Since no-out-of-order arrival, DATA[0] can no longer arrive. (b) MaxSeqNum 1 = 7 is not sufficient Proof: 1. We assume the sender sends { DATA[0], DATA[1],, DATA[4] }. All arrive. 2. The receiver sends ACK[5] in response, and the receive window moves on to { DATA[5],, DATA[7]}. 3. We assume the ACK[5] is lost, then sender times out and re-transmits DATA[0]. While the receiver is expecting DATA[7]. 7 and 0 are in-distinguishable in mod MaxSeqNum calculation. So the receiver will accept DATA[0] as DATA[7], which is error. (c) MaxSeqNum SWS + RWS Question 41 The 1982 Ethernet specification allowed between any two stations up to 1500 m of coaxial cable, 4 / 6
1000 m of other point-to-point link cable, and two repeaters. Each station or repeater connects to the coaxial cable via up to 50 m of drop cable. Typical delays associated with each device are given in Table 2.7 (where c = speed of light in a vacuum = 3 10 8 m/s). What is the worst-case round-trip propagation delay, measured in bits, due to the sources listed? (This list is not complete; other sources of delay include sense time and signal rise time.) The one way delays include: 1) propagation delay in coax cable, 1500 / (0.77*3*10 8 ) = 6.49 µs 2) propagation delay in point-to-poin link, 1000 / (0.65*3*10 8 ) = 5.13 µs 3) propagation delay in drop cables, 6 * 50 / (0.65*3*10 8 ) = 1.54 µs 4) process delay in transceivers, 6 * 0.2 = 1.2 µs 5) process delay in repeaters, 2 * 0.6 = 1.2 µs So, the one-way delay is 6.49+5.13+1.54+1.2+1.2 = 15.56µs, the round-trip-time is 31.12µ µs. For 10Mbps Ethernet, one bit time is 0.1µs, then the worst-case round-trip propagation delay is 311 bits. Question 43 Suppose the round-trip propagation delay for Ethernet is 46.4 µs. This yields a minimumm packet size of 512 bits (464 bits corresponding to propagation delay + 48 bits of jam signal). (a) What happens to the minimumm packet size if the delay time is held constant, and the signalling rate rises to 100 Mbps? (b) What are the drawbacks to so large a minimum packet size? (c) If compatibility were not an issue, how might the specifications be written so as to permit a smaller minimum packet size? (a) When rate rises to 100Mbps, one bit time is 0.01µs. If the delay time is held constant, then it will be 4640 bits time. Then the minimum packet size is 4640 + 48 = 4688 bits = 586 Bytes (b) This packet size is considerably larger than many higher-level packet sizes, resulting in considerable wasted bandwidth 5 / 6
(c) The minimum packet size could be smaller if maximum collision domain diameter were reduced, and if sundry other tolerances were tightened up Question44 Let A and B be two stations attempting to transmit on an Ethernet. Each has a steady queue of frames ready to send; A s frames will be numbered A1, A2, and so on, and B s similarly. Let T = 51.2 µs be the exponential backoff base unit. Suppose A and B simultaneously attempt to send frame 1, collide, and happen to choose backoff times of 0 T and 1 T, respectively, meaning A wins the race and transmits A1 while B waits. At the end of this transmission, B will attempt to retransmit B1 while A will attempt to transmit A2. These first attempts will collide, but now A backs off for either 0 T or 1 T, while B backs off for time equal to one of 0 T,..., 3 T. (a) Give the probability that A wins this second backoff race immediately after this first collision; that is, A s first choice of backoff time k 51.2 is less than B s. (b) Suppose A wins this second backoff race. A transmits A3, and when it is finished, A and B collide again as A tries to transmit A4 and B tries once more to transmit B1. Give the probability that A wins this third backoff race immediately after the first collision. (c) Give a reasonable lower bound for the probability that A wins all the remaining backoff races. (d) What then happens to the frame B1? This scenario is known as the Ethernet capture effect. We note the backoff time for A and B are k_a and k_b respectively. (a) After the first collision, k_a can be 0 or 1, k_b can be 0,1,2,3. If A choose a smaller k_a than k_b, then it will win the second backoff race. There will be totally 2*4 cases, and 5 cases satisfying k_a < k_b. As the result, the probability for A wins the second race is 5/8 (b) k_a can be any one in {0,1}, k_b can be {0,1,2,,7}. There will be totally 2*8 cases, and 13 cases satisfying k_a < k_b. As the result, the probability for A wins the second race is 13/16 (c) P(winning race 1) = 5/8 > 1/2 P(winning race 2) = 13/16 > 3/4 P(winning race i) > 1 1/2 i-1 then, P(A wins every time after 3 times) = (1-1/8)*(1-1/16)*(1-1/32)* 3/4 (d) B gives up on B1, and starts over with B2. 6 / 6