1. Home
  2. Explore
  3. Computer Science
  4. TCP/IP and OSI Models

Study methods

Flashcards
Quiz
Fill in the blanks
Written test
Lesson
Notes
Podcast
Content

TCP/IP and OSI Models

TCP/IP and OSI Networking Models

🌐 Why Networking Models Matter

Networking models like the OSI model (Open Systems Interconnection) and the TCP/IP model were created to solve a critical industry problem: proprietary protocols and hardware that didn't work together. In the early days, vendors built their own systems, their own cables, and their own protocols, making interoperability nearly impossible. A device from one vendor often could not communicate with a device from another vendor without a separate network.

The OSI model, developed by the ISO (International Organization for Standardization), aimed to bring standardization and interoperability by defining a set of layers, interfaces, and protocol conventions that any vendor could follow. The same principle applies today with the TCP/IP model, which is the actual model used on the modern internet.

Standardized cabling is a perfect example: an RJ45 connector and a CAT5e UTP cable (unshielded twisted pair) can connect a Cisco switch, a UniFi switch, a Netgear switch, or a TP-Link router. This universal compatibility is a direct result of the standardization efforts that began with the OSI model. Similarly, standardized protocols like TCP, UDP, and OSPF are implemented across all major networking vendors, giving multi-vendor interoperability.

A layered approach allows different teams and industries to specialize: one company focuses on manufacturing cables, another on building switches, another on writing routing protocols, and network engineers configure and manage them. Each layer has defined responsibilities, making the overall system manageable and scalable.

Key takeaway: The OSI and TCP/IP models exist to stop vendor lock‑in and proprietary protocols, ensuring that devices and software from different manufacturers can work together seamlessly.

📡 The OSI Model (7 Layers)

The OSI model consists of seven layers, numbered from Layer 1 (bottom) to Layer 7 (top). A common mnemonic to remember the names is: All People Sleeping Through Networking Don’t Pass (an example of a sentence, not the actual layer names).

The actual layers are:

Layer

Name

Function

Layer 1

Physical

Transmits raw bitstreams as electrical, optical, or radio signals over physical media (cables, wireless).

Layer 2

Data Link

Manages physical addressing (MAC addresses), framing, and error correction between directly connected devices.

Layer 3

Network

Provides logical addressing (IP addresses) and determines the best path through the network (routing).

Layer 4

Transport

Supports end‑to‑end communication between devices; handles reliable vs. unreliable delivery (TCP vs. UDP).

Layer 5

Session

Establishes, manages, and terminates sessions between applications.

Layer 6

Presentation

Translates data formats (encryption, compression, encoding) so the application layer can process it.

Layer 7

Application

Provides network services directly to user applications (HTTP, FTP, Telnet, etc.).

The OSI model was designed as a reference model — a theoretical framework for understanding networking. In practice, the TCP/IP model is what actually runs the internet.

🌍 The TCP/IP Model (4‑Layer vs. 5‑Layer)

The original TCP/IP model (RFC 1122) had four layers:

  • Link Layer (combines OSI Layer 1 and Layer 2)

  • Internet Layer (corresponds to OSI Layer 3)

  • Transport Layer (OSI Layer 4)

  • Application Layer (combines OSI Layers 5, 6, and 7)

However, in the CCNA curriculum and in most real‑world networks, the hybrid TCP/IP model is used, which has five layers:

  • Physical Layer (Layer 1)

  • Data Link Layer (Layer 2)

  • Network Layer (Layer 3)

  • Transport Layer (Layer 4)

  • Application Layer (Layer 5)

The hybrid model splits the original Link Layer into two separate layers (Physical and Data Link) to align more closely with the OSI model’s structure while still using TCP/IP protocols. This is the model you need to know for exams and for practical networking.

Important: Even though we officially use the 5‑layer TCP/IP model, network engineers still often refer to Layer 7 when talking about application‑layer issues. This habit comes from the OSI model’s Layer 7 (Application). So you may hear “there’s a Layer 7 problem” — it means an application‑layer problem, even though in TCP/IP it would be Layer 5.

🔄 Comparing OSI and TCP/IP Models

Both models share the same core layering philosophy, but they differ in number and granularity of layers.

OSI Model (7 Layers):

  • Application, Presentation, Session — these three are separate.

  • Transport, Network, Data Link, Physical — the lower four layers are essentially the same as TCP/IP’s lower four.

TCP/IP Model (5‑Layer Hybrid):

  • Application — combines OSI Layers 5, 6, and 7.

  • Transport, Network, Data Link, Physical — identical in concept to OSI.

The OSI model never won the protocol war; today every device on the internet uses TCP/IP. But the OSI model remains valuable as a conceptual tool for teaching and troubleshooting.

📩 Protocols and Devices at Each Layer (TCP/IP Model)

🔌 Layer 1: Physical Layer

Transmits raw bits (binary 0s and 1s) over physical media. The medium can be:

  • Copper cables — electrical signals (e.g., Ethernet CAT5e/CAT6)

  • Fiber optic cables — light signals (single‑mode or multi‑mode)

  • Wireless — radio signals (Wi‑Fi, 5G, satellite)

Devices at Layer 1: Hubs, repeaters, transceivers (e.g., media converters).
Protocols/Standards: Ethernet (at the physical level), Wi‑Fi (IEEE 802.11), fiber standards (single‑mode, multi‑mode).

đŸ§± Layer 2: Data Link Layer

Manages frames that include MAC addresses (source and destination), framing, and error correction. This layer operates between directly connected devices — it is per‑link (hop‑by‑hop).

