3_networking
3_networking
fig 5-1
➢ Services offered
▪ Connectionless service
• Packets are injected into the subnet individually
and routed independently of each other.
• No advance setup is needed.
• In this context, the packets are frequently called
datagrams.
Implementation of Connectionless Service
➢ Connection-oriented service
• A path from the source router to the destination
router must be established before any data
packets can be sent.
• This connection is called a VC (virtual circuit).
• This service is analogy with the physical
circuits set up by the telephone system .
Implementation of Connection-Oriented
Service
5-4
Routing Algorithm
• The routing algorithm is that part of the
network layer software responsible for
deciding which output line an incoming packet
should be transmitted on.
30
• One way of measuring path length is the number of
hops. Using this metric, the paths ABC and ABE in
the above figure are equally long.
• Another metric is the geographic distance in
kilometers, in which case ABC is clearly much
longer than ABE
Shortest Path Routing
• However, many other metrics besides hops and
physical distance are also possible.
• 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.
• By changing the weighting function, the
algorithm would then compute the ''shortest''
path measured according to any one of a
number of criteria or to a combination of
criteria.
Shortest Path Routing
➢ Dijkstra's algorithm
• Each node is labeled (in parentheses) with its
distance from the source node along the best
known path.
• Initially, no paths are known, so all nodes are
labeled with infinity.
• As the algorithm proceeds and paths are found,
the labels may change, reflecting better paths.
Shortest Path Routing
• A label may be either tentative or
permanent.
• Initially, all labels are tentative. When it is
discovered that a label represents the
shortest possible path from the source to that
node, it is made permanent and never
changed thereafter.
• Permanent node is indicated by a filled-in
circle.
Shortest Path Routing
Hierarchical routing.
Problems – optimal paths are sacrificed
Hierarchical Routing
• When a single network becomes very large, an
interesting question is: How many levels should
the hierarchy have?
• For example, consider a subnet with 720 routers.
• If there is no hierarchy each router needs 720
routing table entries.
• If the subnet is partitioned into 24 regions of 30
routers each, each router needs 30 local entries
plus 23 remote entries for a total of 53 entries.
Hierarchical Routing
• If a three-level hierarchy is chosen, with eight
clusters, each containing 9 regions of 10
routers, each router needs 10 entries for local
routers, 8 entries for routing to other regions
within its own cluster, and 7 entries for distant
clusters, for a total of 25 entries.
• Kamoun and Kleinrock in 1979 have
discovered that the optimal number of levels
for an N router subnet is ln N.
• It requires a total of e ln N entries per router.
Broadcast Routing
• In some applications, hosts need to send messages
to many or all other hosts.
• Sending a packet to all destinations
simultaneously is called broadcasting.
• For example, a service distributing weather
reports, stock market updates, or live radio
programs might work best by broadcasting to all
machines and letting those that are interested read
the data.
Broadcast Routing
• Various methods are being used for broadcast
routing.
• One of broadcasting method where the source
will create multiple copies of a packet and
send a distinct packet to each destination.
• In this method the source requires to maintain
the complete list of all destinations.
• It is the least desirable of the methods because
the link bandwidth will be wasted.
Broadcast Routing
• Flooding is another method for broadcast
routing.
• Flooding is not suitable for ordinary point-to-
point communication.
• For broadcasting it might be a good
alternative.
• The problem with flooding as a broadcast
technique is it generates too many packets and
consumes too much bandwidth.
Broadcast Routing
• Multidestination routing is the third
algorithm for broadcast routing.
• In this method each packet contains the list of
destinations.
• When a packet arrives at a router, the router
checks all the destinations to determine the set
of output lines that will be needed.
• The router generates a new copy of the packet
for each output line to be used and includes in
each packet only those destinations that are to
use the line.
Broadcast Routing
• In effect, the destination set is partitioned
among the output lines.
• After a sufficient number of hops, each packet
will carry only one destination and can be
treated as a normal packet.
• Multidestination routing is like separately
addressed packets, except that when several
packets must follow the same route, one of
them pays full fare and the rest ride free.
Broadcast Routing
• A fourth broadcast algorithm that uses the sink
tree for the router initiating the broadcast.
• A spanning tree is a subset of the subnet that
includes all the routers but contains no loops.
• If each router knows which of its lines belong
to the spanning tree, it can copy an incoming
broadcast packet onto all the spanning tree
lines except the one it arrived on.
Broadcast Routing
• This method makes excellent use of
bandwidth, generating the absolute minimum
number of packets necessary to do the job.
• The only problem is that each router must have
knowledge of some spanning tree for the
method to be applicable. Sometimes this
information is available (e.g., with link state
routing) but sometimes it is not (e.g., with
distance vector routing).
Broadcast Routing
• The last broadcast algorithm is called as
reverse path forwarding.
• When a broadcast packet arrives at a router,
the router checks to see if the packet arrived on
the line that is normally used for sending
packets to the source of the broadcast.
• If so, then it is being considered that the
broadcast packet followed the best route from
the router.
Broadcast Routing
• Therefore the first copy has been arrived at the
router.
• Hence the router forwards copies of it onto all
lines except the one it arrived on.
• However the broadcast packet arrived on a line
other than the preferred one for reaching the
source the packet is discarded as it considered
as duplicate.
Broadcast