Computer Network Exam Review - Chapter 5

The scope of this chapter is 5.1, 5.3 and 5.4.

The unit of transmission at this layer is the message segment

5.1 Overview of transport layer protocols:

5.1.1 Communication between processes:

The transport layer provides communication services to the application layer above it. It belongs to the highest level of the communication-oriented part and is also the lowest level of user functions.

Shielding effect: The transport layer shields the underlying network core details (such as network topology, routing protocols used, etc.) from high-level users, so that the application process sees as if there is an end-to-end logic between the two transport layer entities. communication channel.

Channels are divided into reliable channels and unreliable channels. The scope of investigation is mainly full-duplex reliable channels using connection-oriented protocol TCP and unreliable channels connection-oriented protocol UDP, which are not examined here.

5.1.2 Two main protocols at the transport layer

Formal standards for the Internet:

User Datagram Protocol UDP

Transmission Control Protocol TCP

Transport protocol unit: The data unit transmitted by two peer transport entities during communication is called the transport protocol data unit TPDU.

The data unit protocol transmitted by TCP is the TCP segment.

The data unit protocol transmitted by UDP is UDP message or user datagram.

UDP: There is no need to establish a connection before transmitting data. After receiving the UDP packet, no confirmation is required. No reliable delivery, but a most efficient way to work.

TCP: Provides reliable, connection-oriented transport services. No broadcast or multicast services are provided. More overhead.

5.1.3 Transport layer ports

Multiplexing: Application processes can be transmitted to the IP layer (network layer) through the transport layer. Divide: After the transport layer receives the data sent to the application process from the IP layer, it must be delivered to the specified application processes respectively.

Protocol port numbers, or often simply ports, are used at the transport layer. Set the port as the abstract end point of the communication.

Software port: an abstract protocol port between protocol stack layers. It is the place where various protocol processes of the application layer interact with transport entities. Different systems can implement ports differently.

Hardware port: An interface for different hardware devices to interact.

TCP/IP transport layer port identification: The port is identified with a 16-bit port number, allowing 65,535 different port numbers. The port number only has local significance and is only used to mark each process in the application layer of this computer. In the Internet, there is no connection between the same port numbers on different computers.

Ports are divided into two categories and three types: client type and server type. The server side is divided into two categories: well-known ports (global port numbers) (IANA is responsible for allocating) and registered ports (registered with IANA). There is only one type of client port: ephemeral port (reclaimed by the system after the communication is completed)

Commonly used well-known ports:

5.3 Transmission Control Protocol TCP Overview 

5.3.1 The main features of TCP

TCP is a connection-oriented transport layer protocol that provides reliable delivery of services based on connectionless and unreliable IP network services. To this end, on the basis of IP datagram services, a series of measures to ensure reliability have been added.

The main features of TCP:

1)TCP is a connection-oriented transport layer protocol.

2) Each TCP connection can only have two endpoints, and each TCP connection can only be point-to-point (one-to-one).

3)TCP provides reliable delivery of services.

4)TCP provides full-duplex communication.

5) Oriented to byte stream

5.1) "Stream" in TCP refers to a sequence of bytes flowing into or out of a process.

5.2) Oriented to byte stream: Although the interaction between the application program and TCP is one data block at a time, TCP regards the data handed over by the application program as just a series of unstructured byte streams.

TCP stream-oriented concept: TCP does not guarantee that the data blocks received by the receiver application and the data blocks sent by the sender application have corresponding sizes. But the byte stream received by the receiving application must be exactly the same as the byte stream sent by the sending application.

TCP does not care how many packets the application process sends to the TCP cache at one time. TCP determines how many bytes a message segment should contain based on the window value given by the other party and the current network congestion level to form a TCP message segment.

TCP uses connections as the most basic abstraction. The endpoint of a TCP connection: socket or socket. Each TCP connection has two ports.

 Socket: socket = (IP address: port number) For example: (192.169.1.20: 2028)

