Login| Sign Up| Help| Contact|

Patent Searching and Data


Title:
METHOD FOR PRUNING A MULTICAST BRANCH, PROTOCOL INDEPENDENT MULTICAST ROUTER, AND LAYER-2 EXCHANGE
Document Type and Number:
WIPO Patent Application WO/2012/041257
Kind Code:
A1
Abstract:
In a method for pruning a multicast branch, a multicast source connected to a first hop PIM router via one or multiple layer-2 switches that has PIM functions is provided. In addition, the first hop PIM router receives a multicast flow initiated by the multicast source, sends a PIM prune message via a port from which the multicast flow is received in response to a determination that the multicast flow is not to be received; or the first hop PIM router receives a PIM prune message for a multicast flow from a downstream PIM router or a multicast group leave message for a multicast flow from a client connected to the first hop PIM router, deletes a port via which the PIM prune message or the multicast group leave message is received from an egress port list corresponding to the multicast flow, and sends a PIM prune message via the port from which the multicast flow is received in response to a determination that the multicast flow is not to be received.

Inventors:
ZHOU DI (CN)
LIU YU (CN)
CHEN QIANYE (CN)
CHEN XUSHENG (CN)
Application Number:
PCT/CN2011/080482
Publication Date:
April 05, 2012
Filing Date:
September 30, 2011
Export Citation:
Click for automatic bibliography generation   Help
Assignee:
HANGZHOU H3C TECH CO LTD (CN)
ZHOU DI (CN)
LIU YU (CN)
CHEN QIANYE (CN)
CHEN XUSHENG (CN)
International Classes:
H04L12/56; H04L45/16; H04L47/76
Foreign References:
CN102075417A2011-05-25
CN1863147A2006-11-15
CN101291240A2008-10-22
CN1889477A2007-01-03
Other References:
See also references of EP 2622805A4
Attorney, Agent or Firm:
DEQI INTELLECTUAL PROPERTY LAW CORPORATION (No. 1 Zhichun RoadHaidian District, Beijing 3, CN)
Download PDF:
Claims:
Claims

What is claimed is:

1 . A Protocol Independent Multicast (PIM) router, connected to a multicast source via at least one layer-2 exchanges, comprising:

a first module to receive a multicast flow initiated by the multicast source, to determine whether the multicast flow is to be received, to send a prune indication to a second module in response to a determination that the multicast flow is not to be received; or, to receive a PIM prune message for the multicast flow from a downstream PIM router or a multicast group leave message for the multicast flow from a client connected to the PIM router, to delete a port via which the PIM prune message or the multicast group leave message is received from an egress port list corresponding to the multicast flow, to determine whether there the multicast flow is to be received, to send a prune indication to a second module in response to a determination that the multicast flow is not to be received; and

wherein the second module is to receive the prune indication, and to send a PIM prune message via the port from which the multicast flow is received.

2. The PIM router of claim 1 , wherein when the PIM router adopts PIM-SSM, or adopts PIM-SM and is not a Designated Router (DR), or adopts bi-directional

PIM and is not a DR,

the first module comprises:

a first sub module to receive the multicast flow and send information of the multicast flow to a second sub module; and

wherein the second sub module is to receive the information of the multicast flow from the first sub module, to determine that the multicast flow is not to be received and to send the prune indication to the second module in response to a determination that a multicast routing table entry has not been established for the multicast flow in the PIM router or in response to a determination that a multicast routing table entry has been established for the multicast flow but an egress port list of the multicast routing table entry is empty.

3. The PIM router of claim 1 , wherein when the PIM router adopts PIM-SM and is a DR,

the first module comprises:

a first sub module to receive the multicast flow and send information of the multicast flow to a second sub module; and

wherein the second sub module is:

to receive the information of the multicast flow from the first sub module, to determine that the multicast flow is not to be received and to send the prune indication to the second module in response to a determination that a multicast routing table entry has been established for the multicast flow but an egress port list of the multicast routing table entry is empty;

or

to determine that the multicast flow is not to be received and to send the prune indication to the second module after receiving a source register stop message from an RP and determining that an egress port list of the multicast routing table entry is empty.

4. The PIM router of claim 1 , wherein when the PIM router adopts PIM-DM, the first module comprises:

a first sub module to receive the multicast flow and send information of the multicast flow to a second sub module; and

wherein the second sub module is:

to receive the information of the multicast flow from the first sub module, to determine that the multicast flow is not to be received and to send the prune indication to the second module in response to a determination that a multicast routing table entry has been established for the multicast flow but all egress ports in the multicast routing table entry are prune ports;

or to receive a PIM prune message from a downstream PIM neighbor and to add the port from which the PIM prune message is received into an egress port list of the multicast routing table entry as a prune port; to receive a PIM graft message from a downstream PIM neighbor and to add the port from which the PIM graft message is received into an egress port list of the multicast routing table entry as a forwarding port; to determine that the multicast flow is not to be received and to send the prune indication to the second module after determining that all ports connected to the downstream PIM neighbors have been added into the egress port list of the multicast routing table list and that all egress ports in the multicast routing table entry are prune ports.

5. The PIM router of claim 1 , wherein when the PIM adopts PIM-SM or PIM-SSM, the PIM router further comprises:

a third module to receive a PIM join message for the multicast flow sent by a downstream PIM router, and to send a PIM join message in the direction of the multicast source; or

when the PIM router adopts PIM-SM or PIM-SSM or PIM-DM, the PIM router further comprises:

a third module to receive a multicast group join message for the multicast flow sent by a client connected to PIM router, and to send a PIM join message in the direction of the multicast source.

6. The PIM router of claim 5, wherein the third module is further to:

determine whether a multicast routing table entry has been established for the multicast flow in the PIM router after receiving the PIM join message from the downstream PIM router or the multicast group join message from the client, to add a port from which the PIM join message or the multicast group join message is received into an egress port list in the multicast routing table entry, and to perform the sending the PIM join message in the direction of the multicast source. 7. The PIM router of claim 1 , further comprising:

when the PIM router adopts PIM-SM and is not a DR, or adopts bi-directional PIM and is not a DR,

a fourth module to send a PIM join message in the direction of a multicast source of each multicast flow according to a multicast routing table entry corresponding to the multicast flow when the first hop PIM router was not a DR and becomes a DR.

8. The PIM router of claim 1 , further comprising: when the PIM router adopts PIM-DM,

a fifth module to receive a PIM graft message for the multicast flow from a downstream PIM neighbor, and to send a PIM join message in the direction of the multicast source.

9. The PIM router of claim 8, wherein the fifth module is further to:

determine whether a multicast routing table entry corresponding to the multicast flow has been established in the PIM router after receiving a PIM graft message for the multicast flow from a downstream PIM neighbor, to add the port from which the PIM graft message is received into an egress port list of the multicast routing table entry and to send a PIM join message in the direction of the multicast source when determining the multicast routing table entry has been established and the egress port list of the multicast routing table entry is empty. 10. A layer-2 exchange with PIM snooping functions, for deployment between a multicast source and a first hop PIM router, the layer-2 exchange comprising: a first module to receive a PIM prune message for a multicast flow, to add a port from which the PIM prune message is received into a PIM snooping entry corresponding to the multicast flow as a prune port and to stop forwarding the multicast via the prune port in response to a determination that the upstream neighbor address in the message is not in a list of PIM routers that are maintained by PIM snooping functions of the exchange.

11 . The exchange of claim 10, wherein the first module is further to set a prune time for the prune port, and to begin forwarding the multicast flow to the prune port when the prune time expires.

