xSoxxRxInxRxxDPauouteouescrctrttikeeerneernatttJioounrney

This diagram illustrates a packet’s journey through network infrastructure: source PC through Switch 1 to Router 1, across internet cloud to Router 2, through Switch 2 to destination server. The dashed golden arrow traces this path, showing how routing decisions forward traffic across network boundaries while Ethernet addresses change at each hop and IP addresses remain constant end-to-end.

Review from Module 4

Review: From IP Addressing to Routing  

The Journey Ahead

Module 4: Addressing (naming the destination) Module 5: Routing (finding the path there)

Routing
7654321TD.......oe A P S T D PdciprerNahasipesaetyyonlssntas!sieioswicnnpoLcatoriatarknliotitknon

Module Overview and Learning Outcomes  

Topics Covered

1.

Routing Technologies and Tables

2.

Dynamic Routing Protocols

3.

Network Address Translation (NAT)

4.

Firewalls and Security

5.

Enterprise Network Topologies

6.

Virtual LANs (VLANs)

Learning Outcomes

After this module, you will be able to:

1 Routing Foundations

1.1 Routers and Path Selection

This section introduces router roles, routing tables, and packet forwarding behavior across network boundaries.

The Router: Gateway Between Networks  

Key Difference from Switches

Switches: MAC addresses (Layer 2) Routers: IP addresses (Layer 3)

xRN1xxN1xx..xIoe9e011nutw2.tw.0teto16o.0rner8r.erk.1k0/tA.0B24/24

This diagram shows a router managing three connected interfaces: left interface connects to local LAN with PCs, right interface connects to server network, and WAN connection links to internet. Each interface has its own IP address and network identifier, allowing the router to switch traffic between networks and enabling inter-network communication.

Routing Tables and Path Selection  

Longest Prefix Match

If a packet for 192.168.1.50 matches both 192.168.0.0/16 and 192.168.1.0/24, the /24 wins because it’s more specific.

Loprnegfixest
PRSFFwaeeainoincardrws!kdcaet DhBreedAsRsrtottriu Moivnta NeaintestgcxiohtnTaHIPbolpe

Static and Default Routes  

Static Routes

ip route 10.0.0.0 255.0.0.0 192.168.1.1

When to Use Static

Small networks, stub networks (one exit), or when you need security control over paths.

Default Route

ip route 0.0.0.0 0.0.0.0 203.0.113.1

Analogy

Static: “Take Highway 10 to Grandma’s.” Default: “For anywhere else, head to the main highway.”

Routing Table Example  

SNMNMT1/G0D1/G0D1/11S0/11DDSDxTx1x1x1x1xInaeaeey92ii02ii710t.009eirtaeh920.0.72tmtsxtp24gre.04gre26.0at.2fectifais.10.0..1erpwktre.10c.00c.1.0i0..1autcul R60.0.6nloi6/0t./1t6.c06llyRto8.02.0eterHc80.028tCoRu1/2.0ko.1..1outot.04/p.0.neute/216R025ner4o4ecutetding   Table

This diagram shows a router’s three route types: directly connected networks (local LANs with PCs and servers), remote networks accessed via next-hop routers, and the default route to internet. Three colored network regions demonstrate that routers use routing tables to decide: for local networks send directly; for remote networks forward to next hop; for unknown destinations use default route.

Reading the Table

To reach 172.16.0.0/16, send packets to next hop 10.0.0.2. For unknown destinations, use the default route via 192.168.1.254.

Packet Forwarding Process  

  Layer 2 headers change at each hop (new MACs )
ISDSDxR1.2.3.ONNSDLLLLLnrcstrcsto R L DueercstaayayayaycMMIIueoetwwIIyeeeeoAAPPtaocgSDPPerrrrmCCedkreorsr2323irDupmictneen3gstRntgIouThPPtTPeaeLaaccdkkeeertts stay the same end-to- end (same IPs)

Fragmentation and MTU  

Problems with Fragmentation

LFFFFEMarrrraTragagagagcUgmmmmheeeee≤nnnnPtttta123c(1(1(1k550e000t0)0)0) (4000 bytes)

This MTU fragmentation diagram shows the process when a packet (4000 bytes) exceeds the maximum transmission unit: the router splits it into three fragments, each fitting within the 1500-byte MTU limit (Fragment 1: 1500 bytes, Fragment 2: 1500 bytes, Fragment 3: 1000 bytes). A brace on the right indicates that each fragment must be at most MTU size. This splitting adds processing overhead; modern systems use Path MTU Discovery to find the smallest MTU along the entire path, avoiding fragmentation altogether.

