0% found this document useful (0 votes)
77 views16 pages

Unit 4

This document summarizes routing protocols and algorithms. It discusses unicast routing which routes packets from source to destination hop-by-hop. Distance vector routing protocols like RIP use hop count to determine best paths. Link state routing protocols like OSPF have each router flood link state information to build a topology database and calculate shortest paths. BGP is a path vector protocol that allows sources to control paths based on policies rather than just hop count.

Uploaded by

Senthilnathan S
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)
77 views16 pages

Unit 4

This document summarizes routing protocols and algorithms. It discusses unicast routing which routes packets from source to destination hop-by-hop. Distance vector routing protocols like RIP use hop count to determine best paths. Link state routing protocols like OSPF have each router flood link state information to build a topology database and calculate shortest paths. BGP is a path vector protocol that allows sources to control paths based on policies rather than just hop count.

Uploaded by

Senthilnathan S
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/ 16

UNIT IV ROUTING 7

Routing and protocols: Unicast routing - Distance Vector Routing - RIP - Link State Routing
– OSPF – Path-vector routing - BGP - Multicast Routing: DVMRP – PIM.

4.1Routing and protocols


 The network layer is responsible for routing the packet from its source to
the destination.
 The network layer is responsible for finding the best one among these
possible routes.
 The network layer needs to have some specific strategies for defining the
best route.
 Routing is the concept of applying strategies and running routing
protocols to create the decision-making tables for each router.
 These tables are called as routing tables

4.2UNICAST ROUTING
 Routing is the process of selecting best paths in a network.
 In unicast routing, a packet is routed, hop by hop, from its source to its
destination by the help of forwarding tables.
 Routing a packet from its source to its destination means routing the packet
from a source router (the default router of the source host) to a destination
router (the router connected to the destination network).
 The source host needs no forwarding table because it delivers its packet to the
default router in its local network.
 The destination host needs no forwarding table either because it receives the
packet from its default router in its local network.
 Only the intermediate routers in the networks need forwarding tables.
NETWORK AS A GRAPH

The Figure below shows a graph representing a network.

The nodes of the graph, labeled A through G, may be hosts, switches, routers, or
networks.
The edges of the graph correspond to the network links.
Each edge has an associated cost

UNICAST ROUTING ALGORITHMS


There are three main classes of routing protocols:
1) Distance Vector Routing Algorithm – Routing Information Protocol
2) Link State Routing Algorithm – Open Shortest Path First Protocol
3) Path-Vector Routing Algorithm - Border Gateway Protocol

4.3 DISTANCE VECTOR ROUTING (DSR) & ROUTING


INFORMATION PROTOCOL (RIP)

Distance vector routing is distributed, i.e., algorithm is run on all nodes.


Each node knows the distance (cost) to each of its directly connected neighbors.
Nodes construct a vector (Destination, Cost, NextHop) and distributes to its
neighbors.
Nodes compute routing table of minimum distance to every other node via NextHop
using information obtained from its neighbors.

Initial State
In given network, cost of each link is 1 hop.
Each node sets a distance of 1 (hop) to its immediate neighbor and cost to itself as
0.
Distance for non-neighbors is marked as unreachable with value ∞ (infinity).
For node A, nodes B, C, E and F are reachable, whereas nodes D and G are
unreachable.

The initial table for all the nodes are given below

 Each node sends its initial table (distance vector) to neighbors and receives their
estimate.
 Node A sends its table to nodes B, C, E & F and receives tables from nodes B, C, E &
F.
 Each node updates its routing table by comparing with each of its neighbor's table For
each destination, Total Cost is computed as:
 Total Cost = Cost (Node to Neighbor) + Cost (Neighbor to Destination)
 If Total Cost < Cost then
 Cost = Total Cost and NextHop = Neighbor
 Node A learns from C's table to reach node D and from F's table to reach node G.
Total Cost to reach node D via C = Cost (A to C) + Cost(C to D)
Cost = 1 + 1 = 2.
 Since 2 < ∞, entry for destination D in A's table is changed to (D, 2, C)
 Total Cost to reach node G via F = Cost(A to F) + Cost(F to G) = 1 + 1 = 2
 Since 2 < ∞, entry for destination G in A's table is changed to (G, 2, F)
 Each node builds complete routing table after few exchanges amongst its neighbors.

