DEV Community

Cover image for Layer by Layer: The OSI Model: Layer 2
Andrew Despres
Andrew Despres

Posted on

Layer by Layer: The OSI Model: Layer 2

Preamble:
This space will be utilized to synthesize my notes and help improve my learning process while I study for the CompTIA Network+ N10-009 certification exam. Please follow along for more Network+ notes and feel free to ask any questions or, if I get something wrong, offer suggestions to correct any mistakes.

Data-Link Layer (Layer 2)

It’s responsible for transferring data between nodes that are on the same logical segment. This means that nodes can communicate using only hardware addresses (Media Access Control - MAC) regardless if they share the same media. This is also referred to as a logical topology.

A MAC addresse is a 48-bit hexadecimal address that are permanently attached to the NIC device by the manufacturer. This is called “burning” the MAC address onto the device. The first half of the MAC address is called the Organizational Unique Identifier (OUI) and each manufacturer has a unique OUI.

Screenshot of an example OUI from the Wireshark websiteExample of an OUI from an Asus Motherboard. This is from the Wireshark website OUI identifier (https://www.wireshark.org/tools/oui-lookup.html).

Nodes are generally not directly connected together like in a Mesh topology, but rather, they are connected to a centralized device like a network Switch or Wireless Access Point. The central node is provides forwarding functions receiving data from the sending node and then directing the data to the receiving node.

The Data-Link Layer performs encapsulation, organizing the bitstream from the Physical Layer into frames. Each frame carries a Network Layer packet as its payload. The Data-Link Layer adds header and trailer information, including:

  1. Source and destination MAC addresses.
  2. Error-detection information (e.g., CRC).
  3. Control information for flow control.
  4. The format of the frame is dependent on the media access method being used. For example Ethernet frames are defined by the 802.3 standard.

Devices that Operate on the Data-Link layer

Network Adapter or Network Interface Card (NIC): A NIC is used to join a node to network media (cabling, WiFi) and allows communication over the network by assembling and dissembling network frames. A NIC also contains a transceiver that operates at the Physical layer to convert electrical signals to binary.

Bridge: Primarily designed to connect two network segments, effectively dividing a larger network into smaller, more manageable collision domains. Historically, bridges were used to reduce network congestion by filtering traffic between segments.

Switch: An advanced form of a Bridge. A Switch creates links between large numbers of nodes more efficiently. Switches have a much higher port density, allowing for connections to numerous devices.

Wireless Access Point (AP): Allows network cards to communicate wirelessly and creates a bridge between wired and wireless networks.

I hope you found today's topic about the Data-Link layer helpful! Come back again to learn about Layer 3, the Network Layer.

Image of Datadog

The Future of AI, LLMs, and Observability on Google Cloud

Datadog sat down with Google’s Director of AI to discuss the current and future states of AI, ML, and LLMs on Google Cloud. Discover 7 key insights for technical leaders, covering everything from upskilling teams to observability best practices

Learn More

Top comments (0)

A Workflow Copilot. Tailored to You.

Pieces.app image

Our desktop app, with its intelligent copilot, streamlines coding by generating snippets, extracting code from screenshots, and accelerating problem-solving.

Read the docs

👋 Kindness is contagious

Explore a trove of insights in this engaging article, celebrated within our welcoming DEV Community. Developers from every background are invited to join and enhance our shared wisdom.

A genuine "thank you" can truly uplift someone’s day. Feel free to express your gratitude in the comments below!

On DEV, our collective exchange of knowledge lightens the road ahead and strengthens our community bonds. Found something valuable here? A small thank you to the author can make a big difference.

Okay