Path MTU Discovery

Modern systems discover the smallest MTU along the entire path to avoid fragmentation.

Case Study: Westley’s Journey to Florin  

Case Study: Westley’s Journey to Florin
Westley is sending a message from the Pirate Ship network (172.16.0.0/24) to Princess Buttercup at Castle Florin (10.0.0.0/24). The ship’s router has this routing table:

Network Next Hop Type
172.16.0.0/24 Directly Connected Direct
10.0.0.0/24 192.168.50.1 Static
0.0.0.0/0 203.0.113.1 Default

Westley’s PC: 172.16.0.25 Buttercup’s PC: 10.0.0.100

Review Questions

1.

Which routing table entry will the router use for Westley’s packet?

2.

What is the next hop IP address?

3.

What would happen if someone deleted the 10.0.0.0/24 entry?

Case Study Solution: Westley’s Journey to Florin  

Solution: Westley’s Journey to Florin

1.

Router uses 10.0.0.0/24—longest prefix match for 10.0.0.100.

2.

Next hop is 192.168.50.1 (path to Castle Florin).

3.

If deleted, router uses default route (0.0.0.0/0) via 203.0.113.1—a longer path through the kingdom!

xWxx1xBxInBBe92uteast.1tterstckle6ernpuy8cetap.5upth0.1

Key Lesson

“As you wish!” Specific routes always win over the default. Without proper entries, packets may take the long way—or never arrive!

2 Router Configuration and Tools

2.1 Static Routing and Diagnostics

This section focuses on practical router setup, route verification, and path diagnostics using common operational tools.

Basic Router Configuration  

Essential Settings

Two Configuration Methods

CLI: Command-line interface (Cisco IOS) GUI: Web-based management interface

Sample CLI Commands

Router> enable Router# configure terminal Router(config)# hostname Florin-GW Florin-GW(config)# interface g0/0 Florin-GW(config-if)# ip address 192.168.1.1 255.255.255.0 Florin-GW(config-if)# no shutdown Florin-GW(config-if)# exit Florin-GW(config)# ip route 0.0.0.0 0.0.0.0 203.0.113.1

Tip

Always save config: copy run start

Routing Table Tools  

Cisco IOS Commands

show ip route Display full routing table

show ip route network Show specific route entry

show ip interface brief Interface status summary

show running-config View current configuration

Windows / Linux Commands

route print (Windows) netstat -r (Windows/Linux) Display host routing table

ip route (Linux) Modern Linux routing display

netstat -rn Numeric output (no DNS lookup)

Quick Check

Use ip route get IP on Linux to see which route would be used for a specific destination.

tracert and traceroute  

Use Cases

Find where packets get stuck, identify slow links, verify routing path.

xSoxHxHxHxDTTTuopopopesTTTrctL=L=L=e123123

This traceroute diagram shows TTL-based path discovery: a source PC sends probes with incrementing TTL values (colored arrows labeled TTL=1, 2, 3) toward destination server through three intermediate routers. Each router decrements TTL; when TTL reaches zero, the router responds with its address and timing. Dashed return arrows show ICMP responses from each hop revealing the complete path with latency measurements, helping diagnose routing problems.

Sample Output

1 2ms 1ms 1ms 192.168.1.1
2 10ms 9ms 11ms 10.0.0.1
3 15ms 14ms 15ms 203.0.113.50

3 Dynamic Routing Protocols

3.1 RIP, EIGRP, OSPF, and BGP

Dynamic routing protocols exchange topology information automatically and select best paths based on protocol metrics and policies.

Dynamic Routing Protocols Overview  

Why Dynamic Routing?

Two Categories

IGP (Interior Gateway Protocol) Within an organization: RIP, OSPF, EIGRP

EGP (Exterior Gateway Protocol) Between organizations: BGP

A(YxxOA(IxxOBBSoSSSSGet 1uP 2PPPw0rF0)Fe0C0enoAmSpaensy)

This diagram shows two autonomous systems (ASes) separated by administrative boundaries: AS 100 (Your Company, blue) runs OSPF internally with two routers exchanging routes efficiently. AS 200 (ISP, green) also runs OSPF internally. The critical orange WAN link between them carries BGP (Border Gateway Protocol), the inter-AS protocol that allows organizations to exchange routing information at the internet’s administrative borders. OSPF handles fast convergence and optimal paths within an organization, while BGP provides intentional, policy-based routing between organizations.

