1 of 37

Routing Basics

Enterprise Network 101 Workshop

2 of 37

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

3 of 37

Routing versus Forwarding

• Routing = building maps

and giving directions

• Forwarding = moving

packets between interfaces

according to the

“directions”

4 of 37

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.

5 of 37

IP route lookup:�Longest match routing

6 of 37

IP route lookup:�Longest match routing

7 of 37

IP route lookup:�Longest match routing

8 of 37

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

9 of 37

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"

10 of 37

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

11 of 37

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)

12 of 37

Autonomous System (AS)

• Collection of networks with same routing policy

• Single routing protocol

• Usually under single ownership, trust and administrative

control

13 of 37

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

14 of 37

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

15 of 37

Static and Dynamic Routing

    • Static Routing: Manual entry for every IP networks need to be done for every router in the routing domain. It doesn’t adapt to network changes automatically

    • Dynamic Routing: Routers learns about the IP networks from other routers using some protocols ( like OSPF,IS-IS,BGP, etc…). It is adaptive to network changes without intervention of the network administrator.

16 of 37

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

17 of 37

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

18 of 37

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

19 of 37

What Is an EGP?

Exterior Gateway Protocol

• Used to convey routing information between Autonomous

Systems

• De-coupled from the IGP

• Current EGP is BGP

20 of 37

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

21 of 37

Interior versus Exterior�Routing Protocols

22 of 37

Hierarchy of Dynamic Routing Protocols

23 of 37

OSPF (Open Shortest Path First)

  • OSPF is a Open-Standard, Link-State routing protocol.�
  • The AD (Administrative Distance) value of OSPF is 110.�
  • OSPF uses the Dijkstra Shortest Path First Algorithm (SPF) to find the shortest path for a given node/Router.�
  • Link state routing protocols learns more information about the structure of the network and thus can make more informed routing decisions.

24 of 37

OSPF (Open Shortest Path First)

  • The OSPF routers maintain a detailed and current map of the whole network topology.�
  • OSPF hierarchical design organizes the network into areas, with the backbone area(Area 0) connecting to all other non-backbone areas.�
  • The phenomenon of hierarchical design facilitates efficient scaling, reduces the impact of changes, and enables routers/nodes to maintain detailed information about their local area while summarizing the information about other areas, promoting fast convergence and streamlined routing.

25 of 37

Overview of OSPF Operation

26 of 37

BGP (Border Gateway Protocol)

  • BGP is the only EGP (Exterior Gateway Protocol).
  • BGP is considered as “Path Vector” Routing Protocol.
  • BGP utilizes the TCP for reliable delivery of its packets on,port 179.
  • There can be two types of BGP neighborship.
    • iBGP - BGP neighborship within the same autonomous system (i.e. Local and remote-asn is same).
    • eBGP - BGP neighborship with different autonomous system (i.e. Local and remote-asn is different).

27 of 37

eBGP vs iBGP

28 of 37

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).

29 of 37

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

30 of 37

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.

31 of 37

32 of 37

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

33 of 37

BGP Attributes Illustration

34 of 37

Where the attributes show up (and what they mean)

35 of 37

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

36 of 37

Questions?

37 of 37