You are on page 1of 106

Unit 3:

Delivery, Forwarding and


Routing
DELIVERY

The network layer supervises the handling of the


packets by the underlying physical networks. We define
this handling as the delivery of a packet.
Direct Delivery
Delivery
Indirect Delivery
Figure 1: Direct and indirect delivery
FORWARDING

Forwarding means to place the packet in its route to


its destination.
Forwarding requires a host or a router to have a
routing table.
When a host has a packet to send or when a router
has received a packet to be forwarded, it looks at this
table to find the route to the final destination.
Figure 5: Simplified forwarding module in classless address

Note In classless addressing, we need at least four


columns in a routing table.
FORWARDING
TECHNIQUES
 Next-Hop Method Versus Route Method
 Network-Specific Method Versus Host-Specific Method
 Default Method
Next-Hop Method Versus Route
Method
 Next hop method:
 Used to reduce the contents of a routing table
 Routing table holds address of next hop only

 Route method:
 Routing table holds address of entire route
Figure 2: Route method versus next-hop method
Network-Specific Method Versus Host-Specific
Method

 Network specific method:


Used to reduce routing table and
simplifythe searching process.
It has entry for destination host only not all host
connected to same network.
 Host specific method:
Routing table has entry for all the
destination host connected to same network.
Used for checking the route or providing security
measures.
Figure 3: Host-specific versus network-specific method
Default
Method
 It is also used to simplify routing
 Uses network address to connect rest of the internet
Figure 4: Default method
Forwarding
Process
Hosts and routers use classless addressing
In classless addressing, the routing table needs
to have one row of information for each block
involved.
Source needs to know network address
of destination
To know network address, we need mask
of corresponding block
Example 1

Make a routing table for R1, using the


configuration in Figure router
6.
Solution
Table 1 shows the corresponding table.
Figure 6: Configuration for Example 1
Table 1: Routing table for router R1 in Figure 6
Address
Aggregation
Use of classless addressing increases routing
table entries.
Classless addressing divides whole address
into block of address.
It increases number of entries in routing
table which increases processing time of router.
 This problem can be solved by address aggregation
 Address aggregation is similar to subnetting.
Sending packet to network address which has
different sub network instead of directly sending
packet to destination host.
Figure 7: Address aggregation
Routing
Table
A host or a router has a routing table with an entry
for each destination, or a combination of destinations,
to route IP packets.
The routing table can be either static or dynamic.
Static Routing Table
 Contains information entered manually.
 The administrator enters the routing information
It cannot update automatically when there is
a change in the Internet.
The table must be manually altered by
the administrator.
A static routing table can be used in a small internet
that does not change v e r y o f t e n .
D ivya R ani R. , De pt o fM CA & CS, KU
Routing
Table
Dynamic Routing Table
Updated periodically by using one of the dynamic
routing protocols such as RIP, OSPF, or BGP.
Whenever there is a change in the Internet, such as
a shutdown of a router or breaking of a link, the
dynamic routing protocols update all the tables in the
routers (and eventually in the host) automatically.
Figure 9: Common fields in a routing table
Routing
Table
Mask: defines the mask applied for the entry.
Network address: defines destination
network address.
Next-hop address: defines the address of the
next- hop router to which the packet is delivered.
Interface: shows the name of the interface.
UNICAST ROUTING
PROTOCOLS
A routing table can be either static or dynamic.
A static table is one with manual entries.
A dynamic table is one that is updated automatically
when there is a change somewhere in the Internet.
A routing protocol is a combination of rules and
procedures that lets routers in the Internet inform
each other of changes.
Topics discussed in this section:
Distance Vector Routing and RIP
Link State Routing and OSPF
Path Vector Routing and BGP
Optimization
Router is connected to several networks
Based on optimization the Router decides for which
network the received packet should be pass
Optimization: selecting optimum (minimum
cost) path
Metric is assigned to each network depends on the
type of protocol (RIP, OSPF, BGP).
Intra and Interdomain Routing
Internet can be so large that one routing protocol
cannot handle the task of updating the routing tables of
all routers.
 Internet is divided into autonomous system.
Autonomous system(AS): Group of networks
and routers under the authority of single
administrator.
Intradomain Routing: Routing inside
single autonomous system.
 Ex: distance vector (RIP) and link state (OSPF)
Interdomain Routing: Routing between
autonomous systems
 Ex: path vector (BGP)
