Hero image for Advanced Routing Protocols: OSPF, BGP & RIP

Advanced Routing Protocols: OSPF, BGP & RIP

networking ccna routing infrastructure

Prerequisites: This article assumes familiarity with basic networking concepts (IP, LAN, WAN, Router). If you’re new to networking, start with SQL Server & Networking Fundamentals first.

Introduction: Why Do We Need Routing Protocols?

In the fundamentals article, we learned that a router is like a reception desk that forwards packets. But how does the router decide which path to take?

┌─────────────────────────────────────────────────────────────────┐
│                    The Routing Decision Problem                  │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│  Packet arrives: "I need to go to 203.0.113.50"                  │
│                                                                  │
│                    ┌─────────┐                                   │
│                    │ Router  │                                   │
│                    └────┬────┘                                   │
│                         │                                        │
│         ┌───────────────┼───────────────┐                        │
│         │               │               │                        │
│         ▼               ▼               ▼                        │
│    Path A           Path B          Path C                       │
│    (3 hops)         (5 hops)        (2 hops, but slow)           │
│                                                                  │
│    Which one should the router choose?                           │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Answer: Routing protocols help routers automatically discover networks and calculate the best path.


Static vs Dynamic Routing

Before diving into protocols, understand the two approaches:

TypeHow It WorksProsCons
Static RoutingAdmin manually configures each routeSimple, predictableDoesn’t adapt to failures
Dynamic RoutingRouters automatically share infoSelf-healing, scalableMore complex, uses bandwidth

When to use which?

  • Static: Small networks, stub networks, default routes
  • Dynamic: Large enterprises, ISPs, networks that change frequently

Part A: Interior Gateway Protocols (IGP)

IGPs operate within a single organization (Autonomous System).

1. RIP: Routing Information Protocol

The “Senior Citizen” of Routing Protocols (1988)

1.1 How RIP Works: Distance Vector

RIP uses the simplest metric: hop count (how many routers between here and destination).

┌─────────────────────────────────────────────────────────────────┐
│                    RIP: Hop Count Metric                         │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   Network A              Network B              Network C        │
│      │                      │                      │             │
│   ┌──▼──┐    1 hop     ┌────▼────┐    1 hop    ┌──▼──┐           │
│   │ R1  │◄────────────►│   R2    │◄───────────►│ R3  │           │
│   └─────┘              └─────────┘              └─────┘          │
│                                                                  │
│   From R1's perspective:                                         │
│   - Network B = 1 hop                                            │
│   - Network C = 2 hops                                           │
│                                                                  │
│   RIP always chooses the path with FEWEST hops                   │
│   (ignoring bandwidth!)                                          │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

1.2 RIP Characteristics

PropertyValue
MetricHop count (1-15, 16 = unreachable)
Max Hops15 (not suitable for large networks)
Update IntervalEvery 30 seconds (broadcasts entire routing table)
ConvergenceSlow (minutes)
AlgorithmBellman-Ford

1.3 RIP Versions

VersionKey Features
RIPv1Classful (no subnet mask), broadcast
RIPv2Classless (VLSM support), multicast, authentication
RIPngIPv6 support

1.4 RIP Limitations

Max 15 hops — Can’t handle large networks ❌ Slow convergence — Takes minutes to adapt to changes ❌ Ignores bandwidth — A 10 Gbps link counts the same as a 56 Kbps dial-up ❌ Broadcasts entire table — Wastes bandwidth every 30 seconds

RIP Today: Mostly seen in legacy systems or teaching labs. Its limitations (max 15 hops, slow convergence, ignoring bandwidth) are precisely WHY we study it — to understand how OSPF solved these problems.


2. OSPF: Open Shortest Path First

The “Industry Standard” for Enterprise Networks (1991)

Unlike RIP (which shares distance), OSPF routers share complete network topology.

┌─────────────────────────────────────────────────────────────────┐
│              OSPF: Link State Database (LSDB)                    │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   Every OSPF router builds a complete MAP of the network:        │
│                                                                  │
│   ┌─────────────────────────────────────────────────────┐        │
│   │              OSPF Router's Brain                     │       │
│   ├─────────────────────────────────────────────────────┤        │
│   │                                                      │       │
│   │   "I know the ENTIRE network topology:"             │        │
│   │                                                      │       │
│   │   R1 ──(10Gbps)── R2 ──(1Gbps)── R3                │         │
│   │    │                              │                 │        │
│   │    └────────(100Mbps)─────────────┘                 │        │
│   │                                                      │       │
│   │   Now I can calculate the BEST path myself!         │        │
│   │                                                      │       │
│   └─────────────────────────────────────────────────────┘        │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

