Chapter 6

Download as pdf or txt
Download as pdf or txt
You are on page 1of 32

Data Chapter 6

Routing in Switched Networks

January 10, 2020

By Lake F.
Outlines
2

By Lake F.
Review: Two Key Network-Layer Functions
3
Analogy:
Routing:
● Forwarding: process of
 Determine route taken by
packets from source to getting through single
destination. interchange.
Forwarding:  Passing thru A.A

 Move packets from ● Routing: process of


router’s input to planning trip from
appropriate router source to dest.
output.  Gonder - A.A - Jimma
By Lake F.
Introduction to Routing
4

 Routing is one of the most complex and crucial design aspects


of switched data networks.
 Routed networks are often large and complex, and it would be
very difficult to manage and update network information on all
routers all the time.
 The primary function of a packet-switching network is to
accept packets from a source station and deliver them to a
destination station.

By Lake F.
Cont’
5

 Hence, a routing function must be performed and some of


the requirements for this function are include:
 Correctness
 Simplicity
 Optimality
 Efficiency
 Stability

By Lake F.
Cont’
6

 Several routing algorithms have been developed to address

routing and updating information difficulties.

 These algorithms allow the routers to learn about the

network and then make decisions based on that information.

 To learn paths (or routes) through a network, and make

decisions on where to send packets, a router use the following


parameters:

By Lake F.
Cont’
7

 Destination address: Typically the IP address of the

packet destination.

 Source address: Where the information came from.

 Possible routes: Routes that can get information from its

present location or source to some other location.

 Best route: The best path to the intended destination.

 Status of routes: The current state of routes, which

routers track to ensure timely delivery of information.


By Lake F.
How to determine “best” path?
8

Performance criteria used for selection of route:

 Hop count: Number of times a packet goes over a router.

 Delay: Time required to reach the destination.

 Reliability: Bit-error rate of each network link.

 Cost: Arbitrary value based on a network.

 Maximum transmission unit (MTU): Maximum


message length (or packet size) allowed on the path.

 The “minimum hop” can be generalized as “least cost” routing.

By Lake F.
Graph theory: Defn.
9

 A graph is a set of vertices (or nodes) linked by edges.

1
3

2 5
4
 Mathematically, we often write G = (V,E)
 V: set of vertices, so |V| = number of vertices
 E: set of edges, so |E| = number of edges

By Lake F.
Graph theory: The need
10

 To present the relationships between different


objects/elements in a mathematical way
 Examples:
 Network connections
 Friendship
 Roads, Airline routes,
 Question: What could the vertices and edges
represent in the above examples?

By Lake F.
Real-time example: Graph application
11

3 Hospital
4
Maraki
1 5
Arada
College
5

Azezo
7 1

Mesgid

Question: Which road has least cost from Azezo to Arada?


By Lake F.
Graph theory: for routing
12
Routing protocol
5
Goal: determine “good” path
(sequence of routers) through 3
v w
network from source to 2 5
destination.
u 2 1 z
 Graph abstraction for 3
1
2
routing algorithms: G(N,E) x y
1
 Graph nodes (set N) are
routers. “Good” path: minimum cost path.

 Graph edges (set E) are


physical links.
By Lake F.
Routing Algorithms: Graph abstraction
13

5
3
v w 5
2
u 2 1 z
3
1 2
x 1
y
Graph: G = (N,E)

♪ N = set of routers = { u, v, w, x, y, z }
♪ E = set of links ={ (u,v), (u,x), (v,x), (v,w), (x,w), (x,y), (w,y), (w,z), (y,z) }

By Lake F.
Graph abstraction: costs
14

5
 c(A,A’) = cost of link (A,A’)
3
v w 5
2
u Example: c(w,z) = 5
2
3
1 z
1 2
x 1
y

Cost of path (x1, x2, x3,…, xp) = c(x1,x2) + c(x2,x3) + … + c(xp-1,xp)

Question: What is the least-cost path between u and z ?

Routing algorithm: algorithm that finds least-cost path!

By Lake F.
Routing protocols-classification
15

Routing protocols

Adaptive(dynamic) Non-Adaptive(static)

Interior Gateway Exterior Gateway


Protocol(IGP) Protocol(EGP)

Distance Vector Link State

Most Important !

By Lake F.
Cont’
16

Dynamic: Interior Gateway


Protocol(IGP)
 Learn about changes in the
 Handle routing within an
network automatically.
Autonomous system.
Static:
Exterior Gateway
 Only a network
Protocol(EGP)
administrator can change
 Handle routing outside an
an information.
Autonomous system.

By Lake F.
Cont’
17

Note:
 An autonomous system is a network or a collection of