Figure 10: Autonomous systems
Figure 11: Popular routing protocols
Distance Vector Routing
Least cost route between any two node is considered.
Each node has maintains a vector (table) of minimum
distances to every node.
Three steps:
 Initialization
 Sharing
 Updating
Figure 12: Distance vector routing tables
Initialization
At the beginning each node knows only
distance between itself and its immediate neighbors
Neighboring nodes: those node which are directly
connected
Distance for any entry that is not a neighbor
is marked as infinite
Figure 13: Initialization of tables in distance vector
routing
Sharing
Sharing of information between neighbors
Ex: sharing of information between A and C
Node A does not know about Node E, but C knows
Node E. Node C share this info with Node A, Node A
can also know how to reach node E.
Node C does not know how to reach Node D, but
Node A does. If A share this info with C, then C also
knows how to reach node D.
Each node sends first two column with its neighbor to
share info, third column of table is updated after
sharing.
Note

In distance vector routing, each node


shares its routing table with its
immediate neighbors periodically and
when there is a change.
Updating
When a node receives a two-column table from a
neighbor, it needs to update its routing table.
 Three steps:
Receiving node adds the cost between itself and
sending node to each value in second
Receiving node adds the name of the sending node to
each row as the third column if the receiving node uses
information from any row.
Comparison is made between modified table and old
table
If next node is different, receiving node chooses the
row with smallest cost. If there is tie, old one is kept.
 If next node is same, receiving node choose new row.
Figure 14 : Updating in distance vector routing
Figure 13: Initialization of tables in distance vector
routing
When to share
Periodic update: node sends its routing table for every
30sec.
Triggered update: a node sends its two-column
routing table to its neighbors anytime when there is a
change in its routing table.
Two-Node Loop Instability
Problem with distance vector routing is instability
Instability: network using this protocol can become
unstable.
Solution for two –node loop instability:
Define infinity: Redefine infinity to smaller number
Split Horizon:
Each node sends only part of its table
NodeB eliminates last line of its routing
table before it sends it to A
Afterreceiving that, A keeps infinity value
as distance to X
Two-Node Loop Instability
 Split horizon and poison reverse:
In split horizon method, B eliminates last line
of routing table and sends that to A
 But A, can not guess this is due to split Horizon
 Solution for this is split horizon and
poison reverse method
 Here in this method, B advertise the value for X to A
but changes the distance with infinity
Figure 15: Two-node instability
Figure 16: Three-node instability
Routing Information Protocol (RIP)
Intradomain routing protocol used inside
an autonomous system.
 Works based on distance vector routing.
RIP implements distance vector routing directly
with some considerations:
Routers have routing tables; networks do not.
 First column defines a network address.
 Metric used is hop count
 Infinity is defined as 16 (Number of hops
should be
<=15)
 Next node column indicates the address of
router to which packet is to be send to reach its
destination
Figure 17: Example of a domain using RIP
Link State Routing

Different from distance vector routing


