Course 2

Bits and Bytes of Networking

TCP/IP & OSI models · IP addressing & subnetting · Ethernet · Transport layer · Application services · Troubleshooting

1  ·  TCP/IP & OSI Models

Key Concepts

  • The OSI model (Open Systems Interconnection) is a conceptual 7-layer framework for understanding how network communication works. It's a teaching tool - real protocols don't map perfectly to it.
  • The TCP/IP model (4 layers) is the practical implementation used on the internet today. It merges OSI layers 5-7 into one Application layer.
  • Encapsulation - each layer wraps data with its own header (and sometimes trailer) as it travels down the stack toward the wire.
  • Decapsulation - headers are stripped at each layer as data moves up the stack at the receiving end.
  • A PDU (Protocol Data Unit) is the name for data at each layer: bit → frame → packet → segment → data.
  • Mnemonic (top→bottom): "All People Seem To Need Data Processing" → Application, Presentation, Session, Transport, Network, Data Link, Physical.

OSI Model - 7 Layers

# Layer PDU Key Protocols / Devices Role
7 Application Data HTTP, HTTPS, FTP, DNS, SMTP, SSH User-facing network services
6 Presentation Data TLS/SSL, JPEG, MP3, ASCII Encoding, encryption, compression
5 Session Data NetBIOS, RPC, SIP Establish, manage & tear down sessions
4 Transport Segment / Datagram TCP, UDP - ports End-to-end delivery, flow & error control
3 Network Packet IP, ICMP, ARP* - Routers Logical addressing & routing
2 Data Link Frame Ethernet, Wi-Fi (802.11) - Switches MAC addressing, framing, error detection
1 Physical Bit Cables, hubs, repeaters, NICs Raw bit transmission over physical media

TCP/IP Model - 4 Layers

TCP/IP LayerMaps to OSIKey Protocols
Application7, 6, 5HTTP, HTTPS, DNS, DHCP, FTP, SMTP, SSH, Telnet
Transport4TCP, UDP
Internet3IP (v4/v6), ICMP, OSPF, BGP
Link (Network Access)2, 1Ethernet, Wi-Fi, ARP, PPP

Encapsulation Flow

Application data → HTTP payload
+ TCP/UDP header = Segment
+ IP header = Packet
+ Ethernet hdr/trailer= Frame
Transmitted as Bits (0s and 1s)

Key Terms

PDUProtocol Data Unit - the name for data at each OSI layer
EncapsulationWrapping data with headers as it moves down the stack toward the wire
DecapsulationStripping headers as data moves up the stack at the destination
MTUMaximum Transmission Unit - largest frame payload allowed; 1500 bytes for standard Ethernet
PayloadThe data portion of a PDU (everything after the headers)
ProtocolA set of rules that govern communication between devices

TCP/IP Five-Layer Model (used in this course)

The Google IT cert uses a 5-layer TCP/IP model — the standard 4-layer model with the Physical layer added as its own layer. It maps directly to real hardware and protocols.

#LayerRoleExamples
5ApplicationUser-facing servicesHTTP, DNS, SMTP, SSH
4TransportEnd-to-end delivery, portsTCP, UDP
3NetworkLogical addressing & routingIP, ICMP, ARP
2Data LinkMAC addressing & framingEthernet, Wi-Fi (802.11)
1PhysicalRaw bit transmission over a mediumCables, hubs, NICs, repeaters
The 5-layer model = the 4-layer TCP/IP model with Physical split out from the Link layer. Know all three (OSI 7, TCP/IP 4, TCP/IP 5) but use this 5-layer version for this cert.

Physical Layer - Cables & Hardware

Twisted pairMost common LAN cabling. Wire pairs twisted to reduce crosstalk. Cat5e: 1 Gbps · Cat6: 10 Gbps short runs · Cat6a: 10 Gbps up to 100m.
Fiber opticTransmits light pulses — immune to EMI, supports long distances. Single-mode: one light path, long distance (WAN links). Multi-mode: multiple paths, shorter distance (buildings/data centers).
CoaxialCenter copper conductor surrounded by shielding. Legacy for LAN; still used in cable internet (DOCSIS standard).
Straight-throughStandard patch cable — same pin order on both ends. Connects unlike devices (PC → switch, switch → router).
CrossoverTx and Rx pairs swapped — connects like devices (PC → PC, switch → switch). Modern switches use Auto-MDIX to detect this automatically, so crossover cables are rarely needed today.
Half duplexOne direction at a time — like a walkie-talkie. Used with hubs; CSMA/CD handles collisions.
Full duplexSimultaneous send and receive. Used with switches — no collisions possible per port.
Patch panelPassive termination board in a rack. Wall jacks run to it; short patch cables connect to the switch. Keeps structured cabling organized and easy to reconfigure.

Common Cabling Tools

