Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transport Layer Problems with network layer services

Similar presentations


Presentation on theme: "Transport Layer Problems with network layer services"— 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 Ying-Dar

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. Ying-Dar

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) Ying-Dar

4 Primitives of Transport Services
socket primitives for TCP Ying-Dar

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) Ying-Dar

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 Ying-Dar

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 Ying-Dar

8 Multiplexing upward multiplexing downward multiplexing 4 3 2 1
layer TSAP TSAP 4 NSAP NSAP 3 2 1 to router upward multiplexing downward multiplexing Ying-Dar

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 Ying-Dar

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) Ying-Dar

11 TCP Header     11 Ying-Dar Lin@CIS.NCTU 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) Ying-Dar

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) Ying-Dar

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. Ying-Dar

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 Ying-Dar

15 TCP Congestion Window Transmission number
Timeout Threshold Congestion window (kilobytes) Threshold Transmission number Ying-Dar

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) Ying-Dar

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 Ying-Dar


Download ppt "Transport Layer Problems with network layer services"

Similar presentations


Ads by Google