12. The exchange of claim 10, wherein the first module is further to set a lifetime value that is smaller than the lifetime value of the multicast routing table entry of the multicast flow corresponding to the PIM prune message in the first hop PIM router; to set the prune port as a temporary router port when the lifetime value of the prune port expires, and to set the temporary router port as a router port if a PIM prune message for the multicast flow is not received within a pre-defined period of time, or to set the temporary router port as a prune port and reset the lifetime value of the prune port if a PIM prune message for the multicast flow is received. 13. The exchange of claim 10, wherein, the first module is further to, when determining an upstream neighbor address in the PIM prune message is not in a list of PIM routers using PIM snooping functions of the exchange, establish a PIM snooping entry for the multicast flow when determining a PIM snooping entry has not been established for the multicast flow in the exchange, to set an empty list as an upstream neighbor list in the PIM snooping entry, to add all ports connected to PIM neighbors except upstream ports into a downstream egress port list in the PIM snooping entry, to perform the adding the prune port into the PIM snooping entry corresponding to the multicast flow; and

to determine whether the multicast flow corresponding to the PIM prune message is to be forwarded based on PIM snooping entries and multicast group management entries in the layer-2 exchange, forwarding no PIM prune message if the multicast flow corresponding to the PIM prune message is to be forwarded, or forwarding the PIM prune message in the direction of the multicast source if the multicast flow corresponding to the PIM prune message is not to be forwarded.

14. The exchange of claim 10, wherein the first module is further to directly perform the adding of the prune port into the PIM snooping entry corresponding to the multicast flow in response to a determination that an upstream neighbor address in the PIM prune message is not in a list of PIM routers using PIM snooping functions of the exchange and a PIM snooping entry has been established for the multicast flow in the exchange; and

to determine whether there the multicast flow corresponding to the PIM prune message is to be forwarded based on PIM snooping entries and multicast group management entries in the layer-2 exchange, forwarding no PIM prune message if the multicast flow corresponding to the PIM prune message is to be forwarded, or forwarding the PIM prune message in the direction of the multicast source if the multicast flow corresponding to the PIM prune message is not to be forwarded.

15. The exchange of claim 10, further comprising:

a second module to receive a PIM join message for a multicast flow; in response to a determination that the upstream neighbor address in the message is not in a list of PIM routers that are maintained by PIM snooping functions of the exchange, to determine whether there is another port other than the port from which the PIM join message is received is to receive the multicast flow based on PIM snooping entries and multicast group management snooping entries in the exchange in response to a determination that there is a PIM snooping entry for the multicast flow corresponding to the PIM join message in the exchange and the port receiving the PIM join message is a prune port in the PIM snooping entry, to forward no PIM join message when there is another port that is to receive the multicast flow, or to forward the PIM join message in the direction of the multicast source if there is no other port that is to receive the multicast flow. 16. The exchange of claim 15, wherein the second module is further to delete the port from which the PIM join message is received from the PIM snooping entry after forwarding the PIM join message in the direction of the multicast source, and to set the port as a router port. 17. The exchange of claim 10, further comprising: a third module to receive a multicast group join message for a multicast flow, to add a port from which the multicast group join message is received into a multicast group management snooping entry corresponding to the multicast flow as a membership port, and to forward the multicast group join message to all router ports, prune ports and upstream neighbors in the PIM snooping entry except the port from which the multicast group join message is received.

18. A method for pruning a multicast branch, said method comprising:

providing a multicast source connected to a first hop PIM router via at least one layer-2 exchange that has Protocol Independent Multicast (PIM) functions; receiving, by the first hop PIM router, a multicast flow initiated by the multicast source, sending a PIM prune message via a port from which the multicast flow is received in response to a determination that the multicast flow is not to be received; or receiving, by the first hop PIM router, a PIM prune message for a multicast flow from a downstream PIM router or a multicast group leave message for a multicast flow from a client connected to the first hop PIM router, deleting a port via which the PIM prune message or the multicast group leave message is received from an egress port list corresponding to the multicast flow, and sending a PIM prune message via the port from which the multicast flow is received in response to a determination that the multicast flow is not to be received.

19. The method of claim 18, further comprising:

receiving, by one of the at least one layer-2 exchange, the PIM prune message from the first hop PIM router, adding a port from which the PIM prune message is received into a PIM snooping entry corresponding to the multicast flow as a prune port and stopping forwarding of the multicast flow via the prune port when determining an upstream neighbor address in the PIM prune message is not in a list of PIM routers which are maintained by PIM snooping functions of the exchange.

Description:
METHOD FOR PRUNING A MULTICAST BRANCH, PROTOCOL

INDEPENDENT MULTICAST ROUTER, AND LAYER-2 EXCHANGE

BACKGROUND

[0001 ] For facilitating understanding, the following concepts are first explained.

[0002] Multicast: a communication manner in contrast with unicast and broadcast. A multicast system includes a multicast source, one or multiple receivers and a multicast group. The source host sends data only once, and the destination address of the data is the address of the multicast group. Each receiver in the multicast group receives a copy of the data, and only the receivers in the multicast group can receive the data.

[0003] IGMP (Internet Group Management Protocol): a protocol for managing IP multicast members in the TCP/IP (Transmission Control Protocol/Internet Protocol) protocol family, which is for establishing and maintaining relations of multicast group members between an IP host and adjacent multicast routers.

[0004] IGSP (Internet Group Management Protocol Snooping): a multicast restriction scheme running in layer-2 devices, which is for managing and controlling multicast groups. A layer-2 device which runs IGMP snooping analyzes a received IGMP packet, establishes a mapping relation between a port and a multicast MAC (Media Access Control) address, and forwards multicast data according to the mapping relation.

[0005] PIM: a protocol which provides IP multicast routing by utilizing a unicast routing table established using static routing or any unicast routing protocol such as RIP, OSPF, IS-IS, BGP and so on, and is for maintaining propagation of multicast data between layer-three devices. PIM protocol has four modes, i.e., PIM-DM (Dense Mode), PIM-SM (Spare Mode), PIM-SSM (Source-Specific Multicast) and bi-directional PIM.

[0006] IP multicast techniques effectively solve problems existing in one-to-many transmissions, implement efficient one-to-many data transmission in an IP network, and can save a large amount of network bandwidth and reduce network loads. Some new value-added services, including Internet information services, such as online live broadcast, IPTV, remote education, Telemedicine, internet radio, real-time video conference, and so on, are able to gain greater development by taking advantage of the multicast functions of the network.

BRIEF DESCRIPTION OF THE DRAWINGS

[0007] Fig. 1 is a schematic diagram illustrating a structure of a multicast network.

[0008] Fig. 2 is a flowchart illustrating a method for pruning a multicast branch according to an example.

[0009] Fig. 3 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-SSM after receiving a multicast flow according to an example.

[0010] Fig. 4 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-SSM after receiving a PIM prune message from a downstream PIM router or an IGMP leave message from a client served by the first hop PIM router according to an example.

[001 1 ] Fig. 5 is a flowchart illustrating a process performed by a layer-2 exchange after receiving a PIM prune message according to an example.

[0012] Fig. 6 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-SSM after receiving a PIM join message from a downstream PIM router according to an example.

[0013] Fig. 7 is a flowchart illustrating a process performed by a layer-2 exchange after receiving a PIM join message according to an example.

[0014] Fig. 8 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-SSM after receiving an IGMP join message according to an example.

[0015] Fig. 9 is a flowchart illustrating a process performed by a layer-2 exchange after receiving a PIM join message according to an example.

[001 6] Fig. 10 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-SM after receiving a multicast flow according to an example. [0017] Fig. 11 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-DM after receiving a multicast flow according to an example.

[0018] Fig. 12 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-DM after receiving a PIM graft message from a PIM neighbor according to an example.

[0019] Fig. 13 is a schematic diagram illustrating a structure of a PIM router according to an example.

[0020] Fig. 14 is a schematic diagram illustrating a structure of a PIM router according to an example.

DETAILED DESCRIPTION OF EXAMPLES

[0021 ] The PIM protocol is the currently prevailing multicast routing protocol in use today. IGMP snooping and PIM snooping are also commonly adopted layer-2 multicast control protocols. PIM snooping, whose importance is only below that of IGMP snooping, is for snooping PIM hello messages, PIM join messages, and PIM prune messages to control the forwarding of a multicast flow to intended routers. PIM snooping exchanges, however, may produce positive outcomes only when deployed between PIM routers, but may not achieve the same outcomes when deployed between a multicast source and a PIM router.

