Você está na página 1de 52

Lecture 1

Introduction to the course Routing protocols


Lecturer: Alexander Pyattaev alexander.pyattaev@tut.fi

Outline
Info about the TLT-2336 course
Overview of the course content Arrangements and grading

Routing algorithms
Link state Distance Vector Hierarchical routing

Routing in the Internet IGP protocols


RIP OSPF

Slides have been derived from the support material from Computer Networking by Kurose and Ross

Purpose of this course(1/2)


Computer networking 1 gives you an understanding of how networks are made
So you can use the same approach to design similar networks. But is that always the good solution?

Sometimes the classic solutions simply do not work:


they may not fit the conditions, they may not scale to the load that has to be carried, they may lack speed, may be hard to set up/administrate, And many more issues may arise

Computer networking II aims to illustrate those special needs that are typical in modern networks and to prepare you for the challenges they present

Purpose of this course (2/2)


In our example, to handle the new conditions you may need a different car For instance:
Routing may be done with RIP, but there are many better ways we will study them IP routing is scalable, but it is no match for the efficiency of label switching with MPLS What if we want to guarantee service? Quality of Service protocols come in handy TCP and UDP are not the only two transport layer protocols, and for a good reason

This course will teach you to think outside of the box


To consider different approaches to networking tasks To understand why and where a certain architecture is useful To combine the technologies together To design your own network architectures

Course Info
Computer Networking I is highly recommended Lectures
Third & fourth period (09.01.2013 13.05.2013): Wednesdays, 16:15 - 17:45 Tietotalo, TB222

Web page in Moodle2


To be announced soon

Class text and general references


Lecture slides (MOST IMPORTANT) Necessary IEEE, IETF and ITU documents + the Internet resources William Stallings "Data & Computer Communications", 7th edition, Prentice-Hall International Inc., 2004 Andrew S. Tanenbaum "Computer Networks", 4th edition, PrenticeHall International Inc., 2003 Kurose, Ross Computer Networking. A top-down approach featuring the Internet, 3rd edition, 2005

Course Syllabus
Course persons responsible
Dmitri Moltchanov and Yevgeni Koucheryavy Email: moltchan@cs.tut.fi, yk@cs.tut.fi Office: Tietotalo, TH208

Instructors
Alexander Pyattaev, Vitaly Petrov Email: alexander.pyattaev@tut.fi, vitaly.petrov@tut.fi Office: Tietotalo, TH209 and TC240

Course structure, no exceptions will be granted


Lectures (weekly, NOT compulsory) Homeworks with a set of problems to solve (compulsory) Simulation assignment done with OPNET (compulsory)

Supplementary courses:
TLT-2156 Laboratory excercises (basic level, recommended) TLT-2506 Communications laboratory (advanced, recommended)

11/01/2012

TLT-2336, spring 2012, Lecture #1

Course Syllabus - grading


5 credit units, grading scale 0-5
Written exam (see dates in POP)
3h, multiple choice test, will also include basic calculus tasks to solve (similar to Computer Networking I)

Exam admission requires successful completion of all the following:


Homeworks (2 homeworks will be published in Moodle2) Assignment (will be published in Moodle2) Examination 70 points
Must be passed to graduate from the course

The final grade (max 100 pts) consists of:

Homework Assignments 20 pts OPNET or NS2 Assignment 10 pts (tba)

More info will be posted in Moodle2

Outline
Info about the TLT-2336 course Routing algorithms
Link state Distance Vector Hierarchical routing

Routing in the Internet IGP protocols


RIP OSPF

The following slides have been derived from the support material from Computer Networking by Kurose and Ross

Routing algorithms
Routing algorithms Purpose
Link state Distance Vector Hierarchical routing

Consider revising lecture from Computer Networking I course as well


9

Reminder - what is routing?


routing algorithm

local forwarding table header value output link


0100 0101 0111 1001 3 2 2 1

