Networking fundamentals

How data really moves from one host to another

Every fault I fix and every design I sign off comes back to these basics. This page walks a packet through the layers and the services every network depends on, with the numbers I use most. You can step through each diagram at your own pace.

  • OSI and TCP/IP
  • Encapsulation
  • ARP
  • DHCP
  • DNS
  • TCP and UDP
  • ICMP
  • NAT
  • MTU
A packet passing down one stack and up another Two four layer stacks, a sender and a receiver. Packets travel down the sender's stack, gaining headers, across the wire as a frame, and up the receiver's stack as each header is removed. SENDER RECEIVER Application Transport Internet Link Application Transport Internet Link frame on the wire headers added headers removed
Live view · encapsulation, down and back up
Models

Two models, one shared language

The Open Systems Interconnection (OSI) model has seven layers and the TCP/IP model, named after the Transmission Control Protocol (TCP) and Internet Protocol (IP), has four. Real networks run TCP/IP, but I still use the OSI layers every day, because they give everyone the same words for where a problem sits. When I troubleshoot, I work from layer 1 upwards.

The seven OSI layers and the four TCP/IP layers Two stacks side by side. The OSI model has seven layers, from physical at the bottom to application at the top. The TCP/IP model groups them into four: link, internet, transport and application. For each layer, a panel shows the unit of data, the main protocols, the devices that work there and what I check when something fails. OSI model TCP/IP model At this layer Applicationlayers 5 to 7 Transport Internet Linklayers 1 and 2 1 · Physical Layer 1 · PhysicalUnit of data (PDU)BitsProtocols and standardsCopper, fibre and radio signals:Cat 6A, OM4 and OS2, 10GBASE-SRDevices that work hereCables, optics, repeaters andmedia convertersWhat I checkLink light, interface errors andoptic power (DOM) readings 2 · Data link Layer 2 · Data linkUnit of data (PDU)FrameProtocols and standardsEthernet, 802.1Q VLANs, ARP,spanning tree, LACP, Wi-Fi 802.11Devices that work hereSwitches, bridges and wirelessaccess pointsWhat I checkMAC table, VLANs, trunks andspanning tree state 3 · Network Layer 3 · NetworkUnit of data (PDU)PacketProtocols and standardsIPv4, IPv6, ICMP, IPsec,OSPF and EIGRPDevices that work hereRouters and layer 3 switchesWhat I checkRouting table, ARP table,ping and traceroute 4 · Transport Layer 4 · TransportUnit of data (PDU)Segment (TCP), datagram (UDP)Protocols and standardsTCP and UDP, with port numbersthat identify each applicationDevices that work hereStateful firewalls, layer 4 loadbalancers, NAT with port translationWhat I checkPorts, the TCP handshake andfirewall session tables 5 · Session Layer 5 · SessionUnit of data (PDU)DataProtocols and standardsOpens, keeps and closes sessions:RPC and NetBIOS sessionsDevices that work hereNo devices of its own: the hostsand applications do thisWhat I checkSession timeouts, idle dropsand reconnects 6 · Presentation Layer 6 · PresentationUnit of data (PDU)DataProtocols and standardsFormatting, encoding, compressionand encryption, such as TLSDevices that work hereHosts, plus TLS offload on proxiesand load balancersWhat I checkCertificates, cipher suites andcharacter encoding 7 · Application Layer 7 · ApplicationUnit of data (PDU)DataProtocols and standardsHTTP, DNS, DHCP, SMTP, SSH,SNMP, NTP and many moreDevices that work hereProxies, layer 7 firewalls andload balancers, and the applicationsWhat I checkDNS answers, HTTP status codes,application and server logs

Swipe sideways to see the whole diagram.

Step 1
  1. Layer 1 moves raw bits as electrical, light or radio signals. Many faults I find are simple: a bad patch lead, a dirty fibre connector or the wrong optic. That is why I always start at the bottom.

  2. Layer 2 moves frames between devices on the same local area network (LAN) or virtual LAN (VLAN), using media access control (MAC) addresses. Switches learn which MAC address sits behind which port. Spanning tree and the Link Aggregation Control Protocol (LACP) work here. Loops, VLAN mismatches and duplex problems live here too.

  3. Layer 3 moves packets between networks using IP addresses. Routers choose the path from their routing table, which protocols such as Open Shortest Path First (OSPF) and the Enhanced Interior Gateway Routing Protocol (EIGRP) fill in. Every router a packet crosses lowers its time to live (TTL) by one.

  4. Layer 4 carries data between applications using port numbers. TCP adds reliability with a handshake and acknowledgements. The User Datagram Protocol (UDP) sends without either, which suits voice, the Domain Name System (DNS) and tunnels.

  5. Layer 5 opens, keeps and closes conversations between applications. The TCP/IP model folds it into the application layer, so I rarely treat it on its own.

  6. Layer 6 deals with how data is formatted, compressed and encrypted. TLS (Transport Layer Security) is often placed here, although it does not sit neatly in any one layer.

  7. Layer 7 is where applications talk: web, email, name lookups and management traffic. Layer 7 firewalls and load balancers read this far into the packet to make their decisions.

Each layer has a name for its data

Data at the top, then a segment (TCP) or datagram (UDP), a packet, a frame and finally bits. Using the right word tells a colleague which header I am talking about.

Devices span layers

A switch works at layer 2 and a router at layer 3. A stateful firewall reads layers 3 and 4, and often layer 7. A load balancer works at layer 4 or layer 7, depending on how it is set up.

Some protocols sit between layers

Multiprotocol Label Switching (MPLS) is often called layer 2.5, because its label sits between the frame and the packet. Virtual Extensible LAN (VXLAN) carries a whole layer 2 frame inside UDP port 4789, which is why it needs a larger maximum transmission unit (MTU).

Encapsulation

Each layer wraps the one above

Before data leaves a host, each layer adds its own header. The receiver removes them in reverse. Knowing exactly which header holds which field is what lets me read a packet capture quickly.

Encapsulation: how each layer wraps the data Data from an application gains a TCP header to become a segment, an IP header to become a packet, and an Ethernet header and trailer to become a frame. The frame crosses the wire as bits. At the receiver, each header is checked and removed in reverse order. Sender10.1.10.20 Receiver10.1.20.50 bits on the wire Ethernet14 bytes IP20 bytes TCP20 bytes Dataup to 1,460 bytes FCS4 bytes Data TCP segment IP packet Ethernet frame 1. Frame checked2. Packet read3. Port 443 found The application hands its data down, for example an HTTPS request.On its own, the data has no idea how to reach the other host. TCP adds source port 52100, destination port 443, sequence andacknowledgement numbers, and flags such as SYN and ACK. IP adds source 10.1.10.20, destination 10.1.20.50, a TTL of 64and protocol number 6, which means TCP. Ethernet adds the destination MAC (the gateway), the source MAC (the PC),EtherType 0x0800 for IPv4, and a frame check sequence at the end. The frame leaves as signals: voltage on copper, light in fibre,or radio waves in the air. The receiver works upwards: it checks the FCS and the MAC, removes the frame,reads the IP header, then hands the segment to the application on port 443.

