Lesson
OSI and TCP/IP Models
Learning objective
Relate common network tasks to the OSI and TCP/IP models.
Why layered models exist
Layered models divide networking work into smaller responsibilities. You already know about hosts, network devices, MAC addresses, and IP addresses. The models give those ideas a place on one map.
Imagine sending a short message from a laptop to another host. One part of the system creates the message, another supplies delivery information, and another carries signals across a cable or wireless link. Separating those jobs lets us study one responsibility at a time.
A protocol is an agreed set of communication rules. A model groups responsibilities; it is not itself a protocol. Neither model is a physical stack of seven or four devices. A host's software and network interface work together, and real products can combine responsibilities.
For now, aim to explain each layer's main job rather than memorize every protocol or header field.
The seven OSI layers
OSI means Open Systems Interconnection. Its seven conceptual layers are numbered from Physical (1) to Application (7). The table is shown from the top down, as data is prepared for sending.
To make each layer concrete, follow one everyday activity through all seven: making a video call to a friend.
| OSI layer | Main job | Video-call example |
|---|---|---|
| 7 — Application | Provides network services to applications. | The video-call app itself: it is the service you open to start the call, using HTTP-style requests and DNS to find your friend's server by name. |
| 6 — Presentation | Handles how data is represented, compressed, or encrypted. | Three jobs in order: translation turns your webcam frames into a shared binary format, compression shrinks that binary (lossy for video, so quality is traded for speed), then encryption (TLS/SSL) scrambles the result so only your friend's app can read it. |
| 5 — Session | Organizes the dialogue between applications. | The call app opens one session through its API when you tap "Call" and keeps it alive for the full 20 minutes, instead of reconnecting from scratch every time either of you speaks. |
| 4 — Transport | Supports communication between application processes. | Your laptop can stream the call's audio and video (UDP) while a chat message you send during the call uses a separate, reliable connection (TCP); ports keep the two apart. |
| 3 — Network | Provides logical addressing and delivery between networks. | Every packet of your call carries your friend's IP address, so routers along the way know which network to forward it toward next. |
| 2 — Data Link | Handles frames on a local link. | Your laptop's Wi-Fi wraps each packet in a frame addressed to your home router's MAC address — the one hop between your laptop and the router. |
| 1 — Physical | Carries bits using signals. | Those frames leave your laptop as radio waves over Wi-Fi, then continue as pulses of light through your internet provider's fiber-optic cable. |
The same seven layers, drawn as a stack. Data starts at Application and works down to Physical as it leaves your laptop for the call.
- ApplicationOpens the video-call app and starts the request to your friend.
- PresentationTranslates, compresses, then encrypts (TLS) your webcam video.
- SessionOpens one call session through the app's API and keeps it alive.
- TransportSeparates the call's audio/video (UDP) from chat (TCP) by port.
- NetworkAddresses every packet with your friend's IP address.
- Data LinkFrames each packet for the next hop, such as your Wi-Fi router.
- PhysicalSends the frame as Wi-Fi radio waves or light in a fiber line.
Presentation does two of those jobs in a specific order, and the receiver reverses both. Compression and encryption are opposites of decompression and decryption — the diagram below follows the same packet through all four:
A closer look at the Presentation layer's own pipeline: watch the same packet of video data flow right, compressed and encrypted on the way out, then decrypted and decompressed on the way back in.
- Original dataYour webcam frame, before any Presentation-layer processing.
- CompressCompressedThe binary shrinks (lossy for video) to save bandwidth.
- Encrypt (TLS/SSL)EncryptedThe compressed binary is scrambled so only your friend's app can read it.
- Travels the networkEncryptedThe same scrambled bytes arrive at your friend's device.
- DecryptCompressedYour friend's app unscrambles the bytes back to compressed form.
- DecompressOriginal dataExpanded back into the original frame, ready to display.
The Application layer is not the entire browser or phone app: it describes the network-service responsibility used by that app. Session and Presentation describe useful jobs, but modern Internet software does not always implement them as separate layers.
Devices are useful reminders, not rigid labels. A hub repeats signals; an ordinary Ethernet switch works with frames; a router connects IP networks. A host uses the whole stack, and one physical product can contain several functions.
Application-layer protocols cover more than web browsing. A few common ones, grouped by the job they do: file transfer uses FTP; web surfing uses HTTP and HTTPS; email uses SMTP, POP3, and IMAP; remote virtual terminals use Telnet and SSH; and network management uses DHCP and SNMP. Each name maps to one everyday task, the way HTTP maps to "load a web page."
The TCP/IP model
TCP/IP stands for Transmission Control Protocol / Internet Protocol. The name also refers to the Internet protocol suite, a family of protocols used together. It does not mean every exchange must use TCP: UDP is another transport protocol in that suite.
We use the common four-layer TCP/IP model:
- Application: services and the application's data exchange, such as HTTP or DNS.
- Transport: communication between application processes, using TCP or UDP.
- Internet: IP addressing and delivery across networks.
- Network Access: local-link frames and the signals that carry them.
Network Access is also called the Link layer. Some teaching resources split it into Data Link and Physical to make a five-layer model. That is a different grouping, not a different Internet. This course's comparison uses four TCP/IP layers consistently.
OSI-to-TCP/IP mapping
Read across the diagram to compare responsibilities, rather than comparing layer numbers. OSI has seven layers while this TCP/IP model has four, so their numbers are not interchangeable.
TCP/IP Network Access roughly combines OSI Physical and Data Link. TCP/IP Internet aligns with OSI Network. Transport aligns with Transport. TCP/IP Application groups the OSI Session, Presentation, and Application responsibilities. These are helpful conceptual mappings, not a requirement that every protocol fit perfectly into one box.
Compare the models layer by layer
Read across each mapping to see how the seven conceptual OSI layers fit into the four practical TCP/IP layers. Every card names its role and gives protocol examples.
OSI model — 7 layers
Layer 7
Application
Provides network services to user applications.
Examples: HTTP, DNS, DHCP
Layer 6
Presentation
Represents, encrypts, and compresses application data.
Examples: TLS, UTF-8
Layer 5
Session
Coordinates conversations between applications.
Examples: Session checkpoints, Dialog control
Layer 4
Transport
Delivers data between application processes using ports.
Examples: TCP, UDP, Ports
Layer 3
Network
Addresses packets and moves them between networks.
Examples: IPv4, Routing
Layer 2
Data Link
Delivers frames across one local network link.
Examples: Ethernet, Wi-Fi, MAC addresses
Layer 1
Physical
Carries bits as electrical, optical, or radio signals.
Examples: Copper, Fiber, Radio
How the layers map
TCP/IP Application maps OSI layers 7, 6, and 5.
The TCP/IP Application layer covers the work described by OSI Application, Presentation, and Session layers.
TCP/IP Transport maps OSI layer 4.
Both models use a Transport layer for ports and process-to-process delivery.
TCP/IP Internet maps OSI layer 3.
The TCP/IP Internet layer corresponds to the OSI Network layer and its IP addressing and routing work.
TCP/IP Network Access maps OSI layers 2 and 1.
The TCP/IP Network Access layer combines OSI local-frame delivery and physical signaling.
TCP/IP model — 4 layers
Application
Combines application, representation, and conversation services.
Examples: HTTP, DNS, DHCP, TLS
Transport
Provides process-to-process delivery and port addressing.
Examples: TCP, UDP, Ports
Internet
Provides logical addressing and delivery across networks.
Examples: IPv4, Routing
Network Access
Handles local-link delivery and physical transmission.
Examples: Ethernet, Wi-Fi, MAC addresses, Bits
Encapsulation and layer matching
Encapsulation means adding delivery information around data as it moves down the sender's stack. Decapsulation means examining and removing that information as the receiver passes the data upward.
Think of putting a message inside labeled envelopes. The labels help deliver the message; they do not replace it. In this simplified TCP example, the names change as delivery information is added:
Application data → TCP segment → IP packet → Ethernet frame → bits carried as signals.
A header is delivery information placed before the data it carries. Ethernet also uses information at the end, called a trailer. A protocol data unit (PDU) is simply the name for the unit of data at a particular layer. You do not need to learn detailed header fields yet. With UDP, the transport unit is called a datagram rather than a TCP segment.
The player shows the sender going down the stack and the receiver going up. It is one simplified transfer, not the complete process of opening a website. The top three OSI responsibilities are grouped into the Application step; no separate Session or Presentation header is assumed.
Step 1 of 9
Encapsulation
The browser creates data
The browser prepares the request it wants the server to receive.
- Active OSI layer
- OSI layer 7 — Application
- Active TCP/IP layer
- TCP/IP Application layer
- Current PDU
- Data
- Information added
- HTTP request data
Technical details
At the sender, HTTP produces application data before lower layers add their delivery information.
Visible PDU: Data
- Application data
OSI model — seven-layer stack
- Layer 7: ApplicationActive
- Layer 6: PresentationStandby
- Layer 5: SessionStandby
- Layer 4: TransportStandby
- Layer 3: NetworkStandby
- Layer 2: Data LinkStandby
- Layer 1: PhysicalStandby
TCP/IP model — four-layer stack
- ApplicationActive
- TransportStandby
- InternetStandby
- Network AccessStandby
Use Pause, Next, Previous, and Restart to compare the original application data with the delivery information around it. Watch the active layer and PDU change together. Detailed protocol mechanics belong in the later layer modules.
Now match four familiar examples to their TCP/IP groups. You can retry an answer or move between examples; this practice is not an additional completion requirement.
Match a technology to a layer
Layered models divide networking work into smaller responsibilities. Match each example to its TCP/IP layer, then read how it relates to OSI.
Example 1 of 4: DNS — Looks up a name such as a website name.
Knowledge check
How we will use this map: after Computer Network Basics, the course restructure follows Physical → Data Link → Network → Transport → Application, Session & Presentation. We will start with the signals and build upward. A separate later module will connect those ideas into how hosts communicate.
For this introduction, remember the jobs: signals, local frames, IP delivery, application transport, and the application's exchange. The OSI model separates the upper responsibilities; TCP/IP groups them. Both help you organize the same networking concepts.
References: OSI reference model (ITU-T X.200) and Internet protocol layers (RFC 1122, section 1.1.3).