In-depth understanding of computer networks-10 Transport Layer 2

Table of contents

0. Overview of transport layer service functions

1. Transport layer addressing

(1) TSAP address allocation scheme for process servers

(2) TSAP address allocation scheme for name servers

2. Establishment of transmission connection

(1) Establishment of normal transmission connection

(2) Solutions to repeated transmission connections

3. Data transmission

4. Release of transmission connection


0. Overview of transport layer service functions

The transport layer must complete end-to-end transparent data transmission in at least two major steps:

The first is the establishment of a virtual transmission connection (connection-oriented transmission service);

Second, the source user data is transmitted to the destination along the transmission connection.

To complete the entire data transmission process, eight basic functions need to be completed:

Transport layer addressing, transport connection establishment, data transmission, transport connection release, flow control, congestion control, multiplexing and demultiplexing, crash recovery.

1. Transport layer addressing

Several issues need to be resolved:

How does the user process of the sending host know the TSAP address associated with the corresponding user process of the receiving host?

There are a large number of potential service processes on a server, but most service processes are rarely used. So having each service process actively and continuously monitor a TSAP address will obviously consume a lot of server resources.

(1) TSAP address allocation scheme for process servers

The process server solution is a type of initial connection protocol solution. It means that the process server first centrally establishes the initial transmission connection for each application process, and then transfers it to the corresponding service for formal transmission connection.

Similar to the original operators in each department, the system has been changed to unified operators and redistribution of wiring.

(2) TSAP address allocation scheme for name servers

In some special cases, some services must run independently on the process server.

Name server name server, also called directory server directory server, is what we usually call DNS service. It is also a kind of initial connection protocol scheme.

Name servers are always listening on a specific well-known server port (i.e. a regular port).

The reason why the name server knows the TSAP addresses of these well-known services is because when a new service is created, it must register with the name server and tell the name server its service name and TSAP address. The name server will record this information in its internal database and it will be available when users query it later. For example, when the DNS server is configured, the corresponding service records of this server and each server role configured on it will be added to the DNS server, and the corresponding server name and used port information will be recorded in these records.

2. Establishment of transmission connection

(1) Establishment of normal transmission connection

Establishment of normal transport connection. Does not consider factors such as network delay, subnet group storage, duplicate grouping, etc.

(1) Host A user process calls the T_CONNECT.request primitive of the transport layer and sends CR TPDU;

(2) Host B calls the T_CONNECT.indication primitive after receiving the request (the service quality may need to be reduced, and the calling parameters will include smaller throughput, longer delay, higher error rate, and lower priority level, etc.) to inform the corresponding user process that a user wants to establish a transmission connection;

(3) If the connection request is accepted, the B user entity calls the T_CONNECT.response primitive (if the service quality needs to be reduced, the parameters are similar to the indication) and sends the CC TPDU; if it is rejected (maybe the B process thinks that the source end's service quality level is too poor, Or the application layer is currently busy with work), then RJ TPDU is sent.

(4) After receiving the CC TPDU, host A calls the T_CONNECT.confirm primitive to confirm to the source user process in its own user entity that the connection has been established, and officially enters the data sending phase.

(2) Solutions to repeated transmission connections

Abnormal connection phenomena during the transmission connection establishment process:

1. Network congestion will cause the confirmation TPDU packets transmitted during the establishment process to be unable to return to the sender in time, and the initiator may need to make multiple connection attempts.

2. Subnet packet storage may also cause some TPDU packets to not arrive in time, causing the transmission connection initiator to retry multiple times. Also, if the delayed packet arrives again after a period of time, it will request the establishment of a new connection, causing the problem of repeated connections.

To solve the above problems, non-duplicate TSAP, timeout connection table, grouped TTL mechanism, and three-way handshake mechanism are usually used.

The first time: the sender sends a CR TPDU request to establish a connection;

The second time: the receiving end receives the CC TPDU and responds, announcing its initial connection sequence number in the response packet;

The third time: After receiving the response, the sender sends the first DT TPDU to confirm the initial sequence number of the receiver.

In the case of delayed repeated CR TPDU, host B still sends a confirmation, but host A checks itself and finds that it has been confirmed, so it sends an RJ TPDU.

3. Data transmission

ISO specifies two types of normal data transmission and accelerated data transmission.

涉及原语:T_DATA.request\T_DATA.indication\T_EXPEDITED_DATA.request\T_EXPEDITED_DATA.indication

TPDU involved: DT TPDU\AK TPDU\ED TPDU\EA TPDU

process:

(1) The user entity of host A calls T_DATA.request (sending accelerated data calls T_EXPEDITED_DATA.request) to instruct the transport layer protocol to start sending data. Ordinary data is sent as DT TPDU (TPDU sequence number field value is assumed to be i), accelerated data is sent as ED TPDU (sequence number field value is assumed to be m);

If the data sent is segmented, each TPDU has a sub-sequence number (in the "variable part"), and the EOT (End of Transmission) in the best data segment is set to 1, if not the last data segment. is 0.

(2) When the data reaches the B host transport layer, call T_DATA.indication (the addend data is T_EXPEDITED_DATA.indication) to indicate to the user entity that data has arrived;

(3) Host B sends an AK TPDU confirmation, in which the "Your TPDU sequence number" (YR-TU-NR) field is the sequence number of the next data or accelerated data TPDU it hopes to receive, which is equal to i+1 (addend The data is m+1), but there is no TPDU sequence number field value

4. Release of transmission connection

Divided into "symmetric release" and "asymmetric release"

Symmetric release: each independently issues a connection release request, and releases the connection only after receiving confirmation from the other party;

Asymmetric: Unilaterally terminates the connection after sending a release request, but doing so may lose the data sent by the other party.

OSI/RM transmission connection release uses a three-way handshake negotiation method, which is divided into normal release connection and abnormal release connection. There are three situations in abnormal release connection: the final confirmation TPDU is lost, the response TPDU is lost, and the response and subsequent release request DR is lost.

The release of TCP/IP uses a four-way handshake mechanism.

DR TPDU is used to request to release the connection

DC TPDU is used to confirm the release of the connection

If the last DC TPDU is lost, the final release connection request will be automatically released due to timeout.

If the other party's DR TPDU is lost, the party that initiated the connection release request will resend the DR TPDU again, requesting to release the connection.

If both the other party's DR TPDU and the DR TPDU requesting retransmission are lost, and the retransmission fails several times, the connection will be automatically released due to transmission timeout.

Guess you like

Origin blog.csdn.net/hongdi/article/details/126122891
Recommended