Routing Basics
Enterprise Network 101 Workshop
A day in a life of a router
• find path
• forward packet, forward packet, forward packet, forward
packet...
• find alternate path
• forward packet, forward packet, forward packet, forward
packet…
• repeat until powered off
Routing versus Forwarding
• Routing = building maps
and giving directions
• Forwarding = moving
packets between interfaces
according to the
“directions”
IP route lookup
• Matches a prefix of destination IP address (first N bits)
• “Longest match” wins
– More specific prefix preferred over less specific prefix
– Example: packet with destination of 172.16.1.1 follows the route for 172.16.1.0/24 rather than the one for 172.16.0.0/16.
IP route lookup:�Longest match routing
IP route lookup:�Longest match routing
IP route lookup:�Longest match routing
RIBs and FIBs
• FIB is the Forwarding Table
– It contains destinations and the interfaces to get to those destinations
– Used by the router to figure out where to send the packet
– Careful! Some people still call this a route!
• RIB is the Routing Table
– It contains a list of all the destinations and the various next hops used to get to those destinations – and lots of other information too!
– One destination can have lots of possible next-hops – only the best
next-hop goes into the FIB
Default route
• Default route has a prefix length of zero
– IPv4 0.0.0.0/0
– IPv6 ::/0
• The shortest possible; only ever matches if no other route
matches
• Sometimes called the "gateway of last resort"
Egress Traffic
• How packets leave your network
• Egress traffic depends on:
– route availability (what others send you)
– route acceptance (what you accept from others)
– policy and tuning (what you do with routes from others)
– Peering and transit agreements
Ingress Traffic
• How packets get to your network and your customers’
networks
• Ingress traffic depends on:
– what information you send and to whom
– based on your addressing and AS’s
– based on others’ policy (what they accept from you and what they do with it)
Autonomous System (AS)
• Collection of networks with same routing policy
• Single routing protocol
• Usually under single ownership, trust and administrative
control
Definition of terms
• Neighbors
– AS’s which directly exchange routing information
– Routers which exchange routing information
• Announce
– send routing information to a neighbor
• Accept
– receive and use routing information sent by a neighbor
• Originate
– insert routing information into external announcements (usually as a
result of the IGP)
• Peers
– routers in neighboring AS’s or within one AS which exchange routing
and policy information
Routing Policy
• Used to control traffic flow in and out of an ISP network
• ISP makes decisions on what routing information to accept
and discard from its neighbours
– Individual routes
– Routes originated by specific ASes
– Routes traversing specific ASes
– Routes belonging to other groupings
Groupings which you define as you see fit
Static and Dynamic Routing
Routing Protocols
• Routers use “routing protocols” to exchange routing
information with each other
– IGP is used to refer to the process running on routers inside an ISP’s network
– EGP is used to refer to the process running between routers
bordering directly connected ISP networks
What Is an IGP?
• Interior Gateway Protocol
• Within an Autonomous System
• Carries information about internal infrastructure prefixes
• Two widely used IGPs in service provider network:
– OSPF
– ISIS
Why Do We Need an IGP?
• ISP backbone scaling
– Hierarchy
– Limiting scope of failure
– Only used for ISP’s infrastructure addresses, not customers or
anything else
– Design goal is to minimize number of prefixes in IGP to aid scalability and rapid convergence
What Is an EGP?
• Exterior Gateway Protocol
• Used to convey routing information between Autonomous
Systems
• De-coupled from the IGP
• Current EGP is BGP
Why Do We Need an EGP?
• Scaling to large network
– Hierarchy
– Limit scope of failure
• Define Administrative Boundary
• Policy
– Control reachability of prefixes
– Merge separate organizations
– Connect multiple IGPs
Interior versus Exterior�Routing Protocols
Hierarchy of Dynamic Routing Protocols
OSPF (Open Shortest Path First)
OSPF (Open Shortest Path First)
Overview of OSPF Operation
BGP (Border Gateway Protocol)
eBGP vs iBGP
BGP Attributes
BGP attributes are specific characteristics or properties associated with BGP routes that influence routing decisions. They are used by BGP routers to select the best path for forwarding traffic across different autonomous systems (ASes).
Why BGP Attributes Are Used:
Path Selection: BGP attributes are crucial in helping routers choose the most optimal path for routing packets between different autonomous systems (ASes).�
Traffic Control: They allow network administrators to define policies to control how traffic is routed, helping with traffic engineering and security.�
Routing Decision Process: BGP uses these attributes (like AS Path, Next Hop, Local Preference, etc.) to evaluate and compare different routes and select the best one.�
Flexibility: By manipulating BGP attributes, administrators can prioritize routes, avoid certain networks, or manage failovers and backups
Key BGP Attributes
AS Path: Prevents routing loops and helps determine the "distance" to a destination.�
Next Hop: The next router to forward the traffic to.�
Local Preference: Determines the preferred route within an AS.�
MED (Multi-Exit Discriminator): Suggests preferred exit points from an AS to neighboring ASes.�
Communities: Tags that help apply routing policies.
BGP Attributes – The DNA of Routing Decisions
Attribute | Purpose | Type |
NEXT_HOP | IP of the next router to reach route | Mandatory |
AS_PATH | List of ASes the route passed | Mandatory |
LOCAL_PREF | Preference for outbound routes | Optional |
MED | Suggests preferred inbound path | Optional |
ORIGIN | How the route was learned (IGP, EGP) | Mandatory |
COMMUNITY | Tags for grouping & filtering routes | Optional |
BGP Attributes Illustration
Where the attributes show up (and what they mean)
BGP Attributes Hierarchy
Weight > Local Preference > Locally Originated > AS Path > Origin > MED > eBGP over iBGP > IGP Metric to Next-Hop > Oldest Path > Router ID > Neighbor IP
Questions?