First, the seven network protocol understanding
OSI |
understanding |
protocol |
Windows structure |
Application layer |
speak |
HTTP,FTP,SMTP |
Application (exe) |
Presentation layer |
Translation, writing |
ASCII |
Winsock API(dll) |
Session Layer |
Loading envelope, pre-addressed |
RPC,SQL |
SPI(dll) |
Transport Layer |
Trust |
TCP,UDP,SPX |
TDI(vxd、sys) |
Network layer |
Messenger to the post office |
IP,IPX |
NDIS(vxd、sys) |
data link layer |
The package was charged Letter |
ATM, FDDI |
NIC driver (vxd, sys) |
Physical Layer |
mail a package |
Rj45,802.3 |
NIC (vxd, sys) |
Two, TCP / IP protocol understood that four
OSI |
Corresponding to the seven |
Information form |
Application layer |
The application layer, presentation layer, session layer |
Data segment |
Transport Layer |
Transport Layer |
data pack |
Network interconnection layer |
Network layer |
Data Frame |
Host-to-network layer |
Data link layer, physical layer |
Bit |
Three, three-way handshake
TCP handshake to initiate a session by three times. Three-way handshake goal is to send and receive data segment sync. It also shows that a receivable data amount (the window size), and to establish a logical connection to another host. This three-way handshake process can be summarized as follows:
- Source host sends a synchronization flag bit (SYN) TCP segment is set. While the initial sequence number indicated in this paragraph (Initial Sequence Number, ISN). ISN is a random value over time.
- Destination host sends back the acknowledgment data segment, this segment synchronization flags (SYN) is likewise set to 1, and the acknowledge flag (ACK) is also set to 1, while confirming the target host expects to receive next data source host a sequence number field indicates Group numbers (i.e., previous data indicate that segment has been received and no error). Furthermore, this section also includes the initial sequence number of the destination host segment.
- Source host sends a return segment, with the same transmission sequence number and acknowledgment number incremented.