ISO seven-layer network model

Between different computer manufacturers to make computers can communicate with each other, in order to establish a computer network within the scope of the larger, the international organization for standardization ISO in 1981 officially launched a network system structure, the OSI seven layer network model, then the computer makers quickly to it, greatly promote the development of the computer network. The seven-layer OSI network model includes the application layer, presentation layer, session layer, transport layer, network layer, data link layer, and physical layer.

1.1 the application layer

Application layer is the OSI layer closest to the user, this layer for the user’s application (such as E-mail, file transfer, and terminal emulation) provides network services, is mainly responsible for the software interface to make the program can use the Internet services, tell from the implementation, actually is to use a specific port number and specific data format encapsulates the TCP or udp, Application layer protocols are created.

1.2 the presentation layer

The presentation layer acts as a translator between the application and the network, ensuring that information sent by the application layer of one system can be read by the application layer of another system. At the presentation layer, the data is formatted in a way that the network understands, depending on the type of network being used. For example, PC program to communicate with another computer, including a computer using extended two decimal interchange code (EBCDIC), while the other is to use American standard code for information interchange (ASCII) to represent the same character, if necessary, the presentation layer will be done by using a common format conversion between multiple data formats. Some typical applications are:

  • Data decryption and encryption, such as system password processing;
  • Decode and encode images and file format information;

1.3 the session layer

The session layer is responsible for establishing, maintaining, and terminating communication between two nodes in the network. The functions of the session layer include establishing a communication connection, keeping the communication connection open during the session, synchronizing the conversation between two nodes, deciding whether the communication is interrupted and where to start the retransmission when the communication is interrupted. You may often hear the conversation layer referred to as the “traffic cop” of network communications. When dial-up requests to your ISP (Internet Service provider) to connect to the Internet, the session layer on the ISP server negotiates the connection between you and the session layer on your PC client. If your phone line accidentally falls out of the wall jack, the session layer on your terminal will detect the disconnect and reinitiate the connection.

1.4 the transport layer

The transport layer is the most important layer in the OSI seven-layer model. The transport protocol either controls the flow or sets the appropriate transmission rate based on how fast the receiver can receive the data. In addition, the transport layer forces long packets to be split according to the maximum size the network can handle. For example, if an Ethernet cannot receive a packet larger than 1500 bytes, the transport layer of the sender node splits the data into smaller pieces and assigns a sequence number to each piece so that the data can be reassembled in the correct order when it reaches the transport layer of the receiver node. This process is called sorting. One service that works at the transport layer is T C P (Transmission Control protocol) in the T C P/I P protocol suite, and another transport layer service is S P X (sequential packet switching) in the I P X/S P X protocol set.

1.5 the network layer

The network layer is used to translate network addresses into physical addresses and determine how to route data from the sender to the receiver. The network layer determines the optimal path from node A in one network to node B in another by taking into account sending priority, network congestion, quality of service, and the cost of alternative routing. The router belongs to the network layer because the network layer processes and intelligently directs data transmission, and the router connects the network segments. In a network, “routing” directs the transmission of data based on addressing schemes, usage patterns, and reachability. The network layer is responsible for establishing the routes used between the source and target machines. This layer itself does not have any error detection and correction mechanisms, so the network layer must rely on the reliable transmission of services between the ends. The network layer is used to establish communication between computer systems on top of the local LAN segment. It can do this because it has its own routing address structure, which is separate and independent from the layer 2 machine address. This protocol is called a routing or routable protocol. Routing protocols include I P, I P X of N O V E L, and A P P L E Ta L K. The network layer is optional and is used only when two computer systems are on different network segments separated by routers, or when communication applications require services, features, or capabilities provided by a certain network layer or transport layer. For example, when two hosts are directly connected on the same NETWORK segment, only the communication mechanism of L A N (OSI reference model 1 and 2) is used to communicate with each other.

1.6 Data Link Layer

The data link layer controls the communication between the network layer and the physical layer. Its main function is how to reliably transfer data over unreliable physical circuits. To ensure transmission, data received from the network layer is split into specific frames that can be transmitted by the physical layer. A frame is a structured packet used to move data. It contains not only the original data, but also the physical addresses of the sender and receiver, as well as error detection and control information. The address determines where the frame will be sent, and the error-correcting and control information ensures that the frame arrives error-free. If, during transmission, the receiving point detects an error in the transmitted data, it informs the sender to resend the frame. The functions of the data link layer are independent of the network and its nodes and the type of physical layer adopted. It also does not care whether Wo r d, E x c E L, or I n t E r n E t are used. Some connecting devices, such as switches, work at the data link layer because they decode frames and use the frame information to send data to the correct receiver. The data link layer provides reliable transmission over unreliable physical media. The functions of this layer include: physical address addressing, data framing, flow control, data error detection, retransmission and so on. Data link layer protocols include SDLC, HDLC, PPP, STP, and frame relay.