Swipe sideways to see the whole diagram.

Step 1
  1. The application creates its data, for example a web request. It knows nothing about addresses or links yet.

  2. The transport layer adds a header with port numbers, so the receiver knows which application the data is for, and sequence numbers, so nothing is lost or reordered.

  3. The network layer adds source and destination IP addresses and a time to live. These stay the same from end to end, unless network address translation (NAT) changes them.

  4. The data link layer adds MAC addresses for this hop only, plus a frame check sequence (FCS) to catch corruption. The frame is rebuilt at every router.

  5. The physical layer sends the frame as signals. A standard Ethernet frame is 64 to 1,518 bytes, or 1,522 bytes with a VLAN tag.

  6. The receiver reverses the process, checking and removing one header at a time until the data reaches the right application.

Packet walk

Following one packet, hop by hop

This is the walk I use to explain almost any network fault. It shows what really changes between a personal computer (PC) and a server on another subnet, and what never changes.

A packet walk from a PC to a server across two routers A PC on 10.1.10.0/24 sends to a server on 10.1.20.0/24 through a switch, two routers and another switch. A panel shows the MAC addresses, IP addresses and TTL on each hop. It also shows what each device does: ARP for the gateway, forwarding by MAC, routing by longest match, delivery and the reply. 10.1.10.0/24 10.0.12.0/30 10.1.20.0/24 PC10.1.10.20 SwitchVLAN 10 Router 110.1.10.1 Router 210.0.12.2 SwitchVLAN 20 Server10.1.20.50 Headers on this hop What happens Source MAC Destination MAC Source IP Destination IP TTL PCnot known yet10.1.10.2010.1.20.506410.1.20.50 is not inside 10.1.10.0/24,so the PC must send it to its defaultgateway, 10.1.10.1. PCffff.ffff.ffff (broadcast)ARP has no IP headerasks for 10.1.10.1noneThe switch floods the ARP broadcastin VLAN 10. Router 1 replies by unicastwith its MAC, and the PC caches it. PCRouter 1, LAN side10.1.10.2010.1.20.5064The switch learns the PC’s MAC on itsport and forwards the frame toRouter 1 only. Router 1, WAN sideRouter 210.1.10.2010.1.20.5063Router 1 removes the frame, finds thelongest match, 10.1.20.0/24 via 10.0.12.2,lowers the TTL and builds a new frame. Router 2, LAN sideServer10.1.10.2010.1.20.5062The server’s subnet is directlyconnected. Router 2 uses ARP for theserver’s MAC if needed, then delivers. ServerRouter 2, LAN side10.1.20.5010.1.10.2064The reply makes the same decisionsin reverse. It may take a differentpath, which matters to firewalls. changes at every routerchanges at every routerthe same end to endthe same end to endone less per routerIf the destination MAC is wrong on theserver side, I check ARP and thegateway. Changed IPs mean NAT.

Swipe sideways to see the whole diagram.

Step 1
  1. The PC compares the destination with its own address and mask. The server is on another subnet, so the frame must go to the default gateway, not straight to the server.

  2. The PC needs the gateway’s MAC address. It broadcasts an Address Resolution Protocol (ARP) request, the switch floods it within the VLAN, and Router 1 answers by unicast.

  3. The frame carries the gateway’s MAC but the server’s IP address. The switch learns the PC’s MAC on the way and forwards the frame out of one port only.

  4. Router 1 removes the frame, looks up the longest matching route, lowers the TTL from 64 to 63, recalculates the IP header checksum and builds a fresh frame for the next hop.

  5. The destination is on a connected subnet. Router 2 resolves the server’s MAC with ARP if it is not cached, lowers the TTL again and delivers the frame.

  6. The server sends its reply to its own gateway, and the whole process runs in reverse. Return traffic can take a different path, so stateful firewalls must see both directions.

  7. MAC addresses change at every routed hop and the TTL drops by one per router. IP addresses and ports stay the same unless NAT or a proxy rewrites them.

Same subnet, no gateway

If the destination is inside the PC’s own subnet, the PC uses ARP for the destination itself and never touches the gateway. A wrong mask breaks exactly this decision.

Longest match wins

A router picks the most specific route that matches. A /24 beats a /16, and the default route, 0.0.0.0/0, is only used when nothing else matches.

Captures either side of a router

Both captures show the same IP addresses but different MAC addresses and a TTL one lower. If the IP addresses differ, something on the path is doing NAT.

Ethernet

Frames, MAC addresses and how switches decide

Ethernet carries almost every packet I touch, on copper, fibre and inside data centre overlays. Two things are worth knowing in detail: what is inside a frame, and how a switch decides where to send it.

The fields of an Ethernet frame, with and without a VLAN tag A standard frame has a preamble, destination MAC, source MAC, EtherType, a payload of 46 to 1,500 bytes and a 4 byte frame check sequence. A tagged frame adds a 4 byte 802.1Q tag after the source MAC. The tag holds a 16 bit tag protocol identifier, a 3 bit priority code point, a 1 bit drop eligible indicator and a 12 bit VLAN ID. One Ethernet frame, left to right as it is sent Preamble8 bytesDestination6 bytesSource6 bytesEtherType2 bytesPayload46 to 1,500 bytesFCS4 bytes Preamble8 bytesDestination6 bytesSource6 bytes802.1Q tag4 bytesEtherType2 bytesPayload46 to 1,500FCS4 bytes Destination comes first, so a switch can start forwarding early (cut through switching).The first 3 bytes of a MAC address are the vendor’s OUI (organisationally unique identifier).EtherType says what is inside: 0x0800 for IPv4, 0x86DD for IPv6, 0x0806 for ARP.A frame is 64 to 1,518 bytes, not counting the preamble.Short payloads are padded, and the FCS catches corruption. TPID 0x810016 bitsPCP3 bitsDEIVLAN ID12 bitsTPID 0x8100 marks the frame as tagged. PCP is the class of service, 0 to 7.The single DEI bit marks frames that may be dropped first. The 12 bit VLAN ID allows 1 to 4,094.A tagged frame can be 1,522 bytes. The tag does not reduce the IP MTU.

Swipe sideways to see the whole diagram.

Standard frame. Five fields follow the preamble. The switch only needs the first six bytes, the destination MAC, to decide where the frame goes. The frame check sequence (FCS) at the end lets the receiver throw away corrupted frames.

802.1Q tagged frame. On a trunk, a 4 byte tag sits between the source MAC and the EtherType. It holds a tag protocol identifier (TPID) of 0x8100, a 3 bit priority code point (PCP), a 1 bit drop eligible indicator (DEI) and the 12 bit VLAN ID. VLANs 0 and 4095 are reserved, so 4,094 VLANs are usable.

