Network Layer
Network Layer
Shortest Distance
Flooding
Path Vector Link State
Routing Algorithms
• Nonadaptive algorithms do not base their routing decisions on measurements or
estimate of the current traffic and topology.
• This is also know as Static Routing.
• Routing process will be designed in advance.
• Adaptive algorithms change their routing decisions to reflect changes in the
topology, and usually the traffic as well.
• Adaptive algorithms differ in where they get their information when they
change the routes and what metric is used for optimization (e.g., distance,
number of hops, or estimated transit time).
• This is also know as Dynamic Routing.
Routing Algorithms
• Hierarchical Routing
• Broadcast Routing
• Multicast 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.
• 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 Optimality Principle
Shortest Path Routing
Shortest Path Routing
• Dijkstra
• To choose a route between a given pair of routers, the algorithm just finds the shortest
path between them on the graph.
• In the general case, the labels on the arcs could be computed as a function of the
distance, bandwidth, average traffic, communication cost, mean queue length, measured
delay, and other factors.
• We examine, in turn, each of the nodes adjacent to(the working node), relabeling each
one with the distance . Whenever a node is relabeled, we also label it with the node from
which the probe was made so that we can reconstruct the final path later.
• Having examined each of the nodes adjacent, we examine all the tentatively labeled
nodes in the whole graph and make the one with the smallest label permanent, This one
becomes he new working node.
Shortest Path Routing
• After all the nodes adjacent to the working node have been inspected and the
tentative labels changed if possible, the entire graph is searched for the
tentatively-labeled node with the smallest value.
• This node is made permanent and becomes the working node for the next round.
Flooding
• Static routing
• Every incoming packet is sent out on every outgoing line except the one arrived
• Generates large no’of duplicate packets.
• To damp the process, hop counter is used, which is decremented at each
hop.when it reaches 0 , the packet is discarded.
• Another technique is to keep track which packets have been flooded, to avoid
sending them second time.
Flooding
• Selective Flooding
• Routers do not flood them on to every outer line, instead flood only on those
lines that are going approximately in the right direction
• Applications
• Distributed database applications
• Wireless networks
Distance Vector Routing
• Two dynamic algorithms in particular, distance vector routing and link state
routing,are the most popular.
• Distance vector routing algorithms operate by having each router maintain a
table (i.e, a vector) giving the best known distance to each destination and which
line to use to get there.
• These tables are updated by exchanging information with the neighbors.
• The distance vector routing algorithm is sometimes called by other names, most
commonly the distributed Bellman-Ford routing algorithm and
the Ford-Fulkerson algorithm.
Distance Vector Routing
• In distance vector routing, each router maintains a routing table indexed by, and
containing one entry for, each router in the subnet.
• This entry contains two parts: the preferred outgoing line to use for
that destination and an estimate of the time or distance to that destination.
• The metric used might be number of hops, time delay in milliseconds, total
number of packets queued along the path, or something similar.
• As an example, assume that delay is used as a metric and that the router knows
the delay to each of its neighbors.
• Once every T msec each router sends to each neighbor a list of its estimated
delays to each destination.
• It also receives a similar list from each neighbor.
Distance Vector Routing
• Each router calculates the estimated delay to reach to some router
using the received list.
J wants to calculate delay to G
J Calculated delays to its
neighbors :A,I,H and K as below
J to A 🡪8
J to I 🡪10
J to
H🡪12 J
to K🡪6
Distance Vector Routing
• New routing
C;
J to G Via A=26 (8+18)
J to G via I
=41(31+10) J to G via
H =18(6+12) J to G
via K=37(31+6)
Other Techniques
• Load Shedding
• Random Early detection (RED)
• Jitter Control
The Warning bit
• It is a method of setting a special bit in the packets header by router.
• As long as the router is in the warning state, it continues to set the warning
bit, which means that the source continued to get acknowledgement with
the warning bit being set.
• As long as the warning bit continued to flow in, the source continued to
decrease its transmission rate.
• Since every router along the path can set the warning bit, traffic increases
only when no router is in trouble.
Choke Packet
• A more direct way of telling the source to slow down.
• Achoke packet is a control packet generated at a congested node
transmitted
and to restrict traffic flow.
• The source, on receiving the choke packet must reduce its transmission rate by a
certain percentage. For a fixed time interval.
• After the period has expired, if the source receives choke packets from the same
destination, it reduces the traffic still more and begins ignoring choke packets
again.
• If no choke packets arrive during the listening period, the host may increase the
flow again.
Hop-by-Hop Choke Packets
• Over long distances or at high speeds choke packets are not very effective.
• A more efficient method is to send to choke packets hop-by-hop.
• This requires each hop to reduce its transmission even before the choke packet
arrive at the source.
• The net effect of this hop-by-hop scheme is to provide quick relief at
the congestion at the price of using up more buffers upstream.
Hop-by-Hop Choke Packets
(a)A choke packet that affects
only the source.
(b)A choke packet that affects
each hop it passes through.
Load Shedding
• It is a fancy way of saying that when routers are being inundated (over whelm as
if with a flood),(When buffers become full,) routers simply discard packets.
• Which packet is chosen to be the victim depends on the application and on the
error strategy used in the data link layer.
• For a file transfer, for, e.g. cannot discard older packets since this will cause a gap
in the received data. An old packet is worth more than a new one. This policy
is often called wine.
• For real-time voice or video it is probably better to throw away old data and keep
new packets. For multimedia, a new packet is more important than an old one,
this policy is often called milk.
Wine: drop new packets (keep old); good for file transfer
Milk: drop old packets (keep new); good for multimedia
Random Early Detection (RED)
• This is a proactive approach in which the router discards one or more packets
before the buffer becomes completely full(Floyd & Jacobson in 1993).
• Each time a packet arrives, the RED algorithm computes the average
queue length, avg.
• If avg is lower than some lower threshold, congestion is assumed to be minimal
or non-existent and the packet is queued.
• If avg is greater than some upper threshold, congestion is assumed to be serious
and the packet is discarded.
• If avg is between the two thresholds, this might indicate the onset of congestion.
The probability of congestion is then calculated.
Jitter Control
• For applications such as audio and video streaming, it does not matter much if
the packets take 20 msec or 30 msec to be delivered, as long as the transit time is
constant.
• The variation (i.e., standard deviation) in the packet arrival times is called jitter.
• High jitter, for ex: having some packets taking 20 msec and others taking 30 msec
to arrive give an uneven quality to the sound, movie.
• An agreement that 99 percent of the packets be delivered with a delay in the
range of 24.5 msec to 25.5 msec might be acceptable.
• The jitter can be bounded by computing the expected transit time for each hop
along the path.
• Packets that are ahead of schedule get slowed down and behind schedule get
speeded up, in both cases reducing the amount of jitter.
Jitter Control
• (a) High jitter. (b) Low jitter.
IPV4 Address
• ICANN(Internet Corporation for Assigned Names and Number)
• An IPv4 address is a 32-bit address that uniquely and universally defines the
connection of a device (for example, a computer or a router) to the Internet.
• An IPv4 address is 32 bits long.
• The address space of IPv4 is 232 or 4,294,967,296.
• Figure:Dotted-decimal notation and binary notation for an IPv4 address
IPV4 Address
• Change the following IPv4 addresses from binary notation to dotted-decimal
notation.
• We replace each group of 8 bits with its equivalent decimal number and add
dots for separation.
IPV4 Address
• Change the following IPv4 addresses from dotted-decimal notation to binary
notation