Routing algorithm
- 4. Router
– A router is located at the gateway
– it routes packets as they travel from one network
to another network(s).
– A router can be hardware device with a software
application
– The router is connected to at least two networks
- 5. •find path
•forward packet, forward packet, forward
packet, forward packet...
•find alternate path
•forward packet, forward packet, forward
packet, forward packet…
•repeat until powered off
What does a router do?
- 6. Routing versus Forwarding
• Routing = building
maps and giving
directions
• Forwarding = moving
packets between
interfaces according
to the “directions”
6
- 8. Network Performance Measures
• Two Performance Measures
– Quantity of Service (Throughput)
• How much data travels across the net?
• How long does it take to transfer long files?
– Quality of Service (Average packet delay)
• How long does it take for a packet to arrive at its
destination?
• How responsive is the system to user commands?
• Can the network support real-time delivery such as
audio and video?
- 9. Fairness versus Optimality
• Quantity of service
versus quality of
service.
• To optimize
throughput, saturate
paths between A and
A’, B and B’, and C and
C’, but what happens
to the response time
from X to X’?
- 10. Types of Routing Algorithms
• Nonadaptive (static)
– Do not use measurements of current conditions
– Static routes are downloaded at boot time
• Adaptive Algorithms(dynamic)
– Change routes dynamically
• Gather information at runtime
– locally
– from adjacent routers
– from all other routers
• Change routes
– When load changes
– When topology changes
- 11. Optimality principle
(a adaptive routing algorithm)
• If router j is on the optimal path from i to k,
then the optimal path from j to k also falls
along the same route.
i
k
(j)
(j)
(j)
- 12. Sink Trees
• The set of optimal
routes to a particular
node forms a sink
tree.
• Sink trees are not
necessarily unique
• Goal of all routing
algorithms
– Discover sink trees for
all destinations
- 13. • Given a network topology and a set of
weights describing the cost to send data
across each link in the network
• Find the shortest path from a specified
source to all other destinations in the
network.
• Shortest path algorithm first developed by
E. W. Dijkstra
Shortest Path Routing
(a nonadaptive routing algorithm)
- 16. Flooding
(a nonadaptive routing algorithm)
• No network information is required
•Packet send by node to every neighbor
•Incoming packets retransmitted on every link
without incoming link
•Eventually a numbers of copies will arrives at
destination
•Each packet is uniquely numbered so duplicate can
be discarded
•Nodes can remember packets already forwarded
to keep network load in bounds
- 18. – All nodes are visited
– All possible routes are tried
• Selective Flooding
– Flood only in the direction of the destination
• Practical example
– Mobile when user 1 dial number to call user 2,the
mobile station/company searches for user 2 in whole
country if user 2 is out of reach. Then this process take
few seconds
– Distributed Databases
Flooding
(a nonadaptive routing algorithm)
- 19. • Neighboring routers periodically exchange
information from their routing tables.
• Routers replace routes in their own routing
tables anytime that neighbors have found
better routes.
• Information provided from neighbors
– Outgoing line used for destination
– Estimate of time or distance
• can be number of hops, time delay, packet queue length,
etc.
Distance Vector Routing
(an adaptive routing algorithm)
- 24. • Five Steps
1.) Discover your neighbors and learn their addresses.
2.) Measure the cost (delay) to each neighbor.
3.) Construct a packet containing all this information
4.) Send this packet to all other routers.
5.) Compute the shortest path to every other router.
Link State Routing
(an adaptive routing algorithm)
- 25. 1.) Discovering Your Neighbors
• Send “Hello” packet on each point-to-point
line. Destination node replies with its
address.
- 27. 2.) Measuring Line Cost
• Send an “ECHO” packet over the line.
• Destination is required to respond to
“ECHO” packet immediately.
• Measure the time required for this
operation.
• Question: Should we measure just the time
it takes to transmit the packet, or should
we include the time that the packet waits
in the queue?
- 28. Argument 2:
• We should include the time that the packet
spends in the queue, as this provides a more
accurate picture of the real delays.
• We should only include the transmission
times, otherwise the network is likely to
oscillate between preferred paths.
- 29. Distributing the Link State Packets
• Use selective flooding
• Sequence numbers prevent duplicate packets
from being propagated
• Lower sequence numbers are rejected as
obsolete
- 30. Computing the New Routes
• Dijkstra’s Shortest Path algorithm is used to
determine the shortest path to each
destination.
- 31. Hierarchical Routing
• Addresses the growth of routing tables
• Routers are divided into regions
• Routers know the routes for their own
regions only
• Works like telephone routing
• Possible hierarchy
– city, state, country, continent
- 33. Routing Mobile Hosts
• Networking portable computers
• Tanenbaum’s proposed solution
– All mobile agents are assumed to have a
permanent home location
– When a portable computer is attached to a
remote network it contacts a process that acts
as the local foreign agent.
– Each home location has a process that acts as
the home agent
- 35. Registering a Mobile Agent
• Periodically the foreign agent broadcasts its
address
• The mobile agent registers with the foreign
agent and supplies its home address
• The foreign agent contacts the mobile
agent’s home agent reporting the mobile
agent’s location.
– Security must be used to verify the identity of
the mobile agent.
• The foreign agent registers the mobile
agent
- 36. Routing Packets to a Mobile Agent
• Packets sent to the mobile agent are routed
to the users home network
• The home agent routes the packets to the
foreign agent
• The home agent provides the source of
incoming packets with the remote address
of the mobile agent
- 37. Broadcast Routing
• Send a separate packet to each destination
• Use flooding
• Use multidestination routing
– Each packet contains a list of destinations
– Routers duplicate packet for all matching
outgoing lines
• Use spanning tree routing
– a subset of the subnet that includes all routers
but contains no loops.
- 38. Spanning Tree Broadcasting
• Uses the minimum
number of packets
necessary
• Routers must be able to
compute spanning tree
– Available with link state
routing
– Not available with
distance vector routing
- 39. Broadcast Routing (continued)
• Reverse Path Forwarding
– Use When knowledge of a spanning tree is not
available
– Provides an approximation of spanning tree
routing
– Routers check to see if incoming packet arrives
from the same line that the router uses to route
outgoing packets to the broadcast source
• If so, the router duplicates the packet on all other
outgoing lines
• Otherwise, the router discards the packet
- 41. Multicast Routing
• A method to broadcast packets to well-
defined groups
• Hosts can join multicast groups.
– They inform their routers
– Routers send group information throughout
the subnet
• Each router computes a spanning tree for
each group. The spanning tree includes all
the routers needed to broadcast data to the
group