The transport layer includes two protocols:
- Transmission Control Protocol (TCP)
- User Datagram Protocol (UDP)
Transport Layer Responsibilities
Transport Layer Protocols
Transmission Control Protocol (TCP)
TCP provides reliability and flows control using these basic operations:
- Number and track data segments transmitted to a specific host from a specific application
- Acknowledge received data
- Retransmit any unacknowledged data after a certain amount of time
- Sequence data that might arrive in the wrong order
- Send data at an efficient rate that is acceptable by the receiver
Click Play in the figure to see how TCP segments and acknowledgments are transmitted between sender and receiver.
TCP Header
TCP Header Fields
TCP Header Field | Description |
---|---|
Source Port | A 16-bit field used to identify the source application by port number. |
Destination Port | A 16-bit field used to identify the destination application by port number. |
Sequence Number | A 32-bit field used for data reassembly purposes. |
Acknowledgment Number | A 32-bit field used to indicate that data has been received and the next byte expected from the source. |
Header Length | A 4-bit field known as ʺdata offsetʺ indicates the length of the TCP segment header. |
Reserved | A 6-bit field that is reserved for future use. |
Control bits | A 6-bit field that includes bit codes, or flags, which indicate the purpose and function of the TCP segment. |
Window size | A 16-bit field used to indicate the number of bytes that can be accepted at one time. |
Checksum | A 16-bit field used for error checking of the segment header and data. |
Urgent | A 16-bit field used to indicate if the contained data is urgent. |
User Datagram Protocol (UDP)
UDP is also known as a best-effort delivery protocol because there is no acknowledgment that the data is received at the destination. With UDP, there are no transport layer processes that inform the sender of successful delivery.
UDP is like placing a regular, nonregistered, letter in the mail. The sender of the letter is not aware of the availability of the receiver to receive the letter. Nor is the post office responsible for tracking the letter or informing the sender if the letter does not arrive at the final destination.
UDP Header
UDP Header Fields
UDP Header Field | Description |
---|---|
Source Port | A 16-bit field used to identify the source application by port number. |
Destination Port | A 16-bit field used to identify the destination application by port number. |
Length | A 16-bit field that indicates the length of the UDP datagram header. |
Checksum | A 16-bit field used for error checking of the datagram header and data. |
Socket Pairs
Together, these two sockets combine to form a socket pair: 192.168.1.5:1099, 192.168.1.7:80