1.7 the physical

The physical layer is the lowest layer and contains physical networking media, such as cable-line connectors. Protocols at the physical layer generate and detect voltage in order to send and receive signals carrying data. By plugging a network interface card into your desktop PC, you have established the foundation for computer networking. In other words, you provide a physical layer. Although the physical layer does not provide error correction services, it can set data transmission rates and monitor data error rates. Physical network problems, such as disconnected wires, affect the physical layer. Users will use some physical media to convey information, such as twisted pair, coaxial cable, etc., but the specific physical media is not within the seven layers of the OSI, someone put physical media as 0 layer, physical layer of the task is to provide it a layer with a physical connection, and their mechanical, electrical, function and process characteristics. Such as the type of cable and connector to be used, the voltage to transmit the signal, etc. At this layer, the data has not yet been organized and is treated only as the original bitstream or electrical voltage, in bits. It defines physical device standards, such as network cable interface types, optical fiber interface types, and transmission rates of various transmission media. Its main function is to transmit bit stream (namely by 1, 0 into the current strength to carry on the transmission, after arriving at the destination in the conversion to 1, 0, that is, we often say the digital analog conversion and analog-to-digital conversion). This layer of data is called bits.

2. TCP/IP four-layer model

TCP/IP is synonymous with a set of protocols. It also includes many protocols that make up the TCP/IP protocol cluster. The TCP/IP protocol cluster is divided into four layers. IP resides at layer 2 (corresponding to OSI layer 3) and TCP resides at layer 3 (corresponding to OSI Layer 4).

2.1 Four-layer model

TCP/IP communication protocol adopts a hierarchy of four layers, each layer calls the network provided by its next layer to fulfill its needs. The four layers are:

  • Application layer: communication layer between applications, such as simple Email Transfer (SMTP), file Transfer Protocol (FTP), network remote access protocol (Telnet), etc. Responsible for network access to the application, the various processes are identified by port numbers.

  • Transport layer: In this layer, it provides data transfer services between nodes, such as transmission Control Protocol (TCP), user Datagram Protocol (UDP), etc. TCP and UDP add transmission data to the packet and transmit it to the next layer, which is responsible for transmitting the data and ensuring that the data has been delivered and received. Responsible for end-to-end communication session connection and establishment. The transmission protocol is selected according to the data transmission mode.

  • Network layer: responsible for providing basic data packet transfer functions, such as Internet protocol (IP), so that each packet can reach the destination host (without checking whether it is correctly received). Responsible for encapsulating data frames into IP datagrams and running the necessary routing algorithms.

  • Data link layer: the management of the actual network media, defining how to use the actual network (such as Ethernet, Serial Line, etc.) to transmit data, network drivers to implement the nic interface. It is responsible for converting binary streams into data frames and sending and receiving data frames.

2.2 What are the protocols of the four-layer model

Application layer {HTTP hypertext transfer protocol FTP file transfer protocol Telnet Remote login SSH security shell protocol STMP simple mail sending POP3 mail receiving transport layer {TCP transmission control protocol, UDP user data packet protocol} Network layer {IP Internet Connection protocol ICMP Network control message protocol Igmp netgroup management protocol} Data link layer {ARP address translation protocol, RARP reverse address translation protocol, MPLS multiprotocol label switching}

Some protocols are as follows: ARP (Address translation protocol) Used to obtain the addresses of hardware hosts on the same physical network. MPLS (Multi-protocol Label Switching) is a promising next generation network protocol. IP (Internet Protocol) is responsible for addressing and routing packets between the host and the network. ICMP :(network control message protocol) a protocol used to send reports about transmission errors of packets. IGMP :(network group management protocol) a protocol used by IP hosts to report host group members to local multicast routers. TCP (Transmission Control Protocol) provides a reliable communication connection for applications. Suitable for transmitting a large number of data at a time. And is suitable for applications that require the corresponding. UDP :(user packet protocol) provides connectionless communication and does not guarantee the reliability of the transmitted packets. Suitable for transmitting small amounts of data at a time.

2.3 Most Common Application-layer Protocols

Note: You can use cat /etc/services to see which application layer protocols are available and which transport layer protocols they use. Generally, we use an IP address followed by an upper port number to uniquely identify a connection: IP is used to locate the host, and port is used to identify the application (process). For example: HTTP –>80 SSH –>22 Telnet –>23 FTP –>21 Generally, the system uses the port number 1-1024, but users can use the port number 1025-65536.

From the original text:www.jianshu.com/p/8bae75a50…