Knowledge points of computer network self-examination (4)

  1. If the IP datagram carries a TCP message, the total length of the IP datagram is 845 bytes, the header length is 20 bytes, the TCP message sequence number is 20120103, and the sequence number of the next TCP message is 20120908. Try to find the length of the TCP packet header
    . The difference between the sequence numbers of the two groups of TCP packets is the TCP data size: 20120908-20120103 = 805
    Set the length of the TCP packet header to x, then 845-20 -x = 805 to
    get x = 20 bytes, that is, the length of the TCP packet header is 20 bytes
  2. The IP datagram carries a TCP message, in which the IP header length is 20 bytes, the total length byte content is hexadecimal number 04B0, and the TCP header length is 32 bytes. Find the length of the data part in the TCP data segment.
    04B0 = 1200
    20 bytes + 32 bytes = 52 bytes 1200-52 =
    1148 bytes
    The length of the data part in the TCP data segment is 1148 bytes
  3. Host A continuously sends two TCP segments to host B, the byte sequence numbers of which are 50 and 80 respectively. Assuming that the previously sent datagram has been received correctly, please answer the following questions
    (1) How many bytes of data is carried in the first segment
    30
    (2) The confirmation of host B after receiving the first segment is good How many?
    80
    (3) If the acknowledgment number played by host B after receiving the second message segment is 160, Q: How many bytes are there in the data in the second data message segment sent by A?
    80
    (4) If the first segment sent by A is lost, but the second segment arrives, BB sends a confirmation to A after the arrival of the second segment, how much should this confirmation number be?
    50
  4. Knowing that the segment structure of TCP is shown in the figure, try to mark the number of bytes occupied by the field at the sequence number and explain its purpose

Insert picture description here
(1) Source port: 16 bits, source node process port
(2) Target port: 16 bits, target node port
(3) Serial number: 32 bits, TCP numbers each byte of each application layer data
( 4) Confirmation number: 32 bits, which is the byte sequence number expected to receive data from the other party, that is, the byte corresponding to the sequence number has not been received, and the bytes before the sequence number have been
received correctly
(5) Header length: 4 bits, indicating The length of the TCP segment header is 4 bytes as the unit of calculation. The length of the TCP header is variable
(6) Window: 16 bits, used to implement TCP flow control
5. Figure 3-6 is a schematic diagram of the process of TCP establishing a connection, assuming host A The start number of the initial data segment sent by the process is 1000, and the start number of the data segment sent by the host B process is 3000. Please explain the three-way handshake process and the changes in the flag field SYN data segment serial number and response number. .

