0% found this document useful (0 votes)
18 views61 pages

Network Layer: Congestion Control Algorithms, Quality of Service, and Routing Algorithm

Uploaded by

Abdul Ahad Shaik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
18 views61 pages

Network Layer: Congestion Control Algorithms, Quality of Service, and Routing Algorithm

Uploaded by

Abdul Ahad Shaik
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 61

Network Layer

Congestion Control Algorithms,


Quality of Service, and Routing
algorithm
Congestion Control Algorithms
Congestion
• A state occurs in the network layer when the message traffic is so heavy
that it slows down network response time.
Effects of Congestion
 As delay increases, performance decreases.
 If delay increases, retransmission occurs, making situation worse.

Congestion control algorithms-


• Leaky Bucket Algorithm
• Token bucket Algorithm

Network Layer-Congestion Control


2
Algorithms
Congestion Control Algorithms
Leaky Bucket Algorithm
• Let us take an example to understand the algorithm.
• Imagine a bucket with a small hole in the bottom.
• No matter at what rate water enters the bucket, the outflow is at constant
rate.
• When the bucket is full with water additional water entering spills over
the sides and is lost.

Network Layer-Congestion Control


3
Algorithms
Congestion Control Algorithms
Leaky Bucket Algorithm
In the same way, each network interface contains a leaky bucket and the
following steps are involved in leaky bucket algorithm:

• When host wants to send packet, packet is thrown into the bucket.
• The bucket leaks at a constant rate, meaning the network interface
transmits packets at a constant rate.
• Bursty traffic is converted to a uniform traffic by the leaky bucket.
• In practice the bucket is a finite queue that outputs at a finite rate.

Network Layer-Congestion Control


4
Algorithms
Congestion Control Algorithms
Leaky Bucket Algorithm

Network Layer-Congestion Control


5
Algorithms
Congestion Control Algorithms
Leaky Bucket Algorithm
• In the figure, we assume that the network has committed a bandwidth of 3
Mbps for a host.

• The use of the leaky bucket shapes the input traffic to make it conform to this
commitment.

• In Figure the host sends a burst of data at a rate of 12 Mbps for 2s, for a total
of 24 Mbits of data.

• The host is silent for 5s and then sends data at a rate of 2 Mbps for 3s, for a
total of 6 Mbits of data.

• In all, the host has sent 30 Mbits of data in 10s. The leaky bucket smooths the
traffic by sending out data at a rate of 3 Mbps during the same 10 s.

Network Layer-Congestion Control


6
Algorithms
Congestion Control Algorithms
Leaky Bucket Algorithm
• Without the leaky bucket, the beginning burst may have hurt the network by
consuming more bandwidth than is set aside for this host.

• We can also see that the leaky bucket may prevent congestion.

• A simple leaky bucket algorithm can be implemented using FIFO queue. A FIFO
queue holds the packets.

• If the traffic consists of fixed-size packets (e.g., cells in ATM networks), the
process removes a fixed number of packets from the queue at each tick of the
clock.

• If the traffic consists of variable-length packets, the fixed output rate must be
based on the number of bytes or bits.

Network Layer-Congestion Control


7
Algorithms
Congestion Control Algorithms
Leaky Bucket Algorithm
The following is an algorithm for variable-length packets:

• Initialize a counter to n at the tick of the clock.

• If n is greater than the size of the packet, send the packet and decrement
the counter by the packet size. Repeat this step until n is smaller than the
packet size.

• Reset the counter and go to step 1.

Network Layer-Congestion Control


8
Algorithms
Congestion Control Algorithms
Leaky Bucket Algorithm- An example
Let n=1000
Packet=

Since n> front of Queue i.e. n>200


Therefore, n=1000-200=800
Packet size of 200 is sent to the network.

Now Again n>front of the queue i.e. n > 400


Therefore, n=800-400=400
Packet size of 400 is sent to the network.

Since n< front of queue