2.2 OSPF Metric: Cost

OSPF uses cost based on bandwidth (higher bandwidth = lower cost = preferred).

Cost = Reference Bandwidth / Interface Bandwidth
Default Reference = 100 Mbps

Examples:
- 10 Mbps link:  100/10 = 10 (high cost)
- 100 Mbps link: 100/100 = 1 (medium cost)
- 1 Gbps link:   100/1000 = 0.1 → rounds to 1

Modern Problem: Default reference is 100 Mbps, so all links ≥100 Mbps have cost = 1. Admins often increase reference to 10 Gbps or 100 Gbps.

2.3 OSPF Neighbor Relationships

OSPF routers go through a state machine before exchanging routes:

┌─────────────────────────────────────────────────────────────────┐
│              OSPF Neighbor State Machine                         │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   Down → Init → 2-Way → ExStart → Exchange → Loading → Full      │
│                                                                  │
│   Key states:                                                    │
│   - 2-Way: "I see you, you see me" (Hello exchange)              │
│   - Full: Complete database synchronized (adjacency formed)      │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

2.4 OSPF Areas: Hierarchical Design

Large networks divide into areas for scalability:

┌─────────────────────────────────────────────────────────────────┐
│                    OSPF Area Design                              │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│                         Area 0                                   │
│                      (Backbone)                                  │
│                   ┌─────────────┐                                │
│                   │     ABR     │ ← Area Border Router           │
│            ┌──────┴──────┬──────┴──────┐                         │
│            │             │             │                         │
│         Area 1        Area 2        Area 3                       │
│        (Sales)      (Engineering)  (Finance)                     │
│                                                                  │
│   Rules:                                                         │
│   - All areas must connect to Area 0                             │
│   - ABRs summarize routes between areas                          │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

2.5 OSPF Packet Types

TypeNamePurpose
1HelloDiscover neighbors, maintain adjacency
2DBD (Database Description)Summarize LSDB contents
3LSR (Link State Request)Request specific LSAs
4LSU (Link State Update)Send LSA data
5LSAckAcknowledge LSU receipt

2.6 OSPF vs RIP Comparison

FeatureRIPOSPF
AlgorithmDistance Vector (Bellman-Ford)Link State (Dijkstra SPF)
MetricHop countCost (bandwidth-based)
Max Network Size15 hopsVirtually unlimited
ConvergenceSlow (minutes)Fast (seconds)
Bandwidth UsageHigh (full table every 30s)Low (updates only on changes)
VLSM SupportRIPv2 onlyYes
HierarchicalNoYes (areas)

🌟 Honorable Mention: IS-IS (Intermediate System to Intermediate System)

While OSPF dominates enterprise networks, IS-IS is making a strong comeback in:

  • 🏢 Hyperscale Data Centers (Facebook, Microsoft) — better scalability
  • 🌐 SDN/VXLAN Underlay (Cisco ACI, VMware NSX) — native multi-topology support
  • 📡 ISP Backbones — vendor-neutral, IPv6-friendly

IS-IS and OSPF are functionally similar (both link-state), but IS-IS runs directly on Layer 2, making it protocol-agnostic.


3. EIGRP: Enhanced Interior Gateway Routing Protocol

Cisco’s Proprietary Hybrid Protocol (now open standard)

3.1 EIGRP: Best of Both Worlds

EIGRP combines distance vector simplicity with link state efficiency.

FeatureEIGRP
MetricComposite (bandwidth + delay by default)
AlgorithmDUAL (Diffusing Update Algorithm)
ConvergenceVery fast (sub-second with feasible successors)
Loop PreventionFeasibility condition
UpdatesPartial, bounded (only changes to affected neighbors)

3.2 EIGRP Metric Calculation

Metric = [K1×Bandwidth + K2×Bandwidth/(256-Load) + K3×Delay] × [K5/(Reliability+K4)]