Autonomous System (AS)

A network under single administrative control. Each AS has a unique number (ASN).

RIP and EIGRP  

RIP (Routing Information Protocol)

Best for: Small, simple networks

RIP Limitation

Hop count ignores link speed! A 10 Gbps path with 3 hops loses to a 1 Mbps path with 2 hops.

EIGRP (Enhanced Interior Gateway RP)

Best for: Cisco enterprise networks

EIGRP Advantage

Keeps backup routes ready—failover is nearly instant!

OSPF (Open Shortest Path First)  

OSPF Cost Formula

Cost =       108
----------------
bandwidth (bps)

100 Mbps Cost = 1
10 Mbps Cost = 10
1 Gbps Cost = 1

AxxxAxAAxArrBrBeeaReaRa120 (Backbone )

This diagram illustrates the relationship between routing protocols and administrative autonomy: Company network (AS 100, blue) runs OSPF internally with two connected routers communicating via OSPF, while ISP network (AS 200, green) also uses OSPF internally with its routers. The critical orange WAN link between them runs BGP (Border Gateway Protocol), which is the inter-AS protocol that exchanges routes between autonomous systems at the administrative boundary. This architecture shows how OSPF handles intra-AS routing efficiency while BGP manages inter-AS reachability across the internet.

ABR

Area Border Router connects areas to the backbone (Area 0).

BGP (Border Gateway Protocol)  

When to Use BGP

Warning

BGP misconfigurations can break parts of the Internet! Handle with care.

YAxIAxIAxeexoSSSSSBBuPPGGr65 A10 B20PP C0l0e0o01ptmhapaany

This multihoming diagram demonstrates redundancy through dual ISP connections: a company router connects to both ISP Alpha (AS 100, green) and ISP Beta (AS 200, orange) via separate eBGP connections, allowing traffic to the internet cloud to split between them. Both ISPs connect to the internet, providing path redundancy and load distribution. If one ISP link fails, traffic automatically reroutes through the other, ensuring business continuity. This architecture is typical of enterprises requiring high availability.

Multihoming

Connecting to multiple ISPs provides redundancy and load balancing.

Route Selection and Administrative Distance  

Routing Protocol Metrics

Protocol Metric
RIP Hop count
EIGRP Bandwidth + delay
OSPF Cost (bandwidth)
BGP Path attributes

What If Multiple Protocols?

When the same route is learned from different protocols, Administrative Distance decides which to trust.

Administrative Distance (AD)

Lower AD = more trusted

Route Source AD
Directly Connected 0
Static Route 1
EIGRP (internal) 90
OSPF 110
RIP 120
External EIGRP 170
Unknown 255

Example

If OSPF (AD 110) and RIP (AD 120) both know a route, OSPF wins!

Case Study: Inigo’s Path to Count Rugen  

Case Study: Inigo’s Path to Count Rugen
Inigo Montoya has configured routers to help him find Count Rugen (the six-fingered man). His router has learned two paths to Rugen’s network (10.20.30.0/24):

Protocol Next Hop Metric AD
OSPF 192.168.1.1 Cost: 20 110
RIP 192.168.2.1 Hops: 3 120

Both paths are currently working. Inigo needs to reach Rugen as quickly as possible!

Review Questions

1.

Which route will the router prefer and why?

2.

What is Administrative Distance and how does it apply here?

3.

If the OSPF path fails, what happens?

Case Study Solution: Inigo’s Path to Count Rugen  

Solution: Inigo’s Path to Count Rugen

1.

Router prefers OSPF route—AD of 110 beats RIP’s AD of 120.

2.

Administrative Distance is a “trustworthiness” rating. Lower AD = more trusted. When multiple protocols know a route, lowest AD wins.

3.

If OSPF fails, router automatically uses RIP route as backup!

xIxxOxRxRAAniSIuDDgoPPgFpen1112pat00ah(thbackup)

Key Lesson

“Hello. My name is Inigo Montoya...” Administrative Distance determines which protocol to trust. The backup route is ready if the primary fails!

4 Edge Services and Translation

4.1 NAT, PAT, and Firewalls

At the network edge, address translation and filtering enforce policy while enabling internal hosts to reach external networks.

Edge Routers and Network Boundaries  

Demarcation Point