Therefore, the procedure is stop.
Initialize n=1000 on another tick of clock.
This procedure is repeated until all the packets are sent to the network.

Network Layer-Congestion Control


9
Algorithms
Congestion Control Algorithms
Token bucket Algorithm

• The leaky bucket algorithm enforces output pattern at the average rate,
no matter how bursty the traffic is.

• So in order to deal with the bursty traffic we need a flexible algorithm so


that the data is not lost.

• One such algorithm is token bucket algorithm.

Network Layer-Congestion Control


10
Algorithms
Congestion Control Algorithms
Token bucket Algorithm

Steps of this algorithm can be described as follows:

1. In regular intervals tokens are thrown into the bucket.


2. The bucket has a maximum capacity.
3. If there is a ready packet, a token is removed from the bucket, and the
packet is sent.
4. If there is no token in the bucket, the packet cannot be sent.

Network Layer-Congestion Control


11
Algorithms
Congestion Control Algorithms
Token bucket Algorithm- An example
Let’s understand with an example
In figure (a) the bucket holds two tokens, and three packets are waiting to be
sent out of the interface.
In Figure (b) two packets have been sent out by consuming two tokens, and 1
packet is still left.

Network Layer-Congestion Control


12
Algorithms
Congestion Control Algorithms
Ways in which token bucket is superior to leaky bucket

• The leaky bucket algorithm controls the rate at which the packets are
introduced in the network, but it is very conservative in nature.

• Some flexibility is introduced in the token bucket algorithm. In the token


bucket, algorithm tokens are generated at each tick (up to a certain limit).

• For an incoming packet to be transmitted, it must capture a token and the


transmission takes place at the same rate.

• Hence some of the busty packets are transmitted at the same rate if
tokens are available and thus introduces some amount of flexibility in the
system.

Network Layer-Congestion Control


13
Algorithms
Congestion Control Algorithms
Difference between Leaky and Token buckets –

Leaky Bucket Token Bucket

When the host has to send a packet , In this leaky bucket holds tokens
packet is thrown in bucket. generated at regular intervals of time.

Bucket leaks at constant rate Bucket has maximum capacity.

Bursty traffic is converted into uniform If there is a ready packet , a token is


traffic by leaky bucket. removed from Bucket and packet is send.

In practice bucket is a finite queue If there is a no token in bucket, packet can


outputs at finite rate not be send.

Network Layer-Congestion Control


14
Algorithms
Quality of Service (QoS)
Quality of Service (QoS) in networks :

• A stream of packets from a source to destination is called a flow. Quality of


Service is defined as something a flow seeks to attain.
• In connection oriented network, all the packets belonging to a flow follow
the same order.
• In a connectionless network, all the packets may follow different routes.

Network Layer-Congestion Control


15
Algorithms
Quality of Service (QoS)
The needs of each flow can be characterized by four primary parameters :

• Reliability, Lack of reliability means losing a packet or acknowledgement


which entertains retransmission.

• Delay, Increase in delay means destination will find the packet later than
expected, Importance of delay changes according to the various application.

• Jitter, Variation of the delay is jitter, If the delay is not at a constant rate, it
may result in poor quality.

• Bandwidth, Increase in bandwidth means increase in the amount of data


which can be transferred in given amount of time, Importance of bandwidth
also varies according to various application.

Network Layer-Congestion Control


16
Algorithms
Quality of Service (QoS)
The needs of each flow can be characterized by four primary parameters :
Application Reliability Delay Jitter Bandwidth

E-mail High Low Low Low

File transfer High Low Low Medium

Web access High Medium Low Medium

Remote login High Medium Medium Low

Audio on demand Low Low High Medium

Video on demand Low Low High High

Telephony Low High High Low

Videoconferencing Low High High High

Network Layer-Congestion Control


17
Algorithms
Quality of Service (QoS)
Techniques for achieving good Quality of Service :
Overprovisioning
The logic of overprovisioning is to provide greater router capacity, buffer space
and bandwidth. It is an expensive technique as the resources are costly. Eg:
Telephone System.

