1 Unicast Routing Protocols. 2 Outline Routing basic RIP OSPF BGP.

58
1 Unicast Routing Protocols

Transcript of 1 Unicast Routing Protocols. 2 Outline Routing basic RIP OSPF BGP.

Page 1: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

1

Unicast Routing Protocols

Page 2: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

2

Outline

Routing basic RIP OSPF BGP

Page 3: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

3

Routing Basic

IP Routing Autonomous System (AS) IGP/EGP Distance-vector(DV)/Link-state(LS) How routing protocol works?

Page 4: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

4

IP Routing

Route entry Destination/netmask Nexthop

Longest-match Default-route Equal Cost Multipath Protocol(ECMP) Static routing/Dynamic routing

Page 5: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

5

Autonomous System (AS)

Collection of networks with same policy Usually under single administrative control IGP to provide internal connectivity Identified by a short number

Public & Private AS numbers public: 1 - 64511 private: 64512 – 65535

AS 100

Page 6: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

6

What Is an IGP?

Interior Gateway Protocol Within an Autonomous System Carries information about internal

prefixes Examples—

RIP, OSPF, ISIS…

Page 7: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

7

What Is an EGP?

Exterior Gateway Protocol Used to convey routing information

between ASes Independent from the IGP Current EGP is BGP4

Page 8: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

8

Why Do We Need an EGP?

Scaling to large network Hierarchy Limit scope of failure

Define administrative boundary Policy

Control reachability to prefixes

Page 9: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

9

Hierarchy of Routing Protocols

Customers

Other ISP’s

BGP4 BGP4/Static

BGP4 / IGP

Customers

BGP4

Page 10: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

10

Distance-vector (Bellman-Ford)

Routers only know their local state link metric and neighbor estimates

Examples – RIP, BGP (path-vector)

Page 11: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

11

Link-state

Routers have knowledge of the global state topology database global optimization (Shortest Path First

- Dijkstra) Examples –

OSPF, ISIS

Page 12: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

12

How Routing Protocol works?

Neighbor Discovery Route Exchange between neighbors

learning/flooding/invalidation/refresh Best route choice and routing table

management Responsibility

Fast convergence and loop-free Scalability Robustness Some control of routing choices

Page 13: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

13

Routing Information Protocol (RIP)

RIP basic General operation RIP v2 VS RIP v1 Conclusion

Page 14: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

14

RIPv2 basic

Distance-vector protocol Metric – hops

Metric is increased when routes are updated to neighbors

Network span limited to 15 (16 means unreachable)

Encapsulated as UDP packets, port 520

Page 15: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

15

RIPV2 General operation

On startup, send request on all interfaces. When a request is received, a response is sent.

- Response contains entire routing table. A response is also gratuitously sent every 30s.

– Response contains entire routing table. A response is also sent when update detected.

- Response only contains changed routes. Route metric is set to 16 when network

becomes inaccessible or not refreshed during 6 update periods(180s)

Invalid routes are flushed after another 4 update periods(120s)

Page 16: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

16

Count of infinity

What happens when a link dies?

A B C

A: 0B: 1, BC: 2, B

A: 1, AB: 0C: 1, C

A: 2, BB: 1, BC: 0

A: 0B: 1, BC: 2, B

A: 1, AB: 0C: 3, A

A: 2, BB: 1, BC: 0

A: 0B: 1, BC: 4, B

A: 1, AB: 0C: 3, A

A: 2, BB: 1, BC: 0

A: 0B: 1, BC: 15, B

A: 1, AB: 0C: 16, A

A: 2, BB: 1, BC: 0

Page 17: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

17

Split horizon

To speed up convergenceSimple

- do not claim reachability for a destination network to the neighbor from which the route was learned.

Poison reverse - includes such routes in updates, but sets their metrics to infinity

Page 18: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

18

Split horizon - simple

A B C

A: 0B: 1, BC: 2, B

A: 1, AB: 0C: 1, C

A: 2, BB: 1, BC: 0

A: 0B: 1, BC: 16, B

