CMPE 080N Quiz #5 Solution 1. a) Source-destination IP address is not sufficient to identify communicating peers at transport layer, because multiple transport-layer peers running on the same source-destination host pair can be active at the same time. That is why there is the need to identify each active transport-layer peer uniquely. A pair of port numbers, one for each communication end-point is thus used along with the source and destination IP addresses. b) When TCP detects that a segment has been dropped, it slows down the rate of packet transmission. c) Flow control is the process of adjusting the flow of data from the sender to ensure that receiver can handle all of the incoming data. Flow control is required to prevent the sender from overflowing the receiver's buffer. Congestion control, on the other hand, tries to prevent data sources from congesting the network, i.e., injecting more traffic than what the network can handle. d) i) Connection-oriented and connectionless service differ in several ways: the former establishes a logical connection between the two communicating end points before being able to transfer data. It then can provide reliable and ordered delivery, flow and congestion control. Connectionless service does not need to establish a connection and can send data right away; however, it does not provide any of the functions provided by the connection-oriented model. TCP is an example of a connection-oriented transport protocol while UDP is an example of connectionless transport. ii) TCP is connection-oriented protocol. iii) UDP is connection-less protocol. e) i) The sequence number identifies the position in the sender's byte stream of the data in the segment. When a segment is received correctly at its destination, an acknowledgment (ACK) segment is returned to the sender. This ACK contains the sequence number of the last byte correctly received, incremented by 1. The acknowledgment acknowledges the next sequence number that is expected. If the sender does not receive an acknowledgement for a segment transmitted, the sender will time-out and re-transmit. ii) Receiver generates the acknowledgements. iii) When a data segment is sent, a timer is started. If the segment is acknowledged before the timer expires, then sender knows that the segment has been received by the receiver successfully. But if the sender doesn’t receive the acknowledgement before the timer expires then it assumes that the segment has been lost and it retransmits the segment again. This process continues until the sender gets an acknowledgement from the receiver successfully confirming the receipt of the segment. This is how TCP achieves reliability using acknowledgements. f) i) The destination address carried by the packet header is checked by the router to decide where to forward the packet. ii) Router looks up the routing table for the next hop information corresponding to the destination address. iii) If the router’s incoming packet queue is full and new packet arrives then the new packet gets dropped. 2. a) Internet protocol stack includes TCP and UDP because they serve the purpose of two different kinds of applications. TCP provides reliable, connection-oriented service. Thus it is suitable for delaytolerant applications like file transfer. But UDP is connection-less, best-effort service. But it has less overhead compared to TCP. Thus it is suitable for delay-sensitive applications like streaming audio/video. b) i) The receipt of correct acknowledgement from the receiver prevents the retransmission timer from expiring. ii) The segment is retransmitted if the timer expires. 3. a) The effective window, i.e., the number of segments that can be sent without being acknowledged is given by min(congestion window, receiver's advertised window) which in this case is 5 segments. b) When receiver receives segment with sequence number 4 without receiving segment with sequence number 3, it will send an ACK = 3 to sender asking for segment with sequence number 3. When sender receives this ACK, it will know that segment with sequence number 3 is lost and it will retransmit the segment again. c) TCP uses cumulative acknowledgements. In this case, when receiver receives segment with sequence numbers 1 and 2, it sends ACK = 3, asking for segment with sequence number 3. But this ACK gets lost. So after the retransmission timer expires at sender, sender will have to send segments with sequence numbers 1 and 2 again.