Top Banner
Lecture 4: Internet Routi ng 1 CS 5283: Internet Routing Venkatesh Sarangan
46

Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Mar 26, 2015

Download

Documents

Irea Montgomery
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 1

CS 5283: Internet Routing

Venkatesh Sarangan

Page 2: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 2

Schematic diagram of the Internet

Page 3: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 3

Overview

Interior Routing Protocols RIP OSPF Pros and Cons

Exterior Routing Protocols Why we need ERP ? BGP

Page 4: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 4

Internet Routing

Intra-domain routing Information about the network outside the domain is

ignored RIP (Routing Information Protocol) OSPF (Open Shortest Path First) protocol

Inter-domain routing EGP (Exterior Gateway Protocol) BGP (Border Gateway Protocol)

Page 5: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 5

Distance Vector Protocols

At each router, maintain a list/vector of distances to all possible destinations

Periodically exchange this information with the neighbors

Update the routing table based on information received from the neighbors

Page 6: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 6

X to B: 1

X to C: 1

X to A: 1

Page 7: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 7

Distance Vector Protocols

On receiving an update from a neighbor Add the link cost to reach the neighbor to the neighbor’s

distance vector Out of all possible neighbors, find which neighbor has the

lowest distance/cost Include this neighbor has the next hop Include this distance as the cost of reaching the destination

Can be implemented using ‘Distributed Bellman-Ford’ algorithm

Page 8: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 8

Routing Information Protocol (RIP)

DV; Link metric always set to 1 (hop count) Maximum hops allowed: 15

16 is considered to be un-reachable or infinity Each router periodically sends its entire routing table

to its neighbor every 30 sec UDP port # 520 is used Maximum RIP message size is 504 bytes

Page 9: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 9

RIP message format

from http://www.cis.umassd.edu/~amathuria/577/f02-577.html

Page 10: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 10

RIP message processing

RIP ‘requests’ are made by routers that just booted up Also used for de-bugging purposes

Routers on receiving the ‘request’ send their entire routing table

Received entries are checked one by one IP address, metric are checked Entries suitably updated; timers are re-started

Page 11: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 11

RIP message processing

Updating tables Add any new destination network Replace existing routes with small delay ones If update from router R, update all routes using R as next

hop Life time of a table entry is 180 sec

If no update is received for 180 sec, crash is assumed Distance is set to 16 (infinity)

Page 12: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 12

RIP: Drawbacks

Count to infinity Consider 1-2-3; If 3 fails, 2 updates & thinks there is a

route through 1; 1 updates & thinks there is a route through 2

No clear solution! Split-horizon: Since 1 reaches 3 through 2, when it

advertises to 2, it advertises infinity for 3. No authentication Black-hole

If a router advertises by mistake (or knowingly) a distance of zero to several destinations, then all routes point to it!

Page 13: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 13

RIP: Drawbacks (contd.)

No support for variable length subnet masking (what is this?)

Slow convergence to topology changes

Page 14: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 14

RIP version 2

RIP v2 extends RIP v1 to remove some of the drawbacks

Provides authentication Supports variable length subnet masking Uses multicasting instead on broadcasting requests

Unused fields in RIP v1 are used for the above extensions

Page 15: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 15

RIP version 2

from http://www.cis.umassd.edu/~amathuria/577/f02-577.html

Page 16: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 16

Distance vector to Link state

RIP, based on DV is simple, yet has slow convergence prone to count to infinity! not suitable for large networks, since maximum hop

count is 16 doesn’t allow multi-path routing

Link state is relatively complex, yet doesn't have the above drawbacks of DV

Page 17: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 17

OSPF Principles

Each node constructs a ‘link state packet (LSP)’ by collecting the states of the incident links

This LSP is then advertised to all other nodes in the network through flooding

Each router acknowledges the receipt of LSP Generates a lot of traffic!

Using the LSPs for all the routers, a DB of the entire network is maintained

Using the DB a directed graph is constructed

Page 18: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 18

OSPF Principles

Routes to all destinations are computed using the local instance of the graph

Uses Dijkstra’s SPF algorithm Specifications were developed in an ‘open’ fashion –

hence OSPF! Size of DB, flooding overhead, complexity of route

computation increase with network size Network is ‘split’ in to various, independent areas,

connected by a ‘backbone’ area Backbone area glues the network together

