routing basics• routing table entry (the path) is created by the administrator (static) or...

39
Routing Basics Campus Network Design & Operations Workshop These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International license (http://creativecommons.org/licenses/by-nc/4.0/) Last updated 12 th December 2018

Upload: others

Post on 17-Jan-2020

9 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Routing Basics

Campus Network Design & Operations Workshop

These materials are licensed under the Creative Commons Attribution-NonCommercial 4.0 International license(http://creativecommons.org/licenses/by-nc/4.0/)

Last updated 12th December 2018

Page 2: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Routing Concepts

• Routers• Routing• Forwarding• Some definitions• Routing Protocols

Page 3: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

• A router is a layer 3 device• Used for interconnecting networks at layer 3• A router generally has at least two interfaces

– With VLANs a router can have only one interface (known as “router on a stick”)

• A router looks at the destination address in the IP packet, and decides how to forward it

What is a Router?

Page 4: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

The Routing Table

• Each router/host has a routing table, indicating the path or the next hop for a given destination host or a network

• The router/host tries to match the destination address of a packet against entries in the routing table

• If there is a match, the router forwards it to the corresponding gateway router or directly to the destination host

• Default route is taken if no other entry matches the destination address

Page 5: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

The Routing Table

Destination Next-Hop Interface

10.40.0.0/16 192.248.40.60 Ethernet0

192.248.0.140/30 Directly connected Serial1

192.248.40.0/26 Directly connected Ethernet0

192.248.0.0/17 192.248.0.141 Serial1

203.94.73.202/32 192.248.40.3 Ethernet0

203.115.6.132/30 Directly connected Serial0

Default 203.115.6.133 Serial0

Typical routing table on a simple edge router

Page 6: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

IP Routing – finding the path

• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic)

• More than one routing protocol may run on a router– Each routing protocol builds its own routing table (Local RIB)

• Several alternative paths may exist– Best path selected for the router’s Global routing table (RIB)

• Decisions are updated periodically or as topology changes (event driven)

• Decisions are based on:– Topology, policies and metrics (hop count, filtering, delay, bandwidth, etc.)

Page 7: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

IP route lookup

• Based on destination IP address• “longest match” routing

– More specific prefix preferred over less specific prefix– Example: packet with destination of 2001:DB8:1::1/128 is sent to the

router announcing 2001:DB8:1::/48 rather than the router announcing 2001:DB8::/32.

Page 8: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

IP route lookup

• Based on destination IP address

2001:DB8::/32 announced from here

2001:DB8:1::/48 announced from

here

Packet: DestinationIP address: 2001:DB8:1::1

2001:DB8::/32 R3

2001:DB8:1::/48 R4

2001:DB9::/32 R5

2001:DBA::/32 R6……

R2’s routing table

R1 R2

R3

R4

Page 9: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

2001:DB8::/32 R32001:DB8:1::/48 R42001:DB9::/32 R52001:DBA::/32 R6……

IP route lookup:Longest match routing

• Based on destination IP address

R2’s IP routing table2001:DB8:1::1 && FFFF:FFFF:: vs.2001:DB8:: && FFFF:FFFF::

Match!

2001:DB8::/32 announced from here

2001:DB8:1::/48 announced from

here

R1 R2

R3

R4

Packet: DestinationIP address: 2001:DB8:1::1

Page 10: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

2001:DB8::/32 R32001:DB8:1::/48 R42001:DB9::/32 R52001:DBA::/32 R6……

IP route lookup:Longest match routing

• Based on destination IP address

Match as well!

2001:DB8::/32 announced from here

2001:DB8:1::/16 announced from

here

R1 R2

R3

R4

Packet: DestinationIP address: 2001:DB8:1::1

R2’s IP routing table

2001:DB8:1::1 && FFFF:FFFF:FFFF:: vs.2001:DB8:1:: && FFFF:FFFF:FFFF::

Page 11: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

IP route lookup:Longest match routing

• Based on destination IP address

2001:DB8::/32 R32001:DB8:1::/48 R42001:DB9::/32 R52001:DBA::/32 R6……

Does not match!

2001:DB8::/32 announced from here

2001:DB8:1::/48 announced from

here

R1 R2

R3

R4

Packet: DestinationIP address: 2001:DB8:1::1

R2’s IP routing table

2001:DB8:1::1 && FFFF:FFFF:: vs.2001:DB9:: && FFFF:FFFF::

Page 12: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

2001:DB8::/32 R32001:DB8:1::/48 R42001:DB9::/32 R52001:DBA::/32 R6……

IP route lookup:Longest match routing

• Based on destination IP address

Does not match!

2001:DB8::/32 announced from here

2001:DB8:1::/48 announced from

here

R1 R2

R3

R4

Packet: DestinationIP address: 2001:DB8:1::1

R2’s IP routing table

2001:DB8:1::1 && FFFF:FFFF:: vs.2001:DBA:: && FFFF:FFFF::

Page 13: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

2001:DB8::/32 R32001:DB8:1::/48 R42001:DB9::/32 R52001:DBA::/32 R6……

IP route lookup:Longest match routing

• Based on destination IP address

Longest match, 48 bit netmask

2001:DB8::/32 announced from here

2001:DB8:1::/48 announced from

here

R1 R2

R3

R4

Packet: DestinationIP address: 2001:DB8:1::1

R2’s IP routing table

Page 14: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Routing versus Forwarding

• Routing = building maps and giving directions

• Forwarding = moving packets between interfaces according to the “directions”

Page 15: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

IP Forwarding

• Router decides which interface a packet is sent to• Forwarding table populated by routing process• Forwarding decisions:

– destination address– class of service (fair queuing, precedence, others)– local requirements (packet filtering)

• Forwarding is usually aided by special hardware

Page 16: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Routing Tables Feed the Forwarding Table

BGP 4 Routing Table

OSPF – Local RIB

Static RoutesRou

ting I

nfo

rmat

ion B

ase

(RIB

)

Forw

ardin

g I

nfo

rmat

ion B

ase

(FIB

)

Connected Routes

IS-IS – Local RIB

Page 17: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

The FIB

• FIB is the Forwarding Table– It contains destinations, the interfaces and the next-hops to get to those

destinations– It is built from the router’s Global RIB– Used by the router to figure out where to send the packet– Cisco IOS: “show ip cef”

Page 18: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

The Global RIB

• The Global RIB is the Routing Table– Built from the routing tables/RIBs of the routing protocols and static routes

on the router• Routing protocol priority varies per vendor – see addendum

– It contains all the known destinations and the next-hops used to get to those destinations

– One destination can have lots of possible next-hops – only the best next-hop goes into the Global RIB

– The Global RIB is used to build the FIB– Cisco IOS: “show ip route”

Page 19: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Explicit versus Default Routing

• Default: Pointing all destinations to another device– Simple, cheap (CPU, memory, bandwidth)– No overhead– Low granularity (metric games)

• Explicit: Every known destination (default free zone)– Complex, expensive (CPU, memory, bandwidth)– High overhead– High granularity (every destination known)

• Hybrid: Default plus some destinations– Minimise overhead– Provide useful granularity– Requires some filtering knowledge

Page 20: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

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

Page 21: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Ingress Traffic

• How packets enter your network• 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)

