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

Unit 3

Uploaded by

22r11a05t5
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
20 views

Unit 3

Uploaded by

22r11a05t5
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 28

Internet Protocol Version 4-

 IPv4 short for Internet Protocol Version 4 is the fourth version of the Internet Protocol (IP).
 IP is responsible to deliver data packets from the source host to the destination host.
 This delivery is solely based on the IP Addresses in the packet headers.
 IPv4 is the first major version of IP.
 IPv4 is a connectionless protocol for use on packet-switched networks.

The following diagram represents the IPv4 header

Version-
 Version is a 4 bit field that indicates the IP version used.
 The most popularly used IP versions are version-4 (IPv4) and version-6 (IPv6).
 Only IPv4 uses the above header.
 So, this field always contains the decimal value 4.
Header Length-
 Header length is a 4 bit field that contains the length of the IP header.
 It helps in knowing from where the actual data begins .

Header length = Header length field value x 4 bytes

The length of IP header always lies in the range- [20 bytes , 60 bytes]
Type Of Service-
 Type of service is a 8 bit field that is used for Quality of Service (QoS).
 The datagram is marked for giving a certain treatment using this field.

Total Length-
 Total length is a 16 bit field that contains the total length of the datagram (in bytes).
 Total length = Header length + Payload length

 Minimum total length of datagram = 20 bytes (20 bytes header + 0 bytes data)
 Maximum total length of datagram = Maximum value of 16 bit word = 65535 bytes
Identification –
 Identification is a 16 bit field.
 It is used for the identification of the fragments of an original IP datagram.
When an IP datagram is fragmented,
 Each fragmented datagram is assigned the same identification number.
 This number is useful during the re assembly of fragmented datagrams.
 It helps to identify to which IP datagram, the fragmented datagram belongs to.

DF Bit
 DF bit stands for Do Not Fragment bit.
 Its value may be 0 or 1.
 When DF bit is set to 0,
 It grants the permission to the intermediate devices to fragment the datagram if required.
 When DF bit is set to 1,
 It indicates the intermediate devices not to fragment the IP datagram at any cost.
 If network requires the datagram to be fragmented to travel further but settings does not
allow its fragmentation, then it is discarded.
 An error message is sent to the sender saying that the datagram has been discarded due to
its settings.
MF Bit
 MF bit stands for More Fragments bit.
 Its value may be 0 or 1.
When MF bit is set to 0,
 It indicates to the receiver that the current datagram is either the last fragment in the set or that it is the
only fragment.

When MF bit is set to 1,


 It indicates to the receiver that the current datagram is a fragment of some larger datagram.
 More fragments are following.
 MF bit is set to 1 on all the fragments except the last one.
Fragment Offset:
 Fragment Offset is a 13 bit field.
 It indicates the position of a fragmented datagram in the original unfragmented IP datagram.
 The first fragmented datagram has a fragment offset of zero.
 Fragment offset for a given fragmented datagram = Number of data bytes ahead of it in the
original unfragmented datagram

Time To Live:
 Time to live (TTL) is a 8 bit field.
 It indicates the maximum number of hops a datagram can take to reach the destination.
 The main purpose of TTL is to prevent the IP datagrams from looping around forever in a routing
loop.
 The value of TTL is decremented by 1 when-
 Datagram takes a hop to any intermediate device having network layer.
 Datagram takes a hop to the destination.
 If the value of TTL becomes zero before reaching the destination, then datagram is discarded.

It is important to note-

 Both intermediate devices having network layer and destination decrements the TTL value by 1.
 If the value of TTL is found to be zero at any intermediate device, then the datagram is discarded.
 So, at any intermediate device, the value of TTL must be greater than zero to proceed further.
 If the value of TTL becomes zero at the destination, then the datagram is accepted.
 So, at the destination, the value of TTL may be greater than or equal to zero.

