Data Segmentation and Port Management in TCP/IP
Functions of the Transport Layer
The Transport Layer allows the segmentation of data and provides the control necessary to reassemble the parts into different streams of communication. The main responsibilities to be met include:
- Tracking individual communication between applications on hosts of origin and destination.
- Data segmentation and the handling and management of each segment in application data streams.
- Identification of different applications.
Data Segmentation and Encapsulation
The protocols of the Transport Layer describe the services that segment the application layer data. This includes the necessary encapsulation of data in each section. Each section of the application requires data to be added to headers in the Transport Layer to indicate the communication with which it is associated.
Segmentation and Reassembly
Most networks have a limitation on the amount of data that can be included in a single Protocol Data Unit (PDU).
Multiplexing of Conversations
Multiplexing allows multiple applications or services to run on each network host. Each of these applications or services is assigned a known port address, so that the Transport Layer determines which application or service identifies the data.
Classification of Port Numbers
- Well-known ports (0 to 1023): These numbers are reserved for services and applications. They are usually used for applications like HTTP (Web server), POP3/SMTP (email server), and Telnet.
- Registered ports (1024 through 49151): These port numbers are assigned to user processes or applications.
- Dynamic or Private ports (49152 to 65535): Also known as ephemeral ports, these are usually assigned dynamically to client applications when initiating a connection.
Using TCP and UDP Protocols
Some applications may use both protocols. For example, the low overhead of UDP allows DNS to quickly meet several client requests. However, sometimes sending the information requested may require the reliability of TCP. In this case, the well-known port number 53 is used by both protocols for this service.
TCP Server Host Processes
Each application process running on the server is configured to use a port number, either by default or manually by the administrator. A single server cannot have two services assigned to the same port number within the same services from the Transport Layer.
UDP Server Processes and Applications
Like TCP-based applications, server applications based on UDP are assigned well-known or registered port numbers. When running these applications or processes, they accept data that matches the assigned port number.
UDP Client Processes
The UDP client process randomly selects a port number from the dynamic range of port numbers and uses it as the source port for the conversation. The destination port will usually be the well-known or registered port number assigned to the server process.