UNIT IV -- TRANSPORT LAYER TABLE OF CONTENTS 4.1. Transport layer. 02 4.2. Reliable delivery service. 03 4.3. Congestion control. 05 4.4. Connection establishment.. 07 4.5. Flow control 09 4.6. Transmission control protocol 10 4.7. User datagram protocol 11
Transport Layer CHAPTER 1 The transport layer plays a very important role in the network architecture. It is the one that provides an interface for all the upper layers to use the Internet to communicate with the peer layers at the other end. It is from this layer onwards that true end-to-end communication takes place. In the sense that a transport layer on source A talks to the transport layer on the final destination B. It is not concerned with what happens on the various intermediate nodes that the packets may actually traverse through.
Reliable Delivery Service CHAPTER 2 Positive acknowledgment ( Ack ) Explicit confirmation by receiver o On cell phone, OK o But how do you know you heard correctly? TCP acknowledgments are cumulative ( I ve received everything up through sequence #N ) o With an option for acknowledging individual segments ( SACK ) Negative acknowledgment ( Nack ) Timeout I m missing the following: How might the receiver tell something s missing? Can they always do this? (Only used by TCP in implicit fashion - fast retransmit ) If haven t heard anything from receiver, send again Problem: for how long do you wait? o TCP uses function of estimated RTT Problem: what if no Ack for retransmission? o TCP (and other schemes) employs exponential back off o Double timer up to maximum - tapers off load during congestion A very different approach to reliability: send redundant data Cell phone analogy: Meet me at 3PM - repeat 3PM Forward error correction Recovers from lost data nearly immediately! But: only can cope with a limited degree of loss
And: adds load to the network (interesting tradeoff) TCP Support for Reliable Delivery Sequence numbers Used to detect missing data... and for putting the data back in order Checksum Used to detect corrupted data at the receiver leading the receiver to drop the packet No error signal sent - recovery via normal retransmission Retransmission Sender retransmits lost or corrupted data Timeout based on estimates of round-trip time (RTT) Fast retransmit algorithm for rapid retransmission
Congestion Control CHAPTER 3 Different congestion avoidance mechanisms Explicit congestion notification mechanism This kind of congestion control is used by DECbit, and Frame relay networks. The router monitors its queue length over a period of time; and when the average queue length exceeds a threshold, it identifies that the traffic is moving towards congestion. When the router detects congestion, it sets a bit (called the explicit congestion notification (ECN) bit) in the header of the packets that go through the router. If this bit is set in the packets that are going towards the destination, then it is referred to as forward notification, and it is the responsibility of the destination to inform the source that it has to reduce the rate at which it is sending packets. If this bit is set in the packets going towards the source, it is referred to as backward notification. The source then reduces the traffic it generates. Random Early Detection (RED) This scheme has been designed to indirectly use the TCP s congestion control mechanism for congestion avoidance. There is no explicit congestion notification since it is not provided for directly in the TCP or IP header. Hence, what the router does is this it monitors the queue length to detect congestion. When it finds that it is moving towards congestion, it randomly drops packets.
TCP congestion control and Avoidance Mechanisms. Congestion avoidance mechanisms Sender maintains two windows: one the receiver granted the other Congestion Window at the connection establishment- the congestion window is set to the size of the maximum segment in use on the connection Each burst acknowledged doubles the congestion window Congestion window grow exponentially This is called the Slow Start algorithm Slowstart algorithm initialize: Congwin = 1 for (each segment ACKed) Congwin++ until (loss event OR CongWin > threshold) RTT Host A Host B one segment two segments four segments time
Connection Establishment CHAPTER 4 Connection Establishment and Termination Allow each end to know that the other exists. Negotiation of optional parameters. Triggers allocation of transport entity resources by mutual agreement. Two way handshake connection establishment o Two way handshake A sends a CR, B replies with an ACK Lost CR s are handled by re-transmission Can lead to duplicate CRs Ignore duplicate CRs once connected o Lost or delayed data segments can cause connection problems Segments arriving from old connections Start segment numbers far removed from previous connection Use CR i Need ACK to include i o Three Way Handshake needed. Two way Handshake
Three way Handshake Connection Establishment Three protocol scenarios for establishing a connection using a three-way handshake. CR denotes a CONNECTION REQUEST. a) Normal operation, b) Old CONNECTION REQUEST appearing from nowhere. c) Duplicate CONNECTION REQUEST and duplicate ACK.
Flow Control CHAPTER 5 Adaptive Flow Control: One major function of a reliable transport layer protocol is to provide end-to-end flow control. TCP does this using the sliding window protocol. However, TCP s flow control mechanism differs slightly from the standard sliding window protocol in the sense that the window size of TCP is variable. Each acknowledgement from the receiver specifies the number of additional bytes the receiver is prepared to receive; i.e. it advertises its window size. The sender acts according to the receiver s advertised window size. In response to an increased window advertisement, the sender increases the size of its window and vice-versa. The receiver advertises its available buffer space as the window size. So, when the buffer is full, it advertises a window size of zero. Then, when the application reads the data from the buffer, the buffer starts becoming free, and the window size is increased. The situation is shown in the figure below.
Transmission Control Protocol CHAPTER 6 Specially designed to provide a reliable end to end byte stream over a unreliable network. The inter network differs from a single network in terms of topology and bandwidth delay packet size. TCP adapts to properties of such network. Each machine supporting TCP has TCP entity. IP layer provide no guarantee that the datagrams will be delivered so the TCP has to provide the reliability. TCP point-to-point: one sender, one receiver reliable, in-order byte steam: no message boundaries pipelined: TCP congestion and flow control set window size at the time of connection setup send & receive buffers the buffer size negotiated full duplex data: bi-directional data flow in same connection MSS: maximum segment size connection-oriented: handshaking (exchange of control messages) init s sender, receiver state before data exchange flow controlled: sender will not overwhelm receiver TCP Header
User Datagram Protocol CHAPTER 7 UDP: UDP is a simple transport protocol but it is unreliable as it is connectionless and it does not provide acknowledgement service as well as flow control. Even the error control supported is minimal. As IP is responsible for host- host communication only, Transport protocols are responsible for delivering data between the desired processes within the end hosts. The different processes within a host are identified by unique port numbers that are integers in the range of 0-65535. UDP datagram UDP formatted the messages received from higher layers as packets called as datagrams by adding the required header fields, the structure of which is given in the following figure 3.1.The UDP datagram is encapsulated in an IP datagram and is transported across the network. UDP Design Source port Total length Destination port Checksum