OSI seven-layer network reference model

The Birth of the Seven-Layer Model

In the middle of the night, a few people sitting in an American bar were talking about the 7 dwarfs in the Disney movie. They wrote the names of the dwarfs on a napkin. Someone joked that 7 is a good number for network layering. A member of the OSI standard group, later OSI was really designed as a seven-layer model, but the seven-layer model was re-named to sound more scientific, and it was born like this.

OSI seven-layer network model

7. Application layer

The application layer is the layer we use the most, such as ajax call interface to send http requests, and domain name system DNS, mail protocol SMTP, webSocket long connection, SSH protocol

6. Presentation layer

The presentation layer mainly does several important things such as security, compression, and is also a translator of programs in the network.

1. Security Encrypt your data before it is sent, and decrypt it at the receiver's presentation layer.

2. The presentation layer also decodes and encodes image files and other formats, such as JPEG and ASCll. Images are human-readable and the computer needs to be converted into a computer-readable code.

5. Session layer

The session layer is where the communication between the sender and receiver is created, maintained, and then terminated or disconnected, somewhat similar to a phone call.

The session layer defines a mechanism that allows the sender and receiver to start or stop a request session, and to maintain the session when both parties are congested.

The session layer includes a mechanism called checkpoints  to maintain reliable sessions. A checkpoint defines a point that is closest to successful communication, and defines a point that needs to be rolled back in order to recover lost or damaged data when content loss or corruption occurs, that is, the principle of breakpoint downloading

4. Transport layer

The transport layer is mainly to define our port number, flow control, and verification.

And has two well-known protocols TCP UDP

TCP 是面向连接的协议并且TCP是可靠的

Because TCP will shake hands three times and wave four times, it is reliable, but it will slow down

UDP 具有较好的实时性 效率比TCP高

UDP does not have three handshakes and four waved hands, so it is unstable, but it is fast and often used in live broadcasts, games

3. Network layer

The network layer is the most complicated layer, where our IP is defined, 220.xxx.xxx.xxx.

This layer controls the forwarding of information between the data link layer and the transport layer, and establishes, maintains, and terminates network connections. Specifically, the data at the data link layer is converted into data packets at this layer, and then the information is transmitted from one network device to another through control of path selection, segment combination, order, in/out routing, etc.

1. Addressing: For the network layer, IP addresses are used to uniquely identify devices on the Internet, and the network layer relies on IP addresses to communicate with each other (similar to the MAC address of the data link layer)

2. Routing: Internal communication in the same network does not require network layer equipment, and mutual communication can be completed only by the data link layer. For mutual communication between different networks, three-layer equipment such as routers must be used.

Our routers work at Layer 3

At the data link layer, I said that if all users using the Internet are in the same network segment, broadcast storms will occur, so users must be divided so that they are in different network segments, and they are in their own small network segments. broadcast on the network segment. The Internet is a giant network composed of countless sub-networks.

A new set of addresses is introduced in the network layer, allowing us to distinguish between different network segments. This set of addresses is called "network address", or "URL" for short.

Therefore, after the appearance of the "network layer", each computer has two types of addresses, one is the MAC address and the other is the network address. There is no connection between the two addresses. The MAC address is bound to the network card, and the network address is assigned by the administrator. They are just randomly combined.

The network address helps us determine which subnet the computer is on, and the MAC address sends the packet to the target NIC in that subnet. Therefore, it can be inferred logically that the network address must be processed first, and then the MAC address.

In this layer, there is a protocol that specifies network addresses, called the IP protocol, and the addresses defined by it are called IP addresses. Currently, the fourth version of the IP protocol, referred to as IPv4, is widely used. This version stipulates that network addresses consist of 32 binary bits. Because IPv4 addresses are no longer enough, IPv6 is being promoted now.

2. Data link layer

Establish logical connection, perform hardware address addressing, error checking and other functions. (Protocol defined by the underlying network)
Combining bits into bytes into frames, using MAC addresses to access media, errors detected but not corrected.

MAC address: the unique identification of each network card

With the Mac address, you can know who is the receiver and who is the sender, and know the content of the data and group it.

So how does he spread the data, he 广播transmits it in a way, and all computers in the local area network can receive the message

1. Physical layer

The physical layer deals directly with physical media.

Physical layer equipment network card, network cable, hub, repeater, modem

physical channel

1. Wired channel

明线

The open wire refers to the overhead line erected in parallel on the pole. It itself is a conductive bare wire or an insulated wire. Although its transmission loss is low, it is more sensitive to external noise interference due to its vulnerability to weather and environment, and has been gradually replaced by cables. 

对称电缆

A symmetrical cable is a cable consisting of multiple pairs of twisted wires

同轴电缆

Coaxial cables have a wide range of applications. Coaxial cables can transmit analog and digital signals in a low-loss manner, and are suitable for various applications. Among them, TV broadcasting systems, long-distance telephone transmission systems, and computer systems are common. Short-distance jumper and LAN interconnection, etc.

光纤

Optical fiber is a fiber made of glass or plastic, using the light 反射原理transmission tool in these fibers with total transmission (total reflection phenomenon is a special phenomenon of light refraction , only light is emitted from an optically dense medium to an optically sparse medium and incident The total reflection  phenomenon will only occur when the angle is greater than or equal to the critical angle )

2. Wireless channel

The wireless channel mainly includes ground wave transmission, sky wave transmission and line-of-sight transmission. For example: satellite communication, radio broadcasting

In this layer, through the above methods, their corresponding transmission signals and voltages will be obtained, and converted into 010101010101, but the data is not yet organized, and it is only processed as the original electrical voltage单位为bit

Guess you like

Origin blog.csdn.net/qq1195566313/article/details/130475987