value in arriving packets header


0111

1
3 2

So what is routing?
A set of proceures/algorithms that allows to set up the forwarding tables automatically and intelligently
It is not a network layer protocol it is an application, just like any other service like DNS

Routing is a process that allows to construct routes, it is not responsible for the actual forwarding
In fact, routing protocol is not needed after the network is configured But the forwarding part is of course needed as long as the network works

What happens if the network changes?


We would need to recompute the routing tables

How do we do all that?

Graph abstraction
5 2 1 Graph: G = (N,E)

v
2

3 3 1

w
1

z
2

N = set of routers = { u, v, w, x, y, z } E = set of links ={ (u,v), (u,x), (u,w), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) } Remark: Graph abstraction is useful in other network contexts Example: P2P, where N is set of peers and E is set of TCP connections

Graph abstraction: costs


5 2 1 c(x,x) = cost of link (x,x)

v
2

3 3 1

w
1

- e.g., c(w,z) = 5

z
2

cost could always be 1, or inversely related to bandwidth, or inversely related to congestion

Cost of path (x1, x2, x3,, xp) = c(x1,x2) + c(x2,x3) + + c(xp-1,xp) Question: Whats the least-cost path between u and z ?

Routing algorithm: algorithm that finds least-cost path


11/01/2012 TLT-2336, spring 2012, Lecture #1 13

Routing Algorithm classification


Global or decentralized information?
Global: all routers have complete topology, link cost info link state algorithms Decentralized: router knows physicallyconnected neighbors, link costs to neighbors iterative process of computation, exchange of info with neighbors distance vector 11/01/2012 algorithms

Static or dynamic?
Static: routes change slowly Updates periodically Dynamic: routes change quickly Updates in response to link cost changes

Routing algorithms
Routing algorithms
Link state Distance Vector Hierarchical routing

Link-state routing
Works by analyzing the cost of each edge of the graph
Represents the quality of the links Can be run independently on each host (but it still needs info from each edge)

The routing protocol itself uses flooding to propagate the link states
Flooding is a process of forwarding to everyone, until each host has a copy of a certain link state In some way it works similar to how rumors spread in a crowd: Have you heard the news about route 666 over last 2 seconds? No! Guess what, the route 666 is congested for the last 2 seconds! OR: Have you heard the news about route 666 over last 2 seconds? Yep, I have that news Okay, I'm gonna check on my other neighbors...

A Link-State Routing Algorithm


Dijkstras algorithm
net topology, link costs known to all nodes accomplished via link state broadcast all nodes have same info computes least cost paths from one node (source) to all other nodes gives forwarding table for that node iterative: after k iterations, know least cost path to k destinations

Notation: c(x,y): link cost from


node x to y; = if not direct neighbors

D(v): current value of


cost of path from source to dest. v

p(v): predecessor node


along path from source to v

N': set of nodes whose


least cost path definitively known

Dijsktras Algorithm(home study)


1 Initialization: 2 N' = {u} 3 for all nodes v 4 if v adjacent to u 5 then D(v) = c(u,v) 6 else D(v) = 7 8 Loop 9 find w not in N' such that D(w) is a minimum 10 add w to N' 11 update D(v) for all v adjacent to w and not in N' : 12 D(v) = min( D(v), D(w) + c(w,v) ) 13 /* new cost to v is either old cost to v or known 14 shortest path cost to w plus cost from w to v */ 15 until all nodes in N'
11/01/2012 TLT-2336, spring 2012, Lecture #1 18

Dijkstras algorithm: example(1/2)


Step 0 1 2 3 4 5 N' u ux uxy uxyv uxyvw uxyvwz D(v),p(v) D(w),p(w) 2,u 5,u 2,u 4,x 2,u 3,y 3,y D(x),p(x) 1,u D(y),p(y) 2,x D(z),p(z)

4,y 4,y 4,y

5 2 1

v
2