Default K values: K1=1, K2=0, K3=1, K4=0, K5=0
Simplified:       Metric = Bandwidth + Delay

3.3 Successor and Feasible Successor

┌─────────────────────────────────────────────────────────────────┐
│              EIGRP: Backup Path Ready                            │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   Destination: 10.0.0.0/8                                        │
│                                                                  │
│   ┌─────────────────────────────────────────┐                    │
│   │ Successor (Primary Path)                │                    │
│   │ via R2, Metric: 1000                    │ ← Used now         │
│   └─────────────────────────────────────────┘                    │
│                                                                  │
│   ┌─────────────────────────────────────────┐                    │
│   │ Feasible Successor (Backup)             │                    │
│   │ via R3, Metric: 1500                    │ ← Ready to use     │
│   └─────────────────────────────────────────┘                    │
│                                                                  │
│   If R2 fails → Instantly switch to R3 (no recalculation!)       │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Part B: Exterior Gateway Protocols (EGP)

EGPs operate between organizations (Autonomous Systems).

4. BGP: Border Gateway Protocol

The “Glue” That Holds the Internet Together

4.1 What Is an Autonomous System (AS)?

An AS is a network under a single administrative domain with a unique AS Number (ASN).

TypeExample
ISPChunghwa Telecom (AS3462), Google (AS15169)
EnterpriseLarge companies with their own IP blocks
Content ProviderNetflix, Facebook

4.2 BGP’s Role

┌─────────────────────────────────────────────────────────────────┐
│              BGP: Internet Routing Between ISPs                  │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│      AS 64501              AS 64502              AS 64503        │
│    ┌─────────┐           ┌─────────┐           ┌─────────┐       │
│    │  ISP A  │◄─────────►│  ISP B  │◄─────────►│  ISP C  │       │
│    │         │   eBGP    │         │   eBGP    │         │       │
│    └─────────┘           └─────────┘           └─────────┘       │
│                                                                  │
│    BGP exchanges:                                                │
│    - Reachability info: "I can reach 203.0.113.0/24"             │
│    - Path attributes: "Go through AS64501 → AS64502"             │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

4.3 iBGP vs eBGP

TypeMeaningWhere
eBGPExternal BGPBetween different AS (inter-AS)
iBGPInternal BGPWithin same AS (distribute eBGP routes internally)

4.4 BGP Path Selection (Simplified)

BGP doesn’t use “shortest path.” It uses a sequence of tiebreakers:

  1. Highest Weight (Cisco-specific, local preference)
  2. Highest Local Preference
  3. Locally Originated (routes from this router)
  4. Shortest AS Path ← Most important tiebreaker
  5. Lowest Origin Type (IGP < EGP < Incomplete)
  6. Lowest MED (Multi-Exit Discriminator)
  7. eBGP over iBGP
  8. Lowest IGP metric to next hop
  9. Oldest route
  10. Lowest Router ID

4.5 BGP Attributes

AttributeDescription
AS_PATHList of ASes the route has traversed
NEXT_HOPIP address of next-hop router
LOCAL_PREFPreference within AS (higher = better)
MEDHint to external neighbors (lower = better)
ORIGINHow the route was learned (IGP, EGP, or incomplete)

4.6 Why BGP Is Special

FeatureIGPs (OSPF, RIP)BGP
ScopeWithin one organizationBetween organizations
GoalFastest pathPolicy-based routing
Decides based onMetrics (cost, hops)Business relationships
ScaleThousands of routes900,000+ routes (full Internet)

4.7 Useful BGP Tools

ToolURLUse Case
HE BGP Toolkitbgp.he.netLook up AS numbers, IP prefixes, peering info
CAIDAcaida.orgInternet topology research, AS relationship datasets

Try it: Search for your ISP’s AS number at bgp.he.net. For example, AS3462 shows Chunghwa Telecom’s BGP routing table and peers.


Part C: Protocol Comparison Summary

Quick Reference Table

ProtocolTypeAlgorithmMetricConvergenceBest For
RIPIGP, DVBellman-FordHop countSlowLegacy, small networks
OSPFIGP, LSDijkstraCost (bandwidth)FastEnterprise networks
EIGRPIGP, HybridDUALCompositeVery fastCisco environments
BGPEGP, PVBest Path SelectionPolicy-basedSlow (by design)Internet, ISPs

