Anda di halaman 1dari 37

Supporting multicast on the LAN

A Day in the Life of a


Multicast Flow
- or “How an IPv4 Multicast Packet gets from sender to receiver”
Gorry Fairhurst
gorry@erg.abdn.ac.uk
Presentation to Networkshop,York
April 2003

Updated July 2003 (rev. 14)


Overview
Rendezvous Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

RP
Point

Designated Receive
Source Router Router
Receiver
Terminology
Part 1: Starting Multicast Applications
Part 2: Network Delivery
Part 3: Stopping Multicast Applications
Overview Gorry@erg.abdn.ac.uk
Rendezvous University of Aberdeen (c) 2003

RP
Point

Designated Receive
Source Router Router
Receiver
• Three key things
IGMP tells a Receive Router which flows to receive
RP's tell PIM Routers about Sources
Join/Prune used to build trees
Terminology Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

• Designated Router (DR) = router sending from source


• IGMP = Internet Group Management Protocol (IPv4)
• PIM = Protocol Independent Multicast routing protocol
• Receiver = end host / pc that wishes to receive
• Receive Router = last-hop router delivering to receiver
• Rendezvous Point (RP) = a router that knows source
• Source = end host / pc that send
• Transit Router = multicast router in the network
Multicast Jargon List Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

• Tree - the multicast delivery path


• from the Source to one or more receivers
• from a Rendezvous Point to one or more receivers
• TIB - Tree Information Base (multicast routing table)
• Join - Routing message to create a Tree entry
• Prune - Routing message to delete a Tree entry
PIM Message Types Gorry@erg.abdn.ac.uk
PIM Messages University of Aberdeen (c) 2003

0: HELLO
1: REGISTER (includes tunnelled packet)
2: REGISTER STOP
3: JOIN/PRUNE
4: Bootstrap Router (BSR) - SM Only
5: ASSERT
6: GRAFT - DM Only
7: GRAFT-ACK - DM Only
8: CANDIDATE RP-ADVERTISEMENT (with BSR)

Common PIM Flags (displayed by "mroute")

C Connected - One or members wish to receive flow for Group G


F Register - This DR has a local Source for Group G
J Join - Router has sent a Join message for this flow
P Pruned - Router does not need to forward flow for Group G
T Tree - Router is receiving directly from the Source (S,G)

Note: This presentation looks only at PIM-SM (not PIM-DM or PIM-SSM)


Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Terminology
Part 1: Starting Multicast Applications
Part 2: Network Delivery
Part 3: Stopping Multicast Applications
Receivers / Clients Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

• User starts program


• Program registers with OS
• Packets flow to Receiver
OS Sends IGMP Report Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Receive Router (IGMP Querier)


224.2.132.76

X
IGMP
Report Tree Information Base (TIB)
OS enables Ethernet Interface
OS send IGMP-Report for Group(s)
Router creates TIB entry
X X
X X Router enables LAN interface

Receiver

Receive Router forwards packets to Receiver


IPv4 Multicast Addresses Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

28 bit group destination address

Class D IP Multicast Address


32 bits starting with bit pattern “1110”
224.0.0.0-239.255.255.255
224.0.0.X are reserved

IPv6
IPv6 has similar address allocations
[RFC 3171]
Mapping to Ethernet MAC Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Class D IPv4 destination address


224.0.0.0-239.255.255.255
32 bits
28 bits
1110

5 bit overlap
0 1 - 00 - 5 E - 7F - FF - FF

23 bits
48 bits
MAC hardware destination address
One L2 (MAC) address
may carry multiple L3 (IPv4) addresses
[RFC1122]
Multicast IP Packet Decode Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

IPv4 Multicast packet sent to Group 224.2.220.62


