Networking foundations

OSI Model, TCP/IP Model & Encapsulation

The models are maps for thinking about communication. They help you ask where a problem is happening, what information is being added, and which device or protocol is involved.

The big idea

One message, several jobs.

When you visit a secure website, the computer does not throw the webpage directly onto a cable. Applications create data; transport protocols identify conversations; network protocols identify source/destination networks; local-link technologies move frames across each link; and the physical layer represents the bits as signals.

Memory phrase: All People Seem To Need Data Processing = Application, Presentation, Session, Transport, Network, Data Link, Physical. Use the phrase to remember order, then learn what each layer actually does.
7

Application

User-facing network services and application protocols. Think HTTP/HTTPS, DNS, DHCP, SMTP and other services used by applications.

Data
6

Presentation

How data is represented: translation/formatting, encoding, compression, and encryption concepts. Think “make the data understandable/presentable.”

Data
5

Session

Establishes, manages, and ends communication sessions/dialogs between applications.

Data
4

Transport

End-to-end transport using protocols such as TCP or UDP. Port numbers identify application conversations/services.

Segment (TCP) Datagram (UDP)
3

Network

Logical addressing and routing between networks. IP addresses live here conceptually; routers make forwarding decisions here.

Packet
2

Data Link

Local-link delivery, framing, MAC addressing, and error-detection information such as an Ethernet frame check sequence.

Frame
1

Physical

Bits represented as electrical, optical, or radio signals through media and interfaces.

Bits

TCP/IP model

The practical Internet model groups the jobs differently.

TCP/IP layerRough OSI mappingMain ideaExamples
ApplicationOSI 7–5Application services, data representation, sessionsHTTP/HTTPS, DNS, DHCP, SMTP, SSH
TransportOSI 4Process-to-process delivery and portsTCP, UDP
InternetOSI 3Logical addressing and routingIPv4, IPv6, ICMP
Network AccessOSI 2–1Frames, local addressing, media and signalsEthernet, Wi-Fi, cabling/radio
Important: The mapping is a learning comparison, not proof that the two models are identical. OSI is a seven-layer reference model; the TCP/IP model groups real Internet networking functions into fewer layers.

Encapsulation

Each layer adds information needed for its job.

Application data
“Get the webpage”
Transport
adds TCP/UDP header
Network
adds IP header
Data Link
adds frame header + trailer
Physical
sends bits/signals
Destination
de-encapsulates upward

Encapsulation = wrap going down

The sending device adds control information as data moves down the stack. A simplified view is:

Data → segment/datagram → packet → frame → bits

De-encapsulation = unwrap going up

The receiving device interprets/removes the relevant control information as the message moves upward until the application receives the data.

Bits → frame → packet → segment/datagram → data

What is in a header?

Headers are instructions and identifying information—not the user message itself.

TCP/UDP header

Includes source and destination port numbers. TCP also contains fields used for sequencing, acknowledgments, flags, and other connection/reliability functions.

IP header

Includes source and destination IP addresses plus information used to handle and route the packet.

Ethernet frame header

Includes source and destination MAC addresses for the current local-link delivery. The frame also includes a trailer used for error detection.

Payload

The payload is what a layer is carrying from the layer above. To Ethernet, for example, the IP packet is payload. To IP, the transport segment/datagram is payload.

Key troubleshooting insight: IP addresses generally describe end-to-end logical source/destination communication, while Layer 2 frame addressing is used on each local link. As traffic crosses a router, the Layer 2 frame is replaced for the next link while the routed IP packet continues toward its destination (subject to networking functions that may modify it).

Devices at each layer

Use layers as a troubleshooting guide—not rigid boxes.

LayerDevices / examplesWhat you might check
7–5Endpoints, application services, proxies/gateways depending on functionBrowser/app settings, DNS/service configuration, authentication, encryption/session issues
4Endpoints; stateful firewalls/load balancers can inspect transport informationTCP/UDP, port numbers, blocked service ports, connection state
3Router, multilayer switchIP address, subnet, default gateway, route, ICMP/reachability
2Switch, bridge, wireless AP bridging local trafficMAC address, VLAN, frame delivery, switch port
1Cables, connectors, transceivers, repeaters/hubs; radio/physical signalLink light, cable, connector, signal, power, interference
Nuance matters: Modern devices often operate across multiple layers. A wireless access point, firewall, multilayer switch, or gateway may perform more than one networking function. Learn the function being described in the scenario.

Follow one secure webpage

From browser click to bits—and back.

1. Application

You request an HTTPS website. DNS may first help resolve the site's name to an IP address.

2. Transport

The communication uses transport-layer information, including ports. Traditional HTTPS commonly points learners to TCP port 443.

3. Internet / Network

IP adds logical source/destination addressing so routers can move the packet between networks.

4. Network access

Your local Ethernet or Wi-Fi link frames the packet for the next hop and sends it as physical/radio signals.

5. Routers forward

At each routed hop, the incoming local-link frame ends there. The router forwards the IP packet inside a new Layer 2 frame appropriate for the next link.

6. Destination unwraps

The receiving system de-encapsulates the information up the stack so the web service can process the request; the response makes its own trip back.

Notebook

Build a model you can redraw from memory.

OSI accordion

Seven flaps: layer number/name on front; function, PDU, addressing, device/example, and one troubleshooting clue underneath.

Encapsulation strip

Draw nested boxes: Ethernet [ IP [ TCP/UDP [ DATA ] ] ]. Label MAC addresses on the frame, IP addresses on the packet, and ports on the transport header.

Memory test: Close your notes and redraw: Data → Segment/Datagram → Packet → Frame → Bits, then reverse it for de-encapsulation.