Animation
How a switch learns, floods, forwards and filters Four hosts connect to one switch, and the MAC address table fills as frames arrive. An unknown destination is flooded and a known one is forwarded out of one port. Frames between known hosts are filtered from the others, a broadcast reaches the whole VLAN, and silent entries age out. Host Aport 1 Host Bport 2 Host Cport 3 Host Dport 4 SwitchVLAN 10 VLAN MAC address Port Age 10Host A1 0 s 290 s 10Host B2 0 s 240 s 10Host C3 0 s 120 s Unknown unicast: flooded to every other port Host A is known: sent out of port 1 only Known: port 2 only. C and D never see it Broadcast: every port in the VLAN except the source Silent entries age out after 300 seconds

Swipe sideways to see the whole diagram.

Step 1
  1. Host A sends to Host B. The switch learns that A lives on port 1. It has never seen B, so it floods the frame out of every other port in the VLAN.

  2. Host B replies. The switch learns B on port 2, and because it already knows A, it sends the reply out of port 1 only.

  3. From now on, frames between A and B use only ports 1 and 2. Hosts C and D never see them. A frame for a host on the same port it arrived on is dropped.

  4. Host C sends an ARP broadcast. Broadcasts and multicasts the switch has not been told about are flooded to every port in the VLAN, so the VLAN is the broadcast domain.

  5. Entries for silent hosts are removed after 300 seconds on Cisco switches by default. A MAC address that keeps moving between ports usually means a loop.

Unicast, broadcast and multicast

A unicast frame goes to one MAC address. A broadcast, ffff.ffff.ffff, goes to every host in the VLAN. A multicast MAC goes to a group, and Internet Group Management Protocol (IGMP) snooping stops it reaching hosts that did not ask for it.

Collision and broadcast domains

A hub is one collision domain, while every switch port is its own. Full duplex links have no collisions at all, so collisions today point to a duplex mismatch. A VLAN is one broadcast domain, and a router ends it.

Ethernet has no TTL

Nothing stops a frame circling a layer 2 loop, so one loop can take down a whole VLAN in seconds. That is why spanning tree exists and why I keep VLANs small. The detail is on the switching page.

To find where a host is plugged in, I take its MAC address from the gateway’s ARP table. Then I follow show mac address-table address from switch to switch, using Cisco Discovery Protocol (CDP) or Link Layer Discovery Protocol (LLDP) neighbours, until it lands on an access port.

Cables and optics

MediumTypical useReachWhat to watch
Cat 6 copper1 Gb/s to desks and access points100 mBend radius and patch lead quality
Cat 6A copper10 Gb/s, and Power over Ethernet (PoE) for Wi-Fi 6 and 7 access points100 mHeat in large cable bundles carrying power
OM4 multimode fibre10GBASE-SR, 25 and 100 Gb/s short reach, at 850 nmabout 400 m at 10 Gb/sDirty connectors and polarity
OS2 single mode fibre10GBASE-LR (10 km) and ER (40 km), at 1310 or 1550 nmup to tens of kmOptic type must match at both ends
Direct attach copper (DAC)Server to top of rack switcha few metresVendor coding on third party cables

Form factors: small form factor pluggable (SFP) for 1 Gb/s, SFP+ for 10, SFP28 for 25, quad SFP (QSFP28) for 100 and QSFP double density (QSFP-DD) for 400 Gb/s. Digital optical monitoring (DOM) shows transmit and receive power, which is the first thing I read when a fibre link will not come up.

ARP

Finding a MAC address for an IP address

The Address Resolution Protocol (ARP) links layer 3 to layer 2. Every packet that leaves a host on Ethernet needs it, so a broken or poisoned ARP cache stops traffic as surely as a cut cable.

ARP, gratuitous ARP, proxy ARP and ARP spoofing A PC, a switch, a gateway and a fourth host. In normal ARP the PC broadcasts for the gateway and gets a unicast reply. In gratuitous ARP a new active gateway announces the virtual address after a failover. In proxy ARP the router answers for a remote address. In ARP spoofing an attacker forges a reply and the switch drops it. PC10.1.10.20/24PC10.1.10.20/24PCwrong mask: /16PC10.1.10.20/24 SwitchVLAN 10SwitchVLAN 10SwitchVLAN 10SwitchARP inspection on Gateway10.1.10.1Old activegateway has failedGatewayproxy ARP onGateway10.1.10.1 Server10.1.10.50New activevirtual 10.1.10.1Server10.1.10.50Attackerclaims 10.1.10.1 Broadcast: who has 10.1.10.1? Unicast reply: 10.1.10.1 is at MAC R1 Gratuitous ARP: 10.1.10.1 is at the virtual MAC Switches relearn the MAC on the new port Broadcast: who has 10.1.20.50? The router replies with its own MAC No match in the DHCP snooping table: dropped Forged: 10.1.10.1 is at the attacker

Swipe sideways to see the whole diagram.

ARP. To send to 10.1.10.1, the PC needs its MAC address. It broadcasts a request to the whole VLAN, the owner replies by unicast, and both sides cache the answer. Cisco routers keep ARP entries for 4 hours by default, while most hosts keep them for only a few minutes.

Gratuitous ARP. A device announces its own IP and MAC without being asked. After a first hop redundancy failover, the new active router sends one so every switch learns the virtual MAC on its port. Firewalls, load balancers and moved virtual machines do the same.

Proxy ARP. This PC has the wrong mask, so it thinks 10.1.20.50 is local and asks for it directly. The router, which has a route to it, answers with its own MAC and quietly fixes the mistake. Proxy ARP is on by default on Cisco IOS, and it can hide bad masks for years, so I turn it off with no ip proxy-arp.

ARP spoofing. ARP has no authentication, so an attacker can claim the gateway’s address and sit in the middle. Dynamic ARP Inspection (DAI) checks each reply against the DHCP snooping table of known address and port pairs, and drops forged ones.

Animation

Incomplete means no reply

An ARP entry that shows Incomplete means the request went out and nothing answered: the host is down, it is in another VLAN, or layer 2 is broken in between. I check with show ip arp and the switch MAC table.

Stale entries after a failover

If a firewall or server fails over without a gratuitous ARP, upstream routers keep the old MAC until it times out. clear ip arp for that address fixes it at once.

Timers that work together

On Nexus switches ARP entries last 1,500 seconds and MAC entries 1,800, so ARP refreshes before the MAC ages out. Get them the wrong way round and the switch floods unicast traffic it should know.

IPv6 does not use ARP. It uses Neighbour Discovery over ICMPv6 (the Internet Control Message Protocol for IPv6), which I cover on the IP addressing page.

DHCP

How a device gets its address, in four messages

The Dynamic Host Configuration Protocol (DHCP) gives every client its address, mask, gateway and DNS servers. The four messages are often remembered as DORA: discover, offer, request, acknowledge.

