Module 00  /  Start here
7
6
5
4
3
2
1
Orientation

Follow one packet all the way down, and all the way back up.

Everything in networking is the same story told at different zoom levels: something takes data, wraps it in a header, hands it to the thing below, and the far end unwraps it in reverse. This lab walks that story from copper and photons up to application protocols, then takes detours into the areas people find hardest — subnetting, routing decisions, and time synchronisation.

How to use this

Read

Each module opens with the concepts and the exam-relevant facts, written to be read start to finish.

Play

Panels marked tool or drill are live. Change the inputs and watch the numbers move — that is where the understanding sticks.

Test

Every module ends with a check. Module 25 has flashcards and a randomised 15-question exam drawn from the whole lab.

The coloured squares in the top-right show which OSI layers the current module operates at. They light up as you move around, so you always know your altitude.

Four ways through

The modules run bottom-up: signals, then frames, then packets, then connections, then applications, then the operational skills that sit across all of them. Read straight through and it climbs the stack once. If you have a narrower goal, take one of these routes instead — every module is self-contained, and the line under each heading tells you what it assumes and where the topic is picked up again.

Certification route — CompTIA Network+

Everything in the exam objectives, and nothing that is not. About 14 modules.

Fastest to useful — diagnosing a real fault

If someone has handed you a broken network this week, do these in this order.

Modern infrastructure — cloud, containers and automation

For an infrastructure, platform or DevOps role rather than a network-engineering one.

Complete route

All 26 modules in order. The capstone at 24 is the test of whether it worked.

What this covers

The scope covers the CompTIA Network+ objective domains in full, and then goes past them: routing protocols, TLS and PKI, packet analysis, container and cloud networking, time synchronisation and automation are all beyond that syllabus.

DomainWhere it lives here
Networking concepts — models, ports, protocols, addressing, servicesModules 01, 04, 08, 10, 12
Network implementation — topologies, cabling, switching, routing, wirelessModules 02, 03, 05, 14
Network operations — documentation, monitoring, availability, DRModules 15, 20
Network security — CIA, threats, hardening, remote accessModule 19
Troubleshooting — methodology, cable/wireless/software toolsModules 07, 20, 21
Beyond the syllabus — routing protocols, TLS and PKI, HTTP and proxies, multicast and VoIP, host and container networking, data centre and internet architecture, packet analysis, design, automationModules 06, 09, 11, 13, 16, 17, 18, 21, 22, 23, 24
A note on numbers. Networking is full of values worth memorising (port 443, /24 = 254 hosts, 1500-byte MTU). Memorise them, but always attach them to a reason. The drills here are built to give you the reason as well as the number.

Self-assessment: where should you start?

drill

Answer honestly. Nothing is stored anywhere; this just points you at a module.

Module 01

Models & encapsulation

The OSI model is not a description of how software is actually written. It is a shared vocabulary: a way for two engineers to agree on where a problem lives before arguing about how to fix it. "It's a layer 1 issue" means go and look at the cable. That is the whole value of it.

The seven layers

Click any layer to inspect what happens there, what the unit of data is called, which devices operate at that level, and which protocols you would name in an exam answer.

OSI layer explorer

tool

Select a layer to inspect it.

Mnemonic, layer 7 down to 1: All People Seem To Need Data Processing. Bottom-up: Please Do Not Throw Sausage Pizza Away.

OSI versus the TCP/IP model

The internet was built on the TCP/IP (DoD) model, which collapses OSI's top three layers into one and its bottom two into one. Both are correct; they are different maps of the same territory. Exams ask you to translate between them.

OSITCP/IP modelTypical content
7 Application / 6 Presentation / 5 SessionApplicationHTTP, DNS, SMTP, TLS, SSH
4 TransportTransportTCP, UDP, QUIC
3 NetworkInternetIPv4, IPv6, ICMP, routing protocols
2 Data link / 1 PhysicalNetwork access (link)Ethernet, 802.11, cabling, fibre optics

Encapsulation: headers all the way down

When you send data, each layer prepends its own header (and layer 2 also appends a trailer). The result is a set of nested envelopes. Receiving is the same process in reverse, called de-encapsulation. The name of the bundle changes as it descends — this naming is examined constantly.

Encapsulation builder

tool
PDU: Data
Start at layer 7 with raw application data and work downwards.
Exam trap. "Segment" belongs to TCP; UDP's layer 4 unit is properly a datagram. Layer 3 produces packets, layer 2 produces frames, layer 1 moves bits. If a question mentions a MAC address, you are at layer 2 regardless of what else is in the sentence.

Header sizes worth knowing

Ethernet II

14-byte header (6 dest MAC, 6 source MAC, 2 EtherType) plus a 4-byte FCS trailer. Standard payload 1500 bytes.

IPv4

20 bytes without options. Contains TTL, protocol number, source and destination IP, header checksum.

IPv6

Fixed 40 bytes, no checksum, no in-transit fragmentation. Extension headers carry the extras.

TCP

20 bytes minimum, up to 60 with options such as window scaling and selective acknowledgement.

UDP

8 bytes: source port, destination port, length, checksum. That is the entire protocol overhead.

MTU maths

1500 MTU − 20 IP − 20 TCP = 1460-byte maximum segment size. Add a tunnel and that shrinks further.

MTU, MSS and why VPNs break things. A GRE or IPsec tunnel adds its own headers inside the same 1500-byte frame. If the inner packet still assumes a 1460-byte MSS, the result is fragmentation or, when the "don't fragment" bit is set and ICMP is blocked, a black hole: small packets work, large ones vanish. Symptom to recognise — SSH connects but a directory listing hangs; the site loads but images do not.

Topologies and traffic patterns

TopologyShapeWhere you meet it
Star / hub-and-spokeEvery node to a central deviceNearly all modern LANs; one switch failure isolates its segment
Mesh (full / partial)Many-to-many linksWAN cores, wireless mesh; full mesh needs n(n−1)/2 links
BusSingle shared backboneLegacy 10BASE2; still the model for a shared collision domain
RingClosed loop, often dual counter-rotatingToken Ring, FDDI, metro fibre rings, SONET protection
Three-tierCore → distribution → accessClassic campus design
Spine-leafEvery leaf to every spine, two hops maxData centres, driven by east-west server-to-server traffic

North-south traffic leaves the data centre toward users; east-west traffic moves between servers inside it. The shift from north-south to east-west is exactly why spine-leaf replaced three-tier designs.

Check yourself: models & encapsulation

drill
Module 02

The physical layer

Layer 1 is the only layer that is genuinely physical: voltage on copper, light in glass, radio in air. Its job is to turn ones and zeros into a signal a receiver can recover, and its failures are the most common and most under-diagnosed faults in any network.

Signalling and encoding

A wire cannot send "1". It sends a voltage. Encoding schemes define how a receiver recovers bits — and, critically, how it stays in time with the sender when a long run of identical bits offers no transitions to lock onto.

  • NRZ — high voltage is 1, low is 0. Simple, but a long run of zeros gives the receiver no clock reference and it drifts.
  • Manchester (10BASE-T) — every bit contains a mid-bit transition, so the clock is embedded in the data. Costs double the bandwidth for the same bit rate.
  • 4B/5B, 8B/10B, 64B/66B — map data words to slightly longer symbols chosen to guarantee transitions. 8B/10B carries 25% overhead; 64B/66B carries about 3%, which is why 10G and above use it.
  • PAM-4/PAM-5 — multiple voltage levels per symbol so each symbol carries more than one bit. 1000BASE-T uses PAM-5 across all four pairs simultaneously in both directions.

Baud rate is not bit rate. Baud counts symbols per second; bit rate counts bits per second. With PAM-4, one symbol carries two bits, so the bit rate is double the baud rate. Exams like this distinction.

Signal degradation over distance

tool

Copper

CategoryRated speedBandwidthMax lengthNotes
Cat 5100 Mbps100 MHz100 mObsolete for new installs
Cat 5e1 Gbps100 MHz100 m"e" = enhanced crosstalk specification
Cat 610 Gbps250 MHz55 m at 10G, 100 m at 1GHas a plastic spline separating pairs
Cat 6a10 Gbps500 MHz100 mShielded options resist alien crosstalk
Cat 7 / 7a10–40 Gbps600–1000 MHz100 m / 50 mFully shielded, GG45/TERA connectors
Cat 825–40 Gbps2000 MHz30 mData-centre top-of-rack patching only

Twisting is the point. Two conductors carrying equal and opposite signals pick up interference equally; the receiver subtracts one from the other and the noise cancels. Untwist more than 13 mm at a termination and you have built an antenna.

Copper faults and their fingerprints

Open

Conductor broken. No link light at all. A TDR reports the distance to the break.

Short

Two conductors touching. Link may flap or never come up.

Split pair

Pins are correct end to end, but wires are drawn from the wrong pairs. A basic continuity tester passes it; crosstalk is severe and gigabit fails. Needs a certifier.

Crossed / reversed pair

Tip and ring swapped. Auto-MDIX often masks it; older gear will not link.

Bottleneck symptom set

Increasing CRC/FCS errors on an interface counter almost always means a layer 1 problem, not congestion.

Duplex mismatch

One end full, one end half. Late collisions on the half-duplex side, terrible throughput, link stays up. Fix by matching both ends explicitly or leaving both on auto.

Pinouts

T568A and T568B differ only in swapping the orange and green pairs. Straight-through cables use the same standard at both ends; a crossover uses A at one end and B at the other. Modern switches negotiate this automatically with Auto-MDIX, but you still need to identify the pinouts on paper.

PinT568AT568BUsed by
1White/GreenWhite/Orange10/100 transmit
2GreenOrange10/100 transmit
3White/OrangeWhite/Green10/100 receive
4BlueBlueGigabit only
5White/BlueWhite/BlueGigabit only
6OrangeGreen10/100 receive
7White/BrownWhite/BrownGigabit only
8BrownBrownGigabit only

Fibre

Fibre carries light through a glass core surrounded by cladding of a lower refractive index, so light entering within the acceptance angle is totally internally reflected along the length. It is immune to electromagnetic interference, carries no ground potential between buildings, and is not tappable without detectable loss.

Multimode (MMF)

50 or 62.5 µm core, cheap 850 nm VCSEL sources, aqua or violet jacket. Many light paths means modal dispersion, which limits distance: OM3 300 m, OM4 400 m, OM5 up to 400 m at 10G. Campus and in-building.

Single-mode (SMF)

8–10 µm core, 1310/1550 nm lasers, yellow jacket. One path, minimal dispersion, tens to hundreds of kilometres. Costlier optics, cheaper cable.

Connectors: LC (small form factor, duplex clip — dominant today), SC (square push-pull), ST (bayonet twist), MPO/MTP (12 or 24 fibres in one ferrule, used for 40/100G breakouts), FC (screw, legacy). Polish types: UPC (blue, ultra physical contact) and APC (green, 8-degree angled, far better return loss for RF-over-glass and long haul). Never mate APC to UPC.

Transceivers: SFP (1G), SFP+ (10G), SFP28 (25G), QSFP+ (40G), QSFP28 (100G), QSFP-DD/OSFP (400G). Media converters bridge copper to fibre when a run exceeds 100 m. For short runs inside a rack, DAC (direct attach copper twinax, a few metres, cheap and low power) and AOC (active optical cable, up to tens of metres, immune to interference) come with the transceivers permanently attached, avoiding the cost of two optics plus a patch lead. BiDi optics send and receive on different wavelengths over a single strand, doubling the capacity of existing fibre where pulling more is impractical — they must be deployed in matched pairs.

Fibre fault checklist. Dirty end faces cause more outages than broken glass — inspect and clean before anything else. Then check: transmit and receive swapped (very common, shows as no link both ways), a bend below the minimum radius, wavelength mismatch between transceivers, or exceeding the optical power budget. An OTDR locates breaks and high-loss splices by distance; a light meter with a known source measures actual loss in dB.

Which medium would you specify?

drill

0 correct

Power over Ethernet

StandardNamePower at sourceAt devicePairs
802.3afPoE15.4 W12.95 W2
802.3atPoE+30 W25.5 W2
802.3bt Type 3PoE++ / 4PPoE60 W51 W4
802.3bt Type 4PoE++100 W71 W4

Watch the switch's total power budget, not just the per-port figure: thirty 30 W cameras need 900 W of budget. Power sourcing equipment (PSE) detects a powered device (PD) by signature resistance before applying voltage, so plugging in a laptop is safe.

Check yourself: physical layer

drill
Module 03

The data link layer

Layer 2 gets a frame from one interface to another on the same network segment. It has no concept of the wider internet — its entire world is the set of devices it can reach without a router. Everything a switch does follows from three rules it applies to every frame it receives.

MAC addresses

A MAC address is 48 bits, written as six hex octets. The first three octets are the OUI (organisationally unique identifier) assigned to the manufacturer; the last three are assigned by that manufacturer. They are meant to be globally unique and burned into the NIC, though every modern OS can override them — and phones randomise them per network to defeat tracking.

Unicast

Least significant bit of the first octet is 0. One specific recipient.

Multicast

That bit is 1, e.g. 01:00:5E:... for IPv4 multicast. A defined group.

Broadcast

FF:FF:FF:FF:FF:FF. Every device in the broadcast domain must process it.

Ethernet speeds and standards

The naming is systematic once you see it: speed, then BASE for baseband signalling, then the medium. T is twisted pair, X or R indicates the encoding, and S, L and E on fibre mean short, long and extended reach.

StandardSpeedMediumMaximum distance
10BASE-T10 MbpsCat 3+ twisted pair, 2 pairs100 m
100BASE-TX100 MbpsCat 5+ twisted pair, 2 pairs100 m
1000BASE-T1 GbpsCat 5e+, all 4 pairs both directions100 m
2.5GBASE-T / 5GBASE-T2.5 / 5 GbpsCat 5e / Cat 6100 m
10GBASE-T10 GbpsCat 6 (55 m) or Cat 6a100 m on Cat 6a
1000BASE-SX / LX1 GbpsMultimode / single-mode fibre550 m / 5 km
10GBASE-SR / LR / ER10 GbpsMultimode / single-mode fibre400 m / 10 km / 40 km

The 2.5G and 5G standards exist specifically to get more than a gigabit out of installed Cat 5e and Cat 6 without rewiring a building — they were driven by wireless access points outgrowing their uplinks.

What a switch actually does

A switch applies exactly three rules, forever:

  1. Learn. Record the source MAC of every incoming frame against the port it arrived on.
  2. Forward. If the destination MAC is in the table, send the frame out that one port only.
  3. Flood. If it is not in the table (unknown unicast), or is broadcast or multicast, send it out every port except the one it came in on.

Entries age out after about five minutes of silence. That is the entire behaviour — step through it below.

Switch MAC learning simulator

tool
sends to

CAM / MAC address table

Switch decision log

Table is empty. Send a frame to begin.

Collision and broadcast domains