[0022] Regarding multicast applications that operate under a mechanism similar to that of VOD (Video On Demand), traffic control at the multicast source side remains a problem to be solved in the industry. Fig. 1 is a schematic diagram illustrating a structure of a multicast network. As shown in Fig. 1 , a multicast source accesses the network via one or more layer-2 exchanges, and a client accesses the network via a layer-2 exchange or a PIM router. In addition, multiple layer-2 exchanges converge at a PIM router. For example, multicast sources 1 and 2 access the network respectively via layer-2 exchanges 5 and 6, and layer-2 exchanges 1 and 2 converge at PIM router 2.

[0023] When a multicast flow initiated from a multicast source reaches a first hop PIM router via one or multiple exchanges, the PIM router may send a source register message to an RP (Rendezvous Point) if the PIM router is a DR (Designated Router). When the RP detects that an (S,G) entry corresponding to the multicast flow, i.e., an entry recording the source address and group address of the multicast flow, has not been established in the RP, which indicates no client subscribes to the multicast flow, the RP sends a source quench message to the DR. After that, when a client subscribes to the multicast flow, the client sends an IGMP join message to a leaf router, and the leaf router sends a PIM join message to the RP. After receiving the PIM join message, the RP sends a PIM join message to the DR, and subsequently, the multicast flow reaches the multicast receiver via the RP. [0024] The first hop PIM router refers to the first PIM router encountered by the multicast flow from the multicast source. The RP is a PIM router providing centralized management of multicast flow information, and acts as a medium between multicast sources and multicast receivers.

[0025] In conventional networks, a multicast flow from a multicast source, whether subscribed to or not by any clients, is first sent to a first hop PIM router via one or multiple exchanges, which increases cache memory consumption in the exchanges. Cache memory for egress ports of an exchange plays an important role in keeping service flows, especially those with bursts such as videos and so on, in order, in preventing packet loss and in reducing jitter. Therefore, forwarding of data flows whose forwarding is not necessary should be prevented to reduce the consumption of cache memory for egress ports of an exchange. Current protocols, however, cannot prune off unnecessary multicast flows between a multicast source and a PIM router on the data link layer.

[0026] Some examples will be described in detail with reference to accompanying drawings.

[0027] In some examples, it is assumed that the whole network adopts the same version of a multicast group management protocol, e.g., adopts one of IGMPv2, IGMPv3, MLDvl (Multicast Listener Discovery Protocol Version 1 ) and MLDv2.

[0028] When IGMPv2 or MLDvl is adopted in this example, a multicast flow is identified by a multicast group identification. However, when IGMPv3 or MLDv2 is adopted, a multicast flow is identified by a multicast source identification + a multicast group identification.

[0029] In some examples, the adopted PIM protocol is PIM-SSM or PIM-DM. When PIM-SSM is adopted, the adopted IGMP version is IGMPv3, in which the IGSP version is IGMPv3 snooping.

[0030] In some examples, a layer-2 exchange with PIM snooping functions has a new role for ports, i.e., prune ports. When a layer-2 exchange with PIM snooping functions receives a PIM prune message from a first hop PIM router for a multicast flow, the port receiving the message is set as a prune port. Afterwards, the multicast flow is prohibited from being forwarded to the prune port.

[0031 ] A layer-2 exchange supporting multicast has four roles for ports, i.e., router ports and membership ports for IGMP snooping, prune ports and upstream ports for PIM snooping. A router port is a downstream port, i.e., a port receiving a PIM join message. The downstream ports are called router ports because they perform the same functions, i.e., connecting routers, forwarding all multicast flows.

[0032] The four roles of the ports are maintained respectively with respect to each other. When a port plays all or any two of three roles of a membership port, a prune port, and a router port at the same time, the priority order of the roles are membership port, prune port and router port in a descending order of priority. For layer-2 forwarding table entries, i.e., PIM snooping entries and IGMP snooping entries, a rule of processing such a port includes: adding the port into the entries when the role with the highest priority of the port is a membership port, and not adding the port to the entries when the role with the highest priority of the port is a prune port. In addition, if the only role of a port is a router port, it is assumed that the role with the highest priority of the port is a router port, and the port is added into the layer-2 forwarding table entries.

[0033] If an upstream neighbor list in a PIM snooping table entry of a layer-2 exchange is empty, no upstream port of the layer-2 exchange should be added into a downstream egress port list in the PIM snooping table entry. A PIM snooping table entry includes: an (S,G) entry, an upstream neighbor list, a down stream neighbor list, and so on.

[0034] The following example adopts IGMP as its multicast group management protocol. It should be understood that when MLD protocol is adopted, replacement of all "IGMP" in the following description with "MLD" is only required.

[0035] Fig. 2 is a flowchart illustrating a method for pruning a multicast branch according to an example. As shown in Fig. 2, the method may include the following operations.

[0036] At block 201 , a layer-2 exchange receives a PIM hello message from a PIM router, sets a port from which the message is received as a router port by utilizing IGMP snooping functions, and maintains a PIM router list according to the message by utilizing PIM snooping functions. Each entry of the PIM router list includes: an address of a PIM router sending a PIM hello message and a port number of the port connecting the layer-2 exchange with the PIM router.

[0037] The address of the PIM router sending the PIM hello message may be obtained from a source address field in the PIM hello message. The port number of the port connecting the layer-2 exchange with the PIM router refers to the port number from which the PIM hello message is received by the layer-2 exchange.

[0038] In a PIM router, a port adopting a PIM protocol may send a PIM hello message at intervals to an external device.

[0039] After receiving the PIM hello message, the layer-2 exchange may forward the message to other layer-2 exchanges, and other layer-2 exchanges also perform the operations at block 201 after receiving the message.

[0040] At block 202, when a multicast flow initiated from a multicast source reaches a first hop PIM router via a router port, the first hop PIM router sends a PIM prune message for the multicast flow via the port from which the multicast flow is received when a determination that receipt of the multicast flow is not required is made.

[0041 ] At block 203, when the first hop PIM router receives a PIM prune message for a multicast flow from a downstream PIM router or receives an IGMP leave message for a multicast flow from a client connected to the first hop PIM router, the first hop PIM router searches in a multicast routing table for an entry corresponding to the multicast flow, deletes the port from which the multicast flow is received from the entry, and sends a PIM prune message for the multicast flow via the port from which the multicast flow is received when a list of egress ports in the entry is empty.

[0042] The frequency at which the PIM prune message is sent at blocks 202 and 203 is restricted, i.e., the PIM prune message will not be repetitively sent within a short time when the same multicast flow is continuously received. The default time interval between each transmission of the PIM prune message is one minute. The transmission of the PIM prune message is stopped when the branch of the multicast flow is pruned off or a new demand for the multicast flow is received from local clients.

[0043] At block 204, a layer-2 exchange between the first hop router and the multicast source receives the PIM prune message, sets a port from which the PIM prune message is received as a prune port when detecting an upstream neighbor address in the message is not in a list of PIM routers maintained by the PIM snooping functions of the layer-2 exchange, and stops forwarding the multicast flow via the prune port.

[0044] From Fig. 2 it may be seen that a multicast flow between a multicast source and a first hop PIM router is pruned off when:

1 . there is no demand for receipt of the multicast flow;

2. there was a demand for receipt of the multicast flow, but at the moment a request to stop receipt of the multicast flow has been received.

[0045] Fig. 3 and Fig. 4 respectively illustrate detailed processing procedures of the above two types of multicast flow by a first hop PIM router adopting PIM-SSM.

[0046] Fig. 3 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-SSM after receiving a multicast flow according to an example. As shown in Fig. 3, the process may include the following operations.

[0047] At block 301 , the first hop PIM router (Rtr) periodically sends a PIM hello message via each PIM port of the first hop PIM.