3 3 1

w
1

z
2

Dijkstras algorithm: example(2/2)


Resulting shortest-path tree from u:

v u

z x
y

Resulting forwarding table in u: destination v x y w


11/01/2012

link (u,v) (u,x) (u,x) (u,x) (u,x)


TLT-2336, spring 2012, Lecture #1 20

Dijkstras algorithm, discussion


Algorithm complexity: n nodes each iteration: need to check all nodes, w, not in N n(n+1)/2 comparisons: O(n2) more efficient implementations possible: O(n*log(n)) Oscillations possible: e.g., link cost = amount of carried traffic
D
1 1 0

A
0 0

1+e e

B
1

C
e

D 1+e 1 B 0 0 C 1 1 recompute routing


e

2+e

D
1

0 1

A
0 0

2+e 1+e

B
1

2+e

C
e

D 1+e 1 B 0 0 C 1 1
e

initially
Solutions:

recompute

recompute

Link costs not depend on the amount of traffic Ensure that not all routers run LS at the same time

Routing algorithms
Routing algorithms
Link state Distance Vector Hierarchical routing

11/01/2012

TLT-2336, spring 2012, Lecture #1

22

Distance Vector Algorithm


We can run an algorithm similar to Djikstra in a distributed manner too, this way we do not need to know anything about the nodes that are not our neighbors in the graph. For that we use the famous Bellman-Ford Equation (dynamic programming) For nodes x,y,and v Define dx(y) := cost of least-cost path from x to y Then dx(y) = min {c(x,v) + dv(y) }
where min is taken over all neighbors v of x

Bellman-Ford example
5 2 1

v
2

3 3

w
1

Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3 z B-F equation says:

du(z) = min { c(u,v) + dv(z), y 1 c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4 Node that achieved minimum is next hop in shortest path forwarding table x
2
11/01/2012 TLT-2336, spring 2012, Lecture #1 24

Distance Vector Algorithm(1/2)


Dx(y) = estimate of least cost from x to y Node x knows cost to each neighbor v: c(x,v) Node x maintains distance vector Dx = [Dx(y): y N ] Node x also maintains its neighbors distance vectors
For each neighbor v, x maintains Dv = [Dv(y): y N ]

11/01/2012

TLT-2336, spring 2012, Lecture #1

25

Distance Vector Algorithm(1/2)


Basic idea: From time-to-time, each node sends its own distance vector estimate to neighbors Asynchronous When a node x receives new DV estimate from neighbor, it updates its own DV using B-F equation: D (y) minv{c(x,v) + Dv(y)} for each node y N x
Under minor, natural conditions, the estimate

Dx(y) converge to the actual least cost dx(y)

11/01/2012

TLT-2336, spring 2012, Lecture #1

26

Distance Vector Algorithm


Iterative, asynchronous:
each local iteration caused by: local link cost change DV update message from neighbor

Each node: wait for (change in local link cost


or message from a neighbor)

Distributed:
each node notifies neighbors only when its DV changes
neighbors then notify their neighbors if necessary

recompute estimates
if DV to any node has changed, notify neighbors

11/01/2012

TLT-2336, spring 2012, Lecture #1

27

Yet another example (home study)


node x table cost to x y z x 0 2 y z node y table cost x y from from from 7 to z cost to x y z x 0 2 3 y 2 0 1 z 7 1 0

Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3


Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2 2

y
7

x y 2 0 1 z node z table cost to x y z x y z 71 0 from

time

Yet another example (home study)


Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} Dx(z) = min{c(x,y) + = min{2+0 , 7+1} = 2 Dy(z), c(x,z) + Dz(z)} node x table = min{2+1 , 7+0} = 3 cost to cost to cost to x y z x y z x y z x 0 2 7 x 0 2 3 x 0 2 3 Forwarding table at x y y 2 0 1 y 2 0 1 v*(y) = v*(z) =y z z 7 1 0 z 3 1 0 node y table cost to cost to cost to x y z x y z y x y z 2 1 x x 0 2 7 x 0 2 3 x z y 2 0 1 y 2 0 1 7 y 2 0 1 z z 7 1 0 z 3 1 0 node z table cost to cost to cost to x y z x y z x y z x 0 2 7 x 0 2 3 x y 2 0 1 y 2 0 1 y z 3 1 0 z 3 1 0 z 71 0 time 11/01/2012 from from from from from from from from from

