Course contents

Unit 3: Network ModelsLesson 3.1 (1 of 14 in this unit)16 of 104 in the Network Fundamentals course

The OSI Model

Your message is ready. How does the network know which computer should receive it, which application needs it, and how to deliver it? Let's follow those jobs before naming the seven OSI layers.

Beginner · 20 min read · Before this: What Is a Computer Network?

You'll learn to name the seven layers and their PDUs, say which device reads which layer, and use the layers to find where a connection is failing.

Technical definition

The OSI (Open Systems Interconnection) model is a seven-layer reference model that divides network communication into the Physical, Data Link, Network, Transport, Session, Presentation and Application layers, each providing services to the layer above it.

Why does a message need more than its text?

A delivery service can read a loose page that says “Meeting at 10:00”, but the message does not name its destination. An addressed envelope adds information the service can use to deliver it. The content and the delivery details do different jobs.

Diagram
The message says what; the envelope says where
The message says what; the envelope says where
The message says what; the envelope says whereTwo delivery examples contain the same message, Meeting at 10. A loose page has no destination. An addressed envelope names the Training Centre and includes a return address, so the service has delivery information as well as the message.Message aloneMessage plus delivery detailsMeeting at 10:00The content is readable.To: Training CentreFrom: Office ABut where should it be delivered?The service has a destination.

On small screens, swipe sideways or focus the diagram and use the arrow keys.

A limited analogy: delivery needs information as well as content. Network protocols use different fields for application ports, IP destinations and the current link; they are not one postal address.

Now use a network example. A laptop at 192.168.1.20 requests a page from a lab server at 203.0.113.20. The request needs more than its text: TCP identifies application endpoints with ports, IP identifies the communicating interfaces, and Ethernet identifies the next recipient on the local link. The server address is reserved for documentation; it is not a live website to test.

Encapsulation means adding the protocol information needed to carry data. A header comes before the data it describes; a trailer comes after it. Ethernet, for example, adds an error-check trailer. The receiver processes the corresponding information to recover the application data.

Data: The application produces data, such as an HTTPS request.

  1. Data · application
  2. Segment · transport
  3. Packet · network
  4. Frame · data link

Data: The application produces data, such as an HTTPS request. Segment: TCP adds a header with the source and destination ports. Packet: IP adds a header with the source and destination IP addresses. Frame: Ethernet adds MAC addresses in front and an error check (FCS) at the end.

On the way out each layer wraps the one above it; the receiver unwraps them in reverse (decapsulation).

The OSI model names seven networking responsibilities; it does not require seven separate headers in every packet. The strip shows a simplified TCP/IP-over-Ethernet example. We will use OSI to explain what each job contributes.

Opening a website involves several separate jobs: requesting the page, protecting the connection, delivering the data, choosing a route and transmitting signals. Layers organise those jobs, and each layer uses the service of the layer below it. By the end of this lesson, you should be able to answer four questions:

  • What does each of the seven layers do, and what is its unit of data (PDU)?
  • Which protocols and devices work at each layer?
  • Where do MAC addresses, IP addresses and ports fit?
  • What happens, layer by layer, when a laptop opens a website?

Why networking was split into layers

Early networking included incompatible vendor systems, which made connecting different products difficult. The OSI (Open Systems Interconnection) model was published by the ISO in 1984 as a common, vendor-neutral way to describe networking. Splitting the work into layers solves several problems:

Mix and match. Wi-Fi can replace Ethernet at layers 1 and 2 without changing your browser at layer 7.
Vendors can work together. A switch from one company and a NIC from another agree on layer 2 standards.
Easier to learn. You can study one layer at a time without knowing everything at once.
Easier to troubleshoot. “The link light is on, but I have no IP address” points you above layer 1: check the VLAN, the Wi-Fi sign-in and DHCP next.

OSI is a reference model: a way to describe and discuss networking. The protocols that actually run the internet come from the TCP/IP suite.

Learn more: The TCP/IP Model

The seven layers at a glance

