0% found this document useful (0 votes)
7 views

Mod3 Routing2

Uploaded by

Riya
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Mod3 Routing2

Uploaded by

Riya
Copyright
© © All Rights Reserved
Available Formats
Download as PPTX, PDF, TXT or read online on Scribd
You are on page 1/ 78

Routing

Computer Netwroks, GECT-Ali M A


Routing
 Switches and routers have enough knowledge of the network
topology so they can choose the right port onto which each
packet should be sent.
 In the case of virtual circuits, routing is an issue only for the
connection request packet;
 In datagram networks, routing is an issue for every packet.
 Router determine which of the output ports (route) is the best
choice to get the packet to the destination
 The router makes this decision by consulting a forwarding table.
 The fundamental problem of routing is, how do routers acquire
the information to make the forwarding table

2
Computer Netwroks, GECT-Ali M A
Routing
 Forwarding : take packet >> read destination
address >> consult forwarding table >> and send the
packet in a direction determined by the table.

 Routing is the process by which forwarding tables


are built.

 Forwarding is a relatively simple and well-defined


process performed locally at a node,

 Routing depends on complex distributed algorithms

3
Computer Netwroks, GECT-Ali M A
Network as a Graph
 Routing is, in essence, a problem of graph theory
 The nodes of the graph, labeled A through F, may be either hosts,
switches, routers, or networks
 The edges of the graph correspond to the network links. Each edge
has an associated cost, which gives some indication of the desirability
of sending traffic over that link
 Routing is to find the lowest-cost path between any two nodes,
 cost of a path equals the sum of the costs of all the edges that make up the path

graph representing a
network

4
Computer Netwroks, GECT-Ali M A
Network Performance Metrics
Metrics
• Property of a route in computer networking,
• Any value used by a routing protocol to select one route over
another.
• For example, Routing Information Protocol (RIP) uses hop count
to determine the best possible route.

A Metric can include:


• link utilization
• number of hops (hop count)
• packet loss (router congestion/conditions)
• latency (delay)
• path reliability
• path bandwidth
• throughput
• speed of the path

Computer Netwroks, GECT-Ali M A


Network Performance Metrics
Latency :

• Amount of time for data to travel from one


location to another across a network
• Also referred as delay,
• Is often less than 100 milliseconds on
today’s high­-speed network, which has very
little impact on Web surfing.

Computer Netwroks, GECT-Ali M A


Network Performance Metrics
Bandwidth and throughput
• Sometimes used interchangeably,
• They are related but not the same.
• Both refer to the amount of data transferred
between two points on a network per unit time.
• Bandwidth :theoretical maximum,(capacity of the
link)
• Throughput: real value, practical measurement.
• Throughput and speed also used interchangeably

Computer Netwroks, GECT-Ali M A


Bandwidth and throughput

Computer Netwroks, GECT-Ali M A


Bandwidth and throughput

Computer Netwroks, GECT-Ali M A


Bandwidth and throughput

Computer Netwroks, GECT-Ali M A


Bandwidth and throughput

Computer Netwroks, GECT-Ali M A


Routing protocol

The purpose of any routing protocol


 Select the best path to reach the destination.
 Detect and update topology changes
 Send and receive updates
• dynamically communicate information about all network paths

Broad categories of routing protocols


 distance vector (DV) routing protocol
 link state (LS) routing protocol

Computer Netwroks, GECT-Ali M A


Distance vector (DV) routing protocol

In DV the best routing path is selected based on a


distance metric (the distance) and an interface (the
vector),

Link State (LS) routing protocol

In LS best routing path is selected by calculating the


state of each link in a path and finding the path that has
the lowest total metric.

Computer Netwroks, GECT-Ali M A


Distance vector (DV) routing protocol
 Router knows 2 things
 Distance to final destination
 Vector, or direction, traffic
should be directed Initial Routing table at A

Cost Next
B

C
A
D Hop
E B 1 B
F G C 1 C

• With this D ∞ -
information, routing E 1 E
table at A is --> F 1 F
Evolution of the table.
Final Routing table at A
• Each node sends a message to
neighbors with a list of distances.
Cost Next
• F --> A with G is at a distance 1 Hop
• C --> A with D at distance 1.
B 1 B
C 1 C
B D 2 C
E 1 E
C
A
D

E F 1 F
F G G 2 F
Evolution of the table.
Final Routing table at B

Cost Next
B
Hop
C

A 1 A
A
D

E
C 1 C
D 2 C
F G

E 2 A
F 2 A
G 3 C
Evolution of the table.
Final Routing table at G

Cost Next
B
Hop
C

A 2 F
A
D

E
B 3 D
C 2 D
F G

