In-Depth Notes on Transport Layer - UDP & TCP Protocols
Role of the Transport Layer
Establishing Communication: Creates a temporary communication session between applications.
Link Between Layers: Serves as the intermediary between the application layer and lower network layers.
Transport Layer Responsibilities
Tracking the Conversation: Monitors conversations between source and destination applications.
Segmentation: Breaks down data into manageable segments; includes headers for tracking and reassembly.
Identifying the Application: Uses port numbers to ensure correct data delivery among multiple applications.
Conversation Multiplexing
Segmenting data allows multiple communications to run concurrently on the same network.
Transport Layer Protocols
TCP (Transmission Control Protocol):
Characteristics: Reliable, ensuring all data arrives at the destination.
Overhead: Adds extra fields in the header, increasing size and potential latency.
UDP (User Datagram Protocol):
Characteristics: Unreliable, faster than TCP with less overhead.
Overhead: Minimal fields; offers best-effort data delivery.
TCP Key Features
Session Establishment: Ensures applications are ready and negotiates data traffic.
Reliable Delivery: Guarantees arrival of each segment sent from the source.
Same-Order Delivery: Uses numbering for correct data reassembly.
Flow Control: Manages the data transmission rate.
TCP Header
Components:
Source/Destination Port: Identifies applications.
Sequence Number: For reassembly of data.
Acknowledgement Number: Indicates received data.
Header Length: Size of the TCP header.
Control Bits: Functions of the TCP segment.
Window Size: Number of bytes that can be sent at once.
Checksum: For error-checking on the header and data.
Total Size: 20 Bytes.
UDP Overview
Stateless Protocol: No data tracking, reliability is managed by applications.
Header Size: Fixed length of 8 bytes.
Port Numbers
Source Port: Dynamically generated port by the sending application.
Destination Port: Indicates the requested service (e.g., Port 80 for web services).
Port Number Categories
Well-known Ports (0-1023): Reserved for standard services.
Registered Ports (1024-49151): Assigned by IANA to specific applications.
Dynamic Ports (49152-65535): Temporary port numbers assigned during communication.
Socket Pairs
Definition: Combination of source and destination port creating a unique identifier.
Example:
192.168.1.7:80enables multiple distinguishing processes.
TCP Communication Process
Three-Way Handshake:
Step 1: Client requests to establish a session.
Step 2: Server acknowledges and requests session with the client.
Step 3: Client acknowledges communication session with server.
TCP Session Termination
FIN Control Flag: Indicated in header to close a connection.
Two-Way Handshake: Uses FIN and ACK segments to close a session.
Sequence Numbers in TCP
Definition: Represents the first byte of data; facilitates tracking of segments.
Incrementing: Initial sequence number is set and incremented with transmitted data.
TCP Reliability and Flow Control
Flow Control: Regulates packet flow; adjustments made based on acknowledgments received.
Window Size Adjustments: Can change during communication based on receiver's capacity.
Congestion Avoidance: Mechanisms in place to prevent overload of network segments.
Characteristics of UDP
Not Connection-Oriented: Lack of connection establishment.
Low Overhead: No extra features for reliability, handled by applications.
Applications of TCP and UDP
TCP: Used in applications requiring reliability such as web browsers and email clients.
UDP: Best suited for applications such as live video or simple request/response mechanisms that do not require all data to arrive reliably.
While I can't include photos directly in this format, I recommend looking for visual aids that illustrate concepts from the transport layer. For example, diagrams that show the TCP three-way handshake or comparisons of TCP and UDP packet structures can greatly enhance understanding. You might find useful resources and images in networking textbooks or online educational platforms.