CN110149276B - Multicast forwarding method and device - Google Patents

Multicast forwarding method and device Download PDF

Info

Publication number
CN110149276B
CN110149276B CN201910464842.5A CN201910464842A CN110149276B CN 110149276 B CN110149276 B CN 110149276B CN 201910464842 A CN201910464842 A CN 201910464842A CN 110149276 B CN110149276 B CN 110149276B
Authority
CN
China
Prior art keywords
multicast
unicast
interface
route
forwarding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201910464842.5A
Other languages
Chinese (zh)
Other versions
CN110149276A (en
Inventor
王蓓蕾
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
New H3C Information Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201910464842.5A priority Critical patent/CN110149276B/en
Publication of CN110149276A publication Critical patent/CN110149276A/en
Application granted granted Critical
Publication of CN110149276B publication Critical patent/CN110149276B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/16Multipoint routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/54Organization of routing tables
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The disclosure provides a multicast message forwarding method and device. In the present disclosure, when performing RPF check on a received multicast packet, if the number of the optimal unicast routes reaching a source IP address of the multicast packet is found in a local unicast route table to be greater than 1 and equivalent to each other, a unicast route with a multicast flag set therein is selected from the found unicast routes, which ensures that an egress interface of the finally selected unicast route enables a multicast protocol, thereby ensuring normal establishment of a multicast forwarding entry and also ensuring normal forwarding of the multicast packet.

Description

Multicast forwarding method and device
Technical Field
The present disclosure relates to network communication technologies, and in particular, to a multicast forwarding method and apparatus.
Background
After receiving a Multicast (Multicast) message, the network device first performs Reverse Path Forwarding (RPF) check on the Multicast message, and only if the RPF check passes, the network device continues to forward the received Multicast message.
Specifically, the network device performing the RPF check mainly includes: searching an optimal unicast route reaching a source IP address of the multicast message in a unicast route table, wherein an output interface of the unicast route is an RPF interface, if the multicast message is received from the RPF interface, the RPF passes the check, and the multicast message is continuously forwarded; otherwise, discarding the multicast message.
Through the RPF, the multicast message can be ensured to be correctly forwarded according to the configuration of the multicast route, and a forwarding loop which may appear can be avoided.
Disclosure of Invention
The present disclosure provides a method and an apparatus for forwarding a multicast packet, so as to ensure normal forwarding of the multicast packet.
The technical scheme provided by the disclosure comprises:
a multicast message forwarding method is applied to network equipment and comprises the following steps:
setting a multicast mark for a unicast route meeting the condition in a local unicast routing table, wherein the condition means that an output interface of the unicast route is an interface which enables a multicast protocol locally;
receiving a multicast message, if a multicast routing table entry for forwarding the multicast message does not exist locally, searching an optimal unicast route reaching a source IP address of the multicast message in a local unicast routing table, if the number of the searched unicast routes is greater than 1 and is equivalent to each other, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast routes with the multicast mark exist, checking whether an output interface of the selected unicast route is consistent with an interface for receiving the multicast message, if so, establishing a multicast forwarding table entry for forwarding the multicast message and forwarding the multicast message according to the established multicast forwarding table entry.
A multicast message forwarding device applied to a network device, comprising:
a marking unit, configured to set a multicast mark for a unicast route that meets a condition in a local unicast routing table, where the condition indicates that an outgoing interface of the unicast route is an interface that locally enables a multicast protocol;
a receiving unit, configured to receive a multicast packet;
and the processing unit is used for searching an optimal unicast route reaching the source IP address of the multicast message in a local unicast route table when a multicast route entry for forwarding the multicast message does not exist locally, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast routes with the multicast mark are found if the number of the searched unicast routes is more than 1 and is equivalent to each other, checking whether an outlet interface of the selected unicast route is consistent with an interface receiving the multicast message, and if so, establishing a multicast forwarding entry for forwarding the multicast message and forwarding the multicast message according to the established multicast forwarding entry.
A network device, the network device comprising: a memory, a processor;
the memory for storing machine executable instructions;
the processor is configured to read and execute the machine executable instructions stored in the memory, so as to implement the multicast packet forwarding method described above.
A meter-readable storage medium having stored therein machine-executable instructions for reading and execution by a processor to implement a multicast packet forwarding method as described above.
According to the technical scheme, in the disclosure, when the network device performs the RPF check on the received multicast packet, if the number of the optimal unicast routes reaching the source IP address of the multicast packet is found in the local unicast route table to be greater than 1 and equivalent to each other, a unicast route with a multicast flag is selected from the found unicast routes, which ensures that the outlet interface of the finally selected unicast route enables the multicast protocol, thereby ensuring the normal establishment of the multicast forwarding table entry and also ensuring the normal forwarding of the multicast packet.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a schematic diagram of multicast packet networking provided by the present disclosure;
fig. 2 is a flow chart of multicast packet forwarding provided by the present disclosure;
fig. 3 is another flow chart of multicast packet forwarding provided by the present disclosure;
fig. 4 is a schematic diagram of networking provided in this embodiment;
FIG. 5 is a schematic view of the apparatus structure provided by the present disclosure;
fig. 6 is a schematic hardware structure diagram of the apparatus shown in fig. 5 provided by the present disclosure.
Detailed Description
In the RPF checking process, the network device searches the unicast routing table for the optimal unicast routing of the source IP address reaching the multicast message to determine the RPF interface. In a specific implementation, there are multiple and equivalent optimal unicast routes that are often found in the unicast routing table and used for searching for a source IP address reaching a multicast packet. For example, as shown in fig. 1, Router2 receives a multicast packet from a multicast Source (Source), where a Source IP address of the multicast packet is an IP address of the Source, Router2 finds, by looking up a unicast routing table, that there are three optimal unicast routes reaching the Source, which are respectively denoted as Link1, Link2, Link3, Link1, Link2, and Link3, and in this case, the network device selects one unicast route from Link, Link2, and Link3 according to an existing route preference principle (e.g., a hash algorithm), and determines an output interface of the selected unicast route as an RPF interface.
In a specific implementation, the multicast protocols are not all deployed on the outgoing interfaces of the unicast routes in the unicast route table, if the multicast protocols are not deployed on the outgoing interfaces of Link2 and Link3 shown in fig. 1, at this time, as described above, if Router1 selects Link2 or Link3, then, on the premise that the multicast protocols are not deployed on the outgoing interfaces of Link2 and Link3, the outgoing interfaces of Link2 and Link3 are not capable of sending and receiving multicast messages, and once Router2 selects Link2 or Link3 as an RPF interface, it means that any multicast message received by Router1 from the Source will not pass RPF check, which may result in failure in forwarding of the multicast message.
In order to ensure normal forwarding of multicast packets when multiple equivalent unicast routes are deployed between network devices and when output interfaces of the multiple equivalent unicast routes do not all deploy a multicast protocol, the present disclosure provides a method flow as shown in fig. 2.
Referring to fig. 2, fig. 2 is a flowchart of multicast packet forwarding provided by the present disclosure. The flow is applied to a network device. As one embodiment, a network device in the present disclosure may be a router.
As shown in fig. 2, the process may include the following steps:
step 201, setting a multicast flag for the unicast route meeting the condition in the local unicast routing table, where the condition means that the outgoing interface of the unicast route is an interface that locally enables a multicast protocol.
For one embodiment, the setting the multicast flag for the unicast route satisfying the condition in the local unicast routing table in step 201 may include:
and aiming at each interface which locally enables a multicast protocol, detecting whether the equipment establishes a multicast neighbor with opposite-end equipment through the interface, if so, searching a unicast route of which the interface is the interface from a local unicast route table, and setting a multicast mark for the searched unicast route.
In one example, the unicast routing table is created before the flow shown in fig. 2 is executed, and may include statically configured unicast routes and also include unicast routes dynamically created according to a packet.
Step 202, receiving the multicast packet, and if there is no multicast routing entry for forwarding the multicast packet locally, executing step 203.
Step 203, searching the optimal unicast route reaching the source IP address of the multicast message in the local unicast route table, if the number of the searched unicast routes is greater than 1 and equivalent, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast route with the multicast mark is present in the searched unicast routes, checking whether an output interface of the selected unicast route is consistent with an interface receiving the multicast message, and if so, executing step 204.
Step 203 is a specific process of performing RPF check on the received multicast packet. As can be seen from step 203, when performing the RPF check, if the number of the optimal unicast routes reaching the source IP address of the multicast packet is found in the local unicast route table to be greater than 1 and equal to each other, a unicast route with a multicast flag is selected from the found unicast routes, which ensures that the egress interface of the finally selected unicast route enables a multicast protocol, thereby ensuring normal establishment of a multicast forwarding table entry and normal forwarding of the multicast packet.
It should be noted that, in step 203, if it is detected that the output interface of the selected unicast route is inconsistent with the interface receiving the multicast packet, the received multicast packet may be directly discarded.
Step 204, establishing a multicast forwarding table for forwarding the multicast message and forwarding the multicast message according to the established multicast forwarding table.
In step 204, the method of establishing the multicast forwarding table entry for forwarding the multicast packet is similar to the existing method of establishing the multicast forwarding table entry, and the structure thereof is also similar to the structure of the existing multicast forwarding table entry, except that in the present application, it is required to ensure that the output interface in the established multicast forwarding table entry is an interface enabling the multicast protocol.
In this step 204, the established multicast forwarding entry for forwarding the multicast packet includes, in addition to the outgoing interface, a multicast source IP address, a multicast group address, and an incoming interface. Here, the multicast source IP address is a source IP address of the multicast packet, the multicast group address is a multicast group address carried in the multicast packet, and the ingress interface is an interface that receives the multicast packet (also an egress interface of the unicast route selected in step 203).
To this end, the flow shown in FIG. 2 is completed
As can be seen from the flow shown in fig. 2, in the present disclosure, when performing RPF check on a received multicast packet, if the number of the optimal unicast routes reaching the source IP address of the multicast packet is found in the local unicast route table to be greater than 1 and equivalent to each other, a unicast route with a multicast flag set is selected from the found unicast routes, which ensures that the egress interface of the finally selected unicast route enables a multicast protocol, thereby ensuring normal establishment of a multicast forwarding entry and also ensuring normal forwarding of the multicast packet.
The above-mentioned steps 202 to 204 are described by taking as an example that there is no multicast routing entry for forwarding the multicast packet locally. In an example, if a multicast routing entry for forwarding a multicast packet exists locally, based on the above description about the multicast routing entry, reference may be made to steps 302 to 304 of the flow shown in fig. 3:
referring to fig. 3, fig. 3 is another multicast packet forwarding flowchart provided by the present disclosure. The process is described by taking a multicast routing table entry locally existing for forwarding the received multicast packet as an example. As shown in fig. 3, the process includes:
step 301 is similar to step 201 and will not be described again.
Step 302, receiving the multicast message, and if a multicast routing table entry for forwarding the multicast message exists locally, executing step 303.
Step 303, checking whether an incoming interface in the multicast routing table entry is consistent with an interface receiving the multicast message, if so, forwarding the multicast message according to the multicast routing table entry, and if not, executing step 304.
Step 304, finding the optimal unicast route reaching the source IP address of the multicast message in the local unicast route table, if the number of the found unicast routes is larger than 1 and equal, selecting a unicast route with a multicast mark from the found unicast routes when the unicast routes with the multicast mark are present, checking whether the output interface of the selected unicast route is consistent with the input interface in the multicast route entry, if so, discarding the multicast message, if not, updating the input interface in the multicast route entry to the output interface of the selected unicast route, and when the output interface of the selected unicast route is consistent with the interface receiving the multicast message, forwarding the multicast message according to the multicast route entry, and when the output interface of the selected unicast route is inconsistent with the interface receiving the multicast message, and discarding the multicast message.
Step 304 is an RPF check performed when it is checked that the incoming interface in the multicast routing table entry is inconsistent with the interface receiving the multicast packet. Here, step 304 is executed to verify whether the existing multicast routing table entry for forwarding the multicast packet is correct, wherein in step 304, when it is detected that the outgoing interface of the selected unicast route is consistent with the incoming interface in the multicast routing table entry, it indicates that the multicast routing table entry is correct, at this time, the multicast packet may be directly discarded, and when it is detected that the outgoing interface of the selected unicast route is not consistent with the incoming interface in the multicast routing table entry, it indicates that the incoming interface of the multicast routing table entry is abnormal (at this time, the multicast routing table entry may be considered as incorrect), at this time, the incoming interface in the multicast routing table entry may be updated to the outgoing interface of the selected unicast route, and then, when the outgoing interface of the selected unicast route is consistent with the interface receiving the multicast packet, the multicast packet is forwarded according to the multicast routing table entry, and when the output interface of the selected unicast route is inconsistent with the interface receiving the multicast message, discarding the multicast message.
The flow shown in fig. 3 is completed.
As can be seen from the process shown in fig. 3, in the present application, when it is detected that an interface receiving a multicast packet is inconsistent with an ingress interface in a multicast routing table entry for forwarding the multicast packet, a network device searches in a local unicast routing table that the number of optimal unicast routes reaching a source IP address of the multicast packet is greater than 1 and is equivalent to each other, selects a unicast route with a multicast flag from the found unicast routes, which ensures that an egress interface of a finally selected unicast route enables a multicast protocol, and then compares the egress interface of the selected unicast route with the ingress interface in the multicast routing table entry, and adaptively processes the multicast packet according to a comparison result, which ensures normal forwarding of the multicast packet.
As an embodiment, in step 203 or step 304, if the number N of unicast routes with multicast flags set in the found unicast routes is greater than 1, selecting one unicast route with multicast flags set in the unicast routes found in step 203 or step 304 includes: and selecting one unicast route from the N unicast routes with the multicast marks according to a set route selection principle. In an example, the routing principle may be random selection, or an existing routing optimization principle, such as optimization of interface IP address, is maximum, and the embodiment is not limited in particular.
It should be noted that, in this embodiment, the interface does not always enable the multicast protocol, and may also delete the multicast protocol deployed by the interface according to actual needs, and when detecting that the multicast protocol deployed by the interface is deleted, find out the unicast route whose interface is the interface from the unicast route table, and delete the multicast flag set by the found unicast route.
The flow shown in fig. 2 or fig. 3 is described below by a specific embodiment:
referring to fig. 4, fig. 4 is a schematic networking diagram provided in this embodiment. Using Router401 in fig. 4 as an example, Router402 is similar:
if Router401 local interfaces Port41_1 and Port41_2 enable Multicast protocols, the embodiment takes a Multicast Protocol as Protocol Independent Multicast (PIM) as an example.
Router401 detects that local interface Port41_1 and Port42_1 on Router402 establish a PIM neighbor, finds the unicast route whose interface is Port41_1 in the local unicast route table, and sets a multicast flag for the found unicast route.
Similarly, Router401 detects that local interface Port41_2 establishes a PIM neighbor with Port42_2 on Router402, searches for a unicast route whose interface is Port41_2 in the local unicast routing table, and sets a multicast flag for the found unicast route.
Router401 local interface Port41_3 does not enable the multicast protocol.
Router401 receives the multicast packet sent from multicast Source400 through local interface Port41_ 1. Here, for convenience of description, the multicast message is denoted as multicast message M1.
The Router401 checks that there is no multicast routing entry for forwarding the multicast message M1 locally, then finds the optimal unicast route to the Source IP address (corresponding to the multicast Source400) of the multicast message M1 in the local unicast routing table, and as a result finds the following three unicast routes: l1, L2, L3. The output interface of L1 is Port41_1, the output interface of L2 is Port41_2, and the output interface of L3 is Port41_ 3.
When the Router401 finds that the three unicast routes L1, L2, and L3 are equivalent, it finds the unicast route with the multicast flag set in the three found unicast routes, and finds that both L1 and L2 set the multicast flag, the Router401 continues to find a unicast route from the two unicast routes with the multicast flag set in L1 and L2 according to the route preference principle, if the selected unicast route is L1.
The Router401 checks that the outgoing interface Port41_1 of the L1 is consistent with the interface Port41_1 that receives the multicast packet M1, and then establishes a multicast forwarding table entry (denoted as table entry 01) for forwarding the multicast packet M1. Here, the entry 01's incoming interface is Port41_ 1. In this embodiment, the structure of entry 01 is similar to that of the existing multicast forwarding entry, and further includes: the Source IP address (IP address of multicast Source400) and the multicast group address carried in the multicast message M1, and the outgoing interface for forwarding the multicast message M1. Here, the outgoing interface may be determined according to the existing interface determining manner, but in this embodiment, it is only necessary to be an interface enabling a multicast protocol such as PIM, and fig. 4 exemplifies the outgoing interfaces as Port41_ R1 and Port41_ R2.
Router401 forwards the multicast message M1 through two egress interfaces Port41_ R1 and Port41_ R2 of entry 01.
In specific implementation, when PIM deployed by Port41_1 is deleted according to actual needs, in this case, Router401 detects that PIM deployed before Port41_1 is deleted, and accordingly, PIM neighbor Down between Port41_1 and the opposite end, that is, Port42_1 on Router401, Router401 finds out a unicast route whose interface is Port41_1 in the local unicast routing table, and deletes the multicast flag set for the found unicast route before. At this time, the update operation may not be performed on the multicast forwarding entry whose previously established ingress interface is Port41_1, but the aging time of the multicast forwarding entry may be waited.
Thereafter, Router401 receives the multicast packet sent from multicast Source400 through local interface Port41_ 2. Here, for convenience of description, the multicast message is denoted as multicast message M2.
Router401 finds that there is locally a multicast routing entry for forwarding multicast message M2, i.e. entry 01 described above.
When the Router401 finds that the ingress interface Port41_1 of the entry 01 is inconsistent with the interface Port41_2 of the received multicast packet M2, it searches the local unicast routing table for the optimal unicast route to the Source IP address (corresponding to the multicast Source400) of the multicast packet M2, and as a result, finds the following three unicast routes: l1, L2, L3. The output interface of L1 is Port41_1, the output interface of L2 is Port41_2, and the output interface of L3 is Port41_ 3.
If Router401 finds that the three unicast routes L1, L2, and L3 are equivalent, it searches for the unicast route with the multicast flag set therein from the three found unicast routes, and if only L2 sets the multicast flag, Router401 selects unicast route L2 with the multicast flag set therein. Router401 compares the outgoing interface of L2 with the incoming interface Port41_1 of entry 01, considers that entry 01 needs to be updated, and updates the incoming interface of entry 01 from Port41_1 to Port41_ 2.
The Router401 checks that the updated entry 01's ingress interface Port41_2 is consistent with the interface Port41_2 that received the multicast packet M2, and forwards the multicast packet M2 through the two egress interface ports 41_ R1 and Port41_ R2 of the entry 01.
Thus, the description of the embodiments is completed.
It can be seen from the above embodiments that, when performing RPF check on a received multicast packet, if the number of the optimal unicast routes reaching the source IP address of the multicast packet is found in the local unicast route table to be greater than 1 and equivalent to each other, a unicast route with a multicast flag set therein is selected from the found unicast routes, which ensures that the egress interface of the finally selected unicast route enables a multicast protocol, thereby ensuring normal establishment of a multicast forwarding entry and normal forwarding of the multicast packet.
The methods provided herein are described above. The following describes the apparatus provided in the present application:
referring to fig. 5, fig. 5 is a block diagram of an apparatus provided in the present disclosure. As shown in fig. 5, the apparatus is applied to a network device, and includes:
a marking unit, configured to set a multicast mark for a unicast route that meets a condition in a local unicast routing table, where the condition indicates that an outgoing interface of the unicast route is an interface that locally enables a multicast protocol;
a receiving unit, configured to receive a multicast packet;
and the processing unit is used for searching an optimal unicast route reaching the source IP address of the multicast message in a local unicast route table when a multicast route entry for forwarding the multicast message does not exist locally, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast routes with the multicast mark are found if the number of the searched unicast routes is more than 1 and is equivalent to each other, checking whether an outlet interface of the selected unicast route is consistent with an interface receiving the multicast message, and if so, establishing a multicast forwarding entry for forwarding the multicast message and forwarding the multicast message according to the established multicast forwarding entry.
In one example, the marking unit sets the multicast mark for the unicast route meeting the condition in the local unicast routing table includes:
and aiming at each interface which locally enables a multicast protocol, detecting whether the equipment establishes a multicast neighbor with opposite-end equipment through the interface, if so, searching a unicast route of which the interface is the interface from a local unicast route table, and setting a multicast mark for the searched unicast route.
In one example, the multicast forwarding entry at least includes: an ingress interface, which is an egress interface of the selected unicast route;
when a multicast routing table entry for forwarding the multicast message exists locally, the processing unit further checks whether an incoming interface in the multicast routing table entry is consistent with an interface for receiving the multicast message,
if yes, forwarding the multicast message according to the multicast routing table item;
if not, searching the optimal unicast route reaching the source IP address of the multicast message in a local unicast route table, if the number of the searched unicast routes is larger than 1 and is equivalent, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast routes with the multicast mark exist, checking whether an outlet interface of the selected unicast route is consistent with an inlet interface in a multicast route table item, if so, discarding the multicast message, if not, updating the inlet interface in the multicast route table item to be the interface receiving the multicast message when the outlet interface of the selected unicast route is consistent with the interface receiving the multicast message, and forwarding the multicast message according to the multicast route table item, otherwise, discarding the multicast message.
In one example, the selecting, by the processing unit, a unicast route with a set multicast flag from the found unicast routes includes:
and if the number N of the unicast routes with the multicast marks in the searched unicast routes is more than 1, selecting one unicast route from the N unicast routes with the multicast marks according to a set route selection principle.
In one example, the processing unit further finds a unicast route of the interface for the interface from the unicast route table when detecting that the multicast protocol deployed by the interface is deleted, and deletes the multicast flag set by the found unicast route.
Thus, the description of the structure of the apparatus shown in fig. 5 is completed.
Correspondingly, the present disclosure also provides a hardware structure diagram of the apparatus shown in fig. 5. Referring to fig. 6, fig. 6 is a hardware structure diagram of the apparatus shown in fig. 5 according to the present disclosure. As shown in fig. 6, the hardware structure includes:
a communication interface 601, a processor 602, a machine-readable storage medium 603, and a bus 604; wherein the communication interface 601, the processor 602, and the machine-readable storage medium 603 communicate with each other via a bus 604. The processor 602 reads and executes the machine-executable instructions in the machine-readable storage medium 603.
Among other things, the machine-executable instructions in the machine-readable storage medium 603 may be instructions corresponding to the process illustrated in fig. 2. As such, the processor 602 reads and executes the machine executable instructions in the machine readable storage medium 603 to implement the multicast packet forwarding method provided by the present disclosure.
The machine-readable storage medium 603 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: volatile memory, non-volatile memory, or similar storage media. In particular, the machine-readable storage medium 603 may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., a compact disk, a DVD, etc.), or similar storage medium, or a combination thereof.
The above description is only exemplary of the present disclosure and should not be taken as limiting the disclosure, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present disclosure should be included in the scope of the present disclosure.

