Unit 5
Unit 5
Unit 5
1.Based on Working.
Based on Working
Based on Working
Adaptive Algorithm:
• Optimality principle
• Shortest path routing algorithm
• Flooding
• Distance vector routing
• Link state routing
• Hierarchical Routing
The Optimality Principle
•One can make a general statement about optimal routes without regard
to network topology or traffic. This statement is known as the
optimality principle.
•It states that if router J is on the optimal path from router I to router K,
then the optimal path from J to K also falls along the same.
•As a direct consequence of the optimality principle, we can see that the
set of optimal routes from all sources to a given destination form a tree
rooted at the destination. Such a tree is called a sink tree. The goal of
all routing algorithms is to discover and use the sink trees for all routers.
Shortest Path Routing Algorithm - Dijikstra’s
• The idea is to build a graph of the subnet, with each node of the
graph representing a router and each arc of the graph representing a
communication line or link.
1. Start with the local node (router) as the root of the tree. Assign a
cost of 0 to this node and make it the first permanent node.
2. Examine each neighbor of the node that was the last permanent
node.
• Ideally, the hop counter should be initialized to the length of the path
from source to destination.
FLOODING
•. In this algorithm the routers do not send every incoming packet out
on every line, only on those lines that are going approximately in the
right
direction.
• In distance vector routing, the least - cost route between any two nodes
is the route with minimum distance.
•In this protocol, as the name implies, each node maintains a vector
(table) of minimum distances to every node.
•Mainly 3 things in this
- Initialization
- Sharing
- Updating
Distance Vector Routing
Initialization
•Each node can know only the distance between itself and its immediate
neighbors, those directly connected to it.
•So for the moment, we assume that each node can send a message to
the immediate neighbors and find the distance between itself and these
neighbors.
•Below fig shows the initial tables for each node. The distance for any
entry that is not a neighbor is marked as infinite (unreachable).
Initialization Of Tables In Distance Vector Routing
Initialization
Sharing Of Tables In Distance Vector Routing
1. The receiving node needs to add the cost between itself and
the sending node to each value in the second column. (x+y)
2. If the receiving node uses information from any row. The
sending node is the next node in the route.
Updating Of Tables In Distance Vector Routing
• The receiving node needs to compare each row of its old table with
the corresponding row of the modified version of the received table.
a. If the next - node entry is different, the receiving node
chooses the row with the smaller cost. If there is a tie, the old
one is kept.
b. If the next - node entry is the same, the receiving node
chooses the new row.
Updating Of Tables In Distance Vector Routing
Final Routing Table
Hierarchical Routing
•At a certain point, the network may grow to the point where it is no
longer feasible for every router to have an entry for every other router,
so the routing will have to be done hierarchically, as it is in the
telephone network.
Hierarchical Routing
•When hierarchical routing is used, the routers are divided into what we
will call regions.
•Each router knows all the details about how to route packets to
destinations within its own region but knows nothing about the internal
structure of other regions.
1. Level 1 – Region.
2. Level 2 – Cluster – It is a collection of region.
3. Level 3 – Zone – It is a collection of clusters.
4. Level 4 – Groups – It is a collection of Zones.
Link State Routing
•Link state routing is based on the assumption that, although the global
knowledge about the topology is not clear, each node has partial
knowledge: it knows the state (type, condition, and cost) of its links.
•In other words, the whole topology can be compiled from the partial
knowledge of each node .
Link State Routing
Building Routing Tables
• The table then provides the device with instructions for sending the
packet to the next hop on its route across the network.
Routing Table
• When too many packets are pumped into the system, congestion occur
leading into degradation of performance.
Difference Between Congestion Control And Flow
Control
Retransmission Policy:
2.If the sender feels that a sent packet is lost or corrupted, the
packet needs to be retransmitted. This transmission may increase
the congestion in the network.
Window Policy:
•The type of window at the sender may also affect congestion.
•In the Go-Back-N window, when the timer for a packet times out,
several packets may be resent, although some may have arrived safe and
sound at the receiver.
•This duplication may make the congestion worse. The Selective Repeat
window, on the other hand, tries to send the specific packets that have
been lost or corrupted.
Open Loop Congestion Control:
Acknowledgment Policy :
Discarding Policy :
•In case of audio file transmission, routers can discard less sensitive
packets to prevent congestion and also maintain the quality of the
audio file.
Open Loop Congestion Control:
Admission Policy :
•This may cause the upstream node or nodes to become congested, and
they, in turn, reject data from their upstream nodes or nodes. And so on.
• In the choke packet method, the warning is from the router, which has
encountered congestion, to the source station directly. The intermediate
nodes through which the packet has traveled are not warned.
Closed Loop Congestion Control: Choke Packet
Closed Loop Congestion Control: Implicit Signaling:
Implicit Signaling:
Explicit Signaling:
Explicit Signaling:
•The node that experiences congestion can explicitly send a signal to
the source or destination.
Explicit Signaling:
Backward Signaling :
•A bit can be set in a packet moving in the direction opposite to the
congestion.
•This bit can warn the source that there is congestion and that it needs to
slow down to avoid the discarding of packets.
Forward Signaling:
•A bit can be set in a packet moving in the direction of the congestion.
This bit can warn the destination that there is congestion.
•The receiver in this case can use policies, such as slowing down the
acknowledgments, to alleviate the congestion.
Traffic Shaping
• It will ensure that water coming out is in a some fixed rate, and also if
bucket is full we will stop pouring in it.
•The input rate can vary, but the output rate remains constant.
Similarly, in networking, a technique called leaky bucket can smooth
out bursty traffic. Bursty chunks are stored in the bucket and sent out
at an average rate.
Traffic Shaping - Leaky Bucket
•If the traffic consists of fixed-size packets, 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.
Traffic Shaping - Leaky Bucket
Traffic Shaping - Leaky Bucket
2.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.
3. Tokens are generated by a clock at the rate of one token every t sec.
4. Idle hosts can capture and save up tokens (up to the max. size of the
bucket) in order to send larger bursts later.
Traffic Shaping - Token Bucket
Before After
Leaky Bucket vs. Token Bucket
Some advantage of token Bucket over leaky bucket
2. Token Bucket can send Large bursts can faster rate while leaky
bucket always sends packets at constant rate.