In Cisco engineers’ work, they always hear similar terms, such as Layer 2 equipment and Layer 3 equipment. What is a Layer 2 or Layer 3 equipment after all? Maybe someone will immediately answer, that is, a switch, a router or a firewall. Yes, but why is it called like this?
When it comes to Layer 2 and Layer 3, we have to mention the seven-layer model of OSI. In the early days of the network, the systems of different manufacturers were different, and the devices of different manufacturers were interconnected differently, so there was a lot of trouble. In order to solve the problem of compatibility among manufacturers, an OSI (Open System Interconnection) model was developed.
In the OSI seven-layer model, from top to bottom, there are the application layer, the presentation layer, the session layer, the transmission layer, the network layer, the data link layer, and the physical layer. Among them, Layer 5, 6, and 7 are called high layers, or host layers, which are mainly responsible for data transmission between residents. Layer 1, 2 and 3 are called bottom layers, or media layers, and are mainly responsible for the communication of network data. The routers and switches we are familiar with at ordinary times belong to Layer 3, the network layer, and Layer 2, the data link layer respectively. Although the OSI model has been optimized into the TCP/IP protocol model, we are still used to calling them Layer 2 and Layer 3 of the 7-layer model.
After understanding the seven-layer model, we should know that the communication between two devices is also realized through it. The specific process is as follows:
- The application layer is where we generate data (text, pictures, videos, etc.).
- Data is transmitted from top layers to bottom layers. In the presentation layer and session layer, data is not processed at all, but a TCP/UDP header is added to the original data when it is transmitted to the transmission layer.
- Then, the data will continue to be transferred to the next layer. When it is transferred to the network layer, an IP header will be added on the original basis.
- After IP header and TCP/UDP header are added, they will continue to be transmitted downward. When they are transmitted to the data link layer, MAC header will be added at the front and FCS check bit will be added at the end.
- Finally, this data will be transmitted to the target device through the physical layer devices (optical fiber, cable, electromagnetic wave, etc.).
The above is the process of data encapsulation before sending, and the other party receives the encapsulated data through the physical layer device. This piece of data will be transferred from the lowest layer of the model to the upper layers, and the corresponding header will be removed when passing through each layer. For example, when the data is transferred from the physical layer to the data link layer, the MAC header and the FCS check bit will be removed, and when the data passes through the network layer, the IP header will be removed, and so on. This process is called data de encapsulation. Therefore, the data received by the application layer is the data that is initially intended to be sent. The process of data transfer from one end to the other is through the OSI seven-layer model we used above.
Now do you understand the difference between Layer 2 and Layer 3 in network equipment? This part of the technology explained today will be systematically taught in the Cisco Primary Certification course .
Read More: Confronting the Menace of the Webcord Virus