DHCP: discover, offer, request and acknowledge, through a relay A client in VLAN 10 gets an address from a DHCP server in another subnet. The Discover is broadcast, the router relays it to the server as a unicast with giaddr set, the server offers an address, the client requests it, and the server acknowledges. Later the client renews at 50 percent of the lease and rebinds at 87.5 percent. routed network Clientno address yetClient10.1.10.57 SwitchVLAN 10 Routerrelay: ip helper DHCP server10.9.0.10 From To UDP ports Key fields 1 · Discover0.0.0.0255.255.255.255 (broadcast)client 68 to server 67Client MAC. It has no address, so it broadcasts. 2 · Relay10.1.10.1 (the relay)10.9.0.10 (unicast)67 to 67giaddr 10.1.10.1 tells the server which scope to use.The router turns the broadcast into a unicast, because broadcasts never cross a router. 3 · Offer10.9.0.10, through the relaythe clientserver 67 to client 68Offered 10.1.10.57/24, gateway 10.1.10.1, DNS, lease 8 days. 4 · Request0.0.0.0255.255.255.255 (broadcast)68 to 67Asks for 10.1.10.57 from server 10.9.0.10.It broadcasts so any other server that made an offer can take it back. 5 · Acknowledge10.9.0.10, through the relaythe client67 to 68The lease is confirmed and the client configures itself.Many clients check the address is free with an ARP probe before they use it. 6 · Renew and rebind10.1.10.5710.9.0.10 (unicast)68 to 67At 50% of the lease (T1) the client renews by unicast.At 87.5% (T2) it broadcasts to any server. If the lease runs out, it starts again.

Swipe sideways to see the whole diagram.

Step 1
  1. A new client has no address, so it broadcasts a Discover from 0.0.0.0 to 255.255.255.255. Every device in the VLAN sees it, but only DHCP servers and relays act on it.

  2. Most servers sit in a data centre, not in every VLAN. The router’s ip helper-address forwards the broadcast as a unicast and fills in giaddr, the relay’s own address, so the server picks the right scope.

  3. The server offers an address with its settings: mask, gateway, DNS servers and lease time. The relay passes the offer back to the client.

  4. The client asks for the offered address, by broadcast, so that any other server that also made an offer knows it was not chosen.

  5. The server confirms the lease. The client sets its address, and many operating systems check that nobody else is using it first.

  6. Halfway through the lease the client renews directly with its server. If that fails, it tries any server at 87.5%. When the lease ends, it gives the address up and starts again.

Options I use most

OptionNameWhat it is for
1Subnet maskThe mask for the offered address.
3RouterThe default gateway.
6DNS serversThe resolvers the client should use.
15Domain nameThe DNS suffix added to short names.
42Network Time Protocol (NTP) serversTime sources for the client.
43Vendor specificFor example, how Cisco access points find their wireless controller.
51Lease timeHow long the address is valid.
66 and 67Trivial File Transfer Protocol (TFTP) server and boot fileNetwork boot (Preboot Execution Environment, PXE) and switch zero touch provisioning.
82Relay agent informationAdded by the switch or relay: which port and which switch the request came from.
150TFTP server (Cisco)Where Cisco IP phones fetch their configuration.

No helper, no address

A client that gives itself 169.254.x.x (Automatic Private IP Addressing, APIPA) never reached a server. On a new VLAN the first thing I check is the ip helper-address on the gateway interface, then show ip dhcp binding or the server’s scope.

The option 82 trap

DHCP snooping on an access switch adds option 82 with giaddr set to 0.0.0.0. An upstream Cisco relay drops that by default, so clients get nothing. The fix is no ip dhcp snooping information option on the switch, or trusting it on the relay.

Snooping stops rogue servers

DHCP snooping lets only trusted ports, the uplinks to real servers, send offers. It also builds the table of address and port pairs that ARP inspection and IP source guard rely on.

By default the helper forwards eight UDP services: DHCP on 67 and 68, plus Time, TACACS (Terminal Access Controller Access Control System), DNS, TFTP and the two NetBIOS ports. I switch off the ones that are not needed with no ip forward-protocol udp <port>. In the data centre, DHCP mostly matters at build time, for server network boot and switch zero touch provisioning.

DNS

Turning names into addresses, and caching the answer

The Domain Name System (DNS) sits underneath almost every application. When DNS fails, users rarely report a DNS problem. They report that email is down, logins fail or a website will not load.

How a DNS name is resolved, step by step A laptop asks its recursive resolver for www.example.com. The resolver, with an empty cache, asks a root server, which refers it to the .com servers, which refer it to the example.com authoritative server, which returns the address with a TTL of 300 seconds. The resolver caches the answer and serves later queries from its cache. Laptopstub resolver Resolverrecursive, caches Root servers13 names, anycast .com serverstop level domain example.comauthoritative Where is www.example.com? Not in cache Referral: ask the .com servers Referral: ask ns1.example.com Answer: A 198.51.100.80, TTL 300 Answer: 198.51.100.80 Cached for 300 seconds Next lookup, same name Answered from cache

Swipe sideways to see the whole diagram.

Step 1
  1. The laptop sends a recursive query to its resolver, usually on UDP port 53: please find the whole answer for me. The resolver checks its cache first.

  2. With nothing cached, the resolver asks a root server. The root does not know the address, but it refers the resolver to the servers for .com.

  3. The .com servers refer the resolver to the name servers that hold the example.com zone. These referrals are iterative queries: each server points to the next.

  4. The authoritative server for example.com returns the A record, 198.51.100.80, with a time to live of 300 seconds.

  5. The resolver passes the answer to the laptop and caches it. The laptop caches it too, for no longer than the TTL.

  6. Anyone who asks for the same name in the next 300 seconds gets the cached answer at once. That is why I lower the TTL a day before I move a service.

Record types

RecordHoldsExample of use
AAn IPv4 addresswww.example.com to 198.51.100.80
AAAAAn IPv6 addressThe same name over IPv6
CNAME (canonical name)An alias to another nameA friendly name pointing at a load balancer or cloud service
MX (mail exchange)Mail servers, with a preferenceWhere email for the domain is delivered
NS (name server)The name servers for a zoneDelegating a subdomain
SOA (start of authority)Zone settings and serial numberZone transfers and negative caching
PTR (pointer)A name for an address (reverse lookup)Readable names in logs and traceroutes
SRV (service)Service, port, priority and weightHow Windows clients find domain controllers
TXT (text)Free textSender Policy Framework (SPF) and domain ownership checks

UDP first, TCP when needed

Most queries use UDP port 53. Zone transfers and answers too large for UDP use TCP port 53, so blocking TCP 53 breaks things in odd ways. Encrypted DNS uses port 853 (DNS over TLS) or 443 (DNS over the secure Hypertext Transfer Protocol, HTTPS).

Split horizon and anycast

Split horizon gives different answers inside and outside the organisation. Anycast resolvers share one address announced by the Border Gateway Protocol (BGP) from several sites, so clients reach the nearest healthy one. The route must be withdrawn when the DNS service fails, not only the server.

How I test it

