Network Layer: Congestion Control Algorithms, Quality of Service, and Routing Algorithm
Network Layer: Congestion Control Algorithms, Quality of Service, and Routing 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.
• 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.
• 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.
• 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.
• The leaky bucket algorithm enforces output pattern at the average rate,
no matter how bursty the traffic is.
• The leaky bucket algorithm controls the rate at which the packets are
introduced in the network, but it is very conservative in nature.
• 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.
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.
• 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.
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.
• 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.
• Centralized algorithm
• Isolation algorithm
• Distributed algorithm
• This algorithm takes the connectivity between the nodes and link cost as
input, and this information is obtained before actually performing any
calculation.
Routing decision Routing decisions are made Routing decisions are the
based on topology and static tables.
network traffic.
• Asynchronous: It does not require that all of its nodes operate in the lock
step with each other.
The least cost from x to y is the minimum of c(x,v)+dv(y) taken over all
neighbors.
• 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.
• 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 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.
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
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.
• After adjustment, A then combines this table with its own table to create a
combined table.
• 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:
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.
• 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.
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
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
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:
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)
5 ADEBC 4,E
6 ADEBCF
Disadvantage:
Heavy traffic is created in Line state routing due to Flooding.