Multicast Routing Short
Multicast Routing Short
Multicast Routing Short
IP Multicast routing
Multicast routing
1
Literature
2
Deployment
3
IPTV - today
•A multicast driving force today is IPTV - a component of
”triple-play”
You can also distribute video via unicast: http (eg youtube),
p2p (eg bit-torrent), streaming(eg rstp),...
•An operator has a head-end from where it distributes
video content
Terestial, Satelite, hard-disk,....
•The operator distributes the video using IP multicast from
its head-end via its distribution network using IP multicast
routing. Typically based on MPLS.
•From the routers, an L2 network, via xDSL modems,
distributes the video the last step.
•Video is encoded using MPEG-2 (ca 3-4Mb/s) or MPEG-4
(HD 12-16Mb/s)
•Encapsulation is either MPEG directly over UDP (DVB) or
MPEG over RTP over UDP
•One video channel per multicast group
When you change channel, you change group
4
IP Multicast Overview
•Receiver-based multicast:
–Senders send to any group
–Receivers join groups
•Dynamic group membership
–Hosts leave and join groups dynamically
•Group addresses (class D)
•Uses multicast in hardware if available
•Best-effort delivery semantics (unreliable)
•Notation:
–(S, G) - specific sender S to group G
–(*, G) - all senders to group G
•Prime architect: Steve Deering
5
IP Multicast Addresses
•IP-multicast addresses, class D addresses (binary prefix: 1110/4)
224.0.0.0 - 239.255.255.255
•28 bit multicast group id
•Selected addresses reserved by IANA for special purposes:
Address Description
224.0.0.0 – 224.0.0.255 Local Network Control Block (dont
forward)
224.0.0.1 All Systems on this subnet
224.0.0.2 All Routers on this subnet
224.0.0.4 DVMRP Routers
224.0.0.9 RIP Routers
6
IP Multicast Architecture
3. Host-to router protocol 4. Intra-domain Multicast
Routing
1. Multicast in hosts
2. Link-level Multicast
5. Inter-domain Multicast
Routing
7
Multicast router
IGMP Multicast
Routing
8
Multicast in routers
•Packets are replicated to many
output ports
•Forwarding used to be done in slowpath – in CPU
the main CPU
•Modern routers can do forwarding in the
Backplane
linecards or in hardware
•Replication can be made in:
–incoming linecards,
–backplane LC 1 LC 2 LC 3
–outgoing linecards
•Routes computed by main CPU by multicast
routing protocol are installed in the linecard FIB
Network
•Route lookup in two steps:
–RPF,
–multicast forwarding
•In multicast forwarding you look at both the
destination and source IP address
9
Multicast Routing
•A packet received on a router is forwarded on many interfaces
•The network replicates the packets – not the hosts
•All routing protocols aim at building delivery trees through a
network
•Mostly multicast routing is more concerned where packets come
from instead of where they are going
10
Delivery Trees
11
Protocol classification
•Dense-mode protocols
–Intended for domains with high receiver density
–Push, Source trees
–Examples: PIM-DM, DVMRP
•Sparse-mode protocols
–Intended for domains with small receiver density
–Pull, shared trees (not always,..)
–Examples: PIM-SM, CBT
•Link-state protocols
–Source trees
–Examples: MOSPF
12
Multicast forwarding step 1: RPF
•Reverse Path Forwarding
•Basic forwarding principle in multicast
•Forward datagram only if it arrives on interface used to send unicast
to source
or rendez-vous-point (RP) if (*, G) entry
Send out on all other interfaces: Flooding!
•You can re-use Unicast routing tables for multicast
but used in reverse
•RPF can also be used in unicast to detect source address spoofing
A common attack mechanism
shortest
path
not shortest
path
14
Exercise1: multicast forwarding
Prefix Outgoing IF
180.70.65.0/24 A
201.4.22.0/24 C
120.14.96.0/24 B
153.18.16.0/24 D
0.0.0.0/0 A
•A router has interfaces A, B, C, D
•The router has a unicast forwarding table and a multicast
forwarding table
•How are the following IP packets forwarded by the
router?
A packet with src = 180.70.65.12 and dst = 228.3.2.2,
arriving on interface B
A packet with src = 201.4.22.4 and dst = 228.3.2.2, arriving
on interface C
A packet with src 120.14.96.42 and dst = 241.16.53.2,
arriving on interface B
A packet with src = 153.18.16.3 and dst = 234.12.32.5.
arriving on interface D Sender, Group Outgoing IF
list
•Solution on web after the lecture *, 228.3.2.2 A, B, C
201.4.22.4, 228.3.2.2 A, D
*, 234.12.32.5 A, C, D
15
DVMRP
•Distance-Vector Multicast Routing Protocol
–Based on unicast distance vector (eg RIP)
•DVMRP was used in the first multicast Internet
–The MBone.
–Unicast tunnels connected multicast islands.
–Mainly academic use
•DVMRP is data-driven/push and uses source-based
trees
•DVMRP builds Truncated Broadcast Trees
–Reverse Path Broadcasting
–Builds routing tables with source networks
–Uses poison reverse to detect down-link routers
•DVMRP floods trees with data
–Then prunes and grafts tree depending on receiver
dynamics.
16
Link-State Multicast: MOSPF
•Add multicast to a given link-state routing protocol
•Extend LSAs with group-membership LSA (type 6)
–Only containing members of a group
•Uses the link-state database in OSPF to build delivery
trees
–Every router knows the topology of the complete network
–Least-cost source-based trees using metrics
–One tree for all (S,G) pairs with S as source
•The delivery trees are optimal, since we use Dijkstra
•Expensive to keep all this information
–Cache active (S,G) pairs
–MOSPF is Data-driven/push: computes Dijkstra when
datagram arrives
•If OSPF is used for unicast routing, it is easy(in
principle) to extend it for multicast routing as well
17
N14
N4 Ib
Group N15
member Ia
s 2
5 9
RT10 RT7
3
3 1
N11 RT9 0
0
1 0
N9 RT11 N8 N
0
6 0
H1 1 RT12
0
2 RT8
4
N10
N7
18
Protocol Independent
Multicasting - PIM
•PIM relies on any unicast routing tables for its RPF
check
–Does not build its own tables (as DVMRP)
•Split into two protocols for different uses
–PIM-DM – PIM Dense mode
–PIM-SM – PIM Sparse mode
19
PIM – Dense Mode
•PIM - Dense Mode
–Flooding-and-prune strategy – similar to DVMRP
–Creates (S,G) in every router (even if no receivers)
–Ca 3-minute cycle
•Uses unicast routing tables for RPF
–No separate multicast routing protocol
•Builds only source-based trees
•PIM Hello messages – to detect neighbor PIM routers
•PIM Prune messages
–Like DVMRP, but prunes also used instead of poison
reverse in DVMRP
•PIM Assert messages
–To elect one single forwarder on a shared link
•PIM Graft – just like DVMRP
20
PIM-SM
21
PIM-SM join example
Receiver
1
RP
IGMP join
Sender S
(*, G) Join
22
PIM-SM join example
Receiver
1
RP
Sender S
(*, G) Join
IGMP join
24
PIM-SM source registring (1)
•PIM-register sent to RP from source
•Data is encapsulated in unicast Register messages to
RP, then natively in (S,*) tree
1.
Register
New
Sender S
25
PIM-SM source registring (2)
•RP joins (S,G) tree (hop-by-hop)
•Data is sent natively from S along (S,G) tree to RP and
via Register messages
2. (S, G) Join
2. (S, G) Join
New
Sender S
26
PIM-SM source registring (3)
•RP sends Register-Stop to make sender stop
encapsulating data.
•Data is now sent natively from S along (S,G) tree to
RP.
New
3. Register-
Sender S
Stop
27
PIM-SM shortest path tree switchover
28
PIM-SM switchover(1)
Receiver 29
PIM-SM switchover (2)
•Traffic starts flowing down SPT also
•Receiver DR:s send (S,G,rpt) Prune towards RP to
leave RPT tree and avoid duplicates
Receiver
30
Receiver
PIM-SM Switchover(3)
•Traffic flows down (S,G) tree only
•Note traffic still flows to RP (for new receivers joining
RPT)
Receiver
Sender S
31
Receiver
Source-specific joins
32
PIM Hello protocol
33
Designated Router
•Many multicast routers on one link. IGMP elects one Querier
•But multicast protocol also elects a Designated Router on each
shared segment.
•DR handles multicast routing on behalf of the link, and forwards
data.
•(Note IGMP Querier and DR may be different)
Delivery
tree
DR
34
PIM Assert
•On a transit link (shared media) one router must be the upstream router
for a tree
•Routers may have inconsistent unicast routing tables causing different
routers to believe different routers are upstream
•This would cause the tree to have several upstream routers ->
duplicates.
•PIM Assert messages are sent to vote for one single forwarder per tree
for the shared media.
•All routers on that shared link use the winner to send joins to.
35
PIM Rendez-vous points
36
MSDP – Multicast Source
Discovery Protocol
•Discovering sources is a major problem in PIM, especially in the
inter-domain routing case:
–One AS manages an independent RP for that domain – following the
autonomous systems architecture
–But what if there are senders in other domains?
•MSDP operation:
–The RPs in different domains communicate with each other on a
peer-to-peer basis
–The RP keeps track of all senders in one domain and sends MSDP
Source Active (SA) messages to the RPs in the other domains
–If an RP has receivers in a group G, and discovers a sender S in
another domain, it performs a (S,G) Join towards S.
–SA messages are reliably flooded to all RP peers
• Concern for scalability
37
MSDP Example(1)
AS2
AS1
RP1 RP2 RP5 AS5
SA(S,G) SA(S,G)
R
AS2
AS1
RP1 RP2 RP5 AS5
Join(S,G)
R
Dat
Join(S,G) a
S RP3
RP4
AS3
AS4
•RP5 receives the SA (S,G), and since it has receivers in its domain,
•It joins the source-specific tree (S,G)
•Data flows from S to R via RP5, and then switchover to source-specific
tree
39
Anycast-RP and MSDP
40
Exercise 2: Anycast-RP, PIM and MDSP
•Four routers running PIM-SM, Anycast-RP and
MSDP
•RP1 and RP2 are RPs and run MSDP
•A sender S1 sends multicast traffic to group G
IGMP 1
S1
•A receiver R1 receives traffic. 2 DR2
41
Source-specific multicast
•Regular IP multicast model (Any-source multicast)
–A receiver R joins a group G (*, G)
–R receives all traffic destined to G
–Senders unknown a priori -> The routing protocol must
detect senders
•Source-specific multicast
–A receiver R joins a group G for sender S only
–R receives traffic only from S destined to G
–The routing protocol need not detect sender
•SSM uses multicast addresses with prefix 232/8
•Requires changes to socket API
•IGMPv3
•But detection of senders not necessary
42
Homework 3
•Similar to Exercise 2.
•Define multicast forwarding state before tree switchover
•H1 sends, H2 and H3 receives. R3 and R4 are RPs running
Anycast-RP and MSDP
•Deadline (for bonus): Next lecture (Mon April 26 10:15)
R1 R2
1 1 2
H1
1 R3 1 R4
2
2
3 1 2
R6 1 R5
4 3
2
R7 3
1
2
3
H2 H3
43