Page 19: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 19

OSPF Principles (contd.)

Each area behaves like a independent network DB includes only intra-area links LSP Flooding stops at area boundary Only intra-area route computation

Intra-area routing relies only on local link state info. Inter-area routing consists of three legs

1. Within source area: Intra-area

2. Through backbone (which has properties of an area) Uses link state routing algorithm for inter-area routing

3. Within destination area: Intra-area

Page 20: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 20

Routers in an OSPF AS

AS 1 AS 2

Internal router

AS 3 AS 4

Area

Backbone router

Backbone

Area border router

AS boundary router

BGP protocol connects the ASes

Page 21: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 21

OSPF Principles (contd.)

Area Border Routers connect given area(s) to the backbone maintain databases for each area they are attached to act as gateway for their area

Backbone Routers may be connected to other Area Border routers

AS Boundary routers Connect the AS to other ASes - gateway for the entire

AS Inject external routes in to the OSPF database, which is

advertised throughout the AS

Page 22: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 22

OSPF Protocols

OSPF runs directly on top of IP and has three sub-protocols

Hello Protocol To check if links are operational and establish

adjacency To elect ‘designated’ router on broad cast networks

Exchange Protocol To synchronize databases between two routers that

have just become adjacent

Page 23: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 23

OSPF Protocols

Flooding Protocol Responsible for disseminating link states Uses sequence numbers to distinguish older updates

from newer ones All updates are acknowledged

Unacknowledged updates are re-sent Updates are sent out on all interfaces apart from the

incoming one

Page 24: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 24

Link State Record types

Router links Summarize all the links that start from the advertising

router Network links

Advertised by the designated router for transit networks Summary links

Advertised by area border routers summarizing the routes for the destinations in an area

External links Links advertised by the AS border routers for destinations

outside the domain

Page 25: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 25

OSPF Link Costs

Cost of each hop is called routing metric OSPF provides flexible metric scheme based on type of

service (TOS) Normal (TOS) 0 Minimize monetary cost (TOS 2) Maximize reliability (TOS 4) Maximize throughput (TOS 8) Minimize delay (TOS 16)

Each router generates 5 spanning trees (and 5 routing tables)

Page 26: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 26

Advantages of OSPF

Fast, loopless convergence Any change is disseminated fast through flooding Consistent databases stored in local routers; hence

loopless Support for multiple metrics such as throughput, delay,

and reliability Support multi-path routing - better link utilization, lower

queueing delays, etc.

Page 27: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 27

Drawbacks of OSPF

For the traffic to travel between two areas, it must be first routed to the backbone (area 0).

this may result in non-optimal routing Dividing an AS into areas adds more complexity

Page 28: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 28

Inter-AS Routing: Limitations of IRPs

Distance Vector Assume a common distance metric across all routers

may not be true for different domains Routing table doesn’t list the entire path

An AS may have some restrictions in forwarding packets through another AS

Link State Assume a common distance metric across all routers

may not be true for different domains Involves flooding updates to all routers

Is certainly not manageable across multiple domains!

Page 29: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 29

Path Vector Routing

Do away with distance metrics Just provide the reachability information, and the list of

domains that should be crossed Removes the difficulty associated with DV and LS

routing Since entire path is enumerated, loops can be avoided

Page 30: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 30

BGP (Border Gateway Protocol)

ERP based on on path vector routing No cost information; each BGP router keeps track of the

exact path used BGP peers initially exchange their full routing tables

Later on, only routing updates are exchanged Uses TCP

A BGP router views the world as a collection of other BGP routers, and the lines connecting them

Page 31: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 31

BGP Messages

Open Used to open a neighbor relationship with another router

Update Used to (a) transmit information about a single route and/or (2) list multiple routes to be withdrawn

Keepalive Used to (1) ack. an Open message, and (2) periodically confirm the neighbor relationship

Notification Sent when an error condition is detected.

Page 32: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 32

BGP Operation

Neighbors/Peers - two BGP routers in different AS that wish to exchange routing information

Three functionalities in BGP Neighbor acquisition Neighbor reachability Network reachability

Page 33: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 33

BGP Operation: Neighbor Acquisition

When two routers in different ASes agree to peer Formal request is necessary, since one router may be

overloaded, and may not wish to be a peer One router sends a request to other