When to Use What?

┌─────────────────────────────────────────────────────────────────┐
│              Routing Protocol Decision Tree                      │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   Is it between different organizations (ASes)?                  │
│       │                                                          │
│     Yes ─── BGP                                                  │
│       │                                                          │
│      No                                                          │
│       │                                                          │
│   Is it a Cisco-only environment?                                │
│       │                                                          │
│     Yes ─── EIGRP                                                │
│       │                                                          │
│      No                                                          │
│       │                                                          │
│   Is it a small/legacy network?                                  │
│       │                                                          │
│     Yes ─── RIP (simple)                                         │
│       │                                                          │
│      No ─── OSPF (standard)                                      │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Part D: Layer 2 Technologies

5. STP: Spanning Tree Protocol

The “Loop Killer” for Switched Networks

5.1 The Problem: Layer 2 Loops

Redundant switches are good for failover, but they create broadcast storms and MAC address table instability.

┌─────────────────────────────────────────────────────────────────┐
│              Layer 2 Loop Problem                                │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│       Switch A ◄───────────────────────► Switch B                │
│          │                                    │                  │
│          └────────────► Switch C ◄────────────┘                  │
│                                                                  │
│   Without STP: Broadcast frames loop forever!                    │
│   Frame: A → B → C → A → B → C → A... (infinite loop)            │
│   Result: Network crashes in seconds                             │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

5.2 How STP Works

STP blocks redundant paths while keeping them ready for failover.

┌─────────────────────────────────────────────────────────────────┐
│              STP: Blocking Redundant Paths                       │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│       Switch A (Root Bridge)                                     │
│          │                │                                      │
│     Forwarding        Forwarding                                 │
│          │                │                                      │
│       Switch B ──────── Switch C                                 │
│                ↑                                                 │
│             BLOCKED                                              │
│         (backup path)                                            │
│                                                                  │
│   If A-B link fails → B-C unblocks automatically                 │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

5.3 STP Port States

StateDurationSends/Receives Data?
Blocking20 secNo (listening for BPDUs)
Listening15 secNo (participating in election)
Learning15 secNo (building MAC table)
Forwarding-Yes (normal operation)
Disabled-No (admin shutdown)

5.4 STP Versions

VersionStandardConvergenceKey Feature
STP (802.1D)Original30-50 secBasic loop prevention
RSTP (802.1w)Rapid1-5 secFast port state changes
MSTP (802.1s)Multiple1-5 secMultiple instances per VLAN
PVST+Cisco30-50 secPer-VLAN STP
Rapid PVST+Cisco1-5 secPer-VLAN RSTP

6. HSRP/VRRP: Gateway Redundancy

“What if the default gateway dies?“

6.1 The Problem: Single Point of Failure

┌─────────────────────────────────────────────────────────────────┐
│              Single Gateway = Single Point of Failure            │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│                    ┌─────────┐                                   │
│                    │ Router  │ ← If this dies...                 │
│                    └────┬────┘                                   │
│                         │                                        │
│            ┌────────────┼────────────┐                           │
│            │            │            │                           │
│         PC1          PC2          PC3                            │
│                                                                  │
│   All PCs configured: Default Gateway = 192.168.1.1              │
│   Router dies → All PCs lose Internet (even if backup exists)    │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

6.2 Solution: Virtual IP (VIP)

HSRP/VRRP creates a virtual gateway shared by multiple routers.

┌─────────────────────────────────────────────────────────────────┐
│              HSRP: Virtual Gateway                               │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   Router A (Active)        Router B (Standby)                    │
│   Physical: 192.168.1.2    Physical: 192.168.1.3                 │
│        │                        │                                │
│        └────────┬───────────────┘                                │
│                 │                                                │
│     Virtual IP: 192.168.1.1 (shared)                             │
│                 │                                                │
│            ┌────┴────┐                                           │
│            │ Switch  │                                           │
│            └────┬────┘                                           │
│                 │                                                │
│    PC Default Gateway: 192.168.1.1 (never changes)               │
│                                                                  │
│    If Router A dies → Router B takes over 192.168.1.1            │
│    PCs don't notice any change!                                  │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

6.3 HSRP vs VRRP vs GLBP

