In this post, I’ll break down Layer 2 of the OSI model, the Data Link Layer. As a WiFi engineer, Layer 2 is where I spend the majority of my time digging into issues. The goal of the Data Link Layer is to provide frame delivery and error detection. To accomplish this goal, this layer provides three main functions:
Media Access Control
Link Layer Addressing
Error Detection
Media Access Control provides a mechanism for controlling how devices access the medium. The two most common channel access mechanisms are:
Carrier Sense Multiple Access with Collision Detection (CSMA/CD) - used in wired ethernet networks
Carrier Sense Multiple Access with Collision Avoidance (CSMA/CA) - used in 802.11-based wireless networks
These channel access mechanisms allow multiple devices to connect to the same physical medium by providing rules to dictate when each device can communicate.
Link Layer Addressing uses a unique 12-digit, 6-byte hexadecimal number called a MAC address to identify each device on a network. The first six digits are called the Organizationally Unique Identifier (OUI). The OUI identifies the manufacturer of the network adapter. The last six digits are uniquely assigned by the manufacturer so that every network adapter has a unique MAC address.
Here is a sample format of a MAC address:
AA:11:AA:11:AA:11
If you recall from the Layer 3 post, every device is assigned a unique L3 address. The most significant difference between Layer 2 and Layer 3 devices is that Layer 2 addresses do not change. They are burnt into the card by the manufacturer. Layer 3 devices are dynamic and will change based on the network that the adapter is plugged into.
Error Detection looks for errors that may have occurred during Layer 1 transmission. If an error is detected at Layer 2, it prevents unnecessary processing of corrupted data by the receiving device. Error detection is accomplished by adding a Cyclic Redundancy Check (CRC) to each frame. The CRC is a checksum of data added to the trailer of a Layer 2 frame that allows the sender and receiver to perform a mathematical calculation to generate a fixed length check value. If the receiver’s value matches the CRC value in the trailer, the frame is considered valid. If the values don’t match, the frame is considered corrupted and discarded.
Facts to Remember:
The PDU at the Data Link Layer is the frame.
Layer 2 channel access methods determine when a device can transmit on the network.
Common Layer 2 Protocols:
802.3 - Ethernet
802.11 - WiFi
I will dive into Layer 2 frames in depth during the Wireless Basics section of the Campus Access objectives, so stay tuned.
As always, open for comments, and let me know if I missed anything that should be included. #HappyLearning