1 / 24

Transport Layer: TCP and UDP

Transport Layer: TCP and UDP. Transport Layer: TCP and UDP. 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

Download Presentation

Transport Layer: TCP and UDP

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: TCP and UDP

  2. Transport Layer: TCP and UDP • 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 maximumsegmentsize 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 214bytes • 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 toSever

  16. Connect Request from Client toSever 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 andApplications

  24. Protocol Usage of Various Common Applications

More Related