The boundary where your network ends and the ISP’s begins. Usually at the edge router.

IxxxxxEDxIndeStgmPeear Rrc/noat Iauionltent NrPeeorntinewttork

Network Address Translation (NAT)  

NAT Terminology

x1PxNxIT2P92rAntr03u.ivTean.b16atrns0.lic8.eela111tte3.1s.50t0o

This NAT translation diagram illustrates the core concept: a PC on private network (192.168.1.10 on left, blue) connects through a NAT router to the internet. The green arrow labeled "Translates to" shows that the router dynamically rewrites the source address in outgoing packets, changing the private address to a public address (203.0.113.50, green) that the ISP assigned. Return traffic is automatically reverse-translated back to the private address. This allows multiple private devices to share a single public IP address, saving address space and providing network privacy.

Why NAT Matters

Your home network might have 20 devices, but your ISP only gives you one public IP. NAT makes this work!

NAT Types  

Static NAT

192.168.1.10 203.0.113.10

Dynamic NAT

S.1.5D.1.1.1.5.5.5PPt00y012012riuanvabltaticicmeiNcATNAT(1:1)(Pool )

This NAT types diagram compares two translation approaches: Static NAT (top, 1:1 mapping) translates one private IP (.10) to exactly one public IP (.50) with a fixed, permanent relationship—good for servers requiring consistent addresses. Dynamic NAT (bottom, pool) maps multiple private IPs (.10, .11, .12) to a pool of public IPs (.50, .51, .52) using temporary associations—when a device connects, it gets assigned the next available public IP, and when disconnected, that public IP returns to the pool. Both require sufficient public IPs; neither scales to thousands of devices on a single public address.

Limitation

Both Static and Dynamic NAT require one public IP per active connection. Not scalable!

PAT: Port Address Translation  

How PAT Works

1.

Host sends packet (src port 12345)

2.

Router changes src IP to public

3.

Router assigns unique port (e.g., 40001)

4.

Tracks mapping in NAT table

5.

Return traffic uses port to find host

 Same
x.1x.1x.1xPx222p012A030303ub:1:1:5T.0.0.0l224...ic343432111111I551333P.1.1.1!:4:4:4000000000123

This Port Address Translation (PAT) diagram illustrates how multiple private devices share a single public IP: three PCs (192.168.1.10:50001, 192.168.1.11:40002, 192.168.1.12:54321) all pass through a PAT router and emerge as port multiplexed connections under the same public IP (203.0.113.1) but with different port numbers (:40001, :40002, :40003). The red brace on the right emphasizes that all three distinct internal connections appear to the internet as one IP address with different ports. This is why home networks with  65,000 available ports can support thousands of simultaneous connections with just one public IP address.

Capacity

With  65,000 available ports, one public IP can support thousands of simultaneous connections!

Firewall Uses and Types  

What Firewalls Do

Default Behavior

Most firewalls: Deny all, permit by exception. Only explicitly allowed traffic passes.

Firewall Types

Trend

Modern networks use NGFW for comprehensive protection.

Firewall Placement and DMZ  

Placement Options

DMZ (Demilitarized Zone)

xIxDxWxMxDxIxxxOIntMeaNntunnerZbilSeteenrnrretaFFlWW LAN

Defense in Depth

Multiple firewall layers provide better protection than a single firewall.

5 VLAN Segmentation and Trunking

5.1 VLAN Design and Security

This section introduces VLAN segmentation, trunking, and security practices for multi-segment switched environments.

Introduction to VLANs  

Benefits of VLANs

xOxxVSxxVELnLaLnoeAleAggNsNinicealP12ersh00inepygasraitcioanl Switch

This VLAN isolation diagram shows a single physical switch (center) containing two logically separate networks: VLAN 10 Sales (blue, left with two PCs) and VLAN 20 Engineering (green, right with two PCs). Despite being on the same physical switch hardware, a red dashed line represents the logical separation—devices in VLAN 10 cannot communicate directly with VLAN 20 devices. This Layer 2 isolation provides network segmentation for security and traffic management, though cross-VLAN communication requires a Layer 3 router.

Key Point

VLANs create Layer 2 isolation. Cross-VLAN traffic requires Layer 3 routing!

VLAN Trunking and 802.1Q  

The Problem

How do VLANs span multiple switches? We need a way to carry VLAN info between switches.

Trunk Ports

Access vs Trunk

Access port: One VLAN, untagged Trunk port: Multiple VLANs, tagged