Insert picture description here
The three-way handshake situation is as follows:
at time T1, A sends a request to B to establish a connection segment, and sets the request connection identification field SYN to 1, and the segment sequence number is 1000.
At time T2, after B receives the connection request segment from A, it sends In the response segment, set the SYN to 1, the response number is 1001, and the sequence number of this segment is 3000.
At time T3, after A receives the segment that receives the connection request from B, it sends the connection confirmation segment, and the response number is 3001 , Indicating that the response segment 3000 sent by B has been received correctly.
At this point, the connection is established successfully, and A and B start to send data segments respectively. The serial numbers are 1001 and 3001, and the response numbers are 3001 and 1001, respectively.

  1. Why does TCP use a three-way handshake to establish a connection? Is it possible to use a two-way handshake? Why
    (1) TCP uses the three-way handshake to establish a connection to ensure that the two parties are fully aware of each other's status, so as to ensure reliability and establish a stable connection. At the same time, establishing a connection through the three-way handshake is also an effective way to prevent the arrival of expired, invalid, and invalid connection requests. After the arrival of invalid connection requests, resulting in the establishment of invalid connections, the three-way handshake is indispensable
    (2) The two-way handshake cannot be used, because There is data loss in the network, and the control section of the second handshake may be lost. In this way, the party that initiates the connection cannot establish the connection because it is not under the control section of the second handshake, and the party that accepts the connection establishment thinks that the connection has been established and thus becomes invalid. Connection, in addition, two-way handshake to establish a connection, it is impossible to avoid invalid connection requests.

  2. How does TCP ensure reliable data transmission
    (1) Application data is divided into data blocks that TCP considers the most suitable for sending (usually MSS), encapsulated into TCP segments, and passed to IP
    (2) When TCP sends a segment, start a timer The device waits for the destination to confirm receipt of this segment. If it cannot receive an acknowledgement in time, it is considered that the message is lost and the segment will be retransmitted. When TCP receives data from the other end of the TCP connection, it will send an acknowledgment segment.
    (3) There is no validation and field in the TCP header, which is used to detect whether an error occurs during the transmission of the data. If the received message passes the validation and detection, and an error is found, TCP will discard the message segment and do not confirm the receipt of this message segment (hoping that the sender will time out and retransmit), and will connect to the received application layer data Add 1 to the sequence number of the last byte of, as the confirmation sequence number, you want to send the sending confirmation segment.
    (4) Since TCP message segments are encapsulated in IP datagrams for transmission, and the arrival of IP datagrams may go through different paths, resulting in a disorder of order, therefore, the arrival of TCP message segments is out of order. If necessary, TCP will reorder the received data according to the sequence number, and deliver the received data to the application layer in the correct order.
    (5) Due to the network delay and retransmission mechanism, the TCP receiving end may receive more data. A repeated message segment, which is the receiving end needs to discard the repeated message segment according to the sequence number.
    (6) TCP can provide flow control. Each party of the TCP connection is established to allocate a certain size of receiving buffer space during the connection. The receiving end of TCP only allows the other end to send the data that the buffer of the receiving end can accept. This prevents the faster host from sending data too fast, causing the slower host’s buffer to overflow

  3. A TCP connection has been established between Host A and Host B. Host A sends two consecutive TCP segments to Host B, each containing a payload of 300 bytes and 500 bytes. The sequence number of the first segment is 200. After host B receives the two segments correctly, what is the confirmation serial number sent to host A?
    Answer: The confirmation serial number sent to host A is 300+500+200 = 1000

  4. A TCP connection is established between Host A and Host B, and the maximum TCP segment length is 1000 bytes. If the current congestion window of host A is 4000 bytes, host A sends the two largest segments to host B in succession, and successfully receives the confirmation of the first segment from host B, confirming the size of the receiving window announced in the segment If it is 2000 bytes, what is the maximum number of bytes that host A can continue to send to host B? The current congestion window of
    1000-byte
    host A is 4000 bytes, and host A sends 2 consecutive maximum segments to host B. The serial number of the first segment is 4000, the port value is 1000, and the serial number of the second segment is 5000, the advertised receiving window size is 2000 bytes, which means that host B has a 2000 byte free buffer at this time, that is, host B can receive 2000 bytes of data at this time, because host B has not Host A sends a second message segment for confirmation, so the two kilobyte buffer needs to reserve 1000 bytes for receiving the second message segment, that is, host A can also send to host B at this time The maximum number of bytes is only 1000 bytes

Self-motivation

People need constant encouragement, and only constant encouragement can they show themselves to the maximum. Encouragement is the motor that people move forward in the face of adversity. As long as you continue to encourage yourself, you can maintain a state of indomitable progress.

The boyfriend can’t make the girlfriend angry. The girlfriend is angry because the boyfriend is wrong. In any case, the boyfriend is wrong. If the boyfriend is wrong, he must willingly accept any punishment from the girlfriend, otherwise he will be matched with the girlfriend boyfriend. Just spit on Han, the boyfriend should make his girlfriend more happy and think more about his girlfriend, know how to pity and cherish his girlfriend, and take care of his girlfriend. To be continued. . . .

Guess you like

Origin blog.csdn.net/weixin_50001396/article/details/114231035