ProtocolVendorLoad BalancingActive/Standby
HSRPCiscoNo (1 active, 1 standby)Yes
VRRPStandard (RFC 5798)NoYes
GLBPCiscoYes (multiple active)Multiple active

Part E: Modern Networking

7. SDN: Software-Defined Networking

Separating the “Brain” from the “Muscle”

7.1 Traditional vs SDN

┌─────────────────────────────────────────────────────────────────┐
│              Traditional vs SDN Architecture                     │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   TRADITIONAL                         SDN                        │
│   ───────────                         ───                        │
│                                                                  │
│   Each device has                     Central controller         │
│   its own brain:                      has ALL brains:            │
│                                                                  │
│   ┌───────┐ ┌───────┐                    ┌─────────────┐         │
│   │Router1│ │Router2│                    │ Controller  │         │
│   │ Brain │ │ Brain │                    │ (OpenFlow)  │         │
│   │+Muscle│ │+Muscle│                    └──────┬──────┘         │
│   └───────┘ └───────┘                           │                │
│                                         ┌───────┼───────┐        │
│                                         │       │       │        │
│                                      ┌──▼──┐ ┌──▼──┐ ┌──▼──┐     │
│                                      │Dumb │ │Dumb │ │Dumb │     │
│                                      │Switch│ │Switch│ │Switch│  │
│                                      └─────┘ └─────┘ └─────┘     │
│                                                                  │
│   Config: Device by device            Config: One place          │
│   Slow to change                      Programmable, agile        │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

7.2 SDN Layers

LayerNameFunction
ApplicationApps/OrchestrationNetwork applications, automation scripts
ControlSDN ControllerCentral brain (e.g., OpenDaylight, Cisco ACI)
InfrastructureData PlaneSwitches/routers that forward packets

7.3 OpenFlow Protocol

OpenFlow is the most common protocol between controller and switches:

Message TypeDirectionPurpose
Packet-InSwitch → Controller”I don’t know what to do with this packet”
Flow-ModController → Switch”Here’s a new rule for your flow table”
Packet-OutController → Switch”Send this packet out port X”

7.4 Overlay vs Underlay: The Modern Data Center Architecture

Modern SDN separates the network into two layers:

┌─────────────────────────────────────────────────────────────────┐
│              Overlay vs Underlay Architecture                    │
├─────────────────────────────────────────────────────────────────┤
│                                                                  │
│   OVERLAY (Virtual Network)                                      │
│   ────────────────────────                                       │
│   • VXLAN tunnels creating virtual Layer 2 across sites          │
│   • Software-defined, flexible, tenant-aware                     │
│   • "What the application sees"                                  │
│                                                                  │
│   ┌─────────────────────────────────────────────────────────────┐│
│   │  VM1 ◄───── VXLAN Tunnel (VNI 1001) ─────► VM2              ││
│   │  10.1.1.10                                 10.1.1.20        ││
│   └─────────────────────────────────────────────────────────────┘│
│                          │                                       │
│   UNDERLAY (Physical Network)                                    │
│   ────────────────────────                                       │
│   • Traditional OSPF/BGP/IS-IS routing                           │
│   • Pure IP connectivity between switches                        │
│   • "The plumbing underneath"                                    │
│                                                                  │
│   ┌─────────────────────────────────────────────────────────────┐│
│   │  Leaf1 ◄────── OSPF/BGP (192.168.x.x) ──────► Leaf2         ││
│   └─────────────────────────────────────────────────────────────┘│
│                                                                  │
│   Key Insight: OSPF/BGP builds the highway, VXLAN runs the cars  │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘
LayerProtocolPurpose
OverlayVXLAN, GRE, GENEVEVirtual network fabric (software-defined)
UnderlayOSPF, BGP, IS-ISPhysical IP reachability (simple, stable)

8. Network Automation with Python

“If you’re configuring 100 devices manually, you’re doing it wrong.”

8.1 Why Automate?

Manual ConfigurationAutomation
100 devices × 5 min = 500 min100 devices × 5 sec = 8 min
Human errorsConsistent results
No audit trailVersion-controlled changes
Can’t scaleScales infinitely

8.2 Python Libraries for Networking