Protocol
 Protocol is a 8 bit field.
 It tells the network layer at the destination host to which protocol the IP datagram belongs to.
 In other words, it tells the next level protocol to the network layer at the destination side.
 Protocol number of ICMP is 1, IGMP is 2, TCP is 6 and UDP is 17.

Header Checksum
 Header checksum is a 16 bit field.
 It contains the checksum value of the entire header.
 The checksum value is used for error checking of the header.

At each hop,
 The header checksum is compared with the value contained in this field.
 If header checksum is found to be mismatched, then the datagram is discarded.
 Router updates the checksum field whenever it modifies the datagram header.
Source IP Address
 Source IP Address is a 32 bit field.
 It contains the logical address of the sender of the datagram.
Destination IP Address
 Destination IP Address is a 32 bit field.
 It contains the logical address of the receiver of the datagram.

Options-
Options is a field whose size vary from 0 bytes to 40 bytes.This field is used for several purposes
such as-
 Record route
 Source routing
 Padding

Internet Protocol Version 6:

 Version 4 − bits: It represents the version of Internet Protocol, i.e. 0110.

 Traffic Class 8 − bits: These 8 bits are divided into two parts. The most significant 6 bits
 are used for Type of Service to let the Router Known what services should be provided to

 this packet. The least significant 2 bits are used for Explicit Congestion Notification ECN.
 Flow Label 20 − bits: This label is used to maintain the sequential flow of the packets

belonging to a communication. The source labels the sequence to help the router identify
that a particular packet belongs to a specific flow of information. This field helps avoid
reordering of data packets. It is designed for streaming/real-time media.
 Payload Length 16 − bits: This field is used to tell the routers how much information a
particular packet contains in its payload. Payload is composed of Extension Headers and

Upper Layer data. With 16 bits, up to 65535 bytes can be indicated; but if the Extension
Headers contain Hop-by-Hop Extension Header, then the payload may exceed 65535
bytes and this field is set to 0.
 Next Header 8 − bits: This field is used to indicate either the type of Extension Header, or

if the Extension Header is not present then it indicates the Upper Layer PDU. The values
for the type of Upper Layer PDU are same as IPv4’s.

 Hop Limit 8 − bits: This field is used to stop packet to loop in the network infinitely. This is
 same as TTL in IPv4. The value of Hop Limit field is decremented by 1 as it passes a link

 Source Address 128 − bits: This field indicates the address of originator of the packet.

 Destination Address 128 − bits: This field provides the address of intended recipient of the
packet.

Extension Headers In IPv6, the Fixed Header contains only that much information which is
necessary, avoiding those information which is either not required or is rarely used. All such
information is put between the Fixed Header and the Upper layer header in the form of Extension
Headers. Each Extension Header is identified by a distinct value.

Network Layer Design Issues:


1. Store-and-forward packet switching
2. Services provided to transport layer

3. Implementation of connectionless service


4. Implementation of connection-oriented service

5. Comparison of virtual-circuit and datagram networks

1 Store-and-forward packet switching


A host with a packet to send transmits it to the nearest router, either on its own LAN or over a point-
to-point link to the ISP. The packet is stored there until it has fully arrived and the link has finished its
processing by verifying the checksum. Then it is forwarded to the next router along the path until it
reaches the destination host, where it is delivered. This mechanism is store-and-forward packet
switching.

2 Services provided to transport layer


The network layer provides services to the transport layer at the network layer/transport layer
interface. The services need to be carefully designed with the following goals in mind:
1. Services independent of router technology.
2. Transport layer shielded from number, type, topology of routers.
3. Network addresses available to transport layer use uniform numbering plan even across LANs and
WANs

3 Implementation of connectionless service


If connectionless service is offered, packets are injected into the network individually and routed
independently of each other. No advance setup is needed. In this context, the packets are frequently
called datagrams (in analogy with telegrams) and the network is called a datagram network.
Let us assume for this example that the message is four times longer than the maximum packet size, so
the network layer has to break it into four packets, 1, 2, 3, and 4, and send each of them in turn to
router A. Every router has an internal table telling it where to send packets for each of the possible

