Routing

smashlizardsΔίκτυα και Επικοινωνίες

29 Οκτ 2013 (πριν από 4 χρόνια και 14 μέρες)

87 εμφανίσεις

COMP 5116

Lecture 5

Routing Concepts and Protocols

1

Comer Readings


Chapter 13


Routing concepts and algorithms


Chapter 15


RIP, OSPF


(15.15.1
-
15.16 is optional reading)


Chapter 14


BGP


(14.9
-
14.18 is optional reading)

2

Outline


Introductory routing concepts


Distance
-
Vector


Link
-
State


Protocols


RIP and son of RIP


OSPF: very high level overview only


BGP: very high level overview only


Some IP routing issues



3

Routing Concepts


Routing:

finding a path from one end to the
other for a packet


Routing algorithms:

disseminate information
and determine paths


Routing protocols
: implement routing
algorithms


Routing tables:

represent paths via forwarding
decisions


4

Routing Topology ?


Two extreme topologies:


No routers
-

every host wired to every other
host via N * N wires


not scalable, not cost effective


A single router
-

for all hosts (star)


one huge routing table, but
single point of failure


Real world: distributed mesh of routers


5

The Original Internet Solution


Hierarchical organisation


At the top: a small circle of core routers that
know all the routes between each other


For the others: concept of a
default route


if you are not at the top AND you don’t know what
to do with a packet, send it “UP” to a core router


Internet now: routing within and between
autonomous
domains


6

Properties of an Ideal Routing
Algorithm


Fair


to all packets and flows


Correct
-

problems if algorithms too complex


Robust
-

can deal with router crashes


Topologically flexible
-

things change over time


Stable
-

routing changes stabilize (converge)


Efficient


not too much routing overhead


Maintainable
-

admin not too complicated


Scalable
-

to many routers, many hosts (distributed)


Secure


spoofing, DOS etc


7

Example of a Classic Problem

8

How Routing Tables Are Built?


Static versus dynamic


Static: Fixed at boot time or hand configured.


Dynamic: Variable routing tables as route changes are
propagated throughout network.


Static pros:


simple, may be OK in a simple topology


Static cons:


can’t react dynamically to changes


not scalable


Dynamic: how do we determine the best paths?


9

A Simple Approach
-

Flooding

10

Tools
-

Flooding


An important routing tool


Used to some extent in many routing
algorithms, but strong pro and con:


Pro
-

perfect routing
, you always discover the
best path (the one taken by the first arriving
packet)


Con
-

“perfect congestion”
-

you use up too
much bandwidth


11

Tools
-

Source Routing


Source
-
routing vs hop
-
by
-
hop


source node determines exact PATH and datagram
follows that path


IP option, but rarely used (management tool)


Used in BGP: can communicate policies, eg “do
not route through this domain”


Not as scalable as hop
-
by
-
hop routing


12

Distance
-
Vector Routing Algorithms


Distance
-
vector algorithms: “
tell the neighbours
about the world



Vector
is destination (net)


Distance
is metric (hopcount)


(perhaps better called ‘destination
-
metric’, but dv is
the convention)


Overview: you flood your destination/hop
-
count info
to your directly connected neighbour routers


RIP is an example


13

Distance
-
Vector Algorithm


Three main algorithmic elements:



Send, receive, timeout



Send: every N seconds, on all connected interfaces
broadcast 2
-
tuples : (to network X, hop count Y)



Metric is hop count

14

Distance
-
Vector Algorithm


Receive:


if new tuple (new destination), add to routing table;


neighbour estimate of hop count + 1


if better (shorter hop count via different link), change
existing;


if “dead” tuple (route no longer available), remove


Timeout: if no refresh from neighbour router in N*Y
seconds (
router crashes) remove all entries via that
router

15

Distance
-
Vector Issues


Slow convergence


Changes sent regularly, but must propagate to all
routers, so convergence takes time (made worse by
possible loops)


“Good news carries fast, bad news slow”

(eg crashes)


Convergence time can cause problems

(eg Count to Infinity problem)

16

Count to Infinity


C crashes, B knows C crashed but hasn’t told A yet


Unfortunately A talks to B first and says:

I can get to C in two hops

(note it doesn’t mention to B that the path is thru B).


Thus B thinks it can get to C in three hops and tells A


A now thinks it’s four hops to C and tells B etc...


Etc, until infinity


RIP max hop count (infinity) is 16

17

Split
-
Horizon Fix


A does not tell B about the path to C

Because B is the next hop A uses to get to C


When link goes away, B will know that there is
no path to C, and tell A


But does not work in all cases

(more complex topologies)

18

Poison Reverse Fix


B actively advertise the broken route to all
other routers.


Done by setting hop count to infinite. (eg. For
RIP is 16)

19

Hold
-
down Fix


All routers receiving a route failure notice will
discard any subsequent notice that indicates
the route is alive.


This condition is kept for a certain duration
(timeout period). Hence a timer is used when
the link is dead.

