⭐ 欢迎来到虫虫下载站! | 📦 资源下载 📁 资源专辑 ℹ️ 关于我们
⭐ 虫虫下载站

📄 draft-ietf-pim-sm-v2-new-11.txt

📁 xorp源码hg
💻 TXT
📖 第 1 页 / 共 5 页
字号:
The function MRIB.next_hop( S ) returns an address of the next-hop PIMneighbor toward the host S, as indicated by the current MRIB.  If S isdirectly adjacent, then MRIB.next_hop( S ) returns NULL.  At the RP forG, MRIB.next_hop( RP(G)) returns NULL.The function NBR( I, A ) uses information gathered through PIM Hellomessages to map the IP address A of a directly connected PIM neighborrouter on interface I to the primary IP address of the same router(Section 4.3.4). The primary IP address of a neighbor is the addressthat it uses as the source of its PIM Hello messages. Note that aFenner/Handley/Holbrook/Kouvelas               Section 4.1.6.  [Page 25]INTERNET-DRAFT             Expires: April 2005              October 2004neighbor's IP address may be non-unique within the PIM neighbor databasedue to scope issues. The address must however be unique amongst theaddresses of all the PIM neighbors on a specific interface.I_Am_Assert_Loser(S, G, I) is true if the Assert state machine (inSection 4.6.1) for (S,G) on Interface I is in "I am Assert Loser" state.I_Am_Assert_Loser(*, G, I) is true if the Assert state machine (inSection 4.6.2) for (*,G) on Interface I is in "I am Assert Loser" state.4.2.  Data Packet Forwarding RulesThe PIM-SM packet forwarding rules are defined below in pseudocode.     iif is the incoming interface of the packet.     S is the source address of the packet.     G is the destination address of the packet (group address).     RP is the address of the Rendezvous Point for this group.     RPF_interface(S) is the interface the MRIB indicates would be used     to route packets to S.     RPF_interface(RP) is the interface the MRIB indicates would be used     to route packets to RP, except at the RP when it is the     decapsulation interface (the "virtual" interface on which register     packets are received).First, we restart (or start) the Keepalive Timer if the source is on adirectly connected subnet.Second, we check to see if the SPTbit should be set because we've nowswitched from the RP tree to the SPT.Next we check to see whether the packet should be accepted based on TIBstate and the interface that the packet arrived on.If the packet should be forwarded using (S,G) state, we then build anoutgoing interface list for the packet.  If this list is not empty, thenwe restart the (S,G) state Keepalive Timer.If the packet should be forwarded using (*,*,RP) or (*,G) state, then wejust build an outgoing interface list for the packet. We also check ifwe should initiate a switch to start receiving this source on a shortestpath tree.Finally we remove the incoming interface from the outgoing interfacelist we've created, and if the resulting outgoing interface list is notempty, we forward the packet out of those interfaces.Fenner/Handley/Holbrook/Kouvelas                 Section 4.2.  [Page 26]INTERNET-DRAFT             Expires: April 2005              October 2004On receipt of data from S to G on interface iif: if( DirectlyConnected(S) == TRUE AND iif == RPF_interface(S) ) {      set KeepaliveTimer(S,G) to Keepalive_Period      # Note: a register state transition or UpstreamJPState(S,G)      # transition may happen as a result of restarting      # KeepaliveTimer, and must be dealt with here. } if( iif == RPF_interface(S) AND UpstreamJPState(S,G) == Joined AND      |    inherited_olist(S,G) != NULL ) {                                     |        set KeepaliveTimer(S,G) to Keepalive_Period                      | }                                                                       | Update_SPTbit(S,G,iif) oiflist = NULL if( iif == RPF_interface(S) AND SPTbit(S,G) == TRUE ) {                 |    oiflist = inherited_olist(S,G) } else if( iif == RPF_interface(RP(G)) AND SPTbit(S,G) == FALSE) {   oiflist = inherited_olist(S,G,rpt)   CheckSwitchToSpt(S,G) } else {    # Note: RPF check failed    # A transition in an Assert FSM, may cause an Assert(S,G)            |    # or Assert(*,G) message to be sent out interface iif.               |    # See section 4.6 for details.                                       |    if ( SPTbit(S,G) == TRUE AND iif is in inherited_olist(S,G) ) {       send Assert(S,G) on iif    } else if ( SPTbit(S,G) == FALSE AND                iif is in inherited_olist(S,G,rpt) {       send Assert(*,G) on iif    } } oiflist = oiflist (-) iif forward packet on all interfaces in oiflistThis pseudocode employs several "macro" definitions:DirectlyConnected(S) is TRUE if the source S is on any subnet that isdirectly connected to this router (or for packets originating on thisrouter).inherited_olist(S,G) and inherited_olist(S,G,rpt) are defined in Section4.1.Fenner/Handley/Holbrook/Kouvelas                 Section 4.2.  [Page 27]INTERNET-DRAFT             Expires: April 2005              October 2004Basically inherited_olist(S,G) is the outgoing interface list forpackets forwarded on (S,G) state taking into account (*,*,RP) state,(*,G) state, asserts, etc.inherited_olist(S,G,rpt) is the outgoing interface for packets forwardedon (*,*,RP) or (*,G) state taking into account (S,G,rpt) prune state,and asserts, etc.Update_SPTbit(S,G,iif) is defined in Section 4.2.2.CheckSwitchToSpt(S,G) is defined in Section 4.2.1.UpstreamJPState(S,G) is the state of the finite state machine in Section4.5.7.Keepalive_Period is defined in Section 4.10.Data triggered PIM-Assert messages sent from the above forwarding codeshould be rate-limited in a implementation-dependent manner.4.2.1.  Last-hop Switchover to the SPTIn Sparse-Mode PIM, last-hop routers join the shared tree towards theRP. Once traffic from sources to joined groups arrives at a last-hoprouter it has the option of switching to receive the traffic on ashortest path tree (SPT).The decision for a router to switch to the SPT is controlled as follows:     void     CheckSwitchToSpt(S,G) {       if ( ( pim_include(*,G) (-) pim_exclude(S,G)              (+) pim_include(S,G) != NULL )            AND SwitchToSptDesired(S,G) ) {              # Note: Restarting the KAT will result in the SPT switch              restart KeepaliveTimer(S,G);       }     }SwitchToSptDesired(S,G) is a policy function that is implementationdefined. An "infinite threshold" policy can be implemented makingSwitchToSptDesired(S,G) return false all the time.  A "switch on firstpacket" policy can be implemented by making SwitchToSptDesired(S,G)return true once a single packet has been received for the source andgroup.Fenner/Handley/Holbrook/Kouvelas               Section 4.2.1.  [Page 28]INTERNET-DRAFT             Expires: April 2005              October 20044.2.2.  Setting and Clearing the (S,G) SPTbitThe (S,G) SPTbit is used to distinguish whether to forward on(*,*,RP)/(*,G) or on (S,G) state.  When switching from the RP tree tothe source tree, there is a transition period when data is arriving dueto upstream (*,*,RP)/(*,G) state while upstream (S,G) state is beingestablished during which time a router should continue to forward onlyon (*,*,RP)/(*,G) state.  This prevents temporary black-holes that wouldbe caused by sending a Prune(S,G,rpt) before the upstream (S,G) statehas finished being established.Thus, when a packet arrives, the (S,G) SPTbit is updated as follows:     void     Update_SPTbit(S,G,iif) {       if ( iif == RPF_interface(S)             AND JoinDesired(S,G) == TRUE             AND ( DirectlyConnected(S) == TRUE                   OR RPF_interface(S) != RPF_interface(RP(G))                   OR inherited_olist(S,G,rpt) == NULL                   OR ( ( RPF'(S,G) == RPF'(*,G) ) AND                        ( RPF'(S,G) != NULL ) )                   OR ( I_Am_Assert_Loser(S,G,iif) ) {          Set SPTbit(S,G) to TRUE       }     }Additionally a router can set SPTbit(S,G) to TRUE in other cases, suchas when it receives an Assert(S,G) on RPF_interface(S) (see Section4.6.1).JoinDesired(S,G) is defined in Section 4.5.7, and indicates whether wehave the appropriate (S,G) Join state to wish to send a Join(S,G)upstream.Basically Update_SPTbit will set the SPTbit if we have the appropriate(S,G) join state and the packet arrived on the correct upstreaminterface for S, and one or more of the following conditions applies:1.   The source is directly connected, in which case the switch to the     SPT is a no-op.2.   The RPF interface to S is different from the RPF interface to the     RP.  The packet arrived on RPF_interface(S), and so the SPT must     have been completed.Fenner/Handley/Holbrook/Kouvelas               Section 4.2.2.  [Page 29]INTERNET-DRAFT             Expires: April 2005              October 20043.   No-one wants the packet on the RP tree.4.   RPF'(S,G) == RPF'(*,G).  In this case the router will never be able     to tell if the SPT has been completed, so it should just switch     immediately.In the case where the RPF interface is the same for the RP and for S,but RPF'(S,G) and RPF'(*,G) differ, then we wait for an Assert(S,G)which indicates that the upstream router with (S,G) state believes theSPT has been completed.  However item (3) above is needed because theremay not be any (*,G) state to trigger an Assert(S,G) to happen.The SPTbit is cleared in the (S,G) upstream state machine (see Section4.5.7) when JoinDesired(S,G) becomes FALSE.4.3.  Designated Routers (DR) and Hello MessagesA shared-media LAN like Ethernet may have multiple PIM-SM routersconnected to it. A single one of these routers, the DR, will act onbehalf of directly connected hosts with respect to the PIM-SM protocol.Because the distinction between LANs and point-to-point interfaces cansometimes be blurred, and because routers may also have multicast hostfunctionality, the PIM-SM specification makes no distinction between thetwo.  Thus DR election will happen on all interfaces, LAN or otherwise.DR election is performed using Hello messages.  Hello messages are alsothe way that option negotiation takes place in PIM, so that additionalfunctionality can be enabled, or parameters tuned.4.3.1.  Sending Hello MessagesPIM Hello messages are sent periodically on each PIM-enabled interface.They allow a router to learn about the neighboring PIM routers on eachinterface.  Hello messages are also the mechanism used to elect aDesignated Router (DR), and to negotiate additional capabilities.  Arouter must record the Hello information received from each PIMneighbor.Hello messages MUST be sent on all active interfaces, including physicalpoint-to-point links, and are multicast to the `ALL-PIM-ROUTERS' groupaddress (`224.0.0.13' for IPv4 and `ff02::d' for IPv6).     We note that some implementations do not send Hello messages     on point-to-point interfaces.  This is non-compliant behavior.     A compliant PIM router MUST send Hello messages, even on     point-to-point interfaces.Fenner/Handley/Holbrook/Kouvelas               Section 4.3.1.  [Page 30]INTERNET-DRAFT             Expires: April 2005              October 2004A per interface Hello Timer (HT(I)) is used to trigger sending Hellomessages on each active interface.  When PIM is enabled on an interfaceor a router first starts, the Hello Timer of that interface is set to arandom value between 0 and Triggered_Hello_Delay.  This preventssynchronization of Hello messages if multiple routers are powered onsimultaneously.  After the initial randomized interval, Hello messagesmust be sent every Hello_Period seconds.  The Hello Timer should not bereset except when it expires.Note that neighbors will not accept Join/Prune or Assert messages from arouter unless they have first heard a Hello message from that router.Thus if a router needs to send a Join/Prune or Assert message on aninterface on which it has not yet sent a Hello message with thecurrently configured IP address, then it MUST immediately send therelevant Hello message without waiting for the Hello Timer to expire,followed by the Join/Prune or Assert message.The DR_Priority Option allows a network administrator to give preferenceto a particular router in the DR election process by giving it anumerically larger DR Priority.  The DR_Priority Option SHOULD beincluded in every Hello message, even if no DR Priority is explicitlyconfigured on that interface.  This is necessary because priority-basedDR election is only enabled when all neighbors on an interface advertisethat they are capable of using the DR_Priority Option.  The defaultpriority is 1.The Generation_Identifier (GenID) Option SHOULD be included in all Hellomessages.  The GenID option contains a randomly generated 32-bit valuethat is regenerated each time PIM forwarding is started or restarted onthe interface, including when the router itself restarts.  When a Hellomessage with a new GenID is received from a neighbor, any old Helloinformation about that neighbor SHOULD be discarded and superseded bythe information from the new Hello message.  This may cause a new DR tobe chosen on that interface.The LAN Prune Delay Option SHOULD be included in all Hello messages senton multi-access LANs. This option advertises a router's capability touse values other than the default for the Propagation_Delay andOverride_Interval which affect the setting of the Prune-Pending,Upstream Join and Override Timers (defined in Section 4.10).The Interface_Address_List Option advertises all the secondary addressesassociated with the source interface

⌨️ 快捷键说明

复制代码 Ctrl + C
搜索代码 Ctrl + F
全屏模式 F11
切换主题 Ctrl + Shift + D
显示快捷键 ?
增大字号 Ctrl + =
减小字号 Ctrl + -