ETHER
Packet size = 218 bytes
Destination = 1:0:5e:2:dc:3e, (multicast) (01-00-5e-02-dc-3e)
Source = 0:d0:bb:f7:c6:c0,
Ethertype = 0800 (IPv4)
IP
Version = 4, Header length = 20 bytes
Type of service = 0x00
Total length = 204 bytes (00cc)
ID = 57862, Flags = 0x00, Frags = 0 0: 0100 5e02 dc3e 00d0 bbf7 c6c0 0800 4500
Time To Live = 113 seconds/hops 16: 00cc e206 0000 7111 a1a9 84b9 8476 e002
Protocol = 17 (UDP) 32: dc3e 7982 7982 00b8 08a0 8005 dbc6 d721
Header checksum = a1a9 48: 69c0 0752 bb5f fe39 3600 8808 b120 8933
Source address = 132.185.132.118 64: 6219 9118 5128 ffc8 1321 bc10 933e aa23
Destination address = 224.2.220.62 80: 3233 ba00 e892 a00c 1a3c 0a28 37ab 012d
No options 96: aca5 4819 9088 0b39 64ba 43a0 b9a8 04b3
UDP 112: 88b8 4bf8 3940 d024 0a98 8b0b 1703 0a3a
Source port = 31106 (7982) 128: 8820 a381 a21f 3bc0 9298 e893 90bd 042a
Destination port = 31106 (7982) 144: 0a88 3287 59ab e980 1211 4002 2208 98b1
Length = 184 (00b8) 160: 7039 0b26 e898 99ab b118 a1aa a702 9ac4
Checksum = 08a0 176: 9128 ca21 7822 2971 090a 2194 98d0 27bb
RTP 192: 0958 8092 993f b3b0 2922 337a 0f88 8810
180B of Data 208: 8a29 0183 fb15 b888 0d4c
IGMP Query
Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Receive Router (IGMP Querier)


224.2.132.76 CHECK

IGMP
Report
Router sends IGMP-Query to LAN
Receiver (or another computer) responds
IGMP Router updates TIB entry
Query

Receiver

Receive Router continues to forward packets to Receiver


* TCPdump: Receiver Joining Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Receiver enables Group (G) at Ethernet interface


IGMP
Report
Receiver send IGMP Membership Report for (G)
16:00:35.401923 churchward.erg.abdn.ac.uk > 224.2.132.76: igmp v2 report 224.2.132.76 [ttl 1]

Data flows from Source to requested Group


16:00:35.594515 source.x.ac.uk.64276 > 224.2.132.76.49280: udp 986 (ttl 127)
16:00:35.700825 source.x.ac.uk.64276 > 224.2.132.76.49280: udp 969 (ttl 127)
16:00:35.706132 source.x.ac.uk.64276 > 224.2.132.76.49280: udp 986 (ttl 127)
....
16:00:44.363832 source.x.ac.uk.64276 > 224.2.132.76.49280: udp 1011 (ttl 127)
16:00:44.369947 source.x.ac.uk.64276 > 224.2.132.76.49280: udp 986 (ttl 127)

IGMP Receiver resends IGMP Membership Report for (G)


Report
- in case first report was lost
16:00:44.370493 churchward.erg.abdn.ac.uk > 224.2.132.76: igmp v2 report 224.2.132.76 [ttl 1]

16:00:44.711456 source.x.ac.uk.64276 > 224.2.132.76.49280: udp 998 (ttl 127)


16:00:44.801106 source.x.ac.uk.64276 > 224.2.132.76.49280: udp 970 (ttl 127)
16:00:44.806525 source.x.ac.uk.64276 > 224.2.132.76.49280: udp 981 (ttl 127)
* Router IGMP Table Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

gate#show ip igmp group


IGMP Connected Group Membership
Group Address Interface Uptime Expires Last Reporter
239.255.255.255 FastEthernet0 2d02h 00:02:38 139.133.204.131
239.255.255.250 FastEthernet0 2d02h 00:02:40 139.133.204.220
224.2.132.76 FastEthernet0 2d02h 00:02:58 139.133.204.110
224.255.222.239 FastEthernet0 2d02h 00:02:59 139.133.204.110
233.2.171.1 FastEthernet0 2d02h 00:02:46 139.133.204.118
224.2.127.254 FastEthernet0 2d02h 00:02:38 139.133.204.131
224.0.1.75 FastEthernet0 2d02h 00:02:38 139.133.204.131
224.0.1.40 FastEthernet0 2d02h never 139.133.204.210

IGMP
Report

IGMP
Query
Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Terminology
Part 1: Starting Multicast Applications
Part 2: Network Delivery
Part 3: Stopping Multicast Applications
The Multicast Tree Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Receiver 2
X
X
Receiver 1
X

Source
Joining / Pruning the Tree
Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003
Receiver 2
X
X
Receiver 1
X

Source

Joining
Routers do not forward flows until a Join is received
Routers send Join if they wish to receive a flow
Pruning
Routers Prune flows when there are no Joins
* Multicast Delivery Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

RP Rendezvous Point

