Chapter 1 โ€” The OSI Model

The OSI (Open Systems Interconnection) model provides a conceptual framework for how network communications work. It has 7 layers โ€” memorise them with: "All People Seem To Need Data Processing" (top-down) or "Please Do Not Throw Sausage Pizza Away" (bottom-up).

LayerNameFunctionProtocols/DevicesPDU
7ApplicationUser interface, application servicesHTTP, FTP, SMTP, DNS, SSHData
6PresentationEncryption, encoding, compressionSSL/TLS, JPEG, ASCIIData
5SessionSession establishment and managementNetBIOS, RPCData
4TransportEnd-to-end delivery, flow controlTCP, UDPSegment
3NetworkLogical addressing, routingIP, ICMP, OSPF ยท RoutersPacket
2Data LinkPhysical addressing, error detectionEthernet, 802.11 ยท SwitchesFrame
1PhysicalBits on the wire/airCables, hubs, NICsBit
๐Ÿ’ก
Security mapping: Firewalls operate at L3/L4. WAFs at L7. Switches at L2. Routers at L3. When a security tool is described, always ask: "what OSI layer does it operate at?"

Chapter 2 โ€” TCP/IP Model & Key Protocols

The TCP/IP model is what actually runs the internet. It collapses OSI layers 5โ€“7 into "Application."

TCP/IP LayerOSI EquivalentProtocols
Application5, 6, 7HTTP(S), FTP, SSH, Telnet, SMTP, POP3, IMAP, DNS, DHCP, SNMP
Transport4TCP, UDP
Internet3IPv4, IPv6, ICMP, ARP, OSPF, EIGRP, BGP
Network Access1, 2Ethernet, 802.11 Wi-Fi, PPP

TCP vs UDP

FeatureTCPUDP
ConnectionConnection-oriented (3-way handshake)Connectionless
ReliabilityGuaranteed delivery, ACKs, retransmissionBest-effort, no ACKs
OrderSequenced (sequence numbers)No ordering
SpeedSlower (overhead)Faster
Use casesHTTP, FTP, SSH, emailDNS, VoIP, video streaming, DHCP

Common Port Numbers (Must Know)

PortProtocolPortProtocol
20/21FTP (data/control)110POP3
22SSH143IMAP
23Telnet161/162SNMP
25SMTP389LDAP
53DNS443HTTPS
67/68DHCP445SMB
80HTTP3389RDP

Chapter 3 โ€” Ethernet & Switching

MAC Addresses

MAC (Media Access Control) addresses are 48-bit hardware addresses burned into NICs. Written as AA:BB:CC:DD:EE:FF. First 24 bits = OUI (manufacturer), last 24 bits = unique device ID.

# View MAC address
ip link show eth0
ifconfig eth0

# Cisco switch: show MAC address table
show mac address-table
show mac address-table dynamic

Switch Operation

  • Learn โ€” When a frame arrives, the switch learns the source MAC โ†’ port mapping
  • Forward โ€” If destination MAC is in table, forward to that port only
  • Flood โ€” If destination MAC is unknown, flood to all ports except the source
  • Filter โ€” If source and destination are same port, drop the frame

Chapter 4 โ€” IP Addressing

See the Subnetting Lab for detailed practical exercises. Key concepts here:

Private Address Ranges (RFC 1918)

RangeClassCIDR
10.0.0.0 โ€“ 10.255.255.255A10.0.0.0/8
172.16.0.0 โ€“ 172.31.255.255B172.16.0.0/12
192.168.0.0 โ€“ 192.168.255.255C192.168.0.0/16

Special Addresses

  • 127.0.0.1 โ€” Loopback (localhost)
  • 169.254.x.x โ€” APIPA (no DHCP available)
  • 0.0.0.0 โ€” Default route / all networks
  • 255.255.255.255 โ€” Limited broadcast

Chapter 5 โ€” Subnetting & VLSM

Covered in depth in the Subnetting Lab. Quick reference:

/24 = 254 hosts    /27 = 30 hosts
/25 = 126 hosts    /28 = 14 hosts
/26 = 62 hosts     /30 = 2 hosts (point-to-point links)

Chapter 6 โ€” Static Routing

# Cisco IOS static route syntax:
ip route [network] [mask] [next-hop | exit-interface]

