Computing
Computer Science LearnITWithMrC ⛯ Year 7 Year 8 Year 9 GCSE
Responsive image

Lesson Video

69

Lesson Tasks

  • Watch the Lesson video
    Make notes on your notes sheet.
  • Read the lesson notes
    Make notes on your notes sheet.
  • Complete the learning activities
    Make any notes on your notes sheet.
  • Check the Learning outcomes
    Update your learning objectives

What do I need to Learn?

0 results forGuest
I need to learn how to describe the 4 layers of the TCP/IP model: application layer, transport layer, internet layer, link layer
I need to learn how to understand that the HTTP, HTTPS, SMTP, IMAP and FTP protocols operate at the application layer.
I need to learn how to understand that the TCP and UDP protocols operate at the transport layer.
I need to learn how to understand that the IP protocol operates at the internet layer

Key Terms

Ethernet RJ45 connector Application Layer Transport Layer Network Layer Data Link Layer fiber-optic

The TCP-IP protocol model

Network Layers

Networks are very complicated in the way they work. There are physical parts to them, such as the cables and wires, and there is also software. To make the process simpler a standard was created which splits up the different functions of a network into layers.

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.

The Data Link Layer

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

The data link layer in action

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?



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:

  1. Change all the data link protocols so they understand IP addresses and the structure of IP packets.
  2. 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.

Diagram showing encapsulation of Data as it travels from device's core OS. At the Network layer it is encapsulated in an IP packet with an IP header. At the Data link layer this IP packet is encapsulated into a Frame. This bits that make up this frame are encoded as signals onto the network media.

It’s like an envelope inside an envelope: double encapsulation! (The attached activity can help you and your students visualise this)

A slip labelled "DATA" going into an envelope labelled "PACKET", which is itself going into an envelope labelled "FRAME".

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.

  1. One device’s transport layer wants to send some data to the equivalent transport layer on a distant device.

  2. The transport layer uses the services of the network layer to transport the data inside IP packets.

  3. 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.

  4. 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.

The journey of the data from one Transport Layer to the Transport Layer on a distant device, via a switch.

TThe transport layer

The transport layer identifies the type of data being transported. It offers two protocols, depending on the need for reliable or unreliable delivery. It is the connection between the network and application layers.

Reliable delivery uses the transmission control protocol (TCP) and creates TCP segments. It’s typically used when re-transmission delays are acceptable. TCP is a connection-orientated protocol, meaning the two ends require a connection to keep track of the numbers of each sent IP packet.

Unreliable delivery uses the User Datagram Protocol (UDP) and creates UDP datagrams. It’s typically used for real-time audio and video. UDP is a connectionless protocol, meaning data is sent to the destination with no additional dialogue.

The application layer

The top layer of the TCP/IP stack is not the transport layer, where TCP resides, it’s the application layer.

Protocols such as HTTP, FTP, SMTP, POP, and IMAP are all application layer protocols.

The application uses the services of the TCP/IP model to encapsulate its message in various layers of protocols. Ultimately, the data is transferred over the media to the internet.