destinations. Each table entry is a pair(destination and the outgoing line). Only directly connected lines
can be used.A’s initial routing table is shown in the figure under the label ‘‘initially.’’ At A, packets 1,
2, and 3 are stored briefly, having arrived on the incoming link. Then each packet is forwarded
according to A’s table, onto the outgoing link to C within a new frame.Packet 1 is then forwarded to E
and then to F.However, something different happens to packet 4. When it gets to A it is sent to router
B,even though it is also destined for F. For some reason (traffic jam along ACE path), A decided to
send packet 4 via a different route than that of the first three packets. Router A updated its routing
table, as shown under the label ‘‘later.’’ The algorithm that manages the tables and makes the routing
decisions is called the routing algorithm.

Implementation of connection-oriented service :


If connection-oriented service is used, a path from the source router all the way to the destination
router must be established before any data packets can be sent. This connection is called a VC (virtual
circuit), and the network is called a virtual-circuit network When a connection is established, a route
from the source machine to the destination machine is chosen as part of the connection setup and
stored in tables inside the routers. That route is used for all traffic flowing over the connection, exactly
the same way that the telephone system works. When the connection is released, the virtual circuit is
also terminated. With connection-oriented service, each packet carries an identifier telling which
virtual circuit it belongs to. As an example, consider the situation shown in Figure. Here, host H1 has
established connection 1 with host H2. This connection is remembered as the first entry in each of the
routing tables. The first line of A’s table says that if a packet bearing connection identifier 1 comes in
from H1, it is to be sent to router C and given connection identifier 1. Similarly, the first entry at C
routes the packet to E, also with connection identifier 1. Now let us consider what happens if H3 also
wants to establish a connection to H2. It chooses connection identifier 1 (because it is initiating the
connection and this is its only connection) and tells the network to establish the virtual circuit. This
leads to the second row in the tables. Note that we have a conflict here because although A can easily
distinguish connection 1 packets from H1 from connection 1 packets from H3, C cannot do this. For
this reason, A assigns a different connection identifier to the outgoing traffic for the second
connection. Avoiding conflicts of this kind is why routers need the ability to replace connection
identifiers in outgoing packets. In some contexts, this process is called label switching. An example of
a connection-oriented network service is MPLS (Multi Protocol Label Switching).

Comparison of virtual-circuit and datagram networks


IP Addressing-
There are two systems in which IP Addresses are classified-

Classless Addressing-
 Classless Addressing is an improved IP Addressing system.
 It makes the allocation of IP Addresses more efficient.
 It replaces the older classful addressing system based on classes.
 It is also known as Classless Inter Domain Routing (CIDR).

Rules For Creating CIDR Block


1. All the IP Addresses in the CIDR block must be contiguous.
2. The size of the block must be presentable as power of 2.
 Size of the block is the total number of IP Addresses contained in the block.
 Size of any CIDR block will always be in the form 21, 22, 23, 24, 25 and so on.
3. First IP Address of the block must be divisible by the size of the block.

CIDR IP Addresses look like-


a.b.c.d / n
 They end with a slash followed by a number called as IP network prefix.

 IP network prefix tells the number of bits used for the identification of network.
 Remaining bits are used for the identification of hosts in the network.

MAC Address IP Address

It stands for Media Access Control Address. It stands for Internet Protocol Address.

MAC Address identifies the physical address of a IP Address identifies the connection of a
computer on the internet. computer on the internet.

Network Administrator or ISP assigns the IP


Manufacturer of NIC card assigns the MAC Address.
Address.