OSI is numbered from Physical (1) at the bottom to Application (7) at the top. Data goes down the layers on the sender and up the layers on the receiver.

  1. 7ApplicationData

    Gives programs a way onto the network: the requests and replies they send.

    e.g. HTTP, HTTPS, DNS, DHCP, SSH, SMTP

  2. 6PresentationData

    Agrees how data is written: character sets, compression and encryption.

    e.g. UTF-8, JPEG, MP4, TLS encryption

  3. 5SessionData

    Opens, keeps track of and closes conversations between programs.

    e.g. RPC, NetBIOS, SOCKS

  4. 4TransportSegment (TCP) / Datagram (UDP)

    Gets data to the right program (port) on the other device; TCP adds reliability.

    e.g. TCP, UDP

  5. 3NetworkPacket

    Logical (IP) addresses, and choosing a path from one network to another.

    e.g. IPv4, IPv6, ICMP, OSPF

  6. 2Data LinkFrame

    Moves frames across one local link using MAC addresses, and checks for errors.

    e.g. Ethernet (802.3), Wi-Fi (802.11), PPP

  7. 1PhysicalBits

    Turns bits into signals and back: voltage on copper, light in fibre, radio waves.

    e.g. Copper (1000BASE-T), fibre, Wi-Fi radio, connectors

The seven OSI layers, from 7 (closest to the user) down to 1 (the wire).

A PDU (protocol data unit) is the name for a unit of data at a given layer. Using the right name tells people which layer you mean: a frame is layer 2, a packet is layer 3.

Memory aid: from layer 7 down, "All People Seem To Need Data Processing". From layer 1 up: "Please Do Not Throw Sausage Pizza Away".

The layers are functional categories. Real protocols don't always fit neatly into one layer, especially at layers 5 to 7.

What each layer contributes

Keep the laptop and lab server in mind. Each section explains one job, how that job works and what it contributes to the same request.

7Layer 7: Application

Gives applications access to network services: asking for a web page, looking up a name, sending an email.

A network service needs rules for requests and replies. HTTP defines how a browser requests a page and how the server replies. DNS defines how to ask for the address of a name. These are application-layer protocols. Your browser uses those protocols; a browser window, a document editor or every other piece of software is not automatically a layer 7 protocol.

In this example: Your browser sends the HTTP request “GET /index.html” to the web server.

Application means the network service and its messages, not everything the user sees on the screen.

Read the separate Application layer lesson →

6Layer 6: Presentation

Makes sure both sides understand the data: character encoding, data formats, compression and encryption.

Receiving bytes is not enough if the receiver interprets them differently. Character encoding tells software how bytes represent letters. An agreed image format tells it how to read a picture. Compression can reduce the amount of data sent, while encryption protects information from being read in transit. These are different jobs: compressing a file does not make it private.

In this example: The page is encoded as UTF-8 text and encrypted with TLS before it leaves the server.

Presentation describes how information is represented; modern TCP/IP applications and libraries perform these functions.

Read the separate Presentation layer lesson →

5Layer 5: Session

Organises a conversation between applications: starting it, coordinating the exchange and ending it.

A conversation may need rules for who sends next or a shared checkpoint from which work can resume. A checkpoint is an agreed record of completed work. Recovery needs support at both ends; naming a session does not make a file transfer resumable. In modern networks, applications often manage their own conversation state instead of using a separate OSI session protocol.

In this example: A resumable transfer application can record completed chunks and request the remaining chunks after reconnecting. The application must implement that behaviour.

A session is a managed conversation; a web login is not proof of a separate layer 5 protocol.

Read the separate Session layer lesson →

4Layer 4: Transport

Delivers data between the right applications on two hosts, using port numbers. TCP adds reliability and ordering.

An IP address gets traffic to a host interface; a port helps the host give it to the right application endpoint. TCP establishes a connection, numbers the bytes, acknowledges received data and retransmits missing data. Its sliding window lets it send multiple segments before an acknowledgement arrives. Receive flow control limits data to what the receiver can accept; congestion control responds to network conditions. UDP sends separate datagrams without built-in acknowledgements, ordering or retransmission.