20

Link
-
State Routing


Link
-
state or shortest path first (SPF)


tell the world about your neighbors



Get status of all neighbours and propagate that
information to the entire set of routers in the net


Routers use this “link
-
state” to build a map of the
shortest paths to everybody


LS is compute
-
intensive


but
converges faster

21

Link
-
State Algorithm

Link
-
state requires each participating router to
keep a map of complete topology, in 3 stages:

1. Determine neighbor connectivity

2. Send (“flood”) link
-
state packet that tells which
link neighbors are up, and cost

3. Use Dijkstra shortest
-
path algorithm to compute
best path to all networks

22

Dijkstra SP Algorithm

1.
Start with local node (router)

2.
Assign cost 0 and make permanent

3.
Examine each neighbor of last permanent node

4.
Assign cumulative cost (= distance from source) to each
node and make tentatively permanent

5.
Among tentative nodes

1.
Find node with smallest cumulative cost and make permanent

2.
If a node can be reached through more than one direction

1.
Select direction with the smallest cumulative cost

6.
Repeat steps 3
-
5 until all nodes permanent

23

Dijkstra

A

D

B

E

C

F

5

2

3

1

2

3

1

1

5

2

Represents global link state information of a network:

Algol: find shortest paths from A to all other routers

(A has all global link state)

24

Dijkstra

Step

N

D(B),
p(B)

D(C), p(C)

D(D), p(D)

D(E), p(E)

D(F), P(F)

0











1

A

2,A

5,A

1,A





2

AD

2,A

4,D

2,D



3

ADE

2,A

3,E

4,E

4

ADEB

3,E

4,E

5

ADEBC

4,E

6

ADEBCF

Permanent Node Assignments

D = Distance, p = previous

Note: In step 0, D(A)=0.

After Dijkstra

Build A’s routing table from Result

Router

Cost

Next Hop

Other Info

D

1

A (direct)

E

2

D

B

2

A (direct)

C

3

D

F

4

D

26

Link
-
State: Pros/Cons


Pros


converges faster, no count to infinity problem


more functionality; e.g.,
each router has map of
net
, can make network debugging easier


Cons


more computation than dv (does this matter?)


Bandwidth trade
-
offs depend on size of network


dv exchanges summary version of route table


ls routers broadcast link state around net


27

Routing protocols: Scalability Issue


No single routing protocol can scale to current
Internet size


routing traffic becomes overwhelming


different organisational boundaries/priorities


Thus: divide world into layers with boundary routers


‘perfect knowledge’ within a layer (maybe)


boundary routers have summary routes


Phone companies have done this for years


28

Protocol Classification

(Generic)

29

Protocols and Topology

30

Routing Information Protocol (RIP)


Distance
-
vector


Implemented first, and RFC 1058 (1988)
later created


In widespread use


bundled with BSD4 Unix and Sun


BSD
routed

and Cornell
gated

support it


31

RIP Details


Messages carried in UDP datagrams, on port 520


Metric is hop count.


Broadcast every 30 seconds, routing table as pairs of
(to net, hop count)


Hop count: direct connect = 1, network one router
away is 2 hops away, etc


New route with shorter hop count replaces older
route


On initialisation, router requests route table from
neighbours


Extra triggered update if metric (hop count) changes
(bad news propagates)

32

More Details


Manages hysteresis (route oscillation)


Route has timeout: 3 minutes, no new info,
then mark with metric=16, one minute later
delete (
hold down

so the fact that route is
gone is propagated)


Infinity = 16, RIP can suffer count to infinity
(but limits span of the network)


Default route is route to 0.0.0.0


eg

to rest of the Internet

33

RIPv1 Header

(Designed

for non
-
IP

networks

also)

34

RIPv2


RFC 2453 (1998)


IP only


Supports subnets and CIDR


Routing domains can be used to allow more
than one RIP domain; more than one
routed

on a system (border routers)


Route tag


eg

AS number, communicates
boundary info

35

RIPv2 header

Next hop used for split
-
horizon fix

36

OSPF
-

Open Shortest Path First


OSPF version 2, in RFC 1247 (1991)


Link
-
state
protocol as contrasted with RIP


OSPF uses IP direct, not on top of UDP


Supports subnets and CIDR


Supports multi
-
access networks


If multiple routers attached to a link (eg Ethernet) only
one is the Designated Router for link
-
state messages


Support for load balancing


If multiple routes have equal cost, use multiple paths


Metric (cost) is link performance (eg. RTT,
bandwidth, …)

37

OSPF


Very High Level Overview


Support for local hierarchies of networks (
eg

enterprise/organisations) and route aggregation


Supports AREA notion
: border
router can
summarize

IP
addresses in area (aggregation),

report

summary to other
backbone or border routers, which leak that info into area
so that internal routers can
optimize

their routes


Area 0: Backbone area


Non
-
0 areas: Connect
to area 0