Page 22: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Autonomous System (AS)

• Collection of networks with same routing policy• Single routing protocol• Usually under single ownership, trust and administrative control

AS 100

Page 23: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Definition of terms• Neighbours

– AS’s which directly exchange routing information– Routers which exchange routing information

• Announce– send routing information to a neighbour

• Accept– receive and use routing information sent by a neighbour

• Originate– insert routing information into external announcements (usually as a result of the IGP)

• Peers– routers in neighbouring AS’s or within one AS which exchange routing and policy

information

Page 24: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Routing flow and Packet flow

routing flowaccept

announceannounceacceptAS 1 AS 2

packet flow

packet flow

For networks in AS1 and AS2 to communicate:AS1 must announce to AS2AS2 must accept from AS1AS2 must announce to AS1AS1 must accept from AS2

Page 25: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Routing flow and Traffic flow

• Traffic flow is always in the opposite direction of the flow of Routing information– Filtering outgoing routing information inhibits traffic flow inbound– Filtering inbound routing information inhibits traffic flow outbound

Page 26: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Routing Protocols

We now know what routing means…

…but what do the routers get up to?

And why are we doing this anyway?

Page 27: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

1: How Does Routing Work?

• Internet is made up of the RENs and ISPs who connect to each other’s networks

• How does an ISP in Kenya tell an ISP in Japan what end-users it has?