System stabilizes when all nodes have complete routing information, i.e.,
convergence.
Routing tables are exchanged periodically or in case of triggered update
ROUTING INFORMATION PROTOCOL (RIP)

 RIP is an intra-domain routing protocol based on distance-vector algorithm.

Example

 Routers advertise the cost of reaching networks. Cost of reaching each link is 1
hop. For example, router C advertises to A that it can reach network 2, 3 at cost
0 (directly connected), networks 5, 6 at cost 1 and network 4 at cost 2.
 Each router updates cost and next hop for each network number.
 Infinity is defined as 16, i.e., any route cannot have more than 15 hops. Therefore
RIP can be implemented on small-sized networks only.
 Advertisements are sent every 30 seconds or in case of triggered update
 Command - It indicates the packet type. Value 1 represents a request packet.
Value 2 represents a response packet.
 Version - It indicates the RIP version number. For RIPv1, the value is 0x01.
 Address Family Identifier - When the value is 2, it represents the IP protocol.
 IP Address - It indicates the destination IP address of the route. It can be the
addresses of only the natural network segment.
 Metric - It indicates the hop count of a route to its destination
Count-To-Infinity (or) Loop Instability Problem
 Suppose link from node A to E goes down.
 Node A advertises a distance of ∞ to E to its neighbors
 Node B receives periodic update from C before A’s update reaches B
 Node B updated by C, concludes that E can be reached in 3 hops via C
 Node B advertises to A as 3 hops to reach
 Node A in turn updates C with a distance of 4 hops to E and so on
 Thus nodes update each other until cost to E reaches infinity, i.e., no
convergence.
 Routing table does not stabilize.
 This problem is called loop instability or count to infinity
4.4 LINK STATE ROUTING (LSR) & OPEN SHORTEST PATH
PROTOCOL (OSPF)

 Each node knows state of link to its neighbors and cost.


 Nodes create an update packet called link-state packet (LSP) that contains:
1. ID of the node
2. List of neighbors for that node and associated cost
3. 64-bit Sequence number
4. Time to live
 Link-State routing protocols rely on two mechanisms:
1. Reliable flooding of link-state information to all other nodes
2. Route calculation from the accumulated link-state knowledge

Reliable Flooding

 Each node sends its LSP out on each of its directly connected links.
 When a node receives LSP of another node, checks if it has an LSP already for
that node.
 If not, it stores and forwards the LSP on all other links except the incoming
one.
 Else if the received LSP has a bigger sequence number, then it is stored and
forwarded. Older LSP for that node is discarded.
 Otherwise discard the received LSP, since it is not latest for that node.
 Thus recent LSP of a node eventually reaches all nodes, i.e., reliable flooding.
 Flooding of LSP in a small network is as follows:
1. When node X receives Y’s LSP (fig a), it floods onto its neighbors A and
C (fig b)
2. Nodes A and C forward it to B, but does not sends it back to X (fig c).
3. Node B receives two copies of LSP with same sequence number.
4. Accepts one LSP and forwards it to D (fig d). Flooding is complete.
 LSP is generated either periodically or when there is a change in the topology

Route Calculation

 Each node knows the entire topology, once it has LSP from every other node.
 Forward search algorithm is used to compute routing table from the received
LSPs.
 Each node maintains two lists, namely Tentative and Confirmed with entries of
the form (Destination, Cost, NextHop).

OPEN SHORTEST PATH FIRST PROTOCOL (OSPF)

 OSPF is a non-proprietary widely used link-state routing protocol. OSPF


Features are:
1. Authentication―Malicious host can collapse a network by advertising
to reach every host with cost 0. Such disasters are averted by
authenticating routing updates.
2. Additional hierarchy―Domain is partitioned into areas, i.e., OSPF is
more scalable.
3. Load balancing―Multiple routes to the same place are assigned same
cost. Thus traffic is distributed evenly.

Link State Packet Format

1. Version ― represents the current version, i.e., 2.


2. Type ― represents the type (1–5) of OSPF message. Type 1 - “hello”
message, Type 2 - request, Type 3 – send , Type 4 -
acknowledge the receipt of link state messages , Type 5 - reserved
3. SourceAddr ― identifies the sender
4. AreaId ― 32-bit identifier of the area in which the node is located
5. Checksum ― 16-bit internet checksum
6. Authentication type ― 1 (simple password), 2 (cryptographic authentication).
7. Authentication ― contains password or cryptographic checksum
4.5 PATH VECTOR ROUTING (PVR) & BORDER GATEWAY
PROTOCOL (BGP)

 Path-vector routing is an asynchronous and distributed routing algorithm.


 The Path-vector routing is not based on least-cost routing.
 The best route is determined by the source using the policy it imposes on the