A: 1, AB: 0C: 16

A: 2, BB: 1, BC: 0

Page 19: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

19

Split horizon – poison reverse

A B C

A: 0B: 1, BC: 2, B

A: 1, AB: 0C: 1, C

A: 2, BB: 1, BC: 0

A: 0B: 1, BC: 16, B

A: 1, AB: 0C: 16

A: 2, BB: 1, BC: 0

C: 16

Page 20: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

20

RIPv2 vs RIPv1

224.0.0.9 - broadcast Variable Length Subnet Mask(VLSM)

- Classless Inter-DomainRouting (CIDR, no prefix/subnet information, derived from address class)

Authentication - none

Page 21: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

21

Conclusion

Simplicity Slow convergence Not suited for large and complex

networks

Page 22: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

22

OSPF Basic OSPF Neighbors OSPF Area SPF and LSA database OSPF Messages Conclusion

Open Shortest Path First (OSPF)

Page 23: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

23

OSPF Basic

Encapsulated as RAW IP packets, protocol ID 89

Uses metrics—path cost(1–65,535)

Page 24: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

24

OSPF Basic - general operation

Use Hello Protocol to establish neighbors All routers exchange Link State Advertisement

(LSA) to build and maintain a consistent database Each router runs SPF on LSA database

independently and gets optimal routes Periodic flooding of LSAs every 30 minutes LSA age

0 when created Incremented as time elapsed. Max age 3600 indicates invalid Remove a LSA by incrementing age to 3600,

reflooding and flushing.

Page 25: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

25

OSPF Network type

Broadcast Point-to-Point/Point-to-Multipoint NBMA(Non-Broadcast Multiple

Access)

Page 26: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

26

Neighbor discovery

Hello packets Periodically Multicasting 224.0.0.5,

including RouterId, AreaId, Netmask, hello interval,

Priority, DR, BDR, Neighbor list

Neighbor state machine Works differently on different network

Page 27: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

27

DR/BDR/Others

For broadcast and NBMA networks Optimize the flooding procedure Designated Router(DR)

Adjacent to all routers Describe all routers on the network Send updates to all routers on the network

Backup Designated Router(BDR) Adjacent to all routers Act as new DR when previous DR fails

Others Only adjacent to DR/BDR, only send updates to

DR/BDR

Page 28: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

28

OSPF Area

Why divide the network into different areas? Limit the scope of updates and computational

overhead independent SPF computing in each area inject aggregated information on routes into

other areas 32 bit number Backbone area – area 0 or 0.0.0.0

All areas must connect to backbone area. Backbone area must be continuous Virtual link when the above fails

Area Border Routers(ABR)

Page 29: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

29

Virtual Link

Area 1 Area 0Area 2

Area 3

Virtual link

ABR

ABR

ABR

Page 30: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

30

Shortest Path First

A B

C D

10

3

1 4

7

Page 31: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

31

Candidate

Root cost

SPF tree Description

A, A, 0 Root tree

A, B, 3A, C, 1A, D, 10

3110

A, A, 0 Add adjacent links to A into Candidate and calculate cost to A.

A, B, 3A, D, 10C, D, 7

3108

A, A, 0A, C, 1

Choose the lowest cost link (A, C, 1), add it into SPF tree and remote it from Candidate. Add adjacent links to C into Candidate and calculate cost to A. Because the new lowest cost to D is 8, <A, D, 10> is remoted.

C, D, 7B, D, 4

87

A, A, 0A, C, 1A, B, 3

Choose the lowest cost link(A, B, 3),Add it into SPF tree and remote it from Candidate.Add adjacent links to B into Candidate and calculate cost to A. because the new lowest cost to D is 7, <C, D, 7> is removed.

A, A, 0A, C, 1A, B, 3B, D, 4

Choose the lowest cost link(B, D, 4),Add it into SPF tree and remote it from Candidate. Because the Candidate is empty, the process is over.

Page 32: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

32

OSPF SPF process

SPF calculation is performed independently for each area

Router LSA Each router creates a router LSA for each area Describe links to an area

