OSI Layers

Published on:

Most important CLI commands

  • ip link — inspect the network interfaces that carry local traffic.
  • ip route get DESTINATION — ask Linux how it would route an IP packet.
  • curl -v URL — observe parts of an application request, including connection and protocol details.
Command or option Meaning
ip -br link show Show network interfaces and their link state in a brief format.
ip route get 1.1.1.1 Show the route Linux would use for this destination without sending a test packet.
curl -v Display connection and protocol details while performing the request.
--max-time 10 Limit the complete request to ten seconds.
--output /dev/null Discard the response body after receiving it.
https://example.com/ Use a public HTTPS endpoint for the observation.

The OSI layer numbers are a conceptual guide. These commands inspect real Internet networking, whose protocols do not always map to one OSI layer perfectly.

Core concepts

1. Layers divide communication into responsibilities

The OSI model divides network communication into seven layers. Each layer provides a service to the layer above and uses the service of the layer below.

When an application sends data, each layer adds or interprets information needed for its responsibility. This is often called encapsulation. At the receiving side, the information is processed in the opposite direction.

The model helps you ask a focused question. Is the problem with the local connection, IP routing, a transport connection, encryption, or the application protocol?

2. The seven layers describe different jobs

The layers are numbered from the physical connection upward:

  1. Physical — carries bits as electrical, optical, or radio signals.
  2. Data Link — moves frames across a local link; Ethernet and MAC addresses belong here.
  3. Network — moves packets between networks; IP addresses and routing belong here.
  4. Transport — provides communication between application endpoints; TCP, UDP, and port numbers belong here.
  5. Session — manages conversations and their continuity between applications.
  6. Presentation — handles data representation, encoding, and transformations such as encryption.
  7. Application — defines protocols used by applications, such as HTTP and DNS.

A layer describes a responsibility, not necessarily a separate program or device.

3. The Internet model groups some OSI layers together

Real Internet systems are usually described with a simpler stack: link, internet, transport, and application. Its application layer combines work that the OSI model separates into session, presentation, and application layers.

For example, HTTPS uses HTTP for application messages, TLS for security, TCP or QUIC for transport behavior, IP for routing, and a link technology such as Ethernet or Wi-Fi for the local hop. Calling TLS “layer 6” can be useful for learning, but real protocol relationships are more important than forcing every protocol into one numbered box.

4. Troubleshooting follows boundaries between layers

Success at one layer proves only that part of the path. An interface can be up while no IP route exists. A TCP connection can succeed while TLS certificate validation fails. TLS can succeed while the server returns an HTTP error.

Start with the symptom and test the nearest relevant boundary. Layer names help organize evidence; they do not replace examining the actual protocol, configuration, and error message.