route.
 In other words, the source can control the path.
 Path-vector routing is not actually used in an internet, and is mostly designed to
route a packet between ISPs.

Spanning Trees

Example:

 The Figure below shows a small internet with only five nodes.
 Each source has created its own spanning tree that meets its policy.
 The policy imposed by all sources is to use the minimum number of nodes to
reach a destination.
 The spanning tree selected by A and E is such that the communication does not
pass through D as a middle node.
 Similarly, the spanning tree selected by B is such that the communication does
not pass through C as a middle node

Path Vectors made at booting time

 The Figure below shows all of these path vectors for the example.
 Not all of these tables are created simultaneously.
 They are created when each node is booted.
 The figure also shows how these path vectors are sent to immediate neighbors
after they have been created.

Updating Path Vectors



 The Figure below shows the path vector of node C after two events.
 In the first event, node C receives a copy of B’s vector, which improves its
vector: now it knows how to reach node A.
 In the second event, node C receives a copy of D’s vector, which does not
change its vector.
 The vector for node C after the first event is stabilized and serves as its
forwarding table.

BORDER GATEWAY PROTOCOL (BGP)

 The Border Gateway Protocol version (BGP) is the only interdomain routing
protocol used in the Internet today.
 BGP4 is based on the path-vector algorithm. It provides information about the
reachability of networks in the Internet.
 BGP views internet as a set of autonomous systems interconnected arbitrarily.

 Each AS have a border router (gateway), by which packets enter and leave that
AS. In above figure, R3 and R4 are border routers.
 One of the router in each autonomous system is designated as BGP speaker.
 BGP Speaker exchange reachability information with other BGP speakers,
known as external BGP session.
 BGP advertises complete path as enumerated list of AS (path vector) to reach a
particular network.
 Paths must be without any loop, i.e., AS list is unique.
 For example, backbone network advertises that networks 128.96 and 192.4.153
can be reached along the path <AS1, AS2, AS4>
4.6 MULTICASTING

 In multicasting, there is one source and a group of destinations.


 Multicast supports efficient delivery to multiple destinations.
 The relationship is one to many or many-to-many.
 One-to-Many (Source Specific Multicast)
1. Radio station broadcast
2. Transmitting news, stock-price
3. Software updates to multiple hosts
 Many-to-Many (Any Source Multicast)
1. Multimedia teleconferencing
2. Online multi-player games
3. Distributed simulations
 In this type of communication, the source address is a unicast address, but the
destination address is a group address.
 The group address defines the members of the group
 In multicasting, a multicast router may have to send out copies of the same
datagram through more than one interface.
 Hosts that are members of a group receive copies of any packets sent to that
group’s multicast address
 A host can be in multiple groups
 A host can join and leave groups
 A host signals its desire to join or leave a multicast group by communicating
with its local router using a special protocol.

MULTICAST ROUTING

 To support multicast, a router must additionally have multicast forwarding


tables that indicate, based on multicast address, which links to use to forward
the multicast packet.
 Unicast forwarding tables collectively specify a set of paths.
 Multicast forwarding tables collectively specify a set of trees -Multicast
distribution trees.
 Multicast routing is the process by which multicast distribution trees are
determined.
 To support multicasting, routers additionally build multicast forwarding tables.
 Multicast forwarding table is a tree structure, known as multicast distribution
trees.
 Internet multicast is implemented on physical networks that support
broadcasting by extending forwarding functions.
MULTICAST ROUTING PROTOCOLS

 Internet multicast is implemented on physical networks that support


broadcasting by extending forwarding functions.
 Major multicast routing protocols are:
1. Distance-Vector Multicast Routing Protocol (DVMRP)
2. Protocol Independent Multicast (PIM)

Distance Vector Multicast Routing Protocol

 The DVMRP, is a routing protocol used to share information between routers to


facilitate the transportation of IP multicast packets among networks.
 It formed the basis of the Internet's historic multicast backbone.
 Distance vector routing for unicast is extended to support multicast routing.
 Each router maintains a routing table for all destination through exchange of
