HW4Solutionsx

HW4Solutionsx - HW 4 Solutions. Problem 3 Note, wrap around...

Info iconThis preview shows page 1. Sign up to view the full content.

View Full Document Right Arrow Icon
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: HW 4 Solutions. Problem 3 Note, wrap around if overflow. 01010011 +01010100 10100111 10100111 +01110100 00011100 One's complement = 1 1 1 0 0 0 1 1. To detect errors, the receiver adds the four words (the three original words and the checksum). If the sum contains a zero, the receiver knows there has been an error. All one-bit errors will be detected, but two-bit errors can be undetected (e.g., if the last digit of the first word is converted to a 0 and the last digit of the second word is converted to a 1). Problem 11 The protocol would still work, since a retransmission would be what would happen if the packet received with errors has actually been lost (and from the receiver standpoint, it never knows which of these events, if either, will occur). To get at the more subtle issue behind this question, one has to allow for premature timeouts to occur. In this case, if each extra copy of the packet is ACKed and each received extra ACK causes another extra copy of the current packet to be sent, the number of times packet n is sent will increase without bound as n approaches infinity. Problem 15 ! ' & ( )' ! "! " & " ' #$ #$% $ " %& ' # Problem 19 a) Here we have a window size of N=3. Suppose the receiver has received packet k-1, and has ACKed that and all other preceeding packets. If all of these ACK's have been received by sender, then sender's window is [k, k+N-1]. Suppose next that none of the ACKs have been received at the sender. In this second case, the sender's window contains k-1 and the N packets up to and including k-1. The sender's window is thus [k-N,k-1]. By these arguments, the senders window is of size 3 and begins somewhere in the range [k-N,k]. b) If the receiver is waiting for packet k, then it has received (and ACKed) packet k-1 and the N1 packets before that. If none of those N ACKs have been yet received by the sender, then ACK messages with values of [k-N,k-1] may still be propagating back. Because the sender has sent packets [k-N, k-1], it must be the case that the sender has already received an ACK for k-N-1. Once the receiver has sent an ACK for k-N-1 it will never send an ACK that is less that k-N-1. Thus the range of in-flight ACK values can range from k-N-1 to k1. Problem 24 ( )* -++ ! , $ , &,! ' There are 232 = 4,294,967,296 possible sequence numbers. a) The sequence number does not increment by one with each segment. Rather, it increments by the number of bytes of data sent. So the size of the MSS is irrelevant -- the maximum size file that can be sent from A to B is simply the number of bytes representable by 2 32 ≈ 4.19 Gbytes . 2 32 b) The number of segments is = 8,012,999 . 66 bytes of header get added to each segment 536 giving a total of 528,857,934 bytes of header. The total number of bytes transmitted is 232 + 528,857,934 = 4.824 × 109 bytes. Thus it would take 249 seconds to transmit the file over a 155~Mbps link. Problem 25 . /1 ! /+ 0 1 / " * ! 2 $ " '!# ( ,& & , a. In the second segment from Host A to B, the sequence number is 197, source port number is 302 and destination port number is 80. b. If the first segment arrives before the second, in the acknowledgement of the first arriving segment, the acknowledgement number is 197, the source port number is 80 and the destination port number is 302. c. If the second segment arrives before the first segment, in the acknowledgement of the first arriving segment, the acknowledgement number is 127, indicating that it is still waiting for bytes 127 and onwards. d. /1 1 ! 3 51 - ! 3 51 3 /41 /1 1 ! 3 /41 Problem 29 Denote EstimatedR TT ( n ) for the estimate after the nth sample. EstimatedRTT (1) = SampleRTT1 EstimatedRTT ( 2 ) = xSampleRTT1 + (1 − x ) SampleRTT2 EstimatedRTT ( 3) = xSampleRTT1 + (1 − x )[ xSampleRTT2 + (1 − x ) SampleRTT3 ] = xSampleRTT + (1 − x ) xSampleRTT2 1 + (1 − x ) 2 SampleRTT3 EstimatedRTT ( 4 ) = xSampleRTT1 + (1 − x ) EstimatedRTT ( 3) = xSampleRTT + (1 − x ) xSampleRTT2 1 + (1 − x ) 2 xSampleRTT3 + (1 − x ) 3 SampleRTT4 b) EstimatedRTT ( n ) = x n −1 j =1 (1 − x ) j SampleRTTj + (1 − x ) n SampleRTTn c) EstimatedRTT ( ∞ ) = x 1− x ∞ j =1 (1 − x ) j SampleRTT j 1∞ j = .9 SampleRTTj 9 j =1 The weight given to past samples decays exponentially. Problem 37 )6 )6 )* $ )* ) ' ) ; / ) ; /4 2 ' // ' + $ $$ $ $ $$ $ , $ 9 /+ " , $ 9 4/ " $ ' + $ // $ $ 9 !/ , $ 9$ ' 7 +8 7/ /+8 ' 7 +8 + 9 ! ' 7 1 //8 *6: # $ $ 9 $ ...
View Full Document

Ask a homework question - tutors are online