Data Link Layer

Data link layer concerns about the media what we are using. It also cares about channels and their functions.

This layer is the protocol layer that transfers data between adjacent network nodes in a wide area network (WAN) or between nodes on the same local area network (LAN) segment. The data link layer provides the functional and procedural means to transfer data between network entities and might provide the means to detect and possibly correct errors that may occur in the physical layer.

Data link layer carries different characteristics like:

  1. Framing
  2. Frame Synchronization
  3. Addressing
  4. Flow control
  5. Error detection and Correction
  6. Media access control
  7. Node-Node Delivery
Framing: The process of Making Frames are called Framing. Frames are the PDU( protocol data unit) formed in Data link layer. A frame is usually transmitted serial bit by bit and contains a header field and a trailer field that “frame” the data.  Representation of Frames are is shown in diagram below:
——-Header————                                                                                                              ———————-Tailer————–
Address field Information (data) field
(0-4096 bytes)
Frame check sequence Flag
Frame Synchronization: It is the process by which incoming framed data are extracted for decoding with the help of frame alignment signals. This process is called as such because framing and synchronization must be carried out whenever a bit slip event occurs during data transmission. The process used for the synchronization between the sender and the receiver is known as frame synchronization.
There are two type of frame synchronization:
  1. Asynchronous
  2. Synchronous
Asynchronous : For each and every eight bit character has a start and stop bit.
Synchronous: Whole Frame will have only one delimiter I. e. Start Frame Delimiter.

Addressing: The data link layer is the lowest layer in the OSI model that is concerned with addressing: labeling information with a particular destination location. Each device on a network has a unique number, usually called a hardware address or MAC address, that is used by the data link layer protocol to ensure that data intended for a specific machine gets to it properly.
MAC Address is 48 bit address. MAC address representation are shown below:
—————————-24 bit————————————-          ——————————-24 bit————————————–
I/G              G/l          Organizational unique Identifier                                   Vendors Assigned
47th          48th
1st bit refers to I/G where I stands for Individual and G stands for Group.
2nd bit refers to G/L where G stands for Global and L stands for Local.
Using MAC address we communicate in a same location.
Flow control: Flow Control is a technique for speed-matching of transmitter and receiver. Flow control ensures that a transmitting station does not overflow a receiving station with data. It coordinates the amount of data that can be sent before receiving acknowledgement.
They are of two types:
  1. Stop and wait Control
  2. Windowing
Stop and wait control: This flow control mechanism forces the sender after transmitting a data frame to stop and wait until the acknowledgement of the data-frame sent is received.
Windowing: The drawbacks of Stop and wait control is it transmit only one frame at a time. In windowing concepts multiple frames are transferred at a time. in this both sender and receiver maintain a window.

windowing1Error Detection and Correction: Error detection is the detection of errors caused by noise or other impairments during transmission from the transmitter to the receiver. This is of two types:

  1. Single bit error
  2. Burst error

Single bit error: When only one bit is ground or changed then it is a single bit error. Parity is used to detect this type of error.

A parity bit is a bit that is added to a group of source bits to ensure that the number of set bits (i.e., bits with value 1) in the outcome is even or odd. It is a very simple scheme that can be used to detect single or any other odd number (i.e., three, five, etc.) of errors in the output.

Burst Error: When multiple bit is changed during transmission then it is Burst error. Checksum is used to detect the error.

A checksum of a message is a modular arithmetic sum of message code words of a fixed word length (e.g., byte values). The sum may be negated by means of a ones’-complement operation prior to transmission to detect errors resulting in all-zero messages.

Error Correction: When data-frame is transmitted, there is a probability that data-frame may be lost in the transit or it is received corrupted. In both cases, the receiver does not receive the correct data-frame and sender does not know anything about any loss. In such case, both sender and receiver are equipped with some protocols which helps them to detect transit errors such as loss of data-frame. Hence, either the sender retransmits the data-frame or the receiver may request to resend the previous data-frame. The process of Retransmission of data is called as Automatic Repeat Request (ARQ).
There is three types of ARQ:
  1. Stop and wait ARQ
  2. Go back ARQ
  3. Selective repeat Request
Stop and wait ARQ: In stop and wait ARQ sender will maintain a time out counter. When the frame is sent sender starts the time counter. when the acknowledgement from receiver comes in time then it will transmit the next frame or it will think the frame or acknowledgement is lost so it transmit the frame again and starts the time counter again.
Go Back ARQ: In this ARQ, When the sender sends all the frames in window, it checks up to what sequence number it has received positive acknowledgement. If all frames are positively acknowledged, the sender sends next set of frames. If sender finds that it has received NACK or has not receive any ACK for a particular frame, it retransmits all the frames after which it does not receive any positive ACK.

Selective repeat Request: In Selective-Repeat ARQ, the receiver while keeping track of sequence numbers, buffers the frames in memory and sends NACK for only frame which is missing or damaged.The sender in this case, sends only packet for which NACK is received.


MAC: This refers to the procedures used by devices to control access to the network medium. Since many networks use a shared medium (such as a single network cable, or a series of cables that are electrically connected into a single virtual medium) it is necessary to have rules for managing the medium to avoid conflicts. For example. Ethernet uses the CSMA/CD method of media access control, while Token Ring uses token passing. Multiple access channel has two types:

  1. Random Access
  2. Control Access
Random Access: In a random access protocol, a transmitting node always transmits at the full rate of the channel. When there is a collision, each node involved in the collision repeatedly retransmits its frame (that is, packet) until the frame gets through without a collision. But when a node experiences a collision, it doesn’t necessarily retransmit the frame right away. Instead it waits a random delay before retransmitting the frame. Each node involved in a collision chooses independent random delays. Because the random delays are independently chosen, it is possible that one of the nodes will pick a delay that is sufficiently less than the delays of the other colliding nodes and will therefore be able to sneak its frame into the channel without a collision.
It is described as:
  • Listen
  • Collision
  • Jam signal
  • Back Off timer
Control Access: In Controlled access protocol, while transmitting node always has to get a token to transfer. without the token node cannot transfer the frames from one to another so, there will be no any collision.
Node-Node Delivery: Any device refereed by MAC address  is called Node. When a single broadcast affects group of computers then  it is said to be Broadcast domain. we can say that any two computers communicating with the help of MAC address in a same network is Node-Node Delivery.