Distance Vector: link cost changes


Link cost changes:
node detects local link cost change

updates routing info, recalculates distance vector if DV changes, notify neighbors

y
50

good news travels fast

At time t0, y detects the link-cost change, updates its DV, and informs its neighbors.

At time t1, z receives the update from y and updates its table. It computes a new least cost to x and sends its neighbors its DV. At time t2, y receives zs update and updates its distance table. ys least costs do not change and hence y does not send any message to z.

11/01/2012

TLT-2336, spring 2012, Lecture #1

30

Distance Vector: link cost changes


Link cost changes:

good news travels fast bad news travels slow - count to infinity problem! 44 iterations before algorithm stabilizes: see text If Z routes through Y to get to X:

60

y
50

Poisoned reverse:

Z tells Y its (Zs) distance to X is infinite (so Y wont route to X via Z)

will this completely solve count to infinity problem?

No! It is good only for loops involving only two nodes TLT-2336, spring 2012, Lecture #1 31

11/01/2012

Comparison of LS and DV algorithms


Message complexity
LS: with n nodes, E links, O(nE) msgs sent DV: exchange between neighbors only convergence time varies

Robustness: what happens if router malfunctions? LS:


node can advertise incorrect link cost each node computes only its own table

Speed of Convergence
LS: O(n2) algorithm requires O(nE) messages may have oscillations DV: convergence time varies may be routing loops count-to-infinity

DV:
DV node can advertise incorrect path cost each nodes table used by others
error propagate through network

Internet routing
Routing algorithms
Link state Distance Vector Hierarchical routing Internet routing

Hierarchical Routing
Our routing study thus far - idealization all routers identical network flat not true in practice scale: with 200 million destinations:
cant store all destinations in routing tables! (~2.4 GB just to store them) routing table exchange would take ages!

administrative autonomy
Internet = network of networks each network administrator may want to control routing in its own network

Hierarchical Routing
aggregate routers into regions, autonomous systems (AS) routers in same AS run same routing protocol
intra-AS routing protocol routers in different AS can run different intra-AS routing protocol
11/01/2012 TLT-2336, spring 2012, Lecture #1 35

Gateway router Direct link to router in another AS

Interconnected AS

3a 3b AS3 1a

3c

1c 1d 1b AS1

2a

2c
AS2

2b

Intra-AS Routing algorithm

Inter-AS Routing algorithm

forwarding table configured by both intra- and inter-AS routing algorithm


intra-AS sets entries for internal destinations inter-AS & intra-AS sets entries for external destinations

Forwarding table

Inter-AS tasks
suppose router in AS1 receives datagram destined outside of AS1: router should forward packet to gateway router, but which one? AS1 must: 1. learn which destinations are reachable through AS2, which through AS3 2. propagate this reachability info to all routers in AS1 Job of inter-AS routing!
2a 1b AS1 2c
AS2

3a 3b AS3 1a

3c

1c 1d

2b

Internet routing
Routing in the Internet Interior Gateway Protocols protocols
RIP OSPF

11/01/2012

TLT-2336, spring 2012, Lecture #1

38

Intra-AS Routing
also known as Interior Gateway Protocols (IGP) most common Intra-AS routing protocols:
RIP: Routing Information Protocol OSPF: Open Shortest Path First IGRP: Interior Gateway Routing Protocol (Cisco proprietary)

11/01/2012

TLT-2336, spring 2012, Lecture #1