DR
Text
Source Source
Designated
Router
Each network has at least one Rendezvous Point (RP) Router
RP knows the address of Sources
RP can forward packets on behalf of sources

Sources send packets to a Designated Router (DR)


DR tells RP the addresses of active local Sources
Sending to the LAN DR Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Reg
PIM Designated Router (DR)

139.133.204.31: 224.2.132.76

DR receives flows from local Source


Creates a TIB entry
Send unicast PIM-Register to RP

Source
139.133.204.31

PIM Designated Router (DR) may be IGMP Querier


Telling the RP about a Source Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

RP 139.133.204.31: 224.2.132.76

Source DR does not forward flows


Reg Send a PIM-Register to the RP
RP updates TIB
STOP RP sends PIM-Register-STOP
X Source DR stops registering (for a while)
X DR
139.133.204.31
Source

DR waits for a PIM-Join


* Facts about RPs Gorry@erg.abdn.ac.uk

• All DRs must know the RP address


University of Aberdeen (c) 2003

• PIM-Register messages sent to RP


• Packets UNICAST to RP
• Messages include a complete packet
• DR resends a PIM-Register after a timeout
• RPs can forward packets (shared tree)
• Generally do not forward packets
• Receiving Router Joins to DR
• e.g. ~ 1 sec.
Registering with the RP Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

RP RP = 146.97.36.9

DR
Source = 139.133.204.31
Reg Group = 224.2.132.76
Mar 7 16:20:15: 2d02h: PIM: Send v2 Data-header Register to 146.97.36.9

for 139.133.204.31, group 224.2.132.76

STOP

Mar 7 16:20:15: 2d02h: PIM: Received v2 Register-Stop on Ethernet0 from 146.97.36.9

for source 139.133.204.31, group 224.2.132.76

Mar 7 16:20:15: 2d02h: PIM: Clear register flag to 146.97.36.9

for (139.133.204.31/32, 224.2.132.76)


Receiving via the RP Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

RP 139.133.204.31: 224.2.132.76
Receive Router
Receive Router sends (*,G) PIM-Join to RP
RP updates TIB
Receiver RP sends (S,G) PIM-Join to Source DR
Source DR forwards flow via RP
X
X DR
139.133.204.31

Packets forwarded via the RP


* Facts about Join / Prune
• Joining Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

• Routers do not forward until they receive a Join


• Routers can Join before Source sends a flow
• Routers can Join before Source Registers with RP
• Pruning
• Routers Prune flows when there are no Joins
• Routers continue to send (~ 3 secs) after Prune
• Allows other routers to Join (continue receiving)
• Routers delete inactive flows (after ~ 3 mins)
* Joining 224.2.132.76 Gorry@erg.abdn.ac.uk
gate#show ip mroute University of Aberdeen (c) 2003

IP Multicast Routing Table


Flags: D - Dense, S - Sparse, C - Connected, L - Local, P - Pruned
R - RP-bit set, F - Register flag, T - SPT-bit set, J - Join SPT
M - MSDP created entry, X - Proxy Join Timer Running
A - Candidate for MSDP Advertisement
Outgoing interface flags: H - Hardware switched
Timers: Uptime/Expires
Interface state: Interface, Next-Hop or VCD, State/Mode

...

(139.133.204.31, 224.2.132.76), 2d02h/00:03:29, flags: CFT


Incoming interface: FastEthernet0, RPF nbr 0.0.0.0
Outgoing interface list:
Tunnel0, Forward/Sparse, 2d02h/00:03:17 (ttl-threshold 24)

After a Join from a Receiver on Local LAN


...
(139.133.204.31, 224.2.132.76), 2d02h/00:03:29, flags: CFT
Incoming interface: FastEthernet0, RPF nbr 0.0.0.0
Outgoing interface list:
Ethernet2, Forward/Sparse, 00:00:11/00:02:57
Tunnel0, Forward/Sparse, 2d02h/00:03:18 (ttl-threshold 24)
Receiving from Source Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003
Receive Router discovers Source address
Receive Router sends (S,G) PIM-Join to Source

RP 139.133.204.31: 232.2.132.76

Receive Source DR forwards packets to Receiver


Router
Receive Router sends a PIM-Prune to RP
Join
RP sends a PIM-Prune to Source DR
Receiver X
X DR

139.133.204.31
Source

Packets forwarded on shortest path


Finding a Remote Source Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003
Join

Join Join RP
139.133.204.31: 224.2.132.76
X
X DR X
139.133.204.31
Source