nslookup www.example.com or dig @10.9.0.53 www.example.com A shows exactly what a given resolver answers. On Cisco devices, no ip domain lookup stops a mistyped command hanging while the router tries to resolve it.

TCP and UDP

Reliable or fast: TCP and UDP

The transport layer decides how data travels between two applications. TCP checks everything arrives, in order. UDP just sends. Reading the TCP flags in a capture tells me more about a failing application than almost anything else.

A TCP connection: handshake, data, window, loss and close A client and server exchange a SYN, a SYN ACK and an ACK. Data is sent with byte based sequence numbers and acknowledged with the next byte expected. Several segments are covered by one acknowledgement within the window. A lost segment causes three duplicate acknowledgements and a fast retransmission. The connection closes with a FIN and ACK in each direction. Client10.1.10.20:52100 Server198.51.100.80:443 SYN · seq 1000 · MSS 1460 SYN ACK · seq 5000 · ack 1001 ACK · ack 5001 seq 1001 · 1,460 bytes of data ack 2461: the next byte I expect seq 2461 seq 3921 seq 5381 ack 6841 · window 64 KB seq 6841 lost seq 8301, 9761 and 11221 arrive ack 6841, sent three times seq 6841 sent again ack 12681: all caught up FIN ACK FIN ACK SYN SENTLISTEN SYN SENTSYN RECEIVED ESTABLISHEDESTABLISHED ESTABLISHEDESTABLISHED ESTABLISHEDESTABLISHED ESTABLISHEDESTABLISHED TIME WAITCLOSED

Swipe sideways to see the whole diagram.

Step 1
  1. The client picks a random high source port and an initial sequence number, then sends a synchronise (SYN) segment. It offers its maximum segment size (MSS) and, usually, window scaling and selective acknowledgement.

  2. The server sets the acknowledge (ACK) flag, acknowledges the client’s number plus one and sends its own starting sequence number. A SYN that gets no answer at all usually means a silent drop or a routing problem.

  3. The client acknowledges the server’s number. The connection is now established on both sides. A stateful firewall builds its session from these three packets.

  4. Sequence numbers count bytes, not packets. After 1,460 bytes starting at 1001, the server acknowledges 2461, which means: I have everything up to 2460, send 2461 next.

  5. The receiver advertises how much it can take before the sender must wait for an acknowledgement. One acknowledgement can cover several segments. A window of zero means the receiving application is not keeping up.

  6. The segment at 6841 is lost, but 8301, 9761 and 11221 arrive. Each of them triggers another acknowledgement for the missing byte. After three duplicates, the sender retransmits at once (fast retransmit) and slows down to ease congestion.

  7. Each side sends a finish (FIN) and acknowledges the other’s, so a clean close takes four packets. The side that closes first waits in TIME WAIT. A reset (RST) tears the connection down at once, for example when a port is closed.

How fast can one TCP flow go?

One flow can never send more than one window per round trip, however fast the link is. Change the numbers to see why long distance transfers crawl.

The most this flow can reach
about 26.2 Mb/s
Window needed to fill the link
about 2,441 KB (bandwidth delay product)

Throughput is at most window ÷ round trip time. Window scaling, agreed in the handshake, lets modern hosts use windows of many megabytes.

TCP flags I read in a capture

FlagWhat it means
SYN (synchronise)Opens a connection and carries the first sequence number.
ACK (acknowledge)The acknowledgement number is valid. Set on every segment after the first.
FIN (finish)The sender has finished sending.
RST (reset)Abort the connection at once.
PSH (push)Hand the data to the application now.
URG (urgent)The urgent pointer is valid. Rarely used.
ECE and CWRECE is the explicit congestion notification (ECN) echo: the receiver reports congestion on the path. CWR, congestion window reduced, confirms the sender has slowed down.

TCP and UDP side by side

TCPUDP
ConnectionThree way handshake firstNone, it just sends
Header20 to 60 bytes8 bytes
ReliabilityAcknowledges and resends lost dataNone. The application handles loss, if it cares
OrderDelivered in orderMay arrive out of order
Flow and congestion controlYes, with the windowNo
Typical usesWeb, email, Secure Shell (SSH), file transfer, databases, BGPDNS, DHCP, NTP, Simple Network Management Protocol (SNMP), syslog, voice and video, VXLAN, QUIC
Firewall behaviourSession follows the handshake and the FIN or RSTSession kept on a timer, so long silent flows can time out

Reading TCP when something fails

What the capture showsWhat it usually means
SYN with no reply, resent several timesA silent drop: a firewall rule, an access list or a routing problem on the way there or back.
SYN answered by RSTNothing is listening on that port, or a firewall is rejecting rather than dropping.
Handshake completes, then the transfer stallsOften MTU: small packets pass and full size ones are lost. Otherwise, the application itself.
Zero window from the receiverThe receiving application cannot keep up. The network is fine.
Many retransmissions and duplicate ACKsPacket loss somewhere on the path: errors, congestion or a bad link.

Small, battery powered Internet of Things (IoT) devices often avoid the cost of TCP. The Constrained Application Protocol (CoAP) runs over UDP and adds its own simple acknowledgements, while Message Queuing Telemetry Transport (MQTT) runs over TCP and keeps one long lived connection. The IoT page covers that choice.

Ports worth knowing

PortTransportServiceNote
20 and 21TCPFTP (File Transfer Protocol)Data and control. Needs an application layer gateway (ALG) through NAT.
22TCPSSH (Secure Shell) and SFTP (SSH File Transfer Protocol)Secure device and server management.
23TCPTelnetPlain text. I replace it with SSH.
25TCPSMTP (Simple Mail Transfer Protocol)Mail between servers.
49TCPTACACS+ (Terminal Access Controller Access Control System Plus)Device administration, encrypts the whole body.
53UDP and TCPDNSTCP for zone transfers and large answers.
67 and 68UDPDHCPServer 67, client 68.
69UDPTFTP (Trivial File Transfer Protocol)Firmware, phone and boot files.
80TCPHTTP (Hypertext Transfer Protocol)Plain web traffic.
88TCP and UDPKerberosWindows authentication. Not the same as IP protocol 88.
110TCPPOP3 (Post Office Protocol version 3)Mail download.
123UDPNTP (Network Time Protocol)Time.
143TCPIMAP (Internet Message Access Protocol)Mail access.
161 and 162UDPSNMP (Simple Network Management Protocol)Polling on 161, traps on 162.
179TCPBGP (Border Gateway Protocol)Routing between networks.
389TCP and UDPLDAP (Lightweight Directory Access Protocol)Directory lookups.
443TCP and UDPHTTPS (HTTP Secure)TCP for HTTP/1.1 and HTTP/2, UDP for HTTP/3 (QUIC).
445TCPSMB (Server Message Block)Windows file sharing.
500UDPIKE (Internet Key Exchange)Key exchange for IP security (IPsec).
514UDPSyslogLogs. TCP 6514 for syslog over TLS.
546 and 547UDPDHCPv6 (DHCP for IPv6)Client 546, server 547.
636TCPLDAPS (LDAP Secure)LDAP over TLS.
853TCPDNS over TLSEncrypted DNS.
1812 and 1813UDPRADIUS (Remote Authentication Dial In User Service)Authentication and accounting, used by 802.1X. Encrypts only the password. Older kit uses 1645 and 1646.
1985UDPHSRP (Hot Standby Router Protocol)Gateway redundancy hellos.
3389TCPRDP (Remote Desktop Protocol)Windows remote desktop.
3784 and 3785UDPBFD (Bidirectional Forwarding Detection)Fast failure detection.
4500UDPIPsec NAT traversalEncapsulating Security Payload (ESP) wrapped in UDP to cross NAT.
4789UDPVXLAN (Virtual Extensible LAN)Data centre overlay.
4791UDPRoCEv2 (RDMA over Converged Ethernet version 2)Remote direct memory access (RDMA) between servers, used by artificial intelligence (AI) and storage fabrics.
5060 and 5061TCP and UDPSIP (Session Initiation Protocol)Voice call set up, 5061 with TLS.
6081UDPGeneve (Generic Network Virtualisation Encapsulation)VMware NSX overlay.