RARP is used for resolving physical (MAC) Address into ARP is used for resolving IP Address into
IP address. physical (MAC) address
ARP (Address Resolution Protocol):
ARP (Address Resolution Protocol) is a network protocol used to find out the hardware (MAC) address
of a device from an IP address. It is used when a device wants to communicate with some other device on
a local network (for example on an Ethernet network that requires physical addresses to be known before
sending packets). The sending device uses ARP to translate IP addresses to MAC addresses. The device
sends an ARP request message containing the IP address of the receiving device. All devices on a local
network segment see the message, but only the device that has that IP address responds with the ARP
reply message containing its MAC address. The sending device now has enough information to send the
packet to the receiving device.

ARP request packets are sent to the broadcast addresses (FF:FF:FF:FF:FF:FF for the Ethernet broadcasts
and 255.255.255.255 for the IP broadcast).

Here is the explanation otf the ARP process:

Let’s say that Host A wants to communicate with host B. Host A knows the IP address of host B, but it
doesn’t know the host B’s MAC address. In order to find out the MAC address of host B, host A sends
an ARP request, listing the host B’s IP address as the destination IP address and the MAC address of
FF:FF:FF:FF:FF:FF (Ethernet broadcast). Switch will forward the frame out all interfaces (except the
incoming interface). Each device on the segment will receive the packet, but because the destination IP
address is host B’s IP address, only host B will reply with the ARP reply packet, listing its MAC
address. Host A now has enough information to send the traffic to host B.
UNICAST ROUTING PROTOCOLS

Hierarchical Routing in Internet

The Internet today is made of a huge number of networks and routers that connect them. Routing in
the Internet cannot be done using a single protocol for two reasons:
A scalability problem and an administrative issue.
Scalability problem means that the size of the forwarding tables becomes huge, searching for a
destination in a forwarding table becomes time-consuming, and updating creates a huge amount of
traffic.
Hierarchical routing means considering each ISP as an autonomous system (AS).Each AS can run a
routing protocol that meets its needs, but the global Internet runs a global protocol to join and connect
all ASs together.The routing protocol run in each AS is referred to as intra-AS routing protocol,
intradomain routing protocol, or interior gateway protocol (IGP);The global routing protocol is referred
to as inter-AS routing protocol, interdomain routing protocol, or exterior gateway protocol (EGP).
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
A router in this protocol implements the distance-vector routing algorithm. 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.
The 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 (independent from performance factors of the routers
and links, such as delay, bandwidth, and so on), 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.

Note that the 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
Figure shows the concept of hop count advertised by three routers from a source host
to a destination host. In RIP, the maximum cost of a path can be 15, which means 16
is considered as infinity (no connection).For this reason, RIP can be used only in
autonomous systems in which the diameter of the AS is not more than 15 hops.

Forwarding Table
A forwarding table in RIP is a three-column table in which the first column is the address of the
destination network, the second column is the address of the next router to which the packet should be
forwarded, and the third column is the cost (the number of hops) to reach the destination
network.Figure3.3.2 shows the three forwarding tables for the routers in Figure (above).
Note that the first and the third columns together convey the same information as does a distance
vector, but the cost shows the number of hops to the destination networks.

For example, R1 defines that the next router for the path to N4 is R2; R2 defines that the next router to
N4 isR3; 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.
RIP Implementation

RIP is implemented as a process that uses the service of UDP on the port number 520. RIP is a routing
protocol to help IP route its datagrams through the AS,the RIP messages are encapsulated inside UDP
user datagrams, which in turn are encapsulated inside IP datagrams.
That is, RIP runs at the application layer, but creates forwarding tables for IP at the network layer.
RIP Messages

Two RIP processes, a client and a server, need to exchange messages. RIP-2 defines the format of the
message, as shown in figure3.3.3.The message Entry, can be repeated as needed in a message. Each
entry carries the information related to one line in the forwarding table of the router that sends the
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.

RIP Algorithm
RIP implements the same algorithm as the distance-vector routing algorithm.

 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.
 The 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.
 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.

Timers in RIP

RIP uses three timers to support its operation.

The periodic timer controls the advertising of regular update messages. Each router has one periodic
timer that is randomly set to a number between 25 and 35 seconds (to prevent all routers sending their
messages at the same time and creating excess traffic). The timer counts down; when zero is reached,
the update message is sent, and the timer is randomly set once again.