D 1 D
E 3 F
F 1 F
Final Distance Matrix
B A B C D E F G
C
A

A 0 1 1 2 1 1 2
D

B 1 0 1 2 2 2 3
F G

C 1 1 0 1 2 2 2
D 2 2 1 0 3 2 1
E 1 2 2 3 0 2 3
F 1 2 2 2 2 0 1
G 2 3 2 1 3 1 0
Note:

In distance vector routing,


Each node shares its routing table
with its immediate neighbors
periodically and when there is a
change.

Computer Netwroks, GECT-Ali M A


Distance-vector routing protocol
1. Initially,
• Each Router makes a list of networks it can
reach, and no. of hops to reach it.
• The number of hops for these networks will be 1.
• This table is called a routing table.
2. Periodically (typically every 30th second)
• Routing table is shared with neighboring routers
(uses inter-router protocol)
• Neighboring routers will add 1 to every hop-count
o needs one hope to reach the router that sent the table.

• This information is shared between physically


connected routers ("neighbors"),
Computer Netwroks, GECT-Ali M A
Distance Vector Routing Protocols
• Examples of Distance Vector routing protocols:
– Routing Information Protocol (RIP)
– Interior Gateway Routing Protocol (IGRP)
– Enhanced Interior Gateway Routing Protocol (EIGRP)

Computer Netwroks, GECT-Ali M A


Routing Protocol Characteristics

– Criteria used to compare routing protocols


• Time for convergence
• Scalability
• Resource usage
• Implementation & maintenance

Computer Netwroks, GECT-Ali M A


DV Routing Problems: Example

• Consider the network shown below:

1 1 2 1
A B C
Dest Dist Port Dest Dist Port Dest Dist Port
B 1 1 A 1 1 A 2 1
C 2 1 C 1 2 B 1 1

Computer Netwroks, GECT-Ali M A


DV Routing Problems: Example
• What happens if we have link failure between B & C?
• B will realize there is a problem and tries to determine another route to C

1 1 2 1
A B X C
Dest Dist Port Dest Dist Port Dest Dist Port
B 1 1 A 1 1 A 2 1
C 2 1 C 1 2 B 1 1

Computer Netwroks, GECT-Ali M A


DV Routing Problems: Example

• B will ask its neighbours (i.e. A), if they can reach C


• How will A respond?
– Look at A’s routing table to find the answer

1 1 2 1
A B X C
Dest Dist Port Dest Dist Port
B 1 1 A 1 1
C 2 1 C ? ?

Computer Networks, GECT-Ali M A


DV Routing Problems: Example

• A thinks that it can reach C in 2 hops


– This path is through B, but that is not known to A
• B will get this information and (falsely) think it can access C
through A
– B believes that the path is 3 hops

1 1 2 1
A B X C
Dest Dist Port Dest Dist Port
B 1 1 A 1 1
C 2 1 C 3 1

Computer Netwroks, GECT-Ali M A


DV Routing Problems: Example

• Now suppose B has a message for C:


– It will send the message to A
• Just as its routing table suggests
– A will send the message back to B
– This will put the packet into a continuous loop

1 1 2 1
A B X C
Dest Dist Port Dest Dist Port
B 1 1 A 1 1
C 2 1 C 3 1

Computer Netwroks, GECT-Ali M A


DV Routing Problems: Routing loops

1 1 2 1
A B C
Dest Dist Port Dest Dist Port Dest Dist Port
B 1 1 A 1 1 A 2 1
C 2 1 C 1 2 B 1 1

1 1 2 1
A B X C
Dest Dist Port Dest Dist Port

B 1 1 A 1 1
C 2 1 C 3 1

Computer Netwroks, GECT-Ali M A


Distance Vector(DV) Routing Protocols
Advantages
 Simple to implement and maintain
• The level of knowledge required about the network is relatively less
 Low resource requirements
• Do not need large amount of memory
• No need for powerful CPU
• Less BW requirement for routing updates
Disadvantages
 Slow convergence because of periodic updates
 Limited scalability
 Slow convergence limits the network size
• Takes more time to propagate the routing information
 Routing loops: Due to slow convergence routing tables
are not updated in time
Computer Netwroks, GECT-Ali M A
Link state routing protocols
• Also known as shortest path first algorithms(OSPF)
• The shortest path to a destination is not necessarily the path with the least
number of hops
• Link state routing protocols are more intelligent than DV protocols
• Each routers learns about its own directly connected networks
• Routers exchange hello packet to “meet” other directly connected
routers
• Each router builds its own Link State Packet (LSP) which includes
information about neighbors such as neighbor ID, link type, & bandwidth
• After the LSP is created the router floods it to all neighbors who then
store the information and then forward it until all routers have the same
information
• Once all the routers have received all the LSPs, the routers then
construct a topological map of the network which is used to determine
the best routes to a destination