Some protocols are not carried by TCP or UDP at all. They have their own IP protocol number instead, which is what a firewall rule or access list has to permit.

IP protocol numberProtocol
1ICMP
6TCP
17UDP
47GRE (Generic Routing Encapsulation)
50ESP (IPsec Encapsulating Security Payload)
51AH (IPsec Authentication Header)
58ICMPv6
88EIGRP
89OSPF
112VRRP (Virtual Router Redundancy Protocol)
ICMP

Ping, traceroute and the messages behind them

The Internet Control Message Protocol (ICMP) is how the network reports problems. It is also behind the two tools I use first on almost every fault. Blocking all of it causes more trouble than it prevents.

How traceroute uses the TTL to find each hop A laptop runs traceroute to a server three routers away. Probes with a TTL of 1, then 2, then 3 expire at each router in turn, and each router replies with ICMP time exceeded. The third router does not reply, so the output shows stars. The final probe reaches the server, which replies port unreachable. Ping uses echo request and echo reply. My laptop10.1.10.20 Router 110.1.10.1 Router 210.0.12.2 Router 3limits ICMP Server198.51.100.80 no reply traceroute 198.51.100.80 1 10.1.10.1 1.2 ms 2 10.0.12.2 4.8 ms 3 * * * 4 198.51.100.80 11.6 ms Probe 1 has a TTL of 1. Router 1 lowers itto 0, drops it and sends back ICMP timeexceeded (type 11), which reveals its address. Probe 2 has a TTL of 2, so it expires atRouter 2. Each hop is found the same way,usually with three probes per hop. Router 3 limits how many ICMP replies itsends. Later hops still answer, so thesestars are not packet loss. The probe reaches the server. Linux and IOSprobe UDP ports from 33434, so the reply isport unreachable (type 3, code 3). Ping sends echo requests (type 8) andwaits for echo replies (type 0). Windowstracert uses echo requests too. ping: !!!!! Success rate 100%

Swipe sideways to see the whole diagram.

Step 1
  1. Traceroute sends its first probes with a time to live of 1. The first router lowers it to zero, discards the probe and replies with ICMP time exceeded.

  2. The next probes have a TTL of 2, so they expire one hop further on. Increasing the TTL by one each time maps the path hop by hop.

  3. Some routers rate limit ICMP or do not send it at all. If later hops still answer, stars on one hop do not mean traffic is lost there.

  4. When a probe finally reaches the server, the TTL has not run out. Linux and IOS traceroute use UDP to high ports, so the server replies port unreachable. Windows tracert uses ICMP echo instead.

  5. Ping is simpler: an echo request and an echo reply, with the round trip time. On Cisco IOS an exclamation mark means a reply and a full stop means a timeout.

ICMP messages worth knowing

Type and codeMeaningWhere I see it
0Echo replyA successful ping.
3, code 0Network unreachableNo route to the destination network.
3, code 1Host unreachableThe last router could not reach the host, often because ARP failed.
3, code 3Port unreachableNothing listening on that UDP port. The normal end of a Linux traceroute.
3, code 4Fragmentation needed and the don’t fragment (DF) bit setPath MTU discovery. It carries the MTU of the next hop. Never block it.
3, code 13Administratively prohibitedAn access list or firewall rejected the packet.
5RedirectA router telling a host about a better next hop on the same subnet.
8Echo requestPing.
11, code 0Time exceeded in transitTraceroute, or a routing loop when it appears on its own.

Cisco IOS ping symbols

SymbolMeaning
!Echo reply received
.Timed out waiting for a reply
UDestination unreachable received
MCould not fragment: the packet was too big with DF set
QSource quench (destination too busy)
?Unknown packet type
&Packet lifetime exceeded

An extended ping on IOS lets me set the source interface, the size and the DF bit, which proves both the return route and the path MTU in one test. IPv6 relies on ICMPv6 even more, for neighbour discovery and for its packet too big messages.

NAT

Translating addresses at the edge

Network address translation (NAT) lets thousands of hosts with private addresses share a few public ones. It also causes some of the strangest faults I see, because it changes the very fields people rely on when they trace a flow.

Port address translation, static NAT and the return path Three inside PCs share one public address through a NAT router, each told apart by a translated source port in the translation table. In static NAT an inside web server is published on its own public address. On the return path, a reply is matched against the table and translated back to the right inside host. Inside Outside PC 110.1.10.20PC 310.1.10.22 PC 210.1.10.21 Web server10.1.20.80 NAT routerout: 203.0.113.10NAT routerpublishes .20NAT routerout: 203.0.113.10 Web server198.51.100.80Internet user198.51.100.9Web server198.51.100.80 Inside local Inside global Outside 10.1.10.20:51000203.0.113.10:1024198.51.100.80:44310.1.10.21:51544203.0.113.10:1025198.51.100.80:44310.1.10.22:49200203.0.113.10:1026198.51.100.80:443 10.1.20.80203.0.113.20any addressA fixed entry, always in the table, so it works in both directions. One public address, told apart by port One to one: reachable from outside Reply matches entry 2: translated back

Swipe sideways to see the whole diagram.

Port address translation (PAT), or NAT overload. Many inside hosts share one public address. The router gives each flow its own source port on the public address, and remembers every mapping in its translation table.

Static NAT. A permanent one to one mapping publishes an inside server on a public address. Because the entry always exists, connections can start from the outside.

The return path. A reply arrives for 203.0.113.10 port 1025. The router finds the matching entry, rewrites the destination back to 10.1.10.21 port 51544, then routes it inside. Without that entry, the reply is dropped.

Animation

The four NAT terms on Cisco IOS