Claims (9)

1. A multicast message forwarding method is applied to network equipment and comprises the following steps:
setting a multicast mark for a unicast route meeting conditions in a local unicast routing table, wherein the conditions mean that an output interface of the unicast route is an interface which locally enables a multicast protocol and establishes a multicast neighbor with opposite terminal equipment;
receiving a multicast message, if a multicast routing table entry for forwarding the multicast message does not exist locally, searching an optimal unicast route reaching a source IP address of the multicast message in a local unicast routing table, if the number of the searched unicast routes is greater than 1 and is equivalent to each other, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast routes with the multicast mark exist, checking whether an output interface of the selected unicast route is consistent with an interface for receiving the multicast message, if so, establishing a multicast forwarding table entry for forwarding the multicast message and forwarding the multicast message according to the established multicast forwarding table entry.
2. The method of claim 1, wherein the multicast forwarding entry comprises at least: an ingress interface, which is an egress interface of the selected unicast route;
if a multicast routing table entry for forwarding the multicast packet locally exists, the method further includes:
checking whether the incoming interface in the multicast routing table entry is consistent with the interface receiving the multicast message,
if yes, forwarding the multicast message according to the multicast routing table item;
if not, searching the optimal unicast route reaching the source IP address of the multicast message in a local unicast route table, if the number of the searched unicast routes is larger than 1 and is equivalent, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast routes with the multicast mark exist, checking whether an outlet interface of the selected unicast route is consistent with an inlet interface in a multicast route table item, if so, discarding the multicast message, if not, updating the inlet interface in the multicast route table item to be the interface receiving the multicast message when the outlet interface of the selected unicast route is consistent with the interface receiving the multicast message, and forwarding the multicast message according to the multicast route table item, otherwise, discarding the multicast message.
3. The method according to claim 1 or 2, wherein the selecting a unicast route with a set multicast flag from the found unicast routes comprises:
and if the number N of the found unicast routes with the multicast marks is more than 1, selecting one unicast route from the N unicast routes with the multicast marks according to a set route selection principle.
4. The method of claim 1, further comprising:
when detecting that the multicast protocol deployed by the interface is deleted, finding out the unicast route of which the interface is the interface from the unicast route table, and deleting the multicast mark set by the found unicast route.
5. A multicast message forwarding apparatus, applied to a network device, comprising:
a marking unit, configured to set a multicast mark for a unicast route that meets a condition in a local unicast routing table, where the condition indicates that an outgoing interface of the unicast route is an interface that locally enables a multicast protocol and establishes a multicast neighbor with an opposite device;
a receiving unit, configured to receive a multicast packet;
and the processing unit is used for searching an optimal unicast route reaching the source IP address of the multicast message in a local unicast route table when a multicast route entry for forwarding the multicast message does not exist locally, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast routes with the multicast mark are found if the number of the searched unicast routes is more than 1 and is equivalent to each other, checking whether an outlet interface of the selected unicast route is consistent with an interface receiving the multicast message, and if so, establishing a multicast forwarding entry for forwarding the multicast message and forwarding the multicast message according to the established multicast forwarding entry.
6. The apparatus of claim 5, wherein the multicast forwarding entry comprises at least: an ingress interface, which is an egress interface of the selected unicast route;
when a multicast routing table entry for forwarding the multicast message exists locally, the processing unit further checks whether an incoming interface in the multicast routing table entry is consistent with an interface for receiving the multicast message,
if yes, forwarding the multicast message according to the multicast routing table item;
if not, searching the optimal unicast route reaching the source IP address of the multicast message in a local unicast route table, if the number of the searched unicast routes is larger than 1 and is equivalent, selecting a unicast route with a multicast mark from the searched unicast routes when the unicast routes with the multicast mark exist, checking whether an outlet interface of the selected unicast route is consistent with an inlet interface in a multicast route table item, if so, discarding the multicast message, if not, updating the inlet interface in the multicast route table item to be the interface receiving the multicast message when the outlet interface of the selected unicast route is consistent with the interface receiving the multicast message, and forwarding the multicast message according to the multicast route table item, otherwise, discarding the multicast message.
7. The apparatus according to claim 5, wherein the processing unit further finds a unicast route for an interface from the unicast route table when detecting that the multicast protocol deployed for the interface is deleted, and deletes the multicast flag set by the found unicast route.
8. A network device, characterized in that the network device comprises: a memory, a processor;
the memory for storing machine executable instructions;
the processor is used for reading and executing the machine executable instructions stored by the memory so as to realize the method of any one of claims 1 to 4.
9. A meter-readable storage medium having stored therein machine-executable instructions for reading and execution by a processor to perform the method of any one of claims 1 to 4.
CN201910464842.5A 2019-05-30 2019-05-30 Multicast forwarding method and device Active CN110149276B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910464842.5A CN110149276B (en) 2019-05-30 2019-05-30 Multicast forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910464842.5A CN110149276B (en) 2019-05-30 2019-05-30 Multicast forwarding method and device

