Lesson 2 of 8 · 25 minutes

Layers and encapsulation

Understand what a frame, packet, segment, and application message each contribute.

What you will learn

  • Trace application data through link, internet, and transport layers.
  • Match common protocols to their role.
  • Separate a useful reference model from literal packet contents.

Use layers to organise questions

The OSI reference model names seven layers: physical, data link, network, transport, session, presentation, and application. Use it as a troubleshooting guide: is there a signal, local delivery, a route, a transport conversation, and a functioning application? Actual internet protocols do not always divide neatly into all seven layers.

A practical TCP/IP view groups work into link, internet, transport, and application layers. Ethernet and Wi-Fi provide link delivery; IP provides addressing and forwarding across networks; TCP or UDP connects application endpoints; DNS and HTTP define application messages.

Wrap the data for delivery

Encapsulation adds control information as data moves toward the wire. For a simple HTTP exchange over TCP and Ethernet, application bytes sit inside a TCP segment, inside an IP packet, inside an Ethernet frame. The receiver interprets these layers to deliver the bytes to the right application.

Each header answers a different question. Ethernet identifies local-link delivery addresses. IP identifies source and destination network addresses. TCP identifies ports and tracks an ordered byte stream. The physical layer sends the resulting bits as electrical, optical, or radio signals.

Watch what changes at a router

For a remote destination, the sender addresses the local frame to its next-hop router. The router removes the incoming link wrapper and builds an appropriate wrapper for the next link. The remote server’s IP address still identifies the destination, although address translation can change IP addresses along some paths.

A capture shows the headers visible at its observation point. Do not expect a frame captured on your laptop to contain the remote web server’s MAC address. The local next hop and the final destination solve different parts of the delivery problem.

Keep these points in mind

  • Trace application data through link, internet, and transport layers.
  • Match common protocols to their role.
  • Separate a useful reference model from literal packet contents.

Pause and practise

In Ethernet → IPv4 → TCP → HTTP, identify the layer used for the next-hop MAC address, remote IP address, destination port, and requested web resource.

Show a worked response

Ethernet supplies the next-hop MAC address, IPv4 the remote IP address, TCP the destination port, and HTTP the requested resource. A router changes the link-layer wrapper as the packet moves between links.

Check your understanding

Choose the best response to each scenario, then check your reasoning. These are course practice questions.

1. Which order describes this encapsulation from outermost to innermost?

0 of 1 answered

Next lesson →
← Previous lesson