Devices at Layer 2: Switches, bridges.
Common encapsulations:

  • Ethernet II — the most common data link protocol for Ethernet networks (uses MAC addresses)

  • PPP (Point‑to‑Point Protocol) — used on serial links (does not use MAC addresses)

  • HDLC — another serial link encapsulation

The encapsulation changes at each hop when crossing different types of links. A router strips the incoming Layer 2 frame and rebuilds a new one for the outgoing interface.

🌐 Layer 3: Network Layer

Provides logical addressing (IP addresses) and routing — determining the best path through the network from source to destination. This is end‑to‑end communication across multiple hops.

Devices at Layer 3: Routers.
Protocols: IPv4, IPv6, and routing protocols like OSPF.

Key difference between Layer 2 and Layer 3:

  • MAC addresses (Layer 2) are physical / burned‑in (though can be spoofed). They identify a device on a local network segment.

  • IP addresses (Layer 3) are logical and configurable. They identify a device’s location in the broader network and can change (e.g., when moving to a different Wi‑Fi network).

Example: A phone connected to one Wi‑Fi network gets an IP like 192.168.1.155; connect to another Wi‑Fi network and it becomes 192.168.0.132. The MAC address typically stays the same (unless using private addressing).

📡 Layer 4: Transport Layer

Manages end‑to‑end communication between applications on different devices. The two main protocols are:

  • TCP (Transmission Control Protocol) — connection‑oriented, reliable. Like a phone call: establishes a connection (three‑way handshake), sends data, and expects acknowledgments for each piece. If data is lost, it is retransmitted.

  • UDP (User Datagram Protocol) — connectionless, unreliable. Like a letter: just sends the data with no guarantee of delivery. No acknowledgment, no retransmission.

Devices at Layer 4: Firewalls, load balancers (sometimes).
Protocols: TCP, UDP.

đŸ–„ïž Layer 5/7: Application Layer

In the 5‑layer TCP/IP model, this is Layer 5 (Application). It corresponds to OSI Layers 5 (Session), 6 (Presentation), and 7 (Application) combined.

This layer contains the protocols that applications use to communicate over a network. Examples:

  • HTTP / HTTPS — web browsing

  • FTP / TFTP — file transfer

  • Telnet / SSH — remote terminal access

  • DNS — domain name resolution

Applications decide whether to use TCP or UDP at Layer 4. For example:

  • Web browsing (HTTP) uses TCP for reliability.

  • Voice over IP (VoIP) uses UDP because retransmission of lost voice packets is pointless — the call quality may degrade but the conversation continues in real time.

🔍 Key Concepts in the TCP/IP Model

Bits, Frames, Packets, Segments

The name of the data unit changes at each layer:

  • Layer 1: bits — raw binary 0s and 1s (electrical/optical/radio signals)

  • Layer 2: frames — includes MAC addresses and error‑checking

  • Layer 3: packets — includes IP source and destination addresses

  • Layer 4: segments — includes TCP or UDP header (port numbers, sequence numbers, etc.)

A router works with packets (Layer 3). A switch works with frames (Layer 2). A hub works with bits (Layer 1).

End‑to‑End vs. Hop‑by‑Hop

  • IP (Layer 3) is end‑to‑end: the source and destination IP addresses remain unchanged (unless NAT is applied) across the entire path.

  • Layer 2 is hop‑by‑hop: the data link encapsulation (Ethernet, PPP, Wi‑Fi) is stripped and rebuilt at every router. Each link uses its own addressing (MAC addresses, etc.) and may be a completely different technology.

Logical vs. Physical Addressing

  • MAC address — physical (burned into the NIC). Unique per interface. Rarely changes (unless using privacy features like Apple’s Private Wi‑Fi Address, which randomizes the MAC per network to prevent tracking).

  • IP address — logical (configured by an administrator or via DHCP). Can change as a device moves between networks. Essential for routing across different subnets.

Real‑World Usage of Layer References

Although the TCP/IP model has only 5 layers, network engineers routinely use OSI layer numbers in troubleshooting:

  • “Problem at Layer 1” = physical connectivity issue (e.g., cable unplugged, fiber cut).

  • “Problem at Layer 2” = data link issue (e.g., wrong VLAN, duplex mismatch, spanning tree problem).

  • “Problem at Layer 3” = routing issue (e.g., missing route, incorrect IP configuration, routing loop).

  • “Problem at Layer 4” = transport issue (e.g., port blocked by firewall, TCP handshake failure).

  • “Problem at Layer 7” = application issue (e.g., web server not responding, HTTP error).

✅ Summary

  • The OSI model is a 7‑layer reference model for understanding networking. It was developed to standardize protocols and enable multi‑vendor interoperability.

  • The TCP/IP model is the practical model used on the internet. The 5‑layer hybrid TCP/IP model (Physical, Data Link, Network, Transport, Application) is what you need to know for the CCNA and real‑world networking.

  • Each layer has specific functions, protocols, and devices:

    • Physical (bits) — hubs, cables, radio

    • Data Link (frames) — switches, MAC addresses, Ethernet/PPP/HDLC

    • Network (packets) — routers, IP addresses, routing protocols

    • Transport (segments) — TCP (reliable) vs. UDP (best‑effort)

    • Application (data for apps) — HTTP, FTP, SSH, etc.

  • Layer 2 changes per hop; Layer 3 stays end‑to‑end (logical addressing).

  • TCP is like a phone call (connection‑oriented, acknowledges data); UDP is like a letter (no acknowledgment).

  • Engineers still use OSI layer numbers informally, especially Layer 7 for application issues.

Ask anything

We've read this whole study set, so questions about it get the best answers.

FlashcardsQuizFill in the blanksWritten testLessonNotesPodcastContent