distance vectors.
 DVMRP is also known as flood-and-prune protocol.
 DVMRP consists of two major components:
 A conventional distance-vector routing protocol, like RIP
 A protocol for determining how to forward multicast packets, based on the
routing table

 Multicasting is added to distance-vector routing in four stages.


1. Flooding
2. Reverse Path Forwarding (RPF)
3. Reverse Path Broadcasting (RPB)
4. Reverse Path Multicast (RPM)
Flooding 

 Router on receiving a multicast packet from source S to a Destination from


NextHop, forwards the packet on all out-going links. 
 Packet is flooded and looped back to S. 
The drawbacks are:
1. It floods a network, even if it has no members for that group.
2. Packets are forwarded by each router connected to a LAN, i.e., duplicate
flooding
Reverse Path Forwarding (RPF) 
 RPF eliminates the looping problem in the flooding process. 
 Only one copy is forwarded and the other copies are discarded. 
 RPF forces the router to forward a multicast packet from one specific interface:
the one which has come through the shortest path from the source to the router. 
 Packet is flooded but not looped back to S.

Reverse-Path Broadcasting (RPB) 


 RPB does not multicast the packet, it broadcasts it. 
 RPB creates a shortest path broadcast tree from the source to each destination. 
 It guarantees that each destination receives one and only one copy of the packet. 
 We need to prevent each network from receiving more than one copy of the
packet. 
 If a network is connected to more than one router, it may receive a copy of the
packet from each router. 
 One router identified as parent called designated Router (DR). 
 Only parent router forwards multicast packets from source S to the attached
network.
 When a router that is not the parent of the attached network receives a multicast
packet, it simply drops the packet

Reverse-Path Multicasting (RPM)



 To increase efficiency, the multicast packet must reach only those networks that
have active members for that particular group. 
 RPM adds pruning and grafting to RPB to create a multicast shortest path tree
that supports dynamic membership changes
Protocol Independent Multicast (PIM)

 PIM divides multicast routing problem into sparse and dense mode. 
 PIM sparse mode (PIM-SM) is widely used. 
 PIM does not rely on any type of unicast routing protocol, hence protocol
independent. 
 Routers explicitly join and leave multicast group using Join and Prune
messages. 
 One of the router is designated as rendezvous point (RP) for each group in a
domain to receive PIM messages. 
 Multicast forwarding tree is built as a result of routers sending Join messages to
RP. 
Two types of trees to be constructed:
Shared tree - used by all senders
Source-specific tree - used only by a specific sending host 
 The normal mode of operation creates the shared tree first, followed by one or
more source-specific trees
Shared Tree

 When a router sends Join message for group G to RP, it goes through a set of
routers. 
 Join message is wildcarded (*), i.e., it is applicable to all senders. 
 Routers create an entry (*, G) in its forwarding table for the shared tree.
 Interface on which the Join arrived is marked to forward packets for that group.
 Forwards Join towards rendezvous router RP. 
 Eventually, the message arrives at RP. Thus a shared tree with RP as root is
formed.

Example 

 Router R4 sends Join message for group G to rendezvous router RP. 
 Join message is received by router R2. It makes an entry (*, G) in its table and
forwards the message to RP. 
 When R5 sends Join message for group G, R2 does not forwards the Join. It adds
an outgoing interface to the forwarding table created for that group.
 Suppose route R1 receives a message to group G. oR1 has no state for group G.
 Encapsulates the multicast packet in a Register message.
 Multicast packet is tunneled along the way to RP. 
 RP decapsulates the packet and sends multicast packet onto the shared tree,
towards R2. 
 R2 forwards the multicast packet to routers R4 and R5 that have members for
group G

Source-Specific Tree

 RP can force routers to know about group G, by sending Join message to the
sending host, so that tunneling can be avoided. 
 Intermediary routers create sender-specific entry (S, G) in their tables. Thus a
source-specific route from R1 to RP is formed. 
 If there is high rate of packets sent from a sender to a group G, then shared-tree
is replaced by source-specific tree with sender as root.

 Rendezvous router RP sends a Join message to the host router R1. 


 Router R3 learns about group G through the message sent by RP. 
 Router R4 send a source-specific Join due to high rate of packets from sender. 
 Router R2 learns about group G through the message sent by R4. 
 Eventually a source-specific tree is formed with R1 as root.

You might also like