No Slide Title

Download Report

Transcript No Slide Title

IP Multicast
Lecture 2: PIM-SM
Carl Harris
Communications Network Services
Virginia Tech
Game Plan
• Part I: IP Multicast Fundamentals
• Part II: Protocol Independent Multicast,
Sparse Mode (PIM-SM).
• Part III: Interdomain Multicast, MulticastOnly Topologies.
• Part IV: Layer 2 Optimizations and
Oddities. PIM-DM, DVMRP Overview.
Part II Agenda
• PIM-SM Motivation and architecture.
• Distribution tree construction and packet
forwarding.
• Distribution tree maintenance.
• PIM-SM over multi-access networks.
• PIM Neighbor discovery.
• RP discovery and failover.
• Parallel routers at a source: Assertion.
Exercise 1
• What additional forwarding rule(s) is (are) needed if a
router has both a source and a receiver connected to the
same interface?
Forwarding Review
Source S sends a packet to group
2. R receives the packet, and
verifies that the packet passes
the RPF test.
S
1. S sends a packet
addressed to G, with TTL=2.
H1
3
(*,G) iif=NULL oif=1,2
H3
1
R
3. The packet matches only (*,G).
R creates (S,G) iif=3 oif=1,2.
2
4. R decrements the TTL of the
packet (now TTL=1). Assuming
that neither interface 1 nor 2 has
a TTL threshold set, R forwards
the packet according to the
created (S,G) state.
H2
Multicast Packet Forwarding
• When a packet is received by a router from
a directly connected source S addressed to a
group G:
– If neither (S,G) nor (*,G) state exists, the packet
is dropped. We make an exception when PIMSM is the multicast routing protocol.
– If (S,G) state exists, its entry timer is refreshed
and the packet will be forwarded using the oif
list for the (S,G) state.
Multicast Packet Forwarding
– If no (S,G) state exists and the packet matches
(*,G) state, the (S,G) state is created.
• iif is set to the interface on which the packet was
received
• oif is copied from the (*,G) state, excluding the
interface on which the packet was received. Note
that by this rule, iif cannot be in the oif list, since
the iif leads back to S.
Forwarding Exercise
Source and receiver on the same interface
2. H4 and R both receive the
packet, R verifies that the packet
passes the RPF test.
S
H1
1. S sends a packet
addressed to G, with TTL=2.
H4
3
(*,G) iif=NULL oif=1,2,3
H3
1
R
2
4. R decrements the TTL of the
packet (now TTL=1). Assuming
that neither interface 1 nor 2 has
a TTL threshold set, R forwards
the packet according to the
created (S,G) state.
3. The packet matches only (*,G).
R creates (S,G) iif=3 oif=1,2
H2
Exercise 2
• IGMP could be used as a primitive multicast routing
protocol. Consider the case of two routers interconnected
on a backbone, each with some local subnets that have
active receivers for a group G. Place a source on a subnet
connected to one of the routers. What additional IGMP
actions will need to take place between the routers to
forward the source to all receivers?
– Need a “Hello” mechanism so that neighboring IGMP
routers can meet each other.
– When a (*,G) state is created, send a membership report
on every interface that leads to neighboring IGMP
routers.
IGMP Exercise
1. H1 joins G.
2. R1 creates
(*,G) iif=NULL oif=1
7. R2 sends a membership
report for G on interface 3
8. R1 updates
(*,G) iif=NULL oif=1,3
2
H1
1
R1
3
3
R2
1
2
9. R1 updates
(*,G)
iif=NULL
oif=1,2,3
H3
H2
4. R2 creates
(*,G) iif=NULL oif=3
5. H3 joins G.
8. H2 joins G.
3. R1 sends membership
report for G on interface 3.
6. R2 updates
(*,G) iif=NULL oif=1,3
IGMP Exercise
2. R2 checks RPF then creates
(S1,G) iif=2 oif=1,3
and forwards the packet.
(*,G) iif=NULL oif=1,2,3
S1
S2
1. S1 sends
a packet to
group G.
2
H1
1
R1
3
3
R2
1
2
H3
H2
This S is different than others
for which we’ve seen an RPF
check. What’s different?
3. R1 checks RPF then creates
(S1,G) iif=3 oif=1,2
and forwards the packet.
(*,G) iif=NULL oif=1,3
Why did R1 set
oif=1,2 ?
IGMP Exercise
(*,G) iif=NULL oif=1,2,3
(S1,G) iif=3 oif=1,2
3. R2 checks RPF then creates
(S2,G) iif=3 oif=1
and forwards the packet.
S1
S2
2
H1
1
R1
3
3
R2
1
2
1. S2 sends
a packet to
group G.
H3
H2
2. R1 checks RPF then creates
(S2,G) iif=1 oif=2,3
and forwards the packet.
(*,G) iif=NULL oif=1,3
(S1,G) iif=2 oif=1,3
IGMP Exercise
Observations
• When a router creates (*,G) state, this
triggers unsolicited membership reports to
be sent to neighboring IGMP routers.
• The result is a spanning tree that connects to
all receivers of group G.
• When a source S is discovered, the creation
of (S,G) state propagates along the spanning
tree, starting at the first-hop router that
connects to S.
IGMP Exercise
Additional exercises
• What happens if the network topology contains a
cycle (more than one non-parallel path that leads
to the same receiver)?
• If there are n sources, how many (S,G) state
entries must be maintained on every router along
the spanning tree for a group G?
PIM-SM
Motivating Observations
• Compared to the scale of the global
Internet, receivers and senders of nearly any
multicast content are sparsely populated
over a very wide area.
– 100,000 or more 2 and 3 member groups.
• An internet often contains many possible
paths between a source S and any multicast
receiver for a group G.
PIM-SM
Motivating Observations
• Flood and prune protocols discover
receivers by sending packets everywhere,
and pruning back when there are no
receivers.
– Examples: DVMRP, PIM-DM, MOSPF
– The Internet has link speeds that vary from
dial-up 56k to OC48c and beyond.
– Even in the LAN environment, high bit-rate
multicast flooding is impractical.
Founding Principles
• Protocol Independent Multicast, SparseMode (PIM-SM) was designed around three
fundamental principles:
– Avoid unnecessary flooding of multicast
packets to network segments with no receivers.
– Support good-quality distribution trees for
heterogeneous applications.
– Minimize bandwidth consumed by protocol
overhead.
PIM-SM Architecture
• The PIM-SM architecture is characterized
by these features:
– Shared and Shortest-Path distribution trees.
• All participants for a group G can use a shared
distribution tree. Permits very large scale.
• Last hop routers can initiate a switch to shortest-path
trees for certain sources when needed (e.g. as data
rates or delay requirements warrant, and scale
permits).
PIM-SM Architecture
– Explicit join/prune tree management. Routers
with local or downstream receivers join (or
leave) a distribution tree by sending explicit
join (or prune) messages toward sources. We
say that PIM-SM is thus receiver driven.
• Compare this to protocols that discover where
receivers aren’t located by flooding packets
everywhere and listening for complaints.
PIM-SM Architecture
– Routing protocol independence. Makes use of
existing unicast routing functionality to adapt to
topology changes, but in a manner that is
independent of the particular protocol used.
Rendezvous Point
• In PIM-SM, for every multicast group G
there exists a router known as the
rendezvous point (RP).
– The RP is the root of the shared tree for group
G. We also call this tree the RP tree (RPT).
– Sources for group G are discovered when their
(S,G) packets are forwarded down the RPT.
– Every router in a PIM domain must know the
RP for every group G. In many cases, the same
router is used as the RP for every group.
Rendezvous Point
– In a PIM domain, there is only one RP for any
group G at any particular time.
– We will use the notation RP(G) to denote the
RP mapping for a group G.
Example: RP(G) = A means that router A is the RP for
group G. Note that RP(G) is a unicast IP address.
– Later we’ll talk about bootstrap:
• allows routers to learn RP mappings
• eliminates the RP as a single point of failure
• leads to a definition of the term PIM domain
Shortest Path Trees
• The shortest path tree (SPT) for a source S
sending to a group G is a tree rooted at the
first-hop router for S such that for every
receiving host R, the path between R and S
consists of the smallest number of interrouter links among all possible paths
between R and S.
– Need to modify this definition for routing
protocols that allow the assignment of arbitrary
link costs.
PIM Control Messages
• PIM control messages are encapsulated in
IP packets, with a unique protocol identifier.
– Most PIM control messages are sent as
multicast packets with address 224.0.0.13 (all
PIM routers). Note that this address has link
scope.
– Certain PIM control messages sent between a
router with a directly connected source and the
RP are sent as unicast packets.
Distribution Tree Maintenance
Join/Prune Messages
• The PIM Join/Prune message is used to
construct and dismantle group distribution
trees.
• Join/Prune messages are multicast by a
router to the all PIM routers group address
(224.0.0.13) so that all directly connected
routers can “hear” the message and update
state accordingly.
Distribution Tree Maintenance
Join/Prune Messages
• Each Join/Prune message contains
– Address of a group G whose distribution tree
will be modified.
– List of sources to forward on a particular link in
the distribution tree for G. (join list)
– List of sources to drop on a particular link of
the distribution tree for G. (prune list)
– Upstream (RPF) neighbor address, needed in
multi-access network operation.
Shared Tree Construction
• The shared tree (RPT) for a group G is
constructed as receivers join the group.
– IGMP detects the presence of directly
connected group receivers and creates or
updates (*,G) state.
– When (*,G) state is created, the iif is set to the
RPF interface for RP(G). Why?
– The creation of (*,G) state triggers a Join/Prune
message to be sent towards the RP for group G.
PIM Example
Constructing the shared tree for G
8. Update
(*,G) iif=NULL oif=1,2
4. Create
(*,G) iif=NULL oif=2
7. B sends Join/Prune
Group=G
Join=A, WC, RPT
Prune=NULL
1
A
3. C sends Join/Prune towards
RP for G (i.e. router A)
Group=G
Join=A, WC, RPT
Prune=NULL
2
RP(G) = A
R2
2
2
4
B
1
3
2. Create
(*,G) iif=2 oif=3
C
3
6. Create
(*,G) iif=2 oif=4
5. Host R2 sends an IGMP
membership report for group G
1
R1
1. Host R1 sends an IGMP
membership report for group G
PIM Example
RPT for G connecting hosts R1 and R2
(*,G) iif=NULL oif=1,2
1
A
2
(*,G) iif=2 oif=4
RP(G) = A
R2
2
2
4
B
3
1
1
(*,G) iif=2 oif=3
C
3
R1
Joining the RPT for G
• When a PIM router wants to join the RPT
for a group G, the Join/Prune message
contains:
–
–
–
–
Group address to join.
RP address is in the join list.
Prune list is NULL.
Wildcard (WC) and RP tree (RPT) flags are set
in the join list entry for the RP
• this is the indication for an RPT join for group G.
• there are other uses for these flags.
Propagating Join/Prune
• Join/Prune messages always flow from the
leaves of a distribution tree toward the root
– whether it’s an RPT or an SPT
• Join/Prune messages are not acknowledged
by upstream routers
– PIM uses periodic retransmission, instead
Propagating Join/Prune
• Join/Prune messages are sent only in
response to a trigger event.
• The fundamental trigger events are:
– Changes in group membership.
• As discovered by IGMP or triggered by an expired
entry timer or outgoing interface timer.
– Discovery of new sources for a group.
• We’ll see how this works, shortly.
Propagating Join/Prune
• PIM routers never forward Join/Prune
messages.
– When a Join/Prune message is received by a
router, its contents are used to modify
forwarding states.
• Changes the shape of group distribution trees.
– State changes that occur as the result of a
Join/Prune message may trigger Join/Prune
messages to be sent towards upstream routers.
PIM Example
Constructing the shared tree for G
1. R1 joins G.
2. A creates
(*,G) iif=3 oif=1
2
R1
1
A
2
8. A updates
(*,G)
iif=3
oif=1,2
7. R2 joins G.
3
3
B
1
RP(G) = B
R3
R2
4. B creates
(*,G) iif=NULL oif=3
3. A sends Join/Prune
towards B (the RP for G).
Group=G
Join=B, RPT, WC
Prune=NULL
5. R3 joins G.
6. B updates
(*,G) iif=NULL oif=1,3
PIM Example
The RPT for G
(*,G) iif=3 oif=1,2
2
H1
1
A
2
3
3
B
1
RP(G) = B
H3
H2
(*,G) iif=NULL oif=1,3