TCP header Introduction

Each TCP segment contains source and destination port numbers for originating and look for the end of the application process. This value plus the two
source IP header of the IP addresses and destination IP addresses uniquely identify a TCP connection.
Sometimes, an IP address and a port number, also known as a jack (socket). The first term appears in the TCP
specification (RFC 7 9 3), and later as it represented the Berkeley programming interface (see section 1.1. 5). Of socket (Socket
pair) (comprising client IP address, client port number, quad server IP address and the server port number) uniquely determined mutual
sides each TCP connection with the network.
Originating from the TCP sequence number is used to identify data bytes transmitted to the receiving end TCP flow, which represents the first in this segment of the
data bytes. If viewed as a stream of bytes between the two one-way flow of the application, the TCP sequence number for each byte into the
row count. Unsigned number is a 32 bit sequence number reaches 232-1 then starts at 0.
When creating a new connection, SYN flag becomes 1. The sequence number field contains the sequence of the selected initial host connection
number ISN (Initial Sequence Number). The host wants to send data to the serial number for the first byte ISN plus 1, because
the SYN flag consumes a serial number (the next chapter details how to establish and terminate the connection, then we will see FIN flag
should occupy a serial number) .
Since each byte transferred are counted, the acknowledgment number comprises sending an acknowledgment of the end of the next expected sequence number received.
Therefore, the acknowledgment number should be the last byte of data has been successfully received serial number plus one. Only the ACK flag (described below) is a 1
acknowledgment number field is valid.
Transmitting ACK without any cost, since the 32 bit acknowledgment number field and ACK flags, there is always a portion of the TCP
portion. Thus, we see once a connection is established, this field is always set, ACK flag is set always
set to 1.
TCP provides full-duplex service to the application layer. This means that data can be transmitted independently in both directions. Thus, even
contact each end of the transmission data sequence number must be maintained in each direction.
TCP can be described as a choice to confirm or deny without sliding window protocol (sliding window protocol for data transmission
in Section 20. 3 describes). We say that TCP confirm the lack of choice because TCP header acknowledgment number indicates the sender has successfully received
to bytes, but does not confirm the number of bytes included within the meaning of. The current can not confirm the selected portion of the data stream. Embodiment
, if 1 ~ 1024 bytes has been received successfully, the next segment comprises a sequence number from 2049 - 3072 bytes, the receiving end is not
able to confirm that the new message segment. It can do it is to send back an acknowledgment number of the ACK 1 0 2 5. It is also not one
be denied that segment. For example, if the received segment contains 1025 ~ 2048 bytes, but the checksum error, TCP connection
receiving end can do is to send back an acknowledgment number of the ACK 1025 . In 2 x 1.7 we will see repeated confirmation of how help
would help to establish a packet has been lost.
It gives the number of 32 bit words in the header portion of the header length. This value is required because the length optional field is variable. This
field accounted for 4 bit, and therefore a maximum of TCP header of 60 bytes. However, there is no optional field, the normal length of 20 bytes.
There are six flag bits in the TCP header. More of them may be set to 1 simultaneously. We here briefly that
their usage, are described in more detail in subsequent sections.
URG urgent pointer (u rgent pointer) effective (see Section 20. 8).
ACK acknowledgment number is valid.
PSH receiver should this segment to the application layer as soon as possible.
RST reconnection.
SYN synchronization number to initiate a connection. This flag and under a flag covered in Chapter 18.
FIN start to finish sending.
172 using TCP / IP Comments, vol 1: Protocol
download
TCP flow control is provided by each end of the connection through the window size of the statement. Window size is the number of bytes, starting
the confirmation field indicates the sequence number value, this value is expected to be received correct receiving byte. Window size is a 16 bit field,
and thus the maximum window size of 65,535 bytes. In 2 x 4.4 we will see a new window scale option, which allows this value by more than
patients varied to provide a larger window.
Inspection and covering the whole of the TCP segment: TCP header and TCP data. This is a mandatory field, it must be
calculated and stored by the originating, for verification by the receiving end. TCP checksum calculation and UDP checksum calculation is similar, using
as described in Section 11.3 of the header is a dummy.
Only when the URG flag is set to 1 urgent pointer is valid. Urgent pointer is a positive offset, and the sequence number field values
summed represents the last byte of urgent data number. Emergency mode is a TCP sender sends the data to the other end of the urgent
a method. We will introduce it in a 2-0.8.
The most common alternative is the maximum packet size field, also known as MSS (Maximum Segment Size). Each connected party
is usually reported in the first segment of communication (to establish the connection SYN flag set that segment) specified in this option. It
indicates the maximum length of the segment can receive this end. We will introduce in Section 8.4 in more detail MSS option, the other TCP
options, some covered in Chapter 2 of 4.
Figure 17--2 we note the TCP segment data part is optional. We will see in a company in Chapter 18 in
time and then establish a connection is terminated, the two sides exchanged only TCP segment header. If a party has no data to send, also
use no header data to confirm the reception of any data. In many cases, the timeout process also transmitted without any
data segment.

Guess you like

Origin www.cnblogs.com/momenglin/p/11300857.html