LibraryPurposeExample Use
NetmikoSSH to network devicesConfigure routers via CLI
ParamikoLow-level SSHRaw SSH connections
NAPALMMulti-vendor abstractionGet/set config across vendors
NornirAutomation frameworkLarge-scale orchestration
AnsibleDeclarative automationPlaybooks for network config

8.3 Example: Netmiko Script

from netmiko import ConnectHandler

# Connect to Cisco router
device = {
    'device_type': 'cisco_ios',
    'host': '192.168.1.1',
    'username': 'admin',
    'password': 'secret123',
}

connection = ConnectHandler(**device)

# Send commands
output = connection.send_command('show ip interface brief')
print(output)

# Configure interface
config_commands = [
    'interface GigabitEthernet0/1',
    'description Connected to Core Switch',
    'ip address 10.0.0.1 255.255.255.0',
    'no shutdown'
]
connection.send_config_set(config_commands)

connection.disconnect()

8.4 APIs and REST

Modern devices support REST APIs instead of CLI:

GET /restconf/data/interfaces  → Returns JSON of all interfaces
PUT /restconf/data/interfaces/interface=Gi0/1  → Updates interface config

9. Cloud Networking

Networks in AWS, Azure, GCP

9.1 Key Cloud Networking Concepts

ConceptCloud TermTraditional Equivalent
Virtual NetworkVPC (AWS), VNet (Azure)Physical LAN
SubnetSubnetSame
Internet GatewayIGWEdge router
NAT GatewayNAT GWNAT router
Security GroupSGPer-instance firewall
Network ACLNACLStateless subnet firewall
Load BalancerELB, ALBF5, Citrix
VPN GatewayVPN GWVPN concentrator
Direct ConnectDirect Connect (AWS), ExpressRoute (Azure)MPLS leased line

9.2 Hub-and-Spoke: Transit Gateway Architecture

As organizations grow, connecting multiple VPCs becomes complex. Transit Gateway is the modern solution:

┌─────────────────────────────────────────────────────────────────┐
│              Transit Gateway: Hub-and-Spoke                      │
├─────────────────────────────────────────────────────────────────┤
│                         BEFORE                                   │
│   ┌─────┐    ┌─────┐    ┌─────┐    Full mesh = N×(N-1)/2 links! │
│   │VPC A│◄──►│VPC B│◄──►│VPC C│    3 VPCs = 3 links             │
│   └──┬──┘    └──┬──┘    └──┬──┘    10 VPCs = 45 links (chaos!)  │
│      └──────────┴──────────┘                                     │
│                                                                  │
│                          AFTER                                   │
│   ┌─────┐     ┌─────┐     ┌─────┐                                │
│   │VPC A│     │VPC B│     │VPC C│                                │
│   └──┬──┘     └──┬──┘     └──┬──┘                                │
│      │           │           │                                   │
│      └───────────┼───────────┘                                   │
│                  │                                               │
│           ┌──────▼──────┐                                        │
│           │Transit Gate │     One hub, all VPCs connect here     │
│           │   (Hub)     │     Also connects to on-prem VPN!      │
│           └─────────────┘                                        │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘
ServiceAWSAzureGCP
Transit HubTransit GatewayVirtual WANCloud Router
On-Prem VPNSite-to-Site VPNVPN GatewayCloud VPN
Dedicated LineDirect ConnectExpressRouteCloud Interconnect

Modern Pattern: Use Transit Gateway as the central hub, attach all VPCs, site-to-site VPN, and Direct Connect to it. Simplifies routing and security policies.

9.3 VPC Architecture

┌─────────────────────────────────────────────────────────────────┐
│                    AWS VPC Example                               │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   VPC: 10.0.0.0/16                                               │
│   ┌───────────────────────────────────────────────────────────┐  │
│   │                                                            │ │
│   │   Public Subnet (10.0.1.0/24)                             │  │
│   │   ┌──────────┐  ┌──────────┐                              │  │
│   │   │ Web EC2  │  │ Web EC2  │ ← Internet-facing           │   │
│   │   └──────────┘  └──────────┘                              │  │
│   │         │                                                  │ │
│   │   Internet Gateway ←───────────────────► Internet         │  │
│   │                                                            │ │
│   ├────────────────────────────────────────────────────────────┤ │
│   │                                                            │ │
│   │   Private Subnet (10.0.2.0/24)                            │  │
│   │   ┌──────────┐  ┌──────────┐                              │  │
│   │   │ App EC2  │  │   RDS    │ ← No direct Internet access │   │
│   │   └──────────┘  └──────────┘                              │  │
│   │         │                                                  │ │
│   │   NAT Gateway ───────────────────────► Internet (outbound)│  │
│   │                                                            │ │
│   └───────────────────────────────────────────────────────────┘  │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

