5. Transport layer (1) Functions of the transport layer

Table of contents

1.1 Main functions of the transport layer

1.2 Addressing and ports of the transport layer

1.2.1 The role of the port

1.2.2Port number

1.2.3 Socket

1.3 Connectionless services and connection-oriented services


1.1 Main functions of the transport layer

  • The physical layer, data link layer and network layer jointly solve the problems faced by hosts interconnecting through heterogeneous networks and realize host-to-host communication.
  • However, the real entity of actual communication in a computer network is the process located in the hosts at both ends of the communication .
  • How to provide direct logical communication services for application processes running on different hosts is the main task of the transport layer

The functions of the transport layer are as follows :

1)

The transport layer shields the core details of the low-level network (such as network topology, routing protocols, etc.) from high-level users. It provides logical communication between processes (end-to-end communication). The network layer provides logical communication between hosts (dots). point-to-point communication).

Logical communication means that the communication between the transport layers seems to transmit data in the horizontal direction , but in fact there is no horizontal physical connection between the two transport layers. As shown below:

  • When the transport layer uses connection-oriented TCP, although the network layer is an unreliable datagram service, the transport layer still provides a reliable end-to-end communication channel equivalent to full duplex between application processes.
  • When the transport layer uses connectionless UDP, this logical communication channel is still an unreliable channel.

 2)  

  • Multiplexing means that different application processes on the sender can use the same transport layer protocol to transmit data.
  • Demultiplexing means that the transport layer of the receiver can correctly deliver the data to the destination application process after stripping off the header of the message.

3)

The transport layer also performs error detection on received messages (including header and data parts) . The network layer only checks the header of the IP datagram, not the data part for errors.

1.2 Addressing and ports of the transport layer

1.2.1 The role of the port

Processes on a computer are identified using a process identifier (PID) in a process control block (PCB). However, different operating systems use PIDs in different formats, so a unified method should be used to identify the application process of the TCP/IP system

A port is a logical (software) interface that is the service access point TSAP of the transport layer . The IP (network layer SAP) address and MAC (data link layer SAP) address identify the interfaces of the host or router, while the port identifies the application process in the host .

1.2.2Port number

The length of the port number is 16 bits, and the value range is 0~65535

 There is no relationship between the same port numbers in different hosts, nor between TCP port numbers and UDP port numbers.

Some commonly used and well-known port numbers for application processes are as follows:

1.2.3 Socket

The port number is spliced ​​to the IP address to form a socket . Sender and receiver sockets are used to identify endpoints in the network. A socket is actually a communication endpoint.

Socket Socket= (IP address: port number)

It uniquely identifies a host in the network and an application (process) on it .

1.3 Connectionless services and connection-oriented services

Connection-oriented service means that the connection must be established before the two communicating parties can communicate; during the communication process, the entire connection situation is monitored and managed in real time; after the communication is completed, the connection is released. This ensures the reliability and orderliness of services .

Connectionless service means that the communication between the communicating parties does not require the establishment of a connection first. When communication is required, information is directly sent to the network and the information is delivered on the network to the best of its ability.

The TCP/IP protocol uses two transport protocols above the IP layer :

Guess you like

Origin blog.csdn.net/weixin_74059671/article/details/128425965