Networking interview question · Most asked

Explain the OSI and TCP/IP models. Why do engineers still talk about 'layer 4' and 'layer 7'?

Create a free account to save this page, take notes and track your progress. Sign in

Summary

The TCP/IP model has four layers (link, internet, transport, application); the seven-layer OSI model is mostly used as vocabulary. 'Layer 4' means transport (TCP/UDP ports) and 'layer 7' means application (HTTP), so a layer 4 load balancer routes by IP and port while a layer 7 one can route by host, path or header.

Longer Answer

Each layer encapsulates the one above: an HTTP request inside a TCP segment, inside an IP packet, inside an Ethernet frame. Layer 3 is IP addressing and routing, layer 2 is MAC addresses and switches. Knowing the layer tells you which device or rule can affect a problem: security groups act on layers 3-4, a WAF on layer 7.

Key Points

  • TCP/IP: link, internet, transport, application.
  • OSI numbers are the common vocabulary.
  • L4 = IP and port; L7 = HTTP content.
  • Encapsulation adds a header per layer.

Deep dive: Networking Tutorial: OSI and TCP/IP Models

Explanation

What interviewers look for

Practical use of the models to reason about devices and rules, not memorised layer names.

More most-asked Networking questions

← All Networking questions

Was this page helpful?