FIT3165/4165 Computer Networks - Topic 7A: Transport Layer Notes
Transport Layer: Transport Functions, Ports and inetd
Introduction
This lecture covers the transport layer, focusing on transport functions, ports, and the inetd daemon. The transport layer is essential for transmitting data over a network, managing session states, and controlling congestion. Ports are used for addressing applications, and inetd manages these functions.
Key Concepts:
- Functional and performance aspects of networks rely on the transport layer.
- Understanding transport layer functionality is crucial for designing, coding, and debugging networked applications.
OSI Context
The transport layer exists within the OSI (Open Systems Interconnection) and TCP/IP models. In the OSI model, it is layer 4, sitting above the network layer and below the session layer. In the TCP/IP model, it aligns with the transport layer.
The encapsulation process involves adding headers at each layer:
- Application Layer: Application data
- TCP Layer: TCP header is added, forming a TCP segment
- IP Layer: IP header is added, forming an IP datagram
- LLC Layer: LLC header is added, forming an LLC protocol data unit
- MAC Layer: MAC header and trailer are added, forming a MAC frame
Transport Layer Functions
The transport layer provides services to the upper layers, including applications or session layers. It manages transport addresses and ensures reliable data transfer through transport entities and protocols.
Transport Service Primitives:
These primitives define the operations available to the upper layers:
LISTEN: Block until a process tries to connect.CONNECT: Actively attempt to establish a connection.SEND: Send information.DATA: Data packet.RECEIVE: Block until a DATA packet arrives.DISCONNECT: Request a release of the connection.- CONNECTION REQ Primitive doesn't have a meaning.
Segments are data chunks sent by transport protocols and can be nested within packets and frames.
State Transitions for Transport Layer Protocol:
The transport layer manages connections through various states:
IDLE: Initial state.PASSIVE ESTABLISHMENT PENDING: Waiting for a connection request.ACTIVE ESTABLISHMENT PENDING: Actively trying to establish a connection.ESTABLISHED: Connection is active.PASSIVE DISCONNECT PENDINGACTIVE DISCONNECT PENDING
These states transition based on events like connection requests, acceptance, and disconnect requests.
Elements of Transport Protocols
- Addressing: Using Transport Service Access Points (TSAP), which equate to ports.
- Connection establishment: Utilizes a three-way handshake to solve issues with delayed and duplicate packets.
- Connection release
- Error control and flow control
- Multiplexing
- Crash recovery
Addressing
Transport protocols use addresses to identify endpoints. TSAPs are equivalent to ports and are used by application processes for communication. The inetd model uses a process server to manage connections.
Connection Establishment
Techniques for restricting packet lifetime include:
- Restricted network design.
- Hop counters in each packet.
- Timestamping each packet.
Networks are non-ideal, with latency, loss, and corruption. Transport protocols must reliably open and close connections despite these issues.
Three-way handshake ensures reliable connection establishment.
Connection Release
Abrupt disconnection can lead to data loss. The two-army problem illustrates the challenge of ensuring reliable communication over an unreliable channel.
Four protocol scenarios for releasing a connection include normal three-way handshake, lost final ACK, lost response, and lost subsequent DRs.
Error Control
Data link protocols protect against errors in transit, but not against corruption inside router memory. End-to-end checks using segment or packet checksums are essential (Saltzer model). Checksums are computed at the source and recomputed at the destination.
Error and Flow Control – Buffer Management
Buffer management techniques include chained fixed-size buffers, chained variable-sized buffers, and one large circular buffer per connection. Dynamic buffer allocation is also used.
Multiplexing
Multiplexing involves sharing a channel, while inverse multiplexing spreads data across multiple channels.
Crash Recovery
Different strategies for sending and receiving hosts determine the outcome of crash recovery. Strategies involve acknowledging before writing, writing before acknowledging, and retransmission policies.
Possible results:
- OK: Protocol functions correctly
- DUP: Protocol generates a duplicate message
- LOST: Protocol loses a message
Congestion Control
Congestion control aims for:
- Efficiency and power.
- Max-min fairness.
- Convergence.
Methods include regulating the sending rate and addressing wireless issues.
Desirable Bandwidth Allocation
Goodput and delay are functions of offered load. Max-min bandwidth allocation ensures fairness among flows.
Bandwidth allocation changes over time as flows start and stop.
Regulating the Sending Rate
Congestion control protocols use various signals:
- XCP: Explicit rate control (Yes, Yes).
- TCP with ECN: Congestion warning (Yes, No).
- FAST TCP: End-to-end delay (No, Yes).
- Compound TCP: Packet loss & end-to-end delay (No, Yes).
- CUBIC TCP: Packet loss (No, No).
- TCP: Packet loss (No, No).
Additive Increase Multiplicative Decrease (AIMD) is a common control law.
Wireless Issues
Wireless links introduce transmission errors, affecting congestion control. Link layer retransmission can mitigate these errors.
Ports and Port Numbers
- Port numbers distinguish between different services running over transport protocols (TCP, UDP, DCCP, SCTP).
- IANA manages port assignments.
- System Ports: 0 through 1023.
- User Ports: 1024 through 49151.
- Dynamic/Private Ports: 49152 through 65535.
Common port assignments are stored in /etc/services.
Examples:
- tcpmux: 1/tcp, 1/udp
- compressnet: 2/tcp, 2/udp, 3/tcp, 3/udp
- rje: 5/tcp, 5/udp
- echo: 7/tcp, 7/udp, 7/sctp
- discard: 9/tcp, 9/udp, 9/sctp
- systat: 11/tcp, 11/udp
- daytime: 13/tcp, 13/udp, 13/sctp
Processes - inetd
The inetd utility is an Internet super-server that listens for connections on internet sockets. It invokes the appropriate service program to handle the request, reducing system load. Configuration file: /etc/inetd.conf.
/etc/inetd.conf Example Entries:
- ftp stream tcp nowait root /usr/libexec/ftpd ftpd -l
- ftp stream tcp6 nowait root /usr/libexec/ftpd ftpd -l
- ssh stream tcp nowait root /usr/sbin/sshd sshd -i -4
/etc/protocols
Lists internet protocols and their numbers.
Examples:
- ip 0 IP
- hopopt 0 HOPOPT
- icmp 1 ICMP
- igmp 2 IGMP
- tcp 6 TCP
Reading Materials
- Tanenbaum, Feamster, Wetherall, Computer Networking, 6th Edition, Pearson Education, Chapter 6
- Stallings, Data and Computer Communications, International Edition, 10th edition, Chapter 17
- Carlo Kopp, When home is the workplace, network congestion follows, Monash Lens: https://lens.monash.edu/@technology/2020/04/03/1379973/a-road-more-travelled-network-congestion-a-consequence-of-working-from-home