Skip to main content

Computer Networks: Layers and Models

A computer network connects devices so they can exchange data. Networks are built in layers: each layer offers a service to the one above and hides the details of the one below.

OSI vs TCP/IP​

OSI layerTCP/IP layerUnit (PDU)Examples
7 ApplicationApplicationData / messageHTTP, DNS, SMTP, FTP
6 PresentationApplicationDataTLS, encoding, compression
5 SessionApplicationDataSessions, RPC
4 TransportTransportSegment (TCP) / datagram (UDP)TCP, UDP
3 NetworkInternetPacketIP, ICMP, routers
2 Data linkLinkFrameEthernet, Wi-Fi, switches
1 PhysicalLinkBitsCables, radio
TIP

Mnemonic (top to bottom): All People Seem To Need Data Processing.

Encapsulation​

Each layer wraps the data from the layer above with its own header (and sometimes a trailer):

Application data
+ TCP header -> segment
+ IP header -> packet
+ Ethernet header/trailer -> frame -> bits on the wire

The receiver removes the headers in reverse order (decapsulation).

Network types and topologies​

TypeScope
PANA person's devices (Bluetooth)
LANA building or campus
MANA city
WANCountries and continents (the Internet)

Common topologies: bus, star (most LANs), ring, mesh, tree.

Switching​

TechniqueIdea
Circuit switchingA dedicated path for the whole call (old telephone network)
Packet switchingData split into packets that are routed independently (the Internet)

Performance terms​

  • Bandwidth: maximum data rate of a link.
  • Throughput: actual data rate achieved.
  • Latency: time for one bit/packet to travel; RTT is the round trip.
  • Jitter: variation in latency.
  • Delay = transmission + propagation + queuing + processing.
Transmission delay = packet size / bandwidth
Propagation delay = distance / signal speed