CN - Unit 4
CN - Unit 4
Routing
Syllabus
Routing and protocols: Unicast routing - Distance Vector Routing - RIP -
Link State Routing – OSPF – Path-vector routing - BGP - Multicast
Routing: DVMRP – PIM.
• An internet is a combination of networks connected by
routers. When a datagram goes from a source to a
destination, it will probably pass through many
routers until it reaches the router attached to the
destination network.
TYPES OF ROUTING PROTOCOLS
repeat (forever) {
wait (for a vector Dw from a neighbor w or any change in the link)
for (y = 1 to N) {
D[y] = min [D[y], (c[myself][w] + Dw[y])] // Bellman-Ford equation
}
if (any change in the vector)
send vector {D[1], D[2], …, D[N]} to all neighbors
}
} // End of Distance Vector
⚫ System stabilizes when all nodes
have complete routing
information, i.e., convergence.
⚫ Routing tables are exchanged
periodically or in case of triggered
update.
⚫ The final distances stored at each
node is given below:
Updation of Routing Tables
⚫ There are two different
circumstances under which a
given node decides to send a
routing update to its neighbors.
1. Periodic Update
2. Triggered Update
Periodic Update
⚫ In this case, each node automatically
sends an update message every so
often, even if nothing has changed.
⚫ The frequency of these periodic
updates varies from protocol to
protocol, but it is typically on the
order of several seconds to several
minutes.
Triggered Update
⚫ In this case, whenever a node notices a
link failure or receives an update from
one of its neighbors that causes it to
change one of the routes in its routing
table.
⚫ Whenever a node’s routing table
changes, it sends an update to its
neighbors, which may lead to a change
Count to Infinity
• For a routing protocol to work properly, if a link is broken (cost becomes infinity),
every other router should be aware of it immediately, but in distance-vector
routing, this takes some time. The problem is referred to as count to infinity. It
sometimes takes several updates before the cost for a broken link is recorded as
infinity by all routers.
Two-Node Loop
Two-Node Loop
• At the beginning, both nodes A and B know how to reach node X.
• Suddenly, the link between A and X fails. Node A changes its table. If A can send its
table to B immediately, everything is fine. However, the system becomes unstable
if B sends its forwarding table to A before receiving A’s forwarding table.
• Node A receives the update and, assuming that B has found a way to reach X,
immediately updates its forwarding table. Now A sends its new update to B.
Now B thinks that something has been changed around A and updates its
forwarding table. The cost of reaching X increases gradually until it reaches
infinity. At this moment, both A and B know that X cannot be reached.
However, during this time the system is not stable. Node A thinks that the
route to X is via B; node B thinks that the route to X is via A. If A receives a
packet destined for X, the packet goes to B and then comes back to A.
Similarly, if B receives a packet destined for X, it goes to A and comes back to
B. Packets bounce between A and B, creating a two-node loop problem.
Split Horizon
• One solution to instability (loop problem) is called split horizon
Here, each node sends only part of its table (and not the entire table) through
each interface.
If, according to its table, node B thinks that the optimum route to reach X
is via A, it does not need to advertise this piece of information to A.
Node A keeps the value of infinity as the distance to X. Later, when node A
sends its forwarding table to B, node B also corrects its forwarding table.
Poison Reverse
• Another solution to loop problem is poison reverse
• Using the split-horizon strategy has one drawback.
When node B in the previous scenario eliminates the route to X from its
advertisement to A, node A cannot guess whether this is due to the split-
horizon strategy (the source of information was A) or because B has not
received any news about X recently.
• In the poison reverse strategy B can still advertise the value for X, but if the source
of information is A, it can replace the distance with infinity as a warning: “Do not
use this value; what I know about this route comes from you.”
Routing Information Protocol (RIP)
The Routing Information Protocol (RIP) is one of the most widely used intradomain routing
protocols based on the distance-vector routing algorithm
Hop Count
First, since a router in an AS needs to know how to forward a packet to different networks
(subnets) in an AS,
RIP routers advertise the cost of reaching different networks instead of reaching other nodes in a
theoretical graph.
Cost is defined between a router and the network in which the destination host is located.
Second, to make the implementation of the cost simpler the cost is defined as the number of
hops, which means the number of networks (subnets) a packet needs to travel through
from the source router to the final destination host.
Network in which the source host is connected is not counted in this calculation because the
source host does not use a forwarding table; the packet is delivered to the default router.
In RIP, the maximum cost of a path can be 15, which means 16 is considered as infinity (no
connection). 28
Forwarding Tables
Routers in an autonomous system need to keep forwarding tables to forward packets to their destination
networks.
A forwarding table in RIP is a three-column table in which the first column is the address of the
destination network,
Second column is the address of the next router to which the packet should be forwarded,
Third column is the cost (the number of hops) to reach the destination network.
Although a forwarding table in RIP defines only the next router in the second column, it gives the
information about the whole least-cost tree .
For example, R1 defines that the next router for the path to N4 is R2;
R2 defines that the next router to N4 is R3;
R3 defines that there is no next router for this path.
The tree is then R1 → R2 → R3 → N4.
The third column is not needed for forwarding the packet, but it is needed for updating the forwarding
table when there is a change in the route.
29
30
31
RIP Implementation
Implemented as a process that uses the service of UDP on the well-known port number
520.
In BSD, RIP is a daemon process (a process running in the background),
named routed (abbreviation for route daemon and pronounced route-dee).
RIP messages are encapsulated inside UDP user datagrams, which in turn are
encapsulated inside IP datagrams.
RIP runs at the application layer, but creates forwarding tables for IP at the network
later.
RIP has gone through two versions: RIP-1 and RIP-2.
The second version is backward compatible
32
RIP Messages
RIP routers exchange routing table information with their neighbors at regular intervals (typically 30 seconds).
• Two RIP processes, a client and a server, need to exchange messages.
• RIP-2 defines the format of the message, as shown in Figure
• Part of the message, which we call entry, can be repeated as needed in a message.
• RIP has two types of messages: request and response.
• A request message is sent by a router that has just come up or by a router that has some time-out entries.
• A request message can ask about specific entries or all entries.
• A response (or update) message can be either solicited or unsolicited.
• A solicited response message is sent only in answer to a request message. It contains information about
the destination specified in the corresponding request message.
• An unsolicited response message, is sent periodically, every 30 seconds or when there is a change in the
forwarding table.
33
34
RIP Algorithm
RIP implements the same algorithm as the distance-vector routing algorithm.
Some changes to be made to enable a router to update its forwarding table:
❑ Instead of sending only distance vectors, a router needs to send the whole contents of its
forwarding table in a response message.
❑ The receiver adds one hop to each cost and changes the next router field to the address of the
sending router.
Each route in the modified forwarding table is the received route
Each route in the old forwarding table the old route.
Received router selects the old routes as the new ones except in the following three cases:
1. If the received route does not exist in the old forwarding table, it should be added to the route.
2. If the cost of the received route is lower than the cost of the old one, the received route should be
selected as the new one.
3. If the cost of the received route is higher than the cost of the old one, but the value of the next
router is the same in both routes, the received route should be selected as the new one.
35
Case : Route was actually advertised by the same router in the past, but now the situation has been
changed.
Example,
suppose a neighbour has previously advertised a route to a destination with cost 3, but now there is no
path between this neighbour and that destination.
The neighbor advertises this destination with cost value infinity (16 in RIP).
The receiving router must not ignore this value even though its old route has a lower cost to the same
destination.
❑ The new forwarding table needs to be sorted according to the destination route.
36
Performance
❑ Update Messages. The update messages in RIP have a very simple format and are sent only to
neighbors;
they are local. They do not normally create traffic because the routers try to avoid sending them at the
same time.
38
39
Link-State Routing
• The internet can be modeled as a graph with nodes(routers) and edges(lines that
connect the nodes)
• A link is an edge of the graph
• State of a link is the cost associated with an edge
• There are three main steps to find the least cost tree for each router - (Least-cost
tree is the tree with the source router as the root and the path between the root
and any other node is the shortest)
1. Flooding – Each router creates and sends a Link State Packet (LSP) to its
neighbors who in turn forward it to their neighbors, and so on, until the LSP
reaches every router in the network.
2. With the help of the information received in LSP packet, all the routers
together create a common database referred to as Link-State Database
(LSDB). Every router has a copy of this database.
3. Each router then applies an algorithm called Dijkstra algorithm to the LSDB,
in order to create a least-cost tree for itself
• To create a least-cost tree, each node needs to have a complete map of the
network i.e. it needs to know the state of each link. The collection of states for all
links is called the link-state database (LSDB).
• There is only one LSDB for the whole internet; each node needs to have a
copy of it
Flooding
⚫ To create this LSDB, each node creates an update packet called link-state packet (LSP) that contains:
ID of the node
List of neighbors for that node and associated cost
64-bit Sequence number
Time to live
• The LSP is sent out of each interface
• When a node receives an LSP from one of its interfaces, it compares the LSP with
the copy it may already have. If the newly arrived LSP is older than the one it has
(found by checking the sequence number), it discards the LSP. If it is newer, the
node discards the old LSP (if there is one) and keeps the received one. It then
sends a copy of it out of each interface except the one from which the packet
arrived. This guarantees that flooding stops somewhere in the network (where a
node has only one interface).
• Difference between the link-state routing algorithm and the distance-vector
routing algorithm.
In the distance-vector routing algorithm, each router tells its neighbors what it
knows about the whole internet; in the link-state routing algorithm, each router
tells the whole internet what it knows about its neighbors
Formation of Least cost tree
• To create a least-cost tree for itself, using the shared LSDB, each node
needs to run the famous Dijkstra Algorithm. This iterative algorithm
uses the following steps:
1. The node chooses itself as the root of the tree, creating a tree
with a single node, and sets the total cost of each node based on the
information in the LSDB.
2. The node selects one node, among all nodes not in the tree,
which is closest to the root, and adds this to the tree. After this node
is added to the tree, the cost of all other nodes not in the tree needs
to be updated because the paths may have been changed.
3. The node repeats step 2 until all nodes are added to the tree
Formation of Least cost tree
Dijkstra’s Algorithm ( ) {
// Initialization
Tree = {root} // Tree is made only of the root
for (y = 1 to N) // N is the number of nodes
{
if (y is the root)
D[y] = 0 // D[y] is shortest distance from root to node y
else if (y is a neighbor)
D[y] = c[root][y] // c[x][y] is cost between nodes x and y in LSDB
else
D[y] = ∞
} //for
Formation of Least cost tree
repeat {
find a node w, with D[w] minimum among all nodes not in the Tree
Tree = Tree ∪ {w} // Add w to tree
// Update distances for all neighbors x of w
for (every node x, which is a neighbor of w and not in the Tree) {
D[x] = min{D[x], (D[w] + c[w][x])}
}
} until (all nodes included in the Tree)
} // End of Dijkstra
Formation of Least cost tree with A as
the root node
Formation of Least cost tree with A as
the root node
Open Shortest Path First (OSPF) Protocol
• Open Shortest Path First (OSPF) is an intradomain routing protocol
• lt is based on the link-state routing protocol
• Each link can be assigned a weight based on the throughput, round-
trip time, reliability or even hop count.
• OSPF uses flooding mechanism to form the least-cost tree
Flooding may generate huge volume of traffic in a larger AS (autonomous
system)
To prevent this huge traffic, OSPF divides an AS into areas
Each area has an ID
All the areas are connected by a backbone area. The ID of the backbone area
is 0 (0.0.0.0).
The routers in the backbone area are responsible for passing the information
collected by each area to all other areas.
In this way, a router in an area can receive all LSPs generated in other
areas
• For forming the LSDB, we can have five types of LSPs or Link-State Advertisements
(LSA):
• Router link
• Network link
• Summary link to network
• Summary link to AS
• External link.
• Router link or Router LSA
• Contains information about the router itself, including its
links and link costs.
• Links include:
A transient link - a link to a transient network, a
network that is connected to the rest of the networks
by one or more routers
Here it advertises the address of the network and
the cost of the link
A stub link - a link to a stub network, a network that is
not a through network.
Here it advertises the address of the stub network
and the cost of the link
A point-to-point link – a link to another router
Here it advertises the ip address of the other router
and the cost of the link
• These LSPs flooded within the router's area.
• Network link or Network LSA
• Describes a network
• One of the routers is assigned as the Designated Router (DR). This DR does
the advertising. It announces the IP address of all routers in the network
(including the designated router), but no cost is advertised
• These LSPs flooded within the DR’s area
• Summary link to network
Here, the advertisement is done by the Area Border Router (ABR)
Summarizes the information of the links collected about an area either from
the area to the backbone or from the backbone to another area
• Summary link to AS
• This advertisement is done by an AS router
• It advertises the about the summary links in other ASs to the backbone area of
the current AS
• External link or External LSA
• This is also done by an AS router to advertise the existence of a single network
(using a protocol other than OSPF) outside the AS to the backbone area
OSPF Messages
• The hello message (type 1) is used by a new router to introduce itself to the
neighbors
• The Database Description (DD) message (type 2) is normally sent in response to
the hello message to allow a newly joined router to acquire the full LSDB
• The Link State Request (LSR) message (type 3) is sent by a router that needs
information about a specific LS.
• The Link-State Update (LSU) message (type 4) is the main OSPF message used for
building the LSDB. They are sent in response to link state request message . This
message, in fact, has five different versions (router link, network link, summary
link to network, summary link to AS border router, and external link)
• The Link-State Acknowledgment (LSAck) message (type 5) - each router that
receives a link-state update message needs to acknowledge it using the type 5
message
OSPF common header
LSU Packet – can contain any combination of five different kinds of LSA
OSPF Common
header
Version—OSPF version number, which is 2 for OSPFv2.
Type—OSPF packet type from 1 to 5, corresponding to hello, DD, LSR, LSU, and
LSAck, respectively.
Packet length—Total length of the OSPF packet in bytes, including the header.
Router ID—ID of the advertising router.
Area ID—ID of the area where the advertising router resides.
Checksum—Checksum of the message.
AuType—Authentication type, ranging from 0 to 2, corresponding to non-
authentication, simple (plaintext) authentication, and MD5 authentication,
respectively.
Authentication—Information determined by authentication type. It is not
defined for authentication type 0. It is defined as password information for
authentication type 1, and defined as Key ID, MD5 authentication data length,
and sequence number for authentication type 2.
PATH VECTOR ROUTING (PVR)
PATH VECTOR ROUTING (PVR)
⚫ 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.
⚫ For example, the best route may be based on
security factor.
⚫ Path-vector routing is not actually used in an
internet, and is mostly designed to route a
packet between ISPs.
Spanning Trees
⚫ In path-vector routing, the path from a source to all
destinations is determined by the best spanning tree.
⚫ The best spanning tree is not the least-cost tree.
⚫ It is the tree determined by the source when it
imposes its own policy.
⚫ If there is more than one route to a destination, the
source can choose the route that meets its policy
best.
⚫ A source may apply several policies at the same
time.
⚫ One of the common policies uses the minimum
number of nodes to be visited (something similar
to least cost)
⚫ Another common policy is to avoid some nodes as
18
⚫ The spanning trees are made, gradually and
asynchronously, by each node.
⚫ When a node is booted, it creates a path vector
based on the information it can obtain about
its immediate neighbor.
⚫ A node sends greeting messages to its
immediate neighbors to collect these
pieces of information.
⚫ Each node, after the creation of the initial path
vector, sends it to all its immediate neighbors.
⚫ Each node, when it receives a path vector
from a neighbor, updates its path vector
using the formula
⚫ The policy is defined by selecting the best of
multiple paths.
⚫ Path-vector routing also imposes one more
condition on this equation.
• If Path (v, y) includes x, that path is discarded
to avoid a loop in the path.
• In other words, x does not want to visit itself
when it selects a path to y.
Example:
⚫ 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.
Path Vectors made at booting time
Updating path vectors
• 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.
Path vector routing algorithm
Path_Vector_Routing ( ) {
// Update
// Initialization repeat (forever) {
for (y = 1 to N) { wait (for a vector Pathw from a neighbor w)
if (y is myself) for (y = 1 to N) {
if (Pathw includes myself)
Path[y] = myself discard the path // Avoid any loop
else if (y is a neighbor) else
Path[y] = myself + neighbor node Path[y] = best {Path[y],
(myself + Pathw [y])}
else }
Path[y] = empty
}
//Send vector {Path[1], Path[2], …,
//Path[y]} to all neighbors
BORDER GATEWAY PROTOCOL
(BGP)
BORDER GATEWAY PROTOCOL (BGP
80
81
The figure also shows the simplified update messages sent by routers involved in the eBGP sessions.
The circled number defines the sending router in each case.
For example, message number 1 is sent by router R1 and tells router R5 that N1, N2, N3, and N4 can be
reached through router R1.
Router R5 can now add these pieces of information at the end of its forwarding table.
When R5 receives any packet destined for these four networks, it can use its forwarding table and find that the
next router is R1.
Messages exchanged during three eBGP sessions help some routers know how to route packets to some
networks in the internet, but the reachability information is not complete.
There are two problems that need to be addressed:
1. Some border routers do not know how to route a packet destined for non neighbor ASs. For
example, R5 does not know how to route packets destined for networks in AS3 and AS4. Routers R6 and
R9 are in the same situation as R5: R6 does not know about networks in AS2 and AS4; R9 does not know
about networks in AS2 and AS3.
2. None of the non border routers know how to route a packet destined for any net- works in other
ASs.
To address the above two problems, we need to allow all pairs of routers (border or non-border) to run the 82
Operation of Internal BGP (iBGP)
The iBGP protocol is similar to the eBGP protocol in that it uses the service of TCP on the well-
known port 179, but it creates a session between any possible pair of routers inside an
autonomous system.
First, if an AS has only one router, there cannot be an iBGP session.
For example, we cannot create an iBGP session inside AS2 or AS4 in our internet.
Second, if there are n routers in an autonomous system, there should be [n × (n -1) / 2] iBGP
sessions in that autonomous system (a fully connected mesh) to prevent loops in the system.
In other words, each router needs to advertise its own reachability to the peer in the session
instead of flooding what it receives from another peer in another session.
Figure 20.26 shows the combination of eBGP and iBGP sessions in our internet.
83
84
The first message (numbered 1) is sent by R1 announcing that networks N8 and N9 are reachable through the
path AS1-AS2, but the next router is R1.
This message is sent, through separate sessions, to R2, R3, and R4.
Routers R2, R4, and R6 do the same thing but send different messages to different destinations.
The interesting point is that, at this stage, R3, R7, and R8 create sessions with their peers, but they actually have no message
to send.
The updating process does not stop here.
For example, after R1 receives the update message from R2, it combines the reachability information about AS3 with the
reach- ability information it already knows about AS1 and sends a new update message to R5.
Now R5 knows how to reach networks in AS1 and AS3. The process continues when R1 receives the update message from
R4.
The point is that we need to make certain that at a point in time there are no changes in the previous updates and that all
information is propagated through all ASs.
At this time, each router combines the information received from eBGP and iBGP and creates what we may call a path table
after applying the criteria for finding the best path, including routing policies that we discuss later.
85
86
Injection of Information into Intradomain
Routing
• The path tables collected and organized by BPG are not used, for
routing packets; they are injected into intradomain forwarding tables
(RIP or OSPF) for routing packets
Address Aggregation
• Intradomain forwarding tables obtained with the help of the BGP4 protocols may
become huge in the case of the global Internet because many destination
networks may be included in a forwarding table.
• Fortunately, BGP4 uses the prefixes as destination identifiers and allows the
aggregation of these prefixes.
• For example, prefixes 14.18.20.0/26, 14.18.20.64/26, 14.18.20.128/26, and
14.18.20.192/26, can be combined into 14.18.20.0/24 if all four subnets can be
reached through one path
Path Attributes
In both intradomain routing protocols (RIP or OSPF), a destination is normally
associated with two pieces of information: next hop and cost.
The first one shows the address of the next router to deliver the packet; the second
defines the cost to the final destination.
In BGP these pieces are called path attributes.
BGP allows a destination to be associated with up to seven path attributes.
Path attributes are divided into two broad categories: well-known and optional.
A well-known attribute must be recognized by all routers; an optional attribute need
not be.
A well-known attribute can be mandatory, which means that it must be present in
any BGP update message, or discretionary, which means it does not have to be.
An optional attribute can be either transitive, which means it can pass to the next
AS, or intransitive, which means it cannot. 89
90
Attribute type
• ORIGIN (type 1):
Well-known mandatory attribute
Defines the source of the routing information.
Can take of the three values: 1, 2 or 3.
1 - information about the path has been taken from an intradomain protocol
(RIP or OSPF)
2 - information comes from BGP
3 - information comes from an unknown source
• AS-PATH (type 2):
Well-known mandatory attribute
Defines the list of autonomous systems through which the destination can be
reached.
Helps to prevent a loop - whenever an update message arrives at a router that
lists the current AS in the path, the router drops that path.
Attribute type
• NEXT-HOP (type 3):
Well-known mandatory attribute
Defines the next router to which the data packet should be forwarded.
This attribute helps to inject path information collected through the
operations of eBGP and iBGP into the intradomain routing protocols such as
RIP or OSPF
• MULT-EXIT-DISC or Multi-Exit Discriminator or MED (type 4):
Optional intransitive attribute
It is a numerical value, which is used to select one among multiple paths to a
destination.
For example, if a router has multiple paths to the destination with same value
in LOCAL-PREF, the one with the lowest MED value is selected. Note that this
attribute is intransitive, which means that it is not propagated from one AS to
another.
Attribute type
• LOCAL-PREF (type 5):
Well-known discretionary attribute.
It is normally set by the administrator, based on the organization policy.
For example, in an internet with five ASs, the administrator of AS1 can set the
local preference value of 400 to the path AS1 → AS2 → AS5, the value of 300
to AS1 → AS3 → AS5, and the value of 50 to AS1 → AS4 → AS5. This means
that the administrator prefers the first path to the second one and prefers the
second one to the third one. The last route should be selected if the other two
are not available.
• ATOMIC-AGGREGATE (type 6):
Well-known discretionary attribute
Defines the destination prefix as not aggregate; it only defines a single
destination network.
This attribute has no value field
Attribute type
• AGGREGATOR (type 7):
Optional transitive attribute, which emphasizes that the
destination prefix is an aggregate.
The attribute value gives the number of the last AS that did the
aggregation followed by the IP address of the router that did so
Route selection
BGP Messages
• BGP uses four types of messages for communication between the BGP speakers
across the ASs and inside an AS:
Open
Update
Keepalive
Notification
BGP Messages
• Open Message (Type 1): To create a neighborhood relationship, a router running
BGP opens a TCP connection (BGP session) with a neighbor and sends an open
message.
• Update Message (Type 2): The update message is the heart of the BGP protocol. It
is used by a router to advertise, update or withdraw routes.
• Notification Message(Type 3): Sent by a router whenever an error condition is
detected or a router wants to close the session.
• Keepalive Message (Type 4): The BGP peers exchange keepalive messages
regularly to tell each other that they are alive
BGP Messages
Multicast Routing
• In multicasting, there is one source and a group of destinations.
• The relationship is one to many.
• The source address is a unicast address, but the destination address is a group address, a
group of one or more destination networks .
• The group address defines the members of the group. Figure shows the routers have been
changed to multicast routers
Multicasting versus Multiple
Unicasting
• Multicasting starts with a single packet from the source that is duplicated
by the routers.
• The destination address in each packet is the same for all duplicates.
Note that only a single copy of the packet travels between any two
routers.
• In multiple unicasting, several packets start from the source. If there are
three destinations, for example, the source sends three packets, each
with a different unicast destination address. Note that there may be
multiple copies traveling between two routers. For example, when a
person sends an e-mail message to a group of people, this is multiple
unicasting. The e-mail application software creates replicas of the
message, each with a different destination address, and sends them one
Multicast Addresses in IPv4
A router or a destination host needs to distinguish between a unicast and a multicast
datagram.
IPv4 and IPv6 each assign a block of addresses for this purpose.
In classful addressing, all of class D was composed of these addresses; classless
addressing used the same block, but it was referred to as the block 224.0.0.0/4 (from
224.0.0.0 to 239.255.255.255).
The number of addresses in the multicast block is huge (228). We definitely cannot
have that many individual groups.
103
104
• Forwarding decisions in unicast communication depend only on the destination
address of the packet. Forwarding decisions in multicast communication depend on
both the destination and the source address of the packet.
• In other words, in unicasting, forwarding is based on where the packet should go;
in multicasting, forwarding is based on where the packet should go and where the
packet has come from.
105
106
Source-Based Tree Approach
In the source-based tree approach to multicasting, each router needs to create a
separate tree for each source-group combination.
In other words, if there are m groups and n sources in the internet, a router needs to
create (m × n) routing trees.
In each tree, the corresponding source is the root, the members of the group are the
leaves, and the router itself is somewhere on the tree.
We can compare the situation with unicast routing in which a router needs only one
tree with itself as the root and all networks in the internet as the leaves.
Although it may appear that each router needs to create and store a huge amount of
information about all of these trees, there are two protocols
107
Group-Shared Tree Approach
In the group-shared tree approach, we designate a router to act as the phony source for
each group.
The designated router, which is called the core router or the rendezvous- point router, acts
as the representative for the group.
Any source that has a packet to send to a member of that group sends it to the core center
(unicast communication) and the core center is responsible for multicasting.
The core center creates one single routing tree with itself as the root and any routers with
active members in the group as the leaves.
In this approach, there are m core routers (one for each group) and each core router has a
routing tree, for the total of m trees. This means that the number of routing trees is
reduced from (m × n) in the source-based tree approach to m in this approach.
108
Multicast Applications
• Access to Distributed Databases: The user who needs to access the database
does not know the location of the information. A user’s request is multicast to all
the database locations, and the location that has the information responds.
• Information Dissemination: A business can send one message that can reach
many customers.
• Teleconferencing: Teleconferencing involves multicasting. The individuals
attending a teleconference all need to receive the same information at the same
time. Temporary or permanent groups can be formed for this purpose.
• Distance Learning: Lessons taught by one professor can be received by a specific
group of students. This is especially convenient for those students who find it
difficult to attend classes on campus
Distance Vector Multicast
Routing Protocol (DVMRP)
• Extension of the Routing Information Protocol (RIP) which is used in unicast
routing.
• Each router in this protocol that receives a multicast packet to be forwarded
implicitly creates a source-based multicast tree in three steps:
1. The router uses an algorithm called reverse path forwarding (RPF) to
simulate creating part of the optimal source-based tree between the source
and itself.
2. The router uses an algorithm called reverse path broadcasting (RPB) to
create a broadcast (spanning) tree whose root is the router itself and whose
leaves are all networks in the internet.
3. The router uses an algorithm called reverse path multicasting (RPM) to
create a multicast tree by cutting some branches of the tree that end in
networks with no member in the group.
Reverse Path Forwarding (RPF)
• In this strategy, the router only forwards those packets that have traveled the shortest path
from source to destination.
• How will a router know which interface belongs to the shortest path?
• To know this, the router pretends that it has a packet to send to the source from where the
packet has arrived. (because the shortest path from A to B is also the shortest path from B to
A)
• In this way, the shortest path to the sender of the packet is computed.
• If the same route is followed by the received packet, it is forwarded to the next router and it
is discarded otherwise.
• The reverse path forwarding ensures that the network receives a copy of the packet without
formation of loops. A loop occurs when a packet that has left the router may come back again
from another interface or the same interface and be forwarded again.
• RPF eliminates loop but does not guarantee that each network receives only a single copy of
the packet.
• The reason for this is that the routing is based on the source address and not on the
destination address.
Reverse Path Broadcasting
(RPB)
• In order to solve the problem, RPB is used.
• In this method, one parent router is defined for each network.
• The network could accept the multicast packets from this parent
router only.
• This router sends packets to those ports for which it is designated as
parent.
• Thus, RPB principle’ allows a router to broadcast the packet in the
network.
This creates duplicate packets on the network and reduces the network
efficiency.
Reverse Path Multicasting (RPM)