Computer Netwroks, GECT-Ali M A


Link state routing protocols
• Capable of determining the best route
based on the following:
– Delay
– Load
– Reliability

Computer Netwroks, GECT-Ali M A


Link-State Routing Protocols
• Requirements for link state routing protocol
–Memory requirements
• Uses more memory
–Processing Requirements
• More CPU processing is required
–Bandwidth Requirements
• Initial startup can consume lots of bandwidth

Computer Netwroks, GECT-Ali M A


Routing Protocols
• When more than one metric is used it is referred to as a
composite metric
• The shortest path to a destination determined by adding the
costs & finding the lowest cost
• Link state protocols only send updates when changes occur,
and they only send the changes, not the entire route table
• Link state protocols use multicast and unicast traffic instead of
broadcast traffic
• Link state routers also develop an overall picture of the
networks available

Computer Netwroks, GECT-Ali M A


Example of formation of shortest path tree
Dijkstra’s LSR Algorithm

Computer Netwroks, GECT-Ali M A


Example of formation of shortest path tree
Dijkstra’s LSR Algorithm

Computer Netwroks, GECT-Ali M A


Example of formation of shortest path tree
Dijkstra’s LSR Algorithm

Computer Netwroks, GECT-Ali M A


Example of formation of shortest path tree
Dijkstra’s LSR Algorithm

Computer Netwroks, GECT-Ali M A


Example of formation of shortest path tree
Dijkstra’s LSR Algorithm

Computer Netwroks, GECT-Ali M A


Example of formation of shortest path tree
Dijkstra’s LSR Algorithm

Computer Netwroks, GECT-Ali M A


Example of formation of shortest path tree
Dijkstra’s LSR Algorithm

Computer Netwroks, GECT-Ali M A


Example of formation of shortest path tree
Dijkstra’s LSR Algorithm

Computer Netwroks, GECT-Ali M A


Routing table for node A

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
6 2

A B C 5

2 1 2
G
2 4
1
D E F

Link state database:

A B C D E F G
B 6 A 6 B 6 A 2 B 1 C 2 C 5
D 2 C 2 F 2 E 2 D 2 E 4 F 1
E 1 G 5 F
Computer Netwroks, GECT-Ali M A 4 G 1
Dijkstra’s LSR Algorithm
6 2
A B C 5

2 1 2
6 G
A B 2 4
D E F 1

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
6 2
A B C 5

2 1 2
6 G
A B 2 4
D E F 1

2 D

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
6 2
A B C 5

6 2 1 2
6 G
A B 2 4
D E F 1

2
2 D E

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
6 2
A B C 5
6 2 1 2
6 G
A B 2 4
D E F 1

2
2 D E

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
6 2
A B C 5

2 1 2 G
5 2 4
6 D E F 1
A B

2 1

2 4
2 D E F
4 8

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm

5 7
6 2
A B c

2 1

2 4
2 D E F
4 8

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
6 2
A B C 5

2 1 2 G
2 4
5 7 D E F 1
6 2
A B c

5
12
2 1 2
G

2 4
2 D E F
4 8

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm

5 7
6 2
A B c

5
12
2 1 2
G

2 4
2 D E F
4 8

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm

5 7
6 2
A B c

5
9
2 1 2
G

1
2 4
2 D E F
4 8

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
5 7
6 2 Forwarding
A B c table at A
Destn Next Cost
5 . node

9 B D 5
2 1 2
G C D 7
D D 2
1
2 E D 4
2 D 4
E F F D 8
4 8 G D 9

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm

6 2
A B C 5

2 1 2
G
2 4
D E F 1

Link state database:

A B C D E F G
B 6 A 6 B 6 A 2 B 1 C 2 C 5
D 2 C 2 F 2 E 2 D 2 E 4 F 1
E 1 G 5 F
Computer Netwroks, GECT-Ali M A 4 G 1
Dijkstra’s LSR Algorithm
• Now, if we want to generate a PATH for C:
– First, we add (C,0,0) to PATH

C (0)

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
• Examine C’s LSP
– Add F, G, and B to TENT

C (0)

(2) (5) (2)


F G B

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
• Place F in PATH (shown as solid line)
– Add G and E to TENT (adding costs)

C (0)

(2) (5) (2)


F G B

(3) (6)
G
E

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
• G exists in TENT twice, keep only the best
– The new G is a better path than the old (3 < 5)

C (0)

(2) (5) (2)


F G B

(3) (6)
G
E

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
• Put B into path (shown as solid line)
– Add A and E to TENT

C (0)

(2) (2)
F B