The expiration timer governs the validity of a route. When a router receives update information for a
route, the expiration timer is set to 180 seconds for that particular route. Every time a new update for
the route is received, the timer is reset.
If there is a problem on an internet and no update is received within the allotted 180 seconds, the route
is considered expired and the hop count of the route is set to 16, which means the destination is
unreachable. Every route has its own expiration timer. The garbage collection timer is used to purge a
route from the forwarding table.
The garbage collection timer is used to purge a route from the forwarding table. When the information
about a route becomes invalid, the router does not immediately purge that route from its table. Instead,
it continues to advertise the route with a metric value of 16. At the same time, a garbage collection
timer is set to 120 seconds for that route. When the count reaches zero, the route is purged from the
table.

Open Shortest Path First (OSPF)

Open Shortest Path First (OSPF) is an intradomain routing protocol like RIP.It is based on the link-
state routing protocol.
Metric

In OSPF, like RIP, the cost of reaching a destination from the host is calculated from the source router
to the destination network.
However, each link (network) can be assigned a weight based on the throughput, round-trip time,
reliability, and so on Figure shows the idea of the cost from a router to the destination host network.

Forwarding Tables
Each OSPF router can create a forwarding table as in figure 3.3.5, after finding the shortest-path tree
between itself and the destination using Dijkstra’s algorithm.

Areas

OSPF was designed to handle routing in a small or large autonomous system.


The formation of shortest-path trees in OSPF requires that all routers flood the whole AS with their
LSPs to create the global LSDB.This may not create a problem in a small AS, but create traffic in

large AS.To prevent this, the AS needs to be divided into small sections called areas as shown in
figure..
Each area acts as a small independent domain for flooding .Each router in an area needs to know the
information about the link states not only in its area but also in other areas.
For this reason, one of the areas in the AS is designated as the backbone area, responsible for gluing
the areas together.

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 the
purpose of communication, each area has an area identification.

OSPF Implementation
OSPF is implemented as a program in the network layer, using the service of the IP for propagation.
An IP datagram that carries a message from OSPF sets the value of the protocol field to 89. This
means that, the OSPF messages are encapsulated inside datagrams.
OSPF has two versions: version 1 and version 2.
OSPF Messages
OSPF is a very complex protocol; it has five different types of messages as shown in figure 3.3.7 .
.The hello message (type 1) is used by a router to introduce itself to the neighbors.
The database description message (type 2) is sent in response to the hello message to allow a newly
joined router to acquire the full LSDB.The link state request message (type 3) is sent by a router that
needs information about a specific LS.The link-state update message (type 4) is the main OSPF
message used for building the LSDB. This message, 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 message (type 5) is used to create reliability in OSPF; each router that receives a
link-state update message needs to acknowledge it.
OSPF Algorithm

OSPF implements the link-state routing algorithm .


After each router has created the shortest-path tree, the algorithm needs to use it to create the
corresponding routing algorithm.The algorithm needs to be augmented to handle sending and receiving
all five types of messages.

Border Gateway Protocol Version 4 (BGP4)

The Border Gateway Protocol version 4 (BGP4) is the only inter domain routing protocol used in the
Internet today.Consider an example of an internet with four autonomous systems. AS2, AS3, and AS4
are stub autonomous systems; AS1 is a transient one as shown in figure 3.3.8 .
. Here,data exchange between AS2, AS3, and AS4 should pass through AS1.

Each router in each AS knows how to reach a network that is in its own AS, but it does not know how
to reach a network in another AS.

