1. Main Agreement
TCP/IP corresponds to a number of protocols in the network layer, the transport layer, the application book. UDP is included, even though it is called TCP and IP.
The main application layer protocol is
HTTP HTTPS Hypertext Transfer Protocol refers to communication between the World Wide Web browser and the server
SMTP e-mail transport
FTP File Transfer
NTP is used to synchronize always in the computer
TFTP Simple File Transfer
SNMP Simple Internet Management Protocol
DHCP Dynamic Assignment IP protocol
SMTP Simple Mail Transfer Protocol
The Pop Post Office Protocol is applied to the message, and if your mail client uses pop, all messages will be downloaded once the server is connected
IMAP Internet Message Access Protocol is similar to the above, the difference is that you can first view through the client, and then decide whether to download
The primary protocol for the transport layer is
SSL is used at the transport layer to encrypt data. The simple encryption system is the public key private key system. OpenSSL is an open source software for encryption.
The main protocols of the network layer are
For the ARP Protocol Address Resolution Protocol, enter ARP-A on the Windows command line to see the address resolution in the port's cache.
Below we will take this picture as the context, analysis of the proposed various data packages
2. Brief introduction of TCP packets
The first 14 bits are the destination's MAC address, and then 24 bits are the source's MAC address
The following 0800 indicates the use of the IP protocol. The above is part of the data link layer data frame.
Now let's look at the network layer protocol .
45 of 4 means using the 4 version of the Protocol, the following 5 indicates that the IP packet header length is 20 bytes (5 4 bytes, note that the smallest head is 20 bytes) below eight bits (00) represents the service type, used in the network to determine the service type provides different priority, delay, transmission quality services. The following 16 bits represent the total length, here is 0040, that is, the network layer data volume is 64bit.
The following 16-bit identity code is specified by the sender, and the recipient is reorganized into several segments of the IP packet according to the code.
The following is a 3-bit flag bit, that is, 40 in 010 is the flag bit, the first bit is meaningless, the second bit (1) indicates that the packet cannot be segmented, and the third bit (0) indicates that this is the last fragment. ‘
Then there is the so-called segmented offset, which represents the offset of the segment across the entire packet, in the above example all 0
TTL is the longest surviving time. This is 40, which is 64. Each route is reduced by one, and if it is less than 0, it will be destroyed.
The following is the protocol value, above 06, which represents the upper layer protocol as TCP
The following 5458 is the verification of the head
The next 64 bits are the IP addresses of the sending and receiving parties
Next is the Transport Layer packet
C835 and 0050 represent the port number of the sender and receiver respectively.
3e41e664 and 00000000 are the serial number and confirmation number respectively.
The sequence number refers to the ordinal number of the first bits in the packet to be sent in the data series. Note that if the package is a SYN packet, it refers to the ordinal of the previous eight-bit byte of the sequence to be sent.
The simple narrative process, the client sends a SYN to the server, to send the data 11 22 33, first a random number (0~4g), and specify the data string of the first data is the random number +1. And the number just minus 1 as the relative value in the analysis of the time to simplify, so the first packet sent by the corresponding value should be seq=0, the server side returned Ack/syn, the server due to the presence of SYN also sent Seq=0, but sent ack=1 to accept the Syn .... In the send process, SEQ represents the sequence number of the first octal bit of data being sent in all data, and the ACK indicates the total number of data received +1
Pictures from http://blog.csdn.net/a19881029/article/details/38091243
Data offset refers to the first 4 bits of B0, which is the starting point in the TCP packet. B is 11, this represents a 32-bit word, so TCP has a header length of 44
The following 6 bits are reserved and should be zeroed
Then the next 6-bits is the important sign.
The next is the window value, which is the local cache, if this value is reduced to the limit, that is to remind the other local cannot accept more messages.
The next 16 bits are emergency pointers, in this case 0. This bit will only be processed if the Urg is placed. Identify the emergency data that is currently needed.
Finally, there are some optional information.