In this example: For this TCP-based HTTPS example, your PC uses source port 51524 and destination port 443. TCP recovers missing bytes, but a long outage can still make the connection fail.

TCP provides a reliable, ordered byte stream while the connection works; UDP itself does not guarantee delivery or order.

Read the separate Transport layer lesson →

3Layer 3: Network

Moves packets between different networks using logical (IP) addresses, choosing a route hop by hop.

IPv4 addresses have 32 bits; IPv6 addresses have 128 bits. A prefix length identifies the network portion: with 192.168.1.20/24, the subnet is 192.168.1.0/24. The address alone does not tell you that subnet. A router compares the packet's destination address with its routes and normally chooses the matching route with the longest prefix. A route may come from a connected interface, a static setting or a routing protocol. It is not necessarily the path with the fewest routers or the lowest delay.

In this example: Your packet carries source 192.168.1.20 and destination 203.0.113.20, and each router picks the next hop.

IP addressing and routing choose where a packet goes next; they do not guarantee that it arrives.

Read the separate Network layer lesson →

2Layer 2: Data Link

Carries data as frames across a link. Ethernet uses MAC addresses for local delivery and an error check to detect damaged frames.

An Ethernet MAC address has 48 bits, usually written as six pairs of hexadecimal digits, such as 02:00:00:00:00:20. Hexadecimal uses 0–9 and A–F. MAC addresses can be locally assigned or changed; they are not guaranteed permanent, globally unique device identities. A switch learns source MAC addresses on incoming ports and looks up destination MAC addresses to forward frames. An unknown unicast destination is normally flooded within its VLAN through eligible ports except the incoming port. The frame check sequence (FCS) detects corruption; Ethernet does not repair the damaged payload.

In this example: Your laptop puts the remote-server packet in a frame addressed to the lab gateway’s MAC address 02:00:00:00:00:01. The local switch carries that frame towards the gateway.

A switch forwards within the local network using MAC addresses; it does not choose the IP route to a remote network.

Read the separate Data Link layer lesson →

1Layer 1: Physical

Turns bits into signals and back: voltages on copper, light in fibre, radio waves in the air. Defines cables, connectors and speeds.

A bit is a binary value, 0 or 1. Physical signalling rules describe how those values travel and how a receiver recognises them. Both ends need compatible media and signalling. Full duplex means both ends can send and receive at the same time; half duplex means they take turns. Legacy shared, half-duplex Ethernet used CSMA/CD to handle collisions. Modern full-duplex Ethernet does not use that collision-detection method. A hub repeats signals rather than choosing a destination from a MAC address table.

In this example: On the wired Ethernet link used in this example, the laptop's network interface sends signals along the cable to the switch. A broken cable prevents that first hop.

A working physical link is necessary, but its link light does not prove that IP settings or the application are correct.

Read the separate Physical layer lesson →

Learn more: HTTP: How the Web TalksDNSDHCP

Why layers 5 to 7 do not have neat boundaries in TCP/IP

The Presentation and Session layers deal with how information is represented or protected, and how a conversation is managed. In TCP/IP, applications and supporting protocols do these jobs, so don't expect a separate layer 5 or layer 6 header in every packet. TLS, for example, protects many connections, but calling it “only layer 6” oversimplifies its role.

Learn more: HTTPS and TLS

Layer 4: TCP and UDP

The transport layer delivers data between applications on two hosts:

Diagram
Layer 4: TCP and UDP
Layer 4: TCP and UDP
TCPUDP
StyleConnection-oriented byte streamConnectionless datagrams
Delivery & orderReliable and in orderNot guaranteed by UDP itself
Lost dataRetransmittedNo built-in retransmission
PortsYesYes
Read each row across: the left box names the item, the others describe it.

Applications can add their own reliability on top of UDP, so “uses UDP” doesn't always mean “unreliable”.