TermMeaningIn the example
Inside localThe inside host’s real, private address10.1.10.21
Inside globalHow the inside host appears to the outside203.0.113.10
Outside globalThe outside host’s real address198.51.100.80
Outside localHow the outside host appears to the inside. Usually the same as outside global198.51.100.80

Order matters

On IOS, traffic going from inside to outside is routed first, then translated. Traffic coming in is translated first, then routed. Most firewalls have their own order, which changes how rules are written.

Configuration and common faults

The minimum PAT configuration is ip nat inside and ip nat outside on the interfaces, plus ip nat inside source list 10 interface Gi0/1 overload. Faults come from a missing interface command, an access list that does not match, no route back to the inside global address, or PAT running out of ports. I check with show ip nat translations and show ip nat statistics.

NAT is not a firewall

NAT hides addresses, but it is not a security control. It also breaks protocols that carry addresses inside their payload, such as FTP and SIP, unless an application layer gateway fixes them.

MTU

When big packets quietly disappear

The maximum transmission unit (MTU) is the largest packet a link carries without fragmenting it. Standard Ethernet allows 1,500 bytes. Every tunnel and overlay adds headers, and when nobody plans for that, the result is one of the most confusing faults in networking.

Path MTU discovery, an MTU black hole and the MSS clamp fix A sender, a firewall, a tunnel router with a 1,400 byte tunnel and a receiver. A 1,500 byte packet with DF set is dropped at the tunnel and an ICMP fragmentation needed message tells the sender to use 1,400. When the firewall blocks that ICMP, large packets disappear. Clamping the TCP MSS at the tunnel router fixes it. tunnel SenderMTU 1500 FirewallMTU 1500 Tunnel routertunnel MTU 1400 Receiverany MTU Too big for 1,400: dropped ICMP 3/4: use MTU 1400 Path MTU learned: 1,400 bytes ICMP blocked here Small packets work, big ones vanish SYN rewritten: MSS 1460 becomes 1360 A full size 1,500 byte packet with the don’t fragment (DF) bit set reaches the tunnel.The tunnel can only carry 1,400 bytes, so the router drops it and sends back ICMP type 3, code 4. The sender lowers its packet size for this destination to 1,400 bytes and sends again.Everything now fits. This is path MTU discovery working as designed. Here the firewall blocks ICMP, so the sender never hears why its packets vanish.Pings and the TCP handshake work, but large transfers hang. This is an MTU black hole. The fix I use most: the tunnel router clamps the TCP MSS in every SYN to 1,360 bytes.Segments then fit inside the tunnel, whatever happens to ICMP on the way.

Swipe sideways to see the whole diagram.

Step 1
  1. The sender sets the DF bit and sends a full size packet. A router whose next link is smaller must drop it and report the size that would fit.

  2. The sender remembers the smaller size for that destination and resends. Nothing is fragmented, and the transfer carries on.

  3. If a firewall or access list blocks that ICMP message, the sender keeps sending packets that are too big. Small packets work, so the fault looks like a slow or broken application.

  4. Lowering the TCP maximum segment size (MSS) at the tunnel edge avoids the problem for TCP. Allowing ICMP type 3, code 4 through firewalls fixes it for everything else.

MTU and MSS calculator

Pick the link MTU and every header the packet gains on the way. The calculator shows what is left for the inner packet and the MSS to clamp to.

Encapsulation on the path
Largest inner IP packet
1,500 bytes
TCP MSS to clamp to (IPv4)
1,460 bytes
TCP MSS for IPv6
1,440 bytes
Largest ping that should pass with DF set
1,472 bytes of data

Overheads are typical figures for IPv4 outer headers. The IPsec figure is the worst case for the Advanced Encryption Standard (AES) in cipher block chaining mode with Secure Hash Algorithm 1 (SHA 1) integrity. IPsec overhead varies with the cipher and padding, so I leave a margin: on tunnels I usually set ip mtu 1400 and ip tcp adjust-mss 1360.

How I prove the path MTU

PlatformCommandWhat it tests
Cisco IOSping 198.51.100.80 size 1500 df-bitA full 1,500 byte packet that must not fragment
Windowsping -f -l 1472 198.51.100.801,472 bytes of data plus 28 bytes of headers is 1,500
Linuxping -M do -s 1472 198.51.100.80The same test, with fragmentation forbidden
VMware ESXivmkping ++netstack=vxlan -d -s 1572 <peer>The overlay path between hosts, for NSX

MSS is the TCP view of MTU

The MSS is the MTU minus 40 bytes of IPv4 and TCP headers, so 1,460 on a 1,500 byte link. Each side announces its MSS in the SYN, which is why clamping it there works so well.

When DF is clear

If the DF bit is clear, an IPv4 router splits a packet that is too big into fragments. Each fragment carries the same ID, an offset and a more fragments (MF) flag. Only the destination puts them back together. Lose one fragment and the whole packet is lost, so I design to avoid fragmentation, not to rely on it.

IPv6 never fragments in transit

Only the sender may fragment an IPv6 packet, and every IPv6 link must carry at least 1,280 bytes. ICMPv6 packet too big messages must always be allowed through.

Jumbo frames in the data centre

I run data centre switches at 9,216 bytes and hosts at 9,000, so a VXLAN or Geneve overlay fits with room to spare. Where traffic leaves the fabric at 1,500, I clamp the MSS at the border.

Web page

Opening a web page, end to end

This brings everything on this page together. When someone tells me a website is slow or broken, these are the steps I check, in this order.

What happens when I open a web page A laptop opens https://www.example.com. It already has DHCP settings, asks the DNS resolver for the address and uses ARP to find its gateway. It completes a TCP handshake through a firewall that applies NAT, sets up TLS and checks the certificate, then sends an HTTP GET and receives the page. internet Laptop10.1.10.20 DNS resolver10.9.0.53 Firewall, NATout: 203.0.113.10 www.example.com198.51.100.80 Address, gateway, DNS A record: 198.51.100.80 ARP: gateway MAC Session created, source NAT to .10 Certificate for the name checked GET / → 200 OK Proof at every step: see the table DHCP has already given the laptop its address, mask, gateway and DNS server.The browser checks its own cache, then the operating system’s, before asking anyone. A DNS query on UDP port 53 asks for www.example.com. The resolver returns 198.51.100.80,often alongside an AAAA record for IPv6. The server is on another network, so the laptop needs the gateway’s MAC.If it is not in the ARP cache, one broadcast and one reply fix that. TCP SYN from port 52100 to 198.51.100.80 port 443. The firewall checks its policy, builds asession and translates the source to 203.0.113.10. The handshake completes. TLS starts: the ClientHello names the site (SNI). The server sends its certificate chain, and thelaptop checks the name, the dates and the chain. Keys are agreed in one round trip on TLS 1.3. The browser sends GET / with the Host header and gets 200 OK. The page then pulls in moreobjects. HTTP/2 reuses one connection, and HTTP/3 runs over QUIC on UDP port 443. Every step leaves evidence I can check. When a user says the site is slow,I walk this list in order until one step does not match what I expect.

