Home/Tracks/Networking

Networking

How data moves: models and layers, addressing and subnetting, VLANs and VPNs, the services every network depends on, and a repeatable way to troubleshoot.

 lessons  documents  infographics Subnet calculator

OSI & TCP/IP models

Models split networking into layers so each layer has one job. The OSI model (7 layers) is used for teaching and troubleshooting; the TCP/IP model (4 layers) is what the internet actually runs on.

L7ApplicationHTTP, HTTPS, DNS, SMTP, SSH, FTP
L6PresentationEncoding, compression, encryption (TLS)
L5SessionOpens, maintains and closes sessions
L4TransportTCP / UDP · ports · Segment
L3NetworkIP, ICMP, routing · routers · Packet
L2Data LinkMAC, ARP, VLAN, STP · switches · Frame
L1PhysicalCables, fibre, radio · Bits

TCP/IP mapping: Application (L5–7) · Transport (L4) · Internet (L3) · Network Interface (L1–2). Mnemonic for OSI bottom-up: Please Do Not Throw Sausage Pizza Away.

TCP vs UDP

TCPUDP
ConnectionConnection-oriented (3-way handshake: SYN → SYN-ACK → ACK)Connectionless
ReliabilityOrdered, acknowledged, retransmitsBest effort, no guarantees
Used byHTTP/S, SSH, SMTP, RDPDNS queries, DHCP, VoIP, streaming, SNMP

Ports to know by heart

PortServicePortService
20/21FTP389 / 636LDAP / LDAPS
22SSH / SFTP443HTTPS
23Telnet (avoid)445SMB
25SMTP500 / 4500IPsec IKE / NAT-T
53DNS3389RDP
67/68DHCP161/162SNMP
80HTTP88Kerberos
Visual:

Network types: PAN to WAN

Networks are classified by how far they reach.

PAN · <10 mPersonal Area Network. Bluetooth, NFC, USB devices around one person.
LAN · 10 m–1 kmLocal Area Network. An office or building: PCs, printers, file servers, Wi-Fi.
MAN · <10 km+Metropolitan Area Network. Connects several LANs across a town or city.
WAN · 100–1000+ kmWide Area Network. Connects sites across countries. The internet is the largest WAN.
Visual:

IPv4 addressing & subnetting

An IPv4 address is 32 bits written as four octets (192.168.10.37). The prefix length (/24) says how many bits belong to the network; the rest identify hosts.

Private ranges (RFC 1918)10.0.0.0/8 · 172.16.0.0/12 · 192.168.0.0/16
Special127.0.0.0/8 loopback · 169.254.0.0/16 APIPA (no DHCP reply)

Quick subnet table

PrefixMaskAddressesUsable hosts
/24255.255.255.0256254
/25255.255.255.128128126
/26255.255.255.1926462
/27255.255.255.2243230
/28255.255.255.2401614
/29255.255.255.24886
/30255.255.255.25242 (point-to-point links)

Formula: usable hosts = 2(32 − prefix) − 2. The first address is the network ID, the last is broadcast.

Subnet calculator

VLANs & trunking

A VLAN splits one physical switch into separate logical networks (broadcast domains). It improves security and reduces broadcast traffic. Devices in different VLANs need a router or Layer-3 switch to talk to each other.

Access portCarries one VLAN. Used for end devices (PCs, printers).
Trunk portCarries many VLANs between switches using 802.1Q tags.
Native VLANUntagged traffic on a trunk (VLAN 1 by default). Change it and don't use it for users.
Voice VLANSeparate VLAN for IP phones, prioritised with QoS.
Management VLANOnly for managing switches (SSH, SNMP). Keep it isolated.
Private VLANIsolates ports inside one VLAN, common in data centres.

Cisco example

! Create VLANs
vlan 10
 name USERS
vlan 20
 name SERVERS

! Access port for a PC
interface GigabitEthernet0/5
 switchport mode access
 switchport access vlan 10
 spanning-tree portfast

! Trunk to another switch / firewall
interface GigabitEthernet0/24
 switchport mode trunk
 switchport trunk allowed vlan 10,20,99
 switchport trunk native vlan 99

! Verify
show vlan brief
show interfaces trunk

Two VLANs can't talk? Check IP/subnet → port VLAN assignment → trunk allowed VLANs → default gateway → inter-VLAN routing → firewall/ACL rules → logs.

Visual: · VLAN Deep Dive (PDF)

VPN types

A VPN creates an encrypted tunnel over an untrusted network such as the internet.

TypeWhat it doesTypical use
Site-to-sitePermanently links two networksBranch office ↔ headquarters (IPsec)
Remote accessConnects one user to a private networkWork from home
IPsecEncrypts IP traffic at Layer 3 (IKE on UDP 500/4500)Site-to-site tunnels, firewalls
SSL / TLSRuns over HTTPS (443), works through most firewallsRemote users, browser portals
Client-basedNeeds an installed client (e.g. Sophos Connect, AnyConnect)Managed corporate laptops
Cloud VPNConnects on-prem networks to a cloud VPCHybrid cloud
Visual: · Site-to-site VPN notes (ODT)

DHCP & DNS

DHCP — automatic IP configuration

Discover→Offer→Request→Acknowledge

The client broadcasts a Discover, the server Offers an address, the client Requests it and the server Acknowledges. Across VLANs you need a DHCP relay (ip helper-address).

DNS — names to IP addresses

RecordPurpose
A / AAAAHostname → IPv4 / IPv6
CNAMEAlias to another hostname
MXMail server for a domain
PTRReverse lookup (IP → name)
SRVLocates services, e.g. Active Directory Domain Controllers
TXTVerification, SPF, DKIM, DMARC

Troubleshooting commands

# Windows
ipconfig /all
ipconfig /release && ipconfig /renew
ipconfig /flushdns
nslookup example.com

# Linux
ip addr
dig example.com +short
resolvectl status
cat /etc/resolv.conf

Rule of thumb: if ping 8.8.8.8 works but ping google.com fails, it's DNS. An address of 169.254.x.x means DHCP failed.

Visual:

What happens when you type a URL

One simple action that touches every layer of the stack — a great way to tie everything together.

  1. DNS resolution. Browser cache → OS cache → router → ISP resolver → root → TLD (.com) → authoritative server returns the IP.
  2. TCP connection. 3-way handshake: SYN, SYN-ACK, ACK to port 443.
  3. TLS handshake. Server presents its certificate; client checks validity, CA and domain name; session keys are agreed.
  4. HTTP request. GET / with headers and cookies.
  5. Server response. Status code (1xx info, 2xx success, 3xx redirect, 4xx client error, 5xx server error) plus HTML.
  6. Rendering. HTML → DOM, CSS → CSSOM, render tree → layout → paint; JavaScript runs.
Visual:

Troubleshooting method

Work bottom-up through the layers and change one thing at a time. Always find out first whether one user or many are affected.

  1. Physical. Cable, link lights, port status (show interfaces status).
  2. IP configuration. Correct IP, mask, gateway and DNS (ipconfig /all).
  3. Gateway. ping the default gateway.
  4. External IP. ping 8.8.8.8, then tracert / traceroute to see where it stops.
  5. DNS. nslookup a known domain.
  6. Firewall. Review policies, NAT, web filtering and traffic logs.
  7. Fix & verify. Apply an approved change, confirm with the user, document the cause.
# Useful Cisco show commands
show ip interface brief
show interfaces status
show mac address-table
show ip route
show running-config
show logging
Library

Documents

PDFs open in a new tab. A tick appears on the ones you've opened.