To enable each router to route a packet to any network in the internet, we first install a variation of
BGP4, called external BGP (eBGP), on each border router (the one at the edge of each AS which is
connected to a router at another AS).We then install the second variation of BGP, called internal BGP
(iBGP), on all routers.
The border routers will be running three routing protocols (intradomain, eBGP, and iBGP), but other
routers are running two protocols (intradomain and iBGP).
Operation of External BGP (eBGP)
BGP is a point-to-point protocol. When the software is installed on two routers, they try to create a
TCP connection using the well-known port 179.
The two routers that run the BGP processes are called BGP peers or BGP speakers.The eBGP variation
of BGP allows two physically connected border routers in two different ASs to form pairs of eBGP
speakers and exchange messages. The routers that we use has three pairs: R1-R5, R2-R6, and R4-R9.
The connection between these pairs is established over three physical WANs (N5,N6, and N7). There
is a need for a logical TCP connection to be created over the physical connection to make the exchange
of information possible. Each logical connection in BGP is referred to as a session. This means that we
need three sessions, as shown in Figure
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 (R1 gets this information from the corresponding intradomain
forwarding table).
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
BGP four types of messages for communication between the BGP speakers across the ASs and inside
an AS:
Four messages are open, update, keep alive, and notification . All BGP packets share the same
common header.

Open Message. To create a neighborhood relationship, a router running BGP opens a TCP connection
with a neighbor and sends an open message.
Update Message.

The update message is used by a router to withdraw destinations that have been advertised previously,
to announce a route to a new destination, or both.
Note that BGP can withdraw several destinations that were advertised before, but it can only advertise
one new destination in a single update message.
Keep alive Message. The BGP peers that are running exchange keep alive messages regularly (before
their hold time expires) to tell each other that they are alive.

Notification. A notification message is sent by a router whenever an error condition is detected or a


router wants to close the session.
Performance

BGP performance can be compared with RIP. BGP speakers exchange a lot of messages to create
forwarding tables, but BGP is free from loops and count-to-infinity.
3.4 MULTICAST ROUTING

In multicasting, there is one source and a group of destinations. The relationship is one to many.In this
type of communication, the source address is a unicast address,but the destination address is a group
address, a group of one or more destination networks in which there is at least one member of the
group that is interested in receiving the multicast datagram.
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.
Multicast Applications
Access to Distributed Databases.

Most of the large databases today are distributed.That is, the information is stored in more than one
location, usually at the time of production.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.
Businesses often need to send information to their customers.If the nature of the information is the
same for each customer, it can be multicast. In this way 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.

Distance Learning.One growing area in the use of multicasting is distance learning.


MULTICASTING BASICS

In multicast communication, the sender is only one, but the receiver is many, sometimes thousands or
millions spread all over the world. It should be clear that we cannot include the addresses of all
recipients in the packet.The destination address of a packet, as described in the Internet Protocol (IP)
should be only one. For this reason,we need multicast addresses. A multicast address defines a group
of recipients, not a single one.
A multicast address is an identifier for a group. If a new group is formed with some active members,
an authority can assign an unused multicast address to this group to uniquely define it.

Multicast Forwarding
Important issue in multicasting is the decision a router needs to make to forward a multicast
packet.Forwarding in unicast and multicast communication is different in two aspects:
In unicast communication, the destination address of the packet defines one single destination. The
packet needs to be sent only out of one of the interfaces, the interface which is the branch in the
shortest-path tree reaching the destination with the minimum cost.
In multicast communication, the destination of the packet defines one group, but that group may have
more than one member in the internet.To reach all of the destinations, the router may have to send the
packet out of more than one interface. Figure (below) shows the concept.

In part a of the figure, the source is in a section of the internet where there is no group member. In part
b, the source is in a section where there is a group member. In part a, the router needs to send out the
packet from two interfaces; in part b, the router should send the packet only from one interface to
avoid sending a second copy of the packet from the interface it has arrived at.

Two Approaches to Multicasting 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. If there are m groups and n sources in the internet, a router needs to create
(mxn) 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.
Group-Shared Tree Approach

In the group-shared tree approach, a router act like a 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. Therefore the number of routing trees is reduced from (m x n) in the source-based
tree approach to m in this approach.
INTRADOMAIN MULTICAST PROTOCOLS

