routing and networking
DESCRIPTION
Usefull resource for learning networking and communications concepts.TRANSCRIPT
Lecture 1
Introduction to the courseRouting protocols
Lecturer: Alexander Pyattaev
2
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
5
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, Prentice-
Hall International Inc., 2003 Kurose, Ross “Computer Networking. A top-down approach
featuring the Internet”, 3rd edition, 2005
11/01/2012 TLT-2336, spring 2012, Lecture #1 6
Course Syllabus Course persons responsible
Dmitri Moltchanov and Yevgeni Koucheryavy Email: [email protected], [email protected] Office: Tietotalo, TH208
Instructors Alexander Pyattaev, Vitaly Petrov Email: [email protected], [email protected] 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)
7
Course Syllabus - grading5 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)
The final grade (max 100 pts) consists of: Examination 70 points
Must be passed to graduate from the course
Homework Assignments 20 pts OPNET or NS2 Assignment 10 pts (tba)
More info will be posted in Moodle2
8
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
9
Consider revising lecture from Computer Networking I course as well
1
23
0111
value in arrivingpacket’s header
routing algorithm
local forwarding tableheader value output link
0100010101111001
3221
Reminder - what is routing?
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?
u
yx
wv
z2
21
3
1
1
2
53
5
Graph: G = (N,E)
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) }
Graph abstraction
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
u
yx
wv
z2
21
3
1
1
2
53
5 • c(x,x’) = cost of link (x,x’)
- e.g., c(w,z) = 5
• 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: What’s the least-cost path between u and z ?
Routing algorithm: algorithm that finds least-cost path
1311/01/2012
TLT-2336, spring 2012, Lecture #1
Routing Algorithm classification
Global or decentralized information?
Global: all routers have complete
topology, link cost info “link state” algorithmsDecentralized: router knows physically-
connected neighbors, link costs to neighbors
iterative process of computation, exchange of info with neighbors
“distance vector” algorithms
Static or dynamic?Static: routes change slowly
Updates periodically
Dynamic: routes change quickly
Updates in response to link cost changes
11/01/2012
Routing algorithms Link state Distance Vector Hierarchical routing
Routing algorithms
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
Dijkstra’s 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
Dijsktra’s 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'
1811/01/2012
TLT-2336, spring 2012, Lecture #1
Dijkstra’s algorithm: example(1/2)
Step012345
N'u
uxuxy
uxyvuxyvw
uxyvwz
D(v),p(v)2,u2,u2,u
D(w),p(w)5,u4,x3,y3,y
D(x),p(x)1,u
D(y),p(y)∞
2,x
D(z),p(z)∞ ∞
4,y4,y4,y
u
yx
wv
z2
21
3
1
1
2
53
5
Dijkstra’s algorithm: example(2/2)
u
yx
wv
z
Resulting shortest-path tree from u:
vxywz
(u,v)(u,x)(u,x)(u,x)(u,x)
destination link
Resulting forwarding table in u:
2011/01/2012
TLT-2336, spring 2012, Lecture #1
Dijkstra’s algorithm, discussionAlgorithm 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
AD
CB
1 1+e
e0
e1 1
0 0
AD
CB
2+e 0
001+e 1
AD
CB
0 2+e
1+e10 0
AD
CB
2+e 0
001+e 1
initially … recomputerouting
… recompute … recompute
Solutions: Link costs not depend on the amount of trafficEnsure that not all routers run LS at the same time
11 11 11e e e
11 111 111 1111
Routing algorithms Link state Distance Vector Hierarchical routing
2211/01/2012
TLT-2336, spring 2012, Lecture #1
Routing algorithms
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
u
yx
wv
z2
21
3
1
1
2
53
5Clearly, dv(z) = 5, dx(z) = 3, dw(z) = 3
du(z) = min { c(u,v) + dv(z), c(u,x) + dx(z), c(u,w) + dw(z) } = min {2 + 5, 1 + 3, 5 + 3} = 4
Node that achieved minimum is nexthop in shortest path ➜ forwarding table
B-F equation says:
2411/01/2012
TLT-2336, spring 2012, Lecture #1
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 ]
2511/01/2012
TLT-2336, spring 2012, Lecture #1
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:Dx(y) min← v{c(x,v) + Dv(y)} for each node y ∊ N
Under minor, natural conditions, the estimate Dx(y) converge to the actual least cost dx(y)
2611/01/2012
TLT-2336, spring 2012, Lecture #1
Distance Vector Algorithm
Iterative, asynchronous: each local iteration caused by:
local link cost change DV update message from
neighbor
Distributed: each node notifies
neighbors only when its DV changes neighbors then notify
their neighbors if necessary
wait for (change in local link cost or message from a neighbor)
recompute estimates
if DV to any node has changed,
notify neighbors
Each node:
2711/01/2012
TLT-2336, spring 2012, Lecture #1
x y zxyz
0 2 7∞∞ ∞∞∞ ∞
from
cost to
from
from
x y zxyz
0
from
cost to
x y zxyz
∞ ∞
∞∞ ∞
cost to
x y zxyz
∞∞ ∞7 1 0
cost to
∞2 0 1
∞ ∞ ∞
2 0 17 1 0
time
x z12
7
y
node x table
node y table
node z table
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2
Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3
32
Yet another example (home study)
x y zxyz
0 2 7∞∞ ∞∞∞ ∞
from
cost to
from
from
x y zxyz
0 2 3
from
cost tox y z
xyz
0 2 3fr
om
cost to
x y zxyz
∞ ∞
∞∞ ∞
cost tox y z
xyz
0 2 7
from
cost tox y z
xyz
0 2 3
from
cost to
x y zxyz
0 2 3
from
cost tox y z
xyz
0 2 7
from
cost tox y z
xyz
∞∞ ∞7 1 0
cost to
∞2 0 1
∞ ∞ ∞
2 0 17 1 0
2 0 17 1 0
2 0 13 1 0
2 0 13 1 0
2 0 1
3 1 02 0 1
3 1 0
time
x z12
7
y
node x table
node y table
node z table
Dx(y) = min{c(x,y) + Dy(y), c(x,z) + Dz(y)} = min{2+0 , 7+1} = 2
Dx(z) = min{c(x,y) + Dy(z), c(x,z) + Dz(z)} = min{2+1 , 7+0} = 3
v*(y) = v*(z) =yForwarding table at x
11/01/2012
Yet another example (home study)
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
“goodnews travelsfast”
x z14
50
y1
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 z’s update and updates its distance table. y’s least costs do not change and hence y does not send any message to z.
3011/01/2012
TLT-2336, spring 2012, Lecture #1
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 textPoisoned reverse: If Z routes through Y to get to X:
Z tells Y its (Z’s) distance to X is infinite (so Y won’t route to X via Z)
will this completely solve count to infinity problem?
No! It is good only for loops involving only two nodes
x z14
50
y60
3111/01/2012
TLT-2336, spring 2012, Lecture #1
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
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
problem
Robustness: what happens if router malfunctions?
LS: node can advertise
incorrect link cost each node computes
only its own table
DV: DV node can advertise
incorrect path cost each node’s table used
by others error propagate
through network
Internet routing
Routing algorithms Link state Distance Vector Hierarchical routing – Internet routing
Hierarchical Routing
scale: with 200 million destinations:
can’t 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
Our routing study thus far - idealization all routers identical network “flat”… not true in practice
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
Gateway router Direct link to router
in another AS
3511/01/2012
TLT-2336, spring 2012, Lecture #1
3b
1d
3a
1c2aAS3
AS1AS2
1a
2c2b
1b
Intra-ASRouting algorithm
Inter-ASRouting algorithm
Forwardingtable
3c
Interconnected AS
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
3b
1d
3a
1c2aAS3
AS1AS2
1a
2c2b
1b
3c
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!
Internet routing
Routing in the Internet – Interior Gateway Protocols protocols RIP OSPF
3811/01/2012
TLT-2336, spring 2012, Lecture #1
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)
3911/01/2012
TLT-2336, spring 2012, Lecture #1
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)
DC
BA
u vw
x
yz
destination hops u 1 v 2 w 2 x 3 y 3 z 2
From router A to subnets:
4011/01/2012
TLT-2336, spring 2012, Lecture #1
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
4111/01/2012
TLT-2336, spring 2012, Lecture #1
RIP: Example
Destination Network Next Router Num. of hops to dest. w A 2
y B 2 z B 7
x -- 1…. …. ....
w x y
z
A
C
D B
Routing/Forwarding table in D
4211/01/2012
TLT-2336, spring 2012, Lecture #1
RIP: Example
Destination Network Next Router Num. of hops to dest. w A 2
y B 2 z B A 7 5
x -- 1…. …. ....
Routing/Forwarding table in D
w x y
z
A
C
D B
Dest Next hops w - 1 x - 1 z C 4 …. … ...
Advertisementfrom A to D
4311/01/2012
TLT-2336, spring 2012, Lecture #1
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)
4411/01/2012
TLT-2336, spring 2012, Lecture #1
RIP Table processing
RIP routing tables managed by application-level process called route-d (daemon)
advertisements sent in UDP packets, periodically repeated
physicallink
network forwarding (IP) table
Transprt (UDP)
routed
physicallink
network (IP)
Transprt (UDP)
routed
forwardingtable
4511/01/2012
TLT-2336, spring 2012, Lecture #1
Internet routing
Routing in the Internet – IGP protocols RIP OSPF
4611/01/2012
TLT-2336, spring 2012, Lecture #1
OSPF (Open Shortest Path First)
“open”: publicly available uses Link State algorithm
LS packet dissemination topology map at each node route computation using Dijkstra’s 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
4811/01/2012
TLT-2336, spring 2012, Lecture #1
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
4911/01/2012
TLT-2336, spring 2012, Lecture #1
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 AS’s.
Checklist:Check course regulationsUnderstand why do we need routingReview routing algorithmsReview routing protocolsUnderstand what is an AS