0% found this document useful (0 votes)
14 views

UNIT-IV - Lesson 15 - Routing

Uploaded by

amaubedwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
14 views

UNIT-IV - Lesson 15 - Routing

Uploaded by

amaubedwal
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 23

Network Layer Design issues

Dr. SHUCHITA UPADHYAYA BHASIN


Professor
Department of Computer Science & Applications
CONTENTS

• Network Layer : Services


 Virtual Circuit and Datagram Subnet
• Routing Algorithms:
Shortest path Routing
 Flooding
 Distance Vector Routing
 Link State Routing
 Hierarchical Routing
 Multi Cast Routing
 Routing for Mobile hosts

By Dr. Shuchita Upadhyaya Bhasin


VIRTUAL CIRCUIT AND DATAGRAM SUBNET
VC routers maintain connection state information
Connection setup in a Virtual Circuit network

By Dr. Shuchita Upadhyaya Bhasin


Implementation of Connectionless Service: Datagram Subnet

Routing within a datagram subnet


Forwarding of Datagrams

By Dr. Shuchita Upadhyaya Bhasin


ROUTING ALGORITHMS

By Dr. Shuchita Upadhyaya Bhasin


SHORTEST PATH ROUTING – DIJKSTRAs Shortest Path Algorithm
The first five steps (b to f) used in computing the shortest path from A to D. The arrow indicates the working
node.
The Dijkstra algorithm used in OSPF in the Internet for computing shortest paths

By Dr. Shuchita Upadhyaya Bhasin


Steps followed in obtaining shortest path from node A to node D

By Dr. Shuchita Upadhyaya Bhasin


FLOODING
• Every incoming packet is sent out on every
outgoing line except the one it arrived on.
• Flooding generates vast numbers of duplicate
packets, in fact, an infinite number unless some
measures are taken to damp the process.
• One such measure is to have a hop counter
contained in the header of each packet, which is
decremented at each hop, with the packet being
discarded when the counter reaches zero.
• the hop counter is initialized to the full diameter
of the subnet.
No network information required
Packet sent by node to every neighbor
Incoming packets retransmitted on every link
except incoming link
Eventually a number of copies will arrive at Selective Flooding: A variation of flooding that is slightly
destination more practical is selective flooding. In this algorithm the
Each packet is uniquely numbered so duplicates routers do not send every incoming packet out on every line,
can be discarded at destination but only on those lines that are going approximately in the
right direction for e.g. a westbound packet is sent on a
westbound
By Dr. Shuchita Upadhyaya Bhasin line only.
Properties of Flooding • Advantages of Flooding:
• All possible routes are tried • Flooding provides robustness in
the sense that all alternative
• Very robust paths between different nodes
• Can be used for emergency messaging are covered by a packet, which
• At least one packet will use may be highly desirable in some
minimum hop count route applications like military.
• Can be used once to set up a route • In distributed database
• All nodes are visited applications, it is sometimes
• Useful to distribute information (e.g. necessary to update all the
routing table) databases concurrently; in which
case flooding can be useful.
• Flooding always chooses the
shortest path, because it
chooses every possible path in
parallel.
By Dr. Shuchita Upadhyaya Bhasin
DISTANCE VECTOR ROUTING
• Distance Vector Routing is a
distributed routing algorithm.
• Distance vector routing was
used in the Internet under the
name RIP. Distance Vector
Routing algorithm operates 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.

By Dr. Shuchita Upadhyaya Bhasin


Routing table for router J

Destination Weight Line

A 8 A

B 20 A

C 20 I
The table shows that if router J wants to get packets to router D, it
should send them to router H first. When the packets arrive at router D 20 H
H, the current router checks its own table and makes a decision how to E 17 I
send the packets to D.
In distance vector algorithms, each router has to follow the following F 30 I
steps: G 18 H
1) It counts the weight of the links directly connected to it and saves
the information to its table. H 12 H
2) In a particular period of time, the router sends its table to its I 10 I
neighbor routers (not to all routers) and receives the routing table
of each of its neighbors. J 0 N/A
3) Based on the information the router receives from its neighbors'
K 6 K
routing tables, it updates its own. By Dr. Shuchita Upadhyaya Bhasin
L 15 K
 Part (a) shows a subnet. The first four columns of part (b) shows
the delay vectors received from the neighbors of router J. A
claims to have a 12-msec delay to B, a 25-msec delay to C, a 40-
msec delay to D etc.
 Suppose that J has measured or estimated its delay to its
neighbors A, I, H and K as 8, 10, 12, 16 and 6 msec respectively.

 Consider how J computes its new route to router G. It knows that


it can get to A in 8 msec, and A claims to be able to get to G in 18
msec, so J knows it can count a delay of 26 msec to G if it
forwards packets bond for G to A.

 Similarly, it computes the delay to G via I, H and K as 41 (31+10),
18 (6+12) and 37 (31+6) msec respectively.
 The best of these values is 18, so it makes an entry in it’s routing
table that the delay to G is 18 msec, and that the route to use is
via H.
 The same calculation is performed for all the other destinations,
with the new routing table shown in the last column of the
figure.

