Transport Layer I Flashcards
To understand: • Transport layer services and protocols • Multiplexing and demultiplexing • Connectionless transport • User Datagram Protocol (UDP)
How does Transports layers work
- Transport layer protocols provide logical
communication between application processes
running on different hosts and are implemented in
the end systems but not in network routers. - On the sending side, the transport layer converts the
application layer messages into transport layer
packets (a.k.a. segments) by (possibly) breaking the
messages into smaller chunks and adding a
transport layer header. The transport layer then
passes the segment to the network layer, where the
segment is encapsulated within a network layer
packet (a.k.a. datagram) and sent to the destination
Transport layer receiving side
- On the receiving side, the network layer extracts the
transport layer segment from the datagram and
passes it up to the transport layer. The transport
layer then processes the received segment, making
the data in the segment available to the receiving
application. - Note: the network routers act only on the network
layer fields of the datagram, they do not examine the
fields of the transport-layer segment encapsulated
with the datagram.
what is the relationship between the transport layer and the
network layer
o The transport layer provides logical communication between
processes. The network layer provides logical communication
between hosts.
o The transport layer relies on the network layer and enhances
the network layer services The IP service model is a best effort
delivery service
- There are more than one transport protocols available to
applications. The Internet has two:
Transmission Control Protocol
(TCP) and User Datagram Protocol (UDP)
o UDP: unreliable, unordered delivery (no extension of IP’s best
effort)
o TCP: reliable, in-order delivery (connection set up, flow
control, congestion control)
Transport layer services to
application
- Process-Level Addressing
- Multiplexing and Demultiplexing
- Integrity checking
- Connection Management (Establishment and Termination
- Acknowledgments and Retransmissions
- Flow Control
Process-Level Addressing
o Used to differentiate between processes (applications)
o Network layer addressing identifies host
Multiplexing and Demultiplexing
o Sender side: multiplexing data from many processes for transport
o Receiver side: demultiplexing data received and directs it to appropriate procosses
Integrity checking
Error detection
Connection Management (Establishment and Termination
o If connection-oriented protocol (e.g. TCP)
Acknowledgments and Retransmissions
o If reliable service (e.g. TCP
Flow Control
o If in-order delivery service (e.g. TCP)
Multiplexing/demultiplexing
Transport layer multiplexing and demultiplexing extend the network layer’s host-to-host delivery service to process-to-process delivery for applications running on hosts. At the sending host, data chunks are collected from different sockets, encapsulated with header information, and passed to the network layer. Demultiplexing is the process of delivering the received segments to the correct socket at the destination host. Each socket has a unique identifier, which depends on whether it is a UDP or TCP socket. UDP sockets are identified by a 2-tuple of destination IP address and port number, while TCP sockets have a 4-tuple. When a TCP segment arrives from the network to a host, the host uses all four values to direct it to the appropriate socket. In contrast, TCP segments with different source IP addresses or source port numbers are directed to two different sockets.
How do web servers use port
numbers?
A web server, like Apache, operates on port 80 and sends segments to clients, with all segments having destination port 80. The server distinguishes between different clients using source IP addresses and port numbers. Each connection is spawned by a new process with its own connection socket. There is not always a one-to-one correspondence between connection sockets and processes, as web servers often use only one process and create a new thread with a new connection socket for each new client connection.
Connectionless transport: User
Datagram Protocol (UDP)
- At the very least, the transport layer has to provide a mux/demux
service in order to pass data between the network layer and the correct
application-level process. - UDP aside from the mux/demux function and some light error checking,
it adds nothing to IP. - UDP takes messages from the application process, attaches source and
destination port number fields for the mux/demux service, adds two
other small fields, and passes the resulting segment to the network
layer. - If the segment arrives at the receiving host, UDP uses the destination
port number to deliver the segment’s data to the correct application
process
UDP segment structure
- The length field specifies the number of bytes in the UDP
segment (header plus data).
o An explicit length value is needed since the size of the data
field may differ from one UDP segment to the next. - The checksum is used by the receiving host to check
whether errors have been introduced into the segment.
o At sender: treat segment contents (including header fields)
as sequence of 16-bit integers, checksum: addition (one’s
complement sum) of segment contents.
o At receiver: compute checksum of received segment, check
if computed checksum equals checksum field value