Buffering
Flows can be buffered on the receiving side before being delivered. It will not affect
reliability or bandwidth, but helps to smooth out jitter. This technique can be used
at uniform intervals.

Traffic Shaping
It is defined as about regulating the average rate of data transmission. It smooths
the traffic on server side other than client side. When a connection is set up, the
user machine and subnet agree on a certain traffic pattern for that circuit called as
Service Level Agreement. It reduces congestion and thus helps the carrier to deliver
the packets in the agreed pattern.

Network Layer-Congestion Control


18
Algorithms
Classification of a Routing algorithm
The Routing algorithm is divided into two categories:
• Adaptive Routing algorithm
• Non-adaptive Routing algorithm

Network Layer-Congestion Control


19
Algorithms
Classification of a Routing algorithm
Adaptive Routing algorithm

• An adaptive routing algorithm is also known as dynamic routing


algorithm.

• This algorithm makes the routing decisions based on the topology and
network traffic.

• The main parameters related to this algorithm are hop count, distance
and estimated transit time.

Network Layer-Congestion Control


20
Algorithms
Classification of a Routing algorithm
An adaptive routing algorithm can be classified into three parts:

• Centralized algorithm
• Isolation algorithm
• Distributed algorithm

Network Layer-Congestion Control


21
Algorithms
Classification of a Routing algorithm
Centralized algorithm
• It is also known as global routing algorithm as it computes the least-cost
path between source and destination by using complete and global
knowledge about the network.

• This algorithm takes the connectivity between the nodes and link cost as
input, and this information is obtained before actually performing any
calculation.

• Link state algorithm is referred to as a centralized algorithm since it is


aware of the cost of each link in the network.

Network Layer-Congestion Control


22
Algorithms
Classification of a Routing algorithm
Isolation algorithm:

• It is an algorithm that obtains the routing information by using local


information rather than gathering information from other nodes.

Network Layer-Congestion Control


23
Algorithms
Classification of a Routing algorithm
Distributed algorithm
• It is also known as decentralized algorithm as it computes the least-cost
path between source and destination in an iterative and distributed
manner.
• In the decentralized algorithm, no node has the knowledge about the cost
of all the network links.
• In the beginning, a node contains the information only about its own
directly attached links and through an iterative process of calculation
computes the least-cost path to the destination.
• A Distance vector algorithm is a decentralized algorithm as it never knows
the complete path from source to the destination, instead it knows the
direction through which the packet is to be forwarded along with the least
cost path.

Network Layer-Congestion Control


24
Algorithms
Classification of a Routing algorithm
Non-Adaptive Routing algorithm

• Non Adaptive routing algorithm is also known as a static routing


algorithm.
• When booting up the network, the routing information stores to the
routers.
• Non Adaptive routing algorithms do not take the routing decision based
on the network topology or network traffic.

Network Layer-Congestion Control


25
Algorithms
Classification of a Routing algorithm
Non-Adaptive Routing algorithm
The Non-Adaptive Routing algorithm is of two types:
Flooding
• In case of flooding, every incoming packet is sent to all the outgoing links
except the one from it has been reached.
• The disadvantage of flooding is that node may contain several copies of a
particular packet.
Random walks
• In case of random walks, a packet sent by the node to one of its neighbors
randomly.
• An advantage of using random walks is that it uses the alternative routes
very efficiently.

Network Layer-Congestion Control


26
Algorithms
Classification of a Routing algorithm
Differences b/w Adaptive and Non-Adaptive Routing Algorithm
Basis Of Comparison Adaptive Routing Non-Adaptive Routing
algorithm algorithm
Define Adaptive Routing algorithm is The Non-Adaptive Routing
an algorithm that constructs algorithm is an algorithm that
the routing table based on constructs the static table to
the network conditions. determine which node to
send the packet.

Usage Adaptive routing algorithm is The Non-Adaptive Routing