By Dr. Shuchita Upadhyaya Bhasin


Distributing the Link State Packets: Flooding is used to distribute
LINK STATE ROUTING the link state packets. Sequence number on each packet, incremented
for each new packet, along with its source identity is used to keep the
Link state routing can be stated in flood in check. When a link state packet reaches a router, it checks
four steps: whether it has already seen that packet. If it is new it is forwarded on
all outgoing lines, otherwise it is discarded. If a packet with a
• Learning about the Neighbors: When a router is booted, it sends a sequence number lower than the highest one seen so far ever arrives,
special HELLO packet on each point-to-point line. The router on the it is rejected as being obsolete.
other end is expected to send back a reply telling who it is.
 Each router maintains list of {source, seq. number}
• Measuring Line Cost: Each router sends a special ECHO packet over the pairs they saw. When a LSP arrives, it is checked
line that the other side is required to send back immediately. The against the list.
round-trip time is divided by two to get an estimate of delay.
 If it is new, it is forwarded on all lines except the one
• Building Link State Packets: Once the information needed for the it arrived on; If it is a duplicate, it is discarded.
exchange has been collected, each router builds a packet containing all
the data. The packet starts with the identity of the sender, followed by  To safeguard against old data, link down etc., age is
a sequence number and age, and a list of neighbors. For each neighbor, decremented once a second and every time it is
the delay to that neighbor is given. forwarded by a router. When the age reaches zero,
• Link state packets are built either periodically or when some significant the LSP is discarded.
event occurs. Computing the new Routes: Once a new router has
accumulated a full set of link state packets, it can construct
the entire subnet graph and represent each link by delays.
Now a shortest path algorithm (Dijkstra’s algorithm) can be
run locally to construct the shortest path to all possible
destinations. The results of this algorithm can be installed in
the routing tables, and normal operation resumed.

By Dr. Shuchita Upadhyaya Bhasin


To summarize, each router must do the following:

1. Discover its neighbors, learn their network address.

Sends ‘hello’ message on booting

2. Measure the delay or cost to each of its neighbors.

Delay = (send ‘Echo’ message + Receive its reply) / 2

3. Construct a packet telling all it has just learned.

Construct Link State (LS) packet. it contains: Source Address, Seq. No., Age, List of neighbors
+ their delay

4. Send this packet to all other routers.

Forwards link state packets to all other routers using Flooding algorithm

5. Compute the shortest path to every other router.

Each router uses Dijkstra algorithm to calculate shortest paths based on current values in its
database.
By Dr. Shuchita Upadhyaya Bhasin
HIERARCHICAL ROUTING
 As networks grow in size, the router routing
tables grow proportionally. Not only is router
memory consumed by ever increasing tables, but
also more CPU time is needed to scan them and
more bandwidth is needed to send status reports
about them.
 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.
 Here, the routers are divided into the regions
with each router knowing all the details about
how to route packets to destinations within its  Suppose a subnet has 720 routers with no hierarchy,
own region, but knowing nothing about the
internal structure of other regions. each router needs 720 routing tables entries.
 When different networks are connected together,  If the subnet is partitioned into 24 regions of 30 routers
each one is regarded as a separate region in order each, each router needs 30 local entries plus 23 entries
to free the routers in one network from having to for a total of 53 entries.
know the topological structure of the other ones.  If a three-level hierarchy is chosen, with eight clusters,
 For huge networks the router may be grouped each containing 9 regions of 10 routers, each router
into regions, regions into clusters, clusters into need 10 entries for local routers, 8 entries for routing to
zones and so on
other regions within its own cluster and 7 entries for
distant clusters, for a total of 25 entries.
By Dr. Shuchita Upadhyaya Bhasin
Multicast message sent to User B, D, and E as they belong
MULTICAST ROUTING to the same multicast group
• Multicast communications refer to
one-to-many communications

Multicast Group Multicast Routing : Problem Statement


The set of receivers for a multicast transmission Goal: find a tree (or trees) connecting routers having local multicast group
members
A multicast group is identified by a multicast address. Tree: not all paths between routers used
A user that wants to receive multicast transmissions joins Source-based: different tree from each sender to receivers
the corresponding multicast group, and becomes a Shared-tree (core-based tree): same tree used by all group members
member of that group Multicast routing in practice
Several techniques can be used; the most common are discussed
After a user joins, the network builds the necessary
below.
routing paths so that the user receives the data sent to the
 Flooding
multicast group
 Spanning-Tree
 Reverse Path Forwarding
By Dr. Shuchita Upadhyaya Bhasin
Spanning-Tree Source-based spanning tree

• It is based on flooding but instead of doing it


all over the place, it is done on spanning tree.
• Spanning trees are built on links between
routers. A Spanning tree is an active and loop-
free path between each two routers.

Routing protocols for Multicast routing in


practice implement one of two approaches of
spanning trees:
Core-based Spanning tree
• Source Based Tree:
Builds one shortest path tree for each
sender.
• Core Based Tree (Shared tree):
Build a single distribution tree that is shared
by all senders

By Dr. Shuchita Upadhyaya Bhasin