Learn more: What the Transport Layer Does

How layers 3, 2 and 1 work together on the first hop

The laptop compares the server address with its own subnet. The server is remote, so the laptop sends through its default gateway at 192.168.1.1. If the gateway MAC address is missing from its cache, the laptop uses ARP (Address Resolution Protocol) to ask which local interface has that IPv4 address.

The IP packet still names 203.0.113.20 as its destination. The first Ethernet frame names the gateway MAC as its destination. The switch forwards that frame towards the gateway; the cable carries the signals. At the router, a route lookup selects the next hop and the outgoing link gets its own frame. ARP does not discover the remote server MAC across the router.

Which devices work at which layer?

A device is usually described by the highest layer it reads to make its forwarding decision. Watch how far “up” each device looks:

Diagram
How far up the layers each device looks
How far up the layers each device looks
LaptopL1–L7Switchreads L2Routerreads L3Firewallreads L3–L7Web serverL1–L7

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

  1. 1. Switch: layer 2. It learns the source MAC address, looks up the destination MAC address and forwards the frame out of the right port.
  2. 2. Router: layer 3. It removes the frame, reads the destination IP address, chooses the next hop and builds a new frame.
  3. 3. Firewall: layers 3 to 7. It checks the IP addresses and the TCP port. A modern firewall may also inspect the application data.
  4. 4. Hosts: all seven. The web server unwraps every layer to reach the HTTP request itself.
LayerDevices
1 PhysicalCables, connectors, hubs, repeaters, media converters, modems
2 Data LinkSwitches, access points, NICs
3 NetworkRouters, Layer 3 switches
4 to 7Firewalls, load balancers, proxies, and every host

Real devices often work at several layers at once. A home router, for example, is a switch (L2), a router (L3) and a firewall with NAT (L3/L4) in one box.

Learn more: Comparing Network Devices

MAC address, IP address and port: different jobs

IdentifierLayerWhat it identifies
MAC address2The sender or next recipient on one local link
IP address3A network interface across an IP network
TCP/UDP port4An application endpoint or service

An HTTPS connection might look like this:

FieldExample
Client IP192.168.1.20
Server IP203.0.113.20
Client source port51524 (temporary)
Server destination port443
TransportTCP

The reply reverses the ports: source port 443, destination port 51524. (203.0.113.20 is a documentation address, not a live server.)

Common protocols and ports

Port numbers belong to the transport protocols (TCP and UDP), not to the OSI layers in general.

ServiceTransportPort
HTTPTCP80
HTTPS (HTTP/1.1, HTTP/2)TCP443
HTTPS (HTTP/3)QUIC over UDP443
DNSUDP and TCP53
SSHTCP22
DHCPv4 server / clientUDP67 / 68

These are common defaults, not proof of which application sent a packet, because services can run on other ports. ICMP (used by ping) has no ports at all: it is carried directly inside IP.

Learn more: Common Ports to Know

Encapsulation: wrapping data for delivery

On the way down the sender's stack, each protocol adds its own control information, usually a header. This is called encapsulation. On the way up, the receiver removes the relevant protocol information again. This is de-encapsulation(also called decapsulation). Corresponding protocols interpret their fields; a router can also inspect other fields for filtering or policy.

Step 1 of 17

You type a message. The chat app hands it to the network stack.

Your laptopSee you at 6!Encapsulation ↓Chat serverSee you at 6!De-encapsulation ↑7Application6Presentation5Session4Transport3Network2Data Link1Physical7Application6Presentation5Session4Transport3Network2Data Link1PhysicalHTTPDataHTTPDataHTTPDataformatted (e.g. encrypted)HTTPDataformatted (e.g. encrypted)HTTPDatasession trackedHTTPDatasession trackedTCPHTTPDataTCPHTTPDataIPTCPHTTPDataIPTCPHTTPDataEthIPTCPHTTPDataFCSEthIPTCPHTTPDataFCS0110 1001 1100…0110 1001 1100…Networks and routers
Each layer adds its own header on the way down and removes it on the way up. Ethernet is the only one here that also adds a trailer: the FCS, an error check at the end of the frame.