Crimping toolAttaches RJ-45 connectors to the ends of twisted-pair cable
Cable testerVerifies pin-to-pin continuity — catches miswiring, opens, and shorts
Punch-down toolSeats wires into patch panel or keystone jack (wall plate) terminals
Cable stripperRemoves the outer jacket without nicking the inner conductors
  1. At which OSI layer does a switch operate?
  2. What is the PDU at the Network layer called?
  3. Which TCP/IP layer combines OSI layers 5, 6, and 7?
  4. What does the Transport layer add to data during encapsulation?
  5. Which OSI layer handles encryption and data formatting (e.g., JPEG, TLS)?
  6. Name two differences between the OSI model and the TCP/IP model.
  1. Layer 2 - Data Link (switches use MAC addresses to forward frames)
  2. Packet
  3. The Application layer
  4. A TCP or UDP header (creating a segment or datagram), which adds source/destination port numbers and sequencing info
  5. Layer 6 - Presentation
  6. OSI has 7 layers; TCP/IP has 4. OSI is conceptual/academic; TCP/IP is the working model used on the real internet. OSI separates Session/Presentation/Application; TCP/IP merges them.

2  ·  Network Layer & IP Addressing

IPv4 Basics

  • 32-bit address written as four octets in dotted-decimal notation (e.g., 192.168.1.100).
  • Each octet ranges from 0–255.
  • Two portions: network part (identifies the subnet) + host part (identifies the device).
  • The subnet mask determines where the network/host boundary falls. Written as dotted-decimal (e.g., 255.255.255.0) or CIDR prefix (/24 = 24 network bits).
  • The logical AND of an IP and its mask gives the network address.

Address Classes (classful - historical context)

ClassFirst Octet RangeDefault MaskNotes
A1 – 126/8 (255.0.0.0)Large networks; 126 networks × ~16M hosts
B128 – 191/16 (255.255.0.0)Medium networks; 16,384 networks × 65,534 hosts
C192 – 223/24 (255.255.255.0)Small networks; 2M networks × 254 hosts
D224 – 239-Multicast only
E240 – 255-Experimental / reserved
Today we use CIDR (Classless Inter-Domain Routing) - subnet masks aren't tied to class boundaries. This dramatically slowed IPv4 exhaustion.

Special / Private Ranges

RangeCIDRPurpose
10.0.0.0 – 10.255.255.255/8Private (RFC 1918)
172.16.0.0 – 172.31.255.255/12Private (RFC 1918)
192.168.0.0 – 192.168.255.255/16Private (RFC 1918)
127.0.0.0 – 127.255.255.255/8Loopback - 127.0.0.1 = localhost
169.254.0.0 – 169.254.255.255/16APIPA - self-assigned when DHCP fails
0.0.0.0-Unspecified / default route
255.255.255.255-Limited broadcast

Subnetting Math

Host bits = 32 – prefix length
Total addresses = 2 ^ (host bits)
Usable hosts = 2 ^ (host bits) – 2
Network address = all host bits = 0 (first address)
Broadcast address= all host bits = 1 (last address)
First usable host= network address + 1
Last usable host = broadcast address – 1

Worked Example - 192.168.1.0 /26

Prefix /26 → subnet mask 255.255.255.192
Host bits 32 – 26 = 6
Total addresses2⁶ = 64
Usable hosts 64 – 2 = 62
Network address192.168.1.0
Broadcast 192.168.1.63
First host 192.168.1.1
Last host 192.168.1.62

Common CIDR Prefix Reference

PrefixSubnet MaskAddressesUsable Hosts
/8255.0.0.016,777,21616,777,214
/16255.255.0.065,53665,534
/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
/32255.255.255.25511 (host route)

IPv6 Basics

  • 128-bit address - written as 8 groups of 4 hex digits separated by colons.
  • Leading zeros within a group can be omitted; consecutive all-zero groups can be replaced with :: (once per address).
  • ::1 - loopback (equivalent to IPv4 127.0.0.1)
  • fe80::/10 - link-local (auto-configured, not routable)
  • 2000::/3 - global unicast (public routable range)
  • No broadcast - replaced by multicast and anycast.
  • IPv6 uses NDP (Neighbor Discovery Protocol) instead of ARP.

IPv6 Address Compression - Rules

Rule 1 Drop leading zeros within each group - 0db8db8  ·  00011  ·  00000
Rule 2 Replace the longest consecutive run of all-zero groups with :: - only once per address
Tiebreaker When two runs are equal length, :: goes to the leftmost run

Worked Examples

Full AddressStep 1 - strip leading zerosStep 2 - apply ::
2001:0db8:0000:0000:0000:0000:0000:0001 2001:db8:0:0:0:0:0:1 2001:db8::1
0000:0000:0000:0000:0000:0000:0000:0001 0:0:0:0:0:0:0:1 ::1
fe80:0000:0000:0000:0200:f8ff:fe21:67cf fe80:0:0:0:200:f8ff:fe21:67cf fe80::200:f8ff:fe21:67cf
2001:0db8:0000:0000:0001:0000:0000:0001 2001:db8:0:0:1:0:0:1 2001:db8::1:0:0:1  (tie at pos 2 & 5 → leftmost wins)

IPv6 Compression Practice

0 / 8
Has leading zeros
All-zero group

Routing Concepts

  • Default gateway - the router IP your device sends traffic to when the destination is outside the local subnet.
  • Routing table - an ordered list of network prefixes and their next-hop addresses. Routers consult this for every packet.
  • TTL (Time To Live) - decremented by each router. Packet is dropped at 0 to prevent routing loops. Starting value is typically 64 (Linux/Mac) or 128 (Windows).
  • Static routes - manually configured; predictable but don't auto-adjust to failures.
  • Dynamic routing - protocols like OSPF (interior), BGP (exterior), and EIGRP automatically discover routes and adapt to changes.

