Purpose of the Data Link Layer


The Data Link Layer

The data link layer of the OSI model (Layer 2), as shown in the figure, prepares network data for the physical network. The data link layer is responsible for network interface card (NIC) to network interface card communications. The data link layer does the following:

  • Enables upper layers to access the media. The upper layer protocol is completely unaware of the type of media that is used to forward the data.
  • Accepts data, usually Layer 3 packets (i.e., IPv4 or IPv6), and encapsulates them into Layer 2 frames.
  • Controls how data is placed and received on the media.
  • Exchanges frames between endpoints over the network media.
  • Receives encapsulated data, usually Layer 3 packets, and directs them to the proper upper-layer protocol.
  • Performs error detection and rejects any corrupt frame.

In computer networks, a node is a device that can receive, create, store, or forward data along a communications path. A node can be either an end device such as a laptop or mobile phone, or an intermediary device such as an Ethernet switch.

Without the data link layer, network layer protocols such as IP, would have to make provisions for connecting to every type of media that could exist along a delivery path. Additionally, every time a new network technology or medium was developed IP, would have to adapt.

The figure displays an example of how the data link layer adds Layer 2 Ethernet destination and source NIC information to a Layer 3 packet. It would then convert this information to a format supported by the physical layer (i.e., Layer 1).