Stub area:
Non
-
0
areas can be stub to prevent injection of
external routes.


Router types:


Area Border Router (ABR): Connects one or more areas to
backbone (area 0).


Autonomous system boundary router (ASBR): Router that
interfaces to another router with different routing protocol (
eg
.
RIP).


Internal router (IR): Routers within an area.

38

OSPF Router Types

39

/ RIP / etc…

RIP vs OSPF


RIP Pros


it just works


simple


RIP Cons


limit of 15 hops


periodic broadcast of full routing table consume large
bandwidth


no understanding of subnetting (RIPv1)


convergence can be slow (minutes..)


can’t aggregate routes


no concept of network delay/link costs



40

RIP vs OSPF


OSPF Pros


fixes RIP’s cons


provide load balancing


separate networks into areas to prevent link state
explosion


OSPF Cons


harder to set up



41

IS
-
IS: Intermediate System to
Intermediate System


Defined in ISO/IEC 10589 within the OSI reference
model


Link
-
state protocol


ES
-
IS allows nodes/routers to discover each other


IS
-
IS for exchanging routing information


Has
backbone
routers

(Level 2),
internal
routers
(Level 1), and
border

routers (Level 1
-
2)


42

IS
-
IS: Intermediate System to
Intermediate System


Runs on Connectionless
-
mode Network Protocol
(CLNP) as opposed to IP


Used by ATM, SDH/SONET, X.25, Frame Relay…


Each node identified by a Network Service Access
Point address (NSAP) address.


This is similar to IP address.


Example NSAP address:
39.0f01.0002.0000.0c00.1111.00

43

OSPF vs IS
-
IS

OSPF

IS
-
IS

Typically used by enterprise

Typically used by ISP

For IPv4/v6 network have to
run both OSPFv2 and v3
separately.

Can support IPv4/v6 in a single
instance.

Logically a star topology

Logically a flat single topology

Less flexible when extending
backbone

More flexible when extending
backbone

44

BGP

Border Gateway Protocol


Concept of Autonomous Systems (AS)


16 bit AS number allocated by regionals (e.g., ARIN)


Binds AS’s or ‘domains’ together


Between adjacent border routers
-

peers


BGP peers exchange reachability information (paths)


Uses TCP to communicate
-

reliable


Distance vector protocol:

AS_Path = list of AS numbers,

Route update = To ASx, via AS #1, AS #2, etc.

Loop detection, since path is fully enumerated



45

BGP contd.


AS can be:


Stub
: connected to only one other AS


Transit
: forwards to/from other AS/ISPs


Multi
-
homed:

connected to more than one other
AS with no transit


Compared to IGP, routing can be policy
-
based (eg
commercial relationships) rather than link cost.


Route aggregation
: a single entry for multiple
destinations (CIDR prefixes)


46

Some Routing Issues: Congestion


Connectionless routers have only so many buffers: so
if too many incoming packets, they drop them



Things get worse at the “freeway exchanges”



How do we prevent/detect congestion?


47

Congestion


Prevent congestion?:


add carrying capacity info


more link state


Detect congestion?


TCP detects congestion when sender notes that
ACKS are missing & sender slows rate of sending
(more next sessions)


Some schemes have routers forward or pass back
congestion bits


Do we add this to routing protocols?


48

Routing Issues: Metric


Which routing metric to use?


Hop count


number of routers traversed (simple)


Delay
-

shortest path in terms of time


Available bandwidth
-

go least congested route


Speed of underlying network


Cost? not appropriate within enterprise, but
between; e.g., which long
-
distance company?



49

Metric


If link costs change, that information must converge
of course


Currently, link cost is usually just hop count


(1 metric)


Question: would more complex algorithms (if
possible) that dynamically account for link costs do
better job than current simple algorithms, or just use
more bandwidth?


50

Metric


RIP


OSPF

51

Routing Issues: Quality of Service
(QoS)


Different
services

and
classes:


“my packets before other packets”


premium (forwarding) service offered by ISP


maybe prioritize certain traffic classes


isochronous (eg real time voice)


Might want to optimize on multiple metrics


Policy
-
based QoS routing


determine best route


source and static routing can be useful (BGP)

52

QoS: The Problem


Packets sent end
-
to
-
end may experience loss,
lengthy delays, and wide variations in delay (jitter)


Some applications (eg VoIP) require packets
(containing digitised audio/video) to be received at
the rate they are transmitted


Delays: for live calls/conferences (eg VoIP) cannot
tolerate long delays (>~400ms)


Jitter: packets that arrive ‘too late’ are useless

(More on this later in the unit)

53

QoS: Solutions?


Network level (QoS routing): prioritise ‘flows’ of
packets to ensure they

are
forwarded within time
constraints


intserv, diffserv (IETF)


feasibility and scalability?



End
-
to
-
end: receiver play
-
out buffer smooths effects
of jitter, at the expense of play
-
out delay

(More later)




54

Next week


Mid
-
term

55