Layering and protocol stacks

Layering, OSI and TCP/IP Reference Models

A computer network has to solve many separate problems at once: put bits on a wire, find the boundaries of a frame, detect damaged frames, share a medium, find a path across many networks, deliver data reliably between two programs, and give those programs names and conventions.

10 min readFormulasQuick revision

Switching and performance metrics

Circuit, Packet and Virtual-Circuit Switching

A network is a mesh of links and switches, and switching is the way data from one link is moved onto the next on its way to the destination. There are two fundamentally different answers.

10 min readFormulasQuick revision

Network Performance Metrics: Delay, Throughput and BDP

Link and path performance is described by a few quantities: how long a packet takes to cross a link or a path (delay or latency), how many bits per second actually arrive (throughput), and how many bits are "in flight" on a path at once (the bandwidth-delay product).

8 min readFormulasQuick revision

Error detection: parity, checksum and CRC

Error Detection: Parity, Hamming Distance and Internet Checksum

Noise, interference and faulty hardware flip bits. A receiver that cannot tell a damaged frame from a good one will pass garbage upward. Error detection adds redundant bits computed from the data; the receiver recomputes them and compares.

10 min readFormulasQuick revision

Cyclic Redundancy Check (CRC)

The cyclic redundancy check is the error-detecting code used in the trailer of almost every link-layer frame: Ethernet's 32-bit frame check sequence (FCS) is a CRC, and so are the checks in Wi-Fi, HDLC and PPP.

8 min readFormulasQuick revision

Medium access control and Ethernet

Medium Access Control: ALOHA, CSMA and CSMA/CD

When many stations share one broadcast channel (a coaxial cable, a hub, a radio frequency), two frames sent at overlapping times destroy each other: a collision. The medium access control (MAC) sublayer of the data link layer decides who may transmit when.

10 min readFormulasQuick revision

Ethernet, Switches and Bridges

Ethernet is the dominant wired local area network technology. Its original form was a shared bus (later a hub) on which all stations contended with CSMA/CD (Medium Access Control).

9 min readFormulasQuick revision

Distance-vector and link-state routing

Distance-Vector Routing

A router forwards each packet by looking up its destination in a forwarding table; routing is the process that fills that table. Routing algorithms come in two families. In link-state routing every router learns the whole topology and runs Dijkstra's algorithm itself (Link-State Routing).

9 min readFormulasQuick revision

Link-State Routing

In link-state (LS) routing every router learns the complete topology of its routing domain and computes shortest paths itself.

8 min readFormulasQuick revision

IPv4: addressing, CIDR, fragmentation and NAT

IPv4 Addressing and Header

IPv4 is the network-layer protocol of the Internet. It carries datagrams from a source host to a destination host across many networks, hop by hop, with no connection set-up and no guarantee of delivery, order or freedom from duplication: a best-effort service.

9 min readFormulasQuick revision

CIDR Notation and Subnetting

Classful addressing gave every network a fixed size: 2^24, 2^16 or 2^8 addresses. An organisation needing 2000 addresses had to take a class B block of 65,536 or several class C blocks, and every class C block was a separate entry in the Internet's routing tables.

9 min readFormulasQuick revision

IPv4 Fragmentation

Every link has a maximum transmission unit (MTU): the largest IP datagram, header included, that one link-layer frame can carry. Ethernet's is 1500 bytes; other links have larger or smaller ones. A datagram crossing several links may meet one whose MTU is smaller than the datagram.

8 min readFormulasQuick revision

Network Address Translation (NAT)

A home or office network typically has many hosts but one public IPv4 address.0/16), which are not routed on the public Internet and may be reused by every organisation.

7 min readFormulasQuick revision

UDP and TCP: flow control and congestion control

Transport Layer: UDP and TCP Basics

IP delivers datagrams between hosts, unreliably. The transport layer turns this into communication between processes, identified by 16-bit port numbers, and optionally adds reliability.

11 min readFormulasQuick revision

TCP Flow Control

A TCP receiver places arriving bytes in a receive buffer, from which the application reads them when it chooses. If the sender sends faster than the application reads, the buffer fills and further bytes would be lost.

8 min readFormulasQuick revision

TCP Congestion Control

Flow control stops a sender from overrunning its receiver.

9 min readFormulasQuick revision

Socket API

Socket API

An application reaches TCP and UDP through the operating system's socket interface, which first appeared in Berkeley UNIX and is now on nearly every system. A socket is an endpoint, named by a file descriptor, through which a process sends and receives data.

8 min readFormulasQuick revision

DNS and HTTP

Domain Name System (DNS)

com; IP needs addresses. The Domain Name System maps between them, and also tells mail systems where to deliver mail and gives aliases. It is a distributed, hierarchical database: no server holds all names. The namespace is a tree.

7 min readFormulasQuick revision

HTTP

The HyperText Transfer Protocol carries the Web. A client (browser) sends a request naming a resource and a method; the server sends back a response with a status code, header fields and usually a body.1 runs over TCP, by default on port 80 (443 for HTTPS, HTTP over TLS).

7 min readFormulasQuick revision