1 / 17

Transport Layer

Transport Layer. Problems with network layer services Transport layer services Addressing Connection establishment and release Flow control and buffering Multiplexing TCP and UDP Some performance guidelines.

berget
Download Presentation

Transport Layer

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Transport Layer • Problems with network layer services • Transport layer services • Addressing • Connection establishment and release • Flow control and buffering • Multiplexing • TCP and UDP • Some performance guidelines 1 Ying-Dar Lin@CIS.NCTU

  2. Problems with Network Layer Services • Data corruption (while stored in node memory) • Packet loss (due to node failure) • Duplicate packets (if ACK is lost) • Virtual channel loss • Out of sequence • Congestion Note: Some of the problems exist also at the link level. The problems here are end-to-end and more difficult to resolve due to large delay. 2 Ying-Dar Lin@CIS.NCTU

  3. Transport Layer Services • Error, loss, duplicate detection and recovery (by software checksum and message ID) • Sequencing and flow control (by sliding window protocol) • Connection establishment and release (by 3-way handshake) • Multiplexing (upward or downward) 3 Ying-Dar Lin@CIS.NCTU

  4. Primitives of Transport Services socket primitives for TCP 4 Ying-Dar Lin@CIS.NCTU

  5. Addressing • TSAP (Transport Service Access Point) -- e.g. (IP addr, local port) in Internet NSAP (Network Service Access Point) -- e.g. IP addr in Internet • Three alternative schemes to address TSAP: 1. stable well-known TSAP addresses for common services (server processes attach themselves to well-known ports) 2. process server that acts as a proxy for less-heavily used servers (listens to a set of ports to wait for connection request, spawns off process to serve the client, goes back to listen for new requests) 3. name server that new services register to (listens to a well-known TSAP, responds the TSAP of requested service) 5 Ying-Dar Lin@CIS.NCTU

  6. Connection Establishment and Release • Problems of delayed duplicates • Three-way handshake: both sides do not have to start with the same sequence number host 1 host 2 host 1 host 2 host 1 host 2 host 1 host 2 CR (seq=x) delayed duplicate DR DR CR (seq=x) ACK (seq=y, ACK=x) DR lost ACK DR ACK (seq=y, ACK=x) ACK ACK DATA (seq=x, ACK=y) REJECT (ACK=y) lost timeout release connection normal operation delayed duplicate normal operation 6 Ying-Dar Lin@CIS.NCTU

  7. Flow Control and Buffering • Source buffering (for low-bandwidth bursty traffic) vs. destination buffering (for high bandwidth smooth traffic) • Two potential bottlenecks: • receive buffer space • subnet capacity • Dynamic sliding window flow control: • measure capacity c TPDUs/sec and cycle time r • compute window size as cr • adjust frequently to track changes in the carrying capacity and cycle time 7 Ying-Dar Lin@CIS.NCTU

  8. Multiplexing layer TSAP TSAP 4 NSAP NSAP 3 2 1 to router upward multiplexing downward multiplexing 8 Ying-Dar Lin@CIS.NCTU

  9. TCP (Transmission Control Protocol)A reliable end-to-end byte stream protocol over an unreliable internetwork • socket, connection, segment • TCP header • TCP connection management • TCP transmission management and silly window syndrome • TCP dynamic window congestion control • TCP dynamic timer management • UDP: encapsulating raw IP 9 Ying-Dar Lin@CIS.NCTU

  10. TCP Socket • socket: IP+port (TSAP) • connection: (socket_source, socket_dest) full-duplex, point-to-point, byte stream • segment: two limits: 65,535 bytes network’s MTU (max transfer unit) 10 Ying-Dar Lin@CIS.NCTU

  11. TCP Header 32 Bits URG: urgent data Urgent pointer: byte offset PSH: PUSHed data (not to buffer it) RST: reset a connection SYN, ACK: (1,0)--connection request (1,1)--connection reply FIN: release a connection Window size: receiver window size Checksum: on header, data, psuedo header Options: max TCP payload (default 536 bytes) window scale factor (up to 216) NAK for selective repeat Source port Destination port Sequence number Acknowledgement number TCP header length U R G A C K P S H R S T S Y N F I N Window size Checksum Urgent pointer  Options (0 or more 32-bit words)   Data (optional)  11 Ying-Dar Lin@CIS.NCTU

  12. TCP Connection Management (START) CONNECT/SYN CLOSED host 1 host 2 CLOSE/- LISTEN/- CLOSE/- SYN (SEQ=x) SYN/SYN+ACK LISTEN RST/- SEND/SYN SYN (SEQ=y,ACK=x+1) SYN RCVD SYN SENT SYN/SYN +ACK (simultaneous open) (Data transfer stage) ACK/- SYN + ACK/ACK (step 3 of the three-way handshake) SYN (SEQ=x+1,ACK=y+1) ESTABLISHED CLOSE/FIN CLOSE/FIN FIN/ACK Connection establishment (Active close) (Passive Close) CLOSING FIN/ACK FIN WAIT 1 CLOSED WAIT ACK/- ACK/- FIN+ACK/ACK TIMED WAIT CLOSE/FIN FIN WAIT 1 LAST ACK FIN/ACK (Timeout/) CLOSED ACK/- (Go back to start) 12 Ying-Dar Lin@CIS.NCTU

  13. TCP Transmission Management and Silly Window Syndrome • Example: a TELNET TCP connection to an interactive editor 1. Sourcedest: 21-byte TCP data segment (41-byte IP datagram) 2. Sourcedest: acknowledgement segment (40-byte) 3. Sourcedest: window update segment (40-byte)(after editor reads the byte) 4. Sourcedest: echo segment (41-byte) (after editor processes the byted) 5. Repeat step 1, 162 bytes in 4 segments for each character types!! • Silly window syndrome: frequent but mall window updates 1. sending application to TCP one byte at a time 2. receiving application sucks the data up from TCP one byte at a time • Nagle’s algorithm to solve 1: When data come into the sender one byte at a time, just send the first byte and buffer all the rest until the outstanding byte is acked. • Clark’s algorithm to solve 2: The receiver should not send a window update until it can handle the max segment size it advitised when conn. was established, or its buffer is half empty, whichever is smaller. 13 Ying-Dar Lin@CIS.NCTU

  14. TCP Dynamic Window Congestion Control • Two limits: network capacity  congestion window receiver capacity  receiver window #bytes that may be sent: min(congestion window, receiver window) • Dynamic window control: 1. Initialization: congestion windowone maximum segment threshold64KB 2. Slow start: exponential up to threshold congestion windowcongestion window + one max segment size for each acked segment (Each successful acked burst doubles congestion window) 3. Congestion avoidance: linearly up to receiver window congestion windowcongestion window + one max segment size for each acked burst 14 Ying-Dar Lin@CIS.NCTU

  15. TCP Congestion Window Timeout 44 40 36 32 28 24 20 16 12 8 4 Threshold Congestion window (kilobytes) Threshold 2 4 6 8 10 12 14 16 18 20 22 24 Transmission number 15 Ying-Dar Lin@CIS.NCTU

  16. TCP Dynamic Timer Management • Retransmission timer: RTT=RTT + (1-)M (M: measured round-trip delay, ~7/8) D=D + (1-) |RTT-M| Timeout=RTT+4*D • Persistent timer: prevent deadlock due to lost window update • Keepalive timer: for idle connections, controversial! • Close timer: for timed wait state while closing a connection double the max packet lifetime (2*120 sec) 16 Ying-Dar Lin@CIS.NCTU

  17. Design Guidelines at Transport Layer • CPU speed is more important than network speed • Reduce packet count to reduce software overhead • Minimize context switching • Minimize copying • You can buy more bandwidth but not lower delay • Avoiding congestion is better than recovering from it • Avoid timeouts • Speed up TPDU processing 17 Ying-Dar Lin@CIS.NCTU

More Related