# Route to 192.168.2.0/24 via next-hop 10.0.0.2
ip route 192.168.2.0 255.255.255.0 10.0.0.2

# Default route (gateway of last resort)
ip route 0.0.0.0 0.0.0.0 203.0.113.1

# Verify routing table
show ip route

# Route codes in output:
# C = Connected, S = Static, O = OSPF
# R = RIP, D = EIGRP, B = BGP, * = default route

Chapter 7 โ€” OSPF (Open Shortest Path First)

OSPF is a link-state routing protocol. Routers share LSAs (Link State Advertisements) to build a complete topology map, then run Dijkstra's SPF algorithm to find the best paths.

Key OSPF Concepts

  • AD (Administrative Distance) โ€” OSPF = 110
  • Metric โ€” Cost based on bandwidth (reference BW 100 Mbps by default)
  • Router ID โ€” Highest loopback IP, or highest active interface IP
  • DR/BDR โ€” On multi-access networks, elected to reduce LSA flooding
  • Area 0 โ€” The backbone area. All other areas must connect to it
# Enable OSPF single-area
router ospf 1
 router-id 1.1.1.1
 network 192.168.1.0 0.0.0.255 area 0
 network 10.0.0.0 0.0.0.3 area 0

# Verify OSPF
show ip ospf neighbor
show ip ospf database
show ip route ospf

# Set OSPF cost on an interface
interface GigabitEthernet0/0
 ip ospf cost 10

Chapter 8 โ€” EIGRP

EIGRP (Enhanced Interior Gateway Routing Protocol) is a Cisco advanced distance-vector protocol. Fast convergence, supports unequal-cost load balancing.

# Enable EIGRP (AS number must match on all routers)
router eigrp 100
 network 192.168.1.0 0.0.0.255
 network 10.0.0.0 0.0.0.3
 no auto-summary

# Verify
show ip eigrp neighbors
show ip eigrp topology
show ip route eigrp

# Key metrics: Bandwidth + Delay (by default)
# AD: internal = 90, external = 170, summary = 5

Chapter 9 โ€” VLANs & Trunking

VLANs (Virtual LANs) logically segment a network at Layer 2 without needing separate physical switches.

# Create a VLAN
vlan 10
 name SALES
vlan 20
 name IT

# Assign port to VLAN (access port)
interface FastEthernet0/1
 switchport mode access
 switchport access vlan 10

# Configure trunk port (carries multiple VLANs)
interface GigabitEthernet0/1
 switchport mode trunk
 switchport trunk encapsulation dot1q
 switchport trunk allowed vlan 10,20,30
 switchport trunk native vlan 99

# Verify
show vlan brief
show interfaces trunk

# Router-on-a-stick (inter-VLAN routing)
interface GigabitEthernet0/0.10
 encapsulation dot1q 10
 ip address 192.168.10.1 255.255.255.0
interface GigabitEthernet0/0.20
 encapsulation dot1q 20
 ip address 192.168.20.1 255.255.255.0

Chapter 10 โ€” Spanning Tree Protocol (STP)

STP prevents Layer 2 loops by blocking redundant paths. Without STP, a broadcast loop would bring down a switched network instantly.

STP Port States

StateLearns MACs?Forwards?
BlockingNoNo
ListeningNoNo
LearningYesNo
ForwardingYesYes
DisabledNoNo
# Show STP status
show spanning-tree
show spanning-tree vlan 10

# Set bridge priority (lower = more likely to become root)
spanning-tree vlan 10 priority 4096

# PortFast โ€” skip listening/learning for access ports
interface FastEthernet0/1
 spanning-tree portfast

# RSTP (802.1w) โ€” much faster convergence than classic STP
spanning-tree mode rapid-pvst

Chapter 11 โ€” Access Control Lists (ACLs)

ACLs filter traffic on routers. An implicit deny all sits at the end of every ACL โ€” if traffic doesn't match any permit statement, it's dropped.

# Standard ACL (filters source IP only, numbers 1-99)
access-list 10 permit 192.168.1.0 0.0.0.255
access-list 10 deny any

# Apply to interface (inbound or outbound)
interface GigabitEthernet0/0
 ip access-group 10 in

# Extended ACL (src, dst, protocol, port โ€” numbers 100-199)
access-list 110 permit tcp 10.0.0.0 0.0.0.255 any eq 80
access-list 110 permit tcp 10.0.0.0 0.0.0.255 any eq 443
access-list 110 deny ip any any

