You are on page 1of 23

Network Layer Design

issues

Dr. SHUCHITA UPADHYAYA BHASIN


Professor
Department of Computer Science & Applications
CONTEN
TS
• 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
VIRTUAL CIRCUIT AND DATAGRAM
SUBNET
VC routers maintain connection state information
Connection setup in a Virtual Circuit network
Implementation of Connectionless Service: Datagram Subnet

Routing within a datagram subnet


Forwarding of Datagrams
ROUTING
ALGORITHMS
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
Steps followed in obtaining shortest path from node A to node D
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 Selective Flooding: A variation of flooding that is slightly
Eventually a number of copies will arrive at destination more practical is selective flooding. In this algorithm the
Each packet is uniquely numbered so duplicates can be routers do not send every incoming packet out on every line,
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 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.
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.
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
D 20 H
should send them to router H first. When the packets arrive at router 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.
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.
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 it
• Building Link State Packets: Once the information needed for the 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 decremented once a second and every time it is
neighbor, 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 the LSP is discarded.
significant 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.
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.
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 own region, but  Suppose a subnet has 720 routers with no hierarchy,
knowing nothing about the internal structure of other each router needs 720 routing tables entries.
regions.
 If the subnet is partitioned into 24 regions of 30 routers
 When different networks are connected together, each each, each router needs 30 local entries plus 23 entries
one is regarded as a separate region in order to free the for a total of 53 entries.
routers in one network from having to know the
 If a three-level hierarchy is chosen, with eight clusters,
topological structure of the other ones.
each containing 9 regions of 10 routers, each router
 For huge networks the router may be grouped into
need 10 entries for local routers, 8 entries for routing to
regions, regions into clusters, clusters into zones and so
on other regions within its own cluster and 7 entries for
distant clusters, for a total of 25 entries.
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 routing
below.
paths so that the user receives the data sent to the
 Flooding
multicast group
 Spanning-Tree
 Reverse Path Forwarding
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 Core-based Spanning tree
trees:
• 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
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.
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.
ROUTING FOR MOBILE HOSTS

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

You might also like