• And how does that ISP send data packets to the customers of the ISP in Japan, and get responses back– After all, as on a local ethernet, two way packet flow is needed for

communication between two devices

Page 28: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

2: How Does Routing Work?

• ISP in Kenya could buy a direct connection to the ISP in Japan– But this doesn’t scale – thousands of ISPs, would need thousands of

connections, and cost would be astronomical

• Instead, ISP in Kenya tells its neighbouring ISPs what end-users it has– And the neighbouring ISPs pass this information on to their neighbours,

and so on– This process repeats until the information reaches the ISP in Japan

Page 29: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

3: How Does Routing Work?

• This process is called “Routing”• The mechanisms used are called “Routing Protocols”• Routing and Routing Protocols ensures that

– The Internet can scale– Thousands of ISPs can provide connectivity to each other– We have the Internet we see today

Page 30: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

4: How Does Routing Work?

• ISP in Kenya doesn’t actually tell its neighbouring ISPs the names of the end-users– (network equipment does not understand names)

• Instead, the ISP will have received an IP address block as a member of the Regional Internet Registry serving Kenya – The end-users will have received address space from this address block

as part of their “Internet service”– And the ISP announces this address block to its neighbouring ISPs – this

is called announcing a “route”

Page 31: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

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 a network– EGP is used to refer to the process running between routers bordering

directly connected networks

Page 32: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

What Is an IGP?

• Interior Gateway Protocol• Within an Autonomous System• Carries information about internal infrastructure prefixes• Two widely used IGPs:

– OSPF (Open Shortest Path First)– IS-IS (Intermediate System to Intermediate System)

Page 33: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Why Does Internet Need an IGP?

• Backbone scaling in RENs and ISPs– Hierarchy– Limiting scope of failure– Only used for Operator’s infrastructure addresses, not end user

addresses or anything else– Design goal is to minimise number of prefixes in IGP to aid scalability

and rapid convergence

• Scalable internal routing for end user networks

Page 34: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

What Is an EGP?

• Exterior Gateway Protocol• Used to convey routing information between Autonomous

Systems• De-coupled from the IGP• The only EGP is Border Gateway Protocol (BGP)

Page 35: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Why Does Internet need an EGP?

• Scaling to large network– Hierarchy– Limit scope of failure

• Define Administrative Boundary• Policy

– Control reachability of prefixes– Merge separate organisations– Connect multiple IGPs

• Application: RENs, ISPs, Multihomed end-users

Page 36: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Interior versus ExteriorRouting Protocols

• Interior– Automatic neighbour discovery– Generally trust your IGP routers– Prefixes go to all IGP routers

• Exterior– Specifically configured peers– Connecting with outside

networks– Set administrative boundaries

Page 37: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Hierarchy of Routing Protocols

BGP

BGP and OSPF/IS-IS

Other ISPs

End UsersIXP

Static/BGP

BGP

REN

Campus

NREN/ISP

Local Internet

Page 38: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

Questions?

Page 39: Routing Basics• Routing table entry (the path) is created by the administrator (static) or received from a routing protocol (dynamic) • More than one routing protocol may run on

39

FYI: Default Administrative DistancesRoute Source Cisco Juniper Huawei Brocade Nokia/ALU Mikrotik

Connected Interface 0 0 0 0 0 0

Static Route 1 5 60 1 1 1

EIGRP Summary Route 5 N/A ? N/A N/A N/A

External BGP 20 170 255 20 170 20

Internal EIGRP Route 90 N/A ? N/A N/A N/A

IGRP 100 N/A ? N/A N/A N/A

OSPF 110 10 10 110 10 110

IS-IS 115 18 15 115 18 N/A

RIP 120 100 100 120 100 120

EGP 140 N/A N/A N/A N/A N/A

External EIGRP 170 N/A ? N/A N/A N/A

Internal BGP 200 170 255 200 130 200

Unknown 255 255 ? 255 ?