Multicast Distance Vector (DVMRP)

The Distance Vector Multicast Routing Protocol (DVMRP) is the extension of the Routing
Information Protocol (RIP) which is used in unicast routing. It uses the source based tree approach to
multicasting.

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)

The first algorithm, reverse path forwarding (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.The router does not know the shortest path from the source to itself, but it can find which is the
next router in the shortest path from itself to the source (reverse path).
The router simply consults its unicast forwarding table, pretending that it wants to send a packet to the
source; the forwarding table gives the next router and the interface the message that the packet should
be sent out in this reverse direction.

The router uses this information to accept a multicast packet only if it arrives from this interface. This
is needed to prevent looping. In multicasting, a packet may arrive at the same router that has forwarded
it.If the router does not drop all arrived packets except the one, multiple copies of the packet will be
circulating in the internet.

Reverse Path Broadcasting (RPB)

The RPF algorithm helps a router to forward only one copy received from a source and drop the rest.
When we think about broadcasting in the second step, we need to remember that destinations are all
the networks (LANs) in the internet. To be efficient,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. RPF cannot help here, because a network does not have the intelligence to apply the RPF
algorithm; we need to allow only one of the routers attached to a network to pass the packet to the
network.
One way to do so is to designate only one router as the parent of a network related to a specific source.
When a router that is not the parent of the attached network receives a multicast packet, it simply drops
the packet.There are several ways that the parent of the network related to a network can be selected;
one way is to select the router that has the shortest path to the source (using the unicast forwarding
table, again in the reverse direction).

Every packet started from the source reaches all LANs in the internet travelling the shortest path.
Figure 3.4.2 shows how RPB can avoid duplicate reception in a network by assigning a designated
parent router, R1, for network N.The difference between RPB and RPF is shown in figure 3.4.3.
Reverse Path Multicasting (RPM)

To increase efficiency, the multicast packet must reach only those networks that have active members
for that particular group. This is called reverse path multicasting (RPM).
To change the broadcast shortest-path tree to a multicast shortest-path tree, each router needs to prune
(make inactive) the interfaces that do not reach a network with active members corresponding to a
particular source-group combination.
This step can be done bottom-up, from the leaves to the root. At the leaf level, the routers connected to
the network collect the membership information using the IGMP protocol.

The parent router of the network can then disseminate this information upward using the reverse
shortest-path tree from the router to the source, the same way as the distance vector messages are
passed from one neighbor to another.
Multicast Link State (MOSPF)

Multicast Open Shortest Path First (MOSPF) is the extension of the Open Shortest Path First (OSPF)
protocol, which is used in unicast routing as shown in figure 3.4.4. It uses the source based tree
approach to multicasting.

In multicasting, each router needs to have a database, as with the case of unicast distance-vector
routing, to show which interface has an active member in a particular group.
A router follow these steps to forward a multicast packet received from source S and to be sent to
destination G (a group of recipients):

The router uses the Dijkstra algorithm to create a shortest-path tree with S as the root and all
destinations in the internet as the leaves. Note that this shortest-path tree is different from the one the
router normally uses for unicast forwarding, in which the root of the tree is the router itself.

Here, the root of the tree is the source of the packet defined in the source address of the packet The
router finds itself in the shortest-path tree created in the first step. In other words, the router creates a
shortest-path subtree with itself as the root of the subtree.The shortest-path subtree is actually a
broadcast subtree with the router as the root and all networks as the leaves.
The IGMP protocol is used to find the information at the leaf level. The router can now forward the
received packet out of only those interfaces that correspond to the branches of the multicast tree.

Protocol Independent Multicast (PIM)


Protocol Independent Multicast (PIM) is the name given to a common protocol that needs a unicast
routing protocol for its operation, but the unicast protocol can be either a distance-vector protocol or a
link-state protocol .PIM uses the forwarding table of a unicast routing protocol to find the next router
in a path to the destination, but it does not matter how the forwarding table is created.

Feature of PIM: It can work in two different modes: dense and sparse.
The term dense means that the number of active members of a group in the internet is large;the
probability that a router has a member in a group is high.For example, in a popular teleconference that
has a lot of members. The term sparse, means that only a few routers in the internet have active
members in the group; the probability that a router has a member of the group is low.For example, in a
technical teleconference where a number of members are spread somewhere in the internet. When the
protocol is working in the dense mode, it is referred to as PIM-DM; when it is working in the sparse
mode, it is referred to as PIM-SM.
Protocol Independent Multicast-Dense Mode (PIM-DM)
When the number of routers with attached members is large relative to the number of routers in the
internet, PIM works in the dense mode and is called PIM-DM. In this mode, the protocol uses a
source-based tree approach as shown in figure 3.4.5.
PIM-DM uses only two strategies described in DVMRP: RPF and RPM. The two steps used in PIM-
DM .

1.A router that has received a multicast packet from the source S destined for the group G first uses the
RPF strategy to avoid receiving a duplicate of the packet. It consults the forwarding table of the
unicast protocol to find the next router if it wants to send a message to the source S (in the reverse
direction).If the packet has not arrived from the next router in the reverse direction, it drops the packet
and sends a prune (remove things which are not needed) message in that direction to prevent receiving
future packets related to (S, G).
If the packet in the first step has arrived from the next router in the reverse direction, the receiving
router forwards the packet from all its interfaces except the one from which the packet has arrived .
Note that this is broadcasting instead of a multicasting if the packet is the first packet from the source
S to group G.Each router downstream that receives an unwanted packet sends a prune

message to the router upstream, and eventually the broadcasting is changed to multicasting.
Figure (above) PIM-DM. The first packet is broadcast to all networks, which have or do not have
members. After a prune message arrives from a router with no member, the second packet is only
multicast.
Protocol Independent Multicast-Sparse Mode (PIM-SM)

When the number of routers with attached members is small relative to the number of routers in the
internet, PIM works in the sparse mode and is called PIM-SM as shown in figure 3.4.6.
In this environment, PIM-SM uses a group-shared tree approach to multicasting.The core router in
PIM-SM is called the rendezvous point (RP). Multicast communication is achieved in two steps.

Any router that has a multicast packet to send to a group of destinations first encapsulates the multicast
packet in a unicast packet (tunneling) and sends it to the RP. The RP then decapsulates the unicast
packet and sends the multicast packet to its destination.
PIM-SM uses a complex algorithm to select one router among all routers in the internet as the RP for a
specific group. This means that if we have m active groups, we need m RPs, although a router may
serve more than one group.
After the RP for each group is selected, each router creates a database and stores the group identifier
and the IP address of the RP for tunneling multicast packets to it.

PIM-SM uses a spanning multicast tree rooted at the RP with leaves pointing to designated routers
connected to each network with an active member. A very interesting point in PIM-SM is the
formation of the multicast tree for a group.
To create a multicast tree rooted at the RP, PIM-SM uses join and prune messages.

Figure (below) shows the operation of join and prune messages in PIM-SM. First, three networks join
group G1 and form a multicast tree. Later, one of the networks leaves the group and the tree is
pruned.The join message is used to add possible new branches to the tree; the prune message is used to
cut branches that are not needed.
When a designated router finds out that a network has a new member in the corresponding group (via
IGMP), it sends a join message in a unicast packet destined for the RP.The packet travels through the
unicast shortest-path tree to reach the RP. Any router in the path receives and forwards the packet, but
at the same time, the router adds two pieces of information to its multicast forwarding table.

The number of the interface through which the join message was sent to the RP is marked(if not
already marked) as the only interface through which the multicast packet destined for the same group
should be received.In this way, the first join message sent by a designated router creates a path from
the RP to one of the networks with group members.To avoid sending multicast packets to networks
with no members, PIM-SM uses the prune message.

You might also like