The Transport Layer
The Transport Layer
Chapter 6 in TanenbaumObjective: Provide end-to-end communication for applications
- In particular, the transport layer must provide delivery to a process running on a host, not just to the host machine.
- The transport layer must provide an application interface, such as the socket interface in Unix and Java
- The service may or may not be reliable (TCP vs UDP)
A message routed from one host to another is handled by network, data link, and physical layers on each router; but by transport layer only on each end.
From the transport layer's point of view, the entire network acts like a communication channel between hosts that provides packet delivery service.
From this point of view, the transport layer's job is to provide a standard interface to applications, hiding details of the network.
The transport layer is to the network layer as the data link layer is to the physical layer, and it carries out some of the same functions, such as error handling and flow control.
In general, a transport layer may provide some or all of the following services:
- process-to-process communication
- error checking
- reliable data transfer
- congestion control
Process-to-process communication
- Accomplished by both UDP and TCP using port numbers
- Each transport layer segment TPDU (transport protocol data unit) contains source and destination port numbers
- IP is host-to-host. IP packets have source and destination IP addresses
- Communication is really socket-to-socket (not process-to-process), because one socket can be shared by several processes
UDP version
- Each socket is bound to a port number
- When an incoming packet arrives, it is enqueued on that socket's queue
TCP version
- All sockets originating from the same listening socket use the same port number
- When a socket is created, it is associated (within the kernel) with its port number and the IP address and port number of the socket at the other end of the connection
- When an incoming packet arrives, its destination port number, source IP address, and source port number are used to enqueue its contents on the appropriate destination socket.
UDP -- User Datagram Protocol
Segment structure
- source port number
- destination port number
- length
- checksum
- payload
UDP adds only two services to the IP layer:
- delivery to processes/sockets/ports
- checksum
TSAP - Transport Service Access Point
TCP -- Transport Control Protocol
Characteristics- connection-oriented
- reliable
- full duplex
- point to point (no multicasting)
How can reliability be achieved in the face of
- garbled messages
- lost messages
- slow messages
- machine failure/reboot
Things to look at:
- TCP segment format
- Connection setup and tear down
- Retransmission scheme (think "sliding window")
- Congestion control