networks that are all supervised by a single entity or an


organization.

By Lake F.
Distance-Vector (DV) routing
18

 Bellman-Ford algorithm is used to perform routing.

 It is least cost algorithm.

 Each node knows the distance (cost) to its directly

connected neighbors.

 A node sends a list to its neighbors with the current

distances to all nodes.

By Lake F.
Cont’
19

 When a router receives information from another router, it


increments whatever metric it is using. This process is called
distance accumulation.
 Routers using this method know the distance between any
two points in the network, but they do not know the exact
topology of an internetwork.
 Distance vector uses regular updates and sends the whole
routing table every time.
 RIP is in use today.
By Lake F.
Cont’
20

Basic idea:
 From time-to-time, each node sends its own distance

vector estimate to neighbors.

B-F equation:

Dx(y) ← minv{c(x,v) + Dv(y)} for each node y ∊ N

• Dx(y) = Least cost path from x to y


• min is taken over all neighbors v of x

By Lake F.
How Distance vector routing works?
21
1 Initialization:
2 for all destinations y:
3 Dx (y) = c(x,y)
4 for all neighbors w: //for all destinations y: Dw(y) = infinity
6 for all neighbors w: // send Dx(y)
7
8 loop
9 wait (until I see a link cost change to neighbor w
10 or until I receive update from neighbor w)
11
12 for all destinations y:
13 Dx(y) = minv { c(x,v) + Dv(y) }
14
15 if we have a new Dx(Y) for any destination Y
24 send new values Dx(Y) to all neighbors
25
26 forever

By Lake F.
Example: Initialization of tables
22

22.22

By Lake F.
Example- Final Distance vector routing tables
23

22.23

By Lake F.
Example
24
5
Clearly, dv(z) = 5, dx(z) = 3,
dw(z) = 3 3
v w
2 5
u 2 1 z
3
B-F equation says: 1
2
x y
1
Cost between u&z
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 achieves minimum is next hop in shortest path.

By Lake F.
Link-State (LS) Routing
25

 The shortest paths can be compute with Dijkstra’s algorithm.

 It is Least-cost routing algorithm.

 Measure the delay (cost) to its neighbors.

 The distance information (link state) is broadcast to all

nodes in the network.

 Each node calculates the routing tables independently.

By Lake F.
Cont’
26

 Link-state routing provides better scaling than distance-

vector routing because it only sends updates when there is a


change in the network, and then it only sends information
specific to the change that occurred.

 It is designed to overcome the drawbacks of DV routing.

 When a router is initialized, it determines the link cost on

each of its network interfaces.

By Lake F.
Cont’
27

 The router then advertises this set of link costs to all other

routers in the internet topology, not just neighboring routers.

 Open Shortest Path First (OSPF) is the main protocol in use

today.

Dijkstra’s algorithm:

“Find the shortest path from a given source node to all other
nodes by developing the paths for increasing path length.”

By Lake F.
How Link state Routing works?
28
1 Initialization:
2 N = {S}
3 for all nodes v
4 if v adjacent to S
5 then D(v) = c(S,v)
6 else D(v) = infinity
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

By Lake F.
Example
29

Step start N D(B),p(B) D(C),p(C) D(D),p(D) D(E),p(E) D(F),p(F)


0 A 2,A 5,A 1,A infinity infinity
1 AD 2,A 4,D 2,D infinity
2 ADE 2,A 3,E 4,E
3 ADEB 3,E 4,E
4 ADEBC 4,E
5 ADEBCF

5
3
B C 5
2
A 2 1 F
3
1 2
D E
1

By Lake F.
Example…
30
Resulting shortest-path tree from A:

B C
A F

D E

Resulting forwarding table in A: Destination Link

B (A,B)
D (A,D)
C (A,D,E,C)
E (A,D,E)
F (A,D,E,F)

By Lake F.
Comparisons
31

Distance vector routing Link State routing


 Bellman-Ford algorithm is used.  Dijsktra algorithm is used.

 The routers receive the topological  The router receive complete

information from the neighbor. information on the network

 Calculates the best route based on topology.

the distance.  Calculates the best route on the

 Updates full routing table. basis of least cost.

 Simple to implement.  Updates only the link state

 Complex to implement

By Lake F.
By Lake F.

You might also like

pFad - Phonifier reborn

Pfad - The Proxy pFad of © 2024 Garber Painting. All rights reserved.

Note: This service is not intended for secure transactions such as banking, social media, email, or purchasing. Use at your own risk. We assume no liability whatsoever for broken pages.


Alternative Proxies:

Alternative Proxy

pFad Proxy

pFad v3 Proxy

pFad v4 Proxy