Publications (2)

Publication Number Publication Date
CN110149276A CN110149276A (en) 2019-08-20
CN110149276B true CN110149276B (en) 2021-05-25

Family

ID=67589991

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910464842.5A Active CN110149276B (en) 2019-05-30 2019-05-30 Multicast forwarding method and device

Country Status (1)

Country Link
CN (1) CN110149276B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110768917B (en) * 2019-10-31 2021-09-21 杭州迪普科技股份有限公司 Message transmission method and device
CN112104560B (en) * 2020-07-27 2022-01-25 深圳市风云实业有限公司 Method for customizing multicast path
CN115567436A (en) * 2022-08-17 2023-01-03 北京东土军悦科技有限公司 Multicast message processing method, system, computer equipment and readable storage medium

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800742A (en) * 2010-01-28 2010-08-11 华为技术有限公司 Method for updating and processing upstream information of routing device, routing devices and network system
CN102946332A (en) * 2012-10-25 2013-02-27 杭州华三通信技术有限公司 Reverse path forwarding inspection method and device
CN106209649A (en) * 2016-06-29 2016-12-07 浙江宇视科技有限公司 The method and device of unicast router is avoided when automatically configuring multicast routing protocol
US9853915B2 (en) * 2015-11-04 2017-12-26 Cisco Technology, Inc. Fast fail-over using tunnels
CN109005109A (en) * 2018-07-24 2018-12-14 新华三技术有限公司 Path establishing method and multicast networking

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102413062B (en) * 2012-01-05 2014-09-17 杭州华三通信技术有限公司 Route selecting method and route equipment
CN109729009B (en) * 2017-10-31 2022-08-26 华为技术有限公司 Method and device for realizing multicast service

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101800742A (en) * 2010-01-28 2010-08-11 华为技术有限公司 Method for updating and processing upstream information of routing device, routing devices and network system
CN102946332A (en) * 2012-10-25 2013-02-27 杭州华三通信技术有限公司 Reverse path forwarding inspection method and device
US9853915B2 (en) * 2015-11-04 2017-12-26 Cisco Technology, Inc. Fast fail-over using tunnels
CN106209649A (en) * 2016-06-29 2016-12-07 浙江宇视科技有限公司 The method and device of unicast router is avoided when automatically configuring multicast routing protocol
CN109005109A (en) * 2018-07-24 2018-12-14 新华三技术有限公司 Path establishing method and multicast networking

