- Practice
- About 14 min
- 5 practice questions
OSI and TCP/IP layers: order, jobs and devices
Recall the seven OSI layers in order, state what each does, match common protocols and devices to layers, and compare with the TCP/IP model.
If something looks wrong, please tell us.
Network communication is complex, so it is divided into layers, each with one job. The OSI model has seven layers. Almost every exam on networking asks for the order of the layers, the job of one layer, or the layer at which a device or protocol works. All of these come from one table.
The seven layers, top to bottom
| No. | Layer | Job | Examples |
|---|---|---|---|
| 7 | Application | Gives network services to the user's programs | HTTP, SMTP, FTP, DNS |
| 6 | Presentation | Translates, compresses and encrypts data formats | Encryption, character codes |
| 5 | Session | Opens, manages and closes conversations | Session control |
| 4 | Transport | End-to-end delivery, splitting data, error recovery | TCP, UDP |
| 3 | Network | Addressing and choosing the route | IP, router |
| 2 | Data Link | Moves frames between devices on the same link, using MAC addresses | Ethernet, switch, bridge |
| 1 | Physical | Sends raw bits as signals over the medium | Cables, hub, repeater |
A common memory aid for the order from layer 7 down to layer 1 is the first letters of Application, Presentation, Session, Transport, Network, Data Link, Physical: All People Seem To Need Data Processing. Going from layer 1 up, the aid reverses: Please Do Not Throw Sausage Pizza Away.
Names for the data at each layer
- Application, Presentation, Session: data
- Transport: segment (for TCP)
- Network: packet
- Data Link: frame
- Physical: bits
The TCP/IP model
The model used on the Internet has four layers: Application (covering OSI layers 5 to 7), Transport, Internet (the same job as the OSI Network layer) and Network Access (covering OSI layers 1 and 2).
Worked examples
Example 1. At which layer does a router work? A router chooses routes using IP addresses, so it works at the Network layer (3). A switch uses MAC addresses and works at the Data Link layer (2). A hub only repeats signals, so it works at the Physical layer (1).
Example 2. At which layer do TCP and UDP work? The Transport layer (4). IP works at the Network layer (3). HTTP works at the Application layer (7).
Example 3. A student writes the layers in order as Application, Presentation, Session, Network, Transport, Data Link, Physical. What is wrong? Network and Transport are swapped. The Transport layer (4) is above the Network layer (3).
Example 4. Which layer is closest to the user, and which is closest to the cable? The Application layer is closest to the user and the Physical layer is closest to the cable.
Example 5 (encapsulation). When you send a message, each layer wraps the data it receives from the layer above in its own label, called a header. The application data gets a transport header and becomes a segment. The Network layer adds addresses to make a packet. The Data Link layer adds hardware addresses to make a frame, and the Physical layer sends the frame as bits. The receiving computer unwraps the layers in the opposite order. This wrapping is why each layer can do its own job without knowing how the others work.
Router: layer 3. Switch: layer 2. Hub: layer 1. TCP and UDP: layer 4. HTTP and SMTP: layer 7.
Key takeaways. Learn the seven layers with a memory aid. Match each device and protocol to its layer. Remember the data names: data, segment, packet, frame, bits. TCP/IP merges the OSI layers into four.
Check your understanding
-
1. How many layers does the OSI model have?
- Four
- Five
- Seven
- Nine
Show answer
Answer: C. The OSI model has seven layers, from Physical (1) to Application (7).
-
2. At which OSI layer does a router work?
- Network
- Data Link
- Physical
- Transport
Show answer
Answer: A. A router forwards packets using IP addresses, which is the Network layer (layer 3).
-
3. Which layer is responsible for end-to-end delivery and error recovery?
- Session
- Network
- Presentation
- Transport
Show answer
Answer: D. The Transport layer (4), using TCP or UDP, handles end-to-end delivery.
-
4. What is the unit of data at the Data Link layer called?
- Packet
- Frame
- Segment
- Bit
Show answer
Answer: B. At the Data Link layer, data is packaged in frames.
-
5. A hub works at which OSI layer?
- Physical
- Network
- Application
- Data Link
Show answer
Answer: A. A hub only repeats electrical signals, which is a Physical layer (layer 1) function.
Sign in to keep track of the lessons you finish.