Skip to main content

What is the data link layer of the OSI model?

The data link layer (Data Link Layer, L2) is the second layer of the OSI model, responsible for reliable data transfer between neighboring devices on the same network.

Put very simply: the data link layer solves the task of "delivering data from one network device to another within a single network segment."


The data link layer takes the bit stream from the physical layer and packages it into frames, while also making sure it arrives without corruption.

Main tasks:

1. Framing (building frames)

  • data is split into frames
  • service information is added to the data (header and trailer)

A frame is the basic "unit of transmission" of the data link layer.


2. MAC-level addressing

  • every device has a MAC address
  • a frame is sent from one MAC address to another

The data link layer does not use IP, that is a layer above.


3. Error control

  • a checksum (FCS) is added to the frame
  • the receiver checks whether the frame is corrupted

The data link layer usually does not correct errors, it detects them.


4. Media access control

Answers the question:

who can transmit data, and when

Examples:

  • Ethernet
  • Wi-Fi (this is especially important there)

5. Interaction with the physical layer

  • receives bits from below
  • passes finished frames up (to the network layer)

  • within a single local area network (LAN)
  • between neighboring nodes
  • up to the first router

It is not responsible for anything beyond the network (between different networks).


  • switches
  • network interface cards (NIC)

They work with:

  • frames
  • MAC addresses

Simple analogy

Office mail:

  • an envelope with the recipient's name is the frame
  • the name on the envelope is the MAC address
  • delivery inside the building is the data link layer

Short definition for an interview

The OSI data link layer delivers data as frames between devices on the same network, using MAC addresses and performing error control and media access control.

Short Answer

Interview ready
Premium

A concise answer to help you respond confidently on this topic during an interview.