[0048] At block 302, a layer-2 exchange receives the PIM hello message, sets a port from which the message is received as a router port by utilizing IGMP snooping functions, and forwards the PIM hello message via each port of the layer-2 exchange to other layer-2 exchanges.

[0049] IGMP snooping is the common characteristic of all layer-2 exchanges supporting multicast. An exchange with IGMP snooping functions regards a port from which an IGMP general query message or a PIM packet is received as a router port, and regards a port from which an IGMP join message is received as a membership port. An exchange with IGMP snooping functions may send all received multicast flows to a router port, and send a multicast flow of a multicast group only to a membership port.

[0050] Other layer-2 exchanges may also perform the operations at block 302 after receiving the PIM hello message.

[0051 ] At block 303, a multicast source initiates a multicast flow, and the multicast flow is forwarded to a first hop PIM router (Rtr) via each router port.

[0052] At block 304, the Rtr determines whether the Rtr has established an (S,G) entry corresponding to the multicast flow, and performs operations at block 305 when the entry has been established, or performs operations at block 308 when the entry has not been established.

[0053] At block 305, the Rtr determines whether a list of egress ports in the (S,G) entry is empty, performs operations at block 306 when the list is empty, or performs operations at block 307 when the list is not empty.

[0054] At block 306, the Rtr updates an aging time of the (S,G) entry, sends a PIM prune message via a port from which the multicast flow is received, and the process is terminated.

[0055] The upstream neighbor address of the PIM prune message is the IP address of the multicast source, the destination IP address is the IP address of the multicast source and the destination MAC address is the MAC address of the multicast source.

[0056] Since the PIM prune message is sent from the port via which the multicast flow enters the Rtr, the PIM prune message will reach a layer-2 exchange between the multicast source and the Rtr. The layer-2 exchange may perform the processing procedures shown in Fig. 5 after receiving the PIM prune message. [0057] At block 307, the Rtr forwards the multicast flow to external devices according to egress port information in the egress port list, and the process is terminated.

[0058] At block 308, the Rtr establishes an (S,G) entry for the multicast flow, configures an aging time for the entry, and sends a PIM prune message to an external device via the port from which the multicast flow is received.

[0059] The aging time of the (S,G) entry is generally configured as three minutes.

[0060] The upstream neighbor address of the PIM prune message is the IP address of the multicast source, the destination IP address is the IP address of the multicast source and the destination MAC address is the MAC address of the multicast source.

[0061 ] If PIM-SM is adopted, in this block, the Rtr may further send a source register message for the multicast flow to an RP.

[0062] Fig. 4 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-SSM after receiving a PIM prune message from a downstream PIM router or an IGMP leave message from a client connected to the first hop PIM router according to an example. As shown in Fig. 4, the process may include the following operations.

[0063] At block 401 , the first hop PIM router (Rtr) receives a PIM prune message sent by a downstream PIM router for a multicast flow or an IGMP leave message sent by a client connected to the Rtr for a multicast flow, searches for an (S,G) entry corresponding to the multicast flow, and processes the (S,G) entry according to the PIM protocol.

[0064] When a multicast receiver ceases to receive a multicast flow, the multicast receiver may send an IGMP leave message for the multicast flow to a leaf router of the multicast receiver. The leaf router sends a PIM prune message to an RP for the multicast flow after receiving the IGMP leave message. The RP forwards the PIM prune message in the direction of the first hop PIM router. [0065] According to a current PIM protocol, the Rtr generally deletes a port from which the PIM prune message is received from a list of egress ports in the (S,G) entry.

[0066] At block 402, the Rtr determines whether an egress port list in the (S,G) entry is empty, performs operations at block 403 when the list is empty, or performs operations at block 404 when the list is not empty.

[0067] At block 403, the Rtr sends the PIM prune message to an external device via the port from which the multicast flow is received, and the process is terminated.

[0068] The upstream neighbor address of the PIM prune message is the IP address of the multicast source, the destination IP address is the IP address of the multicast source and the destination MAC address is the MAC address of the multicast source.

[0069] Since the PIM prune message is sent from the port via which the multicast flow enters the Rtr, the PIM prune message will reach the layer-2 exchange between the multicast source and the Rtr. The layer-2 exchange may perform the processing procedures shown in Fig. 5 after receiving the PIM prune message.

[0070] At block 404, the Rtr performs no further operations.

[0071 ] The PIM prune message sent by the first hop PIM router will reach the one or multiple layer-2 exchanges between the multicast source and the first hop PIM router. Fig. 5 is a flowchart illustrating a process performed by a layer-2 exchange after receiving a PIM prune message according to an example. As shown in Fig. 5, the process may include the following operations.

[0072] At block 501 , a layer-2 exchange receives a PIM prune message for a multicast flow.

[0073] At block 502, the layer-2 exchange determines whether the upstream neighbor address in the PIM prune message is in a list of PIM routers that are maintained by PIM snooping functions of the layer-2 exchange, performs operations at block 503 if the upstream neighbor address is in the list, or performs operations at block 504 if the upstream neighbor address is not in the list.

[0074] At block 503, the layer-2 exchange performs processing according to a current PIM snooping protocol, and the process is terminated.

[0075] If the upstream neighbor address in the PIM prune message is in the list of PIM routers maintained by PIM snooping functions, which is an indication that the layer-2 exchange is deployed between PIM routers, the processing according to current PIM snooping protocol is performed. Otherwise, this is an indication that the layer-2 exchange is deployed between the multicast source and the first hop PIM router, thus the processing according to an example is adopted, i.e., operations at blocks 504 to 509.

[0076] At block 504, the layer-2 exchange determines whether there is a PIM snooping entry for the multicast flow in the layer-2 exchange, performs operations at block 505 when there is the PIM snooping entry, or performs operations at block 506 when there is no such PIM snooping entry.

[0077] At block 505, the layer-2 exchange adds the port from which the PIM prune message is received into a list of downstream egress ports in the PIM snooping entry, marks the port as a prune port, and performs operations at block 507.

[0078] At block 506, the layer-2 exchange generates a PIM snooping table entry according to the PIM prune message. The upstream port in the PIM snooping entry is set to be an egress port found in a unicast destination MAC table entry according to the destination MAC address of the PIM prune message. The upstream neighbor list is empty. The port from which the PIM prune message is received is added into a downstream egress port list in the entry, and is marked as a prune port. All PIM neighbor ports except the upstream ports are added into the downstream egress port list in the PIM snooping table entry.

[0079] As for an arbitrary multicast flow, if a PIM snooping table entry has not been established for the multicast flow, the layer-2 exchange forwards the multicast flow via all PIM neighbor ports except upstream ports by default. Therefore, at this block, after a PIM snooping table entry is established for the multicast flow, all PIM neighbor ports except the upstream ports and marked prune ports are added into the downstream egress port list of the PIM snooping table entry in order to guarantee that the multicast flow will be forwarded to all PIM neighbor ports except the upstream ports when the multicast flow is subsequently received.

[0080] At block 507, the layer-2 exchange determines whether it is necessary to forward the multicast flow corresponding to the PIM prune message according to PIM snooping table entries and IGMP snooping table entries in the layer-2 exchange, i.e., determining whether there is a PIM snooping table entry or an IGMP snooping table entry having a port whose role of the highest priority is membership port or router port, and performs operations at block 508 if there is, or performing operations at block 509 if there is not.

[0081 ] At block 508, the layer-2 exchange does not forward the PIM prune message, and the process is terminated.

[0082] At block 509, the layer-2 exchange searches in unicast destination MAC table entries for an egress port according to a unicast destination MAC address of the PIM prune message, and forwards the PIM prune message via the egress port.

[0083] The PIM prune message then reaches the multicast source.

