OSI 7-layer network model
The seven-layer architecture of a network is categorized from bottom to top as: physical layer, data link layer, network layer, transport layer, session layer, representation layer, and application layer.
- Physical layer mainly defines the physical device standards, its main role is to transmit the bit stream, the specific approach is to transmit at the sending end of the 1,0 code into the strength of the current to transmit, after reaching the destination and then convert the current according to the strength of the 1,0 code, that is, we often say analog-to-digital conversion and digital-to-analog conversion, this layer of data is called a bit.
- The data link layer is mainly used for parsing and encapsulating MAC addresses in data packets. The data in this layer is called data frame. The devices that work at this layer are network cards, bridges, and switches.
- The network layer is mainly used for encapsulating and parsing IP addresses in packets, and the data at this layer is called a packet. Devices working at this layer are routers, switches, firewalls, etc.
- The transport layer defines the protocols and port numbers for transmitting data and is mainly used for segmentation, transmission and reorganization of data. The protocols that work in this layer are TCP and UDP, etc. TCP is a transmission control protocol with low transmission efficiency and high reliability, and is used for transmitting data with high reliability requirements and small data volumes, such as for Alipay transfers using TCP. UDP is a user datagram protocol with the opposite characteristics of TCP, and is used for transmitting data with low reliability requirements and large data volumes, such as for video services such as Jitterbug. UDP is the user datagram protocol, which is the opposite of TCP, and is used for transmitting large amounts of data with low reliability requirements.
- The session layer establishes connections and performs access validation and session management on the basis of the transport layer, specifically including login authentication, disconnection, data sticking and packet splitting, and so on. Devices need to recognize each other either by IP address, MAC address or host name.
- The representation layer mainly encodes, decodes, encrypts, decrypts, compresses, decompresses, etc. the received data, i.e., it converts the content that can be recognized by the computer into content that can be recognized by adults (pictures, sound, text, etc.). The application layer builds specific applications based on the network, such as FTP file uploading and downloading service, Telnet service, HTTP service, DNS service, SNMP mail service, etc.
TCP/IP four-layer network model
TCP/IP does not refer to TCP and IP together, but to the entire TCP/IP family of the Internet. In terms of the protocol layering model, TCP/IP consists of four layers, from bottom to top: the network interface layer, the network layer, the transport layer, and the application layer.
- Network Interface Layer: Defines the protocols for network communication between hosts, specifically including Ethernet, FDDI, ATM and other communication protocols.
- Network Layer: Mainly used for data transmission, routing and address resolution to ensure that hosts can send data to any destination on the network. As data travels through the network, the order in which it is sent and arrives may change. IP and Address Resolution Protocol (ARP) are used at the network layer
- Transport Layer: Enables peer entities on the source and destination machines to communicate with each other based on sessions. Two end-to-end protocols, TCP and UDP, are defined in this layer.TCP is a connection-oriented protocol that provides reliable message transmission and connectivity services to upper-layer applications.In addition to basic data transmission, it also has features such as reliability assurance, flow control, multiplexing, priority, and security control.UDP is a connectionless, unreliable-transport oriented protocol that is mainly used for applications that don't need features such as reliability assurance and flow control similar to those of TCP. UDP is a protocol for connectionless, unreliable transport and is mainly used for applications that do not require TCP-like features such as reliability assurance and flow control.
- Application Layer: Responsible for the definition of specific application layer protocols, including Telnet, FTP, SMTP, DNS and HTTP.