(3) (6) (3) (8)


G A
E E

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
• E exists in TENT twice, keep only the best
– The new E is better than the old (3 < 6)

C (0)

(2) (2)
F B

(3) (6) (3) (8)


G A
E E

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
• Place E in PATH (shown as solid line)
– Add D to TENT

C (0)

(2) (2)
F B

(3) (3) (8)


G A
E

(5)
D

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
• Place G in PATH (shown as solid line)
– All G’s LSP elements already exist in TENT

C (0)

(2) (2)
F B

(3) (3) (8)


G A
E

(5)
D

Computer Netwroks, GECT-Ali M A


Dijkstra’s LSR Algorithm
• Place D in PATH (shown as solid line)
– Add path to A since it is better than old A

C (0)

(2) (2)
F B

(3) (3) (8)


G A
E

(5)
D

(7)
AA
Computer Netwroks, GECT-Ali M
Dijkstra’s LSR Algorithm
• Place A in PATH (shown as solid line)
– All A’s LSP elements already exist in PATH

C (0)

(2) (2)
F B

(3) (3)
G
E

(5)
D

(7)
AA
Computer Netwroks, GECT-Ali M
Dijkstra’s LSR Algorithm
• We are done since all routes from TENT were
placed into PATH

C (0)

(2) (2)
F B

(3) (3)
G
E

(5)
D

(7)
AA
Computer Netwroks, GECT-Ali M
Dijkstra’s LSR Algorithm
• We can now create a forwarding database:

Forwarding Database
C (0) Destination Port

(2) (2) C C
F B
F F
(3) (3)
G
E G F
B B
(5) E B
D
D B
(7)
A
Computer Netwroks, GECT-Ali M A
A B
Dijkstra Example
* *
1

10

2 3 9
0 4 6

7
5

The Considered The Unconsidered.

Computer Netwroks, GECT-Ali M A


Dijkstra Example

* *

1
10 inf
10

2 3 9
0 4 6

7
5
inf
5
2

The Considered The Unconsidered.


Computer Netwroks, GECT-Ali M A
Considering a Node

1
10 inf
10

2 3 9
0 4 6

7
5
inf
5
2 Cost updates of 8,14, and 7

The Considered The Unconsidered. The Under Consideration (w).


Computer Netwroks, GECT-Ali M A
Pushing out the horizon

1
8 14

2 3 9
0 4 6

7
5

5 7
2 Cost updates of 13

The Considered The Unconsidered. The Under Consideration (w).


Computer Netwroks, GECT-Ali M A
Next Phase

1
8 13

2 3 9
0 4 6

7
5

5 7
2 Cost updates of 9

The Considered The Unconsidered. The Under Consideration (w).


Computer Netwroks, GECT-Ali M A
Considering the last node

1
8 9

2 3 9
0 4 6

7
5

5 7
2

The Considered The Unconsidered. The Under Consideration (w).


Computer Netwroks, GECT-Ali M A
Dijkstra Example – Done

1
8 9

2 3 9
0 4 6

7
5

5 7
2

Computer Netwroks, GECT-Ali M A


Distance Vector Vs Link State
Distance Vector Link State
View network topology in Gets common view of the entire
neighbors perspective network topology

Add distance vectors from router Calculates the shortest paths to


to router other routers

Frequent periodic updates Event triggered updates


Slow convergence Faster convergence

Passes copies of routing tables to Passes routing updates to other


neighbor routers routers

Computer Netwroks, GECT-Ali M A


Link-state routing protocol
• link-state routing works by having the routers
tell every router on the network about its
closest neighbors.
• The entire routing table is not distributed from
any router, only the part of the table
containing its neighbors.

Computer Netwroks, GECT-Ali M A


Link-state routing protocol
• The neighbor information is gathered continuously.
• The neighbor information list is then broadcasted to
every router through flooding,
• Flooding means that it sends the information to all of
its neighbors who in turn send it to all of their
neighbors and so on. Soon, all routers on the
network have this information.

Computer Netwroks, GECT-Ali M A


Link-state routing protocol
• The neighbor information is flooded whenever
there is a change in the network.
• Every router knows everything about the
network by analyzing the information from
other routers,
• It can calculate the best path to any
destination by using Dijkstra's algorithm.

Computer Netwroks, GECT-Ali M A


Routing Algorithms in the Internet
Distance Vector Link State

• Routing Information Protocol (RIP) • Intermediate System - Intermediate


System (IS-IS)
• Gateway-to-Gateway Protocol (GGP)
• Open Shortest Path First (OSPF)
• Exterior Gateway Protocol (EGP)

• Interior Gateway Routing Protocol


(IGRP)

Computer Netwroks, GECT-Ali M A

You might also like