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
Networking foundations
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
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.
User-facing network services and application protocols. Think HTTP/HTTPS, DNS, DHCP, SMTP and other services used by applications.
DataHow data is represented: translation/formatting, encoding, compression, and encryption concepts. Think “make the data understandable/presentable.”
DataEstablishes, manages, and ends communication sessions/dialogs between applications.
DataEnd-to-end transport using protocols such as TCP or UDP. Port numbers identify application conversations/services.
Segment (TCP) Datagram (UDP)Logical addressing and routing between networks. IP addresses live here conceptually; routers make forwarding decisions here.
PacketLocal-link delivery, framing, MAC addressing, and error-detection information such as an Ethernet frame check sequence.
FrameBits represented as electrical, optical, or radio signals through media and interfaces.
BitsTCP/IP model
| TCP/IP layer | Rough OSI mapping | Main idea | Examples |
|---|---|---|---|
| Application | OSI 7–5 | Application services, data representation, sessions | HTTP/HTTPS, DNS, DHCP, SMTP, SSH |
| Transport | OSI 4 | Process-to-process delivery and ports | TCP, UDP |
| Internet | OSI 3 | Logical addressing and routing | IPv4, IPv6, ICMP |
| Network Access | OSI 2–1 | Frames, local addressing, media and signals | Ethernet, Wi-Fi, cabling/radio |
Encapsulation
The sending device adds control information as data moves down the stack. A simplified view is:
Data → segment/datagram → packet → frame → bits
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?
Includes source and destination port numbers. TCP also contains fields used for sequencing, acknowledgments, flags, and other connection/reliability functions.
Includes source and destination IP addresses plus information used to handle and route the packet.
Includes source and destination MAC addresses for the current local-link delivery. The frame also includes a trailer used for error detection.
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.
Devices at each layer
| Layer | Devices / examples | What you might check |
|---|---|---|
| 7–5 | Endpoints, application services, proxies/gateways depending on function | Browser/app settings, DNS/service configuration, authentication, encryption/session issues |
| 4 | Endpoints; stateful firewalls/load balancers can inspect transport information | TCP/UDP, port numbers, blocked service ports, connection state |
| 3 | Router, multilayer switch | IP address, subnet, default gateway, route, ICMP/reachability |
| 2 | Switch, bridge, wireless AP bridging local traffic | MAC address, VLAN, frame delivery, switch port |
| 1 | Cables, connectors, transceivers, repeaters/hubs; radio/physical signal | Link light, cable, connector, signal, power, interference |
Follow one secure webpage
You request an HTTPS website. DNS may first help resolve the site's name to an IP address.
The communication uses transport-layer information, including ports. Traditional HTTPS commonly points learners to TCP port 443.
IP adds logical source/destination addressing so routers can move the packet between networks.
Your local Ethernet or Wi-Fi link frames the packet for the next hop and sends it as physical/radio signals.
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.
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
Seven flaps: layer number/name on front; function, PDU, addressing, device/example, and one troubleshooting clue underneath.
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.