Also Published As

Publication number Publication date
CN110149276A (en) 2019-08-20

Similar Documents

Publication Publication Date Title
CN110149276B (en) Multicast forwarding method and device
US11563641B1 (en) Shifting network traffic from a network device
US8923305B2 (en) Flooding-based routing protocol having database pruning and rate-controlled state refresh
US11233724B2 (en) Multicast data packet processing method, and apparatus
EP1632063B1 (en) Method and appartus for packet claasification and rewriting
US8316153B2 (en) Method, node, and system for notifying proxy update in WMN
US20090070422A1 (en) Multicast Group Management in Infiniband
KR100666996B1 (en) Routing system and route update method
CN110798403B (en) Communication method, communication device and communication system
KR20050114654A (en) Radio ad hoc communication system, terminal, processing method in the terminal, and program causing the terminal to execute the method
RU2006129488A (en) DEVICE FOR DYNAMIC NETWORK MANAGEMENT AND METHOD OF DYNAMIC NETWORK MANAGEMENT
CN101540731B (en) Three-tier message retransmission method and device
JP7053901B2 (en) Loop avoidance communication method, loop avoidance communication device and loop avoidance communication system
WO2018184487A1 (en) Bier message forwarding method and device
US12003412B2 (en) Method and apparatus for processing link state information
US20230116548A1 (en) Route Processing Method and Related Device
CN110677340A (en) Message forwarding method and device
CN112887209B (en) Entry establishment method and related equipment for data transmission
US8432909B2 (en) Methods and systems for using a link management interface to distribute information in a communications network
CN112350936B (en) Method and device for optimizing interior gateway protocol flooding and storage medium
CN111385195B (en) Information processing method, device and storage medium
US20220150167A1 (en) Bier packet processing method, network device, and system
US11700201B2 (en) Mechanism to enforce consistent next hops in a multi-tier network
US20100132028A1 (en) Method for implementing security-related processing on packet and network security device
CN111556179A (en) ARP (Address resolution protocol) table item updating method and device

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant
TR01 Transfer of patent right

Effective date of registration: 20230625

Address after: 310052 11th Floor, 466 Changhe Road, Binjiang District, Hangzhou City, Zhejiang Province

Patentee after: H3C INFORMATION TECHNOLOGY Co.,Ltd.

Address before: 310052 Changhe Road, Binjiang District, Hangzhou, Zhejiang Province, No. 466

Patentee before: NEW H3C TECHNOLOGIES Co.,Ltd.

TR01 Transfer of patent right