The names of the data units follow the encapsulation shown at the start:

Diagram
Encapsulation: wrapping data for delivery
Encapsulation: wrapping data for delivery
StageUnitWhat's added
ApplicationDataThe request or response content
TCPSegment (UDP: datagram)Ports, sequence numbers and other TCP fields
IPPacketSource and destination IP addresses
EthernetFrameMAC addresses, EtherType and an error-check trailer
PhysicalBitsLink-specific signalling
Read each row across: the left box names the item, the others describe it.

Here's what the finished Ethernet frame looks like:

Preamble7 BSync pattern
SFD1 BStart of frame
Destination MAC6 BWho it's for
Source MAC6 BWho sent it
EtherType2 Be.g. 0x0800 = IPv4
Payload46–1500 BIP packet (+ padding)
FCS4 BError check (CRC)
On the wire only (8 B)
Ethernet header: 14 B
Frame: 64–1518 bytes (destination MAC → FCS)
Ethernet II frame. The preamble and SFD are transmitted before the frame but aren't counted in its size. Payloads under 46 bytes are padded; 802.1Q VLAN tags add 4 bytes.

This is simplified: HTTPS also adds TLS protection, and a large message is split across many packets. The encapsulation lesson follows every header as it is added and removed, with real addresses, and shows what changes at a router.

Learn more: Encapsulation and De-encapsulation

OSI compared with TCP/IP

TCP/IP is the protocol suite the internet actually runs on. Its common model has four layers. You can switch the diagram to the five-layer view that many courses use:

OSI ↔ TCP/IP (4-layer view)
7ApplicationHTTP, DNS, DHCP, SSH
6PresentationEncoding, compression, encryption
5SessionSetting up and ending sessions
4TransportTCP, UDP · ports
3NetworkIPv4, IPv6, ICMP · routers
2Data LinkEthernet, Wi-Fi · MAC · switches
1PhysicalCables, fibre, radio · bits
Application
Transport
Internet
Link / Network Access
The mapping is a teaching approximation, not an exact equivalence. Always check which model a diagram uses.
Diagram
OSI compared with TCP/IP
OSI compared with TCP/IP
OSI layersTCP/IP layerExamples
7, 6, 5ApplicationHTTP, DNS, DHCP, SSH, plus security and session functions
4TransportTCP, UDP
3InternetIPv4, IPv6, ICMP
2, 1Link / Network AccessEthernet, Wi-Fi, physical transmission
Read each row across: the left box names the item, the others describe it.

Use OSI numbers to talk about problems, and TCP/IP to understand what actually runs.

Learn more: The TCP/IP Model

A laptop opens a website

Assume the laptop already has working IP settings and the site uses HTTPS over TCP. Select any step to see which layers are involved.

Step 1 of 9 · DNS query
Laptop
DNS server
Gateway
Web server

1. DNS query · Application · UDP 53

What's the address of example.com?

Tap this step's arrow for the details.

Device key: Gateway (router)

Arrows run from each message's sender to its receiver. Rows show message order, not separate cables or elapsed time to scale. Port numbers identify services or conversations, not physical switch sockets.

Logical view: DNS traffic to a remote resolver also passes through the gateway. HTTP/3 replaces the TCP and TLS steps with QUIC over UDP, which builds in TLS.

Name resolution → next hop → transport → security and the application.

In order, the important steps are:

  1. Name resolution: get the server's IP address, unless it is already cached.
  2. Next-hop choice: is the destination local, or does it need the gateway?
  3. Local delivery: find the next hop's MAC address with ARP if needed.
  4. Transport setup: open the TCP connection.
  5. Security and application: negotiate TLS and send the HTTP request.

A later lesson follows the same request packet by packet.

Learn more: What Happens When You Open a Website?

What a failure looks like at each layer