xSxSTxxVVxxVVwwrLLLLiiuAAAAtctcnkNNNNhh 1 2(81010202002.1Q)

This VLAN trunking diagram shows two physical switches (Switch 1 on left, Switch 2 on right) connected by a thick orange trunk link carrying both VLAN 10 (blue) and VLAN 20 (green) traffic simultaneously. Despite being on different physical switches, VLAN 10 devices on the left connect logically to VLAN 10 devices on the right, and VLAN 20 devices span both switches—maintaining logical separation across physical infrastructure. The 802.1Q protocol tags each frame with a 12-bit VLAN ID, allowing the trunk to multiplex multiple VLANs. This enables geographically distributed network segmentation where logically grouped devices remain isolated from other VLANs regardless of physical switch location.

802.1Q Tag

Adds 4-byte tag to Ethernet frame:

Voice VLANs  

Configuration Example

switchport mode access switchport access vlan 10 switchport voice vlan 50

OnVDeoiaceta
xSIxPVVcwPCLLaiPAAbthNNlecho!n51e00

This Voice VLAN diagram shows how a single cable can carry both voice and data traffic: an IP phone sits at the center with a switch connection above and a PC plugged into the phone below, using just one physical cable from switch to phone. The phone tags traffic as Voice VLAN 50 (orange) destined to the switch, while the PC’s data uses Data VLAN 10 (blue). The switch separates these two VLANs logically, giving voice traffic higher QoS priority. This converged network approach saves cabling costs and enables quality voice calls even when data traffic becomes heavy, as voice is sensitive to delay and jitter.

Why Separate?

Voice is sensitive to delay and jitter. Separating it ensures calls stay clear even when data traffic is heavy.

Native VLAN and Security  

What is Native VLAN?

Security Risk

Attackers can exploit native VLAN mismatches to hop between VLANs. This is called VLAN hopping. Best practices:

802.1Q
UDSTDGTDSTTDVnsrcyaoasrcayaLttptaegtgptaAaMMesgeNgAAtoegCCNdIDeadtivFerFVarLmaAemNe

This diagram contrasts untagged and tagged Ethernet frames: an untagged frame (top) carries only traditional Ethernet headers (Dst MAC, Src MAC, Type, Data) and is automatically assigned to the native VLAN when sent across a trunk. A tagged frame (bottom) inserts a 4-byte 802.1Q tag after the Src MAC field, containing the VLAN ID (12 bits) and Priority field (3 bits for QoS). Untagged frames bypass VLAN classification, while tagged frames are delivered to their specific VLAN. This mechanism allows switches to multiplex hundreds of VLANs across single trunk links by explicitly marking each frame with its VLAN membership.

Configuration

switchport trunk native vlan 999

VLAN 1 Concerns

VLAN 1 carries management traffic by default. Keep it separate from user data!

Case Study: Miracle Max’s Potion Shop  

Case Study: Miracle Max’s Potion Shop
Miracle Max runs a potion shop with three departments, each on its own VLAN:

Department VLAN Subnet
Potion Brewing VLAN 10 192.168.10.0/24
Customer Sales VLAN 20 192.168.20.0/24
Billing Office VLAN 30 192.168.30.0/24

The Sales team (192.168.20.50) needs to check inventory on the Brewing server (192.168.10.10), but their packets aren’t getting through!

Review Questions

1.

Why can’t Sales communicate directly with Brewing?

2.

What device is needed to enable this communication?

3.

What is this process called?

Case Study Solution: Miracle Max’s Potion Shop  

Solution: Miracle Max’s Potion Shop

1.

VLANs are separate broadcast domains—Layer 2 isolation prevents direct communication between VLANs.

2.

A router (or Layer 3 switch) is needed to route between VLANs.

3.

This is called inter-VLAN routing.

xxRTxBVxSVxBVorrLaLiLuueAleAllAtnkwNsNinNeingrg123000

Key Lesson

“Have fun storming the castle!” VLANs provide security through isolation, but inter-VLAN routing lets authorized traffic flow when needed.

Module Summary

Module 5.0 Summary  

Key Concepts:

VLANs & Network Design:

Conclusion

This module explored routing protocols, network address translation, firewalls, VLANs, and enterprise network design. You learned how routers make forwarding decisions, how dynamic routing protocols adapt to topology changes, how NAT/PAT conserve addresses, and how VLANs provide logical segmentation. In the next module, we’ll examine network services including DHCP and DNS.