[0084] In this example, a lifetime value may be set for a prune port in a PIM snooping table entry. The lifetime value of a prune port may be 1 /3 of the lifetime value of the (S,G) entry of the multicast flow in the PIM router, e.g., one minute by default. Therefore, a PIM DR may receive the multicast flow every one minute. When the lifetime value of prune ports expires, all the prune ports in a PIM snooping entry may temporarily be set as router ports to have the multicast flow forwarded through the ports. If no PIM prune message for the multicast flow is received from a port within a pre-defined time period from the time the lifetime value of the prune port expires, the port is formally set as a router port. Then, a determination as to whether there are other prune ports in the PIM snooping table entry is made, and the PIM snooping table entry is deleted if there are no other prune ports to save entry resources. If any PIM prune message for the multicast flow is received from the port within the pre-defined time period from the time the lifetime value expires, the port is set as a prune port, and the lifetime value of the prune port is reset.

[0085] Subsequently, if a device subscribes to a multicast flow whose branch has been pruned off, a branch may be grafted to the multicast flow. A branch should be grafted between a multicast source and a first hop PIM router for a multicast flow that satisfies any of the following three conditions:

[0086] 1 . when a client connected to a downstream PIM router subscribes to the multicast flow, the client may send an IGMP join message to the downstream PIM router, and the downstream PIM router may send a PIM join message to the first hop PIM router after receiving the IGMP join message;

[0087] 2. when a client connected to the layer-2 exchange subscribes to the multicast flow, the client may send an IGMP join message to the layer-2 exchange;

[0088] 3. when a client connected to the first hop PIM router subscribes to the multicast flow, the client may send an IGMP join message to the first hop PIM router.

[0089] A few exemplary processing procedures in connection with grafting a branch for a multicast flow will be described hereinafter.

[0090] Fig. 6 is a flowchart illustrating a process performed by a first hop PIM router adopting PIM-SSM after receiving a PIM join message from a downstream PIM router according to an example. As shown in Fig. 6, the process may include the following operations.

[0091 ] At block 601 , a first hop PIM router (Rtr) receives a PIM join message for a multicast flow from a downstream PIM router, searches for an (S,G) entry corresponding to the multicast flow in the first hop PIM router. [0092] When the downstream PIM router of the first hop PIM router is connected to a client, and as shown in Fig. 1 , PIM router 2 is a first hop PIM router, PIM router 1 is a downstream PIM router of PIM router 2 and PIM router 1 is connected to client 1 . When the client subscribes to a multicast flow, the client may send an IGMP join message for the multicast flow to the downstream PIM router. The downstream PIM router may send a PIM join message for the multicast flow to the first hop PIM router, e.g., the PIM router 2, after receiving the IGMP join message.

[0093] At block 602, the Rtr determines whether a list of egress ports in the (S,G) entry is empty, performs operations at block 603 when the list is empty, or performs operations at block 604 when the list is not empty.

[0094] At block 603, the Rtr adds the port from which the PIM join message is received into an egress port list in the (S,G) entry, searches in a unicast routing table for an entry corresponding to the destination IP address of the message, sends a PIM join message through an egress port in the unicast routing table entry, and then the process is terminated.

[0095] The destination IP address of the PIM join message is the IP address of the multicast source, the destination MAC address being the MAC address of the multicast source. The PIM join message may be forwarded to the multicast source through one or more layer-2 exchanges between the Rtr and the multicast source. The processing procedures of the PIM join message by a layer-2 exchange may be as shown in Fig. 9.

[0096] To avoid PIM join message loss and to receive the multicast flow quickly, the Rtr may send the PIM join message at a high frequency until the multicast flow is received.

[0097] At block 604, the Rtr processes the PIM join message according to a current PIM protocol.

[0098] Fig. 7 is a flowchart illustrating a process performed by a layer-2 exchange after receiving an IGMP join message according to an example. As shown in Fig. 5, the process may include the following operations. [0099] At block 701 , a layer-2 exchange receives an IGMP join message for a multicast flow.

[00100] The IGMP join message is initiated by a client connected to the layer-2 exchange.

[00101 ] At block 702, the layer-2 exchange searches in the layer-2 exchange for an IGMP snooping table entry corresponding to the multicast flow, adds a port from which the message is received into the IGMP snooping table entry as a membership port, and forwards the IGMP join message to all router ports, prune ports and upstream neighbors in a PIM snooping table entry except to the port from which the message is received.

[00102] The IGMP join message may reach other layer-2 exchanges or the first hop PIM router. A processing procedure of the IGMP join message by the other layer-2 exchanges is the same as that in this example. An example of a processing procedure of the IGMP join message by the first hop PIM router is as shown in Fig. 8.

[00103] Fig. 8 is a flowchart illustrating a process performed by a first hop

PIM router adopting PIM-SSM after receiving an IGMP join message according to an example. As shown in Fig. 8, the process may include the following operations.

[00104] At block 801 , a first hop PIM router (Rtr) receives an IGMP join message for a multicast flow.

[00105] The IGMP join message may be initiated from the following two types of sources.

[00106] Source 1 : when the first hop PIM router is connected to a client, as shown in Fig. 1 , PIM router 2 is the first hop PIM router and is connected to client 2. If the client subscribes to a multicast flow, the client may send an IGMP join message to the first hop PIM router.

[00107] Source 2: when a layer-2 exchange between the multicast source and the first hop PIM router is connected to a client, as shown in Fig. 1 where PIM router 2 is the first hop PIM router, and layer-2 exchange 1 between PIM router 2 and multicast sources 1 and 2 is connected to client 3. If client 3 subscribes to a multicast flow, client 3 may send an IGMP join message to layer-2 exchange 1 . Layer-2 exchange 1 may forward the IGMP join message to the first hop PIM router.

[00108] At block 802, the Rtr determines whether the Rtr has established an (S,G) entry corresponding to the multicast flow, and performs operations at block 803 when the entry has been established, or performs operations at block 808 when the entry has not been established.

[00109] At block 803, the Rtr determines whether an egress port list of the

(S,G) entry is empty, performs operations at block 804 when the list is empty, or performs operations at block 807 when the list is not empty.

[001 10] At block 804, the Rtr determines whether the IGMP join message is from a port leading to the multicast source, and performs operations at block 805 if the IGMP join message is from the port, or performs operations at block 806 if the IGMP join message is not from the port.

[001 1 1 ] The IGMP join message is from a port leading to the multicast source, i.e., the source of the IGMP join message is the Source 2 at block 801 , thus there is no need to add the port receiving the IGMP join message into the egress port list of the (S,G) entry, nor to send a PIM join message.

[001 12] At block 805, the Rtr performs no further processing, and the process is terminated.

[001 13] At block 806, the Rtr adds the port from which the IGMP join message is received into the egress port list of the (S,G) entry, sends a PIM join message for the multicast flow in the direction of the multicast source (S), and the process is terminated.

[001 14] The destination IP address of the PIM join message is the IP address of the multicast source, the destination MAC address being the MAC address of the multicast source. The PIM join message may be forwarded to the multicast source through layer-2 exchanges between the Rtr and the multicast source. The processing procedures of the PIM join message by a layer-2 exchange may be as shown in Fig. 9.

[001 15] To avoid PIM join message loss and to receive the multicast flow quickly, the Rtr may send the PIM join message at a high frequency until the multicast flow is received.

[001 1 6] At block 807, the Rtr performs processing according to a current

PIM protocol, and the process is terminated.

[001 17] According to a current PIM protocol, the Rtr may add the port from which the IGMP join message is received into the egress port list of the (S,G) entry.

[001 18] At block 808, the Rtr performs processing according to a current

PIM protocol.

[001 19] According to a current PIM protocol, the Rtr may establish an (S,G) entry corresponding to the multicast flow, and may add the port receiving the IGMP join message into the egress port list of the (S,G) entry.

[00120] Fig. 9 is a flowchart illustrating a process performed by a layer-2 exchange after receiving a PIM join message according to an example. As shown in Fig. 9, the process may include the following operations.

[00121 ] At block 901 , a layer-2 exchange receives a PIM join message for a multicast flow.

[00122] At block 902, the layer-2 exchange determines whether the upstream neighbor address in the PIM join message is in a list of PIM routers which are maintained by PIM snooping functions of the layer-2 exchange, performs operations at block 903 if the upstream neighbor address is in the list, or performs operations at block 904 if the upstream neighbor address is not in the list.

