Presentation is loading. Please wait.

Presentation is loading. Please wait.

Transport Layer: TCP and UDP. Overview of TCP/IP protocols Comparing TCP and UDP TCP connection: establishment, data transfer, and termination Allocation.

Similar presentations


Presentation on theme: "Transport Layer: TCP and UDP. Overview of TCP/IP protocols Comparing TCP and UDP TCP connection: establishment, data transfer, and termination Allocation."— Presentation transcript:

1 Transport Layer: TCP and UDP

2 Overview of TCP/IP protocols Comparing TCP and UDP TCP connection: establishment, data transfer, and termination Allocation of port numbers Size matters: MTU, datagram, MSS, buffer Standard Internet services and applications Debugging techniques and tools

3 Overview of TCP/IP Protocols

4 Comparing TCP and UDP

5 TCP Connection: Establishment Three-way handshake

6 TCP Options Three common TCP options (sent in SYN) : MSS option: The maximum segment size that can be received 65,535 (16 bits for the widow size field in the TCP header) is the upper limit Window scale option: To allow the advertised widow size to be scaled (left-shift) 0-14 bits. MSS can thus reach up to 65,355 x 2 14 bytes Timestamp option: May be used for high-speed connections to prevent possible data corruption caused by old, delayed, or duplicated segments

7 TCP Connection: Data Transfer

8 TCP Connection: Termination Four-way handshake

9 TCP State Transition Diagram

10 TIME_WAIT State Its duration is twice the MSL (maximum segment lifetime), sometimes called 2MSL MSL may be 30 seconds, 1 minute, or 2 minutes Two reasons for the TIME_WAIT state : To implement TCP ’ s full duplex connection termination reliably To give TCP enough time to handle the loss of any of the last four segments To allow old duplicate segments to expire in the network To prevent old duplicates being misinterpreted as belonging to a new incarnation of the same connection 10

11 Illustrating the First Reason

12 Allocation of Port Numbers

13 Socket Pair 4-tuple that defines the two endpoints of a connection The local IP address, local TCP port, foreign IP address, and foreign TCP port Uniquely identifies every TCP connection on the Internet

14 A Concurrent Server Server ’ s socket pair

15 Connect Request from Client to Sever

16 TCP must look at all four elements in the socket pair to determine which endpoint receives an arriving segment

17 TCP Output and UDP Output 17

18 Size Matters Maximum IP datagrams : IPv4: 65,535; IPv6: 65,575 (without jumbo payload option) Link MTU (maximum transmission unit) : Ethernet: 1,500; FDDI: 4,325; PPP: configurable Path MTU: The smallest MTU in the path between two hosts 1,500 is the popular one today Path MTU may be asymmetric between two hosts, due to possibly different route in each direction TCP MSS (maximum segment size) It is subject to the reassembly buffer size at two hosts However, it is often the link MTU minus IP & TCP headers 18

19 Buffer Sizes and Limitations Link MTU (maximum transmission unit): Ethernet MTU: 1500 bytes, PPP MTU: configurable Path MTU: the smallest link MTU in the path, can be discovered by IPv4 DF (don ’ t fragment) bit

20 TCP Output and UDP Output

21 TCP Output The write blocks if no room in the socket send buffer The kernel will not return from the write until the final byte in the application buffer has been copied into the socket send buffer Successful return from a write only tells us that we can reuse our application buffer TCP must keep a copy of our data until it is acknowledged by the peer

22 UDP Outputs UDP socket has a send buffer size but no real buffer If application ’ s datagram > send buffer size, an error message is returned UDP need not keep a copy of our data A successful return from a write to a UDP socket tells us the datagram has been added to the data link output queue An error message will be generated if there is no room in the data link output queue

23 Standard Internet Services and Applications

24 Protocol Usage of Various Common Applications


Download ppt "Transport Layer: TCP and UDP. Overview of TCP/IP protocols Comparing TCP and UDP TCP connection: establishment, data transfer, and termination Allocation."

Similar presentations


Ads by Google