used by dynamic routing. algorithm is used by static
routing.

Routing decision Routing decisions are made Routing decisions are the
based on topology and static tables.
network traffic.

Categorization The types of adaptive routing The types of Non Adaptive


algorithm, are Centralized, routing algorithm are flooding
isolation and distributed and random walks.
algorithm.

Complexity Adaptive Routing algorithms Non-Adaptive Routing


are more complex. algorithms are simple.

Network Layer-Congestion Control


27
Algorithms
Distance Vector Routing Algorithm
The Distance vector algorithm is iterative, asynchronous and distributed.

• Distributed: It is distributed in that each node receives information from


one or more of its directly attached neighbors, performs calculation and
then distributes the result back to its neighbors.

• Iterative: It is iterative in that its process continues until no more


information is available to be exchanged between neighbors.

• Asynchronous: It does not require that all of its nodes operate in the lock
step with each other.

Network Layer-Congestion Control


28
Algorithms
Distance Vector Routing Algorithm
• The Distance vector algorithm is a dynamic algorithm.

• It is mainly used in ARPANET (Advanced Research Projects Agency


Network), and RIP (Routing Information Protocol).

• Each router maintains a distance table known as Vector.

Network Layer-Congestion Control


29
Algorithms
Distance Vector Routing Algorithm
Three Keys to understand the working of Distance Vector Routing Algorithm-

Knowledge about the whole network:


• Each router shares its knowledge through the entire network.
• The Router sends its collected knowledge about the network to its
neighbors.
Routing only to neighbors:
• The router sends its knowledge about the network to only those routers
which have direct links.
• The router sends whatever it has about the network through the ports.
• The information is received by the router and uses the information to
update its own routing table.
Information sharing at regular intervals:
• Within 30 seconds, the router sends the information to the neighboring
routers.

Network Layer-Congestion Control


30
Algorithms
Distance Vector Routing Algorithm
Three Keys to understand the working of Distance Vector Routing Algorithm-

Knowledge about the whole network:


• Each router shares its knowledge through the entire network.
• The Router sends its collected knowledge about the network to its
neighbors.
Routing only to neighbors:
• The router sends its knowledge about the network to only those routers
which have direct links.
• The router sends whatever it has about the network through the ports.
• The information is received by the router and uses the information to
update its own routing table.
Information sharing at regular intervals:
• Within 30 seconds, the router sends the information to the neighboring
routers.

Network Layer-Congestion Control


31
Algorithms
Distance Vector Routing Algorithm
Distance Vector Routing Algorithm
Let dx(y) be the cost of the least-cost path from node x to node y. The least
costs are related by Bellman-Ford equation-
dx(y) = minv{c(x,v) + dv(y)}

Where the minv is the equation taken for all x neighbors.

After traveling from x to v, if we consider the least-cost path from v to y, the


path cost will be c(x,v)+dv(y).

The least cost from x to y is the minimum of c(x,v)+dv(y) taken over all
neighbors.

Network Layer-Congestion Control


32
Algorithms
Distance Vector Routing Algorithm
Distance Vector Routing Algorithm
With the Distance Vector Routing algorithm, the node x contains the
following routing information:

• For each neighbor v, the cost c(x,v) is the path cost from x to directly
attached neighbor, v.
• The distance vector x, i.e., Dx = [ Dx(y) : y in N ], containing its cost to all
destinations, y, in N.
• The distance vector of each of its neighbors, i.e., Dv = [ Dv(y) : y in N ] for
each neighbor v of x.

Network Layer-Congestion Control


33
Algorithms
Distance Vector Routing Algorithm
Distance Vector Routing Algorithm
• Distance vector routing is an asynchronous algorithm in which node x
sends the copy of its distance vector to all its neighbors.

• When node x receives the new distance vector from one of its neighboring
vector, v, it saves the distance vector of v and uses the Bellman-Ford
equation to update its own distance vector.

• The equation is given below:


dx(y) = minv{ c(x,v) + dv(y)} for each node y in N