Receiver
DR

Receive Router sends (*,G) PIM-Join to local RP


Local RP sends (S,G) PIM-Join to Source
Source DR forwards flow to Receiver Local RP needed
Note: Packets were not forwarded via the RP to know Source!
Connecting PIM Domains Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

• All RPs need to know address of all Sources


• Inter-domain & Intra-domain
• Two other protocols used in Inter-Domain PIM:
• Multicast Source Discovery Protocol - MSDP
• Multi-Protocol BGP - MBGP
Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Terminology
Part 1: Starting Multicast Applications
Part 2: Network Delivery
Part 3: Stopping Multicast Applications
Application Ends Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Program sends signal to OS


Ethernet interface filters cleared
Send IGMP-Leave message
Stop responding to IGMP-Queries

Receivers may "disappear"


Program crashes
Computer Crashes
Computer disconnects from net...
Pack Up & Go Home Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Prune
Receive Router (IGMP Querier)
224.2.132.76 CHECK

X
Send IGMP-Query to check for Receivers
No response indicates no members
Router stops forwarding flow
IGMP
Query
PIM-Prune sent upstream

Receiver

Router prunes unwanted multicast group


Stopping a Source Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Prune

Source DR
X
139.133.204.31:224.2.132.76 Source DR receives a PIM-Prune
Source DR stops forwarding

Source

Source continues to send to DR


TCPDump of IGMP-Leave Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

• Multicast Flow (G= 224.2.132.76) forwarded by local DR


• IGMP Leave Message from Receiver
16:07:18.879773 churchward.erg.abdn.ac.uk > ALL-ROUTERS.MCAST.NET:

igmp leave 224.2.132.76 [ttl 1]

• Multicast Flow (G= 224.2.132.76) STILL forwarded by local DR


• IGMP Query
16:07:41.026028 gate-erg.erg.abdn.ac.uk > ALL-SYSTEMS.MCAST.NET:

igmp query v2 [tos 0xc0] [ttl 1]

• Multicast Flow (G= 224.2.132.76) STILL forwarded by local DR


• Local DR STOPS forwarding Multicast Flow (G= 224.2.132.76)
• Send PIM-Prune (G= 224.2.132.76) if no other local LANs require this
So Finally.... Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

Three key things


IGMP tells a Receive Router which flows to Receive
RP's tell Receive Routers about Sources (via packets)
Join/Prune used to build trees

Multicast isn't hard


It is very different to unicast
Need to work with new "tools"
Question & Answers Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

?
Finding out more
• Networkshop 30 (Nottingham, 2002)
Gorry@erg.abdn.ac.uk
University of Aberdeen (c) 2003

• Jonathan Couzens, "Inter-Domain Multicast" , 2002.

• G Fairhurst, "Multicast & LANs”, p191-208, 2002.

• RFCs

• S. Deering, 'Host Extensions for IP Multicasting', RFC 1112, October 1989

• W. Fenner, 'Internet Group Management Protocol, Version 2', RFC2236, November 1997

• B. Cain, S. E. Deering, and A. Thyagarajan, 'Internet Group Management Protocol, Version 3', <draft-ietf-idmr-
igmp-v3-xx.txt> WORK IN PROGRESS (IETF MAGMA WG), 2003.

• D. Estrin, D. Farinacci, A. Helmy, D. Thaler, S., Deering, M. Handley, V. Jacobson, C. Liu, P. Sharma, L. Wei
Protocol Independent Multicast-Sparse Mode (PIM-SM): Protocol Specification", RFC2362, . June 1998

• W Fenner, Mark Handley "Protocol Independent Multicast - Sparse Mode (PIM-SM): Protocol Specification
(Revised)" draft-ietf-pim-sm-v2-new-06.txt , WORK IN PROGRESS (IETF PIM WG), 2003.

• Books

• K. Clark & K. Hamilton ‘CISCO LAN Switching’ ISBN 1-57870-094-9, 1999

• B.M. Edwards, L.A. Giuliano, B.R. Wright, “Intedomain Multicast Routing: Practical Juniper and CISCO Systems
Solutions”, ISBN 0-201-74612-3, 2002.

• Kosiur, “IP Multicasting”, Wiley, ISBN 0-417-24359-0, 1998

• B. Wilson, “Developing IP Multicast Networks”, CISCO Press, ISBN 1-57870-077-9, 2000.

Anda mungkin juga menyukai