[00123] At block 903, the layer-2 exchange performs processing according to a current PIM snooping protocol, and then the process is terminated. [00124] At block 904, the layer-2 exchange determines whether there is a

PIM snooping table entry for the multicast flow in the layer-2 exchange, performs operations at block 905 when a PIM snooping table entry exists, or performs operations at block 906 when no such PIM snooping table entry exists.

[00125] At block 905, the layer-2 exchange determines whether the port from which the PIM join message is received is a prune port in the PIM snooping table entry, and performs operations at block 907 when the port is a prune port, or performs operations at block 906 when the port is not a prune port.

[00126] At block 906, the layer-2 exchange performs no further processing, and the process is terminated.

[00127] At block 907, the layer-2 exchange determines whether there is another port needing to forward the multicast flow except the port receiving the PIM join message according to local PIM snooping table entries and IGMP snooping table entries, and performs operations at block 908 when such a port exists, or performs operations at block 909 when such a port does not exist.

[00128] At block 908, the layer-2 exchange does not forward the PIM join message, and performs operations at block 910.

[00129] At block 909, the layer-2 exchange searches in a unicast routing table for an entry according to the destination IP address of the PIM join message, forwards the PIM join message via egress ports in the unicast routing table entry, and performs operations at block 910.

[00130] At block 910, the layer-2 exchange deletes the mark which labels the receiving port of the PIM join message as a prune port from a downstream egress port list of the PIM snooping table entry, sets the receiving port of the PIM join message as a router port and forwards the multicast flow via the port.

[00131 ] At block 911 , the layer-2 exchange judges whether the downstream egress port list of the PIM snooping table entry does not include a prune port and the upstream neighbor list is empty, performs operations at block 912 if the downstream egress port list of the PIM snooping table entry does not include a prune port and the upstream neighbor list is empty; otherwise, performs operations at block 913.

[00132] At block 912, the layer-2 exchange deletes the PIM snooping table entry to save table entry resources, and the process is terminated.

[00133] At block 913, the layer-2 exchange performs no further processing.

[00134] Fig. 10 is a flowchart illustrating a process performed by a first hop

PIM router adopting PIM-SM after receiving a multicast flow according to an example. As shown in Fig. 10, the process may include the following operations.

[00135] At block 1001 , the first hop PIM router (Rtr) periodically sends a

PIM hello message via each PIM port of the first hop PIM.

[00136] At block 1002, a layer-2 exchange receives the PIM hello message, sets a port from which the message is received as a router port by utilizing IGMP snooping functions, and forwards the PIM hello message via each port of the layer-2 exchange to other layer-2 exchanges.

[00137] Other layer-2 exchanges may also perform the operations at block

1002 after receiving the PIM hello message.

[00138] At block 1003, a multicast source initiates a multicast flow, and the multicast flow is forwarded to a first hop PIM Rtr via each router port.

[00139] At block 1004, the Rtr judges whether the Rtr has established an

(S,G) entry corresponding to the multicast flow, and performs operations at block 1005 when the entry has been established, or performs operations at block 1008 when the entry has not been established.

[00140] At block 1005, the Rtr judges whether an egress port list of the

(S,G) entry is empty, performs operations at block 1006 when the list is empty, or performs operations at block 1007 when the list is not empty.

[00141 ] At block 1006, the Rtr updates an aging time of the (S,G) entry, sends a PIM prune message via a port from which the multicast flow is received, and the process is terminated.

[00142] The upstream neighbor address of the PIM prune message is the

IP address of the multicast source, the destination IP address is the IP address of the multicast source and the destination MAC address is the MAC address of the multicast source.

[00143] Since the PIM prune message is sent from the port via which the multicast flow enters the Rtr, the PIM prune message will reach the layer-2 exchange between the multicast source and the Rtr. The layer-2 exchange may perform the processing procedures shown in Fig. 5 after receiving the PIM prune message.

[00144] At block 1007, the Rtr forwards the multicast flow to external devices according to egress port information in the egress port list, and the process is terminated.

[00145] At block 1008, the Rtr establishes an (S,G) entry corresponding to the multicast flow, and sets an aging time for the (S,G) entry.

[00146] The aging time of the (S,G) entry is generally configured as three minutes.

[00147] At block 1009, the Rtr determines whether the Rtr is a DR, and performs operations at block 1011 when the Rtr is a DR, or performs operations at block 1010 when the Rtr is not a DR.

[00148] At block 1010, the Rtr performs no further processing, and the process is terminated.

[00149] At block 1011 , the Rtr sends a source register message for the multicast flow to an RP.

[00150] At block 1012, the Rtr receives a source register stop message for the multicast flow returned by the RP, determines whether an egress port list of the (S,G) entry corresponding to the multicast flow is empty, and performs operations at block 1013 when the list is empty, or performs operations at block 1014 when the list is not empty.

[00151 ] After receiving the source register message for the multicast flow, the RP may first return a PIM join message for the multicast flow to the Rtr when determining there is a receiver of the multicast flow, and sends a source register stop message for the multicast flow to the Rtr. After receiving the PIM join message, the Rtr adds the port from which the message is received into an egress port list of an (S,G) entry corresponding to the multicast flow. The RP may directly return a source register stop message for the multicast flow to the Rtr.

[00152] At block 1013, the Rtr sends a PIM prune message to external devices via the port from which the multicast flow is received, and the process is terminated.

[00153] The upstream neighbor address of the PIM prune message is the

IP address of the multicast source, the destination IP address is the IP address of the multicast source and the destination MAC address is the MAC address of the multicast source.

[00154] Since the PIM prune message is sent from the port via which the multicast flow enters the Rtr, the PIM prune message will reach the one or multiple layer-2 exchanges between the multicast source and the Rtr. The layer-2 exchange may perform the processing procedures shown in Fig. 5 after receiving the PIM prune message.

[00155] At block 1014, the Rtr forwards the multicast flow to external devices according to egress port information in the egress port list.

[00156] When the first hop PIM router adopts bi-directional PIM and is not a DR, the processing procedures of the multicast flow by the first hop PIM router are the same as that of a first hop PIM router that adopts PIM-SM and is not a DR when receiving a multicast flow.

[00157] In addition, the first hop PIM router adopts PIM-SM or bi-directional

PIM, and the first hop PIM router may send a PIM join message in the direction of the multicast source for each (S,G) entry established in the first hop PIM router when the first hop PIM router becomes a DR from a non-DR.

[00158] After the first hop PIM router adopting the PIM-SM receives a PIM prune message from a downstream PIM router or an IGMP leave message from a client connected to the first hop PIM router, the processing procedures of the first hop PIM router are the same with that of a first hop PIM router adopting PIM-SSM, as in the example shown in Fig. 4.

[00159] After the first hop PIM router adopting the PIM-SM receives a PIM join message from a downstream PIM router, the processing procedures of the first hop PIM router are the same as that of a first hop PIM router adopting PIM-SSM, as in the example shown in Fig. 6.

[001 60] After the first hop PIM router adopting the PIM-SM receives an

IGMP join message from a downstream PIM router, the processing procedures of the first hop PIM router are the same as that of a first hop PIM router adopting PIM-SSM, as in the example shown in Fig. 8.

[001 61 ] Fig. 11 is a flowchart illustrating a process performed by a first hop

PIM router adopting PIM-DM after receiving a multicast flow according to an example. As shown in Fig. 11 , the process may include the following operations.

[001 62] At block 1101 , the first hop PIM router (Rtr) periodically sends a

PIM hello message via each PIM port of the first hop PIM.

[001 63] At block 1102, a layer-2 exchange receives the PIM hello message, sets a port from which the message is received as a router port by utilizing IGMP snooping functions, and forwards the PIM hello message via each port of the layer-2 exchange to other layer-2 exchanges.

[001 64] Other layer-2 exchanges may also perform the operations at block

1102 after receiving the PIM hello message.

