Departamento de Tecnología Electrónica Computer Networking Unit 3: Transport layer PROBLEMSAND EXERCISES Transport Layer 95
Pr1: port numbers Suppose that the client A initiates a TCP connection to a Web server whose name is S. More or less simultaneously, the client B also initiates a TCP connection to S. a) Indicate possible source and destination port number for: 1. Segments sent from A to S 2. Segments sent from B to S 3. Segments sent from S to A 4. Segments sent from S to B b) If A and B are in diferent hosts, could source port number from A to S be the same that from B to S? c) What if client process A and B are in the same host? Transport layer 2-96
Pr2: port numbers Look at the connections that the clients have initiated with the Web server and answer the questions: P1 P4 P5 P6 P2 P1P3 SP: 5775 DP: 80 S-IP: B D-IP: C Client IP: A SP: 9157 DP: 80 S-IP: A Web Server IP: C SP: 9157 DP: 80 S-IP: B client IP: B D-IP: C D-IP: C SP = Source port # DP = Destination port # S-IP = Source IP address D-IP = Destination IP address Transport Layer 2-97
Pr2: port numbers (II) What are the source and destination port number values in the segments flowing from the server back to the clients processes? What are the IP addresses (source and destination) of N_PDUs carrying these transport-layer segments? Transport Layer 3-98
Pr3: checksum UDP and TCP use 1s complement for their checksums. Suppose you have the following three 16-bit words: 1110000001010010 1101010100101111 0010101110101111 What is the 1s complement of the sum of these 16-bit words? Receiver adds the three words to the received checksum. If the result of the addition, in binary, contains some zero, the receiver realizes there is some error in some bit, is it right? Is it possible that a 1-bit error will go undetected? Propose a particular example for a non-detectable error. Transport Layer 3-99
Pr4: Channel utilization Pipeline protocols improve the performance of stop-and-wait protocols. Suppose a Tx and a Rx with a 1Gbps link, 30ms RTT, 1500 bytes PDUs and header size equal to zero (negligible size in comparison to the data size). How many data PDUs has Tx to have in-flight for channel utilization is 95%? Transport Layer 3-100
Pr5: Control over T_PDU content We have said that an application may choose UDP for a transport protocol because UDP offers finer application control (than TCP) of what data is sent in a segment and when. a) Why does an application have more control of what data is sent in a segment? b) Why does an application have more control on when the segment is sent? Transport Layer 3-101
Pr6: MSS Consider transferring an enormous file of L bytes from Host A to Host B. Assume an MSS of 536 bytes. a) What is the maximum value of L such that TCP sequence numbers are not exhausted? Recall that the TCP sequence number field has 4 bytes. Note: MSS isthemaximumsizeof userdata carriedbyany segmentin a TCP connection. In SYN segment, usingtcp options header, each TCP entity informs to the other about whichmss wantstouse. Thesmallerwillbeused. Transport Layer 3-102
Pr6: MSS (II) b) For the L you obtain in (a), find how long it takes to transmit the file. Assume that a total of 66 bytes of transport, network, and datalink header are added to each segment before the resulting packet is sent out over a 155 Mbps link. Ignore flow control and congestion control so A can pump out the segments back to back and continuously. Transporte 3-103
Pr7: seq # and ACK Host A and B are communicating over a TCP connection, and Host B has already received from A all bytes up through byte 126. Suppose Host A then sends two segments to Host B back-toback. The first and second segments contain 70 and 50 bytes of data, respectively. In the first segment, the sequence number is 127, the source port number is 302, and the destination port number is 80. Host B sends an acknowledgement whenever it receives a segment from Host A. a) In the second segment sent from Host A to B, what are the sequence number, source port number, and destination port number? b) If the first segment arrives before the second segment, in the acknowledgement of the first arriving segment, what is the acknowledgment number, the source port number, and the destination port number? Transport Layer 3-104
Pr7: seq # and ACK (II) c) If the second segment arrives before the first segment, in the acknowledgement of the first arriving segment, what is the acknowledgment number? d) Suppose the two segments sent by A arrive in order at B. The first acknowledgement is lost and the second acknowledgement arrives after the first timeout interval. Draw a timing diagram, showing these segments and all other segments and acknowledgements sent. (Assume there is no additional packet loss.) For each segment in your figure, provide the sequence number and the number of bytes of data; for each acknowledgement that you add, provide the acknowledgement number. Transport Layer 3-105
Pr8: TCP flow control 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 as high as 120 Mbps Host B can read out of its TCP receive buffer at a maximum rate of 60 Mbps. Describe the effect of TCP flowcontrol overtheratethat Application layer of A sends data through its TCP socket. Transport Layer 3-106
Pr9: estimated RTT We discussed TCP needs to estimate a value for RTT to know how long it has to wait for an ACK. To estimate the RTT, TCP uses SampleRTT values that are the time passed between a segment sending and the arrival of its ACK. However, TCP doesn t use the SampleRTT associated to the retransmitted segments. Why do you think TCP avoids measuring the SampleRTT for retransmitted segments? Transport Layer 3-107
Pr10: variables in pipelining What is the relationship between the variable SendBaseof TCP transmitter and the variable LastByteRcvd of TCP receiver? Transport Layer 3-108
Pr11: variables in pipelining What is the relationship between the variable LastByteRcvdof TCP receiver and the variable yof TCP sender? Transport Layer 3-109
Pr12: fast retransmit We saw that TCP waits until it has received three duplicate ACKs before performing a fast retransmit. When receiving three duplicate ACKs of a segment, TCP does a fast retransmit of this segment that supposes lost, without waiting for timer expires. Why do you think the TCP designers chose not to perform a fast retransmit after the first duplicate ACK for a segment is received? Transport Layer 3-110
Pr13: flow control Host A is sending an enormous file to Host B over a TCP connection. Over this connection there is never any packet loss and the timers never expire. Denote the transmission rate of the link connecting Host A to the Internet by R bps. Suppose that the process in Host A is capable of sending data into its TCP socket at a rate S bps, where S = 10 R. Further suppose that the TCP receive buffer is large enough to hold the entire file, and the send buffer can hold only one percent of the file. What would prevent the process in Host A from continuously passing data to its TCP socket at rate S bps? TCP flow control? TCP congestion control? Or something else? Elaborate. Transport Layer 3-111