DR/BDR(broadcast) Neighboring router(point-to-point) Prefix/mask(stub network) metric

Network LSA Only DR creates a network LSA for a network Describe all routers on the network

Page 33: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

33

Inter-area routes

Network Summary LSA Created by ABR Advertise optimal routes in one area

into another area Prefix/mask Metric

Flood only in one area

Page 34: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

34

Inter-AS routes

Autonomous System Border Router(ASBR) Autonomous System External LSA

Created by ASBR Describe routes redistributed from other AS

Prefix/mask Metric

Flood across area in an AS(except stub area) ASBR summary LSA

Created by ABR Describe ASBR routers in one area

ASBR router id metric

Page 35: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

35

Stub area

AS External LSA are forbidden in stub area

Why stub area? When many networks are connected

only via one router All external networks aggregated into

default route Reduce routing table sizes

Page 36: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

36

OSPF Messages

Hello Used to establish neighbor relationship

Database description Used to describe brief information of LSA

Link-state request Used to request LSAs

Link-state update Used to update LSAs

Link-state acknowledgment Used to assure LSA flooding reliable by

including brief description of received LSA

Page 37: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

37

Conclusion

2-level hierarchical model Faster convergence Relatively low, steady state bandwidth

requirements

Page 38: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

38

Border Gateway Protocol (BGP)

BGP Basic BGP Peers BGP Updates – NLRI and Path Attributes Synchronization with IGP Route Reflector and AS Confederation Routing policy BGP Messages Conclusion

Page 39: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

39

BGP Basic

Based on TCP connection, port 179 BGP peer is configured manually BGP Peers exchange

Update messages containing Network Layer Reachability Information (NLRI)

Path attributes are with NLRI to avoid loop and facilitate policy control

No routes refresh

Page 40: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

40

AS 100 AS 101

AS 102

AA CC

BGP Peers - eBGP

eBGP TCP/IP

Peer Connection

Peers in different AS’sare called External Peers

Note: eBGP Peers normally should be directly connected.

EE

BB DD220.220.8.0/24 220.220.16.0/24

220.220.32.0/24

eBGP

eBGPeBGP

Page 41: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

41

AS 100 AS 101

AA CC

BGP Peers - iBGP

iBGP TCP/IP

Peer Connection

Peers in the same ASare called Internal Peers

AS 102

EE

BB DD

Note: iBGP Peers don’t have to be directly connected. Loopback interface are normally used as peer connection end-points. In this case, recursive route look-up is needed.

220.220.8.0/24 220.220.16.0/24

220.220.32.0/24

iBGP iBGP

Page 42: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

42

Full mesh

Each iBGP speaker must peer with every other iBGP speaker in the AS (full mesh)

IBgp speaker never floods routes received from another iBGP peer to any other iBGP peer.

AS 100

AABB

CC DD

Page 43: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

43

BGP Updates — NLRI

Network Layer Reachability Information

Used to advertise feasible routes Composed of:

Network Prefix Mask Length

Page 44: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

44

BGP Updates — Path Attributes Used to convey information associated with

NLRI Origin - mandatory AS path - mandatory Next hop - mandatory Local preference Multi-Exit Discriminator (MED) Community Origin Aggregator

Rich policy control

Page 45: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

45

Origin

Conveys the origin of the prefix Three values:

IGP - Generated using “network” statement ex: network 35.0.0.0

EGP - Redistributed from EGP Incomplete - Redistribute IGP

ex: redistribute ospf IGP < EGP < INCOMPLETE

Page 46: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

46

Sequence of ASes a route has traversed

Loop detection Apply policy

AS 100

AS 300

AS 200

AS 500

AS 400

170.10.0.0/16 180.10.0.0/16

150.10.0.0/16

Network Path

180.10.0.0/16 300 200 100

170.10.0.0/16 300 200

150.10.0.0/16 300 400

Network Path180.10.0.0/16 300 200 100170.10.0.0/16 300 200

AS-Path Attribute

Page 47: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

47

Sequence of ASes a route has traversed

