You are on page 1of 3

Name: ____________________________________ SP2012

HW#3 CSCI402

1. (R9) In the rdt protocols covered in class, why did we need to introduce sequence numbers? To distinguish between a new packet or the retransmission of a packet. 2. (R10) In the rdt protocols covered in class, why did we need to introduce timers? To handle lost packets. 3. In the formula for estimating the round-trip time, what is the consequence of setting equal to 1.0? The round-trip time will be equal to the sample RTT, thus completely ignoring any RTT history. This will cause the estimated RTT to be very erratic. 4. In the formula for calculating the timeout interval, what does the constant 4 represent? What would be the consequence of increasing or decreasing this constant? Why not set this constant equal to 0? The 4 represents a magnification of how much the sample RTT deviates from the estimated RTT. Increasing the value of this constant puts more emphasis on the deviation, causing the timeout to be larger; decreasing it does the opposite. Setting this constant to zero would ignore the deviation, which would set the timeout exactly equal to the estimated RTT. This eliminates any buffer, which will likely leed to premature timeouts. 5. (P1) Suppose Client A initiates a Telnet session with Server S. At about the same time, Client B also initiates a Telnet Session with Server S. Provide possible source and destination port numbers for the following: The segments sent from A to S i. src 4876 dest 23 The segments sent from B to S i. scr 5239 dest 23 The segments sent from S to A i. src 23 dest 4876 The segments sent from S to B i. src 23 dest 5239 If A and B are different hosts, is it possible that the source port number in the segments from A to S is the same as that from B to S? Yes, different hosts can have the same port number because they have different IP addresses. If A and B are the same host, is it possible that the source port number in the segments from A to S is the same as that from B to S? No, this would cause the IP address and port number to be equal, which would make it impossible to deliver the segment to the correct process. 6. (P3) UDP and TCP use 1s complement for their checksums. Suppose you have the following three 8-bit bytes sent from Host A to Host B: 01010011,

Name: ____________________________________ HW#3 CSCI402 SP2012 01010100, and 01110100. What is the checksum that will be calculated by Host A? (HINT: To calculate the checksum, add the first two bytes and then add the result to the third byte to get the sum. Finally, take the complement of the sum by flipping each bit).

When Host B receives the three bytes and the checksum, it must check for errors. It does this by adding all four bytes together (the original three bytes and the checksum). If the sum contains all ones there were no transmission errors. Assuming there were no transmission errors, show the calculations that will be performed by Host B.

00011100 +11100011 11111111

Name: ____________________________________ HW#3 CSCI402 SP2012 7. (P4) Supposed you have the following 2 bytes: 01011100 and 01010110. What is the 1s complement of the sum of these type bytes? Adding the two bytes gives 10110010. Taking the ones complement gives 01001101. Find an example where flipping one bit in each of the bytes results in the exact same 1s complement you calculated before flipping the bits. First byte = 01011110 ; second byte = 01010100. What does this example say about the reliability of the TCP/UDP checksum method of detecting errors? The checksum is not always reliable. Some errors will go undetected: the data suggests that, on average, between one packet in 10 billion and one packet in a few millions will have an error that goes undetected (see When The CRC and TCP Checksum Disagree, which is posted on Canvas). The best way to address this is to add application layer error detection. 8. (P25) Host A and B are directly connected with a 100 Mbps link. There is one TCP connection between the two hosts, and Host A is sending to Host B an enormous file over this connection. Host A can send its application data into its TCP socket at a rate of 100 Mbps but host B can only read the data out of its TCP receive buffer at a rate of 60 Mbps. Describe how TCP flow control will moderate this transmission. When the transmission is complete, what will be the average transfer rate of the file (explain your answer)? Host A will start-off transmitting at 100 Mbps. When Bs buffer is full, it will use flow control to slow A down. From this point forward, flow control ensures that As transmission rate will not exceed 60 Mbps. Ignoring the initial burst that fills up Bs buffer, the rate will be very close to, and not more than, 60 Mbps.

You might also like