[001 65] At block 1103, a multicast source sends a multicast flow, and the multicast flow is forwarded to a first hop PIM Rtr via each router port.

[001 66] At block 1104, the Rtr judges whether the Rtr has established an (S,G) entry corresponding to the multicast flow, and performs operations at block 1105 when the entry has been established, or performs operations at block 1106 when the entry has not been established.

[001 67] At block 1105, the Rtr updates an aging time of the (S,G) entry, and operations at block 1107 are performed.

[001 68] At block 1106, the Rtr establishes an (S,G) entry for the multicast flow, sets an aging time for the (S,G) entry, and forwards the multicast flow to all downstream PIM neighbors of the Rtr; after receiving a PIM prune message returned by a downstream PIM neighbor, adds the port from which the PIM prune message is received into an egress port list in the (S,G) entry as a prune port; after receiving a PIM graft message from a downstream PIM neighbor, adds the port from which the PIM graft message is received into an egress port list in the (S,G) entry as a forwarding port. The above operations are performed until all of the ports connected to downstream PIM neighbors are added into the (S,G) entry.

[001 69] The aging time of the (S,G) entry is generally configured as three minutes.

[00170] At block 1107, the Rtr judges whether all egress ports in the (S,G) entry are prune ports, performs operations at block 1108 when all egress ports are prune ports, or performs operations at block 1109 when all egress ports are not prune ports.

[00171 ] At block 1108, the Rtr sends a PIM prune message to external devices via the port from which the multicast flow is received, and the process is terminated.

[00172] The upstream neighbor address of the PIM prune message is the

IP address of the multicast source, the destination IP address is the IP address of the multicast source and the destination MAC address is the MAC address of the multicast source.

[00173] Since the PIM prune message is sent from the port via which the multicast flow enters the Rtr, the PIM prune message will reach the one or multiple layer-2 exchanges between the multicast source and the Rtr. The layer-2 exchange may perform the processing procedures shown in Fig. 5 after receiving the PIM prune message.

[00174] At block 1109, the Rtr forwards the multicast flow via each forwarding egress port in the (S,G) entry.

[00175] Fig. 12 is a flowchart illustrating a process performed by a first hop

PIM router adopting PIM-DM after receiving a PIM graft message from a PIM neighbor according to an example. As shown in Fig. 12, the process may include the following operations.

[00176] At block 1201 , a Rtr receives a PIM graft message for a multicast flow from a PIM neighbor, and searches in the Rtr for an (S,G) entry corresponding to the multicast flow.

[00177] At block 1202, the Rtr judges whether a list of egress ports in the

(S,G) entry is empty, performs operations at block 1203 when the list is empty, or performs operations at block 1204 when the list is not empty.

[00178] At block 1203, the Rtr adds the port from which the PIM graft message is received into an egress port list of the (S,G) entry, searches in a unicast routing table for an entry corresponding to the destination IP address of the message, sends a PIM join message through an egress port in the unicast routing table entry, and the process is terminated.

[00179] The destination IP address of the PIM join message is the IP address of the multicast source and the destination MAC address is the MAC address of the multicast source. The PIM join message may be forwarded to the multicast source through layer-2 exchanges between the Rtr and the multicast source. The processing procedures of the PIM join message by a layer-2 exchange may be as shown in Fig. 9.

[00180] To avoid PIM join message loss and to receive the multicast flow quickly, the Rtr may send the PIM join message at a high frequency until the multicast flow is received. [00181 ] At block 1204, the Rtr processes the PIM graft message according to a current PIM protocol.

[00182] After the first hop PIM router adopting the PIM-DM receives a PIM prune message from a downstream PIM router or an IGMP leave message from a client connected to the first hop PIM router, the processing procedures of the first hop PIM router are the same as those of a first hop PIM router adopting PIM-SSM, as in the example shown in Fig. 4.

[00183] After the first hop PIM router adopting the PIM-DM receives an

IGMP join message from a downstream PIM router, the processing procedures of the first hop PIM router are the same as those of a first hop PIM router adopting PIM-SSM, as in the example shown in Fig. 8.

[00184] Fig. 13 is a schematic illustrating a structure of a PIM router provided by an example. The PIM router is a first hop PIM router, is connected to a multicast source via a layer-2 exchange having PIM snooping functions. As shown in Fig. 13, the PIM router may include: a first module and a second module.

[00185] The first module is to receive a multicast flow initiated from the multicast source, to delete the port from which a PIM prune message or a multicast group leave message is received from an egress port list of the multicast flow after receiving the PIM prune message from a downstream PIM router for the multicast flow or after receiving the multicast group leave message from a client connected to the PIM router, to determine whether the multicast flow is to be received, and to send a prune indication to the second module in response to a determination that the multicast flow is not to be received.

[00186] The multicast group leave message is an IGMP leave message or an MLD leave message.

[00187] The second module is to receive the prune indication, and to send a PIM prune message via the port from which the multicast flow is received.

[00188] When the PIM router adopts PIM-SSM, or is not a DR and adopts

PIM-SM, the fist module may include the following sub modules. [00189] A first sub module is to receive the multicast flow and send information of the multicast flow to a second sub module.

[00190] The second sub module is to receive the information of the multicast flow from the first sub module, to determine that the multicast flow is not to be received and to send the prune indication to the second module when a determination that a multicast routing table entry has not been established for the multicast flow in the PIM router is made or when a determination that a multicast routing table entry has been established for the multicast flow but an egress port list of the multicast routing table entry is empty is made.

[00191 ] When the PIM router adopts PIM-SM and is DR, the first module may include the following sub modules.

[00192] A first sub module is to receive the multicast flow and send information of the multicast flow to a second sub module.

[00193] The second sub module is to receive the information of the multicast flow from the first sub module, to determine that the multicast flow is not to be received and to send the prune indication to the second module when a determination that a multicast routing table entry has been established for the multicast flow but an egress port list of the multicast routing table entry is empty is made; or to establish a multicast routing table entry for the multicast flow and to send a source register message to an RP when a determination that a multicast routing table entry has not been established for the multicast flow is made, to determine that the multicast flow is not to be received and to send the prune indication to the second module after receiving a source register stop message from the RP and determining that an egress port list of the multicast routing table entry is empty.

[00194] When the PIM router adopts PIM-DM, the first module may include the following sub modules.

[00195] A first sub module is to receive the multicast flow and send information of the multicast flow to a second sub module. [00196] The second sub module is to receive the information of the multicast flow from the first sub module, to determine that the multicast flow is not to be received and to send the prune indication to the second module when determining a multicast routing table entry has been established for the multicast flow but all egress ports in the multicast routing table entry are prune ports; or to establish a multicast routing table entry for the multicast flow and to forward the multicast flow to all downstream PIM neighbors when a determination that a multicast routing table entry has not been established for the multicast flow is made; to receive a PIM prune message from a downstream PIM neighbor and to add the port from which the PIM graft message is received into an egress port list of the multicast routing table entry as a prune port; to receive a PIM graft message from a downstream PIM neighbor and to add the port from which the PIM graft message is received into an egress port list of the multicast routing table entry as a forwarding port; to determine that the multicast flow is not to be received and to send the prune indication to the second module after determining that all ports connected to the downstream PIM neighbors have been added into the egress port list of the multicast routing table list and that all egress ports in the multicast routing table entry are prune ports.

[00197] In practice, when the PIM router adopts PIM-SM or PIM-SSM, the first module may also include: a third module, to receive a PIM join message for the multicast flow from a downstream PIM router or a multicast group join message from a client connected to the PIM router, and to send a PIM join message in the direction of the multicast source.

[00198] The third module is further to determine whether a multicast routing table entry corresponding to the multicast flow has been established in the PIM router after receiving a PIM join message for the multicast flow from a downstream PIM router, to add the port from which the PIM join message is received into an egress port list of the multicast routing table entry and to send a PIM join message in the direction of the multicast source when a determination that the egress port list of the multicast routing table entry is empty is made.

