Want to keep learning?

This content is taken from the Raspberry Pi Foundation & National Centre for Computing Education's online course, An Introduction to Computer Networking for Teachers. Join the course to learn more.

The TCP/IP model and the Data Link / Network Access Layer

To transport data across a large network, such as a WAN, the data may travel across lots of different connections. These connections are called links because they ‘link’ the devices together. Each type of link has a different frame structure, and uses different addresses and protocols.

The process of encapsulating data, transporting it across a link, and decapsulating at the end of the link, is repeated time and time again as the data makes its journey.

Animation showing data being encapsulated and decapsulated as it traverses several links.

The ‘special envelope’ analogy

Imagine a world in which we send letters by placing them in different kinds of envelopes for different transportation systems (i.e. types of links); the addresses we write on the envelopes only get the envelope across a particular section of the transportation system.

  • The transport system between houses and post offices uses white envelopes. The only things that can be written on white envelopes is a house number, a street, and the name of a local post office.

  • The transport system between post offices use red envelopes. The only things that can be written on red envelopes are the names of post offices.

  • The sender writes a letter with the full address of the person they want to send it to.
  • They then place it in a white envelope, just addressed to the local post office.
  • The post office opens the envelope to look at the full address at the top of the letter to see where it is going. It then puts the letter back in a new red envelope addressed to the next post office.
  • This may repeat through several post offices.
  • When the letter gets to a post office that recognises the full address as being local, it puts the letter in a white envelope addressed the destination house and the street.

At each stage, the envelope is in the correct wrapper for that section of the journey and just has the local addresses to get it across that section or link.

Note that unlike what it looks like here, the post offices don’t get to read the contents of our letter - more on this later in the course.

How does this connect to real world networks? How do we transport data across one link?

  1. The data to be transported comes from the sender’s network layer. This is the part of a device’s network operating system that deals with external communications — you will learn more about it next week.
  2. The data must be encapsulated in a frame, converted into the appropriate electrical, wireless, or optical signal for the type of transmission media, and finally transmitted via the media.
  3. When the data is received, this process is reversed: the signal is decoded, and the data is decapsulated from the frame and passed to the receivers’ network layer.

We refer to the set of processes above as part of the data link layer. This is a combination of software and hardware built into the network interface card (NIC) or network adapter. A modern computer typically has three separate data link layer for Ethernet, wireless, and Bluetooth, and switches in the appropriate layer as needed.

In the part of a device’s operating system that deals with networking, the data link layer sits between the network layer and the physical connectors that connect the device to the transmission media.

Representing the Data Link Layer

You may be imagining that the data link layer on one device communicates directly with the data link layer on another device. However, the connection is via the physical media.

  • The network layer in one device wants to send some data to the network layer in another device, across some type of connection.

An animation of the Network Layer in one device sending some data to the Network Layer in another device

  • On the sending device, the network layer passes the data to the appropriate data link layer. This layer encapsulates the data to create a frame, and passes the frame to the media.

An animation. Data from the network layer on the first device is passed down to the data link layer. A frame from this device goes to the data link layer on a second device, and data is passed up from this data link layer to the network layer.

  • The final part of the data link layer converts the bits of the frames into the electrical, wireless, or optical signals that are sent along the link medium.

  • When the frame is received, the receiving device’s data link layer decapsulates the data from the frame and passes it up to the receiver’s network layer.

Animation showing the data being encapsulated into a frame, this frame transmitted as a signal over the transmission media, and the data being decapsulated in the second device.

We say that the data link layer is providing a service to the network layer by transporting its data in frames across the link.

The TCP/IP model

We can now start to build our layered model from the bottom up. The Data Link layer in the TCP/IP model

You can see that the data link layer is just the first, or bottom, layer of a layered model called the TCP/IP model. TCP stands for Transmission Control Protocol, and IP stands for Internet Protocol. They both are foundational telecommunications protocols

The TCP/IP model allows new link technologies to be developed and integrated into our networks without having to scrap everything and start again. All we’d need to do is use updated NICs in our devices. (As NICs are often embedded, we end up changing the devices anyway.)

Thanks to this model, we didn’t have to shut down the internet and build a new one when new wireless standards or 3G/4G came out.

Questions

  • In the layered TCP/IP model, what happens when the receiving data link layer checks the Frame Check Sequence (FCS) and realises an error has occurred?
  • The data link layer for Ethernet uses MAC addresses when constructing a frame. Do we need addresses in all types of frames?

Share your answers in the comments below.

Share this article:

This article is from the free online course:

An Introduction to Computer Networking for Teachers

Raspberry Pi Foundation