The node x has updated its own distance vector table by using the above
equation and sends its updated table to all its neighbors so that they can
update their own distance vectors.

Network Layer-Congestion Control


34
Algorithms
Distance Vector Routing Algorithm
Algorithm
At each node x,

Initialization
for all destinations y in N:
Dx(y) = c(x,y) // If y is not a neighbor then c(x,y) = ∞
for each neighbor w
Dw(y) = ? for all destination y in N.
for each neighbor w
send distance vector Dx = [ Dx(y) : y in N ] to w
loop
wait(until I receive any distance vector from some neighbor w)
for each y in N:
Dx(y) = minv{c(x,v)+Dv(y)}
If Dx(y) is changed for any destination y
Send distance vector Dx = [ Dx(y) : y in N ] to all neighbors
forever

Network Layer-Congestion Control


35
Algorithms
Distance Vector Routing Algorithm
An example-

Network Layer-Congestion Control


36
Algorithms
Distance Vector Routing Algorithm
An example-
• In the above figure, each cloud represents the network, and the number inside the cloud
represents the network ID.
• All the LANs are connected by routers, and they are represented in boxes labeled as A, B, C,
D, E, F.
• Distance vector routing algorithm simplifies the routing process by assuming the cost of
every link is one unit.
• Therefore, the efficiency of transmission can be measured by the number of links to reach
the destination.
• In Distance vector routing, the cost is based on hop count.

Network Layer-Congestion Control


37
Algorithms
Distance Vector Routing Algorithm
An example-

Network Layer-Congestion Control


38
Algorithms
Distance Vector Routing Algorithm
Routing Table

Two steps occurs:

• Creating the Table

• Updating the Table

Network Layer-Congestion Control


39
Algorithms
Distance Vector Routing Algorithm
Creating the Table

Initially, the routing table is created for each router that contains at least three types
of information such as Network ID, the cost and the next hop.

NET ID: The Network ID defines the final destination of the packet.

Cost: The cost is the number of hops that packet must take to get there.

Next hop: It is the router to which the packet must be delivered.

Network Layer-Congestion Control


40
Algorithms
Distance Vector Routing Algorithm
Creating the Table- An example
• In the the figure, the original routing tables are shown of all the routers.
• In a routing table, the first column represents the network ID, the second column
represents the cost of the link, and the third column is empty.
• These routing tables are sent to all the neighbors.

Network Layer-Congestion Control


41
Algorithms
Distance Vector Routing Algorithm
Creating the Table- An example
For Example

• A sends its routing table to B, F & E.


• B sends its routing table to A & C.
• C sends its routing table to B & D.
• D sends its routing table to E & C.
• E sends its routing table to A & D.
• F sends its routing table to A.

Network Layer-Congestion Control


42
Algorithms
Distance Vector Routing Algorithm
Updating the Table
• When A receives a routing table from B, then it uses its information to update the
table.
• The routing table of B shows how the packets can move to the networks 1 and 4.
• The B is a neighbor to the A router, the packets from A to B can reach in one hop.
So, 1 is added to all the costs given in the B's table and the sum will be the cost to
reach a particular network.

• After adjustment, A then combines this table with its own table to create a
combined table.

Network Layer-Congestion Control


43
Algorithms
Distance Vector Routing Algorithm
Updating the Table
• The combined table may contain some duplicate data.
• In the above figure, the combined table of router A contains the duplicate data, so
it keeps only those data which has the lowest cost.
• For example, A can send the data to network 1 in two ways. The first, which uses
no next router, so it costs one hop.
• The second requires two hops (A to B, then B to Network 1). The first option has
the lowest cost, therefore it is kept and the second one is dropped.

• The process of creating the routing table continues for all routers. Every router
receives the information from the neighbors, and update the routing table.
Network Layer-Congestion Control
44
Algorithms
Distance Vector Routing Algorithm
Updating the Table
• Final routing tables of all the routers are given below:

Network Layer-Congestion Control


45
Algorithms
Link State Routing
Link state routing is a technique in which each router shares the knowledge of its
neighborhood with every other router in the internetwork.

The three keys to understand the Link State Routing algorithm:


Knowledge about the neighborhood
• Instead of sending its routing table, a router sends the information about its
neighborhood only.
• A router broadcast its identities and cost of the directly attached links to other
routers.
Flooding
• Each router sends the information to every other router on the internetwork
except its neighbors. This process is known as Flooding.
• Every router that receives the packet sends the copies to all its neighbors.
• Finally, each and every router receives a copy of the same information.
Information sharing
• A router sends the information to every other router only when the change
occurs in the information.
Network Layer-Congestion Control
46
Algorithms
Link State Routing-Two Phases
Reliable Flooding
• Initial state: Each node knows the cost of its neighbors.
• Final state: Each node knows the entire graph.

Route Calculation
Each node uses Dijkstra's algorithm on the graph to calculate the optimal routes to all
nodes.

• The Link state routing algorithm is also known as Dijkstra's algorithm which is used
to find the shortest path from one node to every other node in the network.

• The Dijkstra's algorithm is an iterative, and it has the property that after kth
iteration of the algorithm, the least cost paths are well known for k destination
nodes.

Network Layer-Congestion Control


47
Algorithms
Link State Routing-Two Phases
Notations used in the algorithm:

• c( i , j): Link cost from node i to node j. If i and j nodes are not directly linked, then
c(i , j) = ∞.
• D(v): It defines the cost of the path from source code to destination v that has the
least cost currently.
• P(v): It defines the previous node (neighbor of v) along with current least cost path
from source to v.
• N: It is the total number of nodes available in the network.

Network Layer-Congestion Control


48
Algorithms
Link State Routing-Two Phases
Algorithm:

Initialization
N = {A} // A is a root node.
for all nodes v
if v adjacent to A
then D(v) = c(A,v)
else D(v) = infinity
loop find w not in N such that D(w) is a minimum.
Add w to N
Update D(v) for all v adjacent to w and not in N:
D(v) = min(D(v) , D(w) + c(w,v))
Until all nodes in N

Network Layer-Congestion Control


49
Algorithms
Link State Routing-Two Phases
Algorithm:

Initialization
N = {A} // A is a root node.
for all nodes v
if v adjacent to A
then D(v) = c(A,v)
else D(v) = infinity
loop find w not in N such that D(w) is a minimum.
Add w to N
Update D(v) for all v adjacent to w and not in N:
D(v) = min(D(v) , D(w) + c(w,v))
Until all nodes in N

In the above algorithm, an initialization step is followed by the loop. The number of
times the loop is executed is equal to the total no. of nodes available in the network

Network Layer-Congestion Control


50
Algorithms
Link State Routing-Two Phases
An example:

In the above figure, consider A as the source vertex .

Network Layer-Congestion Control


51
Algorithms
Link State Routing-Two Phases
Step 1:
• The first step is an initialization step.
• The currently known least cost path from A to its directly attached neighbors,
B, C, D are 2,5,1 respectively.
• The cost from A to B is set to 2, from A to D is set to 1 and from A to C is set to
5.
• The cost from A to E and F are set to infinity as they are not directly linked to A.

Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

Network Layer-Congestion Control


52
Algorithms
Link State Routing-Two Phases
Step 2:
• In the above table, we observe that vertex D contains the least cost path in step
1.
• Therefore, it is added in N. Now, we need to determine a least-cost path
through D vertex.
a) Calculating shortest path from A to B
v = B, w = D
D(B) = min( D(B) , D(D) + c(D,B) )
= min( 2, 1+2)
= min( 2, 3)

The minimum value is 2. Therefore, the currently shortest path


from A to B is 2.

Network Layer-Congestion Control


