What is a Datalink Layer?
The OSI model’s data link layer (Layer 2) handles the moving of data in and out across a physical link in a network. It performs the node-to-node delivery of data. It takes a frame from the network layer, forms frames, and gives it to the physical layer. The data link layer also synchronizes the information transmitted over the data. The main responsibilities of this layer are the following:-
- The data link layer encodes bits into packets before transmission and then decodes the packets back into bits at the destination.
- Allowing the upper layers to access the media
- Responsible for logical link control, media access control and also responsible for hardware addressing,
- Handling and defining physical layer standards.
- Preparing network data for the physical network and also controlling data placement and receiving on the media
- Exchanging frames between nodes over a physical network media, such as UTP or fibre-optic
- Receiving and directing packets to an upper-layer protocol
- Performing error detection
The Layer 2 notation for network devices connected to a common media known as a node. Nodes build and send frames. The OSI data link layer exchanges Ethernet frames between source and destination nodes over a physical network media.
The data link layer effectively separates the media transitions that occur as the packet is forwarded from the communication processes of the higher layers. The data link layer receives packets from and directs them to an upper-layer protocol, in this case, IPv4 or IPv6. This upper-layer protocol does not need to know which media the communication will use.
Datalink Sub-Layers
As we know, the OSI model’s data link layer(Layer 2) is the protocol layer and handles moving data in and out across a physical link in a network. The data link layer is theoretically divided into two sublayers. Logical link control (LLC) and media access control (MAC) layer. This division is based on the architecture used in the IEEE 802 Project, the IEEE working group responsible for creating the values describing many networking technologies.
- Logical Link Control (LLC)
- Media Access Control (MAC)
Logical Link Control (LLC)
This upper sublayer is Logical Link Control(LLC), which communicates with the network layer. It places information in the frame that identifies which network layer protocol is being used for the frame. This information allows multiple Layer 3 protocols, such as IPv4 and IPv6, to use the same network interface and media. It provides services to the network layer above it and hides the rest of the details of the data link layer to allow different technologies to work seamlessly with the higher layers. Most local area networking technologies use the IEEE 802.2 LLC protocol.
Media Access Control (MAC)
This lower sublayer defines the media access processes performed by the hardware. It also provides data link layer addressing and access to various network technologies.
The figure above illustrates how the data link layer is divided into the LLC and MAC sublayers. The LLC communicates with the network layer, while the MAC sublayer allows various network access technologies. For instance, the MAC sublayer communicates with Ethernet LAN technology to send and receive frames over copper or fibre-optic cable. It also communicates wirelessly with wireless technologies such as WiFi and Bluetooth to send and receive frames.
Also, Read Physical Layer (Layer-2) of OSI Model