Loop detection

AS-Path Loop detection

AS 100

AS 300

AS 200

AS 500

AS 400

170.10.0.0/16 180.10.0.0/16

150.10.0.0/16

180.10.0.0/16 300 200 100

170.10.0.0/16 300 200

150.10.0.0/16 300 400

180.10.0.0/16 dropped

Page 48: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

48

160.10.0.0/16

150.10.0.0/16192.10.1.0/30

.2

AS 100

AS 200

Network Next-Hop Path160.10.0.0/16 192.20.2.1 100

CC

Next Hop Attribute

.1

BGP Update

Messages

BB

AA

.1

.2

AS 300

EE

DD

Next hop to reach a network Usually a local network is the next hop in

eBGP session Next Hop updated between eBGP Peers Next hop not changed between iBGP peers

140.10.0.0/16

192.20.2.0/30

Network Next-Hop Path150.10.0.0/16 192.10.1.1 200160.10.0.0/16 192.10.1.1192.10.1.1 200 100

Network Next-Hop Path150.10.0.0/16 192.10.1.1 200160.10.0.0/16 192.10.1.1192.10.1.1 200 100

Page 49: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

49

Local Preference

AS 400

AS 200

160.10.0.0/16

AS 100

AS 300

160.10.0.0/16 500> 160.10.0.0/16 800

800

EE

BB

CC

AA

DD

500

Multi-homed AS

• Only for iBGP• Local to an AS • Path with highest local preference wins

Page 50: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

50

Multi-Exit Discriminator (MED)

AS 201

AS 200

192.68.1.0/24

CC

AA BB

192.68.1.0/24 1000192.68.1.0/24 2000

preferred

• Used to convey the relative preference of entry points• Comparable if paths are from the same AS • Path with lower MED wins• IGP metric can be conveyed as MED

Page 51: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

51

Customer AS 201

Service Provider AS 200

192.68.1.0/24

CC

AA BB

Community:201:110 Community:201:120

DD

Community Local Preference201:110 110201:120 120

•Used to group destinations•Each destination could be member of multiple communities•Flexibility to scope a set of prefixes within or across AS for applying policy

Communities

Page 52: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

52

BGP Updates — Withdrawn Routes

Used to “withdraw” network reachability Each Withdrawn Route is composed of:

Network Prefix Mask Length

Page 53: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

53

Synchronization with IGP

C not running BGP (non-pervasive BGP) A won’t advertise 35/8 to D until the IGP is in

sync Turn synchronization off!

Run pervasive BGP

1880

209

690

B

AC

35/8

D OSPF

Page 54: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

54

Alternative to Full Mesh –Router-reflection

AS 100 RR

Client Non-clientNon-client

Client

Non-client peers are full-mesh connected RR reflects routes from non-client peers to all client peers RR reflects routes from client peers to all non-client peers and other

client peers

Route Reflector (RR) Client peers Non-client peers

Page 55: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

55

Alternative to Full Mesh –Confederation

AS Confederation 100

Member-AS 65532Member-AS 65531

•Divided into member AS, marked by private AS number•Full-mesh in member AS•Peers between member AS are most similar with eBGP, except that inserted AS path is confederation AS path•When routes get out of AS confederation, remove confederation AS path

Page 56: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

56

Routing Policy

Why? To steer traffic through preferred paths Inbound/Outbound prefix filtering To enforce Customer-ISP agreements

How ? AS based route filtering - filter list Prefix based route filtering - distribute list BGP attribute modification - route maps

Page 57: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

57

BGP Messages

OPEN To negotiate and establish peering

UPDATE To exchange routing information(NLRI, Path

attributes, Withdrawn routes) KEEPALIVE

To maintain peering session NOTIFICATION

To report errors (results in session reset)

Page 58: 1 Unicast Routing Protocols. 2 Outline  Routing basic  RIP  OSPF  BGP.

58

Conclusion

The single extant protocol for interdomain routing

Fundamentally simple algorithms but can provide complex and flexible policy control

More future applications, such as BGP/MPLS VPN networks