9.4 Hybrid Cloud Connectivity

MethodLatencyBandwidthCostSecurity
Site-to-Site VPNVariableLimited by internetLowEncrypted
Direct Connect/ExpressRouteLow, consistentUp to 100 GbpsHighPrivate (not encrypted by default)

Part F: Troubleshooting & QoS

10. Network Troubleshooting Methodology

10.1 OSI-Based Troubleshooting

LayerCheckCommands
1 (Physical)Cable, port lightsVisual inspection
2 (Data Link)MAC address, VLANshow mac address-table, show vlan
3 (Network)IP, routingping, traceroute, show ip route
4 (Transport)Port, firewalltelnet host port, netstat
7 (Application)Service, DNSnslookup, curl, logs

10.2 Common Issues Checklist

SymptomLikely CauseQuick Check
No connectivityCable, port downCheck lights, show interface status
Intermittent dropsDuplex mismatch, CRC errorsshow interface → check errors
Can ping IP, not nameDNS issuenslookup
Slow speedsCongestion, QoSshow interface → high utilization
Routing loopMisconfigured routetraceroute shows repeating hops

11. QoS: Quality of Service (Advanced)

Note: Basic QoS was covered in the Networking Fundamentals article.

11.1 QoS Mechanisms

MechanismPurpose
ClassificationIdentify traffic types (DSCP, CoS)
MarkingTag packets with priority
QueuingDecide which packets go first (WFQ, LLQ, CBWFQ)
PolicingDrop excess traffic (hard limit)
ShapingBuffer excess traffic (smooth output)

11.2 DSCP Values

DSCPPHBTypical Use
EF (46)Expedited ForwardingVoice (highest priority)
AF41 (34)Assured ForwardingVideo conferencing
AF21 (18)Assured ForwardingTransactional data
CS0 (0)Best EffortDefault (no priority)

11.3 QoS Trust Boundaries

┌─────────────────────────────────────────────────────────────────┐
│              QoS Trust Boundary                                  │
├─────────────────────────────────────────────────────────────────┤ 
│                                                                  │
│   PC (Untrusted)           Access Switch          Distribution   │
│   ┌─────────┐              ┌──────────┐          ┌──────────┐    │
│   │ Marks   │──────────────│ Remarking│──────────│  Trusted │    │
│   │ EF      │              │ to BE    │          │          │    │
│   └─────────┘              └──────────┘          └──────────┘    │
│                                                                  │
│   IP Phone (Trusted)       Access Switch                         │
│   ┌─────────┐              ┌──────────┐                          │
│   │ Marks   │──────────────│  Trust   │                          │
│   │ EF      │              │  DSCP    │                          │
│   └─────────┘              └──────────┘                          │
│                                                                  │
│   Don't trust random PCs marking their own traffic as EF!        │
│                                                                  │
└─────────────────────────────────────────────────────────────────┘

Appendix: Key Terms

TermDefinition
Autonomous System (AS)Network under single administrative control
IGPInterior Gateway Protocol (within one AS)
EGPExterior Gateway Protocol (between ASes)
Distance VectorShare distance and direction to destinations
Link StateShare complete network topology
ConvergenceTime for all routers to agree on network state
Administrative DistanceTrustworthiness of routing source (lower = more trusted)
STPSpanning Tree Protocol (loop prevention)
HSRPHot Standby Router Protocol (gateway redundancy)
SDNSoftware-Defined Networking
VPCVirtual Private Cloud

Administrative Distance Values

SourceAD
Directly connected0
Static route1
EIGRP summary5
eBGP20
EIGRP90
OSPF110
RIP120
iBGP200
Unknown255 (never used)

Series Navigation

This article is part of the Networking series:

  1. SQL Server & Networking Fundamentals — Basics
  2. Advanced Routing Protocols: OSPF, BGP & RIP ← You are here