Each layer depends on the one below it, so a failure at a low layer breaks everything above it. A failure at a high layer leaves the lower layers working:

Diagram
What a failure looks like at each layer
What a failure looks like at each layer
LayerExample symptomCheck
PhysicalNo link lightCable, power, fibre, transceiver, interface status
Data linkLink up, but local devices unreachableWi-Fi association, switch port, MAC learning, interface errors
NetworkOther networks unreachableIP address, mask, gateway, routes
TransportHost reachable, service isn'tIs the service listening? Is the port filtered?
ApplicationConnects, but the request failsDNS, certificates, authentication, application logs
Read each row across: the left box names the item, the others describe it.

Try it: where does it break?

A laptop opens https://example.com. Pick a fault and watch how far the request gets. The lowest layer that fails stops everything above it.

Diagram
Finding the failing layer
Finding the failing layer
Fault:
LaptopIP 192.168.1.20SwitchRouterIP 192.168.1.1Firewallexample.comIP 203.0.113.20Frame02:00:00:00:00:20 → 02:00:00:00:00:01Packet192.168.1.20 → 203.0.113.20TCP 51524 → 443

Device key: example.com (server)

Lines show the example’s network connections. Thick links: uplinks/WAN, as labelled. The coloured path and envelope follow the current step; its text identifies the sender, receiver and traffic type.

Reading the addresses

IP labels identify interfaces or destinations. Subnet labels identify networks; /n is the prefix length. A router ID (RID) identifies a routing process and need not be a reachable interface.

An IP address alone is not a URL. A web URL includes a scheme such as https://; an address on a router or printer does not imply a website.

MAC addresses identify link-layer interfaces or destination groups. They are not IP addresses or website URLs.

  • Laptop: IP 192.168.1.20
  • Router: IP 192.168.1.1
  • example.com: IP 203.0.113.20

Frame 02:00:00:00:00:20 to 02:00:00:00:00:01. Packet 192.168.1.20 to 203.0.113.20.

Tip: click or tap a device to see its details.

  1. 1. Layers 1–3 on the first link: the frame goes to the router's MAC address; the packet is addressed to 203.0.113.20.
  2. 2. New frame, same packet: the router strips the frame, routes the packet and builds a new frame for the next link.
  3. 3. Layer 4 allowed: the firewall permits TCP port 443 and NAT gives the packet a public source address. The server receives the request.
  4. 4. Reply: the page comes back the same way. Every layer worked.
Work up from layer 1: the first layer that fails explains the symptom.

Working up the stack from a Windows PC

Many engineers check from the bottom up: they prove that each layer works before moving to the next one. Useful commands on a Windows PC:

Diagram
Working up the stack from a Windows PC
Working up the stack from a Windows PC
LayerCommandWhat to inspect
1–2ipconfig /all, netsh wlan show interfacesAdapter configuration and reported link/association state; not proof of end-to-end delivery
2–3arp -aThe local ARP cache; an entry can be stale and does not prove the gateway is currently reachable
3ping 192.168.1.1, tracert 203.0.113.20Echo replies and route-hop responses when permitted; missing replies can also be filtering
4Test-NetConnection host -Port 443A TCP connection to the service opens
7nslookup example.com, the browserDNS replies and application behaviour are separate checks
Read each row across: the left box names the item, the others describe it.

PowerShell's Test-NetConnection tests DNS (layer 7), IP (layer 3) and TCP (layer 4) in one command:

Example output
PS C:\> Test-NetConnection example.com -Port 443

ComputerName     : example.com
RemoteAddress    : 203.0.113.20
RemotePort       : 443
InterfaceAlias   : Wi-Fi
SourceAddress    : 192.168.1.20
TcpTestSucceeded : True
What to look for: a value in RemoteAddress means DNS (layer 7) turned the name into an IP address. SourceAddress shows the PC's own IP address (layer 3). TcpTestSucceeded : True means a TCP connection to port 443 opened (layer 4). False only says the handshake didn't complete: nothing may be listening, a firewall may be dropping or rejecting it, the host may be down, or the path or a policy may differ for TCP. If the connection opens and the website still fails, look at TLS or the application itself.

