05 network protocol layering

Hierarchical network model TCP / IP protocol

TCP / IP protocol is the de facto standard communications network, complex network traffic divided into multiple layers, each layer has its own responsibilities, to partition network traffic, lower layer of the upper support.

 

TCP / IP protocols are divided into four layers, including an application layer, transport layer, network layer, link layer.

 

Link layer (link layer): responsible for Ethernet, WIFI transmits the original data packet on such underlying network operating cards at this level, to identify the device on the network via the MAC address, also called a MAC layer. MAC (Media Access Control Address) address uniquely identifies a network card, the card will identify the device belongs.

Network layer (internet layer): This layer on the basis of the link layer, the MAC address substituted IP address identification device, connected to a large network of many local area networks, wide area networks.

Transport layer (transport layer): This layer above the network layer, provides a communication between the applications in this layer in order to identify the different applications on the same device, TCP / UDP will work in this layer.

The application layer (application layer): This layer over the underlying transport layer, mainly some application-oriented protocols, such as Telnet, SSH, FTP, SMTP, HTTP, MQTT like.

 

MAC layer transmission unit is a frame (Frame)

IP is a transmission unit layer packet (Packet)

TCP transport layer is a unit of segment (Segment)

HTTP layer is a transmission unit or a message packet (message)

 

TCP / UDP protocol differences

TCP is a stateful protocol, the two sides need to communicate establish a connection (three-way handshake) to send data, but also by the failure of retransmission, sending sequence, sliding windows and other technology to ensure data is not lost is not repeated, TCP protocol is one to one communication. TCP is a continuous data "byte stream" in a certain sequence.

UDP is a stateless protocol, the two sides do not need to establish a communication connection, UDP protocol best effort data, but does not guarantee that the data will be sent to the receiver, UDP-many communications, issued a distributed data packet, the order send, receive scrambled.

 

Layered OSI network model

OSI (Open System Interconnection Reference Model, Open Systems Interconnect Communication Reference Model) is a layered protocol network academic, it is just a reference. TCP / IP stack software is a pure, not the physical location of the device cables, network card, ISO theoretically more complete than the TCP / IP four-layer protocol.

 

First layer: a physical layer, the physical form of the network, such as cable, optical fiber, network cards, hubs and the like.

Second layer: data link layer, the data link layer corresponds to the TCP / IP protocol.

The third layer: The network layer corresponds to the TCP / IP Internet protocol layer.

Fourth layer: the transport layer, the transport layer corresponds to TCP / IP protocol.

Fifth layer: the session layer, the network maintains the connection state, and maintain session synchronization.

Sixth layer: the presentation layer, the data is converted to a suitable, understandable syntax and semantics.

Seventh layer: an application layer, application-specific data transmission.

 

Structure of the transmission network

 

Model mapping between ISO and TCP / IP model

 

Four load balancing

Work in the transport layer, based on characteristics of TCP / IP protocol, such as IP address, port number, etc. of load balancing backend server.

 

Seven load balancing

Work at the application layer, based on characteristics of the HTTP protocol, by parsing HTTP packets URI, host name, resource type and other information, use the appropriate policy forwarded to the back-end server load balancing.

 

to sum up

1, TCP / IP core is divided into four three-story IP and TCP, HTTP in the fourth layer.

2, ISO is divided into seven, the corresponding TCP / IP, TCP four layers, HTTP was seven.

3, HTTP using the TCP / IP protocol stack layer by layer re-packing unpacking, data transmission is achieved, each layer of the upper layer is transparent.

 

Published 28 original articles · won praise 9 · views 5564

Guess you like

Origin blog.csdn.net/rookiegan/article/details/104896989