Each node has topology of the entire domain
Domain - list of nodes and links, how they are
connected including the type, cost (metric), and condition
of the links ((up or down).
Dijkstra's algorithm is used to build a routing table of
a node.
Figure 18: Concept of link state routing
Link State Routing
Topology must be dynamic representing the latest state
of each node and each link.
Each node has atleast partial knowledge i.e each node
has information such as state, condition and cost of its
link.
Building Routing Tables:
 It builds routing table in 4 steps
Creation of the states of the links by each node, called
the link state packet (LSP).
Dissemination of LSPs to every other router,
called Flooding in an efficient and reliable way.
 Formation of a shortest path tree for each node.
 Calculation of routing table based on the shortest path.
Figure 19: Link state knowledge
Link State Routing
Step1: Creation of Link state Packet(LSP)
LSP carries information such as node identity, list
of links, sequence number, and age
 Node identity & list of links are used to make topology
Sequence number is used for flooding
and distinguishes new LSPs from old ones.
Age prevents old LSPs from remaining in the domain
for a long time.
 LSPs are generated in two cases:
When there is a change in the topology of domain.
On a periodic basis: The timer set for
periodic dissemination is for every 60 min or 2 hour .
Link State Routing
Step2: Flooding of LSPs
Flooding: Dissemination of LSP for all nodes
in domain from each individual node.
 It has following steps:
Creating node sends a copy of the LSP out of each
interfaces
Receiver node compare this LSP with the copy that it
may already have.
If new LSP older than LSP it has, then simply
discards the packet.
If new LSP newer than LSP it has, discards older
one and then sends copy of the newer LSP to all its
interface excluding sender of the that LSP
Link State Routing
Step3:Formation of shortest path tree
Uses Dijkstra algorithm
Dijkstra algorithm creates shortest path tree from
a graph
It divides nodes into two list : Tentative & Permanent
It finds the neighbors of a current node, makes them
tentative, examines them, and if they pass the criteria,
makes them permanent.
Starts from root
 Selects neighbors of root has tentative.
 Among tentative nodes one node which is
having shortest path is moved to permanent list
 Process repeats
Figure 20: Dijkstra algorithm
Figure 21: Example of formation of shortest path tree
Table 2: Routing table for node
A
Open Shortest Path First (OSPF)
Intradomain routing protocol based on state
link routing.
OSPF divides Autonomous system into areas
(collection of networks, hosts & routers).
Area border router:
Router used to connect two areas
It summarizes info about one area and send
to other area
Among all the areas in AS one area is chosen
as backbone area.
 Backbone area:
Serves as primary area
All areas inside AS must be connected to this
Router used in thi s a r e a i s c a lled backbone
Di vya R ani R. , De pt of M CA & CS , KU
Figure 22: Areas in an autonomous system
Figure 23: Types of links
The metric can be based on a type of service
(minimum delay, maximum throughput, and so on).
Types of Link
A point-to-point link connects two routers without any
other host or router in between.
A transient link is a network with several routers
attached to it. The data can enter through any of the
routers and leave through any router.
A stub link is a network that is connected to only one
router. The data packets enters and leaves the network
through this single router.
When the link between two routers is broken, the
administration may create a virtual link.
Figure 24: Point-to-point link
Figure 25: Transient link
Figure 26: Stub link
Figure 17: Example of an AS and its graphical representation in OSPF
 Drawback of distance vector routing:
 Only used in intradomain routing
 Instability if there are more hops in domain
 Drawback of link state routing
 Only used in intradomain routing
 Requires more resources to create routing table
 Flooding creates traffic
Solution:
Use path vector routing
Path Vector Routing
Useful for interdomain routing
Similar to distance vector routing
Speaker node: one node which acts on behalf of
all node in one AS
Routing table is created for speaker node only
in autonomous system
One speaker can communicate with speaker node
of another AS
It has three steps:
 Initialization
 Sharing
 Updating
Figure 28: Initial routing tables in path vector routing
Path Vector Routing
Initialization: speaker node knows reach ability
of nodes within its own autonomous system
Sharing: speaker node shares its table with
neighbor autonomous system
Updating: speaker node updates its table by
adding nodes that are not in its routing table

Loop prevention: The instability of distance vector


routing and the creation of loops can be avoided in path
vector routing. When a router receives a message, it
checks to see if its autonomous system is in the path list to
the destination. If it is, looping is involved and the
message is ignored.
Figure 29: Stabilized tables for three autonomous systems
Border Gateway Protocol (BGP)
Interdomain path vector routing protocol
Three categories of autonomous systems:
stub, multihomed, and transit.
Stub: A stub AS has only one connection to
another AS.
Multihomed AS: A multihomed AS has more than one
connection to other ASs.
Transit AS: A transit AS is a multihomed AS that also
allows transient traffic.
Path attributes gives information about the path
Border Gateway Protocol (BGP)
Exchange of routing information between two BGP
takes place in session.
A session is a connection that is established between
two BGP routers only for the sake of exchanging routing
information.
 BGP can use TCP to provide reliability
 Two types in BGP session
External BGP(E-BGP): exchange of info between
two speaker nodes of two different autonomous
system.
Internal BGP(I-BGP): exchange of info between two
router of same autonomous system.
Figure 30: Internal and external BGP sessions
MULTICAST ROUTING
PROTOCOLS

In this section, we discuss multicasting and multicast


routing protocols.

Topics discussed in this section:


Unicast, Multicast, and Broadcast
Applications
Multicast
Routing Routing
Protocols
Unicasting
One source and one destination.
One-to –one relationship.
Unicast address is assigned to the hosts
Router forwards the packet through only one of its
interfaces.
Router discards the packet if destination not found.
Figure 31: Unicasting
Multicasting
 One source and group of destination
 One-to-many relationship
 Source address is unicast, but destination
the is a group address, which defines one or more
address
destinations
Router forwards the packet through several of
its interfaces
Figure 32: Multicasting
Broadcasting
 One source and all other hosts are destinations
 One-to-all relationship
 It creates huge amount of network traffic
Multiple
Several Unicasting
packets starts from source with
different unicast destination address
 Ex: sending e-mail to multiple person
Multicasting is more efficient than
multiple unicasting
 In multicasting there is no delay between packets
Figure 33: Multicasting versus multiple unicasting
Note

Emulation of multicasting through


multiple unicasting is not
efficient and may create long
delays, particularly with a large
group.
Applications of
multicasting
 Access to distributed databases
 Information dissemination
 Dissemination of news
 Teleconferencing
 Distance learning
Optimal Routing: Shortest Path
Trees
 Root: source
 Leaves: each destination
 Shortest path: path from root to each destination
Optimal Routing in Unicast
Routing
Router consults routing table particular
for destination
 Each line or routing table is shortest
path

Note

In unicast routing, each router in the domain


has a table that defines a shortest path tree to
possible destinations.
Figure 34: Shortest path tree in unicast routing
Optimal Routing in Multicast
Routing
Destinations may be in different network
Forwards packet to members of group
In multicast routing, each involved router needs to
construct a shortest path tree for each group.
If there are n groups then n shortest path tree
is required
It uses two approaches
Source based tree: each router needs to have one
shortest path tree for each group.
Group shared tree: only the core router, which has
a shortest path tree for each group, is involved in
multicasting.
Source based
tree
Each router needs to have one shortest path tree for
each group.
 Shortest path tree defines next hop
Figure 35: Source-based tree approach
Group Shared
Tree
All the routers do not have routing table
Only center core maintains routing table on behalf
of all the routers.
Figure 36: Group-shared tree approach
Figure 37: Taxonomy of common multicast protocols
Multicast Link State
Routing
Extension of unicast link state routing
Source based tree approach
Each node advertises every group which has
any group members in the link using LSP
After receiving LSPs ,router creates n
topologies using Dijkstra’s algorithm
Demerit: more time and space complexity
Solution: creates the tree only when needed
MOSPF
Extension of OSPF
Creates group-membership LSA packets
Using LSA, tree can be created which includes host
belongs to same group
Tree can be store for future use
Data driven protocol
Multicast Distance Vector
Routing(DVMRP)
Uses source based tree approach
Each router creates routing table initial
with information
Never shares routing table with neighbors
It uses 4 strategies
 Flooding
 Reverse path forwarding(RPF)
 Reverse path broadcasting(RPB)
 Reverse path multicasting(RPM)
Flooding
Routers receives packet & broadcast all
the interface except from one it receives packet
Members of group which identifies group id
will receives packet remaining host discards
that packet
 Demerit : It creates loops in the system.
Reverse Path Forwarding
(RPF)
Modified flooding strategy
It eliminates the loop in the flooding process
Each router forward only one copy that
has travelled shortest path from source to router
Demerit: one network may receive more than
one copy of the packet (Duplication of packet)
Figure 38: Reverse path forwarding (RPF)
Figure 39: Problem with RPF
Reverse path broadcasting
(RPB)
Eliminates duplication of packets
It defines parent for each network
It uses policy that network should receive
packet from parent only
Router with shortest path to source will considered
as parent
If there are more than one router with shortest path
then one with smallest IP address is selected as parent
It guarantees that each destination receives one and
only one copy of the packet.
Demerits: Uses broadcasting
Figure 40: RPF Versus RPB
Reverse Path
Multicasting(RPM)
 Avoid broadcasting of packets
 Uses concept of pruning and grafting
Figure 41: RPF, RPB, and RPM
Note

RPM adds pruning and grafting to


RPB to create a multicast shortest
path tree that supports dynamic
membership changes.
Figure 42: Group-shared tree with rendezvous router
Figure 43: Sending a multicast packet to the rendezvous router
Note

In CBT, the source sends the multicast


packet (encapsulated in a unicast
packet) to the core router. The core
router decapsulates the packet and
forwards it to all interested interfaces.
Note

PIM-DM is used in a dense multicast


environment, such as a LAN.
Note

PIM-DM uses RPF and pruning and


grafting strategies to handle
multicasting.
However, it is independent of the
underlying unicast protocol.
Note

PIM-SM is used in a sparse multicast


environment such as a WAN.
Note

PIM-SM is similar to CBT but uses a


simpler procedure.

You might also like