Transport Layer: TCP Summary - header, the communication process

Protocol framework
1. The three elements of the protocol (syntax (meaning the role of each variable), semantics, timing) - protocol data unit
2. Data transmission process: three-way handshake, the communication, four wave
3. Features: stable connection (core), flow control, congestion control

Data units
for each segment: Seq (first byte number), Ack (last byte number +1), MSS- the maximum number of bytes the carrier (the Length)
considering only three communication parameters: Seq, Ack , Length.
Here Insert Picture Description
for this graph to explain added: for each communication (per RTT) may transmit a plurality of segments, particularly made to develop several traffic congestion is controlled by
--TCP pipeline mechanism: allows the sender at any moment there can be multiple have been issued but not yet confirmed the presence of the segment (greatly improved transmission efficiency). The specific amount is determined by the flow control and congestion control mechanisms.
Here Insert Picture Description

Header format parameters -TCP (syntax)
semantics embodied timing during transmission
message field that is a parameter, these parameters are used to implement the protocol functions.
1. source port, destination port number: looking for identification purposes host socket.
2. six core variables
*** Seq (number), Ack (acknowledgment) ***: To establish an orderly (seq identify each byte, segment), reliability (Ack acknowledgment mechanism)
rwnd (receive window), CWnd (congestion window) : by the receiver buffer / sender identification of network congestion, a transmission rate - flow control, congestion control,
the SYN, the FIN : establishment, disconnect TCP connection (SYN = 1, FIN = 1 )

Here Insert Picture Description
Communication process
TCP connection: three-way handshake (on SYN, SEQ, ACK three state variables)
1.SYN segment (two variables): SYN = 1, SEQ client initial (random)
2.SYNACK segment (three variables): SYN = 1, the server initial sequence number, acknowledgment number + 1 = initial number of the client
after receiving the SYN segment to the server cache the TCP connection is assigned, the variable and socket interface.
3. The client acknowledges (three variables): SYN = 0, ID = +1 client server initial sequence number, acknowledgment number of the initial sequence number + 1 + server
after receiving the SYNACK segment connecting the client cache assigned to the TCP, the variables and socket interface. After each segment in SYN = 0.
Here Insert Picture Description
First:
Client - -> Server At this point the server knows the client to establish a connection to the
second:
Client <- this time the server receives a client server know - the connection request
third:
client - -> At this time, the server knows the client server received their response
to this, we can assume that the client has established a connection with the server
data transfer process:
only consider three parameters communication: Seq, Ack, Length. each segment is called a communication
connection is established, TCP protocol provides full-duplex communications services. The so-called full-duplex, meaning: at the same time in the same link, the communicating parties can write data at the same time. A relative concept, called half-duplex, namely: at the same time in the same link, data can be written only by the party.
Here Insert Picture Description
Disconnect: Four waving

  1. Client sends a termination segment FIN = segment 1, the server replies with an acknowledgment segment
  2. The server sends its own termination segment FIN = 1 segment, the client replies with a confirmation message segment

Here Insert Picture Description

Published 54 original articles · won praise 1 · views 2755

Guess you like

Origin blog.csdn.net/weixin_44682507/article/details/103212477