A successful ping shows that ICMP echo got there and back: layers 1 to 3 work for that traffic, at that moment. It doesn't prove that HTTPS on port 443 works, because firewalls and policies can treat TCP differently from ICMP. “Ping works but the site doesn't load” is one of the most common help-desk reports, and the answer is often at layer 4 or above: a blocked port, a stopped service or a certificate problem.

Learn more: Bottom-Up, Top-Down, Divide and ConquerA Troubleshooting Method

Ways the model gets misapplied

  • Thinking every packet has seven headers. Real traffic uses TCP/IP, and layers 5 and 6 rarely have a header of their own.
  • Calling everything a “packet”. A frame is layer 2, a packet is layer 3 and a segment is layer 4. Using the right word shows which layer you mean.
  • Saying a switch works at layer 3. A normal switch forwards frames using MAC addresses (layer 2). Only a Layer 3 (multilayer) switch can also route.
  • Placing ports at layer 3. Ports belong to TCP and UDP at layer 4; IP addresses are layer 3.
  • Treating the browser as “the application layer”. The browser is an application that uses layer 7 protocols such as HTTP and DNS.
  • Forcing every protocol into one layer. ARP sits between layers 2 and 3, and TLS spans layers 5 to 7. The model is a guide, not a strict rule.
Five things to carry forward
  • PDUs: bits (1), frame (2), packet (3), segment or datagram (4), data (5–7).
  • Switches work at layer 2, routers at layer 3, firewalls at layers 3 to 7; hosts use all seven.
  • MAC addresses, IP addresses and ports do different jobs at layers 2, 3 and 4.
  • The sender wraps data in headers; the receiver removes them in reverse order.
  • OSI is the shared vocabulary; TCP/IP (taught with four or five layers) is what actually runs.

Which layer is failing? Six scenarios

Predict · scenario 1

Test-NetConnection example.com -Port 443 shows RemoteAddress : 203.0.113.20 and TcpTestSucceeded : False. Ping to 203.0.113.20 works. Which layer is failing?

Predict · scenario 2

A laptop's Ethernet port shows no link light at all. At which layer should you start looking?

Predict · scenario 3

A PC can ping the web server's IP, but the website won't load in the browser.

Predict · scenario 4

A router receives data from one network and must forward it to another. What is the layer 3 PDU it works with, and which addresses does it read?

Predict · scenario 5

A frame arrives on one port and must be forwarded out of the correct port inside the same LAN, using the destination MAC address. Which device does this?

Predict · scenario 6

Users can reach websites by IP address but not by name. Which layer and service is the most likely cause?

From OSI to the TCP/IP model

Continue with The TCP/IP model to see the four layers that really run the internet, then Encapsulation and de-encapsulation to watch each header being added and removed. For layer 2 details, read Ethernet fundamentals and MAC addresses.

Technical references

Layer mappings describe functions; real implementations do not need a separate module or header for each OSI layer.

FAQ

Do I need to memorise both models?
Yes. Engineers use the OSI layer numbers as shared vocabulary when troubleshooting, for example "that's a layer 2 issue". The TCP/IP model describes the protocols that actually run. Learn both, and learn how their layers map to each other.
Is TCP/IP four layers or five?
A common model has four layers: Application, Transport, Internet and Link. Many courses, including CCNA material, split Link into Data Link and Physical, which gives five. Neither is wrong; check which version a diagram or exam question uses.
Why do two models even exist?
OSI came from a standards body (the ISO) that designed a vendor-neutral reference model. TCP/IP grew out of the protocols that people actually built and deployed. TCP/IP won in practice, and OSI became the shared vocabulary.
What is a "layer 8" problem?
It is engineers' humour for user error. The joke is that the problem sits above layer 7, with the person using the device, so it isn't in the network at all.