Swipe sideways to see the whole diagram.

Step 1
  1. Before anything crosses the network, the laptop needs an address and a resolver, usually from DHCP, and the browser checks whether it already knows the answer.

  2. The name is turned into an address. If this step fails, users report that the site is down, even though the network may be perfect.

  3. An address outside the laptop’s subnet means the first hop is the default gateway, found with ARP. A wrong gateway or mask breaks everything from here on.

  4. The three way handshake crosses the firewall, which checks its rules, creates a session and applies NAT. A drop here shows as a SYN with no answer.

  5. The encrypted session is set up and the server proves who it is with a certificate. The ClientHello names the site with Server Name Indication (SNI), so one address can serve many sites. An expired certificate or a missing intermediate stops the page here, with a browser warning.

  6. The request and response finally flow. One page can trigger dozens more lookups and connections for scripts, images and fonts.

  7. I can prove or rule out every step with a command or a log, which turns a vague complaint into a short, ordered check list.

How I prove each step

StepWhat I proveCommand or evidence
SettingsAddress, mask, gateway and DNS server are rightipconfig /all, ip addr, the DHCP binding
Name lookupThe name resolves to the expected addressnslookup www.example.com, dig www.example.com
GatewayThe laptop has the gateway’s MAC, and the gateway is uparp -a, show ip arp, show standby brief
PathThere is a route there and backtraceroute, show ip route 198.51.100.80
Firewall and NATThe rule allows it and a session existspacket-tracer on a Cisco Adaptive Security Appliance (ASA), session table, show ip nat translations
TCP and MTUThe handshake completes and full size packets passA packet capture, a ping with DF set at full size
TLSThe certificate is valid for the nameopenssl s_client -connect www.example.com:443 -servername www.example.com
HTTPThe server answers quickly and correctlyBrowser developer tools, curl -v https://www.example.com, proxy and server logs

My full method, with worked faults, is on the troubleshooting page.

Delivery

One, all, some or the nearest

A packet can be meant for one host, every host, a group of hosts or the nearest of several identical hosts. Each type behaves differently on a switch and a router, and each one fails in its own way.

Unicast, broadcast, multicast and anycast One sender and four receivers. Unicast reaches one host. Broadcast reaches every host in the VLAN but is stopped by the router before VLAN 20. Multicast reaches only the hosts that joined group 239.1.1.10. Anycast reaches the nearest of two DNS servers that share the address 192.0.2.53. Sender10.1.10.20 Networkswitch and routerNetworkVLAN 10NetworkIGMP snoopingNetworkrouting Host AHost AVLAN 10Host Ajoined 239.1.1.10DNS, London192.0.2.53 Host Bthe targetHost BVLAN 10Host Bnot joinedHost B Host CHost CVLAN 10Host Cjoined 239.1.1.10Host C Host DHost DVLAN 20Host Dnot joinedDNS, Frankfurt192.0.2.53 One sender, one receiver Every host in the VLAN. A router stops it Only hosts that joined the group Same address in two places: the nearest wins

Swipe sideways to see the whole diagram.

Unicast. One sender, one receiver. Almost all traffic is unicast.

Broadcast. Every host in the broadcast domain receives it, needed or not. ARP and DHCP rely on it. Routers do not forward it, and IPv6 has no broadcast at all.

Multicast. One stream to a group address in 224.0.0.0/4. Hosts join with IGMP, switches use IGMP snooping to send it only where it was asked for, and routers use Protocol Independent Multicast (PIM) to carry it between subnets. Video, market data and routing protocols use it.

Anycast. The same address is announced from more than one place, and routing delivers each packet to the nearest copy. DNS resolvers, root servers and content delivery networks rely on it.

Animation
Time

Every device agreeing on the time

Logs, logins, certificates and some regulations all depend on accurate time. Two protocols deliver it: NTP for most devices, and the Precision Time Protocol (PTP) where microseconds matter.

NTP strata, PTP clocks and why time matters A time hierarchy. In NTP a stratum 0 reference feeds stratum 1 servers, which feed stratum 2 core switches, which feed clients. In PTP a GNSS reference feeds a grandmaster, which feeds boundary clocks in switches, which feed ordinary clocks in hosts. A third view lists why accurate time matters. Stratum 0GNSS or atomicGNSSreference Stratum 1time serverGrandmasterIEEE 1588 Stratum 2core switchBoundary clockPTP aware switch Stratum 1time serverGrandmasterstandby Stratum 2core switchBoundary clockPTP aware switch Clientservers and PCsOrdinary clockhardware stamps Clientservers and PCsOrdinary clockhardware stamps Clientservers and PCsOrdinary clockhardware stamps Logs from every device line up Kerberos fails beyond 5 minutes of skew Certificates check their validity dates MiFID II: high frequency trading within 100 µs of UTC What depends on accurate time

Swipe sideways to see the whole diagram.

NTP. The Network Time Protocol runs on UDP port 123 and keeps clocks within milliseconds. Each step away from the reference adds one to the stratum. I give every device at least four sources, so one bad clock can be outvoted even when another is unreachable, and I authenticate them with keys or NTS (Network Time Security).

PTP. The Precision Time Protocol (IEEE 1588) reaches sub microsecond accuracy with hardware timestamps. A grandmaster, usually fed by a Global Navigation Satellite System (GNSS) receiver, serves boundary clocks in PTP aware switches, which serve the hosts. Every hop must support it, and asymmetric paths ruin the accuracy.

Why time matters. Without good time, logs cannot be lined up during an incident, Kerberos logins fail and certificates look invalid. Regulated trading systems also break rules that tie their clocks to Coordinated Universal Time (UTC), such as the European Markets in Financial Instruments Directive (MiFID II). Satellite signals can be jammed or spoofed, so critical sites add a terrestrial source and a good holdover clock.

Animation
Projects

Where I use the basics

These are the places where I have relied on this material most.

Home lab

A network I can break on purpose

My three site lab runs MPLS, Dynamic Multipoint VPN (DMVPN), a route out to the real internet, and Windows DNS and DHCP. I use it to rehearse packet walks, captures and faults before I meet them on a live network. See the topology.

Passport Telecom · 2004 to 2007

Where it started

Cisco based telecoms infrastructure for over 4,000 clients across East Africa and South America, hands on from the first day of my career.

JJ Food Wholesale · 2007 to 2011

Running a whole group network

Local and wide area networks (LAN and WAN), voice over IP (VoIP), virtualisation and security across the group, including warehouse, cold chain and temperature monitoring systems at the food depots.

BNY Mellon · 2018 to 2019

A regulated refresh with no outages

The Europe, Middle East and Africa (EMEA) network refresh: audit, high and low level design, and implementation across LAN, WAN, software defined WAN (SD-WAN) and data centre, replacing end of life equipment with no service outages.

Backed by CCNP Enterprise, CCNP Routing and Switching and CCNA, and the CCIE Routing and Switching written exam. See all credentials