Code360 powered by Coding Ninjas X Naukri.com. Code360 powered by Coding Ninjas X Naukri.com
Table of contents
1.
Introduction
2.
OSI Layered Model
2.1.
Data Link Layer
2.2.
Functionalities of Data Link Layer
2.2.1.
Framing and link access
2.2.2.
Flow Control
2.2.3.
Reliable Delivery
2.2.4.
Half Duplex and Full Duplex
2.2.5.
Error detection
2.2.6.
Error correction 
3.
Frequently Asked Questions
3.1.
What is the data link layer?
3.2.
What are the examples of the Data link layer?
3.3.
What is a frame?
4.
Conclusion
Last Updated: Mar 27, 2024

Data Link Layer

Computer Networks

Introduction

The Data Link Layer in OSI Model is the Second Layer from the bottom. In the TCP/IP Model, it is combined with the Physical Layer to form a combined layer called the Network Interface Layer. Let us discuss the Data Link Layer and all its related functionalities in detail but before that let's briefly recap the OSI Layered Model. 

OSI Layered Model

OSI stands for Open System Interconnections. OSI model describes seven layers the computer system uses to communicate over a network. OSI Layered model was the first standard model for network communications in the early 1980s.

Each layer of the OSI (Open System Interconnections) model performs a specific function and communicates with its adjacent layers, i.e., layers above and below.

The seven layers of the OSI model are as follows:

  1. Physical Layer
  2. Data Link layer
  3. Network Layer
  4. Transport Layer
  5. Session Layer
  6. Presentation Layer
  7. Application Layer

This blog focuses on the second layer of the OSI (Open System Interconnections) model, the Data Link Layer.

Now, we will learn about the Data Link layer in detail.

Data Link Layer

As discussed above, Data Link Layer is the second layer of the OSI (Open System Interconnections) model, which the computer system uses to communicate over a network. The Data link layer is sometimes known as layer 2. The Data link layer is the protocol layer used to transfer data between nodes on a network segment across the physical layer. 

The physical layer is the first layer (from the bottom) in the OSI (Open System Interconnections) model. The physical layer is most closely associated with the physical connection between devices. The physical layer also provides a mechanical, electrical, and procedural interface to the transmission medium.

The Adjacent nodes are connected by the communication channel known as links. To move the datagram from the source to the destination, the datagram must be moved across an individual link.

A datagram is an independent, self-contained message sent over the network whose arrival, arrival time, and content are not guaranteed.

The purpose of the Data Link layer is the delivery of frames between nodes on the same level of the network, or we can say that its primary responsibility is to transfer the datagram across an individual link.

Some examples of the Data link layers are Ethernet, token ring, PPP (Point to Point Protocol), HDLC, and ADCCP.

The Data link layer has two sub-layers that are:

  • Logical link control 
    This layer deals with flow control, protocols, and error controls.
  • Media access control
    This layer deals with actual control of media.

 

Must Read HDLC Protocol and Basic Networking Commands

Functionalities of Data Link Layer

The following are the major functionalities provided by the data link layer:

Framing and link access

Framing means the creation of frames, and frames are the streams of bits received from the layers of the network into manageable data units. This process of division of streams of bits (also called framing) is performed by the Data link layer.

Flow Control

The data link layer provides a mechanism for flow control that prevents the sending node on one side of the link from overwhelming the receiving node on another side of the link.

The receiver's buffer can overflow without flow control, which leads to frame loss. Flow control prevents the traffic jam created at the receiver side.

Reliable Delivery

Reliable delivery service is provided by the Data link layer, which means it transmits the network layer datagram without any error. It is accomplished with transmissions and acknowledgments. 

Half Duplex and Full Duplex

Data can be transmitted by only one node simultaneously in Half-duplex mode, while data can be transmitted by both the nodes simultaneously in Full-duplex mode. In a half-duplex mode, data can be transmitted in both ways. Both devices can send or receive data in both directions but not at the same time.

In a full-duplex mode, data is transmitted in both directions at the same time. The sender and receiver can send data at the same time in the full-duplex mode.

Error detection

The data link layer provides a mechanism for the detection of errors. In a Computer Network, errors can be introduced by noise and signal attenuation. The error detection is achieved by adding bits for error detection, and then an error check is performed by the receiving node.

Error correction 

It is pretty similar to error detection, except that the receiving node detects the error and determines where it occurred in the frame. Error correction mechanism finds out the bits that are corrupted and their location also and uses various mechanisms to prevent duplication of frames.

You can also read about the network models in computer network.

Also see, Message Switching in Computer Networks.

Frequently Asked Questions

What is the data link layer?

The Data link layer is a protocol layer used to transfer data between nodes on a network segment across the physical layer. 

What are the examples of the Data link layer?

Examples of the Data link layer are Ethernet, token ring, PPP (Point to Point Protocol), HDLC, and ADCCP.

What is a frame?

The data link layer formats the message into pieces, and each piece is called a data frame. And data link layer adds a customized header having the source of hardware and the destination address to the frames.

Conclusion

This blog is about the data link layer, the second layer of the OSI (Open System Interconnections) mode. We learned about the OSI layered model and its seven layers in it. We study the Data link layer and the two sub-layers in the Data link layer. We also learned the services provided by the Data Link layer.

Recommended Readings:


Do check out The Interview guide for Product Based Companies as well as some of the Popular Interview Problems from Top companies like Amazon, Adobe, Google, etc. on Coding Ninjas Studio.

Check out some of the amazing Guided Paths on topics such as Data Structure and Algorithms, Competitive Programming, Basics of C, Basics of Java, Computer Networks, etc. along with some Contests and Interview Experiences only on Coding Ninjas Studio

Live masterclass