IPv4 Datagram Header - Key Fields

FieldSizeNotes
Version4 bitsAlways 4 for IPv4
IHL (Header Length)4 bitsLength in 32-bit words; minimum = 5 (= 20 bytes)
Total Length16 bitsEntire datagram size (header + data); max 65,535 bytes
TTL8 bitsDecremented at each router hop; packet dropped at 0
Protocol8 bitsUpper-layer protocol: 1=ICMP · 6=TCP · 17=UDP
Header Checksum16 bitsError detection for the header only (not payload)
Source IP32 bitsSender's IP address
Destination IP32 bitsRecipient's IP address
Flags & Fragment Offset3+13 bitsControls fragmentation when a packet must be split to fit an MTU

Routing - IGPs, EGPs & Autonomous Systems

Autonomous SystemA collection of IP networks under a single organization's routing policy. Each AS is assigned an ASN (Autonomous System Number) by IANA or a regional registry (ARIN, RIPE, APNIC).
IGPInterior Gateway Protocol — routes traffic within an AS. Examples: OSPF (link-state, most common), RIP (distance-vector, legacy), EIGRP (Cisco proprietary).
EGPExterior Gateway Protocol — routes traffic between autonomous systems. BGP is the only EGP in use today — it's what holds the internet together.
IANAInternet Assigned Numbers Authority — manages global IP address allocation, AS numbers, port/protocol registries, and TLD root zones. Delegates regional IP allocation to RIRs.
  1. What is the subnet mask for a /26 prefix?
  2. How many usable hosts does a /28 network provide?
  3. What is the network address for host 10.0.1.100 on a /27 network?
  4. A host shows the address 169.254.1.50. What does this indicate?
  5. You need to subnet a /24 into blocks of exactly 30 usable hosts. What prefix length do you use?
  6. What is the broadcast address of 192.168.10.64/26?
  1. 255.255.255.192
  2. 14 (2⁴ – 2 = 14)
  3. /27 block size = 32. 100 ÷ 32 = 3 remainder 4 → block starts at 96. Network address: 10.0.1.96
  4. DHCP failed or no DHCP server was reachable. The host auto-assigned an APIPA address (169.254.0.0/16).
  5. /27 (2⁵ – 2 = 30 usable hosts)
  6. Block starts at .64, size = 64 addresses. Broadcast = .64 + 63 = 192.168.10.127

3  ·  Data Link Layer & Ethernet