Each TCP connection is uniquely identified by the two endpoints (ie, two sockets) at both ends of the communication: TCP connection::= {socket1, socket2} = {(IP1: port1), (IP2: port2)}

The relationship between TCP connection, IP address, and socket: TCP connection is an abstraction provided by the protocol software. The endpoint of a TCP connection is an abstract socket, i.e. (IP address:port number). There can be multiple different TCP connections to the same IP address. The same port number can also appear in multiple different TCP connections.

5.4 How reliable transmission works

IP networks provide unreliable transmission

Characteristics of ideal transmission conditions: the transmission channel does not produce errors. No matter how fast the sender sends data, the receiver always has time to process the received data.

Under ideal transmission conditions, reliable transmission can be achieved without taking any measures. However, actual networks do not have ideal transmission conditions. Some reliable transmission protocols must be used to achieve reliable transmission on unreliable transmission channels.

5.4.1 Stop waiting protocol

After each packet is sent, it stops sending and waits for confirmation from the other party. Send the next packet after receiving the confirmation. Both parties in full-duplex communication are both the sender and the receiver. Suppose only consider that A sends data, while B receives data and sends acknowledgment. Therefore A is called the sender and B is called the receiver.

1. No error conditions

2. There are two situations when errors occur:

1) B detects an error when receiving M1, discards M1, and does nothing else (does not notify A that it has received an error packet). 2) M1 is lost during transmission. At this time, B of course knows nothing and does nothing. 

In both cases, B will not send any information.

Question: How does A know whether B received M1 correctly?

Solution: Timeout and retransmit

1.A Set a timeout timer for each sent packet.

2. As long as A receives the corresponding confirmation before the timeout timer expires, it will cancel the timeout timer and continue to send the next packet M2.

3. If A does not receive B's confirmation within the time specified by the timeout timer, it will consider the packet as error or lost, and resend the packet. Acknowledgments are lost and acknowledgments are late 

Confirmation loss: If the confirmation for M1 sent by B is lost, then A will not receive the confirmation within the set timeout retransmission time, so A retransmits M1 after the timeout timer expires. Assume that B correctly receivesthe packet M1 retransmitted by A.

At this time, B should take two actions: (1) Discard this duplicate packet M1 and do not deliver it to the upper layer. (2) Send confirmation to A. 

Late acknowledgment: B's acknowledgment for packet M1 is late, so A retransmits M1 after the timeout timer expires. B will receive the duplicate M1, discard the duplicate M1, and retransmit the acknowledgment packet . A will receive duplicate confirmations. Handling of duplicate confirmations: discard . Summary of key points of the Stop Waiting Agreement:

Stop waiting : The sender only sends one packet at a time. Send the next packet after receiving the confirmation. Temporary storage : After sending a packet, the sender must temporarily store a copy of the sent packet in preparation for retransmission. Numbering : Each packet and acknowledgment sent is numbered. Timeout retransmission: The sender sets a timeout timer for each packet sent. If the timeout bit of the timeout timer is confirmed, the sender will automatically timeout and retransmit the packet. The retransmission time of the timeout timer should be longer than the average round-trip time of data in packet transmission to prevent unnecessary retransmissions. Simple, but channel utilization is too low.

In order to improve transmission efficiency: pipeline transmission. Pipeline transmission: The sender sends multiple packets consecutively before receiving an acknowledgment. 5.4.2 Continuous ARQ protocol

Sending window: The sender maintains a sending window, and packets within the sending window can be sent continuously without waiting for confirmation from the other party.

Sending window sliding: Every time the sender receives a confirmation, it slides the sending window forward by one packet position. Cumulative acknowledgment: The receiver sends an acknowledgment to the last packet that arrives in sequence, indicating that all packets up to this packet have been received correctly. Advantages and disadvantages of cumulative confirmation:

Advantages: Easy to implement, no need to retransmit even if confirmation is lost.

Disadvantages: It cannot reflect to the sender the information of all packets that the receiver has correctly received.

Guess you like

Origin blog.csdn.net/m0_53345417/article/details/130244862