Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

Introduction of hierarchical model

2025-02-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

Shulou(Shulou.com)06/01 Report--

One: why should the protocol be layered

The process of network communication is very complex, the data traverses the medium to the correct computer in the form of electronic signal, and then converts it to the original form so that the receiver can read it. In order to reduce the complexity of the network design, the protocol is designed in layers.

Second, the significance of hierarchical design:

The module design of the communication service layer can be relatively independent of the differences between specific communication lines and communication hardware interfaces.

The module design of the communication service layer can be relatively independent of the specific user application requirements.

Simplify the relevant network operation; provide compatibility between different manufacturers; promote standardization work; structure layering; easy to learn and operate.

Each layer is independent, and the change of one layer will not affect the adjacent layer.

Three: hierarchical model-OSI

The main purpose of establishing a seven-layer model is to solve the compatibility problems encountered in the interconnection of heterogeneous networks. It clearly distinguishes the three concepts of "service", "interface" and "protocol".

Service: what functions does one layer provide for the upper layer?

Interface: how the upper layer uses the services of the next layer

Protocol: how to implement services at this layer

In this way, there is a strong independence between the layers, and there is no restriction on what protocols the entities in the Internet use. As long as the same service is provided upward without changing the interface of the adjacent layer.

The OSI reference model has the following advantages

It simplifies the related network operation, provides compatibility and standard interface between devices, promotes standardization, and can be structurally separated and easy to implement and maintain.

OSI layer 7 function

The basic functions of each level of the OSI reference model are as follows:

Physical layer: transmits bitstreams between devices, specifying reviews, speeds, and cable pins

Data link layer: bits are combined into bytes, then bytes are combined into frames, link layer addresses (MAC) are used to access the media and error detection is performed.

Network layer: provides a logical address for the router to determine the path.

Transport layer: provides link-oriented or non-link-oriented data transmission and error detection before retransmission.

Session layer: responsible for establishing, managing, and terminating communication sessions between presentation layer entities. The communication at this layer consists of service requests and responses between applications in different devices.

Presentation layer: provides a variety of coding and conversion functions for application layer data to ensure that the data sent by the application layer of one system can be recognized by the application layer of another system. It can be encrypted.

Application layer: the layer closest to the user in the OSI reference model that provides network services for applications.

Four: hierarchical model-TCP/IP

The TCP/IP model divides the network into four layers. The TCP/IP model does not pay attention to the underlying physical media, but mainly focuses on the logical data flow forwarding between terminals. The core of TCP/IP mode is the network layer and the transport layer: the network layer solves the problem of logical data flow forwarding between networks, and the transport layer ensures reliable transmission from source to destination. The uppermost application layer provides business applications to end users through various protocols.

Five: TCP/IP encapsulation

The application data needs to be processed by each layer of TCP/IP before it can be transmitted to the destination through the network. In each layer, the protocol data unit PDU of this layer is used to exchange information with each other. Different layers of PDU contain different information, so PDU is given different names in different layers. For example, the upper layer data is called data segment after the TCP header is added in the transport layer. After the IP header is added in the network layer, it becomes a packet, and the packet adds a data link layer header in the data link layer to become a data frame; finally, the frame is converted into bits and transmitted through the network. The process of passing data down layer by layer on the protocol stack and adding headers and trailers is called encapsulation.

Six: communication between terminals

The data link layer controls the transmission of data frames over the physical link.

The header and tail information must be encapsulated before a packet can be propagated on a physical medium. The encapsulated data packet becomes a data frame, and the information encapsulated in the data frame determines how the data is transmitted. There are two formats of data frames transmitted over Ethernet, and which format is determined by the network layer in the TCP/IP protocol suite. Next, let's introduce these two data frame formats.

As shown in the above two formats, the main difference between the two formats is that the Etherne_II format contains a Type field that identifies which upper layer protocol will be sent for processing after the Ethernet frame processing is completed. In IEEE802.3, the same location is the length field. Different Type field values can be used to distinguish between the two types of frames, using the IEEE 802.3 format when the Type field value is less than or equal to 1500. When Type is greater than or equal to 1536, the frame uses Ethernet II format. The Ethernet frame also includes meta and destination MAC addresses, representing the sender's MAC and the receiver's MAC, respectively, and a frame check sequence field to verify the integrity of the frame during transmission.

The length of Ethernet data frames is between 64 and 1518 bytes.

Length defines the number of bytes contained in the Data field in the IEEE802.3 format.

Logical link control LLC consists of destination service access point source service access point and control field

SNAP consists of organization code and type fields. The meaning of the Org code field is the same as the meaning of Type in the Ethernet II frame.

Ethernet uniquely represents the network equipment through the MAC address on the layer 2 link, and realizes the communication between the local area network devices. The MAC address is also called the physical address. Most network card manufacturers burn the MAC address into the ROM of the network card. The sender uses the MAC address of the receiver as the destination address. After the Ethernet frame is encapsulated, it is converted into a bit stream through the physical layer and transmitted on the physical media.

The MAC address consists of two parts, the vendor code and the serial number. The first 24 bits represent the vendor code, which is managed and assigned by IEEE. The remaining 24-bit serial numbers are assigned by the manufacturer.

Seven: three ways of sending frames

Unicast: sent from a single source to a single destination. In the collision domain, all hosts can receive the unicast frame sent by the source host, but when other hosts find that the destination address is inconsistent with the local MAC address, they will discard the received frame, and only the real destination host will accept and process the received frame.

Broadcast: indicates that a frame is sent from a single source to all hosts on a shared Ethernet network. The destination MAC address of the broadcast frame is FF:FF, and all hosts that receive the broadcast accept and process the frame.

Multicast: multicast forwarding can be understood as a selective broadcast in which the host listens for a specific multicast address and receives and processes frames whose destination MAC address is the group broadcast MAC address.

Eight: sending and receiving of data frames

After the frame is sent out of the physical interface of the host, it is transmitted to the destination through the transmission medium. In a shared network, this frame may reach multiple hosts. The host checks the destination MAC address in the frame header and discards the received frame if the destination MAC address is not a native MAC address or a locally monitored multicast or broadcast MAC address.

If the destination MAC address is a native MAC address, the frame is accepted, the parity sequence of the frame is checked, and compared with the values calculated by the machine to determine whether the frame remains intact during transmission. If the FCS value of the frame is different from the value calculated locally, the host considers the frame to be corrupted and discards the frame. If the frame passes the FCS check, the host determines which protocol the frame is sent to the upper layer based on the Type field of the frame header.

Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.

Views: 0

*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.

Share To

Network Security

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report