[00199] In practice, when the PIM router adopts PIM-SM or PIM-SSM or PIM-DM, the PIM router may also include: a fourth module, to receive a multicast group join message for the multicast flow from a client connected to the PIM router, and to send a PIM join message in the direction of the multicast source.

[00200] The fourth module is further to determine whether a multicast routing table entry corresponding to the multicast flow has been established in the PIM router after receiving a multicast group join message for the multicast flow from a client connected to the PIM router, to add the port from which the multicast group join message is received into an egress port list of the multicast routing table entry and to send a PIM join message in the direction of the multicast source when a determination that the multicast routing table entry has been established and the egress port list of the multicast routing table entry is empty is made.

[00201 ] When the PIM router adopts PIM-SM and is not a DR, or adopts bi-directional PIM and is not a DR, the PIM router may also include: a fifth module, to send, for a multicast routing table entry established for each multicast flow, a PIM join message for the multicast flow in the direction of the multicast source when the PIM router was not a DR and becomes a DR.

[00202] When the PIM router adopts PIM-DM, the PIM router may also include: a sixth module, to receive a PIM graft message for the multicast flow from a downstream PIM neighbor, and to send a PIM join message in the direction of the multicast source.

[00203] The sixth module is further to judge whether a multicast routing table entry corresponding to the multicast flow has been established in the PIM router after receiving a PIM graft message for the multicast flow from a downstream PIM neighbor, to add the port from which the PIM graft message is received into an egress port list of the multicast routing table entry and to send a PIM join message in the direction of the multicast source when determining the multicast routing table entry has been established and the egress port list of the multicast routing table entry is empty.

[00204] The following is a description of a structure of a exchange with

PIM snooping functions according to an example. The exchange is deployed between a multicast source and a first hop PIM router. The exchange may mainly include a first module, a second module and a third module.

[00205] The first module is to receive a PIM prune message for a multicast flow, to add a port from which the PIM prune message is received into a PIM snooping entry corresponding to the multicast flow as a prune port and to stop forwarding the multicast via the prune port when a determination that the upstream neighbor address in the message is not in a list of PIM routers which are maintained by PIM snooping functions of the exchange is made.

[00206] The first module may further set a prune time for a prune port, and begin forwarding the multicast flow via the prune port when the prune time expires.

[00207] The first module may further set a lifetime value that is smaller than the lifetime value of the multicast routing table entry of the multicast flow corresponding to the PIM prune message in the first hop PIM router; set the prune port as a temporary router port when the lifetime value of the prune port expires, and set the temporary router port as a router port if a PIM prune message for the multicast flow is not received within a pre-defined period of time, or set the temporary router port as a prune port and reset the lifetime value of the prune port if a PIM prune message for the multicast flow is received.

[00208] After determining the upstream neighbor address in the PIM prune message is not in the list of PIM routers that are maintained using the PIM snooping functions of the exchange, the first module may further establish a PIM snooping entry for the multicast flow when determining a PIM snooping entry has not been established for the multicast flow in the exchange, set an empty list as an upstream neighbor list of the PIM snooping entry, add all PIM neighbor ports except upstream ports of the exchange into an egress port list in the PIM snooping entry, add the prune port into the PIM snooping entry of the multicast flow; determine whether the multicast flow is to be forwarded based on PIM snooping entries and multicast group management entries in the exchange, and not forwarding the PIM prune message if the multicast flow is to be forwarded, or forwarding the PIM prune message in the direction of the multicast source if the multicast flow is not to be forwarded. [00209] After determining the upstream neighbor address in the message is not in the list of PIM routers maintained by the PIM snooping functions, the first module may directly add the prune port into the PIM snooping entry of the multicast flow when determining the PIM snooping entry has been established for the multicast flow; determine whether the multicast flow is to be forwarded based on PIM snooping entries and multicast group management entries in the exchange, and not forwarding the PIM prune message if the multicast flow is to be forwarded, or forwarding the PIM prune message in the direction of the multicast source if the multicast flow is not to be forwarded.

[00210] When the layer-2 exchange adopts IGMP, the multicast group snooping entry is an IGMP snooping entry. When the layer-2 exchange adopts MLD, the multicast group snooping entry is an MLD snooping entry.

[0021 1 ] The second module is to receive a PIM join message for a multicast flow. When a determination that the upstream neighbor address in the message is not in a list of PIM routers that are maintained by PIM snooping functions of the exchange is made, a determination is made as to whether there is another port other than the port from which the PIM join message is received is to receive the multicast flow based on PIM snooping entries and multicast group management snooping entries in the exchange when a determination is made that there is a PIM snooping entry for the multicast flow corresponding to the PIM join message in the exchange and the port receiving the PIM join message is a prune port in the PIM snooping entry, the PIM join message is not forwarded when there is another port requiring receipt of the multicast flow, or the PIM join message is forwarded in the direction of the multicast source if there is no other port requiring receipt of the multicast flow.

[00212] The second module may further delete the port receiving the PIM join message from the PIM snooping entry after forwarding the PIM join message in the direction of the multicast source, and set the port as a router port.

[00213] The third module is to receive a multicast group management join message for a multicast flow, add the port receiving the message into a multicast group management entry of the multicast flow as a membership port, and forward the multicast group management join message via all router ports, prune ports and upstream neighbors in the PIM snooping entry except the port from which the message is received.

[00214] The multicast group management join message may be an IGMP join message or an MLD join message.

[00215] The example methods, systems and modules disclosed herein may be implemented by hardware, machine-readable instructions or a combination of hardware and machine-readable instructions. Machine-readable instructions used in the examples disclosed herein may be stored in storage medium readable by one or more processors, such as hard drive, CD-ROM, DVD, compact disk, floppy disk, magnetic tape drive, RAM, ROM or other proper storage device. Or, at least part of the machine-readable instructions may be substituted by specific-purpose hardware, such as custom integrated circuits, gate array, FPGA, PLD and specific-purpose computers and so on. For example, Fig. 14 is a schematic diagram illustrating a structure of a PIM router provided by another example. The PIM router is a first hop PIM router, and may be connected to a multicast source via a layer-2 exchange having PIM snooping functions. As shown in Fig. 14, the PIM router may include: a first module, a second module, and a processor. The first module and the second module may be stored in storage medium readable by the processor to cause the processor to perform similar functions as the first module and the second module shown in Fig. 13.

[0021 6] A machine-readable storage medium is also provided, which is to store instructions to cause a machine to execute a control method as disclosed herein. Specifically, a system or apparatus having a storage medium which stores machine-readable instructions which may be read and executed by one or more processors (e.g. a CPU or MPU etc) of the system or apparatus to implement the methods and functions described in the above examples.

[00217] In this situation, the machine readable instructions (e.g. program codes) read from the storage medium may implement any one of the above examples, thus the machine readable instructions and the storage medium storing the machine readable instructions are part of the technical scheme. [00218] The storage medium for providing the machine readable instructions may include a floppy disk, hard drive, magneto-optical disk, compact disk (such as CD-ROM, CD-R, CD-RW, DVD-ROM, DVD-RAM, DVD-RW, DVD+RW), magnetic tape drive, Flash card, ROM and so on. Optionally, the machine readable instructions may be downloaded from a server computer via a communication network.

[00219] It should be noted that, alternatively to the machine readable instructions being executed by a computer, at least part of the operations performed by the machine readable instructions may be implemented by an operation system running in a computer following instructions based on the machine readable instructions to realize the technical scheme of any of the above examples.

[00220] In addition, the machine readable instructions implemented from a storage medium may be written in a storage in an extension board inserted in the computer or in a storage in an extension unit connected to the computer. In this example, a CPU in the extension board or the extension unit executes at least part of the operations according to the instructions based on the machine readable instructions to realize the technical scheme of any of the above examples.

[00221 ] The foregoing are only examples of the present disclosure and are not for use in limiting the protection of scope thereof. All modifications, equivalent replacements or improvements in accordance with the spirit and principles of the present disclosure shall be included in the protection scope of the present disclosure.