MAC Addresses

  • 48-bit (6-byte) address burned into the NIC by the manufacturer. Written in hex - e.g., AA:BB:CC:DD:EE:FF.
  • First 3 bytes = OUI (Organizationally Unique Identifier) - identifies the manufacturer.
  • Last 3 bytes = device-unique identifier assigned by the manufacturer.
  • Broadcast MAC: FF:FF:FF:FF:FF:FF - received by every device on the segment.
  • MACs operate only within a single network segment (they're not routed).
  • Can be spoofed in software - important for security.

Ethernet Frame Structure

FieldSizePurpose
Preamble7 bytesAlternating 1/0 bits for clock synchronization
SFD (Start Frame Delimiter)1 byteMarks end of preamble, start of frame
Destination MAC6 bytesWho should receive this frame
Source MAC6 bytesWho sent this frame
EtherType / Length2 bytes0x0800=IPv4 · 0x0806=ARP · 0x86DD=IPv6
Payload (data)46–1500 bytesIP packet or other upper-layer data
FCS (Frame Check Sequence)4 bytesCRC checksum for error detection
The minimum Ethernet frame payload is 46 bytes. If data is smaller, padding is added. Maximum payload = MTU = 1500 bytes.

ARP - Address Resolution Protocol

  • Resolves IP addresses to MAC addresses on the local network (Layer 3 → Layer 2).
  • ARP Request: broadcast to FF:FF:FF:FF:FF:FF asking "Who has 192.168.1.1?"
  • ARP Reply: unicast response "I have 192.168.1.1 - my MAC is AA:BB:CC:DD:EE:FF"
  • Mappings are stored in the ARP cache (view with arp -a) to avoid repeated lookups.
  • Gratuitous ARP: a device broadcasts its own IP→MAC mapping. Used in failover/HA and (maliciously) for ARP spoofing.

Switches vs Hubs

Hub (Layer 1)Broadcasts all traffic to all ports. Every device shares one collision domain. No intelligence - just a repeater.
Switch (Layer 2)Learns MAC addresses and builds a MAC address table. Forwards frames only to the relevant port. Each port = its own collision domain.
Collision domainSegment where only one device can transmit at a time. Switches isolate collision domains per port.
Broadcast domainAll devices that receive a broadcast frame. A switch creates one broadcast domain (unless VLANs are used).
CSMA/CDCarrier Sense Multiple Access / Collision Detection - half-duplex Ethernet mechanism to detect and handle collisions (hubs/legacy). Modern switches are full-duplex and don't use it.

VLANs

  • Virtual LANs logically segment a switch into separate broadcast domains without needing separate physical hardware.
  • IEEE 802.1Q - standard for VLAN tagging; inserts a 4-byte tag into the Ethernet frame.
  • Access port: carries traffic for a single VLAN; used for end devices.
  • Trunk port: carries traffic for multiple VLANs between switches or switch-to-router; tags identify the VLAN.
  • Native VLAN: traffic on a trunk port that arrives untagged is assigned to the native VLAN (default VLAN 1).

Unicast, Multicast & Broadcast

UnicastOne sender → one specific receiver. Standard for most traffic (web requests, SSH sessions). Uses a specific destination MAC and IP address.
MulticastOne sender → a specific group of receivers that have opted in. Multicast MAC range: 01:00:5E:xx:xx:xx. Used for streaming and routing protocol updates (e.g., OSPF uses 224.0.0.5).
BroadcastOne sender → all devices on the local segment. Destination MAC is FF:FF:FF:FF:FF:FF. Used by ARP requests and DHCP discovery. Does not cross routers.
  1. What protocol maps an IP address to a MAC address?
  2. How many bytes is a MAC address, and how is it written?
  3. What is the broadcast MAC address?
  4. What is the maximum payload size of an Ethernet frame, and what is this called?
  5. What does the OUI in a MAC address tell you?
  6. How does a switch differ from a hub in terms of collision domains?
  1. ARP (Address Resolution Protocol)
  2. 6 bytes (48 bits), written as 6 pairs of hex digits separated by colons or dashes (e.g., AA:BB:CC:DD:EE:FF)
  3. FF:FF:FF:FF:FF:FF
  4. 1500 bytes - this is the MTU (Maximum Transmission Unit) for standard Ethernet
  5. The first 3 bytes (OUI) identify the device manufacturer (e.g., Intel, Cisco)
  6. Each port on a switch is its own collision domain; only one device can collide with itself. A hub has a single shared collision domain for all ports.

4  ·  Transport Layer - TCP vs UDP

TCP vs UDP

FeatureTCPUDP
ConnectionConnection-oriented (handshake)Connectionless (fire and forget)
ReliabilityGuaranteed delivery, retransmits lost segmentsNo guarantee - best effort
OrderingSequence numbers ensure in-order deliveryNo ordering
Flow controlYes - sliding windowNo
SpeedSlower (overhead)Faster (minimal overhead)
Use casesHTTP, HTTPS, SSH, FTP, email - reliability criticalDNS, DHCP, VoIP, streaming, gaming - speed critical
Header size20 bytes minimum8 bytes

TCP Three-Way Handshake

Step 1 - Client → ServerSYN (synchronize - "I want to connect")
Step 2 - Server → ClientSYN-ACK (synchronize-acknowledge - "OK, ready")
Step 3 - Client → ServerACK (acknowledge - "Connection established")
Connection teardown uses a four-way FIN exchange: FIN → ACK → FIN → ACK. Either side can initiate.

TCP Flags

SYNSynchronize - initiates a connection
ACKAcknowledge - confirms receipt of data
FINFinish - gracefully closes a connection
RSTReset - abruptly terminates a connection
PSHPush - send buffered data immediately to the application
URGUrgent - data should be prioritized

TCP Socket States

LISTENServer is waiting for incoming connections on a port
SYN_SENTClient sent SYN, waiting for SYN-ACK from the server
SYN_RECEIVEDServer received SYN and replied SYN-ACK, waiting for the final ACK
ESTABLISHEDThree-way handshake complete — connection is active and data can flow
FIN_WAITThis side sent FIN to start closing; waiting for acknowledgment from the other end
CLOSE_WAITRemote side has closed; local application needs to finish and also close
TIME_WAITConnection is closed but the socket stays open briefly to catch any delayed packets still in transit (typically 60–120 s)
CLOSEDNo active connection
Socket states are visible in netstat or ss output. A large number of CLOSE_WAIT states usually means the application isn't closing connections properly.

Port Numbers

Well-known0 – 1,023 - reserved for common system services
Registered1,024 – 49,151 - registered by applications (e.g., databases)
Dynamic/ephemeral49,152 – 65,535 - assigned temporarily to client-side connections

Common Port Numbers to Memorize

Port(s)ProtocolTransportNotes
20 / 21FTPTCP20 = data, 21 = control
22SSH / SCP / SFTPTCPSecure remote shell & file transfer
23TelnetTCPUnencrypted - avoid; use SSH instead
25SMTPTCPSending email between mail servers
53DNSTCP+UDPUDP for queries; TCP for zone transfers and large responses
67 / 68DHCPUDP67 = server, 68 = client
80HTTPTCPUnencrypted web traffic
110POP3TCPReceive email (downloads to client)
123NTPUDPNetwork Time Protocol
143IMAPTCPReceive email (syncs with server)
161 / 162SNMPUDP161 = queries, 162 = traps
389LDAPTCPDirectory lookups (Active Directory)
443HTTPSTCPHTTP over TLS
445SMBTCPWindows file sharing
465 / 587SMTPS / SubmissionTCPSecure/authenticated email sending
636LDAPSTCPLDAP over TLS
993 / 995IMAPS / POP3STCPSecure email retrieval
1433MS SQL ServerTCP
3306MySQLTCP
3389RDPTCPRemote Desktop Protocol (Windows)
5432PostgreSQLTCP
5900VNCTCPRemote desktop (cross-platform)
8080 / 8443HTTP / HTTPS altTCPCommon non-privileged web service ports
  1. Walk through the TCP three-way handshake in order.
  2. What port does HTTPS use, and what does it add over HTTP?
  3. Which protocol would you use for live video streaming, and why?
  4. What port does RDP use?
  5. A firewall blocks all traffic to port 22. What functionality is lost?
  6. What are the three port number ranges and their boundaries?
  1. Client sends SYN → Server replies SYN-ACK → Client sends ACK. Connection is now established.
  2. Port 443. HTTPS = HTTP wrapped in TLS, which provides encryption, authentication (server certificate), and data integrity.
  3. UDP - because it's faster (no handshake, no retransmission) and a dropped frame is less noticeable than jitter caused by waiting for retransmits.
  4. 3389
  5. SSH access is lost, meaning secure remote shell, SCP file transfers, and SFTP would all be blocked.
  6. Well-known: 0–1023 | Registered: 1024–49151 | Dynamic/ephemeral: 49152–65535

5  ·  Application Layer Services - DNS, DHCP, NAT, HTTP

DNS - Domain Name System

  • Translates human-readable hostnames (example.com) into IP addresses. Often called "the phonebook of the internet."
  • Hierarchical structure: root (.) → TLD (.com) → authoritative nameserver → record.
  • DNS queries use UDP port 53 (most common); TCP port 53 for large responses and zone transfers.
  • TTL (Time To Live): how long a record is cached before re-querying.

DNS Record Types

TypeMaps / ReturnsExample
AHostname → IPv4 addressexample.com → 93.184.216.34
AAAAHostname → IPv6 addressexample.com → 2606:2800:220:1:248:1893:25c8:1946
CNAMEAlias → canonical namewww.example.com → example.com
MXDomain → mail server(s)example.com → mail.example.com (priority 10)
PTRIP → hostname (reverse lookup)34.216.184.93.in-addr.arpa → example.com
NSDomain → authoritative nameserver(s)example.com → ns1.example.com
SOAZone metadata - serial, refresh, retry, expireEach zone has exactly one
TXTFree-form textSPF, DKIM, domain verification

DNS Resolution Process

1. Check local cacheBrowser / OS cache
2. Check /etc/hostsLocal override file
3. Query recursive resolverISP DNS or 8.8.8.8 (Google)
4. Resolver → rootRoot returns TLD nameserver address
5. Resolver → TLDTLD returns authoritative NS address
6. Resolver → authoritative NSReturns the actual A/AAAA record
7. Resolver caches + repliesClient gets the IP, answer cached per TTL

Anatomy of a Domain Name

Full example mail.example.com.
Root .  (trailing dot — implied, managed by ICANN)
TLD com  (top-level domain — .com, .org, .net, country codes)
Domain (SLD) example  (registered with a domain registrar)
Subdomain mail  (configured by the domain owner in DNS)
FQDN mail.example.com.  (fully qualified — includes root dot)
A registrar (e.g., Namecheap, Google Domains) is where you purchase a domain. Domains expire if not renewed — losing one can mean losing email and web traffic. ICANN oversees TLDs and accredits registrars.

DNS Zones

  • A DNS zone is the portion of the namespace that a particular nameserver is authoritative for (e.g., example.com and all its records).
  • Zone data lives in a zone file — a text file containing all DNS records for that domain, plus an SOA (Start of Authority) record at the top.
  • The SOA record holds the primary nameserver name, admin email, serial number, and refresh/retry/expire timers for secondary servers.
  • Zone transfer: secondary nameservers copy zone data from the primary. AXFR = full transfer; IXFR = incremental. Both use TCP port 53.

DHCP - Dynamic Host Configuration Protocol

  • Automatically assigns IP configuration to devices on a network.
  • Assigns: IP address, subnet mask, default gateway, DNS servers, and a lease time.
  • Uses UDP: client listens on port 68, server on port 67.
  • Initial discovery uses broadcasts (source: 0.0.0.0, dest: 255.255.255.255).

DORA Process

D - Discover Client broadcasts "Anyone have an IP for me?"
O - Offer Server replies with an available IP lease offer
R - Request Client broadcasts "I'll take 192.168.1.50 from Server X"
A - AcknowledgeServer confirms "It's yours until [lease time]"
  • Lease renewal: client tries to renew at 50% of lease time (T1), then again at 87.5% (T2).
  • DHCP reservation: server assigns a fixed IP based on the client's MAC address.
  • DHCP relay agent: forwards DHCP broadcasts across router boundaries so one server can serve multiple subnets.

NAT - Network Address Translation

  • Translates private IP addresses to a public IP (and back) as packets cross the router. Extends IPv4 address space.
  • Static NAT: one-to-one mapping - one private IP always maps to one specific public IP.
  • Dynamic NAT: many-to-many - private IPs share a pool of public IPs.
  • PAT (Port Address Translation) / NAT overload / masquerade: many-to-one - all private devices share a single public IP, differentiated by port numbers. This is what home routers do.
Inside localInside globalExplanation
192.168.1.10:50001203.0.113.5:10001Private IP:port → public IP:port (PAT)
192.168.1.11:50002203.0.113.5:10002Different port used on the same public IP

HTTP / HTTPS

  • HTTP methods: GET (retrieve), POST (submit), PUT (replace), PATCH (partial update), DELETE, HEAD (headers only), OPTIONS (capabilities).
  • HTTPS = HTTP + TLS - adds encryption, server authentication via certificates, and data integrity (port 443).

HTTP Status Codes

RangeCategoryCommon Codes
1xxInformational100 Continue, 101 Switching Protocols
2xxSuccess200 OK · 201 Created · 204 No Content
3xxRedirection301 Moved Permanently · 302 Found · 304 Not Modified
4xxClient Error400 Bad Request · 401 Unauthorized · 403 Forbidden · 404 Not Found · 429 Too Many Requests
5xxServer Error500 Internal Server Error · 502 Bad Gateway · 503 Service Unavailable · 504 Gateway Timeout
  1. What DNS record type maps a hostname to an IPv4 address?
  2. Spell out and explain each step of the DHCP DORA process.
  3. An HTTP response returns status 403. What does this mean, and what's the difference from 401?
  4. What type of NAT is used in a typical home router? How does it allow multiple devices to share one IP?
  5. You try to access a site by IP and it works, but using the domain name it fails. What is the likely problem?
  6. What is the DNS TTL and why does it matter for troubleshooting?
  1. A record
  2. Discover (client broadcasts looking for a DHCP server) → Offer (server offers an IP lease) → Request (client formally requests that specific offer) → Acknowledge (server confirms the lease)
  3. 403 = Forbidden (you are authenticated but not permitted to access the resource). 401 = Unauthorized (authentication is required and was not provided or failed - misleading name).
  4. PAT (Port Address Translation) / NAT overload. The router translates each private IP:port pair to the public IP with a unique port number, tracking each session in the NAT table.
  5. DNS resolution is failing. The IP-based request bypasses DNS entirely. Check the DNS configuration or try nslookup / dig on the domain.
  6. TTL is how long a DNS record is cached. A low TTL means changes propagate quickly but cause more DNS queries. A high TTL reduces queries but means stale entries linger longer after a change - important when troubleshooting after a DNS update.

6  ·  Connectivity, VPNs & Troubleshooting Tools

Systematic Connectivity Troubleshooting

Step 1Physical - check cable, NIC link light, Wi-Fi signal
Step 2IP config - ipconfig / ip addr - verify IP/mask/GW/DNS
Step 3Loopback - ping 127.0.0.1 - tests TCP/IP stack itself
Step 4Default gateway - ping 192.168.1.1 - tests local LAN
Step 5External IP - ping 8.8.8.8 - tests routing & internet
Step 6DNS - ping google.com or nslookup google.com - tests name resolution
Step 7Path - traceroute / tracert - identify where packets stop

Windows Troubleshooting Commands

ipconfig                 # Show IP configuration (all adapters)
ipconfig /all            # Detailed - includes MAC, DHCP server, lease times
ipconfig /release        # Release DHCP lease
ipconfig /renew          # Request new DHCP lease
ipconfig /flushdns       # Clear the local DNS cache

ping 8.8.8.8             # Test ICMP connectivity
ping -t 8.8.8.8         # Continuous ping (Ctrl+C to stop)
ping -n 10 8.8.8.8     # Send exactly 10 packets

tracert google.com       # Trace route hop-by-hop
pathping google.com      # Combined ping + tracert with statistics

nslookup google.com     # DNS lookup
nslookup -type=MX gmail.com  # Query specific record type

arp -a                   # Show ARP table (IP ↔ MAC mappings)
route print             # Show routing table
netstat -an             # Show all connections and listening ports
netstat -b              # Show which executable owns each connection

Linux / macOS Commands

ip addr                  # Show IP addresses (modern Linux)
ip route                 # Show routing table
ifconfig                 # Show IP config (legacy, still common on macOS)

ping -c 4 8.8.8.8       # Send 4 ICMP echo requests
traceroute google.com   # Trace route (Linux/macOS)

dig google.com          # Detailed DNS lookup
dig MX gmail.com        # Query MX records
dig +short google.com  # Just the answer
nslookup google.com     # Simpler DNS lookup

ss -tulpn               # Show listening ports and processes (modern)
netstat -tulpn          # Same, legacy command

arp -n                   # Show ARP table
curl -I https://example.com  # Show HTTP response headers only
tcpdump -i eth0 -n     # Capture packets on interface eth0

VPNs - Virtual Private Networks

  • Purpose: create an encrypted tunnel over an untrusted network (the internet), allowing secure communication as if on a private network.
  • Site-to-site VPN: connects two entire networks (e.g., HQ ↔ branch office). Always-on tunnel between routers/firewalls.
  • Remote access VPN: individual device connects to a corporate network. The user's device gets a virtual IP on the remote subnet.
  • Split tunneling: only traffic destined for the remote network goes through the VPN; other traffic goes direct. Reduces VPN load but reduces security.

VPN Protocols

IPsecLayer 3. Two modes: Tunnel (encrypts entire packet, used for site-to-site) vs Transport (encrypts payload only). Often combined with IKEv2.
SSL/TLS VPNRuns over TCP/443. Works through firewalls that block non-HTTP. Common for remote access (e.g., OpenVPN, Cisco AnyConnect).
WireGuardModern, minimal codebase, fast. Uses UDP. Increasingly replacing OpenVPN in new deployments.
L2TP/IPsecL2TP provides the tunnel (Layer 2), IPsec provides encryption. Built into most OSes.
PPTPOld, insecure - should not be used. Only included for historical/exam context.

Proxy Servers

Forward proxySits between clients and the internet. Can filter, cache, and log outbound requests. Clients know about it.
Reverse proxySits in front of servers (e.g., Nginx, HAProxy). Handles load balancing, SSL termination, and caching. Clients don't know the backend servers.

Firewalls

StatelessFilters based on static rules (src/dst IP, port, protocol). Each packet is evaluated independently - no awareness of connection state.
StatefulTracks the state of active connections (connection table). Allows return traffic for established sessions automatically. More secure.
NGFWNext-Generation Firewall - adds deep packet inspection, application awareness, IDS/IPS, and user identity into a stateful firewall.

Wireless Troubleshooting Notes

  • 2.4 GHz non-overlapping channels: 1, 6, 11 (US). Use these to avoid co-channel interference.
  • 5 GHz: more channels, less interference, shorter range.
  • RSSI (Received Signal Strength Indicator): measure of signal strength. More negative = weaker (e.g., -70 dBm is weaker than -50 dBm).
  • Authentication failures: wrong passphrase, expired certificate (WPA2-Enterprise), or mismatch in security standard.
  • Check DHCP exhaustion if new devices can't get an IP - the pool may be full.

Broadband & WAN Connections

DSLDigital Subscriber Line — broadband over phone lines. ADSL is asymmetric (faster download than upload), common for homes. Speed degrades with distance from the exchange.
Cable broadbandRuns over coaxial TV infrastructure (DOCSIS standard). Shared bandwidth in a neighborhood — speeds vary with local congestion.
FiberLight-based — highest speeds, lowest latency. FTTH/FTTP: fiber all the way to the building. FTTC: fiber to the curb, copper for the last stretch.
T-carrier linesT1: 24 multiplexed channels, 1.544 Mbps. T3: 28 T1s bundled, ~45 Mbps. Business-grade dedicated lines; largely replaced by fiber and MPLS today.
WAN / MPLSWide Area Networks connect geographically separated sites. MPLS (Multiprotocol Label Switching) is a managed WAN service that routes by label rather than IP — predictable performance, but expensive.
Point-to-point VPNReplaces dedicated WAN links with an encrypted tunnel over the public internet. Lower cost, but reliability depends on both ISPs.

Wireless Networking

Infrastructure modeDevices connect through a central access point (AP) — standard for home/office. The AP bridges wireless clients to the wired network.
Ad-hoc modeDevices connect directly to each other — no AP needed. Useful for quick file transfers; no central management.
MeshMultiple APs communicate with each other to extend coverage. Eliminates dead zones without running long cables. Common in modern home Wi-Fi systems.
Wi-Fi 6 (802.11ax)Current mainstream standard. Key improvements over Wi-Fi 5: OFDMA (multiple clients share one channel simultaneously), MU-MIMO uplink and downlink, BSS Coloring (reduces interference in dense environments). Up to ~9.6 Gbps theoretical.
Cellular (4G/5G)4G LTE: typical 10–100 Mbps, widely available. 5G: multi-Gbps theoretical, low latency; important for IoT. Devices connect via SIM card tied to a carrier account.

Wireless Security Standards

StandardStatusNotes
WEPBroken40-bit key, easily cracked in minutes — never use
WPADeprecatedTKIP encryption, known vulnerabilities — avoid
WPA2AcceptableAES-CCMP encryption. Personal (pre-shared key) or Enterprise (802.1X/RADIUS auth)
WPA3CurrentSAE replaces PSK (resists offline dictionary attacks). Mandatory for Wi-Fi 6 certification.

Cloud Computing

IaaSInfrastructure as a Service — rent raw compute, storage, and networking. You manage OS and above. Examples: AWS EC2, Azure VMs, Google Compute Engine.
PaaSPlatform as a Service — provider manages the infrastructure; you deploy your app/code. Examples: Heroku, Google App Engine, Azure App Service.
SaaSSoftware as a Service — fully managed application, accessed via browser. You just use it. Examples: Gmail, Salesforce, Microsoft 365.
Cloud storageObject storage accessible over the internet. Data is replicated for durability. Examples: Google Drive, AWS S3, iCloud.
Quick mental model: IaaS = you manage most · PaaS = you manage the app · SaaS = you just log in.

IPv4 / IPv6 Coexistence

Dual stackA device or network runs both IPv4 and IPv6 simultaneously. The dominant real-world transition strategy — the device uses whichever protocol the destination supports.
Tunneling (6in4)IPv6 packets are encapsulated inside IPv4 packets to cross an IPv4-only network. Used when two IPv6 networks are separated by IPv4 infrastructure.
NAT64Gateway translates between IPv6 and IPv4 — allows IPv6-only clients to reach IPv4-only servers.
  1. What command shows the ARP cache on Windows? On Linux?
  2. You can ping 8.8.8.8 successfully but cannot load google.com in a browser. What is most likely wrong and what command would you run next?
  3. What does ipconfig /flushdns do and when would you use it?
  4. What is the difference between a site-to-site VPN and a remote access VPN?
  5. A stateless firewall rule permits TCP traffic from any source to port 80. Why might a stateful firewall be preferable here?
  6. What are the non-overlapping channels on the 2.4 GHz band (US), and why does this matter?
  1. Windows: arp -a. Linux: arp -n or ip neigh
  2. DNS resolution is failing - the device can reach the internet but can't translate domain names to IPs. Run nslookup google.com or dig google.com to verify.
  3. It clears the local DNS resolver cache. Useful when DNS records have changed (e.g., server migration) but the old cached entry is still being used.
  4. Site-to-site connects two full networks permanently (e.g., two offices), handled by router/firewall appliances. Remote access VPN connects a single user's device to a network, typically initiated on-demand by the user.
  5. A stateful firewall automatically permits the TCP reply traffic (RST, ACK, established sessions) for connections it initiated, and blocks unsolicited inbound packets. A stateless firewall would need explicit rules for return traffic, creating security gaps.
  6. Channels 1, 6, and 11 are the only three non-overlapping 20 MHz channels in the US 2.4 GHz band. Using the same or adjacent channels as a neighbor causes co-channel or adjacent-channel interference, reducing throughput.

7  ·  What Actually Matters - Key Takeaways

The mental model - OSI layers for troubleshooting

Use the 4-layer TCP/IP model bottom-up. Every real-world problem maps to one of these layers - it stops you from chasing DNS when the cable is unplugged.

1  Physical Is the cable / signal good?
2  Data Link Is the MAC address / switch doing its job?
3  Network Is IP routing correct?
4  Transport Is the right port open? Is the connection establishing?
5  Application Is the service itself responding?

IP addressing & subnetting - needs to be automatic

  • CIDR notation, what the prefix length means, how to derive the network address, broadcast address, and usable host range from any prefix.
  • Memorize the private RFC 1918 ranges cold: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16.
  • Understanding why subnetting exists - traffic segmentation, security boundaries, broadcast domain control - matters more long-term than binary math speed. But the math still needs to be solid.

TCP vs UDP - know when each is appropriate

TCP Connection-oriented. Three-way handshake (SYN → SYN-ACK → ACK), guaranteed delivery, ordered, flow-controlled. Used where integrity matters - HTTP, SSH, FTP.
UDP Fire-and-forget. No handshake, low overhead. Used where speed matters more than perfection - DNS queries, streaming, VoIP, gaming.
Knowing which protocol is involved tells you what kind of problem to look for.

DNS - the system everything depends on

  • Resolution chain: recursive resolver → root → TLD → authoritative.
  • Record types in practical priority order: A (IPv4), AAAA (IPv6), CNAME (alias), MX (mail routing), PTR (reverse lookup), NS (delegation).
  • TTL as an operational lever - lower it before migrations so changes propagate quickly.
  • The real skill: isolating "is this DNS or connectivity?" quickly with nslookup or dig.

DHCP - understand the lease lifecycle

  • DORA: Discover → Offer → Request → Acknowledge. Discover and Request are broadcasts; Offer and Acknowledge come from the server.
  • Lease renewal behavior: client tries at 50% of lease time (T1), then at 87.5% (T2).
  • Reservations (MAC-to-IP binding) give devices a stable address without full static config.
  • IP helper addresses forward DHCP broadcasts across subnets so one server can serve multiple VLANs.

NAT - the bridge between private and public

  • PAT (the common form) maps many internal hosts to one public IP via port tracking.
  • The NAT table is what makes return traffic work - if the entry times out or the device reboots, return traffic has nowhere to go.
  • Inbound connections to NATted hosts require explicit port forwarding rules.

Routing fundamentals

  • Static routes: manually configured, predictable, fragile at scale.
  • Dynamic routing protocols (OSPF interior, BGP exterior): know the names and use cases even before you configure them.
  • The default gateway is the "if I don't know where else to send it" rule.
  • TTL is both a routing safety mechanism (drops loops) and the engine behind traceroute.

Troubleshooting tools - daily instruments

pingLayer 3 reachability, round-trip time
traceroute / tracertPath mapping - find where packets stop
nslookup / digDNS verification independent of the browser
netstat / ssWhat's listening, what's connected
ipconfig / ip addrLocal config sanity check
Ping the gateway Fails → local problem
Gateway OK, destination fails Somewhere in the path
IP works, hostname fails DNS
That sequence gets you to the answer faster than reaching for any individual tool first.

IPv6 - know it well enough to work with it

  • 128-bit addresses, colon-hex notation. Two compression rules: drop leading zeros per group; replace the longest consecutive all-zero run with :: once (leftmost on ties).
  • Address types that matter: global unicast (2000::/3, publicly routable), link-local (fe80::/10, auto-configured, non-routable, always present on every interface), loopback (::1).
  • No broadcast - replaced by multicast. No NAT needed at scale.
  • Dual-stack is the real-world transition reality - most production networks run both IPv4 and IPv6 simultaneously.

The bigger picture

Networks are layered systems and every problem has a layer. Verify each layer before assuming the problem is higher up. That instinct - checking bottom-up systematically before jumping to conclusions - is worth more than memorizing any individual fact on this list.
Quiz Me
1 / 6

0 / 6

correct