PIM-Networkshop 2003-14

download PIM-Networkshop 2003-14

of 37

Transcript of PIM-Networkshop 2003-14

  • 8/8/2019 PIM-Networkshop 2003-14

    1/37

    - or How an IPv4 Multicast Packet gets from sender to receiver

    A Day in the Life of aMulticast Flow

    Gorry Fairhurst

    [email protected] to Networkshop, YorkApril 2003

    Updated July 2003 (rev. 14)

    Supporting multicast on the LAN

  • 8/8/2019 PIM-Networkshop 2003-14

    2/37

    [email protected] of Aberdeen (c) 2003

    Overview

    ReceiverSource

    RP

    Rendezvous

    Point

    DesignatedRouter

    ReceiveRouter

    Terminology

    Part 1: Starting Multicast Applications

    Part 2: Network Delivery

    Part 3: Stopping Multicast Applications

  • 8/8/2019 PIM-Networkshop 2003-14

    3/37

    [email protected] of Aberdeen (c) 2003

    Three key thingsIGMP tells a Receive Router which flows to receive

    Overview

    RP's tell PIM Routers about Sources

    Join/Prune used to build trees

    ReceiverSource

    RP

    Rendezvous

    Point

    DesignatedRouter

    ReceiveRouter

  • 8/8/2019 PIM-Networkshop 2003-14

    4/37

    [email protected] 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

    Terminology

  • 8/8/2019 PIM-Networkshop 2003-14

    5/37

    [email protected] 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

    Multicast Jargon List

  • 8/8/2019 PIM-Networkshop 2003-14

    6/37

    [email protected] of Aberdeen (c) 2003

    PIM Message TypesPIM Messages

    0: HELLO1: REGISTER (includes tunnelled packet)2: REGISTER STOP3: JOIN/PRUNE4: Bootstrap Router (BSR) - SM Only

    5: ASSERT6: GRAFT - DM Only7: GRAFT-ACK - DM Only8: CANDIDATE RP-ADVERTISEMENT (with BSR)

    Common PIM Flags (displayed by "mroute")

    C Connected - One or members wish to receive flow for Group GF Register - This DR has a local Source for Group GJ Join - Router has sent a Join message for this flowP Pruned - Router does not need to forward flow for Group GT Tree - Router is receiving directly from the Source (S,G)

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

  • 8/8/2019 PIM-Networkshop 2003-14

    7/37

    [email protected] of Aberdeen (c) 2003

    Terminology

    Part 1: Starting Multicast Applications

    Part 2: Network Delivery

    Part 3: Stopping Multicast Applications

  • 8/8/2019 PIM-Networkshop 2003-14

    8/37

    [email protected] of Aberdeen (c) 2003

    User starts program

    Program registers with OS Packets flow to Receiver

    Receivers / Clients

  • 8/8/2019 PIM-Networkshop 2003-14

    9/37

    [email protected] of Aberdeen (c) 2003

    Tree Information Base (TIB)

    OS Sends IGMP Report

    Router enables LAN interface

    Receive Router (IGMP Querier)

    Receiver

    IGMPReport

    224.2.132.76

    X

    Receive Router forwards packets to Receiver

    X XXX

    OS enables Ethernet Interface

    OS send IGMP-Reportfor Group(s)

    Router creates TIB entry

  • 8/8/2019 PIM-Networkshop 2003-14

    10/37

    [email protected] of Aberdeen (c) 2003

    IPv4 Multicast Addresses

    Class D IP Multicast Address32 bits starting with bit pattern 1110224.0.0.0-239.255.255.255

    224.0.0.X are reserved

    IPv6IPv6 has similar address allocations

    [RFC 3171]

    28 bit group destination address

  • 8/8/2019 PIM-Networkshop 2003-14

    11/37

    [email protected] of Aberdeen (c) 2003

    Mapping to Ethernet MAC

    Class D IPv4 destination address

    224.0.0.0-239.255.255.255

    1110

    28 bits32 bits

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

    48 bits

    5 bit overlap

    23 bits

    MAC hardware destination address

    One L2 (MAC) addressmay carry multiple L3 (IPv4) addresses

    [RFC1122]

  • 8/8/2019 PIM-Networkshop 2003-14

    12/37

    [email protected] of Aberdeen (c) 2003

    Multicast IP Packet Decode

    ETHER

    Packet size = 218 bytesDestination = 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 bytesType of service = 0x00Total length = 204 bytes (00cc)ID = 57862, Flags = 0x00, Frags = 0Time To Live = 113 seconds/hopsProtocol = 17 (UDP)Header checksum = a1a9

    Source address = 132.185.132.118Destination address = 224.2.220.62No optionsUDP

    Source port = 31106 (7982)Destination port = 31106 (7982)Length = 184 (00b8)Checksum = 08a0

    RTP180B of Data

    0: 0100 5e02 dc3e 00d0 bbf7 c6c0 08004500

    16: 00cc e206 0000 7111 a1a9 84b9 8476 e002

    32: dc3e7982 7982 00b8 08a0 8005 dbc6 d721

    48: 69c0 0752 bb5f fe39 3600 8808 b120 8933

    64: 6219 9118 5128 ffc8 1321 bc10 933e aa2380: 3233 ba00 e892 a00c 1a3c 0a28 37ab 012d

    96: aca5 4819 9088 0b39 64ba 43a0 b9a8 04b3

    112: 88b8 4bf8 3940 d024 0a98 8b0b 1703 0a3a

    128: 8820 a381 a21f 3bc0 9298 e893 90bd 042a

    144: 0a88 3287 59ab e980 1211 4002 2208 98b1

    160: 7039 0b26 e898 99ab b118 a1aa a702 9ac4

    176: 9128 ca21 7822 2971 090a 2194 98d0 27bb

    192: 0958 8092 993f b3b0 2922 337a 0f88 8810

    208: 8a29 0183 fb15 b888 0d4c

    IPv4 Multicast packet sent to Group 224.2.220.62

  • 8/8/2019 PIM-Networkshop 2003-14

    13/37

    [email protected] of Aberdeen (c) 2003

    IGMP Query

    Router updates TIB entry

    Receive Router (IGMP Querier)

    Receiver

    IGMP

    Report

    IGMPQuery

    224.2.132.76 CHECK

    Receive Router continues to forward packets to Receiver

    Router sends IGMP-Queryto LAN

    Receiver (or another computer) responds

  • 8/8/2019 PIM-Networkshop 2003-14

    14/37

    [email protected] of Aberdeen (c) 2003

    * TCPdump: Receiver Joining

    IGMPReport

    16:00:35.401923 churchward.erg.abdn.ac.uk > 224.2.132.76: igmp v2 report 224.2.132.76 [ttl 1]

    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)

    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)

    Data flows from Source to requested Group

    Receiver enables Group (G) at Ethernet interfaceReceiver send IGMP Membership Reportfor (G)

    Receiver resends IGMP Membership Reportfor (G)- in case first report was lost

    IGMPReport

  • 8/8/2019 PIM-Networkshop 2003-14

    15/37

    [email protected] of Aberdeen (c) 2003

    gate#show ip igmp groupIGMP 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.131224.0.1.40 FastEthernet0 2d02h never 139.133.204.210

    * Router IGMP Table

    IGMPReport

    IGMPQuery

  • 8/8/2019 PIM-Networkshop 2003-14

    16/37

    [email protected] of Aberdeen (c) 2003

    TerminologyPart 1: Starting Multicast ApplicationsPart 2: Network DeliveryPart 3: Stopping Multicast Applications

  • 8/8/2019 PIM-Networkshop 2003-14

    17/37

    [email protected] of Aberdeen (c) 2003

    The Multicast Tree

    XX

    X

    Source

    Receiver 1

    Receiver 2

  • 8/8/2019 PIM-Networkshop 2003-14

    18/37

    [email protected] of Aberdeen (c) 2003

    Pruning

    Routers Prune flows when there are noJoins

    Joining / Pruning the Tree

    X

    XX

    Source

    Receiver 1

    Receiver 2

    Joining

    Routers do not forward flows until aJoin is receivedRouters sendJoin if they wish to receive a flow

  • 8/8/2019 PIM-Networkshop 2003-14

    19/37

    [email protected] of Aberdeen (c) 2003

    * Multicast Delivery

    Source

    RP

    Each network has at least one Rendezvous Point (RP) RouterRP knows the address of SourcesRP can forward packets on behalf of sources

    Sources send packets to a Designated Router (DR)DR tells RP the addresses of active local Sources

    Rendezvous Point

    SourceDesignated

    Router

    DRText

  • 8/8/2019 PIM-Networkshop 2003-14

    20/37

    [email protected] of Aberdeen (c) 2003

    Sending to the LAN DR

    Send unicast PIM-Registerto RP

    PIM Designated Router (DR)

    Source139.133.204.31

    139.133.204.31: 224.2.132.76

    Reg

    PIM Designated Router (DR) maybe IGMP Querier

    DR receives flows from local Source

    Creates a TIB entry

  • 8/8/2019 PIM-Networkshop 2003-14

    21/37

    [email protected] of Aberdeen (c) 2003

    Telling the RP about a Source

    RP

    DR

    139.133.204.31: 224.2.132.76

    Source DR stops registering (for a while)XX

    DR waits for a PIM-Join

    STOP

    Reg

    139.133.204.31

    Source DR does not forward flows

    RP updates TIB

    Send a PIM-Registerto the RP

    RP sends PIM-Register-STOP

    Source

  • 8/8/2019 PIM-Networkshop 2003-14

    22/37

    [email protected] of Aberdeen (c) 2003

    All DRs must know the RP address PIM-Registermessages sent to RP Packets UNICAST to RP

    Messages include a complete packet DR resends a PIM-Registerafter a timeout

    RPs can forward packets (shared tree) Generally do not forward packets Receiving Router Joins to DR

    e.g. ~ 1 sec.

    * Facts about RPs

  • 8/8/2019 PIM-Networkshop 2003-14

    23/37

    [email protected] of Aberdeen (c) 2003

    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

    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)

    Registering with the RP

    Reg

    STOP

    DR

    RP RP = 146.97.36.9

    Source = 139.133.204.31Group = 224.2.132.76

  • 8/8/2019 PIM-Networkshop 2003-14

    24/37

    [email protected] of Aberdeen (c) 2003

    Receiving via the RP

    RP

    DR

    139.133.204.31: 224.2.132.76

    RP sends (S,G) PIM-Jointo Source DR

    X

    X

    Packets forwarded via the RP

    Receive Router

    139.133.204.31

    Receive Router sends (*,G) PIM-Jointo RPRP updates TIB

    Source DR forwards flow via RPReceiver

  • 8/8/2019 PIM-Networkshop 2003-14

    25/37

    [email protected] of Aberdeen (c) 2003 Joining

    Routers do not forward until they receive aJoin Routers canJoin before Source sends a flow

    Routers canJoin before Source Registers with RP Pruning Routers Prune flows when there are noJoins

    Routers continue to send (~ 3 secs) after Prune Allows other routers toJoin (continue receiving)

    Routers delete inactive flows (after ~ 3 mins)

    * Facts about Join / Prune

  • 8/8/2019 PIM-Networkshop 2003-14

    26/37

    [email protected] of Aberdeen (c) 2003gate#show ip mroute

    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)

    ...

    (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:57Tunnel0, Forward/Sparse, 2d02h/00:03:18 (ttl-threshold 24)

    * Joining 224.2.132.76

    After aJoin from a Receiver on Local LAN

  • 8/8/2019 PIM-Networkshop 2003-14

    27/37

    [email protected] of Aberdeen (c) 2003

    Receiving from Source

    RP 139.133.204.31: 232.2.132.76

    Source DR forwards packets to Receiver

    X

    X

    Packets forwarded on shortest path

    Join

    139.133.204.31

    Receive Router discovers Source address

    Receive Router sends (S,G) PIM-Jointo Source

    RP sends a PIM-Pruneto Source DR

    Receive Router sends a PIM-Pruneto RP

    Source

    Receive

    Router

    DR

    Receiver

  • 8/8/2019 PIM-Networkshop 2003-14

    28/37

    [email protected] of Aberdeen (c) 2003

    Finding a Remote Source

    DRX X

    Local RP needed

    to know Source!

    RP

    DR

    139.133.204.31: 224.2.132.76

    JoinJoin

    Join

    X

    Source DR forwards flow to Receiver

    139.133.204.31

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

    Local RP sends (S,G) PIM-Jointo Source

    Note: Packets were not forwarded via the RP

    Source

    Receiver

  • 8/8/2019 PIM-Networkshop 2003-14

    29/37

    [email protected] 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

    Connecting PIM Domains

  • 8/8/2019 PIM-Networkshop 2003-14

    30/37

    [email protected] of Aberdeen (c) 2003

    Terminology

    Part 1: Starting Multicast ApplicationsPart 2: Network DeliveryPart 3: Stopping Multicast Applications

  • 8/8/2019 PIM-Networkshop 2003-14

    31/37

    [email protected] of Aberdeen (c) 2003

    Program sends signal to OS

    Ethernet interface filters cleared

    Send IGMP-Leave messageStop responding to IGMP-Queries

    Application Ends

    Receivers may "disappear"Program crashesComputer CrashesComputer disconnects from net...

  • 8/8/2019 PIM-Networkshop 2003-14

    32/37

    [email protected] of Aberdeen (c) 2003

    Pack Up & Go Home

    Router stops forwarding flow

    Receive Router (IGMP Querier)

    Receiver

    224.2.132.76

    X

    Router prunes unwanted multicast group

    Prune

    IGMPQuery

    CHECK

    Send IGMP-Queryto check for ReceiversNo response indicates no members

    PIM-Prunesent upstream

  • 8/8/2019 PIM-Networkshop 2003-14

    33/37

    [email protected] of Aberdeen (c) 2003

    Stopping a Source

    Source continues to send to DR

    Source DR

    Source

    139.133.204.31:224.2.132.76

    Prune

    X

    Source DR stops forwarding

    Source DR receives a PIM-Prune

  • 8/8/2019 PIM-Networkshop 2003-14

    34/37

    [email protected] of Aberdeen (c) 2003

    Multicast Flow (G= 224.2.132.76) forwarded by local DR

    IGMP Leave Message from Receiver16: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 Query16: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

    TCPDump ofIGMP-Leave

  • 8/8/2019 PIM-Networkshop 2003-14

    35/37

    [email protected] of Aberdeen (c) 2003

    Three key things

    IGMP tells a Receive Router which flows to ReceiveRP's tell Receive Routers about Sources (via packets)

    Join/Prune used to build trees

    So Finally....

    Multicast isn't hardIt is very different to unicast

    Need to work with new "tools"

  • 8/8/2019 PIM-Networkshop 2003-14

    36/37

    [email protected] of Aberdeen (c) 2003

    Question & Answers

    ?

  • 8/8/2019 PIM-Networkshop 2003-14

    37/37

    [email protected] of Aberdeen (c) 2003 Networkshop 30 (Nottingham, 2002)

    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', 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. WeiProtocol 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 SystemsSolutions, 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.

    Finding out more