53
Algorithms
Link State Routing-Two Phases
Step 2:
b) Calculating shortest path from A to C
v = C, w = D
D(B) = min( D(C) , D(D) + c(D,C) )
= min( 5, 1+3)
= min( 5, 4)
The minimum value is 4. Therefore, the currently shortest path
from A to C is 4.
c) Calculating shortest path from A to E
v = E, w = D
D(B) = min( D(E) , D(D) + c(D,E) )
= min( ∞, 1+1)
= min(∞, 2)
The minimum value is 2. Therefore, the currently shortest path
from A to E is 2.

Note: The vertex D has no direct link to vertex E. Therefore, the value of D(F) is infinity.
Network Layer-Congestion Control
54
Algorithms
Link State Routing-Two Phases
Step 2:

Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

2 AD 2,A 4,D 2,D ∞

Network Layer-Congestion Control


55
Algorithms
Link State Routing-Two Phases
Step 3:
• In the above table, we observe that both E and B have the least cost path in step 2.
• Let's consider the E vertex. Now, we determine the least cost path of remaining
vertices through E.
a) Calculating the shortest path from A to B.
v = B, w = E
D(B) = min( D(B) , D(E) + c(E,B) )
= min( 2 , 2+ ∞ )
= min( 2, ∞)
The minimum value is 2. Therefore, the currently shortest path fro
m A to B is 2.

Network Layer-Congestion Control


56
Algorithms
Link State Routing-Two Phases
Step 3:
b) Calculating the shortest path from A to C.
v = C, w = E
D(B) = min( D(C) , D(E) + c(E,C) )
= min( 4 , 2+1 )
= min( 4,3)

The minimum value is 3. Therefore, the currently shortest path


from A to C is 3.
c) Calculating the shortest path from A to F.
v = F, w = E
D(B) = min( D(F) , D(E) + c(E,F) )
= min( ∞ , 2+2 )
= min(∞ ,4)
The minimum value is 4. Therefore, the currently shortest path
from A to F is 4.

Network Layer-Congestion Control


57
Algorithms
Link State Routing-Two Phases
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

1 A 2,A 5,A 1,A ∞ ∞

2 AD 2,A 4,D 2,D ∞

3 ADE 2,A 3,E 4,E

Network Layer-Congestion Control


58
Algorithms
Link State Routing-Two Phases
Step 4:
• In the above table, we observe that B vertex has the least cost path in step 3.
• Therefore, it is added in N. Now, we determine the least cost path of remaining
vertices through B.
a) Calculating the shortest path from A to C.
v = C, w = B
D(B) = min( D(C) , D(B) + c(B,C) )
= min( 3 , 2+3 )
= min( 3,5)
The minimum value is 3. Therefore, the currently shortest path
from A to C is 3.
b) Calculating the shortest path from A to F
v = F, w = B
D(B) = min( D(F) , D(B) + c(B,F) )
= min( 4, ∞)
= min(4, ∞)
The minimum value is 4. Therefore, the currently shortest path
from A to F is 4. Network Layer-Congestion Control
59
Algorithms
Link State Routing-Two Phases
Step 5:
• In the above table, we observe that C vertex has the least cost path in step 4.
• Therefore, it is added in N. Now, we determine the least cost path of remaining
vertices through C.
a) Calculating the shortest path from A to F
v = F, w = C
D(B) = min( D(F) , D(C) + c(C,F) )
= min( 4, 3+5)
= min(4,8)
The minimum value is 4. Therefore, the currently shortest path
from A to F is 4.
Step N D(B), P(B) D(C), P(C) D(D), P(D) D(E), P(E) D(F), P(F)

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
Network Layer-Congestion Control
60
Algorithms
Link State Routing-Two Phases
Final table:
Step N D(B),P(B) D(C),P(C) D(D),P(D) D(E),P(E) D(F),P(F)

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

Disadvantage:
Heavy traffic is created in Line state routing due to Flooding.

Flooding can cause an infinite looping, this problem can be solved by


using Time-to-leave field

Network Layer-Congestion Control


61
Algorithms

You might also like