From point A to point B
Point A: You know a router "sends packets", but you are not sure what changes in them along the way or why one route beats another. Switch, hub, ARP and VPN sound like loose acronyms. Point B: You can follow a packet hop by hop, predict which route a router will pick, explain how a switch learns and forwards frames, tell the WAN and VPN options apart and say when OSPF uses a DR/BDR and when it does not.
This chapter covers the second part of Day 1. It is broad on purpose: each topic comes back later in more detail (OSPF, VLANs, ACLs, VPNs). Here you fix the ideas that repeat across the whole syllabus.
Packet forwarding and the routing table (RIB)
A router works at layer 3 of the OSI model: it looks at IP addresses (IPv4 and IPv6) and forwards packets. Today it can be a physical box or a software process (a virtual machine or a cloud router); the routing logic is the same. It is not a firewall either: a router can do filtering (ACLs) and NAT, but those are separate functions that solve separate problems.
The most common mistake is to think that, when the packet leaves through another interface, it takes that interface's IP address. It does not: intermediate routers change neither the source IP nor the destination IP. What changes is the layer 2 frame carrying it.
| Element | Changes at each hop? |
|---|---|
| Source and destination IP | No (unless there is NAT) |
| Source and destination MAC | Yes: rewritten for the next link |
| TTL / Hop Limit | Yes: drops by 1; at 0 the packet is discarded |
| IPv4 header checksum | Yes: recalculated because the TTL changed |
Lookup order. On a match, the router rewrites the frame and sends it out the exit interface.
The table the router consults is the RIB (Routing Information Base); in show ip route you see it as the "routing table". On real devices the fast decision uses an optimized copy (the FIB, with CEF), but for the exam reasoning with the RIB is enough. If the destination is not there and there is no default route (0.0.0.0/0), the packet is dropped and the router usually answers with an ICMP "destination unreachable".
R1# show ip route
Codes: C - connected, S - static, O - OSPF, D - EIGRP, L - local, * - candidate default
Gateway of last resort is 198.51.100.1 to network 0.0.0.0
S* 0.0.0.0/0 [1/0] via 198.51.100.1
10.0.0.0/8 is variably subnetted, 4 subnets, 3 masks
C 10.1.1.0/24 is directly connected, GigabitEthernet0/0
L 10.1.1.1/32 is directly connected, GigabitEthernet0/0
O 10.2.0.0/16 [110/20] via 10.1.1.2, 00:04:12, GigabitEthernet0/0
D 10.2.5.0/24 [90/3072] via 10.1.1.3, 00:01:05, GigabitEthernet0/0
198.51.100.0/30 is subnetted, 1 subnets
C 198.51.100.0 is directly connected, GigabitEthernet0/1
R1(config)# ip route 0.0.0.0 0.0.0.0 198.51.100.1
Sample RIB with a static default route (S*), one OSPF route and one EIGRP route
Routing logic: prefix, metric and administrative distance
When several routes can reach the same destination, the router decides in three steps and in this order. It is one of the heaviest topics in the IP Connectivity domain, so it pays to master it.
- Longest prefix match. The most specific route wins, regardless of protocol or metric. This works because everything today is CIDR and VLSM (RFC 4632), not classes.
- Administrative distance (AD). If the prefix is identical but different protocols advertise it, the lowest AD wins: it measures how much you trust the source.
- Metric. If prefix and protocol are the same, the lowest metric wins (cost in OSPF, composite metric in EIGRP, hops in RIP). On a tie, the router load-balances across the equal-cost routes (ECMP).
R1# show ip route 10.2.5.20
Routing entry for 10.2.5.0/24
Known via "eigrp 100", distance 90, metric 3072, type internal
Routing Descriptor Blocks:
* 10.1.1.3, from 10.1.1.3, 00:01:05 ago, via GigabitEthernet0/0
For 10.2.5.20 the EIGRP /24 wins even though an OSPF /16 exists: the prefix is evaluated before the AD
| Route source | Default AD |
|---|---|
| Connected | 0 |
| Static | 1 |
| eBGP | 20 |
| Internal EIGRP | 90 |
| OSPF | 110 |
| RIP | 120 |
| External EIGRP | 170 |
A typical exam case: the router has 1.1.1.0/27 learned by OSPF and 1.1.1.0/24 by EIGRP, and traffic arrives for 1.1.1.1. Even though EIGRP has the lower AD, the router uses the /27 because it is more specific. AD only comes into play when the prefix is the same.
Control, data and management planes
Every network device does three different jobs, and separating them in your head clears up much of what comes later (SDN, controllers, automation).
| Plane | What it does | Examples |
|---|---|---|
| Control | Builds the information that says where to send things | OSPF, EIGRP, BGP tables; STP; ARP and MAC table (learning) |
| Data (forwarding) | Receives, processes and sends each packet or frame | FIB/CEF lookup, frame rewrite, applied ACLs |
| Management | Access to administer the device | SSH, Telnet, HTTPS, SNMP, NETCONF, RESTCONF, APIs |
A useful analogy: the brain is the control plane (it decides), the arms and legs are the data plane (they execute) and the senses are the management plane (where you receive information and orders).
In a traditional network every device carries all three planes inside the box: you log into each router by CLI and its control plane is local, even if together they form a "collective intelligence" (for example, OSPF adjacencies). This is called distributed control. In a controller-based network the control plane is centralized in software (Cisco Catalyst Center, formerly DNA Center) and the devices keep the data plane, which depends on their hardware. The controller talks to them through southbound APIs (NETCONF, RESTCONF, SSH, SNMP) and exposes a northbound REST API to your scripts and applications.
From hub to switch
The first Ethernet networks did not use switches. They were a shared bus of coaxial cable: thick (10BASE5, up to 500 m) and thin (10BASE2, up to 185 m). Each PC connected with a BNC T-connector and the cable had terminators at both ends to absorb the signal. A break anywhere took the whole network down.
Twisted-pair cable (UTP, 10BASE-T, 100 m per run) changed the topology to a star: one cable per device to a central point. That point was first the hub, a layer 1 multiport repeater with no intelligence: it regenerates the signal and copies it out of every port.
| Hub | Switch | |
|---|---|---|
| Layer | 1 (repeater) | 2 (layer 3 models also exist) |
| Learns addresses | No | Yes, MAC table |
| Collision domains | 1 for all ports | 1 per port |
| Broadcast domains | 1 | 1 per VLAN |
| Bandwidth | Shared among all ports | Dedicated per port (microsegmentation) |
| Duplex mode | Half duplex (CSMA/CD) | Full duplex |
In between came the bridge, with two interfaces and a MAC table. The switch is its evolution, with many ports and dedicated hardware. That is why a 100 Mb/s hub with 10 devices split those 100 Mb/s among all of them, while a switch port delivers 100 Mb/s or 1 Gb/s to each one. Hubs are no longer made; switches are.
Switching: MAC table and ARP
A layer 2 switch picks the exit interface from the destination MAC. Its MAC table (CAM) is empty at power-up and fills itself with one simple principle: from every frame that comes in, it records the source MAC and the port it arrived on. Dynamic entries age out after 300 s by default if they are not seen again.
- A frame arrives: the switch learns the source MAC and port.
- It looks up the destination MAC in the table.
- If found, it sends the frame out that port only (unicast).
- If not found (unknown unicast) or if it is a broadcast, it floods it out every port in the VLAN except the ingress one.
What is missing is where the destination MAC comes from. Host A (172.16.1.1) wants to talk to C (172.16.1.2) in its own subnet; it knows the IP but not the MAC. It uses ARP (RFC 826): it sends a request addressed to FFFF.FFFF.FFFF (the broadcast MAC, 48 bits set to one) asking "who has 172.16.1.2?". The switch learns A's MAC, floods the request, the other hosts ignore it and C answers by unicast with its MAC. At that moment the switch learns C's too. From then on, traffic between A and C goes direct.
After this exchange A stores C's MAC in its ARP table and the switch forwards only out Fa0/3.
SW1# show mac address-table dynamic
Mac Address Table
-------------------------------------------
Vlan Mac Address Type Ports
---- ----------- -------- -----
1 aaaa.aaaa.aaaa DYNAMIC Fa0/1
1 cccc.cccc.cccc DYNAMIC Fa0/3
Total Mac Addresses for this criterion: 2
R1# show ip arp
Protocol Address Age (min) Hardware Addr Type Interface
Internet 172.16.1.2 3 cccc.cccc.cccc ARPA GigabitEthernet0/0
Switch MAC table and layer 3 device ARP table with the example's data
Evolution of the Internet and WAN options
Networks moved from circuit switching (telephony, dial-up modems) to packet switching. Today a site joins another in several ways. For the CCNA you only need to know when each one fits; you are not asked to configure a carrier service.
| Option | How it works | Key idea |
|---|---|---|
| Leased line (PPP/HDLC) | Serial point-to-point link | Obsolete; on Cisco the default serial encapsulation is proprietary HDLC |
| Metro Ethernet | The provider delivers Ethernet between sites | E-Line, E-LAN and E-Tree (below) |
| MPLS L3VPN | The provider routes your VPN with labels | Your CE exchanges routes with the provider's PE |
| VPN over Internet | Encrypted tunnel over a broadband access | GRE, IPsec, DMVPN; cheap, no quality guarantee |
Metro Ethernet defines three service types. E-Line is point-to-point (like a virtual wire between two sites, e.g. with VPWS). E-LAN is multipoint: all sites look connected to one Ethernet segment (e.g. with VPLS). E-Tree is hub-and-spoke: a root site talks to the leaves and the leaves do not talk to each other. On the exam the question often runs the other way: "for a point-to-point link, which service type?" (E-Line).
Tunnels are built over Internet access. GRE (RFC 2784) encapsulates almost any protocol inside IP (protocol 47) but does not encrypt. DMVPN combines mGRE, NHRP and IPsec to build a hub-and-spoke network where sites can open direct tunnels to each other on demand. MPLS (RFC 3031) forwards by labels in the provider core, while you still see a neighbor router.
R1(config)# interface Tunnel0
R1(config-if)# ip address 10.99.0.1 255.255.255.252
R1(config-if)# tunnel source GigabitEthernet0/1
R1(config-if)# tunnel destination 203.0.113.2
Minimal GRE tunnel between two routers (the default mode is GRE over IPv4)
VPN and AAA
A VPN (virtual private network) creates a tunnel across an untrusted network such as the Internet. The CCNA does not ask you to implement one; it asks for its benefits and components. IPsec (RFC 4301) is the usual framework, in two scenarios: site-to-site (two routers or firewalls join sites) and remote access (a client connects to the company network).
- Confidentiality: only those who should can read the data. Achieved by encrypting (e.g. AES).
- Integrity: what leaves is what arrives, unaltered. Verified with hash functions (HMAC).
- Origin authentication: checks that the other end is who it claims to be (pre-shared keys or certificates).
- Anti-replay: discards valid packets that an attacker captured and resends. IPsec numbers packets and rejects repeated or too-old ones.
AAA is another set of three questions, this time about network users. It is usually delivered by a RADIUS server (UDP 1812/1813) or TACACS+ (TCP 49, Cisco), and 802.1X with EAP uses it for port or Wi-Fi access.
| Function | Question | Example |
|---|---|---|
| Authentication | Who are you? | Username and password, certificate, second factor |
| Authorization | What can you do? | Can run show, but not configure terminal |
| Accounting | What did you do and when? | Log of logins and commands |
R1(config)# aaa new-model
R1(config)# radius server RAD1
R1(config-radius-server)# address ipv4 192.0.2.10 auth-port 1812 acct-port 1813
R1(config-radius-server)# key S3cr3t
R1(config)# aaa authentication login default group radius local
R1(config)# aaa authorization exec default group radius local
R1(config)# aaa accounting exec default start-stop group radius
AAA with RADIUS and local fallback for router access
OSPF: broadcast and point-to-point networks
The exam does not ask you to configure serial links (or clock rate), but it does expect you to know how OSPF treats each link type. Two types matter: broadcast and point-to-point. The type depends on the interface: on Ethernet it is broadcast by default and on a serial link (HDLC or PPP) it is point-to-point.
| Broadcast | Point-to-point | |
|---|---|---|
| DR/BDR election | Yes | No |
| Interface priority | Used (ip ospf priority) | Not applicable |
| Multicast used | 224.0.0.5 (all OSPF routers) and 224.0.0.6 (DR/BDR) | Only 224.0.0.5 |
| Neighbor state | FULL with DR/BDR; 2-WAY among the others | FULL with the neighbor |
| Default Hello / Dead | 10 s / 40 s | 10 s / 40 s |
You can force the type on an Ethernet interface that only joins two routers (for example, an E-Line service) with ip ospf network point-to-point. This avoids electing a DR, converges faster and simplifies the design. Both ends must use the same type. If the link is an E-LAN with several sites, leaving broadcast is the natural choice.
R1(config)# interface GigabitEthernet0/0
R1(config-if)# ip ospf network point-to-point
R1# show ip ospf interface GigabitEthernet0/0
GigabitEthernet0/0 is up, line protocol is up
Internet Address 10.0.12.1/30, Area 0
Process ID 1, Router ID 1.1.1.1, Network Type POINT_TO_POINT, Cost: 1
Timer intervals configured, Hello 10, Dead 40, Wait 40, Retransmit 5
R1# show ip ospf neighbor
Neighbor ID Pri State Dead Time Address Interface
2.2.2.2 0 FULL/ - 00:00:36 10.0.12.2 GigabitEthernet0/0
Network type forced to point-to-point; the neighbor shows FULL/- (no DR). On broadcast you would see FULL/DR or FULL/BDR
Class videos
- Day 1 · Part 2.1Packet forwarding and RIBWatch video
- Day 1 · Part 2.2Routing logicWatch video
- Day 1 · Part 2.3Switching, MAC and ARPWatch video
- Day 1 · Part 2.4From hub to switchWatch video
- Day 1 · Part 2.5Evolution and WAN modelsWatch video
- Day 1 · Part 2.6VPN, AAA and OSPFWatch video
Recorded live in 2021; Spanish audio with Spanish, English, French and Portuguese subtitles. When you play it, the video loads from YouTube. Day 1 playlist on YouTube
Test what you learned
1. A PC with IP 10.1.1.10 sends a packet to a remote server through three routers with no NAT. What source IP does the server see and which fields change along the way?
Answer. Answer. It sees 10.1.1.10: intermediate routers do not rewrite IP addresses. What changes at each hop are the source and destination MACs, the TTL (down by 1) and, because of that, the IPv4 header checksum. Only a NAT would change the source IP.
2. The table has 10.2.0.0/16 (OSPF, AD 110), 10.2.5.0/24 (EIGRP, AD 90) and a static 0.0.0.0/0. Which route is used for 10.2.5.20? And if the /24 came from OSPF and the /16 from EIGRP?
Answer. Answer. In both cases it uses the /24 (from EIGRP in the first, from OSPF in the second): the longest prefix is evaluated before the AD, so AD and metric only break ties between routes with the same prefix. The default route is used only when nothing more specific matches.
3. A freshly powered-on switch receives on Fa0/1 a frame whose destination MAC it does not know. What does it do with it and what does it learn?
Answer. Answer. It learns that the source MAC is on Fa0/1 and stores the entry. Because the destination is unknown (unknown unicast), it floods the frame out every port in the VLAN except Fa0/1. When the destination replies, it learns that port too and stops flooding.
4. An attacker captures a valid encrypted packet and resends it later. Which VPN property blocks it? And which AAA function records the commands an administrator types?
Answer. Answer. Anti-replay blocks it: IPsec numbers packets and discards duplicates or out-of-window ones, even if they are correctly encrypted and authenticated. The function that records the commands is accounting; authorization defines which commands can be run and authentication only verifies identity.
5. Two routers are joined by an E-Line service over Ethernet. Which OSPF network type fits, and how does it differ from broadcast?
Answer. Answer. Point-to-point fits (ip ospf network point-to-point on both ends), because E-Line is a point-to-point link. With broadcast a DR/BDR would be elected and priority and multicast 224.0.0.6 would be used; on point-to-point there is no election and neighbors go straight to FULL.
Key takeaways
- A router forwards; it does not change the source and destination IPs (except with NAT). It changes the MAC, lowers the TTL and recalculates the checksum.
- Decision order: longest prefix, then administrative distance, then metric; on a full tie there is ECMP load balancing.
- With no match in the RIB and no default route, the packet is dropped.
- The control plane decides, the data plane executes and the management plane administers. Controllers centralize control.
- A switch learns by source MAC, forwards by destination MAC and floods unknown unicast and broadcast. ARP maps IP to MAC.
- A hub shares bandwidth in one collision domain; a switch gives one collision domain per port, but broadcast still spans the VLAN.
- Metro Ethernet: E-Line is point-to-point, E-LAN multipoint and E-Tree hub-and-spoke. GRE does not encrypt; IPsec does.
- OSPF broadcast elects a DR/BDR; point-to-point has no election. Ethernet is broadcast by default and serial is point-to-point.
Official resources
- CCNA 200-301 exam page (Cisco)cisco.com
- RFC 4632: CIDR and route aggregationrfc-editor.org
- RFC 826: Address Resolution Protocolrfc-editor.org
- RFC 7426: SDN layers and terminologyrfc-editor.org
- RFC 2328: OSPF version 2rfc-editor.org
- RFC 4301: IPsec security architecturerfc-editor.org
Source and credits. Chapter written from the CCNA 200-301 Bootcamp that Jesús Espinoza recorded live in 2021, on the v1.0 syllabus; the current exam is v1.1. Text drafted with AI assistance and reviewed; original diagrams by The House of Routing. Technical data and configuration were checked against Cisco's official documentation, IETF RFCs and IEEE standards.