Skip to 0 minutes and 3 secondsTransporting both data and IP packets across a variety of links and devices poses as a problem. One solution is to redesign all data link protocols to understand IP addressing and packet structure. But this redesign would render much of the existing network infrastructure we have redundant. Instead, we can use the data link protocols to transport the IP packets as their data. Previously you learned that frames transport data from the network layer. Now this data is in fact an IP packet, which contains or encapsulates the real data we want delivered to the end device. Imagine an envelope inside another envelope. We call this double encapsulation. In this model, the operating system sends the data to the transport layer.
Skip to 0 minutes and 59 secondsThe transport layer then sends the data down to the network layer. The network layer then breaks up the data into blocks and encapsulates each block into an IP packet. The network layer then sends these packets down to the data link layer. The data link layer encapsulates these packets into frames. The frames are then transmitted as bits onto the media, such as an Ethernet cable. Let's look at one example of using a computer to view a web page and send the data to a distant web server. The data starts its journey on your computer sent via the transport layer to the network layer. The network layer encapsulates the data as IP packets.
Skip to 1 minute and 41 secondsEach packet then travels to the data link layer, which encapsulates it into an Ethernet frame. This Ethernet frame travels along the Ethernet cable to the switch. The switch reads the MAC address and sends the frame out of the correct ports on the router. The router decapsulates the IP packet from the frame. And the network layer of the router examines the IP address to see where the packet is being sent. The next link to the destination is across an ADSL link. The IP packet travels to the data link layer of the router and becomes encapsulated into an ADSL frame. The ADSL frame moves across the ADSL link to the internet service provider. This process repeats over and over.
Skip to 2 minutes and 26 secondsEach step of the journey decapsulates the packet and examines the destination address. The next link is selected, and a new frame encapsulates the packet ready for transmission. The IP packet is transmitted from one device to the next one in the chain until it reaches its destination.
Explaining the Layered Model
In the previous step, you saw many simliarities between Internet Protocol (IP) addresses and IP packets on the one hand, and MAC addresses and Ethernet frames on the other hand. Do we need both, or can they coexist?
In this step, you’ll learn more about IP packets and how they are transported in frames. This is visualised as the next layer in the TCP/IP model.
What is the data in a data link frame?
Last week, we looked at how frames operate at the data link layer, particularly at how Ethernet frames transport data.
To transport IP packets across all the various links, there are two theoretical options:
- Change all the data link protocols so they understand IP addresses and the structure of IP packets.
- Use the data link protocols to transport IP packets as their data.
Option 1 would require a vast amount of redesign that would make much of the existing network infrastructure redundant — option 2 is the logical choice.
So the data transmitted in data link frames (such as Ethernet frames) is IP packets. These IP packets contain (encapsulate) the actual data that one device is sending to another.
It’s like an envelope inside an envelope: double encapsulation! (The attached activity can help you and your students visualise this)
So in the same way that the data link layer encapsulates data from the network layer, the network layer encapsulates data from another Layer. This ‘higher’ layer is called the transport layer, which you’ll learn about later in the course.
NOTE: the network layer is sometimes referred to as the internet layer. We will use the term network layer here.
The network layer as a service
In the same way the data link layer provides a service to the network layer by transporting its data in frames, the network layer also provides a service to the transport layer by transporting its data.
One device’s transport layer wants to send some data to the equivalent transport layer on a distant device.
The transport layer uses the services of the network layer to transport the data inside IP packets.
The network layer uses the services of the data link layer to transport the IP packets as frames across the local links. In practice this involves intermediary devices (e.g. routers) that check each IP packet’s destination address and choose the next link.
The data link layers connect to the media and transmit the frames as bits encoded into electrical, optical, or electromagnetic (wireless) signals. If the media is Ethernet, a switch will be involved.
In the next step, you’ll learn about the fields that make up an IP packet.
- Why do we refer to IP as an ‘end-to-end’ protocol?
- Switches can be called ‘layer 2 devices’ because they work at the data link layer. What do you think routers are called?
- On a typical journey across the internet, how many times do you think an IP packet encapsulated in a frame and then decapsulated again? This happens each time the packet crosses a new link.
Share your answers and join the conversation below.