By Dr. Shuchita Upadhyaya Bhasin
REVERSE PATH FORWARDING
• Reverse path forwarding (RPF) is used in conjunction with a Multicast routing protocol to
build a loop-free shortest-path tree.
• In normal unicast IP forwarding, the router reads the destination address of the packet,
and looks it up in the forwarding table to decide the port to send the packet out from.
• In multicast IP forwarding, the destination address corresponds to a group of ports on
the router.
• When a multicast packet enters a router's interface, it will look up the list of networks
that are reachable via that interface i.e., it checks the reverse path of the packet.
• If the router finds a matching routing entry for the source IP address of the multicast
packet, the RPF check passes and the packet is forwarded to all other interfaces that are
participating in multicast for that multicast group.
• If the RPF check fails, the packet will be dropped.
• As a result, the forwarding of the packet is decided based upon the reverse path of the
packet rather than the forward path.
• RPF routers only forward packets that come into the interface that also holds the routing
entry for the source of the packet.

By Dr. Shuchita Upadhyaya Bhasin


REVERSE PATH FORWARDING
 The source node sends a multicast packet to the multicast
group.
 Router A is directly attached to the source of the multicast
traffic. Router A also connected to router B and C so it sends a
multicast packet to each (router B and C).
 Router B receives the multicast packet on link 1. This is a
parent link. It duplicates the packet and sends to all other
routers (C, D and E) which is directly connected with it.
 Router C receives the packet on link 2, which is a parent link. It
also receives a multicast packet on link 3 from router B. This is
a child link for C. So C discards the packet. Router C also
duplicates the packet and sends to the other routers directly
connected with it.
 Router D receives the packet on link 4, which is its parent link.
It also duplicates the packet and send to router E.
 Router E receives the multicast packet on links 5, 6, 8 and 9.
Link 5 is a parent link and other links are child links. So router
E accepts the packet on link 5 and discards the rest.
 Router F receives the multicast packet on links 7 and 9. It
accepts the packet only on link 7 because it is the parent link.
 To optimize this example, let’s assume that B learned that link
3 is a child link for C. So when B receives a mutlicast packet, it
will send it out of all links except links 1 and 3.

By Dr. Shuchita Upadhyaya Bhasin


ROUTING FOR MOBILE HOSTS
• When you move from one access network Forwarding packets from a correspondent node to a
to another, you need to get a new IP mobile node.
address—one that corresponds to the new
network. But, the computer or telephone
at the other end of your conversation
doesn’t immediately know where you have
moved or what your new IP address is.
• Consequently, in the absence of some
other mechanism, packets would continue
to be sent to the address where
you used to be, not where you are now.
This problem is illustrated in figure;
• as the mobile node moves from the 802.11
network in (a) to the cellular network in (b),
somehow packets from the correspondent
node need to find their way to the new
network and then on to the mobile node.

By Dr. Shuchita Upadhyaya Bhasin


ROUTING FOR MOBILE HOSTS
• All users are assumed to have a
permanent home location that never
changes. The routing goal in systems
with mobile users is to make it possible
to send packets to mobile users using
their home addresses, and have the
packets efficiently reach them
wherever they may be.
• The world is divided into small units
called areas, where an area is typically
a LAN or wireless cell. Each area has
one or more foreign agents, which
keep track of all mobile users visiting
the area.
• In addition, each area has a home
agent, which keeps track of users
whose home is in the area, but who are
currently visiting another area.

By Dr. Shuchita Upadhyaya Bhasin


 When a new user enters an area, either by connecting to  When a packet is sent to a mobile user, it is
it (e.g., plugging into the LAN), or just wandering into the routed to the user’s home LAN. Packets sent to
cell, his computer must register itself with the foreign
agent there. The registration procedure typically works the mobile user on its home LAN are
like this: intercepted by the home agent.
 Periodically, each foreign agent broadcasts a packet  The home agent then looks up the mobile
announcing its existence and address. A newly arrived user’s new (temporary) location and finds the
mobile host may wait for one of these messages, but if address of the foreign agent handling the
none arrives quickly enough, the mobile host can mobile user.
broadcast a packet saying: “ Are there any foreign agents
around?”  The home agent then does two things. First, it
 The mobile host registers with the foreign agent, giving encapsulates the packet in the payload field of
its home address, current data link layer address, and an outer packet and sends the latter to the
some security information. foreign agent . This mechanism is called
 The foreign agent contacts the mobile host’s home agent
tunneling.
and says: “one of your hosts is over here.” The message  After getting the encapsulated packet, the
from the foreign agent to the home agent contains the foreign agent removes the original packet from
foreign agents’ network address. It also includes the the payload field and sends it to the mobile
security information, to convince the home agent that user as a data link frame.
the mobile host is really there.
 The home agent examines the security information,
which contains a time stamp, to prove that it was
generated within the past few seconds. If it is happy, it
tells the foreign agent to proceed.
 When the foreign agent gets the acknowledgement from
the home agent, it makes an entry in its tables and
informs the mobile host that it is now registered.

By Dr. Shuchita Upadhyaya Bhasin

You might also like