EXAM 1 SOLUTION --------------- Version 1, March 18, 2004 Problem 1 (15 Points = 7 + 8) --------- a) There are three output interfaces between A and B and a total distance of 3D. Queueing can only occur at the output port of X1 since that is the only contention point. In the worst case, a pkt will have to wait an amount L/R at the output of X1 before it can begin transmission. So, for R(i) = R and D(i) = D, Tmax = 3 x (L/R + D/c') + L/R where c' = 2/3 x c. b) Consider the pkt sequence (X, Y) where X and Y are consecutive pkts. The max interval occurs for the sequence (no-delay X, delayed Y), and the min interval occurs for the sequence (delayed X, no-delay Y). So, Max { a(i) } = T + L/R Min { a(i) } = Max { T - L/R, L/R } A minimum interval of L/R when T = L/R is obvious since that occurs when pkts are sent back-to-back. The following diagram compares the two sequence situations for T > L/R with the case of (no-delay X, no-delay Y): X Y (no-delay X, no-delay Y): |<----- T ---->| (no-delay X, delayed Y): |<------ T + L/R ----->| (delayed X, no-delay Y): |<----->| T - L/R Note that the maximum additional delay due to queueing is L/R since the high-priority pkts can not be delayed except when a cross traffic pkt starts transmission before a high-priority pkt arrives to X1. Problem 2 (20 Points = 5 + 5 + 5 + 5) --------- a) 10 usec x 1 Gbps = 10,000 bits b) Lost link utilization due to small frames. Suppose the minimum frame size is 512 bits. Then, the maximum link utilization (ignoring header and interframe gaps) is 512/10,000 = 0.0512. A slot time can hold about N = 19.5 of these minimum-sized frames. In fact the smaller the minimum-sized frame, the lower the utilization might be. c) The difficulty is that the sender may see that m frames were placed on the bus without collision before it sees a noise burst, but the m frames may not make it to the receiver at all; i.e., the sender's view of the traffic is different than the receiver's view. In the worst-case a collision occurs when the receiver has buffered n small frames. The sender doesn't know how many were buffered. There are many possible approaches to dealing with this issue. 1) All-or-None: Sender: Discard all n frames. Send a jamming signal. Try again to transmit these n frames after a backoff period. Receiver: Discard all n frames. 2) Go-Back-N: Sender/Receiver use a form of GBN. But this approach is much more complex than the All-or-None approach. d) For the All-or-None approach, n frames must be marked as unsendable. In the worst-case, this could involve having to notify n processes. For the Go-Back-N approach, only the unACKed mini-frames need to be marked unsendable. Problem 3 (10 Points = 5 + 5) --------- a) This means that if there are two continuously backlogged stations, they will collide with probability 1 with no waiting. Then, one will be successful with probability 1/2 on the next attempt since W = {0,1}. Then, X and Y will collide with probability 1 again. But now both choose from W = {0,1,2,3}, and each has an equal probability of winning: Pr [ success ] = 1/4 x (3/4 + 2/4 + 1/4) = 3/8 In the old algorithm, X would begin to have a higher probability of success after each success. For example, the above probability is 5/8 in the old algorithm. b) Once X wins twice in a row without an intervening collision, we have the situation that we had before where X can capture the media. What would be better is to base the backoff counter on something that indicates that degree of contention. One such measure is the collision rate. So, perhaps decrement B if the collision rate is falling, and increment if it is rising. A simpler approach is to use the idea of p-persistence with backoff with p < 1; i.e., choose with probability p to reset the backoff counter. Problem 4 (25 Points = 7 + 7 + 4 + 7) --------- a) The sender knows that the receiver did not receive frames m, m+1, and m+2. So, it should retransmit those frames and mark the send buffer for frame m+3 as accepted. b) Let t' be the time normalized by the transmission time of a single frame: t' = t/(L/R). Consider the first 11 frames. We can begin to retransmit the 2 missing frames after the ACK for frame 2 arrives. This occurs at t' = 2a+3; i.e., 2 frame times past the solution to Homework 3, Problem 4b. The 2 extra frame times are due to the 1 extra frame drop and the fact that an ACK can't be sent until a good frame is received. At this point, the send window is full and the sender can't do anything but do the retransmissions and wait for the ACKs to start flowing again. The ACKs start flowing again at t' = (2a+3) + (2a+1) = 4a +4. The ACK for the frame 1 retransmission will be ACK(11,1). Now, the send window is empty and a new transmission period begins. So, e = (2a+1)/(4a+4) = 11/24 [*] Note that the augmented ACK really didn't do anything for us unless the sender is allowed to inflate its window. During the period [2a+3, 4a+4], the sender continued to receive ACKs but none advanced the window. c) Since we assume that packets 0, 1, (2a+1), (2a+2), etc. are dropped, a >= 1/2. But when a = 1/2, [*] still holds because we are forced to wait for the retransmission ACKs. d) If retransmissions are lost, the situation gets worse because the sender can only continue if it gets more ACKs. This can only occur if we are allowed to inflate the send window or the receiver notices that the frame rate has dropped off and sends a NAK. Problem 5 (20 Points = 5 + 15) --------- a) 10 usec = 20 usec/2 b) Looking at the big picture, the two servers will each consume 1 usec of time transmitting synchronous traffic in each token rotation. The total asynchronous traffic is 50 usec (= 10 x 5 usec) which will be sent on a FCFS basis starting with node 0 until the token becomes late. In rotation 0, nodes 0 and 1 will both transmit 1 usec of synchronous traffic and 5 usec of asynchronous traffic. Now, TTRT - 12 usec = 28 usec. This means that the next 6 nodes (nodes 2-7) will transmit asynchronously for 5 usec each. Let TRT'(n) be the measured token rotation time of node n. Now, when node 8 receives the token, TRT'(8) = 42 and the token is considered late. So, nodes 8 and 9 reset their TRT' to 0 and pass the token. When node 0 receives the token again, TTRT'(0) = 42 and the token is late. But nodes 0 and 1 are done transmitting their asynchronous traffic. So, they both transmit 1 usec of synchronous traffic. Since nodes 2-7 are done with their asynchronous traffic, they pass the token. Now, TTRT'(8) = 2 usec, and since the token is early, it transmits 5 usec of asynchronous traffic and passes the token to node 9. Since TTRT'(9) = 7 usec when node 9 gets the token, it transmits 5 usec of asynchronous traffic. Summarizing, the async finishing times for node i are: Node Fin Time (usec) ----------------------- 0 6 1 12 2 17 3 22 4 27 5 32 6 37 7 42 8 49 9 54 Here is the detailed evolution: t TTRT'(0) TTRT'(1) ---------------------------------------- 0 0 0 Early token Send 1 usec sync Send 5 usec async 6 6 6 Early token 0 Send 1 usec sync Send 5 usec async 12 12 6 Nodes 2-7 send 5 usec async 42 42 36 Late token 0 36 Send 1 usec sync 43 1 37 Early token 0 Send 1 usec sync 44 2 38 Nodes 8 and 9 send 5 usec async 54 12 48 Early token Problem 6 (10 Points = 5 + 5) --------- a) Let C be the Internet checksum. We know that if we compute the one's complement sum using all fields except the checksum, we will get comp(C), the one's complement of C. Now, if we add the checksum C to this value, we get C + comp(C). But comp(C) is obtained from C by flipping every bit. So, C+C' = 0xFFFF. b) If the count field were 16-bits and aligned on a 16-bit boundary, then all we would have to do is complement C, subtract 1, and complement the result to get the new checksum C'. That is, C' = comp( comp(C) -' 1 ) where -' is the one's complement subtraction operator. Rewriting, C' = comp( comp(C) +' 0xFFFD ) = C +' 0x0001 That is, we could just add 1 to C (using one's complement arithmetic). But since the count field is 8-bits, we need to know if it is in the high- or low-order byte. Here is a solution assuming that the count field is a positive integer: C + 0x0001, if count field is in low-order byte C' = C + 0x0100, otherwise If the count field were not necessarily a positive integer, then we would have to insure carry isolation.