Sending a parcel
You send a gift to a friend in another country. You write a note. You put it in a box. You write the address on the box. A van takes it to a post office. A plane flies it. Another van brings it to your friend.
Nobody does the whole job. Each person does one small job. Then they pass the parcel on. Computers send data in the same way, in layers.
Key words
| Word | What it means | Example |
|---|---|---|
| Encryption | Scrambling data so only the right people can read it. | HTTPS |
| Network | Computers joined to share data. | The college network |
| Router | A device that joins networks and sends data the right way. | A home router |
| Port | A number that says which program on a computer gets the data. | 80 for a web page |
| ASCII | A code that gives each letter and symbol a number. | A is 65 |
The cells students fill in are left blank in this preview.
More key words
| Word | What it means | Example |
|---|---|---|
| Layer | One level in a model, with one job. | The transport layer |
| OSI model | A seven-layer model of how data moves across a network. | Layers 1 to 7 |
| TCP/IP model | The four-layer model the internet is built on. | Application, transport, internet, network |
| Protocol | A set of rules computers follow to talk to each other. | HTTP |
| Header | Extra information a layer adds to the front of the data. | The address on the box |
| IP address | A number that names a device on a network. | 10.0.12.1 |
| MAC address | A number built into a network card that names it. | Six pairs of letters and numbers |
| Frame | The data with its last header added, ready to send. | [Frame][IP][TCP]Hi |
| Ethernet | The usual wired way to join computers in a building. | The cable behind a desk PC |
| OSPF | Open shortest path first: routers share a map to find the best path. | Routers in a large network |
| DNS | Domain name system: it turns a name into an IP address. | Finding a website |
| ARP | Address resolution protocol: it finds the MAC address for an IP address. | Who has 10.0.12.1? |
The cells students fill in are left blank in this preview.
Put the parcel jobs in order
Have a go
Put the parcel jobs in order
3 questionsWhy use layers?
A layer does one job and talks to the layer above and below it. You can change one layer and leave the rest as it is.
For example, you can change from a cable to Wi-Fi. Only the bottom layers change. Your web browser does not notice.
The seven OSI layers
| Layer | Name | Its job | Examples |
|---|---|---|---|
| 7 | Application | Gives network services to the program you use | HTTP, HTTPS, FTP, SMTP, DNS |
| 6 | Presentation | Changes the format of data. Handles encryption and compression (making data smaller) | TLS (the encryption behind HTTPS) |
| 5 | Session | Starts, keeps and ends a conversation between two programs | Keeping a video call connected until you hang up |
| 4 | Transport | Breaks data into parts and delivers them safely | TCP |
| 3 | Network | Gives IP addresses and chooses the route across networks | IP, OSPF |
| 2 | Data link | Moves data between two devices that are joined by one cable or one radio link. Uses MAC addresses | Ethernet, Wi-Fi, switches |
| 1 | Physical | Sends the 1s and 0s as electricity, light or radio | Ethernet cables, Wi-Fi radio, USB |
The cells students fill in are left blank in this preview.
A way to remember the order
Tip
From layer 7 down to layer 1: "All People Seem To Need Data Processing". Application, Presentation, Session, Transport, Network, Data link, Physical. You can make your own sentence.
Quick check: the layers
Have a go
Quick check: the layers
3 questionsMatch the layer to its job
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
The four TCP/IP layers
| TCP/IP layer | Its job | Protocols | OSI layers it covers |
|---|---|---|---|
| Application | Services for programs, formats and conversations | HTTP, HTTPS, FTP, SMTP, DNS, DHCP | 5, 6 and 7 |
| Transport | Splits data and delivers it safely | TCP | 4 |
| Internet | IP addresses and routes across networks | IP, OSPF | 3 |
| Network | Moves data over the local cable or Wi-Fi | Ethernet, Wi-Fi | 1 and 2 |
The cells students fill in are left blank in this preview.
The two models side by side
flowchart LR
subgraph TCP["TCP/IP: four layers"]
t4["Application"] --> t3["Transport"] --> t2["Internet"] --> t1["Network"]
end
subgraph OSI["OSI: seven layers"]
o7["Application"] --> o6["Presentation"] --> o5["Session"] --> o4["Transport"] --> o3["Network"] --> o2["Data link"] --> o1["Physical"]
end
Extra: More protocols on each layer
| OSI layer | More examples | What they do |
|---|---|---|
| 6 Presentation | TLS, JPEG, ASCII | TLS encrypts for HTTPS. JPEG and ASCII are formats for pictures and text. |
| 5 Session | RPC, NetBIOS | Start and keep a conversation between two programs |
| 4 Transport | UDP, ports | UDP is fast, with no delivery check. A port picks the program that gets the data. |
| 3 Network | ICMP | Carries error messages and the ping test |
| 2 Data link | ARP | Finds the MAC address that goes with an IP address |
The cells students fill in are left blank in this preview.
Put the protocol on its layer
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
Try it: every layer adds a header
message = "Goal!"
print(message)
for layer in ["TCP", "IP", "Frame"]:
message = "[" + layer + "]" + message
print(message)
# TCP is the transport layer. IP is the internet layer.
# Frame is the network layer in the TCP/IP model (the data link layer in OSI). Add your own layer and run it again.
Make a free account to save your work and track your progress.
Extra: Send one ping to the router
sudo ip netns exec h1 ping -c 1 -W 1 10.0.12.1A command for the lesson’s lab terminal. It is shown here and not run.
Extra: Read both kinds of address
sudo ip netns exec h1 ip addr showA command for the lesson’s lab terminal. It is shown here and not run.
Extra: See the address pair
sudo ip netns exec h1 ip neighA command for the lesson’s lab terminal. It is shown here and not run.
Extra: Two addresses for one device
Important
In the second output, find the interface to-r1. Its link/ether line holds the MAC address: a data link address. Its inet line holds the IP address: a network layer address. One device has both. The last command showed the router and the MAC address that ARP learned for it.
Your turn: add and remove headers
A message goes down the layers. Each layer adds a label (a header) at the front.
- Write add_headers. It adds "[TCP]", then "[IP]", then "[Frame]". Each new label goes at the very front.
- Write remove_headers. The other computer takes the labels off in the opposite order.
- Press Run Tests to check.
def add_headers(message):
# Add three labels in front of the message, one at a time:
# first "[TCP]", then "[IP]", then "[Frame]".
# Each new label goes at the very front.
# add_headers("Hi") gives "[Frame][IP][TCP]Hi".
return message
def remove_headers(packet):
# The other computer takes the labels off in the opposite order.
# remove_headers("[Frame][IP][TCP]Hi") gives "Hi".
return packet
Make a free account to save your work, or press Start lab to work through the whole lesson.
Key words crossword
Have a go
Loading…
Your answers are marked here and are not kept. A college account keeps every student’s marks.
Final check
Have a go