A hub is a layer 1 repeater: one collision domain, one broadcast domain, everyone shares the bandwidth. A switch gives every port its own collision domain (which is why full duplex and CSMA/CD's retirement are possible) but all ports remain in one broadcast domain unless you add VLANs. A router breaks up broadcast domains — that is its defining layer 2 side-effect.

CSMA/CD (collision detection) governed half-duplex Ethernet: listen, transmit, detect a collision, jam, back off for a random interval. CSMA/CA (collision avoidance) is the wireless equivalent, because a radio cannot listen while transmitting; it uses RTS/CTS and acknowledgements instead.

VLANs

A VLAN splits one physical switch into several logical switches. Ports in VLAN 10 cannot reach ports in VLAN 20 without a router or a layer 3 switch, even though they share the same hardware. This is how you get separate broadcast domains, separate security zones, and separate subnets without buying more switches.

  • Access port — belongs to exactly one VLAN, carries untagged frames, faces an end device.
  • Trunk port — carries many VLANs between switches, tagging each frame with 802.1Q: a 4-byte tag inserted after the source MAC containing the 12-bit VLAN ID (1–4094) and a 3-bit priority field for QoS.
  • Native VLAN — the one VLAN sent untagged on a trunk. It must match on both ends, and leaving it as VLAN 1 is a classic finding in a security audit because of VLAN hopping via double tagging.
  • Voice VLAN — a phone with a built-in switch takes tagged voice traffic while the PC behind it stays untagged on the data VLAN.
  • Inter-VLAN routing — either a router-on-a-stick (one trunked physical link with subinterfaces) or, far more commonly, SVIs on a layer 3 switch.

VLAN reachability sandbox

tool

Assign each port a VLAN, then test whether two hosts can talk without a router.

pings
Awaiting test.

Spanning Tree Protocol

Redundant links between switches are essential and also fatal: a layer 2 loop has nothing to stop it, because an Ethernet frame has no TTL. A single broadcast circulates forever, multiplying at every switch, and the network melts within seconds — a broadcast storm. STP (802.1D, and today RSTP 802.1w) prevents this by blocking redundant paths until they are needed.

  1. Elect a root bridge — lowest bridge ID wins, where the bridge ID is priority (default 32768, configurable in steps of 4096) followed by the MAC address. Left to itself the oldest switch usually wins, which is rarely what you want; set the priority manually on your core.
  2. Each non-root switch picks one root port — the interface with the lowest cumulative path cost back to the root. Cost is inversely related to bandwidth: 10G = 2, 1G = 4, 100M = 19.
  3. Each segment picks one designated port — the port on that segment nearest the root forwards; every remaining port is blocked.

Variants worth naming: the original 802.1D STP runs one spanning tree for the whole switch, so every VLAN follows the same blocked links. PVST+ runs a separate tree per VLAN, which lets you balance load by making different switches root for different VLANs — at the cost of one tree per VLAN to compute. MSTP (802.1s) is the compromise: VLANs are mapped into a small number of instances, so you get per-instance load balancing with a fraction of the overhead. RSTP (802.1w) is the fast-converging behaviour that all of them now use.

Classic 802.1D port states are blocking, listening, learning, forwarding and disabled, taking up to 50 seconds to converge. RSTP cuts that to a second or two with discarding/learning/forwarding and proposal-agreement handshakes. PortFast (edge port) skips the delay on access ports; pair it with BPDU Guard, which shuts a port down if a BPDU arrives there — that means someone plugged a switch into a desk port. Two related protections: Root Guard on ports facing downstream switches refuses to accept a superior BPDU, so a new switch cannot take over as root and drag your traffic through a wiring closet; Loop Guard protects against a link that stops receiving BPDUs but stays physically up, which would otherwise let a blocked port wrongly start forwarding and create the loop STP existed to prevent.

Recognising a loop in the wild: all switch LEDs blinking in unison, CPU pegged, MAC addresses flapping between ports in the logs, and the network unusable but not "down". Unplug to isolate, then work out which redundant link lost its STP protection.

Link aggregation

LACP (802.3ad) bundles several physical links into one logical link for both bandwidth and resilience. Frames are distributed by a hash of source and destination addresses, so a single conversation still uses only one member link — four bonded 1G ports do not give one file transfer 4 Gbps. Both ends must agree, and STP treats the bundle as a single interface.

ARP: the joint between layers 2 and 3

A host knows the destination IP but must put a MAC address in the frame. ARP resolves one to the other. The host broadcasts "who has 192.168.1.1, tell 192.168.1.50"; the owner replies with its MAC by unicast; both cache the result for a few minutes. View it with arp -a.

  • Gratuitous ARP — an unsolicited announcement, used to detect duplicate addresses and to move a virtual IP during failover.
  • Proxy ARP — a router answers on behalf of a host in another subnet. Mostly a legacy nuisance.
  • ARP spoofing — since ARP has no authentication, an attacker replies to everything and becomes a man in the middle. Mitigate with Dynamic ARP Inspection plus DHCP snooping.
  • IPv6 has no ARP. It uses Neighbor Discovery over ICMPv6 with neighbor solicitation and advertisement messages.

Frame integrity and switching modes

Every Ethernet frame ends with a 4-byte FCS holding a CRC32 of the frame. The receiver recomputes it and silently discards mismatches — layer 2 detects errors but does not correct them; recovery is left to TCP. A store-and-forward switch buffers the whole frame and validates the FCS before forwarding. Cut-through forwards as soon as it has read the destination MAC, cutting latency but propagating corrupt frames. Runts are frames under 64 bytes, giants exceed the MTU, and jumbo frames (typically 9000 bytes) must be enabled consistently on every device in the path or you get silent drops.

Check yourself: switching

drill
Module 04

IP addressing & subnetting

Subnetting is the single topic that decides most Network+ results, and it is arithmetic, not theory. Once you can convert between decimal and binary confidently, everything else is bookkeeping. Work through the tools here until the answers arrive before the calculator does.

Binary, because everything is binary

An IPv4 address is 32 bits shown as four decimal octets. Each octet is eight bit positions with these values:

128   64   32   16   8   4   2   1

To convert 192 to binary, take the largest value that fits (128, remainder 64), then 64 (remainder 0): 11000000. To go back, add the positions holding a 1. Learn the eight valid subnet-mask octets by heart — they are the only ones that exist: 128, 192, 224, 240, 248, 252, 254, 255.

Address dissector

tool

Classes, private ranges and special addresses

ClassFirst octetDefault maskPrivate range (RFC 1918)
A1–126/8   255.0.0.010.0.0.0 – 10.255.255.255
B128–191/16   255.255.0.0172.16.0.0 – 172.31.255.255
C192–223/24   255.255.255.0192.168.0.0 – 192.168.255.255
D224–239Multicast—
E240–255Experimental—

Classful addressing is dead in practice — CIDR replaced it — but the class boundaries and private ranges are still examined. Other reserved blocks to recognise on sight:

  • 127.0.0.0/8 — loopback. The whole /8 is reserved; 127.0.0.1 is just the customary one.
  • 169.254.0.0/16 — APIPA / link-local. If a host has this, it asked for DHCP and got nothing. Diagnose the DHCP path, not the host.
  • 100.64.0.0/10 — carrier-grade NAT, used inside ISPs.
  • 224.0.0.0/4 — multicast; 255.255.255.255 — limited broadcast.

Masks, CIDR and the two numbers that matter

The mask splits the 32 bits into a network part (1s) and a host part (0s). Two formulas cover almost every question:

Usable hosts

2h − 2, where h is the number of host bits. Subtract two for the network address (all host bits 0) and the broadcast address (all host bits 1).

Subnets from borrowing

2b, where b is the bits borrowed from the host portion. Borrow 3 bits from a /24 and you get 8 subnets of 30 hosts each.

The block-size shortcut. Take 256 minus the interesting octet of the mask. A /26 is 255.255.255.192, so 256 − 192 = 64: subnets start at .0, .64, .128, .192. Any address between .64 and .127 belongs to the .64 network with .127 as its broadcast. This works in seconds and needs no binary at all.

Subnet calculator

tool

Bit view

Subnetting drill — timed practice

drill

Randomly generated questions in the style of the exam. Work it out on paper first.

0 / 0

Worked example: VLSM

You have 192.168.20.0/24 and need subnets for 100 users, 50 phones, 20 printers, and two point-to-point links. Allocate largest first, always rounding up to the next power of two:

RequirementHosts neededPrefixAllocationUsable
Users100/25192.168.20.0 – .127126
Phones50/26192.168.20.128 – .19162
Printers20/27192.168.20.192 – .22330
P2P link 12/30192.168.20.224 – .2272
P2P link 22/30192.168.20.228 – .2312

Point-to-point links use /30 (or /31 where supported, which dispenses with network and broadcast addresses entirely). Fixed-length subnetting would have wasted most of this /24.

Summarisation and supernetting

Subnetting divides a block. Summarisation does the reverse: it advertises several contiguous networks as one shorter prefix, so a neighbour holds one route instead of eight. Supernetting is the same arithmetic applied to what were once classful boundaries — the reason CIDR was invented.

The method is to write the candidates in binary and find how many leading bits they all share:

10.20.00000000.0 = 10.20.0.0/24 10.20.00000001.0 = 10.20.1.0/24 10.20.00000010.0 = 10.20.2.0/24 10.20.00000011.0 = 10.20.3.0/24 ^^^^^^^^^^^^^^ 22 bits identical → summarises as 10.20.0.0/22

Three rules decide whether a summary is safe. The blocks must be contiguous; the count must be a power of two; and the first block must sit on a boundary that is a multiple of the block count. 10.20.4.0/24 through 10.20.7.0/24 summarise to 10.20.4.0/22, but 10.20.3.0/24 through 10.20.6.0/24 do not summarise at all, however contiguous they look.

The risk of over-summarising. A summary advertises reachability for the whole range, including any part of it you do not actually own or that is currently down. Traffic for a missing subnet is drawn in and then dropped — a black hole that is invisible from outside. This is why summarisation belongs at deliberate boundaries you control, and why address plans that leave contiguous room per site are worth the effort.

IPv6

128 bits, written as eight groups of four hex digits. Compression rules: drop leading zeros in a group, and replace one run of all-zero groups with :: — once only, or the address becomes ambiguous.

2001:0db8:0000:0000:0000:ff00:0042:8329 → 2001:db8::ff00:42:8329
PrefixTypeEquivalent to
2000::/3Global unicastRoutable public address
fc00::/7 (fd00::/8 in practice)Unique localRFC 1918 private space
fe80::/10Link-localAPIPA — always present on every interface
ff00::/8MulticastMulticast; IPv6 has no broadcast at all
::1Loopback127.0.0.1
::/0Default route0.0.0.0/0

A /64 is the standard subnet size for any LAN because SLAAC requires 64 host bits: the router advertises a prefix and the host generates its own address, either from its MAC via EUI-64 (which inserts fffe in the middle and flips the seventh bit) or from a random value for privacy. Transition mechanisms worth naming: dual stack (run both, the preferred approach), tunnelling (6to4, Teredo, GRE), and NAT64/DNS64 for IPv6-only clients reaching IPv4 servers.

Check yourself: addressing

drill
Module 05

Routing & NAT

A router makes one decision, over and over: given this destination IP, which interface do I send it out of, and to which next hop? Everything about routing protocols exists only to populate the table that answers that question.

Where this sits: builds on module 04. The protocols that populate this routing table are module 06; the tools that diagnose it are module 07. QoS is introduced here and covered properly in module 13.

The forwarding decision

A router compares the destination against every route in its table and picks the longest prefix match — the most specific route wins, regardless of protocol or metric. A /32 host route beats a /24, which beats the /0 default route. Only if two routes have identical prefix lengths does the router compare administrative distance, and only then the metric.

SourceAdministrative distanceMeaning
Directly connected0The interface is up with an address in that subnet
Static route1An administrator typed it in
eBGP20Learned from an external autonomous system
OSPF110Link-state, cost based on bandwidth
RIP120Distance-vector, hop count, max 15
Internal BGP200Learned from inside the same AS

Lower AD means more trustworthy. It is a tie-breaker between protocols; metric is a tie-breaker within a protocol.

Routing table lookup — longest prefix match

drill
Destination: — which route is used?
0 correct

Static versus dynamic

Static routes are predictable, use no CPU or bandwidth, and do not adapt: if the link fails, traffic keeps being sent into the hole unless you add tracking. They suit stub sites and default routes. A floating static route is the standard trick for backup paths: configure a second static route to the same destination with a deliberately worse administrative distance — say 200 instead of 1 — so it stays out of the table until the preferred route disappears, then installs itself automatically. It is how a 4G backup link sits idle behind a leased line without any routing protocol at all.

Dynamic protocols discover topology, converge around failures, and scale — at the cost of complexity and of trusting your neighbours.

Distance-vector (RIP, EIGRP)

"Routing by rumour" — each router tells neighbours its whole table and trusts what it hears. Simple, slow to converge, prone to loops. Mitigations: split horizon, route poisoning, hold-down timers. RIP's 15-hop limit exists to bound the damage.

Link-state (OSPF, IS-IS)

Every router floods link-state advertisements so all routers build an identical map, then run Dijkstra's shortest-path algorithm locally. Fast convergence, loop free, more CPU and memory. OSPF uses areas with a mandatory backbone, area 0.

Path-vector (BGP)

The protocol of the internet. Exchanges full AS paths between autonomous systems and chooses on policy — local preference, AS path length, MED — not on speed. Converges in minutes, deliberately.

Hybrid (EIGRP)

Cisco's advanced distance-vector: DUAL algorithm, feasible successors held ready for instant failover, composite metric from bandwidth and delay.

IGP versus EGP: interior gateway protocols (RIP, OSPF, EIGRP, IS-IS) run inside one administrative domain; exterior gateway protocols (BGP) run between them.

First-hop redundancy

Hosts have one default gateway configured. If that router dies, they are stranded. FHRPs let two or more routers share a virtual IP and virtual MAC: VRRP (open standard), HSRP (Cisco), GLBP (Cisco, adds load balancing), and CARP (the free-software equivalent used by pfSense, OPNsense and BSD firewalls). The active router answers ARP for the virtual IP; on failure the standby takes over, usually sending a gratuitous ARP, and hosts never notice.

Network Address Translation

NAT rewrites addresses in the IP header as packets cross a boundary. It exists because IPv4 ran out of addresses, and it has the side effect of hiding internal structure.

  • Static NAT — one private address permanently mapped to one public address. Used for servers that must be reachable inbound.
  • Dynamic NAT — private addresses drawn from a pool of public ones, first come first served. Runs out when the pool does.
  • PAT / NAT overload — many private hosts share one public address, distinguished by source port. This is what your home router does, and what people usually mean by "NAT".
  • Port forwarding (destination NAT) — inbound traffic to a public port is redirected to a specific internal host and port.
  • Hairpin NAT (NAT loopback) — an internal host reaching its own public address. Without support for it, the request leaves for the router, gets translated, and comes back to an interface that will not accept it, so the site works from outside and fails from inside. The clean fix is split-horizon DNS returning the internal address to internal clients.
  • Double NAT — two translating devices in series, typically an ISP router in front of your own. Everything outbound works; inbound port forwarding requires configuring both, and some protocols break. Put the ISP device in bridge or modem mode where possible.
  • Carrier-grade NAT — the ISP translates too, so your "public" address is shared with other subscribers from 100.64.0.0/10. You cannot port-forward at all, inbound VPN and gaming break, and the usual answers are a static public address or an outbound tunnel to something you control.

PAT translation table

tool

Public address on the router: 203.0.113.7. Generate connections from internal hosts and watch how one public address serves them all.

The return packet arrives addressed to 203.0.113.7 on the translated port. The router looks that port up in this table and rewrites the destination back to the private address and original port. If the entry has expired, the packet is dropped — which is why unsolicited inbound traffic cannot reach your LAN, and why NAT is sometimes mistaken for a firewall.

Traffic shaping and QoS — in brief

When a link saturates, something must be prioritised. DSCP markings in the IP header and CoS in the 802.1Q tag classify traffic; queueing then decides who goes first. Policing drops traffic above a rate, shaping buffers and delays it instead. That is enough to read a router configuration — the classification, marking and trust-boundary detail, and the reason voice needs it at all, are covered properly in the multicast and real-time module.

Check yourself: routing

drill
Module 06

OSPF & BGP in depth

Module 05 covered what routing protocols are for. This one goes inside the two that matter most: the protocol that runs inside almost every enterprise, and the protocol that holds the internet together.

Where this sits: builds on module 05 — assumes you can read a routing table and know what longest prefix match and administrative distance mean. Revisited from the internet side in module 18.

OSPF

Every OSPF router floods descriptions of its own links to every other router in the area. Each then holds an identical link-state database and independently runs Dijkstra's shortest-path-first algorithm over it, placing itself at the root of the tree. Because every router computes from the same map, loops are impossible by construction.

Forming an adjacency

  1. Hello packets to 224.0.0.5 every 10 seconds on broadcast links discover neighbours. Both ends must agree on area ID, hello and dead intervals, subnet mask, authentication and stub flags — a mismatch in any one leaves the neighbour stuck and is the usual cause of "OSPF will not come up".
  2. States progress Down → Init → 2-Way → ExStart → Exchange → Loading → Full. Getting stuck in ExStart usually means an MTU mismatch; stuck in 2-Way on a broadcast segment is normal for two non-designated routers.
  3. On a multi-access segment, routers elect a DR and BDR so that n routers form 2n adjacencies rather than n(n−1)/2. Election is by highest priority, then highest router ID; priority 0 means never eligible. The election is not pre-emptive — a better router arriving later does not take over.

The router ID is a 32-bit value written like an IP: manually set, else the highest loopback address, else the highest active interface address. Set it explicitly, or a rebooted router can adopt a different identity and reshape your database.

OSPF cost and path selection

tool

Cost = reference bandwidth ÷ interface bandwidth, minimum 1. The default reference is 100 Mbps, which makes every link of 100 Mbps and above cost 1 — raise it on any modern network.

Comma-separated interface speeds in Mbps.

Areas and LSA types

Areas limit how far link-state flooding travels: routers inside an area know its full topology, and only summary information crosses the boundary. Every area must touch area 0, the backbone, directly or through a virtual link. An ABR sits between an area and the backbone; an ASBR injects routes from outside OSPF entirely.

LSANameCarries
Type 1Router LSAA router's own links, flooded within its area
Type 2Network LSAGenerated by the DR, describing routers on a multi-access segment
Type 3Summary LSANetworks in one area advertised into another by an ABR
Type 4ASBR SummaryHow to reach an ASBR from another area
Type 5External LSARoutes redistributed from outside OSPF. E1 adds internal cost to external; E2 (the default) uses the external cost alone
Type 7NSSA ExternalExternals inside a not-so-stubby area, converted to type 5 at the ABR

Stub areas block type 5 externals and substitute a default route; totally stubby areas block type 3 as well. Both exist to shrink the database on small routers. Summarisation happens only at ABRs and ASBRs — you cannot summarise in the middle of an area, because that would corrupt the shared map.

BGP

BGP does not look for the fastest path. It looks for the path that policy prefers, between organisations that do not trust each other. Each autonomous system has a number (32-bit since 2007; 64512–65534 are private) and advertises which prefixes it can reach, prepending its own AS to the AS_PATH as the advertisement travels. A router that sees its own AS in a received path discards it — that is the entire loop-prevention mechanism.

  • eBGP runs between different AS numbers, typically directly connected, TTL 1 by default. iBGP runs inside one AS and requires a full mesh or route reflectors, because iBGP-learned routes are never re-advertised to other iBGP peers.
  • Peers connect over TCP 179, exchange OPEN, then UPDATE messages, and hold the session up with KEEPALIVEs. It is incremental: once converged, only changes are sent.
  • Transit is paying someone to reach the whole internet. Peering is two networks exchanging their own customers' traffic, usually settlement-free, often at an internet exchange point.

BGP path selection

drill

Two paths to the same prefix. Which one is installed? Work down the decision list in order — the first difference decides it.

0 correct

The decision order, simplified but in the right sequence: highest weight (Cisco-local), highest LOCAL_PREF (consistent across your AS — the main lever for outbound traffic), locally originated routes, shortest AS_PATH, lowest origin type, lowest MED (a hint to your neighbour about their inbound preference, only compared between paths from the same AS), eBGP over iBGP, lowest IGP metric to the next hop, then oldest route and lowest router ID as tie-breakers.

Controlling traffic: you influence outbound traffic easily with LOCAL_PREF. Influencing inbound traffic is harder because it depends on other people's policy — the usual tools are AS-path prepending (making your path look longer on the link you would rather not receive on), MED, and BGP communities, which are tags a provider publishes to let you request behaviour such as "do not advertise this to peer X".

Route filtering is not optional. Without prefix lists and maximum-prefix limits, a misconfiguration leaks routes you do not own, and the internet believes you. Modern practice adds RPKI origin validation so a route's origin AS can be cryptographically checked against the address holder's records.

Check yourself: OSPF & BGP

drill
Module 07

ICMP, path tools & MTU

ICMP is not a transport protocol and carries no user data. It is the network's own signalling channel — the way a router tells a sender "that was too big", "nobody is there", or "you ran out of hops". Two of the most-used diagnostic tools in existence are built entirely from it, and blocking it wholesale breaks things that look nothing like a ping.

Where this sits: builds on modules 04 and 05. These tools reappear as part of a method in module 20, and at packet level in module 21.

The messages that matter

TypeMessageWhat it tells you
8 / 0Echo Request / Echo ReplyThe basis of ping. A reply proves layers 1–3 work in both directions.
3Destination UnreachableThe code carries the detail: 0 network unreachable, 1 host unreachable, 3 port unreachable (which is how UDP traceroute knows it arrived), 4 fragmentation needed but DF set — the message path MTU discovery depends on, 13 administratively prohibited (a firewall said no).
11Time ExceededTTL hit zero in transit. This is what every traceroute hop is made of. Code 1 means a fragment reassembly timeout.
5Redirect"There is a better first hop for that destination on this same subnet." Often disabled, since it can be abused to divert traffic.
12Parameter ProblemA malformed header field.
4Source QuenchDeprecated congestion signal. Modern networks use ECN instead.

ICMPv6 does far more than its v4 counterpart: it carries Neighbor Discovery (replacing ARP), Router Solicitation and Advertisement (which drive SLAAC), and multicast listener discovery. Filtering ICMPv6 the way people filter ICMPv4 breaks IPv6 outright — the address configuration itself depends on it.

Why blocking all ICMP hurts. Type 3 code 4 is how a sender learns a downstream link has a smaller MTU. Drop it and path MTU discovery fails silently: the sender keeps emitting full-size packets with DF set, a router keeps discarding them, and nothing ever reports why. Small packets pass, large ones vanish — the classic black hole. Rate-limit ICMP if you must; do not blanket-deny it.

Ping, properly

Ping sends an echo request with a sequence number and a payload, and times the reply. What it actually proves: the destination is reachable, the return path exists, and neither direction is dropping at that size. What it does not prove: any application is running, or that TCP will succeed.

Read the TTL in the reply

Common initial values are 64 (Linux/macOS), 128 (Windows) and 255 (network gear). A reply with TTL 57 suggests a Linux host seven routers away. Useful for spotting when a device has been replaced or a path has changed.

"Request timed out" ≠ down

Many hosts and most firewalls silently drop echo requests by policy. Confirm with a TCP probe to a port you expect to be open before declaring a host offline.

Vary the size

A large ping with the don't-fragment bit set is the standard way to find the real path MTU by hand.

Watch the pattern

Steady low RTT is healthy. Occasional spikes suggest queueing; regular loss suggests a physical or capacity problem. One lost packet in a hundred wrecks TCP throughput.

Traceroute

Traceroute exploits TTL. It sends a probe with TTL 1; the first router decrements it to zero, discards it and returns ICMP Time Exceeded — revealing itself. Then TTL 2, and so on, until the destination replies (echo reply on Windows, or ICMP port unreachable for the Unix UDP method). Windows tracert uses ICMP echo; classic Unix traceroute uses high-numbered UDP; both support TCP variants that get through firewalls which drop the rest.

Traceroute simulator

tool
Each probe leaves with a TTL one higher than the last. Watch what comes back.

Reading a trace honestly. Stars do not mean the path is broken — they mean that hop declined to generate an ICMP reply, which is common on core routers that rate-limit control-plane traffic. Latency that jumps at one hop and stays high is real; latency that spikes at one hop and drops back is that router deprioritising its own ICMP generation, not a fault. And because the return path can differ from the forward path, a trace shows you one direction only. mtr and pathping repeat probes over time and give per-hop loss, which is what you want for intermittent problems.

MTU, fragmentation and MSS

Ethernet's default MTU is 1500 bytes of payload. A packet larger than the next link's MTU must be fragmented by the sender or, in IPv4, by an intermediate router — unless the DF bit is set, in which case the router drops it and returns ICMP type 3 code 4 with the MTU it can accept. That feedback loop is path MTU discovery. IPv6 removes router fragmentation entirely: only the source may fragment, so PMTUD is mandatory rather than optional.

MSS is the TCP-layer equivalent, announced in the SYN: "do not send me segments larger than this." It is normally MTU minus 40 for IPv4 with TCP. MSS clamping on a tunnel interface rewrites that announcement downward as the SYN passes, so both ends negotiate a size that fits — the standard fix for VPN black holes, and far more reliable than depending on ICMP surviving the internet.

Path MTU calculator

tool

Which tool proves what?

drill

0 correct

Check yourself: ICMP & MTU

drill
Module 08

The transport layer

Layer 3 gets a packet to the right host. Layer 4 gets it to the right program on that host, and decides whether anyone checks it arrived. Those two jobs — multiplexing by port, and reliability — are the whole layer.

Where this sits: builds on module 04. Every mechanism described here is visible in a capture in module 21.

Ports and sockets

A port is a 16-bit number, so 0–65535. Servers listen on well-known ports; clients pick a random high-numbered ephemeral port (49152–65535 by the IANA definition) for each connection. The pair of IP and port is a socket, and a connection is uniquely identified by four values: source IP, source port, destination IP, destination port.

  • 0–1023 — well known, historically requiring administrative privilege to bind.
  • 1024–49151 — registered, claimed by specific applications.
  • 49152–65535 — dynamic/ephemeral, client side.

TCP: reliability by bookkeeping

TCP is connection-oriented. Before any data moves, the two ends synchronise sequence numbers in a three-way handshake, and every byte thereafter is numbered and acknowledged. Lost data is retransmitted; out-of-order data is reassembled; the sender slows down when the network complains.

TCP session walkthrough

tool
Client
10.0.0.5:52104
Server
93.184.216.34:443
SYN
CLOSED

The flags

FlagMeaningSeen when
SYNSynchronise sequence numbersOpening a connection; a flood of these with no follow-up is a SYN flood attack
ACKAcknowledgement field is validSet on every segment after the first
FINNo more data from senderGraceful close; each direction closes independently
RSTReset — abort immediatelyConnecting to a closed port, or an application crash. Instant "connection refused"
PSHPush buffered data to the application nowInteractive traffic such as SSH keystrokes
URGUrgent pointer validRare, effectively deprecated
Reading a failure from the response. An immediate RST means the host is reachable but nothing is listening — routing and firewalls are fine, the service is down. Silence (the client retries and times out) means something dropped the packet: a firewall configured to drop rather than reject, or a broken path.

Flow control and congestion control

Two different problems, often confused:

Flow control — protecting the receiver

The receiver advertises a window size: how many bytes it can accept before it must be acknowledged. A slow receiver shrinks the window; a window of zero says "stop until I say otherwise". Window scaling extends the 16-bit field for high-bandwidth links.

Congestion control — protecting the network

The sender maintains its own congestion window, growing it exponentially during slow start, then linearly. Loss or duplicate ACKs are read as congestion and the window collapses. This is why a single lossy link throttles throughput far below its raw bandwidth.

The connection as a state machine

TCP is defined as a set of states and the events that move between them. Every socket on your machine is sitting in one of them right now, and ss -tan or netstat -an shows you which. Reading that output is a diagnostic skill in itself — the state a connection is stuck in tells you which side failed.

TCP state explorer

tool

Select a state to see what it means and what a build-up of it indicates.

Why TIME-WAIT exists, and why it matters at scale. After closing, the initiating side holds the socket for twice the maximum segment lifetime — commonly 60 seconds — so a delayed duplicate from the old connection cannot be mistaken for data on a new one using the same four-tuple. A busy proxy opening thousands of short-lived outbound connections a second can therefore exhaust its ephemeral port range and start failing to connect while appearing completely idle. The fixes are connection reuse (keep-alive), a wider ephemeral range, or having the server close first so the burden sits elsewhere.

Windows, and what actually limits throughput

TCP does not send one segment and wait. It sends as much as the smaller of two windows allows, then waits for acknowledgements to free up space. That amount in flight is bounded by the bandwidth-delay product — the capacity of the pipe itself. A 1 Gbps link with 80 ms of latency holds 10 MB of data in flight at any moment, so a receiver advertising a 64 KB window will use less than 1% of it, no matter how fast the link is.

The 16-bit window field maxes out at 65,535 bytes, which is why the window scaling option exists: a multiplier negotiated in the SYN that raises the ceiling to a gigabyte. If a middlebox strips that option — some old firewalls did — throughput collapses over long paths and nothing looks broken.

Throughput calculator — why a fast link can be slow

tool

Congestion control, in four phases

  1. Slow start. The sender begins with a congestion window of a few segments and doubles it every round trip. Despite the name it is exponential and aggressive — it is only slow at the start.
  2. Congestion avoidance. Past a threshold, growth becomes linear: roughly one segment per round trip. Careful probing rather than doubling.
  3. Fast retransmit. Three duplicate acknowledgements mean a segment went missing but later ones are arriving. The sender resends immediately rather than waiting for a timeout.
  4. Fast recovery. The congestion window is halved rather than reset to one, because duplicate ACKs prove the path is still delivering. A full timeout, by contrast, collapses the window completely — which is why a timeout costs far more throughput than a single loss.

Modern stacks mostly run CUBIC, which recovers more aggressively on high-bandwidth long-latency paths, or BBR, which models bandwidth and round-trip time directly instead of treating loss as the only congestion signal — a better fit for wireless links, where loss often means interference rather than a full queue.

Details that produce real faults

Selective acknowledgement

Without SACK, a receiver can only say "I have everything up to X", so one lost segment in a burst can force retransmission of everything after it. SACK lets it list the blocks it did receive. Negotiated in the SYN; check it is present when a transfer performs badly under loss.

Nagle and delayed ACK

Nagle holds small writes back until the previous data is acknowledged, to avoid flooding the network with tiny packets. Delayed ACK holds acknowledgements back up to 200 ms hoping to piggyback them. Together they can deadlock briefly, adding a fixed 200 ms to request-response applications. Interactive protocols disable Nagle with TCP_NODELAY.

Retransmission timeout

Calculated continuously from measured round-trip time and its variance, then doubled on each successive failure. This is the exponential backoff you see in a capture: retries at roughly 1, 2, 4 and 8 seconds.

Keepalives

An idle connection sends nothing, so neither end knows the other died — and a stateful firewall will silently drop the session from its table after a timeout. Keepalives probe periodically to detect that. Defaults are often two hours, far longer than most firewall idle timeouts, which is why long-lived database or SSH sessions mysteriously hang.

UDP: send it and hope

UDP adds ports and an optional checksum to IP, and nothing else. No handshake, no acknowledgements, no ordering, no retransmission, no congestion control. That is a feature: for voice, video, gaming and DNS lookups, a late packet is worse than a lost one, and the application can handle recovery in a way that suits it.

TCPUDP
ConnectionThree-way handshake firstNone
Header20–60 bytes8 bytes
DeliveryGuaranteed, orderedBest effort, unordered
PDUSegmentDatagram
UsesHTTP(S), SSH, SMTP, FTP, file transferDNS, DHCP, NTP, SNMP, TFTP, VoIP media, streaming

QUIC is the modern twist: it runs over UDP on port 443 but implements reliability, ordering and TLS 1.3 encryption itself in user space, removing a round trip and dodging the middlebox problems TCP suffers. HTTP/3 uses it.

Port drill

drill
0 / 0

Port and protocol reference

tool
PortProtocolTransportWhat it does

Check yourself: transport

drill
Module 09

Session, presentation & TLS

Layers 5 and 6 exist to keep a conversation going and to agree what its contents mean — and the protocol that does most of that work today is TLS. It answers two questions at once: is this traffic private, and am I talking to who I think I am. Encryption without identity is worthless — an attacker in the middle can encrypt too. The certificate is the identity half, and almost every "TLS problem" in practice is a certificate problem.

Where this sits: builds on module 08 — TLS runs inside a TCP connection. Applied to real traffic in modules 10 and 11.

Layers 5 and 6, and what they actually do

These are the two layers people skip, partly because no single protocol maps neatly onto them — in the TCP/IP model they are folded into the application layer entirely. They are still worth understanding, because the functions exist regardless of which box you draw them in.

Layer 5 — Session

Establishing, maintaining and tearing down a dialogue that outlives any single exchange. Authentication happens once and the resulting session is reused; a long transfer is checkpointed so it can resume rather than restart; a half-duplex conversation is managed so both ends do not talk at once. Examples: NetBIOS session service, RPC, SIP dialogues, SMB session setup, and the session tickets that let TLS resume without a full handshake.

Layer 6 — Presentation

Making sure that what one side means is what the other side reads. Character encoding (ASCII, UTF-8), data serialisation, compression, and encryption all belong here. Examples: TLS, MIME types, JPEG and MPEG encoding, and the encoding negotiation in a Content-Type header.

Why it matters in practice. A fault at these layers looks nothing like a network fault: the connection establishes and stays up, packets flow, but the data is wrong or the session dies on a fixed schedule. Mojibake in a web form is a layer 6 encoding mismatch. A user logged out every thirty minutes regardless of activity is a layer 5 session lifetime. A certificate error is layer 6 refusing to proceed. In all three cases pinging harder will not help — and recognising that is the value of keeping the layers separate in your head.

Which layer is this fault?

drill

0 correct

Symmetric and asymmetric, and why both

Symmetric encryption (AES) uses one shared key, is fast, and can move gigabits. Its problem is distribution: how do two strangers agree on a key over a network anyone can read? Asymmetric encryption (RSA, elliptic curve) uses a mathematically linked key pair — anything encrypted with the public key can only be decrypted with the private one, and a signature made with the private key can be verified by anyone holding the public one. It is slow, so TLS uses it only to authenticate the server and agree a symmetric session key, then switches to symmetric for the actual data.

Modern TLS agrees that session key with an ephemeral Diffie-Hellman exchange, which gives perfect forward secrecy: the key is never transmitted and is discarded afterwards, so an attacker who records today's traffic and steals the server's private key next year still cannot decrypt it.

TLS handshake, step by step

tool
0 round trips

SNI (Server Name Indication) is the extension that lets one IP address host many TLS sites: the client states the hostname it wants in the Client Hello, so the server knows which certificate to present. It is sent in clear text in TLS 1.2 and 1.3, which is how filtering appliances still identify HTTPS destinations without decrypting anything. Encrypted Client Hello is the emerging fix.

What a certificate actually is

A signed statement binding a public key to an identity. The important fields:

  • Subject and Subject Alternative Names — the names the certificate is valid for. Browsers ignore the old common name field entirely; if the name you typed is not in the SAN list, it fails.
  • Issuer — who signed it, pointing at the next certificate up the chain.
  • Validity period — not-before and not-after dates. This is why a wrong clock produces certificate errors, which ties directly back to module 12.
  • Public key, signature algorithm, and the CA's signature over everything above.
  • Key usage / extended key usage — whether it may be used for server authentication, client authentication, code signing and so on.

Validation walks the chain: the server certificate is signed by an intermediate, the intermediate by a root, and the root is already in the client's trust store because the operating system or browser vendor put it there. A server must send its intermediates — forgetting them is the single most common certificate misconfiguration, and it fails on some clients and not others depending on what they have cached.

Certificate error diagnosis

drill

0 correct

PKI

The machinery around certificates. A Certificate Authority issues and signs them; a Registration Authority verifies who is asking. You generate a key pair, keep the private key, and send a Certificate Signing Request containing the public key and the names you want. The CA validates ownership — by DNS record, an HTTP file, or company documents for higher assurance — and returns a signed certificate.

Revocation: CRL

A signed list of revoked serial numbers published by the CA. Simple, but the list grows large and clients cache it, so revocation can take effect slowly.

Revocation: OCSP

The client asks the CA about one certificate in real time. Faster, but it leaks browsing habits to the CA and adds a dependency. OCSP stapling fixes both: the server fetches a signed, time-stamped status itself and includes it in the handshake.

Internal CA

Most organisations run their own for internal services and 802.1X client certificates, pushing the root into the trust store by Group Policy. Nothing external trusts it, and that is the point.

Automation

ACME (Let's Encrypt and others) issues short-lived certificates automatically. Short lifetimes make renewal a routine rather than an annual emergency — and make revocation matter less.

Mutual TLS reverses the usual asymmetry: the client presents a certificate too, so the server authenticates it without a password. This is how EAP-TLS wireless, many APIs and most service meshes authenticate.

Check yourself: TLS & PKI

drill
Module 10

Application protocols & services

Two services do more invisible work than everything else combined: DNS turns names into addresses, and DHCP hands out the addresses in the first place. When users say "the internet is down", one of these two is the cause more often than any cable.

Where this sits: builds on modules 08 and 09. HTTP is large enough to get its own module and is covered in 11; NTP in 12.

DNS

DNS is a distributed, hierarchical database read from right to left. In www.example.co.uk. the trailing dot is the root, then uk, then co, then example, and finally the host. No single server knows everything; each level knows only who to ask next.

DNS resolution, step by step

tool

A recursive resolver (your ISP's, or 8.8.8.8 / 1.1.1.1) does the legwork and returns one final answer. Iterative queries are what the resolver sends to each authoritative server: "I do not have it, ask this one instead." Caching happens at every level, governed by each record's TTL — which is why you lower the TTL a day before a planned migration.

Record types

RecordMapsNotes
AName → IPv4The everyday record
AAAAName → IPv6"Quad A"
CNAMEName → another nameAlias. Cannot coexist with other records at the same name, and never at the zone apex
MXDomain → mail serverHas a preference value; lower is preferred
NSZone → authoritative serversDelegation
PTRIP → nameReverse lookup, in the in-addr.arpa zone. Mail servers check it
SOAZone metadataPrimary server, serial number, refresh and expiry timers
TXTArbitrary textSPF, DKIM and DMARC anti-spoofing records, domain ownership proofs
SRVService → host and portUsed heavily by Active Directory and SIP
CAADomain → permitted certificate authoritiesNames which CAs may issue for the domain. Checked by the CA at issuance, so it prevents mis-issuance rather than blocking clients

Zones and transfers: a primary (master) server holds the writable zone; secondaries pull copies by zone transfer (AXFR full, IXFR incremental) and answer authoritatively. Split-horizon DNS returns different answers to internal and external clients for the same name. DNSSEC signs records so a resolver can verify they were not tampered with — it provides authenticity, not confidentiality. DoH and DoT encrypt the query itself over 443 and 853.

DHCP

Four messages, in order: Discover, Offer, Request, Acknowledge. Remember DORA. The client starts with no address at all, so Discover is a broadcast from 0.0.0.0 to 255.255.255.255 on UDP port 68, and the server replies from port 67.

DHCP DORA walkthrough

tool

Scope — the range of addresses a server can hand out. Reservation — a specific address always given to a specific MAC. Exclusion — addresses inside the scope the server must not use, typically for static infrastructure. Lease — the time an address is valid; the client tries to renew at 50% (T1) directly with the server, and at 87.5% (T2) it broadcasts to any server. Options — extra settings delivered with the address: option 3 default gateway, option 6 DNS servers, option 15 domain name, option 42 NTP servers, option 66/67 boot server for PXE.

Relay agents. Routers do not forward broadcasts, so a DHCP server on another subnet never hears Discover. A relay agent (ip helper-address) catches the broadcast and forwards it as a unicast to the server, inserting the receiving interface's subnet so the correct scope is chosen. If a new VLAN gets APIPA addresses while others are fine, a missing helper address is the first thing to check.

Other services you must be able to name

ServicePortsPurpose and gotchas
HTTP / HTTPS80 / 443 TCPWeb. HTTPS is HTTP inside TLS; the certificate proves identity and enables encryption
SSH22 TCPEncrypted remote shell, secure file copy (SCP/SFTP) and tunnelling. Replaced Telnet (23), which sends credentials in clear text
FTP20 data / 21 control TCPActive mode has the server open the data connection back to the client — firewalls hate it; passive mode fixes this. FTPS adds TLS; SFTP is unrelated and runs over SSH
TFTP69 UDPTrivial, no authentication. Config backups and network boot only
SMTP25, 587 submission, 465 implicit TLSSending mail. Port 25 between servers is widely blocked on consumer lines to limit spam
POP3 / IMAP110 / 143, secure 995 / 993Retrieval. POP3 downloads and typically deletes; IMAP keeps mail on the server and syncs state across devices
SNMP161, traps 162 UDPMonitoring. v1 and v2c use community strings in clear text; only v3 adds authentication and encryption. A trap is pushed by the device; a get is polled by the manager
Syslog514 UDPCentral logging, severity 0 emergency to 7 debug. Lower number is more serious
NTP123 UDPTime synchronisation — module 12
LDAP / LDAPS389 / 636 TCPDirectory queries, the backbone of Active Directory authentication
Kerberos88Ticket-based authentication. Fails if clocks differ by more than about five minutes
RDP3389 TCPWindows remote desktop. Never expose directly to the internet
SMB445 TCPWindows file and printer sharing
SIP / RTP5060, 5061 TLS / dynamic UDPVoIP signalling and the media stream itself
RADIUS / TACACS+1812-1813 UDP / 49 TCPAAA. RADIUS encrypts only the password; TACACS+ encrypts the whole payload and separates authentication from authorisation

Check yourself: services

drill
Module 11

HTTP, proxies & load balancing

HTTP is a request-response protocol made of plain text lines, which is why it is so easy to debug and so easy to proxy. Everything sitting between a browser and an application server — reverse proxies, load balancers, CDNs, WAFs — is manipulating those lines.

Where this sits: builds on modules 09 and 10. The Kubernetes and cloud equivalents of these load balancers are in module 17.

Anatomy of a request

GET /orders/42 HTTP/1.1 Host: shop.example.com User-Agent: curl/8.5.0 Accept: application/json Cookie: session=8f2c... Connection: keep-alive

The method, the path, the version, then headers, a blank line, and an optional body. The Host header is what makes virtual hosting possible: one IP and one port can serve hundreds of sites because the server reads the name from the request. Lose that header and a reverse proxy has no idea which backend you wanted.

MethodPurposeSafe / idempotent
GETRetrieve a resource; no side effects expectedBoth
HEADHeaders only, no body — a cheap existence and size checkBoth
POSTSubmit data, create a resourceNeither
PUTReplace a resource entirelyIdempotent
PATCHModify part of a resourceNeither
DELETERemove a resourceIdempotent
OPTIONSAsk what is permitted; used by browser CORS preflightBoth

Status code explorer

tool

Pick a code. The class matters as much as the number: 2xx succeeded, 3xx go elsewhere, 4xx you got it wrong, 5xx the server got it wrong.

The distinction that saves hours: a 502 or 504 comes from a proxy, not the application — 502 means the backend gave an invalid response or refused the connection, 504 means it did not answer in time. A 503 means something is deliberately refusing to serve, usually because health checks have failed or the service is in maintenance. In all three cases the thing you are talking to is fine; look one layer behind it.

Versions

  • HTTP/1.1 — one request at a time per connection, with keep-alive to avoid reopening TCP. Head-of-line blocking is solved by browsers opening six connections per host.
  • HTTP/2 — binary framing, many multiplexed streams over one TCP connection, header compression, server push. Still suffers TCP-level head-of-line blocking: one lost packet stalls every stream.
  • HTTP/3 — the same model over QUIC on UDP 443, where each stream is independent, so loss on one does not stall the others. Also merges the transport and TLS handshakes into a single round trip.

Proxies

Forward proxy

Sits in front of clients. The organisation controls it to filter categories, cache, log, and enforce policy on outbound traffic. Configured explicitly in the client, or transparently by redirecting port 80 and 443.

Reverse proxy

Sits in front of servers. Clients think it is the application. It terminates TLS, routes by hostname and path, caches, compresses, rate-limits and hides the real backends. NGINX, HAProxy, Traefik and every cloud load balancer are this.

Because a reverse proxy terminates the client connection, the backend sees the proxy's address as the source. X-Forwarded-For preserves the original client address, X-Forwarded-Proto records whether the client used HTTPS, and X-Forwarded-Host the original hostname. Applications that generate absolute URLs will emit http://internal-name/ links unless these are set and trusted correctly — and they must be stripped from inbound requests, or a client can forge its own source address in your logs and access rules.

TLS termination ends encryption at the proxy, giving it visibility for routing and caching; TLS passthrough forwards the encrypted stream untouched; re-encryption terminates and opens a fresh TLS session to the backend, which is what you want when the internal network is not trusted.

Proxy variants worth naming

  • Explicit proxy — the client is configured with the proxy address, usually by policy or a PAC file. Honest, visible, and it breaks if the setting is wrong.
  • Transparent proxy — the network redirects port 80 and 443 without the client knowing. Nothing to configure, but TLS interception requires deploying a trusted root to every device, and some applications with certificate pinning will simply refuse to work.
  • SOCKS proxy — operates at layer 5 rather than 7, so it relays any TCP stream and, in SOCKS5, UDP too. It does not read or modify the protocol inside, which makes it useful for arbitrary applications. ssh -D 1080 creates one on the fly, which is the simplest way to route a browser through a remote network.
  • Secure web gateway — a proxy with the full policy stack bolted on: category filtering, malware scanning, data loss prevention and TLS inspection.

Load balancing

Load balancer simulator

tool
ConceptWhat it means in practice
Layer 4 balancingDecides on IP and port only. Fast, protocol-agnostic, cannot read a URL. Used for anything TCP or UDP.
Layer 7 balancingReads the HTTP request, so it can route /api to one pool and /images to another, rewrite headers, and retry a failed request elsewhere.
Health checksActive probes remove a backend from rotation before users find it. A check that only opens a TCP port will happily keep sending traffic to an application that is returning 500s — check a real endpoint.
Session persistenceKeeps one client on one backend, by cookie or source-IP hash. Necessary when session state lives in server memory; a sign you should move that state to a shared store.
DrainingStop sending new connections to a backend while letting existing ones finish. How you deploy without dropping requests.
Active/active vs active/passiveBoth serving and sharing load, versus one idle until failover. Active/active needs the application to tolerate concurrency; active/passive wastes capacity but is simpler.
Split brain. When a redundant pair loses the link between them, each may decide the other is dead and both become active — two masters writing the same data, or two devices claiming the same virtual IP. Mitigate with an independent quorum, a separate heartbeat path, or fencing that forcibly powers down the loser.

Check yourself: HTTP & proxies

drill
Module 12 — deep dive

Time synchronisation

Time is the one shared assumption every distributed system makes and almost nobody verifies. Kerberos refuses tickets more than five minutes out. TLS certificates become "not yet valid". Log correlation across two hosts becomes fiction. Multi-factor codes fail. NTP is the protocol that keeps all of that from happening, and it does something genuinely clever: it measures the delay of the network in order to cancel it out.

Where this sits: depends on modules 08 and 10. Its consequences show up again in module 16 (Kerberos) and module 19 (log correlation).

Why an engineer should care. Symptoms that are really clock problems: users cannot log in to the domain but the network is fine; a certificate error on an appliance that was working yesterday; a SIEM that shows the firewall blocking a connection after the server logged it succeeding; a database cluster refusing to elect a leader. If two systems disagree about time, they will eventually disagree about causality.

What "correct time" means

  • UTC — Coordinated Universal Time, the civil standard. Derived from atomic time but kept within 0.9 s of the Earth's rotation by inserting leap seconds.
  • TAI — International Atomic Time, a pure count of atomic seconds with no leap seconds. Currently 37 seconds ahead of UTC.
  • GPS time — atomic, no leap seconds since 1980, so it runs 18 s ahead of UTC. GNSS receivers apply the offset from the navigation message before presenting UTC.
  • Unix epoch — seconds since 00:00:00 UTC on 1 January 1970. A signed 32-bit counter overflows on 19 January 2038; NTP's own 32-bit era counter rolls over on 7 February 2036, which NTPv4 handles with era numbering.
  • Leap seconds — announced six months ahead, applied as 23:59:60 UTC. NTP signals one with the two leap indicator bits; systems either step, or "smear" the second across a day so nothing sees a discontinuity. Smearing and stepping servers must never be mixed in one pool.

Local time zones and daylight saving are an operating-system presentation concern. Infrastructure runs on UTC internally, always: it removes an entire class of ambiguity from logs, and it means nothing happens twice at 01:30 in October.

Stratum: distance from truth

Stratum is not a quality rating and not a hop count in the routing sense. It counts how many NTP servers you are from a reference clock. Each layer adds its own error, so the number is a rough proxy for accumulated uncertainty. Click a level to inspect it.

Stratum hierarchy explorer

tool

Select a stratum level.

Stratum 16 means unsynchronised. It is the maximum value and it signals "do not trust me" — a server that has lost its upstream, or one that has only just started and has not yet settled. Stratum 0 is never seen on the wire: it is the reference hardware itself, and it is reported by the stratum 1 server in the reference identifier field as a four-character code such as GPS, PPS, DCF or PTP.

How NTP actually measures time

The naive approach — "the server says it is 12:00:00, so set the clock to 12:00:00" — is wrong by however long the reply took to arrive. NTP solves this with four timestamps captured across one exchange:

SymbolNameRecorded by
T1Originate timestampClient, as the request leaves
T2Receive timestampServer, as the request arrives
T3Transmit timestampServer, as the reply leaves
T4Destination timestampClient, as the reply arrives

From those four values:

round-trip delay δ = (T4 − T1) − (T3 − T2) clock offset θ = [(T2 − T1) + (T3 − T4)] / 2

The delay is the total time on the wire with the server's own processing removed. The offset is the average of how wrong the clock looked on the way out and on the way back — averaging cancels the transit time provided the path is symmetric. That assumption is the protocol's one real weakness: on an asymmetric path (say 5 ms out, 25 ms back), NTP will confidently place the clock 10 ms off and report a healthy delay. It is also why running NTP through a congested or heavily queued link degrades accuracy even though nothing is broken.

Offset and delay calculator

tool

Disciplining the clock

Knowing the offset is not the same as fixing it. A computer's oscillator is a cheap crystal that runs fast or slow by a fairly constant amount, measured in parts per million. At 50 ppm — entirely normal — a clock gains or loses 50 microseconds per second, which is 4.3 seconds per day. NTP does not just correct the error; it learns the drift rate, writes it to a drift file, and applies continuous compensation so that even if the network disappears, the clock stays close.

  • Slew — speed the clock up or down slightly until it converges. Time never jumps and never goes backwards. Used for offsets under 128 ms. Correcting a large error by slewing alone takes a long time, because the maximum slew rate is about 500 ppm.
  • Step — jump the clock straight to the right value. Used above 128 ms. Applications that assume monotonic time can behave badly, which is why databases and clusters prefer slewing and why -x / makestep settings exist.
  • Panic threshold — by default, an offset over 1000 seconds makes the daemon exit rather than apply a change that large. Something is badly wrong; a dead CMOS battery, usually.

Clock drift simulator

tool

Choosing who to believe

Configure one server and you have no way to know if it is lying. Configure two and you cannot tell which one is wrong. NTP's selection algorithm therefore wants at least four sources, and it works in stages:

  1. Sanity checks — reject anything with stratum 16, a bad leap indicator, a failed authentication, or a root distance beyond the limit.
  2. Intersection algorithm — each source gives a confidence interval rather than a point. Sources whose intervals do not overlap the majority are falsetickers and are discarded; the survivors are truechimers. This is what makes four sources meaningfully better than two.
  3. Clustering — among the survivors, sources with the highest jitter are progressively discarded until the remaining set is tightly grouped.
  4. Combining — the surviving offsets are weighted, usually by root distance, and one is chosen as the system peer to drive the loop filter.

Key metrics you will see reported: jitter (short-term variation in measured offset — a network quality signal), dispersion (accumulated maximum error, which grows between polls), root delay and root dispersion (the totals all the way back to the reference clock). Root distance, roughly root dispersion plus half the root delay, is the honest statement of worst-case error.

Reading ntpq -p

tool

Click any row or column heading to have it explained.

Select something above.

Poll intervals and burst options

NTP polls between every 64 seconds (26) and every 1024 seconds (210) by default, widening the interval automatically as the clock proves stable. That is deliberately gentle: NTP is designed so that a hundred thousand clients can share a public server. iburst sends a short burst of eight packets at startup so a machine synchronises in seconds rather than minutes — you almost always want it. burst does the same on every poll and is considered abusive against servers you do not own. prefer marks a source as the one to favour when the algorithms are otherwise undecided.

Modes and topology

Client/server

The normal arrangement. The client polls, the server answers, and the server never adjusts to the client.

Symmetric active/passive (peers)

Two servers of equal stratum synchronise with each other for mutual backup. Used between site time servers.

Broadcast / multicast

Server pushes to a whole LAN. Low overhead, poor accuracy (no round-trip measurement), and easy to spoof. Rare now.

SNTP

Simple NTP: same packet format, no filtering, selection or discipline algorithms. Fine for a printer or an IP camera; not for a domain controller.

A sane enterprise design: two or three internal servers, each taking time from several external sources or a local GNSS receiver, peering with one another, with every other device on the network pointing only at those internal servers. Firewall outbound UDP 123 so nothing bypasses them. In a Windows domain, the PDC emulator holds the authoritative role and every member syncs down the domain hierarchy automatically — pointing individual member servers at external NTP is a classic cause of drift.

Security

  • Amplification attacks — the old monlist command returned a large response to a tiny spoofed request, giving an amplification factor in the hundreds. Disable monlist, restrict queries, and keep daemons current.
  • Spoofing and delay attacks — plain NTP is unauthenticated. An attacker who can move a client's clock can expire or un-expire certificates, replay Kerberos tickets, or defeat time-based tokens.
  • Symmetric keys — shared secrets configured on both ends. Workable internally, painful to distribute.
  • NTS (Network Time Security, RFC 8915) — the modern answer: TLS key establishment on TCP 4460, then authenticated NTP packets on 123. Use it where supported.
  • Restrict who may query and who may modify; never leave a server open to the internet by accident.

When milliseconds are not enough: PTP

NTP on a normal LAN gets you within a few milliseconds; on a quiet local link, tens of microseconds. Finance, broadcast, power distribution and mobile networks need better, and that means PTP (IEEE 1588).

NTPPTP
Typical accuracy1–50 ms over WAN, <1 ms on LANSub-microsecond, nanoseconds with hardware support
TimestampingSoftware, in the OS stackHardware, in the NIC or switch PHY
HierarchyStratum 0–15Grandmaster → boundary and transparent clocks → slaves
Network requirementRuns over anythingNeeds PTP-aware switches to correct for queueing delay
MessagesSymmetric request/responseSync, Follow_Up, Delay_Req, Delay_Resp; best master clock algorithm elects the grandmaster
TransportUDP 123UDP 319 (event) and 320 (general), or raw Ethernet

A boundary clock terminates PTP and regenerates it, isolating each segment. A transparent clock measures how long a packet spent inside the switch and writes that into a correction field, so downstream devices can subtract it — this is the trick that defeats queueing jitter, and it is why ordinary switches ruin PTP accuracy.

Holdover and hardware

When a GNSS antenna fails or the signal is jammed, the server enters holdover: it keeps time using its own oscillator and the drift figure it has learned. How long that lasts depends entirely on the oscillator — a plain crystal drifts milliseconds within hours, a TCXO does better, an OCXO holds microseconds for a day, and a rubidium standard holds for weeks. This is what you are buying when a time appliance costs thousands rather than tens.

Time troubleshooting scenarios

drill

0 correct

Check yourself: time

drill
Module 13

Multicast, VoIP & real-time traffic

Most traffic tolerates delay. Voice and video do not — a packet that arrives late is a packet that was lost, because the audio moment it belonged to has already passed. This module covers one-to-many delivery, and how to protect traffic that cannot wait.

Where this sits: takes the QoS introduction from module 05 and finishes it, and applies the addressing rules from module 04 to multicast.

Multicast

Unicast sends one copy per recipient; broadcast sends to everyone whether they want it or not; multicast sends one copy that the network duplicates only where paths diverge, and only toward receivers who asked. For a 4 Mbps video stream and 200 viewers, that is the difference between 800 Mbps and 4 Mbps leaving the server.

Anycast is the fourth mode and works differently: the same address is advertised from many locations, and normal routing delivers each client to the topologically nearest instance. Root DNS servers and CDN edges use it, which is why 8.8.8.8 answers quickly everywhere.

RangeUse
224.0.0.0/24Link-local control, never routed. 224.0.0.1 all hosts, .2 all routers, .5 and .6 OSPF, .9 RIPv2, .18 VRRP
224.0.1.0 – 238.255.255.255Globally scoped and source-specific (232.0.0.0/8) application traffic
239.0.0.0/8Administratively scoped — the private address space of multicast, for use inside your own network
ff00::/8IPv6 multicast, with an explicit scope field in the address itself

Multicast IP to MAC mapping

tool

Getting it right on a LAN

A switch treats an unknown multicast frame like a broadcast and floods it — which turns a 4 Mbps stream into 4 Mbps on every port, including the ones with nothing but a printer on them. IGMP snooping is the fix: the switch listens to the IGMP membership reports passing through it and builds a map of which ports actually have receivers, forwarding the stream only there. On a VLAN with no multicast router, configure an IGMP querier on the switch, or the memberships expire and flooding resumes.

  • IGMPv2 — join, leave-group, and queries. IGMPv3 adds source filtering, which is what source-specific multicast needs. IPv6 uses MLD, carried inside ICMPv6.
  • PIM routes multicast between subnets. Sparse mode builds a shared tree rooted at a rendezvous point and only where receivers exist — the sane default. Dense mode floods everywhere then prunes, and is a bad idea on anything but a lab.
  • The reverse-path-forwarding check discards any multicast packet that did not arrive on the interface the router would use to reach the source. That is how multicast avoids loops.

VoIP

Two separate protocols do two separate jobs, and confusing them makes VoIP faults very hard to diagnose. SIP (TCP/UDP 5060, TLS 5061) is signalling only: register, invite, ring, answer, hang up. The audio never touches it. The audio is RTP over UDP on a dynamically negotiated high port pair, with RTCP alongside carrying statistics on jitter and loss. So a call that connects but has no audio is a media-path problem — one-way audio almost always means NAT or a firewall blocked the RTP stream in one direction, while the SIP signalling flowed fine.

MetricTarget for voiceWhat breaks past it
One-way latencyunder 150 msBeyond 150 ms people start talking over each other; past 400 ms it is unusable
Jitterunder 30 msThe de-jitter buffer runs dry, producing clicks and dropouts
Packet lossunder 1%Audible gaps; concealment algorithms hide only so much

Codecs trade bandwidth for quality: G.711 uses 64 kbps of payload and sounds like a landline; G.729 uses 8 kbps and sounds compressed; Opus adapts between roughly 6 and 128 kbps. Add IP, UDP and RTP headers — 40 bytes on every 20 ms packet — and real-world G.711 needs closer to 87 kbps per direction on Ethernet.

Call quality and bandwidth calculator

tool

QoS in practice

QoS does nothing until a link is congested; then it decides who suffers. The process is always the same three steps: classify (identify the traffic), mark (write that decision into the packet so everything downstream can act on it without re-inspecting), and queue (act on the marking when there is contention).

MarkingWhereTypical use
DSCP EF (46)IP header, 6 bitsVoice payload — strict priority queue
DSCP AF41 (34)IP headerInteractive video
DSCP CS3 (24)IP headerCall signalling
DSCP AF21 / CS0IP headerTransactional data / best effort
CoS 0–7802.1Q tag, 3 bitsLayer 2 priority — lost the moment the tag is stripped, so it must be mapped to DSCP at the boundary

Trust boundaries matter: mark as close to the source as possible, but never trust markings from user devices, or a games console will helpfully mark itself EF. Re-mark at the access port. Policing drops or re-marks traffic exceeding a rate immediately; shaping buffers it and releases it smoothly, which suits TCP far better but adds delay. Strict priority queuing must be bounded — an unbounded voice queue can starve everything else.

Bandwidth, throughput, goodput. Bandwidth is the link's rated capacity. Throughput is what you actually achieve, headers included. Goodput is the useful application data only, after protocol overhead and retransmissions. A 1 Gbps link delivering 940 Mbps of throughput and 900 Mbps of goodput is behaving perfectly — the gap is physics and headers, not a fault.

Check yourself: multicast & real-time

drill
Module 14

Wireless

Wi-Fi is Ethernet's rules applied to a medium nobody owns, where every station shares one channel, collisions cannot be detected, and the walls are part of the design. Most wireless faults are radio-planning faults, not configuration faults.

Standards

StandardMarketing nameBandsMax theoretical rateKey technique
802.11a—5 GHz54 MbpsOFDM
802.11b—2.4 GHz11 MbpsDSSS
802.11g—2.4 GHz54 MbpsOFDM, b-compatible
802.11nWi-Fi 42.4 & 5 GHz600 MbpsMIMO, 40 MHz channels, frame aggregation
802.11acWi-Fi 55 GHz~6.9 Gbps80/160 MHz, 256-QAM, downlink MU-MIMO
802.11axWi-Fi 6 / 6E2.4, 5, and 6 GHz for 6E~9.6 GbpsOFDMA, uplink MU-MIMO, BSS colouring, target wake time
802.11beWi-Fi 72.4, 5, 6 GHz~46 Gbps320 MHz channels, 4096-QAM, multi-link operation

Higher frequency means more bandwidth and less range: 2.4 GHz penetrates walls but offers only three non-overlapping 20 MHz channels (1, 6, 11) and shares space with Bluetooth, microwaves and cordless phones. 5 GHz offers around 24 channels, some requiring DFS — the AP must vacate within seconds if it detects radar, which shows up as an unexplained brief outage.

2.4 GHz channel planner

tool

Pick channels for three neighbouring access points and see the overlap.

Signal, in decibels

RF power is measured in dBm, decibels relative to one milliwatt — a logarithmic scale, so −30 dBm is a thousand times stronger than −60 dBm. Two rules make the arithmetic trivial: +3 dB doubles power, +10 dB multiplies it by ten (and the negatives halve and divide). SNR is the gap between signal and noise floor, and it matters more than raw signal.

−30 to −50 dBm

Excellent. You are standing next to the AP.

−60 dBm

Good. Reliable for voice and video.

−70 dBm

Usable minimum for data. Design edge-of-cell to this.

−80 dBm and below

Unreliable. Clients cling on and drag the whole cell's rate down.

SNR > 25 dB

Good. Below 15 dB, throughput collapses regardless of signal strength.

Free-space loss

Doubling distance costs 6 dB before you add a single wall.

dBm / milliwatt converter

tool

Antennas and coverage

Omnidirectional antennas radiate in a doughnut around the mast — the default for indoor APs. Directional types (Yagi, panel, parabolic) concentrate energy into a beam for point-to-point links or covering a long corridor. Antenna gain in dBi does not create power; it reshapes it, trading coverage in one direction for another. Regulators limit EIRP, the combination of transmitter power and antenna gain.

Design for 15–20% cell overlap so clients can roam without dropping. Too much transmit power is a common mistake: it makes clients hear the AP from far away but the AP cannot hear their weaker replies, producing the classic "full bars, no data".

Security

SchemeStatusNotes
WEPBrokenRC4 with a 24-bit IV; crackable in minutes. Never use.
WPA (TKIP)DeprecatedA retrofit onto WEP hardware.
WPA2 (CCMP/AES)AcceptableThe long-standing baseline. Vulnerable to offline dictionary attack on weak PSKs, and to KRACK if unpatched.
WPA3CurrentSAE (dragonfly) handshake resists offline cracking and gives forward secrecy; 192-bit enterprise mode; protected management frames mandatory.
WPA2/3-EnterpriseBest practice802.1X with a RADIUS server and EAP — per-user credentials or certificates, no shared password to leak.

802.1X uses three roles: the supplicant (client), the authenticator (switch or AP, which passes traffic through but nothing else until authentication succeeds), and the authentication server (RADIUS). EAP variants worth naming: EAP-TLS (certificates both ends, strongest), PEAP and EAP-TTLS (server certificate plus inner password auth), EAP-FAST.

Attacks: an evil twin or rogue AP broadcasts your SSID to harvest credentials; deauthentication frames kick clients off so they reconnect to the attacker (protected management frames stop this); war driving maps networks from a vehicle. Hiding an SSID and filtering MAC addresses are not security measures — both are trivially defeated by watching the air.

Survey vocabulary. A predictive survey models coverage from floor plans. A passive survey listens and maps actual signal. An active survey associates and measures real throughput. A heat map from any of these is the evidence you need before adding another AP — which, more often than not, makes things worse by adding co-channel interference.

Check yourself: wireless

drill
Module 15

WAN & remote access

Beyond the building, someone else owns the cable. This module covers what you are actually buying from a provider, how you reach across it securely, and how much downtime the design can absorb.

Where this sits: builds on modules 05 and 09. What lives on the far side of a cloud link is module 17.

WAN links

TechnologyTypical rateNotes
Leased line / dedicated fibre10 Mbps – 100 GbpsSymmetric, contended by nobody, SLA-backed. The expensive, reliable option
DSL / VDSLUp to ~80 Mbps downCopper from the cabinet; rate falls with distance. Asymmetric
Cable (DOCSIS)Up to multi-gigabitShared coax segment, so evening contention is real
Fibre to the premises100 Mbps – 10 GbpsGPON splits one feed among many subscribers
Cellular 4G/5G10 Mbps – 1 Gbps+Failover and temporary sites. Watch for carrier-grade NAT breaking inbound access
Satellite25 – 350 MbpsGeostationary adds ~500 ms round trip; low-earth-orbit constellations cut that to 20–50 ms
MPLSProvider dependentLabel switching in the provider core; any-to-any private connectivity with QoS classes
Metro Ethernet10 Mbps – 10 GbpsPresented as an Ethernet handoff; simple to consume

SD-WAN puts a controller in front of several cheap links — broadband, cellular, MPLS — and steers each application over whichever path currently meets its policy, measuring loss, latency and jitter continuously. It is the reason MPLS budgets have shrunk.

Demarcation point — where the provider's responsibility ends and yours begins. The CSU/DSU or NTU sits at that boundary. Knowing exactly where the demarc is saves hours during an outage, because it decides who you are allowed to blame.

Tunnels and remote access

  • Site-to-site VPN — two firewalls build a permanent encrypted tunnel; users are unaware it exists.
  • Client-to-site (remote access) VPN — a laptop dials in. With full tunnel, all traffic goes via the office and is inspected; with split tunnel, only corporate subnets do, which saves bandwidth and loses visibility.
  • IPsec — the standard suite. IKE negotiates keys in two phases; AH authenticates but does not encrypt, ESP encrypts and authenticates. Tunnel mode wraps the whole original packet; transport mode keeps the original IP header.
  • GRE — encapsulation with no encryption; often wrapped inside IPsec because it can carry multicast and routing protocols, which plain IPsec cannot.
  • SSL/TLS VPN — runs over 443, so it traverses hotel and airport firewalls that block IPsec.
  • Zero trust network access — replaces the flat "you are inside, so you are trusted" model with per-application authorisation on every request.
  • Out-of-band management — a console server or dedicated management interface reachable when the production network is down. If your only route to the router is through the router, one bad configuration line costs you a site visit.

Where cloud fits

A cloud region is reached over exactly the technologies above — an IPsec or TLS tunnel across the internet for convenience, or a direct connect circuit into the provider for predictable latency, higher throughput and lower egress cost. Everything on the far side of that link is covered properly in the virtualisation and containers module: service models, VPC design, security groups and network ACLs.

Availability and continuity

RTO is how long you may take to restore service; RPO is how much data you may lose. Those two numbers drive every design decision below. A hot site is running and current; a warm site has hardware and stale data; a cold site is space and power. Aim availability at the "nines": 99.9% allows about 8.8 hours of downtime a year, 99.999% allows just over five minutes. MTBF measures how long a component lasts; MTTR measures how quickly you fix it — and MTTR is usually the one you can actually improve.

Check yourself: WAN & cloud

drill
Module 16

Host networking

The network does not stop at the switch port. Every server is a small router with its own interfaces, routing table, ARP cache and firewall, and a large share of "network problems" are actually host configuration. This module covers the two operating systems you will meet, plus the storage protocols that run between them.

Linux networking

The ip command replaced the old ifconfig, route and arp tools; they are the same concepts with better syntax and full support for modern features.

TaskModern commandLegacy equivalent
Show addressesip addrifconfig
Interface state, MAC, MTUip linkifconfig
Routing tableip routeroute -n
Which route would be usedip route get 8.8.8.8—
ARP / neighbour cacheip neigharp -a
Sockets and listenersss -tulpnnetstat -tulpn
Link speed, duplex, driverethtool eth0—

Configuration is persisted by NetworkManager (desktops and RHEL, driven by nmcli), systemd-networkd (servers and containers), or distribution files such as netplan. Name resolution comes from /etc/nsswitch.conf deciding the order, /etc/hosts first, then /etc/resolv.conf — which on most systems now points at a local stub resolver rather than the real DNS servers.

Netfilter: how a packet crosses a Linux box

iptables and its successor nftables are front-ends to the same kernel framework. Understanding the order of the hooks explains why a rule in the wrong chain does nothing.

Netfilter path walkthrough

tool

Connection tracking is what makes a Linux firewall stateful: ct state established,related accepts return traffic for connections you already permitted, so you only write rules for the initiating direction. MASQUERADE is source NAT that picks up the outgoing interface's address automatically — right for dynamic WAN addresses, marginally more expensive than a fixed SNAT.

Network namespaces give a process its own complete network stack — interfaces, routes, firewall rules, sockets. Two namespaces are joined by a veth pair, a virtual cable with an end in each, usually with one end plugged into a Linux bridge that behaves exactly like a switch. Every container network you will ever meet is built from those three pieces.

Windows networking

PowerShell has replaced most of the old commands, and returns objects rather than text: Get-NetIPAddress, Get-NetRoute, Get-NetAdapter, Resolve-DnsName, and Test-NetConnection host -Port 443, which is the modern substitute for telnet-as-a-port-tester. Windows Firewall applies a different rule set per network profile — domain, private, or public — so a service that works in the office and fails on a home network is usually a profile classification issue, not a firewall rule issue.

SMB on TCP 445 carries Windows file and printer sharing. SMB 1 is obsolete and should be disabled outright; SMB 3 adds encryption, multichannel and better performance over WAN links.

Active Directory depends on the network more than people realise

AD is three things stacked: LDAP for directory queries (389, or 636 for LDAPS), Kerberos for authentication (88), and DNS for locating everything. Clients find domain controllers not by address but by SRV records such as _ldap._tcp.dc._msdcs.example.local — which is why pointing a domain-joined machine at a public DNS server breaks logon completely, even though the internet still works.

Kerberos authentication walkthrough

tool

Sites and subnets tell AD which physical location a client is in, so it uses a local domain controller rather than one across a WAN link. An unregistered subnet produces slow logons and odd replication choices, and shows up in the domain controller's event log as clients from an unknown subnet.

Network storage

ProtocolTypePortsNotes
SMB / CIFSFile (NAS)445 TCPWindows-native, now good on Linux via Samba. Handles locking and permissions at the file level
NFSFile (NAS)2049 TCPUnix-native. v4 fixed the old portmapper sprawl and added proper security. Sensitive to latency
iSCSIBlock (SAN)3260 TCPSCSI commands over IP. The client sees a raw disk, not a share. Wants its own VLAN, jumbo frames and ideally its own switches
Fibre ChannelBlock (SAN)Dedicated fabricSeparate lossless network with its own switches and HBAs. FCoE carries it over Ethernet
NVMe over FabricsBlockVariousThe modern low-latency successor, over RDMA or TCP

File versus block is the distinction to hold onto: NAS serves files and manages the filesystem itself, so many clients can share it safely. SAN serves raw blocks, and the client formats it — which means two clients writing to the same block device without a clustered filesystem will destroy it. Storage traffic is also unusually sensitive to loss and jitter, because a delayed block read stalls an application thread in a way a delayed web request does not.

Check yourself: host networking

drill
Module 17

Virtual, container & cloud networking

None of this is new networking. A virtual switch is a switch, a container is a host with its own namespace, and a Kubernetes Service is a load balancer. What changes is that the wiring is now created and destroyed by software in seconds, and you cannot see it by looking at a rack.

Where this sits: builds on module 15. A virtual switch is module 03 inside a host, and a container namespace is module 16 inside a process.

Hypervisor networking

A virtual switch inside the host forwards frames between VMs and out through one or more physical uplinks. It does VLAN tagging, port groups with policies, and traffic shaping — but by default it does no MAC learning from the outside world, and it is not a managed switch: no STP participation, no CLI, and it forwards VM-to-VM traffic entirely inside the host, where your physical monitoring cannot see it.

Bridged

The VM sits directly on the physical LAN with its own address from the real DHCP scope. Behaves like another machine plugged into the switch.

NAT

VMs share a private network and the host translates outbound. Outbound works, inbound needs port forwarding. Default in desktop hypervisors.

Host-only / internal

Isolated segment reachable by the host and other VMs but with no route out. The right choice for lab work you do not want touching production.

Trunked port group

Pass 802.1Q tags to the guest so a virtual firewall or router can terminate several VLANs on one virtual NIC.

Two virtualisation-specific traps. Promiscuous mode and MAC address changes are usually blocked on a virtual switch by default — which quietly breaks a virtual appliance doing IDS, clustering with a shared virtual MAC, or nested virtualisation. And when a VM live-migrates to another host, it takes its MAC with it; the physical switches relearn it on a different port, which is normal, but looks exactly like MAC flapping.

Docker

By default Docker creates a Linux bridge (docker0), gives each container a veth pair into it, allocates addresses from a private range, and adds a masquerade rule so containers can reach the outside world. Containers on the same user-defined network reach each other by container name, resolved by Docker's built-in DNS at 127.0.0.11.

What docker run -p actually does

tool

Network modes: bridge (isolated, published ports only), host (the container shares the host's stack entirely — no isolation, no port mapping, and a port conflict if two containers want the same one), none (loopback only), and overlay for multi-host clusters, which encapsulates container traffic in VXLAN so containers on different physical hosts appear to share a layer 2 segment.

Kubernetes networking

Kubernetes imposes a deliberately simple model, which the CNI plugin (Calico, Cilium, Flannel) must implement: every pod gets its own IP, every pod can reach every other pod without NAT, and nodes can reach all pods. Pod addresses are ephemeral — a pod that restarts gets a new one — which is why nothing should ever be configured with a pod IP.

ObjectWhat it gives youReachable from
ClusterIPA stable virtual IP and DNS name load-balancing across the matching podsInside the cluster only. The default
NodePortThe same, plus a high port (30000–32767) opened on every nodeAnything that can reach a node. Blunt but useful in a lab
LoadBalancerNodePort plus an external load balancer provisioned by the cloud providerThe internet, with one address per service — which gets expensive
IngressA layer 7 reverse proxy routing by hostname and path to many services behind one address, usually terminating TLSThe internet, sharing one entry point
Headless serviceDNS returning pod addresses directly with no virtual IPStateful sets and clients doing their own balancing

Service discovery is DNS: service.namespace.svc.cluster.local, with the short form working inside the same namespace. Network policies are the firewall — and the default is wide open, so until you apply one, every pod can talk to every other pod in the cluster. A policy selecting a pod switches it to default-deny for that direction, which is the usual source of surprise.

Choose the right exposure

drill

0 correct

Cloud service models

Who runs what, and therefore who is responsible when it breaks.

IaaS

Virtual machines, storage and networks. You patch the operating system and design the addressing. Closest to a traditional data centre.

PaaS

A runtime you deploy code onto. The provider owns the OS and middleware; you own the application and its configuration.

SaaS

A finished application. You own only your data, your identities and your access control — which is still plenty to get wrong.

Deployment models are public, private, hybrid and community. The shared responsibility model is the line that matters: the provider secures the cloud, you secure what you put in it. Almost every headline cloud breach has been a customer misconfiguration — an open storage bucket or an over-permissive security group — rather than a provider failure.

Cloud networking, translated

Cloud termTraditional equivalentWatch out for
VPC / VNetYour whole private address spaceOverlapping CIDR blocks make future peering impossible — plan the ranges before you build
SubnetSubnet, tied to one availability zoneThe provider reserves several addresses in each; a /28 gives fewer usable hosts than you expect
Route tableRoute tableA "public" subnet is simply one whose route table has a default route to an internet gateway
Internet gatewayYour internet routerProvides inbound and outbound for instances holding public addresses
NAT gatewayPAT on your edge routerOutbound only for private subnets, and billed per gigabyte — a common surprise on the invoice
Security groupStateful host firewallAttached per instance, allow-rules only, return traffic automatic
Network ACLStateless router ACLPer subnet, allow and deny, numbered order, and you must permit return traffic explicitly
VPC peering / transit gatewaySite-to-site links / a WAN hubPeering is not transitive; a transit gateway is the hub-and-spoke answer
Private endpointA service reachable without traversing the internetKeeps traffic to managed services on the provider's backbone

SDN

Traditional devices make forwarding decisions individually: each has its own control plane deciding routes, and its own data plane moving packets. SDN centralises the control plane in a controller that programs every device's data plane, so policy is expressed once and pushed everywhere. The management plane — how you configure and monitor the devices — is the third, distinct piece. Intent-based networking goes further, taking a statement of desired outcome and continuously verifying reality against it.

Check yourself: virtual & container

drill
Module 18

Data centre & internet architecture

Two ends of the same story: how a modern data centre fabric is built, and how those fabrics connect to each other to form the internet. Both are worth understanding conceptually well before you would ever configure them.

Inside the data centre

Top-of-rack switches sit in each cabinet with short copper or DAC runs to the servers, and fibre uplinks out. In spine-leaf terms those are the leaves; every leaf connects to every spine, and spines connect only to leaves. Any server is therefore exactly two hops from any other, latency is uniform and predictable, and adding capacity means adding a spine rather than redesigning.

Classic three-tier designs blocked half their links with spanning tree. Spine-leaf refuses to waste them: the fabric runs layer 3 between leaves and spines with ECMP spreading flows across every available path, so all links carry traffic all the time.

MLAG

Servers still want a single logical uplink across two switches for redundancy. MLAG (also MC-LAG, vPC, stacking) lets two switches present themselves as one LACP partner, so the server bonds two links to what it believes is one device — no STP blocking, full bandwidth, and survival of a switch failure. The trade-off is a peer link and shared state between the two switches, which is another split-brain risk to design around.

VXLAN and EVPN

The fabric is routed, but applications still want layer 2 adjacency and VM mobility. VXLAN solves this by encapsulating an entire Ethernet frame inside UDP (port 4789) and carrying it across the routed underlay. The tunnel endpoints are VTEPs, usually the leaf switches. Two extra benefits: the segment identifier is 24 bits, giving about 16 million segments instead of the 4094 VLANs allow, and the outer header is normal IP, so the underlay needs to know nothing about tenants.

EVPN is the control plane that makes VXLAN sane. Without it, VTEPs learn remote MAC addresses by flooding. EVPN uses BGP to advertise MAC and IP reachability between VTEPs, so the fabric knows where every endpoint is without flooding, supports anycast gateways on every leaf, and handles ARP suppression.

Encapsulation overhead calculator

tool

Overlays cost bytes. Work out what the underlay MTU has to be so the tenant can still use 1500.

How the internet actually fits together

The internet is roughly 75,000 autonomous systems agreeing to carry each other's traffic. Three commercial relationships explain almost all routing behaviour:

  • Transit — you pay a provider to reach everywhere. They advertise the full table to you and your prefixes to everyone.
  • Peering — two networks exchange traffic destined for each other's customers only, usually without payment, usually at an internet exchange point where hundreds of networks meet on a shared fabric. Cheaper and lower-latency than sending the same traffic via transit.
  • Customer — the inverse of transit; you sell it to someone smaller.

A packet's journey is therefore: your router, your ISP's access network, their backbone, an exchange point or transit provider, the destination's ISP, the destination network. Nobody plans that path end to end. Each AS independently picks the next hop it prefers, and the path emerges.

CDNs and anycast

A content delivery network keeps copies of content at edge sites close to users. The request never crosses an ocean because it never leaves the region. Two mechanisms steer users to the right edge: DNS-based routing, where the authoritative server answers differently depending on where the query came from, and anycast, where every edge advertises the same IP prefix by BGP and normal routing delivers each client to the nearest instance.

Anycast has a second use: it absorbs volumetric DDoS by spreading the attack across every site that advertises the prefix, instead of concentrating it on one. It works well for short, stateless exchanges like DNS; for long TCP sessions, a routing change mid-connection can move you to a different server, which is why anycast TCP needs care.

Why a CDN changes troubleshooting. Two users resolving the same hostname legitimately get different addresses, so "it works for me" carries no information. Compare the resolved address, the edge location in the response headers, and whether the object was a cache hit before blaming the origin.

Check yourself: architecture

drill
Module 19

Network security

Security is not a device you add at the edge. It is a set of assumptions you stop making — that the LAN is trustworthy, that a MAC address identifies a device, that a packet's source address is real.

Where this sits: draws on modules 03, 05, 09, 10 and 14. Every attack here is an abuse of a mechanism you have already met.

The starting principles

The CIA triad: confidentiality (only the intended parties can read it), integrity (nobody altered it undetected), availability (it is there when needed). Almost every control maps to one of these, and they pull against each other — encrypting everything harms availability when a key is lost.

AAA: authentication (who are you), authorisation (what may you do), accounting (what did you do). RADIUS and TACACS+ implement it for network devices. Least privilege and defence in depth are the two habits that matter most in practice.

Filtering traffic

DeviceOperates atDecides on
Packet filter / ACL3–4Source and destination IP, port, protocol. Stateless — must permit the return traffic explicitly
Stateful firewall3–4Tracks connections, so replies to permitted outbound traffic are allowed automatically
Next-generation firewall3–7Adds application identification, user identity, TLS inspection and IPS
Proxy7Terminates and re-originates the session; caching, content filtering, logging
IDS2–7Detects and alerts, out of band on a mirror port. Cannot stop anything
IPS2–7Inline, so it can drop. A false positive here becomes an outage

Rules are evaluated top to bottom, first match wins, and the list ends with an implicit deny. Order matters more than content: a permissive rule above a restrictive one makes the restrictive one dead code.

Firewall rule evaluator

tool
Set the values and evaluate.

Attacks and their countermeasures

Match the attack

drill

0 correct
AttackWhat happensCountermeasure
ARP spoofing / poisoningAttacker answers ARP requests to become a man in the middleDynamic ARP Inspection with DHCP snooping
MAC floodingFloods the CAM table until the switch fails open and floods all framesPort security limiting MAC addresses per port
VLAN hoppingDouble tagging or negotiating a trunk from an access portDisable DTP, set an unused native VLAN, hard-code access ports
Rogue DHCP serverHands out a gateway the attacker controlsDHCP snooping with trusted ports
DHCP starvationRequests every address in the scope with forged MAC addresses until nothing is left for real clientsPort security limiting MACs per port, plus DHCP snooping rate limits
IP spoofingForged source address, used to hide, to reflect an attack onto a victim, or to defeat address-based trustIngress and egress filtering (BCP 38) — drop packets whose source could not legitimately arrive on that interface
Port scanning and reconnaissanceMapping which hosts and services exist before attacking oneNot preventable, but detectable: IDS signatures, and reducing the attack surface so there is little to find
TCP reset attackForged RST packets tear down a session an attacker can observe or guessEncryption, randomised sequence numbers, and not exposing plaintext protocols
DNS poisoningForged records send users to the wrong addressDNSSEC, restricted recursion, response rate limiting
DDoS / amplificationBotnet or reflected UDP services (DNS, NTP, memcached) saturate the linkUpstream scrubbing, rate limiting, disabling open reflectors
On-path (MITM)Attacker relays and can alter trafficTLS with certificate validation, mutual authentication
Evil twinFake AP with the same SSID harvests credentials802.1X with certificate validation, wireless IPS
Social engineering / phishingThe user is the vulnerabilityTraining, MFA, mail authentication with SPF, DKIM and DMARC

Hardening the network itself

  • Change default credentials, disable unused ports and services, remove Telnet and HTTP management in favour of SSH and HTTPS.
  • Port security — limit MAC addresses per port and define the violation action (protect, restrict, shutdown).
  • 802.1X everywhere it is practical, with a guest or quarantine VLAN for devices that fail.
  • Network segmentation — separate VLANs for users, servers, voice, management, guest and IoT, with rules between them. A flat network turns one compromised laptop into a full breach.
  • Microsegmentation — the same idea taken to individual workloads rather than subnets, enforced by host firewalls, hypervisor policy or a service mesh. Two servers in the same VLAN can be prevented from talking to each other at all, which removes the lateral movement that segmentation alone still permits.
  • Zero trust — stop treating network location as evidence of trust. Every request is authenticated and authorised on its own merits, based on identity and device posture, whether it came from a desk in the office or a cafe.
  • Private VLANs and client isolation stop devices in the same segment from reaching each other.
  • Screened subnet (DMZ) — public-facing servers sit between two rule sets, so a compromise there gains no path inward.
  • NAC — posture-check devices before admitting them: patch level, antivirus, certificate.
  • Keep firmware current, back up configurations off-box, and keep a change log. Most "sudden" outages follow a change nobody wrote down.

Physical security counts. Locked comms rooms, badge readers, cameras, and cable locks. An attacker with physical access to a switch does not need any of the attacks above.

Check yourself: security

drill
Module 20

Tools & troubleshooting

The difference between an engineer and someone who restarts things is method. The method below is the one CompTIA examines, and it is genuinely how good troubleshooting works: narrow the problem before you touch anything.

Where this sits: uses the tools introduced in module 07 and applies them as a method. Goes one level deeper in module 21.

The seven steps

  1. Identify the problem. Gather information, question users, identify symptoms, determine what changed, and duplicate the fault if you can. "What changed?" resolves more incidents than any tool.
  2. Establish a theory of probable cause. Question the obvious first. Work the OSI model — top down, bottom up, or divide and conquer, but pick one deliberately.
  3. Test the theory. If it is confirmed, move on. If not, form a new theory or escalate.
  4. Establish a plan of action and identify potential effects. Who will this interrupt, and when is the window?
  5. Implement the solution or escalate.
  6. Verify full system functionality and, where possible, put preventive measures in place.
  7. Document findings, actions and outcomes. Undocumented fixes get made again next year, from scratch.
Exam behaviour. Questions describing a fault usually ask "what should you do next", not "what is broken". Find where the scenario sits in the seven steps and pick the following one. Never pick a step that skips ahead.

Command line tools

Command reference

tool

Hardware tools

Cable tester

Continuity and pinout only. Passes split pairs, so it proves a cable is connected, not that it is good.

Certifier

Measures against the category standard — crosstalk, return loss, delay skew — and produces the pass certificate an installer owes you.

TDR / OTDR

Sends a pulse and times the reflection to locate a break or high-loss point by distance. Copper and fibre respectively.

Tone generator and probe

"Fox and hound" — puts a tone on a cable so you can find the other end in a bundle of four hundred.

Light meter / OPM

Measures actual optical power in dBm against the link budget.

Protocol analyser

Wireshark or a tap. The final authority: it shows what is actually on the wire rather than what a device claims.

Spectrum analyser

Finds non-Wi-Fi RF interference that a Wi-Fi scanner cannot see at all.

Punchdown tool / crimper

110 blocks and keystones; crimpers for RJ45 plugs on stranded patch cable.

Monitoring and documentation

You cannot troubleshoot what you never measured. Establish a baseline of normal utilisation, latency and error counts so "slow" becomes a number rather than an opinion. Collect device metrics with SNMP, logs with syslog, flow records with NetFlow/sFlow/IPFIX (who talked to whom, how much), and packets with SPAN ports or taps when you need the detail. Feed logs into a SIEM for correlation — and note that correlation is only as good as the clock synchronisation behind it, which brings you back to module 12.

Documentation worth keeping current: physical and logical topology diagrams, an IP address management record, rack and floor plans, cable and port maps, a configuration baseline per device, and a change log. A network diagram that is a year out of date is worse than none, because people trust it.

Fault diagnosis

drill

0 correct

Check yourself: troubleshooting

drill
Module 21

Packet capture & analysis

Every other tool reports what a device believes. A capture shows what actually crossed the wire. When two teams disagree about whose fault something is, this is the evidence that ends the argument — which makes it the highest-value skill on the whole list.

Where this sits: builds on module 20. This is where modules 08 to 11 stop being theory — every handshake and retransmission described there is visible here.

Getting the traffic

Switches forward frames only to the port that needs them, so a capture on your laptop sees your own traffic, broadcasts, and nothing else. Options, in ascending order of fidelity:

  • Capture on an endpoint — tcpdump on the server itself. Easiest and usually sufficient. Shows what the host received, which may differ from what was sent.
  • SPAN / port mirror — the switch copies traffic from one port or VLAN to your capture port. Convenient, but mirrored traffic is deprioritised, so a busy switch drops copies and you get phantom "missing" packets. It also usually strips VLAN tags and errored frames.
  • Network TAP — a passive device in the physical path that copies every bit, including errors and tags, without the switch's involvement. What you use when the answer must be trustworthy.

Capture filters (BPF syntax, applied before the packet is stored) reduce the file size and the load: tcpdump -i eth0 -nn 'host 10.1.1.5 and port 443'. Display filters (Wireshark syntax, applied afterwards) narrow what you look at without losing the rest. They are different languages, and mixing them up is the first hurdle everyone hits. Useful tcpdump flags: -nn no name resolution, -s0 full packet, -w file.pcap to write, -c 100 to stop after 100.

Display filter builder

tool

Pick what you are looking for and get the filter, in both syntaxes.

Choose an intent above.

Reading a trace

Below is a short capture of a client fetching a page. Click any row to see what it tells you and what to check next.

Annotated capture

tool

Select a packet.

Signals worth recognising instantly

Retransmissions

The same sequence number sent again. A few are normal; a steady rate means real loss. Where they appear tells you which side of the capture point the loss is on.

Duplicate ACKs

The receiver repeatedly acknowledging the same byte means it is getting later data but is missing something. Three duplicates trigger fast retransmit.

Zero window

The receiver's buffer is full and it has told the sender to stop. That is an application or host problem, not a network one.

RST after SYN

Nothing listening, or a device deliberately tearing the connection down. Check the source MAC of the reset — it is sometimes not the server at all.

SYN with no reply

Retries at roughly 1, 2, 4 seconds then gives up. Something is dropping silently — a firewall or a missing return route.

Long gap before a response

If the network delivered the request quickly and the reply came 8 seconds later, the network is exonerated. Timestamp columns settle this in seconds.

Techniques

  • Follow TCP stream reassembles a conversation into readable form — invaluable for HTTP, SMTP and anything plain text.
  • Statistics → Conversations ranks talkers by bytes, which finds the source of unexpected traffic in seconds.
  • Statistics → I/O graph plots throughput over time so you can line a complaint up with a spike.
  • Expert Information collects Wireshark's own warnings about retransmissions, resets and malformed packets.
  • Capture at both ends of a problem path simultaneously. Comparing what left with what arrived localises loss precisely, and is the only way to prove where a packet died.
Capture responsibly. A full capture contains credentials, personal data and business content. Get authorisation, limit scope with capture filters, store it encrypted, and delete it when the ticket closes. On encrypted traffic you can still see addresses, ports, sizes, timing and the SNI — often enough to solve the problem without decrypting anything.

What does this capture show?

drill

0 correct

Check yourself: capture

drill
Module 22

Network design & address planning

Everything so far has been components. Design is choosing which ones, arranged how, with which addresses — and doing it so that the person who inherits it in five years can extend it without starting again.

Where this sits: pulls together modules 03, 04, 05, 14 and 19 into decisions rather than components.

Principles

  • Hierarchy. Access layer connects endpoints, distribution aggregates and applies policy, core moves traffic fast and does little else. Small sites collapse core and distribution into one pair; the roles still exist conceptually.
  • Segment by function and trust, not by floor. Users, servers, voice, wireless, guest, IoT, management and cameras each get their own VLAN and subnet, because each needs different rules.
  • Summarise. If every subnet at a site falls inside one contiguous block, that site is one route to everyone else. Allocate with room to grow rather than tightly.
  • No single point of failure on anything shared. Dual uplinks, dual power, two gateways with VRRP, two DNS and DHCP servers.
  • Manage out of band. A separate management VLAN, and console access that does not depend on the network being healthy.
  • Document as you build. A diagram, an address plan, a VLAN table and a change log. Retrofitted documentation is always wrong.

Addressing that scales

Give each octet a job. A common scheme inside 10.0.0.0/8 is 10.[site].[vlan].0/24, so 10.20.30.0/24 is site 20, VLAN 30 — and the whole of site 20 summarises as 10.20.0.0/16. Keep VLAN IDs and third-octet values aligned, so VLAN 30 is always x.x.30.0 wherever you are. It costs nothing and makes reading a firewall log trivial.

Address plan generator

tool

A worked design

The brief: 100 employees, 10 servers, 20 VoIP phones, 10 cameras, 5 access points, guest Wi-Fi, one internet connection, remote-access VPN.

DecisionChoiceWhy
TopologyCollapsed core: two stacked layer 3 switches, access switches dual-homed to bothAt this size a separate core adds cost and no resilience. Stacking or MLAG removes STP blocking
VLANs10 management, 20 servers, 30 users, 40 voice, 50 wireless, 60 guest, 70 camerasFunction-based, and the numbering leaves gaps for later
RoutingSVIs on the core pair, VRRP or stack-shared gateways, static default to the firewallNo dynamic protocol needed for one site with one exit
FirewallZones per VLAN; guest and IoT permitted to the internet only; management reachable from a jump host onlySegmentation is worthless without rules between the segments
WirelessController or cloud-managed APs, PoE+ from access switches, corporate SSID on 802.1X and guest SSID isolated on VLAN 60Per-user credentials, no shared key to leak, guests never touch internal VLANs
VoiceVoice VLAN on access ports with PCs untagged behind phones, DSCP EF trusted from the phone onlyOne cable per desk, and QoS marking that cannot be forged by the PC
ServicesTwo DNS/DHCP servers, internal NTP taking time from the firewall or a GNSS source, syslog and SNMP to a monitoring hostAnything users depend on needs a second instance
Remote accessFirewall-terminated VPN with MFA, split tunnel or full tunnel per policy, users landing in their own zoneRemote users should get the same rules as on-site, not more
ResilienceDual PSUs and uplinks, UPS on comms rooms, 4G backup on the firewall, nightly config backupsDesign for the failures that actually happen: power and single links

Design decisions

drill

0 correct

Build it in a lab

Reading is not enough — the concepts stick when you break them yourself. Cisco Packet Tracer is free and ideal for switching, VLANs, STP and routing exercises. GNS3 and EVE-NG run real network operating system images for realistic behaviour. Proxmox, Hyper-V or VirtualBox on a spare machine lets you run pfSense, OPNsense or VyOS as a router and firewall, with Linux VMs as clients.

A lab worth building, in order: two VLANs on a switch and prove they cannot talk; add a router or SVI and prove they can; add DHCP with a relay; add a firewall rule that blocks one direction and confirm it from both ends; break the subnet mask deliberately and watch what fails; add a second uplink and watch STP block it; then capture the whole boot sequence of a client — DHCP, ARP, DNS, TCP, TLS, HTTP — in Wireshark and identify every packet. That last exercise is worth more than a week of reading.

Check yourself: design

drill
Module 23

Automation, APIs & configuration management

Configuring one switch by hand is fine. Configuring forty consistently, proving they are still configured that way next month, and rolling back safely when they are not — that needs a different approach. This is where networking meets software practice.

Managing devices at all

In-band management

SSH to the device over the production network. Convenient, and useless precisely when you need it — a bad rule locks you out of the box you need to fix.

Out-of-band management

A separate path: dedicated management ports on their own VLAN or physical network, console servers, and often a 4G modem. This is what saves a site visit.

Console access

Serial, usually 9600 8N1, reachable through a terminal server. The only thing that works when the device has no usable IP configuration at all.

Management VLAN hygiene

Never VLAN 1, never the native VLAN, reachable only from a jump host, and with SSH keys or certificates rather than shared passwords.

Running versus startup configuration. The running config is live in memory and takes effect instantly; the startup config is what loads at boot. Forgetting to save means a reboot silently reverts your work — and remembering to save too early means a mistake survives the reboot that would have rescued you. Many platforms offer a confirmed commit that rolls back automatically unless you confirm within a few minutes; use it for anything that could sever your own connection.

Configuration management

  • Back up every device automatically, nightly, to a repository. A config file is small; there is no excuse for not having last week's.
  • Diff the backups. Yesterday's config against today's answers "what changed?" — the single most useful question in troubleshooting — in seconds rather than hours.
  • Version control the whole lot in git. You get history, blame, review before merge, and rollback for free.
  • Change control is not bureaucracy for its own sake: a window, a documented plan, a tested rollback, and someone else who read it. Most major outages are self-inflicted during a change nobody reviewed.
  • Standardise firmware across a platform. Mixed versions produce bugs that only appear between two specific devices, which are miserable to diagnose.

Programmatic interfaces

Screen-scraping a CLI over SSH works and is still widely done — Netmiko and NAPALM exist to make it bearable — but it is brittle, because a firmware upgrade that reformats one output column breaks your script. Structured interfaces are the alternative:

InterfaceTransportData formatNotes
REST APIHTTPSJSONThe common case on modern controllers and firewalls. Verbs map to actions: GET read, POST create, PUT replace, PATCH modify, DELETE remove
NETCONFSSH (830)XMLPurpose-built for network configuration. Supports candidate configs, validation and atomic commit across devices
RESTCONFHTTPSJSON or XMLNETCONF's model exposed over HTTP
YANG—Schema languageNot a protocol: the data model that defines what NETCONF and RESTCONF may contain, so different vendors can share structure
gNMI / streaming telemetrygRPCProtobufDevices push counters continuously instead of waiting to be polled by SNMP — far higher resolution, far lower overhead

Read status codes the same way as in module 11: 401 means your token is wrong, 403 means the token is fine but lacks permission, 404 means the path or object name is wrong, and 429 means you are polling too fast.

Infrastructure as code

Two ideas do most of the work. Declarative configuration describes the desired end state and lets the tool work out the steps, rather than scripting the steps yourself. Idempotency means running it twice changes nothing the second time — so you can run it routinely to correct drift, not just at build time.

Ansible

Agentless, connects over SSH or an API, playbooks in YAML with Jinja2 templating. The usual first step for network engineers because it needs nothing installed on the device.

Terraform

Provisions infrastructure — cloud VPCs, subnets, security groups, load balancers — and keeps a state file recording what it built so it knows what to change or destroy.

Templating

One template plus a variables file per site generates forty consistent configs. Consistency is the real prize; the time saving is secondary.

Source of truth

A database such as NetBox holding intended addressing, VLANs and cabling, which the automation reads. The network then matches the documentation because the documentation builds the network.

Worth learning alongside: enough Python to parse and request things, YAML and JSON to read data files and API responses, and git to work with others without overwriting them. None needs to be deep to be useful.

JSON from an API — read the response

tool

A typical interface listing. Click a field to see what it tells you and what a script would do with it.

Select a field.

Check yourself: automation

drill
Module 24 — capstone

Follow a packet

The real test of networking knowledge is whether you can explain, in order and without hand-waving, everything that happens between typing a URL and seeing a page. Every module in this lab appears somewhere in the sequence below. Step through it, then break something and watch where it fails.

Where this sits: every module in the lab appears somewhere in this sequence. If a stage does not make sense, the trail line at the top of the relevant module says where to go back to.

https://www.example.com — end to end

tool

The short version

If you can expand each of these into a paragraph, and name the command or filter that proves it happened, you have the mid-level understanding this lab set out to build.

StageLayerHow you prove it
Link comes up, speed and duplex negotiated1ethtool eth0, switch port counters
DHCP DORA assigns address, mask, gateway, DNS2–7ip addr, filter bootp
DNS resolves the name to an address7dig www.example.com, filter dns
Host ANDs destination with its mask — local or remote?3ip route get <ip>
ARP finds the gateway's MAC (not the server's)2–3ip neigh, filter arp
Frame built, switch forwards on its MAC table, VLAN tag added on the trunk2show mac address-table
Router picks the longest prefix match, decrements TTL, rewrites the layer 2 header3show ip route, traceroute
Firewall evaluates rules top down against connection state3–7Firewall session log
NAT rewrites source address and port, recording the translation3–4NAT translation table
BGP carries the packet across autonomous systems to the destination network3Looking glass, traceroute
TCP three-way handshake, MSS negotiated4Filter tcp.flags.syn==1
TLS handshake: SNI sent, certificate validated against a trusted chain, keys agreed5–6Filter tls.handshake, openssl s_client
HTTP request sent with Host header; reverse proxy routes to a backend7curl -Iv, response headers
Response returns down the same chain, de-encapsulated at each layer7→1Follow TCP stream
Where to go next. Build the lab in module 22 and capture that entire sequence yourself. When you can point at each packet in Wireshark and say what it is, why it is there, and what would happen if it were missing, the acronyms stop being a list to memorise and become a description of something you can see.
Module 25

Exam room

Two ways to test yourself: flashcards for recall, and a randomised exam drawn from every module. Neither is stored anywhere — refresh and you start clean.

Flashcards

drill
TAP TO REVEAL

Practice exam — 15 questions, whole syllabus

drill

Final reminders

Numbers to have automatic

Ports 20/21, 22, 23, 25, 53, 67/68, 69, 80, 110, 123, 143, 161/162, 389, 443, 445, 514, 587, 636, 993, 995, 3389. Cable lengths: 100 m copper. Host counts: /24=254, /25=126, /26=62, /27=30, /28=14, /29=6, /30=2.

Distinctions examiners love

Hub/switch/router. Collision vs broadcast domain. IDS vs IPS. Policing vs shaping. RTO vs RPO. Latency vs jitter vs throughput. Authentication vs authorisation. SFTP vs FTPS. Stratum vs hop count.

When a question looks ambiguous

Pick the answer that is least destructive, most standards-based, and follows the documented process. "Check the physical connection" is right far more often than it feels.

Where people lose marks

Subnetting under time pressure, port numbers, and troubleshooting-order questions. All three are fixed by drilling, which is what the tools above are for.