May be turned down The existence of other router should be manually fed

If accepted, Keepalive message is sent as a response

Page 34: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 34

BGP Operation (contd.)

Neighbor reachability: Maintaining the peer relationship Periodically send Keepalive messages

Network Reachability Each BGP router maintains a database of reachable

networks, and the preferred paths for reaching them Any updates to this database is exchanged among

BGP peers

Page 35: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 35

BGP Messages

Marker

Length

TypeVersion

Domain id

Hold time

BGP id

Optional parameter lenOptional Parameters

162

11

2

2

4

1

var

Marker

Length

Type

Unfeasible routes length

162

1

2

Total Path Attr. length

Withdrawn routes

Path Attributes

Net. Layer reach. info

var

2

var

var

Open Message

Update Message

Page 36: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 36

BGP Messages

Marker

Length

Type

162

1

Marker

Length

Type

162

11 Error code

Datavar

Keepalive Notification Message

1 Error subcode

Page 37: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 37

BGP Messages

All messages have a header with three fields Marker: Reserved for authentication

Sender may insert a value which the recipient may use for authenticating the sender

Length: Length of the message in octets Type: Type of the BGP message

Open, Keepalive, Update, Notification

Page 38: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 38

BGP Messages

Open: Used for acquiring a neighbor with a TCP connection

Version: version of the BGP used My domain id: AS identifier Hold time: Value proposed by the sender for Keepalive

message interval BGP id: Usually the sender’s IP address

Keepalive: Used for preventing the hold timer from expiring

Page 39: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 39

BGP Messages

Update Communicates information about a single route, which

may be added to the recipient’s database Withdraws a list of routes previously advertised to the

recipient Fields in the Update message:

Unfeasible routes length Withdrawn routes Total path attributes length Path attributes NLRI: A list of networks that can be reached by this route

Page 40: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 40

BGP: Path attributes

Origin: Indicates whether this information was generated by an IGRP or EGRP

AS_Path: A list of domains traversed in this route Next_Hop: IP address of the next hop border router to

be used for reaching destinations listed in NLRI Multi_Exit_Disc: Used to communicate preferences

among the intra-domain routes (explained later) Local_Pref: Used by a router to inform other routers

within the domain about its own preferences no significance outside the domain

Page 41: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 41

BGP: Example

R3R2

R1R4 R8

R7

R6

R5

2.1

2.2

2.3

2.4

1.4

1.1

1.2

1.3 AS 1

AS 2

BGP peers

Page 42: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 42

BGP: Example

Consider R1 Using OSPF, R1 constructs an image of the topology of

the sub-networks in Domain 1 Using BGP Open message it acquires neighborhood with

R5 in domain 2 It then sends an Update message to R5 with

AS_Path: It has the id of domain 1 Next_Hop: The IP address of R1 NLRI: List of all subnetworks in domain 1

above message informs R5 that all subnets listed in NLRI are reachable via R1, and the only domain traversed is 1

Page 43: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 43

BGP: Example

Let R5 have a BGP relation with R9 in domain 3 In the Update message sent by R5 to R9,

AS_Path: {IDs of AS2, AS1} Next_Hop: IP address of R5 NLRI: List of subnets in Domain 1

above message informs R9 that all subnets listed in NLRI are reachable via R5, and the domains traversed are 1 & 2

Page 44: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 44

BGP: Example

R9 may have alternate routes to the subnets in domain 1 If R9 prefers the route advertised by R5, it updates its

database, and sends an Update message to its other peers

New Update message will have AS_Path field of {AS3, AS2, AS1}

Page 45: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 45

BGP: Path Attributes

Multi_Exit_Disc attribute: Used to choose one among many entry points into a

domain Attribute contains a number that reflects some internal

metric for reaching destinations within AS Let both R1 and R2 have BGP relation with R5 Each provides an Update message for subnetwork 1.3 that

includes a routing metric used internal to AS 1 R5 could use these two values as the basis for choosing

between the two routes for reaching the subnet 1.3

Page 46: Lecture 4: Internet Routing1 CS 5283: Internet Routing Venkatesh Sarangan.

Lecture 4: Internet Routing 46

Summary: Internet Routing

Basics Routing table structure Distance vector, Link state, Path vector Intra-domain: RIP, OSPF Inter-domain: BGP