39

RIP ( Routing Information Protocol)


Not really used anymore home study distance vector algorithm included in BSD-UNIX Distribution in 1982 distance metric: # of hops (max = 15 hops)
From router A to subnets: u v w destination hops u 1 v 2 w 2 x 3 y 3 z 2

z
11/01/2012

x y

TLT-2336, spring 2012, Lecture #1

40

RIP advertisements
distance vectors: exchanged among neighbors every 30 sec via Response Message (also called advertisement) each advertisement: list of up to 25 destination subnets within AS

11/01/2012

TLT-2336, spring 2012, Lecture #1

41

RIP: Example
z w A x D C
Destination Network

w y z x

Next Router

.
11/01/2012

A B B -.

Num. of hops to dest.

2 2 7 1

....

Routing/Forwarding table in D
TLT-2336, spring 2012, Lecture #1 42

RIP: Example
Dest w x z . Next C hops 1 1 4 ...

Advertisement from A to D

z x D
Next Router

Destination Network

w y z x

.
11/01/2012

A B B A -.

Num. of hops to dest.

2 2 7 5 1
....

Routing/Forwarding table in D TLT-2336, spring 2012, Lecture #1

43

RIP: Link Failure and Recovery


If no advertisement heard after 180 sec --> neighbor/link declared dead
routes via neighbor invalidated new advertisements sent to neighbors neighbors in turn send out new advertisements (if tables changed) link failure info quickly (?) propagates to entire net poison reverse used to prevent ping-pong loops (infinite distance = 16 hops)

11/01/2012

TLT-2336, spring 2012, Lecture #1

44

RIP Table processing


RIP routing tables managed by applicationlevel process called route-d (daemon) advertisements sent in UDP packets, periodically repeated
routed Transprt (UDP) network (IP) link physical
11/01/2012

routed Transprt (UDP)

forwarding table

forwarding table

network (IP) link physical

TLT-2336, spring 2012, Lecture #1

45

Internet routing
Routing in the Internet IGP protocols
RIP OSPF

11/01/2012

TLT-2336, spring 2012, Lecture #1

46

OSPF (Open Shortest Path First)


open: publicly available uses Link State algorithm
LS packet dissemination topology map at each node route computation using Dijkstras algorithm link cost definition up to the administrator

OSPF advertisement carries one entry per neighbor router advertisements disseminated to entire AS (via flooding)
carried in OSPF messages directly over IP (rather than TCP or UDP

OSPF advanced features (not in RIP)

security: all OSPF messages authenticated (to prevent malicious intrusion), 2 modes:
simple authentication same password for all routers, passed in the message (plaintext not very secure) MD5 authentication shared secret keys used, MD5 hash computed for each OSPF message content, used with sequence numbers (against reply attacks)

multiple same-cost paths allowed (only one path in RIP)


Only one chosen for carrying traffic though

11/01/2012

TLT-2336, spring 2012, Lecture #1

48

OSPF advanced features (not in RIP)

For each link, multiple cost metrics for different TOS (e.g., satellite link cost set low for best effort; high for real time)
Up to the network administrator

integrated uni- and multicast support:


Multicast OSPF (MOSPF) uses same topology data base as OSPF New type of link-state advertisement used for that

hierarchical OSPF in large domains


Within a single AS, different areas defined

11/01/2012

TLT-2336, spring 2012, Lecture #1

49

Hierarchical OSPF

Hierarchical OSPF
two-level hierarchy: local area, backbone.
Link-state advertisements only in area each node has detailed area topology; only knows direction (shortest path) to nets in other areas.

area border routers: summarize distances to nets in own area, advertise to other Area Border routers. backbone routers: run OSPF routing limited to backbone. boundary routers: connect to other ASs.

Checklist: Check course regulations Understand why do we need routing Review routing algorithms Review routing protocols Understand what is an AS

Você também pode gostar