# Named ACL (preferred โ€” easier to edit)
ip access-list extended BLOCK_TELNET
 deny tcp any any eq 23
 permit ip any any

interface GigabitEthernet0/1
 ip access-group BLOCK_TELNET in

# Verify
show access-lists
show ip interface GigabitEthernet0/0
๐Ÿ’ก
ACL Placement Rule: Place standard ACLs close to the destination. Place extended ACLs close to the source. This minimises unnecessary traffic traversal.

Chapter 12 โ€” NAT & PAT

NAT (Network Address Translation) converts private IPs to public IPs, allowing many devices to share one public IP address.

# PAT (Port Address Translation / NAT Overload)
# Most common โ€” many-to-one translation

# Define inside/outside interfaces
interface GigabitEthernet0/0
 ip nat inside
interface GigabitEthernet0/1
 ip nat outside

# Create ACL for traffic to translate
access-list 1 permit 192.168.0.0 0.0.255.255

# Enable PAT (overload)
ip nat inside source list 1 interface GigabitEthernet0/1 overload

# Verify NAT translations
show ip nat translations
show ip nat statistics

Chapter 13 โ€” DHCP & DNS

# Configure DHCP server on Cisco router
ip dhcp excluded-address 192.168.1.1 192.168.1.10

ip dhcp pool LAN
 network 192.168.1.0 255.255.255.0
 default-router 192.168.1.1
 dns-server 8.8.8.8 8.8.4.4
 lease 7

# Verify
show ip dhcp pool
show ip dhcp binding

# DNS resolution process:
# 1. Client checks local cache
# 2. Client asks configured DNS server
# 3. DNS server checks its cache
# 4. DNS server queries root, then TLD, then authoritative server
# 5. Answer returned and cached

# DNS record types
# A     = hostname โ†’ IPv4
# AAAA  = hostname โ†’ IPv6
# MX    = mail server
# CNAME = alias
# PTR   = reverse lookup (IP โ†’ hostname)
# NS    = authoritative name server
# TXT   = arbitrary text (SPF, DKIM)

Chapter 14 โ€” Network Security

Layer 2 Attacks & Mitigations

AttackDescriptionMitigation
MAC FloodingFill switch CAM table โ†’ switch broadcasts all trafficPort security (limit MAC count per port)
VLAN HoppingDouble-tagging or DTP exploit to access other VLANsDisable DTP, set native VLAN to unused
ARP SpoofingFake ARP replies โ†’ MitM positionDynamic ARP Inspection (DAI)
DHCP StarvationExhaust DHCP pool โ†’ DoSDHCP Snooping (trust only uplinks)
STP AttackSend superior BPDUs โ†’ become root bridgeBPDU Guard on access ports
# Port Security โ€” limit MACs per port
interface FastEthernet0/1
 switchport port-security
 switchport port-security maximum 2
 switchport port-security violation restrict

# DHCP Snooping
ip dhcp snooping
ip dhcp snooping vlan 10,20
interface GigabitEthernet0/1
 ip dhcp snooping trust   # uplink to real DHCP server

# Dynamic ARP Inspection
ip arp inspection vlan 10
interface GigabitEthernet0/1
 ip arp inspection trust

Chapter 15 โ€” IPv6 Basics

IPv4 is exhausted. IPv6 uses 128-bit addresses providing 340 undecillion unique addresses.

# IPv6 address format: 8 groups of 4 hex digits
2001:0db8:85a3:0000:0000:8a2e:0370:7334

# Can compress consecutive zeros with ::
2001:db8:85a3::8a2e:370:7334

# Special addresses:
::1/128          = loopback
fe80::/10        = link-local (always starts with fe80)
ff02::1          = all-nodes multicast
2001:db8::/32    = documentation/examples

# Configure IPv6 on Cisco interface
ipv6 unicast-routing
interface GigabitEthernet0/0
 ipv6 address 2001:db8:1::1/64
 ipv6 address fe80::1 link-local

# Show IPv6 info
show ipv6 interface brief
show ipv6 route
โœ…
Workbook Complete! You've covered all major CCNA topics. Practice with the subnetting and OSPF labs, then try Cisco Packet Tracer or GNS3 for hands-on router/switch configuration.
Practice: Subnetting Lab โ†’ OSPF Lab โ†’