This disclosure relates to the field of communications technologies, and in particular, to a multicast packet sending method and an apparatus.
Multicast means that a sender sends packets carrying same data to a plurality of specific receivers. In an initial implementation, a sender replicates data in a packet to generate a plurality of copies based on a quantity of receivers, and separately encapsulates the copies and sends the copies to the receivers. This causes repeated transmission of packets on some links, reduces network resource utilization, and increases a possibility of network congestion.
To resolve the foregoing problems, a series of multicast technologies are proposed in the industry. A most typical multicast technology is Protocol-Independent Multicast (PIM)-Sparse Mode (SM). PIM-SM needs to maintain a multicast forwarding information base (MFIB) table for each multicast stream in a network. Therefore, there is a severe scalability problem.
Embodiments of this disclosure provide a multicast packet sending method and an apparatus to improve scalability of a multicast packet.
According to a first aspect, a multicast packet sending method is provided. The method includes the following step. A first node obtains a first multicast packet including multicast information of a second node, and sends the first multicast packet to the second node. The second node is a non-leaf subnode of the first node in a multicast tree, the multicast information of the second node includes multicast routing information of the second node, multicast routing information of a node includes a multicast routing identifier of the node and multicast routing information of a non-leaf subnode of the node in the multicast tree, and a multicast routing identifier of a node is used by the node to determine a subnode of the node in the multicast tree. In the method provided in the first aspect, the multicast routing information is embedded in the multicast packet, and multicast routing information of a tree recursive structure included in the multicast packet can describe packet forwarding information of the multicast tree or a subtree of the multicast tree. Therefore, scalability is good, and a forwarding path can be conveniently planned and specified based on a requirement.
In a possible implementation, a multicast routing identifier of a node is used by the node to determine, in a first node set corresponding to the node, a subnode of the node in the multicast tree, and the first node set corresponding to the node includes a part or all of potential subnodes of the node.
In a possible implementation, a multicast routing identifier of a node includes subnode quantity information of the node and an identifier of each subnode of the node.
In a possible implementation, a multicast routing identifier of a node includes a third field and X fourth fields, the third field indicates a quantity X of subnodes of the node, and one fourth field indicates an identifier of one subnode of the node. In the possible implementation, in a multicast scenario in which density of nodes in the multicast tree is extremely low, multicast encapsulation with highest efficiency can be provided.
In a possible implementation, a multicast routing identifier of a node includes N third fields, N is a quantity of nodes in a first node set corresponding to the node, one third field indicates whether a node in the first node set is a subnode of the node in the multicast tree, and the first node set corresponding to the node includes a part or all of potential subnodes of the node. In the possible implementation, in a multicast scenario in which density of nodes in the multicast tree is high, multicast encapsulation with highest efficiency can be provided.
In a possible implementation, a multicast routing identifier of a node includes a third field, the third field includes a first group identifier, the first group identifier indicates a first node group corresponding to the node, and all nodes in the first node group corresponding to the node are subnodes of the node. In the possible implementation, in a multicast scenario in which density of nodes in the multicast tree is highest, multicast encapsulation with highest efficiency can be provided.
In a possible implementation, multicast routing information of a node further includes an addressing field of the node, and the addressing field of the node is used by the node to determine a position of multicast routing information of a non-leaf subnode of the node.
In a possible implementation, the addressing field of the node indicates a length of the multicast routing information of the non-leaf subnode of the node. In the possible implementation, bit overheads of the addressing field can be reduced, and resource utilization can be improved.
In a possible implementation, the addressing field of the node indicates a start position or an end position of the multicast routing information of the non-leaf subnode of the node. In the possible implementation, the node can quickly determine the position of the multicast routing information. Therefore, multicast efficiency is improved.
In a possible implementation, the addressing field of the node includes a plurality of delimitation fields, and the multicast routing information of the non-leaf subnode of the node is separated by the plurality of delimitation fields.
In a possible implementation, the multicast information of the second node further includes a first field of the second node, and the first field indicates a length of the multicast routing information of the second node or a length of the multicast information of the second node.
In a possible implementation, the multicast information of the second node further includes a second field, and the second field is used to align bytes of the multicast information of the second node.
In a possible implementation, the first multicast packet is an Internet Protocol (IP) packet, a destination address in the first multicast packet is an address of the second node, the first multicast packet further includes data, and the multicast information of the second node in the first multicast packet is located between an IP header and the data of the first multicast packet.
In a possible implementation, that a first node obtains a first multicast packet includes that the first node receives a second multicast packet, where the second multicast packet includes multicast routing information of the first node, the first node determines that the second node is a non-leaf subnode of the first node, the first node obtains the multicast routing information of the second node based on the multicast routing information of the first node, and the first node performs packet encapsulation based on the multicast routing information of the second node to obtain the first multicast packet.
In a possible implementation, that the first node obtains the multicast routing information of the second node based on the multicast routing information of the first node includes that the first node determines a position of the multicast routing information of the second node based on an addressing field in the multicast routing information of the first node, and the first node obtains the multicast routing information of the second node based on the position of the multicast routing information of the second node.
In a possible implementation, the first node is a source node of the multicast tree, and that a first node obtains a first multicast packet includes that the first node generates the first multicast packet.
In a possible implementation, the first node is a source node of the multicast tree, and that a first node obtains a first multicast packet includes that the first node generates a second multicast packet, where the second multicast packet includes multicast routing information of the first node, the first node determines that the second node is a non-leaf subnode of the first node, the first node obtains the multicast routing information of the second node based on the multicast routing information of the first node, and the first node performs packet encapsulation based on the multicast routing information of the second node to obtain the first multicast packet.
In a possible implementation, the first node includes at least one entity, the second node includes at least one entity, and the first multicast packet is a multicast packet sent by an entity in the first node to an entity in the second node.
In a possible implementation, a multicast routing identifier of a node is used by an entity in the node to determine a subnode of the node in the multicast tree.
According to a second aspect, a multicast packet sending method is provided, and is applied to a first entity, where the first entity belongs to a first node. The method includes the following steps. The first entity receives a third multicast packet, where the third multicast packet includes first multicast routing information of the first node, the first multicast routing information of the first node includes a first multicast routing identifier of the first node and multicast routing information of a non-leaf subnode corresponding to the first multicast routing identifier of the first node, multicast routing information of a node includes a multicast routing identifier of the node and multicast routing information of a non-leaf subnode of the node in a multicast tree, the multicast routing identifier of the node is used by an entity in the node to determine a subnode of the node in the multicast tree, and the first multicast routing identifier of the first node is the same as a multicast routing identifier of the first node or is obtained by updating a multicast routing identifier of the first node, the first entity determines a second entity based on the first multicast routing identifier of the first node, where the second entity is an entity in the first node, and the first entity sends a fourth multicast packet to the second entity, where the fourth multicast packet includes second multicast routing information of the first node, the second multicast routing information of the first node includes a second multicast routing identifier of the first node and multicast routing information of a part or all of non-leaf subnodes corresponding to a third multicast routing identifier of the first node, the third multicast routing identifier of the first node is the same as the first multicast routing identifier of the first node or is obtained by updating the first multicast routing identifier of the first node, and the second multicast routing identifier of the first node is the same as the third multicast routing identifier of the first node or is obtained by updating the third multicast routing identifier of the first node. According to the method provided in the second aspect, when one node includes a plurality of entities, multicast packet forwarding between the entities in the node can be implemented.
In a possible implementation, that the first entity determines a second entity based on the first multicast routing identifier of the first node includes that the first entity looks up a multicast forwarding table based on the first multicast routing identifier of the first node to obtain the second entity.
In a possible implementation, the method further includes that the first entity determines a first subnode based on the first multicast routing identifier of the first node, where the first subnode is a subnode corresponding to the first entity, among subnodes of the first node in the multicast tree, and the first entity sends a fifth multicast packet to the first subnode, where the fifth multicast packet includes multicast routing information of the first subnode.
In a possible implementation, the first entity does not belong to the first subnode, and that the first entity sends a fifth multicast packet to the first subnode includes that the first entity sends the fifth multicast packet to a third entity in the first subnode.
In a possible implementation, the first entity belongs to the first subnode, and the method further includes that the first entity determines a second subnode based on a multicast routing identifier of the first subnode, where the second subnode is a subnode corresponding to the first entity, among subnodes of the first subnode in the multicast tree.
In a possible implementation, the first entity belongs to the first subnode, the first subnode further includes a fourth entity, and the method further includes that the first entity sends a sixth multicast packet to the fourth entity, where the sixth multicast packet includes first multicast routing information of the first subnode, the first multicast routing information of the first subnode includes a first multicast routing identifier of the first subnode and multicast routing information of a part or all of non-leaf subnodes corresponding to a second multicast routing identifier of the first subnode, the second multicast routing identifier of the first subnode is the same as a multicast routing identifier of the first subnode or is obtained by updating a multicast routing identifier of the first subnode, and the first multicast routing identifier of the first subnode is the same as the second multicast routing identifier of the first subnode or is obtained by updating the second multicast routing identifier of the first subnode.
According to a third aspect, a first node is provided and includes a processing unit and a communications unit. The processing unit is configured to obtain a first multicast packet, where the first multicast packet includes multicast information of a second node, the second node is a non-leaf subnode of the first node in a multicast tree, the multicast information of the second node includes multicast routing information of the second node, multicast routing information of a node includes a multicast routing identifier of the node and multicast routing information of a non-leaf subnode of the node in the multicast tree, and a multicast routing identifier of a node is used by the node to determine a subnode of the node in the multicast tree. The communications unit is configured to send the first multicast packet to the second node.
In a possible implementation, a multicast routing identifier of a node is used by the node to determine, in a first node set corresponding to the node, a subnode of the node in the multicast tree, and the first node set corresponding to the node includes a part or all of potential subnodes of the node.
In a possible implementation, a multicast routing identifier of a node includes subnode quantity information of the node and an identifier of each subnode of the node.
In a possible implementation, a multicast routing identifier of a node includes a third field and X fourth fields, the third field indicates a quantity X of subnodes of the node, and one fourth field indicates an identifier of one subnode of the node.
In a possible implementation, a multicast routing identifier of a node includes N third fields, N is a quantity of nodes in a first node set corresponding to the node, one third field indicates whether a node in the first node set is a subnode of the node in the multicast tree, and the first node set corresponding to the node includes a part or all of potential subnodes of the node.
In a possible implementation, a multicast routing identifier of a node includes a third field, the third field includes a first group identifier, the first group identifier indicates a first node group corresponding to the node, and all nodes in the first node group corresponding to the node are subnodes of the node.
In a possible implementation, multicast routing information of a node further includes an addressing field of the node, and the addressing field of the node is used by the node to determine a position of multicast routing information of a non-leaf subnode of the node.
In a possible implementation, the addressing field of the node indicates a length of the multicast routing information of the non-leaf subnode of the node.
In a possible implementation, the addressing field of the node indicates a start position or an end position of the multicast routing information of the non-leaf subnode of the node.
In a possible implementation, the addressing field of the node includes a plurality of delimitation fields, and the multicast routing information of the non-leaf subnode of the node is separated by the plurality of delimitation fields.
In a possible implementation, the multicast information of the second node further includes a first field of the second node, and the first field indicates a length of the multicast routing information of the second node or a length of the multicast information of the second node.
In a possible implementation, the multicast information of the second node further includes a second field, and the second field is used to align bytes of the multicast information of the second node.
In a possible implementation, the first multicast packet is an IP packet, a destination address in the first multicast packet is an address of the second node, the first multicast packet further includes data, and the multicast information of the second node in the first multicast packet is located between an IP header and the data of the first multicast packet.
In a possible implementation, the processing unit is further configured to receive a second multicast packet by using the communications unit, where the second multicast packet includes multicast routing information of the first node, determine that the second node is a non-leaf subnode of the first node, obtain the multicast routing information of the second node based on the multicast routing information of the first node, and perform packet encapsulation based on the multicast routing information of the second node to obtain the first multicast packet.
In a possible implementation, the processing unit is further configured to determine a position of the multicast routing information of the second node based on an addressing field in the multicast routing information of the first node, and obtain the multicast routing information of the second node based on the position of the multicast routing information of the second node.
In a possible implementation, the first node is a source node of the multicast tree, and the processing unit is further configured to generate the first multicast packet.
In a possible implementation, the first node is a source node of the multicast tree, and the processing unit is further configured to generate a second multicast packet, where the second multicast packet includes multicast routing information of the first node, determine that the second node is a non-leaf subnode of the first node, obtain the multicast routing information of the second node based on the multicast routing information of the first node, and perform packet encapsulation based on the multicast routing information of the second node to obtain the first multicast packet.
In a possible implementation, the first node includes at least one entity, the second node includes at least one entity, and the first multicast packet is a multicast packet sent by an entity in the first node to an entity in the second node.
In a possible implementation, a multicast routing identifier of a node is used by an entity in the node to determine a subnode of the node in the multicast tree.
According to a fourth aspect, a first entity is provided. The first entity belongs to a first node. The first entity includes a communications unit and a processing unit. The communications unit is configured to receive a third multicast packet, where the third multicast packet includes first multicast routing information of the first node, the first multicast routing information of the first node includes a first multicast routing identifier of the first node and multicast routing information of a non-leaf subnode corresponding to the first multicast routing identifier of the first node, multicast routing information of a node includes a multicast routing identifier of the node and multicast routing information of a non-leaf subnode of the node in a multicast tree, the multicast routing identifier of the node is used by an entity in the node to determine a subnode of the node in the multicast tree, and the first multicast routing identifier of the first node is the same as a multicast routing identifier of the first node or is obtained by updating a multicast routing identifier of the first node. The processing unit is configured to determine a second entity based on the first multicast routing identifier of the first node, where the second entity is an entity in the first node. The communications unit is further configured to send a fourth multicast packet to the second entity, where the fourth multicast packet includes second multicast routing information of the first node, the second multicast routing information of the first node includes a second multicast routing identifier of the first node and multicast routing information of a part or all of non-leaf subnodes corresponding to a third multicast routing identifier of the first node, the third multicast routing identifier of the first node is the same as the first multicast routing identifier of the first node or is obtained by updating the first multicast routing identifier of the first node, and the second multicast routing identifier of the first node is the same as the third multicast routing identifier of the first node or is obtained by updating the third multicast routing identifier of the first node.
In a possible implementation, the processing unit is further configured to look up a multicast forwarding table based on the first multicast routing identifier of the first node to obtain the second entity.
In a possible implementation, the processing unit is further configured to determine a first subnode based on the first multicast routing identifier of the first node, where the first subnode is a subnode corresponding to the first entity, among subnodes of the first node in the multicast tree, and the communications unit is further configured to send a fifth multicast packet to the first subnode, where the fifth multicast packet includes multicast routing information of the first subnode.
In a possible implementation, the first entity does not belong to the first subnode, and the communications unit is further configured to send the fifth multicast packet to a third entity in the first subnode.
In a possible implementation, the first entity belongs to the first subnode, and the processing unit is further configured to determine a second subnode based on a multicast routing identifier of the first subnode, where the second subnode is a subnode corresponding to the first entity, among subnodes of the first subnode in the multicast tree.
In a possible implementation, the first entity belongs to the first subnode, and the first subnode further includes a fourth entity, and the communications unit is further configured to send a sixth multicast packet to the fourth entity, where the sixth multicast packet includes first multicast routing information of the first subnode, the first multicast routing information of the first subnode includes a first multicast routing identifier of the first subnode and multicast routing information of a part or all of non-leaf subnodes corresponding to a second multicast routing identifier of the first subnode, the second multicast routing identifier of the first subnode is the same as a multicast routing identifier of the first subnode or is obtained by updating a multicast routing identifier of the first subnode, and the first multicast routing identifier of the first subnode is the same as the second multicast routing identifier of the first subnode or is obtained by updating the second multicast routing identifier of the first subnode.
According to a fifth aspect, a communications apparatus is provided and includes a processor. The processor is connected to a memory, the memory is configured to store computer-executable instructions, and the processor executes the computer-executable instructions stored in the memory, so that the communications apparatus implements the method provided in the first aspect or the second aspect. For example, the memory and the processor may be integrated together, or may be independent components. If the memory and the processor are independent components, the memory may be located inside the communications apparatus, or may be located outside the communications apparatus.
In a possible implementation, the processor includes a logic circuit, and further includes an input interface and/or an output interface. For example, the output interface is configured to perform a sending action in a corresponding method, and the input interface is configured to perform a receiving action in the corresponding method.
In a possible implementation, the communications apparatus further includes a communications interface and a communications bus. The processor, the memory, and the communications interface are connected by the communications bus. The communications interface is configured to perform receiving and sending actions in the corresponding method. The communications interface may also be referred to as a transceiver. Optionally, the communications interface includes at least one of a transmitter and a receiver. In this case, the transmitter is configured to perform a sending action in the corresponding method, and the receiver is configured to perform a receiving action in the corresponding method.
In a possible implementation, the communications apparatus exists in a form of a chip product.
According to a sixth aspect, a chip is provided. The chip includes a processor and an interface. The processor is coupled to a memory through the interface. When the processor executes a computer program or instructions in the memory, the method provided in the first aspect or the second aspect is performed.
According to a seventh aspect, a computer-readable storage medium is provided and includes instructions. When the instructions are run on a computer, the computer is enabled to perform the method provided in the first aspect or the second aspect.
According to an eighth aspect, a computer program product is provided, and includes instructions. When the instructions are run on a computer, the computer is enabled to perform the method provided in the first aspect or the second aspect.
For technical effects brought by any implementation in the third aspect to the eighth aspect, refer to technical effects brought by corresponding implementations in the first aspect or the second aspect. Details are not described herein again.
It should be noted that the solutions in the foregoing aspects may be combined on the premise that the solutions are not contradictory.
In the description of this disclosure, unless otherwise stated, “I” means “or”. For example, AB may represent A or B. The term “and/or” in this specification describes only an association relationship for describing associated objects and represents that three relationships may exist. For example, A and/or B may represent the following three cases: only A exists, both A and B exist, and only B exists. In the description of this disclosure, unless otherwise stated, “at least one” means one or more, and “a plurality of” means two or more.
In addition, to clearly describe the technical solutions in embodiments of this disclosure, terms such as “first” and “second” are used in embodiments of this disclosure to distinguish between same items or similar items having basically same functions and purposes. A person skilled in the art may understand that the terms such as “first” and “second” do not limit a quantity and an execution sequence, and the terms such as “first” and “second” do not indicate a definite difference.
It should be noted that, in this disclosure, terms such as “an example” or “for example” are used to represent an example, an instance, or an illustration. Any embodiment or design scheme described as “an example” or “for example” in this disclosure should not be construed as being more preferred or advantageous than other embodiments or design schemes. To be precise, the terms such as “an example” or “for example” are intended to present a related concept in a specific manner.
This disclosure may be applied to a scenario in which one sender needs to send a packet carrying same data to a plurality of receivers. Referring to
It should be noted that, for ease of description, in embodiments of this disclosure, if an entity belongs to only one node, the node and the entity use a same identifier. In this case, an address of the entity may also be described as an address of the node, and an action performed by the node is also an action performed by the entity. Therefore, the address of the node mentioned hereinafter is the address of the entity in the node. For example, a node including only entity A is referred to as node A. In this case, an address of node A is equivalent to an address of entity A. A node including only entity B is referred to as node B. In this case, an address of node B is equivalent to an address of entity B.
In this disclosure, the entity may also be referred to as a functional entity. The entity may be a physical entity or a virtual entity. The physical entity may be, for example, a router, a switch, a server, a host, a network adapter, a line card, a chip, a die of a chip, a terminal (for example, a mobile terminal), or an internal module of a device. The virtual entity may be, for example, a virtual machine, a container, a process, or a thread. When the entity is a physical entity, the node may also be referred to as a multicast device.
To make the method provided in this disclosure clearer, some concepts in this disclosure are first briefly described.
1. Multicast Tree:
A multicast tree is a path from a source node to all destination nodes, where the path is generated for a combination of the specific source node and destination nodes based on a specific network topology by using a routing protocol (for example, PIM or an Interior Gateway Protocol (IGP)) or another method (for example, manual configuration or computation by a controller). The path is a tree structure using the source node as a root node and the destination nodes as leaf nodes, and is referred to as a multicast tree. The multicast tree may also be referred to as a multicast distribution tree (MDT). For example, referring to
It should be noted that a sender and/or a receiver may be a node in the multicast tree, or may not be a node in the multicast tree. If the sender and/or the receiver are/is a node in the multicast tree, the source node may be the sender, and the destination node may be the receiver. For ease of description, unless otherwise specified, in embodiments of this disclosure, an example in which the sender and the receiver are nodes in the multicast tree is used to describe the methods provided in embodiments of this disclosure. If the receiver is not a node in the multicast tree, after data reaches a leaf node, the leaf node sends the received data to the receiver connected to the leaf node.
In addition, a module other than a network adapter in a server may be considered as a node (assumed to be node a), and the network adapter in the server may be considered as another node (assumed to be node b). In this case, node b may be considered as a subnode of node a. A module other than a line card in a router may be considered as a node (assumed to be node c), and the line card in the router may be considered as another node (assumed to be node d). In this case, node d may be considered as a subnode of node c. For example, referring to
2. Subnode:
A subnode of a node refers to a node that a packet of the node in the multicast tree can reach through one-hop multicast (that is, multicast forwarding is performed only once). One-hop multicast means looking up a multicast forwarding table once. For example, in
When a subnode of a node is a leaf node of the multicast tree, the subnode may be referred to as a leaf subnode of the node. When a subnode of a node is not a leaf node of the multicast tree, the subnode may be referred to as a non-leaf subnode of the node.
In the description of this disclosure, unless otherwise specified, a subnode of a node mentioned hereinafter in this disclosure is a subnode of the node in a multicast tree. The subnode may also have another name, for example, a multicast subnode. This is not limited in this disclosure.
It should be noted that a node to which an entity belongs may be a subnode of another node to which the entity belongs. For example, referring to (b) in
3. Potential Subnode:
A potential subnode of a node refers to a node that a packet of the node can reach through one-hop multicast. For example, node R and node A in
4. Multicast Routing Information, First Multicast Routing Information, and Second Multicast Routing Information:
In embodiments of this disclosure, multicast routing information of a node is carried in a multicast packet forwarded between nodes. Both first multicast routing information and second multicast routing information of a node are derived from multicast routing information of the node, and are carried in a multicast packet forwarded between entities in the node.
5. Multicast Routing Identifier, First Multicast Routing Identifier, Second Multicast Routing Identifier, and Third Multicast Routing Identifier:
In embodiments of this disclosure, a multicast routing identifier of a node is carried in a multicast packet forwarded between nodes. A first multicast routing identifier, a second multicast routing identifier, and a third multicast routing identifier of a node are all derived from a multicast routing identifier of the node, and are carried in a multicast packet forwarded between entities in the node.
6. Unicast and Multicast Packets:
First Definitions of Unicast and Multicast Packets:
Packets are classified based on behavior of packet processing performed by an entity. In this case, both a unicast packet and a multicast packet are for an entity in this disclosure, and whether a packet is a unicast packet or a multicast packet is relative.
For an entity, if a received packet does not include any multicast routing information that needs to be processed by the entity or does not include any multicast routing information, the entity does not need to perform multicast forwarding on the packet (or does not need to look up a multicast forwarding table), but only needs to perform unicast forwarding based on unicast encapsulation of the packet (or use a destination address of unicast encapsulation to look up a unicast forwarding table for forwarding) or consume the packet (that is, the entity processes the packet and does not need to forward the packet). In this case, the packet is a unicast packet for the entity.
For an entity, if a received packet includes multicast routing information, and the entity needs to process the multicast routing information, that is, needs to perform multicast forwarding based on the multicast routing information (or needs to look up a multicast forwarding table), the packet is a multicast packet for the entity.
For example, entity A and entity B have a topological connection, and entity B and entity C have a topological connection. A packet sent by entity A to entity C can reach entity C only through entity B. If the packet includes multicast routing information and unicast encapsulation, and a destination address of unicast encapsulation is an address of entity C, the packet is a unicast packet for entity B and a multicast packet for entity C.
For another example, entity A and entity B have a topological connection, and entity A sends a packet to entity B. The packet does not include multicast routing information, but includes unicast encapsulation, and a destination address of unicast encapsulation is an address of entity B. In this case, the packet is a unicast packet for entity B.
Second definitions of unicast and multicast packets:
Packets are classified based on structures of the packets. A packet whose outermost header is a unicast header is a unicast packet, and a packet whose outermost header is a multicast header is a multicast packet. An IP header whose destination IP address is a unicast address is a unicast header, and a media access control (MAC) header whose destination MAC address is a unicast address is also a unicast header. An IP header whose destination IP address is a multicast address is a multicast header, and a MAC header whose destination MAC address is a multicast address is also a multicast header. Multicast information in this disclosure is also a multicast header.
Based on the foregoing two definitions of the unicast and multicast packets, to make the methods provided in embodiments of this disclosure clearer, the first definition is used in this disclosure to describe the methods provided in embodiments of this disclosure. When the second definition is used in this disclosure, whether a packet is a unicast packet or a multicast packet may be determined based on a specific structure of the packet. For example, in the following description, a first node sends a first multicast packet to a second node, and if an outermost header of the first multicast packet is a unicast header, the first multicast packet may be described as a unicast packet when the second definition is used for description.
Unicast encapsulation in a packet in this disclosure may be IP version 4 (IPv4) unicast encapsulation, IP version 6 (IPv6) unicast encapsulation, or any other possible encapsulation form. In this disclosure, unicast encapsulation in any possible form may be performed on a packet including multicast routing information, or unicast encapsulation may not be performed. The unicast encapsulation of the packet enables the packet to traverse a network between two entities in unicast mode (or the packet is transmitted between the two entities). The multicast routing information mentioned in the description of the unicast packet and the multicast packet is multicast routing information defined hereinafter in this disclosure.
It should be noted that, in embodiments of this disclosure, when a multicast packet is an IP packet, and a destination IP address in an IP header of the multicast packet is a unicast address, the IP header of the multicast packet is unicast encapsulation of the multicast packet. It should be noted that if the multicast packet in this disclosure is an IP packet, in the description of this disclosure, the destination address is a destination IP address.
In the following description of this disclosure, if an entity receives a multicast packet and the multicast packet is an IP packet, the entity first determines whether a destination address in an IP header of the multicast packet is an address of the entity, and if yes, parses multicast information after the IP header of the multicast packet, and forwards the multicast packet based on the multicast information. In a process of sending the multicast packet to another entity, the entity first determines multicast information and data that need to be sent to the another entity, then determines a next-hop address (that is, an address of the another entity), fills in a destination address field in the IP header with the address of the another entity, encapsulates the multicast information and data to be sent to the another entity, into the IP header to obtain the multicast packet to be sent to the another entity, and then sends the multicast packet to the another entity. For brevity in the following description of this disclosure, this process is not described in detail in each step, and is centrally described herein. Details are not described again later.
It should be noted that for data in the multicast packet, the data is different for different parts of the multicast packet. Further, for a part of the multicast packet, the data is a part after the part of the multicast packet. For example, referring to
The foregoing briefly describes some concepts in this disclosure.
Multicast packet forwarding may be implemented by using PIM-SM (denoted as solution 1) or BIER (denoted as solution 2). The following describes implementation processes and existing problems of the solutions 1 and 2.
Solution 1: A multicast packet is forwarded through PIM-SM.
PIM-SM is a multicast routing protocol. PIM-SM is used to establish an MFIB table hop by hop in a direction from a receiver to a multicast source (a sender or a rendezvous point (RP)), and finally construct a tree structure that uses the multicast source as a root node and the receiver as a leaf node, that is, a multicast tree. A multicast packet is replicated on each router (or a multicast router) in a direction from a root node to a leaf node in the multicast tree, until the multicast packet reaches a receiver. All receivers may form a multicast group, and one receiver is a member of the multicast group. A multicast tree that uses an RP as a root node and a member in a multicast group as a leaf node is referred to as an RP tree (RPT). A multicast tree that uses a sender as a root node and a member in a multicast group as a leaf node is referred to as an SPT. RPT and SPT forwarding processes are basically consistent. Using the SPT as an example, after the SPT is constructed, each router stores an MFIB table, where the MFIB table stores a group address and a port list. When receiving a multicast packet whose destination address is the group address, the router sends the multicast packet through a port in the port list. For example, for an SPT and an MFIB table stored in a router in the SPT, refer to
Solution 1 has the Following Problems:
Solution 2: A Multicast Packet is Forwarded Through BIER.
To resolve the problems of PIM-SM, a stateless multicast routing protocol BIER is proposed in the industry. A router supporting BIER is referred to as a bit-forwarding router (BFR), a domain ingress router supporting BIER is referred to as a bit-forwarding ingress router (BFIR), and a domain egress router supporting BIER is referred to as a BFER. BIER assigns a unique identifier (ID) to each BFER. The ID is referred to as a BFRID, and a typical value range of the ID is 1 to 65536. Referring to
As specified in the BIER protocol, a SI and a bit string carried in a header of a multicast packet indicate BFERs to which the multicast packet is sent. A bit string is a bitmap of 256 bits in length, and each bit corresponds to one BFER. For example, when a value of a bit corresponding to a BFER is 1, it indicates that the multicast packet needs to be multicast to the BFER. One multicast packet can carry only one SI and one bit string. Therefore, one multicast packet can be multicast to only one set. For example, referring to
Solution 2 has the Following Problems:
1. Because a multicast packet can carry only one SI and one bit string, the multicast packet can be multicast to only one set. This means that if there are 50 sets in total and the multicast packet needs to be sent to BFERs in the 50 sets, 50 multicast packets need to be sent. Excessive packets cause poor multicast efficiency.
2. The BIFT in the BIER is fixed, that is, each node has a fixed next hop. Therefore, a path for routing cannot be planned or specified.
To resolve the problems existing in the foregoing solution 1 and solution 2, this disclosure provides a multicast packet sending method. Referring to
601. A first node obtains a first multicast packet, where the first multicast packet includes multicast information of a second node, the second node is a non-leaf subnode of the first node in a multicast tree, the multicast information of the second node includes multicast routing information of the second node, multicast routing information of a node includes a multicast routing identifier of the node and multicast routing information of a non-leaf subnode of the node in the multicast tree, and a multicast routing identifier of a node is used by the node to determine a subnode of the node in the multicast tree.
The first node may be any node having a non-leaf subnode in the multicast tree. The first node may include at least one entity. The second node may include at least one entity.
A multicast routing identifier of a node is used to indicate the node to perform multicast routing and forwarding. Optionally, a multicast routing identifier of a node is used by the node to determine, in a first node set corresponding to the node, a subnode of the node in the multicast tree, and the first node set corresponding to the node includes a part or all of potential subnodes of the node. One node may correspond to a plurality of node sets. The node set may be generated by a specific protocol, algorithm, or configuration. The first node set may be one of a plurality of node sets. The first node set corresponding to the node may be indicated by using the multicast routing identifier of the node. For example, the multicast routing identifier of the node may carry a set identifier, and the first node set is indicated by using the set identifier. The first node set corresponding to the node may alternatively be preconfigured in the node.
Optionally, a multicast routing identifier of a node is used by an entity in the node to determine a subnode of the node in the multicast tree.
Multicast routing information of a non-leaf subnode in multicast routing information of a node may be a multicast routing information list, and the list may be arranged in a sequential manner, a chain manner, or another possible manner. This is not limited in this disclosure. It may be understood that, if a node does not have a non-leaf subnode, multicast routing information of the node does not include multicast routing information of the non-leaf subnode, and includes only a multicast routing identifier of the node.
As can be learned from the description of the first multicast packet, the first multicast packet includes multicast routing information of a tree recursive structure, and multicast routing information of a non-leaf subnode of the second node in the first multicast packet may be considered as a recursive unit in the recursive structure. For ease of description, in some of the following descriptions of this disclosure, multicast routing information of a non-leaf subnode of a node is denoted as a recursive unit. It is assumed that a quantity of non-leaf subnodes of a node is M, and that multicast routing information of the (m+1)th non-leaf subnode of the node is denoted as recursive unit m of the node, where m is an integer greater than or equal to 0 and less than M. It may be understood that multicast routing information of each non-leaf subnode of the second node further includes a plurality of recursive units (each recursive unit is multicast routing information of a non-leaf subnode of the non-leaf subnode), and so on. The multicast routing information included in the first multicast packet may describe packet forwarding information of the multicast tree or a subtree of the multicast tree.
For example, referring to
For example, based on the multicast tree shown in
Optionally, multicast routing information of a node further includes an addressing field of the node. An addressing field of a node is used by the node to determine a position of multicast routing information of a non-leaf subnode of the node. The position may be a position of the multicast routing information of the non-leaf subnode of the node in the multicast routing information or multicast information of the node, or may be a position in the multicast packet. For example, referring to
Optionally, the multicast information of the second node further includes a first field, and the first field indicates a sum of one or more of a length of the first field of the second node, a length of the addressing field of the second node, a length of the multicast routing identifier of the second node, and a total length of multicast routing information of non-leaf subnodes of the second node, and the one or more lengths include the total length of the multicast routing information of the non-leaf subnodes of the second node. For example, the first field indicates a length of the multicast routing information of the second node, or a length of the multicast information of the second node, or the total length of the multicast routing information of the non-leaf subnodes in the multicast routing information of the second node. These lengths may be represented by bits, bytes, or the like. The first field may further include a reserved field for subsequent function extension. The first field may be a field of a fixed length, for example, one byte (that is, eight bits). For example, referring to
Optionally, the multicast information of the second node further includes a second field, and the second field is used to align bytes of the multicast information of the second node. The second field may also be referred to as a padding field. For example, referring to
The first field and the second field may be added by the first node to the first multicast packet. For example, in a process of the following step (14), the first field and the second field are added to the first multicast packet.
The multicast information of the second node may be carried in the packet header of the first multicast packet. The multicast information of the node may be considered as multicast encapsulation in the packet header of the multicast packet. Referring to
Data in the multicast packet for multicast information is information that actually needs to be sent to a leaf node.
During specific implementation, step 601 may be implemented in the following manner 11, manner 12, or manner 13.
Manner 11: The first node receives a second multicast packet, and obtains the first multicast packet based on the received second multicast packet.
In specific implementation, manner 11 may include the following steps:
(11) The first node receives the second multicast packet, where the second multicast packet includes multicast routing information of the first node, and the multicast routing information of the first node includes a multicast routing identifier of the first node and multicast routing information of a non-leaf subnode of the first node.
(12) The first node determines that the second node is a non-leaf subnode of the first node.
(13) The first node obtains the multicast routing information of the second node based on the multicast routing information of the first node.
(14) The first node performs packet encapsulation based on the multicast routing information of the second node to obtain the first multicast packet.
In step (11), if the first node is not a source node of the multicast tree, the first node may receive the second multicast packet sent by another node in the multicast tree.
In specific implementation of step (12), in a possible implementation, a non-leaf subnode of a node may be configured in the node. In this case, the first node may determine, based on the configuration, whether the second node is a non-leaf subnode of the first node. In another implementation, a non-leaf subnode and/or a leaf subnode of a node may be configured in the node. The first node determines, based on the multicast routing identifier of the first node, whether the second node is a subnode of the first node, and if yes, determines, based on configured information about whether the second node is a leaf node, whether the second node is a non-leaf subnode of the first node.
In specific implementation, step (13) may include the following steps:
(13-1) The first node determines a position of the multicast routing information of the second node based on an addressing field in the multicast routing information of the first node. For specific implementation of step (13-1), refer to the following related description of the addressing field. Details are not described herein again.
(13-2) The first node obtains the multicast routing information of the second node based on the position of the multicast routing information of the second node.
Manner 12: The first node generates the first multicast packet, where the first node is a source node of the multicast tree.
Manner 13: The first node generates a second multicast packet, and obtains the first multicast packet based on the second multicast packet. The second multicast packet includes multicast routing information of the first node.
In specific implementation, manner 13 may include that the first node generates the second multicast packet, the first node determines that the second node is a non-leaf subnode of the first node, the first node obtains the multicast routing information of the second node based on the multicast routing information of the first node, and the first node performs packet encapsulation based on the multicast routing information of the second node to obtain the first multicast packet. For an implementation process of steps same as the steps in manner 11 in specific implementation of manner 13, refer to manner 11. Details are not described again.
602. The first node sends the first multicast packet to the second node. Correspondingly, the second node receives the first multicast packet from the first node.
The first multicast packet is a multicast packet sent by an entity in the first node to an entity in the second node. For processing of a multicast packet between entities included in a node, refer to the embodiment shown in
Optionally, a destination address in unicast encapsulation of the first multicast packet is an address of the second node. Further, the first multicast packet may be an IP packet. In this case, the destination address in the first multicast packet is the address of the second node. The first multicast packet further includes data, and the multicast information of the second node in the first multicast packet is located between the IP header and the data of the first multicast packet. The unicast encapsulation may include an indication field. The indication field indicates whether unicast-encapsulated information in the multicast packet includes the multicast information. After receiving the multicast packet, the node or the entity may determine, based on the indication field, whether the unicast-encapsulated information in the multicast packet includes the multicast information. For example, if the unicast encapsulation is IPv4 encapsulation, a “protocol” field in an IPv4 header may indicate whether the unicast-encapsulated information in the multicast packet includes the multicast information. If the unicast encapsulation is IPv6 encapsulation, a “next header” field in an IPv6 header may indicate whether the unicast-encapsulated information in the multicast packet includes the multicast information.
It should be noted that, in this embodiment of this disclosure, a source address in unicast encapsulation of a multicast packet sent by a node (for example, node a) to another node (for example, node b) may be an address of node a, or may be an address of a source node in the multicast tree. For example, based on the example shown in
It should be noted that, when the multicast packet in this disclosure does not include unicast encapsulation, the node may determine a next-hop node of the multicast packet by using a multicast routing identifier in the multicast packet. For example, a node receives a multicast packet. When a multicast routing identifier of the node is a bit sequence in the following description, a node corresponding to a bit whose value is 1 in the multicast routing identifier is a next-hop node of the multicast packet, that is, a subnode of the node is the next-hop node of the multicast packet.
In the method provided in this embodiment of this disclosure, multicast routing information is embedded in the multicast packet, multicast routing information of a tree recursive structure included in the multicast packet can describe packet forwarding information of the multicast tree or a subtree of the multicast tree. Therefore, scalability is good, and a forwarding path can be conveniently planned and specified based on a requirement.
The multicast routing identifier of the node mentioned in the foregoing embodiment may be implemented in the following manner 21, manner 22, or manner 23.
Manner 21: A multicast routing identifier of a node includes subnode quantity information of the node and an identifier of each subnode of the node.
In manner 21, optionally, a multicast routing identifier of a node includes a third field and X fourth fields, the third field indicates a quantity X of subnodes of the node, and one fourth field indicates an identifier of one subnode of the node. For example, an ID of the node may be an index of the node, an IP address of the node, or another identifier of the node. For example, the identifier of the node is the index of the node. Referring to (a) in
In manner 21, nodes in a first node set corresponding to a node may have consecutive numbers, for example, 0, 1, 2, and so on. An index of a node may be a number of the node. A node may determine, by using node indexes carried in a multicast routing identifier of the node in a received multicast packet, nodes to which the multicast packet needs to be sent (that is, determine which nodes are subnodes of the node). In actual implementation, numbers of nodes in a first node set corresponding to a node may alternatively be consecutive values starting from another value (for example, 1) (that is, indexes of nodes in the first node set corresponding to the node are 1, 2, 3, . . . ), or may be discrete values. This is not limited in this disclosure. When a node in a first node set corresponding to a node is numbered from 0, a bit width of the fourth field is W=┌log2 N┐, where N is a quantity of nodes in the first node set corresponding to the node. The bit width of the fourth field may alternatively be a fixed bit width, for example, 1 byte.
In manner 21, when a value of the third field is a natural number, a bit width of the third field may be ┌log2 (N+1)┐. When the value of the third field is N−1 (that is, when the value of the third field is 0, it indicates that N is 1, or when the value of the third field is 1, it indicates that N is 2, and so on), the bit width of the third field may be ┌log2 N┐. Alternatively, the third field may be a fixed bit width, for example, 1 byte. In this case, a maximum length of the fourth field is fixed.
In manner 21, the third field may also be referred to as a Cnt field or a Count field. The fourth field may also be referred to as an Idx field or an Index field. In the following description, the third field in manner 21 is referred to as a Cnt field, and the fourth field is referred to as an Idx field.
For example, based on the example shown in
In manner 21, each node may store a multicast forwarding table (or a multicast routing table, a routing forwarding table, or another name). The multicast forwarding table includes a correspondence between a node index in a first node set corresponding to the node and next-hop (nexthop) information (for example, an outbound interface to a next hop and a next-hop address). A node may determine a node index based on an Idx field in the multicast routing identifier, and then look up the multicast forwarding table for the next-hop information and forward the multicast packet to the next hop. For example, based on the example shown in
Manner 22: A multicast routing identifier of a node includes N third fields, where N is a quantity of nodes in a first node set corresponding to the node, and one third field indicates whether a node in the first node set is a subnode of the node in the multicast tree.
In manner 22, one third field may be one bit, that is, a multicast routing identifier of one node (assumed to be node 1) includes N bits. Referring to (b) in
In manner 22, each node may store a multicast forwarding table. The multicast forwarding table includes a correspondence between a bit in a bit sequence and next-hop information (for example, an outbound interface to a next hop and an address of the next hop). A node may determine next-hop information based on a position of a bit in the bit sequence in the multicast forwarding table, and forward the multicast packet to the next hop. The correspondence between a bit in the bit sequence and next-hop information may include four cases. In the first case, a leftmost bit in the bit sequence is the first bit, and bits from left to right are sequentially the first bit, the second bit, the third bit, . . . , and the jth bit in the bit sequence corresponds to an entry whose index is j−1. In the second case, a rightmost bit in the bit sequence is the first bit, and bits from right to left are sequentially the first bit, the second bit, the third bit, . . . , and the jth bit in the bit sequence corresponds to an entry whose index is j−1. In the third case, a leftmost bit in the bit sequence is the first bit, and bits from left to right are sequentially the first bit, the second bit, the third bit, . . . , and the jth bit in the bit sequence corresponds to an entry whose index is j. In the fourth case, a rightmost bit in the bit sequence is the first bit, and bits from right to left are sequentially the first bit, the second bit, the third bit, . . . , and the jth bit in the bit sequence corresponds to an entry whose index is j. j is an integer greater than 0. For example, a bit sequence 010011 is used as an example. Six bits correspond to node A to node F. For a correspondence between a bit in the bit sequence and a next-hop address, refer to
It should be noted that correspondences between bit sequences of different nodes and next-hop information may be different entries in a same table. In this case, indexes of entries corresponding to bit sequences of some nodes do not start from 0 or 1. For example, entries corresponding to a bit sequence of node A1 in (a) in
For example (denoted as example 1), based on the network topology diagram of entities shown in
For example, based on the example shown in
If multicast routing information of node A0 in a multicast packet (denoted as multicast packet A) received by node A0 and a correspondence between a bit in a bit sequence and a next-hop address are (a) in
If multicast routing information of node A0 in a multicast packet (denoted as multicast packet A) received by node A0 and a correspondence between a bit in a bit sequence and a next-hop address are (b) in
(31) Node A0 parses received multicast packet A, obtains multicast routing information of node A0, and parses a set identifier (that is, the first bit) in a multicast routing identifier of node A0. A parsing result is 0, indicating that a first node set corresponding to node A0 is {node B, node C, node D, node E, node F, node G}. In this case, the multicast routing identifier of node A0 further includes six bits subsequently, and node A0 continues to parse the six bits to obtain a bit sequence 111000.
(32) Node A0 traverses the bit sequence 111000, finds non-zero bits, and looks up a multicast forwarding table based on positions of these bits, to learn that a packet needs to be sent to node B, node C, and node D. Because node B, node C, and node D are leaf nodes, node A0 sends a unicast packet to node B, node C, and node D. In unicast encapsulation of a unicast packet sent to node B, a source address is an address of node A0, and a destination address is an address of node B. In unicast encapsulation of a unicast packet sent to node C, a source address is an address of node A0, and a destination address is an address of node C. In unicast encapsulation of a unicast packet sent to node D, a source address is an address of node A0, and a destination address is an address of node D.
Manner 23: A multicast routing identifier of a node includes a third field, the third field includes a first group identifier, the first group identifier indicates a first node group corresponding to the node, and all nodes in the first node group corresponding to the node are subnodes of the node.
The first node group corresponding to the node is a subset of a first node set corresponding to the node. Nodes in the first node set corresponding to the node may form at least one node group. One node in the first node set may be located in one node group, or may be located in a plurality of node groups. Which nodes form one node group may be preconfigured. One node group corresponds to one group identifier (ID) (GID). In this case, referring to (c) in
For example (denoted as example 2), based on the example shown in
Similar to manner 21 and manner 22, in manner 23, each node may also store a multicast forwarding table, and the multicast forwarding table includes a correspondence between a group identifier of a node group and next-hop information (for example, an outbound interface to a next hop and an address of the next hop). The next hop herein is a node in the node group corresponding to the group identifier. In this case, a node may determine, based on the multicast routing identifier and the correspondence in the multicast forwarding table, to which nodes a multicast packet is to be forwarded. Based on example 1, for an example of the multicast forwarding table of node R, refer to Table 2.
It may be understood that the multicast routing identifiers in the foregoing manner 21, manner 22, and manner 23 may be converted mutually. For example, the GID in manner 23 may be converted into the bit sequence in manner 22 or the multicast routing identifier in manner 21. For example, the multicast routing identifier (that is, identifier 2) of node R in the foregoing example 2 may be converted into the multicast routing identifier (that is, 0011) of node R in the foregoing example 1.
The multicast routing identifiers in the foregoing manner 21, manner 22, and manner 23 may be respectively referred to as a first-type multicast routing identifier, a second-type multicast routing identifier, and a third-type multicast routing identifier. A length of a multicast routing identifier of one node in the foregoing manner 21, manner 22, and manner 23 may be statically maintained in the node. A node (for example, a source node) that generates the first multicast packet in the multicast tree or a controller may maintain lengths of multicast routing identifiers of all nodes in the multicast tree.
In the foregoing manner 21, in a multicast scenario in which density of nodes in the multicast tree is extremely low, encapsulation efficiency of the multicast packet is optimal. In the foregoing manner 22, in a multicast scenario in which density of nodes in the multicast tree is high, encapsulation efficiency is optimal. In the foregoing manner 23, in a multicast scenario in which density of nodes in the multicast tree is highest, encapsulation efficiency is optimal.
Optionally, a multicast routing identifier of a node further includes a type field, and the type field indicates a type of the multicast routing identifier of the node. The types of multicast routing identifiers include the first-type multicast routing identifier, the second-type multicast routing identifier, and the third-type multicast routing identifier. In this case, the node that receives the multicast packet may determine, based on the type of the multicast routing identifier, how to identify the multicast routing identifier. For example, when the multicast routing identifier further includes the type field, for the multicast routing identifiers in manner 21, manner 22, and manner 23, refer to (a) in
In actual implementation, a unique type of multicast routing identifier may be used (in this case, the type field is not required), or a type of multicast routing identifier to be used may be indicated by using the type field. In addition, it should be noted that the type field may be considered as a part of the multicast routing identifier, or may be considered as a field independent of the multicast routing identifier. This is not limited in this disclosure. In a multicast packet, types of multicast routing identifiers of different nodes may be the same or may be different. This is not limited in this disclosure.
Optionally, a multicast routing identifier of a node further includes a multicast routing identifier length field and/or a node type field. The multicast routing identifier length field indicates a length of the multicast routing identifier. The node type field indicates a node type. Node types include a single-entity node and a multi-entity node. The single-entity node means that the node includes one entity, and the multi-entity node means that the node includes a plurality of entities. Similar to the type field, the multicast routing identifier length field and/or the node type field may be considered as a part of the multicast routing identifier, or may be considered as a field independent of the multicast routing identifier. This is not limited in this disclosure.
The type field, the multicast routing identifier length field, and the node type field may be collectively referred to as a description field or a dscr field. These fields may have other names. This is not limited in this disclosure.
The addressing field mentioned in the foregoing embodiment may be implemented in the following manner 31, manner 32, or manner 33.
Manner 31: An addressing field of a node indicates a length of multicast routing information of a non-leaf subnode of the node.
It is assumed that the node is node 1, and that there are M non-leaf subnodes of node 1. An addressing field of node 1 may include M−1 or M fields (the field is denoted as a fifth field), one fifth field indicates a length of multicast routing information of a non-leaf subnode of node 1 (the length is denoted as Y), and a bit width of the fifth field may be ┌log2 Y┐ (in this case, the length indicated by the fifth field is a sum of a value of the fifth field and 1), or ┌log2 (Y+1)┐ (in this case, the length indicated by the fifth field is the value of the fifth field), or a fixed bit width (for example, 1 byte or 2 bytes). For multicast information of node 1, refer to
In the first case, the addressing field of node 1 may indicate lengths of M−1 recursive units of node 1. The M−1 recursive units may be any M−1 recursive units among the M recursive units. In this case, another recursive unit among the M recursive units may be obtained through calculation based on a length indicated by the first field. For example, referring to
In the second case, referring to
In manner 31, node 1 may determine a start position of recursive unit 0 based on the first field, the multicast routing identifier, and the length of the addressing field, and then determine a start position and/or an end position of each recursive unit based on the length of each recursive unit. The position mentioned in this disclosure may be an offset relative to a start position of the multicast information, or may be an offset relative to another position in the multicast packet. For example, based on the example shown in
Manner 32: An addressing field of a node indicates a start position or an end position of multicast routing information of a non-leaf subnode of the node.
It is assumed that the node is node 1, and that there are M non-leaf subnodes of node 1. An addressing field of node 1 may include M−1 or M fields (the field is denoted as a fifth field), and one fifth field indicates a start position or an end position of multicast routing information of a non-leaf subnode of node 1. The fifth field may be several fixed bits (for example, four bits) or several fixed bytes (for example, one byte). For ease of description, the following describes manner 32 by using an example in which the fifth field indicates the start position. A principle when the fifth field indicates the end position is similar, and may be understood with reference. For the multicast information of node 1, refer to (a) in
Manner 32 may be implemented in the following manner a or manner b.
Manner a: The addressing field of node 1 indicates start positions of M−1 recursive units of node 1.
In manner a, the M−1 recursive units may be recursive unit 1 to recursive unit M−1, that is, the addressing field of node 1 indicates O1, O2, . . . , OM-M-1. In a first possible implementation of manner a, referring to (a) in
In manner a, node 1 may determine a start position of recursive unit 0 based on lengths of the first field (or the sixth field), the multicast routing identifier, and the addressing field, determine start positions of recursive unit 1 to recursive unit M−1 and lengths of recursive unit 0 to recursive unit M−2 based on the addressing field, and then determine the length of recursive unit M−1 based on the first field (or the sixth field). The position mentioned in this disclosure is similar to that in manner 31, and may be understood with reference. Details are not described again. For example, based on the example shown in (b) in
Manner b: The addressing field of node 1 indicates start positions of M recursive units of node 1.
In manner b, the addressing field of node 1 indicates O0, O1, . . . , OM-M-1. In this case, node 1 may determine start positions of recursive unit 0 to recursive unit M−1 and lengths of recursive unit 0 to recursive unit M−2 based on the addressing field, and then determine the length of recursive unit M−1 based on the first field or the sixth field. The position mentioned in this disclosure is similar to that in manner 31, and may be understood with reference. Details are not described again. For example, based on the example shown in (c) in
Manner 33: An addressing field of a node includes a plurality of delimitation fields, and multicast routing information of a non-leaf subnode of the node is separated by the plurality of delimitation fields.
It is assumed that the node is node 1, and that there are M non-leaf subnodes of node 1. The addressing field of node 1 may include M−1 delimitation fields, and a length of the delimitation field may be preconfigured. For multicast information of node 1, refer to
In manner 33, node 1 may determine a start position of recursive unit 0 based on lengths of the first field (or the sixth field) and the multicast routing identifier, determine start positions of recursive unit 1 to recursive unit M−1 and lengths of recursive unit 0 to recursive unit M−2 based on the delimitation fields, and then determine the length of recursive unit M−1 based on the first field (or the sixth field). The position mentioned in this disclosure is similar to that in manner 31, and may be understood with reference. Details are not described again. For example, based on the example shown in
In the foregoing embodiment, the method provided in this disclosure is described by using an example in which the second node is a non-leaf subnode of the first node in the multicast tree. The second node may alternatively be a leaf subnode of the first node. In this case, the multicast packet sending method provided in this disclosure may be implemented by using a method shown in
1901. A first node receives a seventh multicast packet, where the seventh multicast packet includes multicast information and data of the first node.
For the description of the multicast information of the first node, refer to the foregoing description. Details are not described again. If the first node is not a source node of a multicast tree, the first node may receive the seventh multicast packet sent by another node in the multicast tree.
1902. If the first node determines that a second node is a leaf subnode of the first node, the first node extracts data in the seventh multicast packet.
For a process in which the first node determines whether a node is a leaf subnode of the first node, refer to related descriptions in step (12). Details are not described again. It may be understood that if the second node is a leaf node of the first node, the second node does not need to forward the multicast packet in multicast mode. Therefore, the first node may send data to the second node. In other words, the packet sent by the first node to the second node is a unicast packet.
1903. The first node assembles a first unicast packet based on the data.
1904. The first node sends the first unicast packet to the second node. Correspondingly, the second node receives the first unicast packet from the first node.
The methods provided in the foregoing embodiments are all described as examples of the method provided in this disclosure from a perspective of a node. A node may include a plurality of entities. In this case, after receiving a multicast packet, an entity in a node may process the multicast packet by using a method shown in
2001. The first entity receives a third multicast packet, where the third multicast packet includes first multicast routing information of the first node.
The first multicast routing information of the first node includes a first multicast routing identifier of the first node and multicast routing information of a non-leaf subnode corresponding to the first multicast routing identifier of the first node, and the first multicast routing identifier of the first node is the same as a multicast routing identifier of the first node or is obtained by updating a multicast routing identifier of the first node. For the description of the multicast routing information of the node, refer to the foregoing description. Details are not described again.
It can be learned from the foregoing function and description of the multicast routing identifier that, if the multicast routing identifier is a bit sequence, or a Cnt field plus an Idx field, a multicast routing identifier of a node has a bit or an Idx field corresponding to each subnode (including a non-leaf subnode and a leaf subnode). Because the first multicast routing identifier is derived from the multicast routing identifier, the non-leaf subnode corresponding to the first multicast routing identifier of the first node is a non-leaf subnode among subnodes corresponding to bits or Idx fields in the first multicast routing identifier.
The first entity is an entity in the first node. The first entity may receive the third multicast packet from another node other than the first node, or may receive the third multicast packet from another entity in the first node. This is not limited in this disclosure. If the first entity receives the third multicast packet from another node other than the first node, the first multicast routing information of the first node is the same as multicast routing information of the first node. If the first entity receives the third multicast packet from another entity in the first node, the first multicast routing identifier of the first node may be the same as the multicast routing identifier of the first node, or may be obtained by updating the multicast routing identifier of the first node. The first multicast routing information may be obtained through calculation according to a method for processing a multicast packet between the first entity and a second entity. For a specific example, refer to the following description. Details are not described again.
2002. The first entity determines a second entity based on the first multicast routing identifier of the first node, where the second entity is an entity in the first node.
In specific implementation, step 2002 may include that the first entity looks up a multicast forwarding table based on the first multicast routing identifier of the first node, to obtain the second entity. It should be noted that the first entity may obtain a plurality of second entities based on the first multicast routing identifier of the first node. The second entity herein may be any one of the second entities. In this disclosure, an example in which the first entity forwards a multicast packet to one second entity is used for description. When actually processing the multicast packet, the first node may forward the multicast packet to each second entity.
For example, if the first multicast routing identifier is a bit sequence, a next hop corresponding to a bit whose value is 1 in the first multicast routing identifier in the multicast forwarding table is the second entity. If the first multicast routing identifier is a Cnt field plus an Idx field, a next hop corresponding to a value of an Idx field in the multicast forwarding table is the second entity.
2003. The first entity sends a fourth multicast packet to the second entity, where the fourth multicast packet includes second multicast routing information of the first node.
The second multicast routing information of the first node includes a second multicast routing identifier of the first node and multicast routing information of a part or all of non-leaf subnodes corresponding to a third multicast routing identifier of the first node. The third multicast routing identifier of the first node is the same as the first multicast routing identifier of the first node or is obtained by updating the first multicast routing identifier of the first node, and the second multicast routing identifier of the first node is the same as the third multicast routing identifier of the first node or is obtained by updating the third multicast routing identifier of the first node.
Further, in the following case 1 and case 2, the first entity needs to update the first multicast routing identifier of the first node to obtain the third multicast routing identifier of the first node. In another case, the third multicast routing identifier of the first node is the same as the first multicast routing identifier of the first node. The following describes case 1 and case 2 and an update method by using examples.
Case 1: The first entity belongs to a subnode (assumed to be subnode 1) of the first node.
In case 1, if the first multicast routing identifier is a bit sequence, the first entity sets a bit corresponding to subnode 1 to 0, to obtain the third multicast routing identifier. If the first multicast routing identifier is a Cnt field plus an Idx field, the first entity deletes the Idx field corresponding to subnode 1, and subtracts 1 from a value of the Cnt field to obtain the third multicast routing identifier.
For example, referring to
Case 2: The first entity does not belong to any subnode of the first node, but the multicast packet can reach one or more subnodes (assumed to be Q subnodes) of the first node only after being forwarded by the first entity in multicast mode.
In case 2, if the first multicast routing identifier is a bit sequence, the first entity sets a bit corresponding to the Q subnodes to 0, to obtain the third multicast routing identifier. If the first multicast routing identifier is a Cnt field plus an Idx field, the first entity deletes the Idx field corresponding to the Q subnodes, and subtracts Q from a value of the Cnt field to obtain the third multicast routing identifier.
For example, referring to
Further, in the following case 3, the first entity needs to update the third multicast routing identifier of the first node to obtain the second multicast routing identifier of the first node. In another case, the second multicast routing identifier of the first node is the same as the third multicast routing identifier of the first node. The following describes the case 3 and the update method by using an example.
Case 3: The first entity needs to forward the multicast packet to a plurality of second entities.
In case 3, for any second entity, if the third multicast routing identifier is a bit sequence, the first entity needs to set a bit that is in the third multicast routing identifier of the first node and that corresponds to a subnode other than P subnodes to 0, to obtain the second multicast routing identifier. If the third multicast routing identifier is a Cnt field plus an Idx field, the first entity deletes the Idx field corresponding to other subnodes than the P subnodes, and subtracts P from a value of the Cnt field to obtain the second multicast routing identifier. The P subnodes are one or more subnodes of the first node, and these subnodes can receive a multicast packet only after the multicast packet is forwarded by the second entity in multicast mode.
For example, referring to (b) in
It should be noted that whether the second multicast routing information of the first node includes multicast routing information of a part or all of non-leaf subnodes corresponding to the third multicast routing identifier of the first node depends on a quantity of second entities to which the first entity needs to send a multicast packet. If the first entity needs to send a multicast packet to one second entity, the second multicast routing information of the first node includes multicast routing information of all non-leaf subnodes corresponding to the third multicast routing identifier of the first node. If the first entity needs to send a multicast packet to two or more second entities, the second multicast routing information of the first node includes multicast routing information of some non-leaf subnodes corresponding to the third multicast routing identifier of the first node.
Optionally, the method further includes the following:
It should be noted that an example in which the first subnode is a non-leaf subnode of the first node is used for description herein. If the first subnode is a leaf subnode of the first node, the first entity sends a unicast packet to a third entity of the first subnode.
The subnode corresponding to the first entity is a subnode that can be processed by the first entity. When the first entity belongs to a subnode of the first node, the first subnode is the subnode. When the first entity does not belong to any subnode of the first node, the first subnode is any one of the Q subnodes. In this disclosure, an example in which the first entity sends a multicast packet to one first subnode is used for description. In actual implementation, the first entity may send a multicast packet to each first subnode.
Optionally, when the first entity does not belong to the first subnode, in specific implementation, step (42) may include that the first entity sends the fifth multicast packet to a third entity in the first subnode.
Optionally, when the first entity belongs to the first subnode, the method further includes that the first entity determines a second subnode based on a multicast routing identifier of the first subnode, where the second subnode is a subnode corresponding to the first entity, among subnodes of the first subnode in the multicast tree. In a subsequent process, the first entity sends a packet to the second subnode. If the second subnode is a leaf subnode of the first subnode, the packet is a unicast packet, and the packet includes data in the third multicast packet. If the second subnode is a non-leaf subnode of the first subnode, the packet is a multicast packet (which may be denoted as an eighth multicast packet), and the eighth multicast packet includes multicast routing information and data of the second subnode. For example, referring to (b) in
Optionally, when the first entity belongs to the first subnode, and the first subnode further includes a fourth entity, the method further includes that the first entity sends a sixth multicast packet to the fourth entity, where the sixth multicast packet includes first multicast routing information of the first subnode, the first multicast routing information of the first subnode includes a first multicast routing identifier of the first subnode and multicast routing information of a part or all of non-leaf subnodes corresponding to a second multicast routing identifier of the first subnode, the second multicast routing identifier of the first subnode is the same as a multicast routing identifier of the first subnode or is obtained by updating a multicast routing identifier of the first subnode, and the first multicast routing identifier of the first subnode is the same as the second multicast routing identifier of the first subnode or is obtained by updating the second multicast routing identifier of the first subnode.
It should be noted that, in the embodiment shown in
To make the embodiment shown in
In the first case, referring to
In the first case, a process of sending a multicast packet by each entity in node D1 is as follows:
(51) If receiving multicast packet A, and determining that a value of the first bit in a multicast routing identifier (that is, 110101) of node D1 in multicast packet A is 1, entity A looks up multicast forwarding table 1 (referring to Table 7) based on last five bits in the multicast routing identifier of node D1, and determines that the first bit (that is, the first bit) whose value is 1 among the five bits corresponds to entity A (that is, entity A) and that the other bits whose values are 1 correspond to entity B.
(52) After finding entity A (that is, entity A), entity A obtains multicast routing information of a node (that is, node A) corresponding to the first bit (that is, the first bit) whose value is 1 among the five bits, and determines that a value of the first bit in the multicast routing identifier (that is, 0101) of node A is 0. In this case, entity A looks up multicast forwarding table 2 based on the last three bits in the multicast routing identifier of node A (referring to Table 8). If it is determined that a bit whose value is 1 among the three bits corresponds to entity 0 and entity Q, entity A sends unicast packet B to entity 0 and entity Q, where unicast packet B includes data in multicast packet A.
(53) After finding entity B, entity A sends multicast packet C to entity B, where multicast packet C includes multicast routing identifier 1 (that is, 100101) of node D1, an addressing field of node D1, multicast routing information of node C, and multicast routing information and data of node E. For multicast routing information 1 of node D1 in multicast packet C, refer to
It should be noted that, because the multicast routing information of node A is processed by entity A, before sending multicast packet C, entity A updates the multicast routing identifier of node D1 to multicast routing identifier 1 of node D1.
(54) If receiving multicast packet C, and determining that a value of the first bit in multicast routing identifier 1 (that is, 100101) of node D1 in multicast packet C is 1, entity B looks up multicast forwarding table 1 (referring to Table 9) based on the last five bits in multicast routing identifier 1 of node D1, determines that all bits whose values are 1 among the five bits correspond to entity C, and sends multicast packet C to entity C.
(55) If receiving multicast packet C, and determining that a value of the first bit in a multicast routing identifier (that is, 100101) of node D1 in multicast packet C is 1, entity C looks up multicast forwarding table 1 (referring to Table 10) based on last five bits in the multicast routing identifier of node D1, and determines that the first bit (that is, the third bit) whose value is 1 among the five bits corresponds to entity C (that is, entity C) and that the other bits whose values are 1 correspond to entity D.
(56) After finding entity C (that is, entity C), entity C obtains multicast routing information of a node (that is, node C) corresponding to the first bit (that is, the third bit) whose value is 1 among the five bits, and determines that a value of the first bit in the multicast routing identifier (that is, 0011) of node C is 0. In this case, entity C looks up multicast forwarding table 2 (referring to Table 11) based on the last three bits in the multicast routing identifier of node C. If it is determined that a bit whose value is 1 among the three bits corresponds to entity S and entity T, entity C sends a packet to entity S and entity T. Unicast packet D sent to entity S includes data in multicast packet A, and multicast packet D sent to entity T includes multicast routing information and data of node T in multicast packet A. For multicast information of node T included in multicast packet D, refer to
Node T receives multicast packet D, looks up a multicast forwarding table (referring to Table 12) based on multicast routing identifier 110 of node T in multicast packet D, determines that a bit whose value is 1 among the three bits corresponds to entity X and entity Y, and sends unicast packet E to entity X and entity Y, where unicast packet E includes data in multicast packet A.
(57) After finding entity D, entity C sends multicast packet F to entity D, where multicast packet F includes multicast routing identifier 2 (that is, 100001) of node D1, and multicast routing information and data of node E. For multicast routing information 2 of node D1 in multicast packet F, refer to
It should be noted that, because the multicast routing information of node C is processed by entity C, before sending multicast packet F, entity C updates multicast routing identifier 1 of node D1 to multicast routing identifier 2 of node D1.
(58) If receiving multicast packet F, and determining that a value of the first bit in multicast routing identifier 2 (that is, 100001) of node D1 in multicast packet F is 1, entity D looks up multicast forwarding table 1 (referring to Table 13) based on the last five bits in multicast routing identifier 2 of node D1, determines that a bit whose value is 1 among the five bits corresponds to entity E, and sends multicast packet F to entity E.
(59) If receiving multicast packet F, and determining that a value of the first bit in multicast routing identifier 2 (that is, 100001) of node D1 in multicast packet F is 1, entity E looks up multicast forwarding table 1 (referring to Table 14) based on the last five bits in multicast routing identifier 2 of node D1, determines that a bit whose value is 1 among the five bits corresponds to entity E (that is, entity E), obtains multicast routing information of a node (that is, node E) corresponding to the first bit whose value is 1 (that is, the fifth bit) among the five bits, and determines that a value of the first bit in the multicast routing identifier (that is, 0110) of node E is 0. In this case, entity E looks up multicast forwarding table 2 (referring to Table 15) based on the last three bits in the multicast routing identifier of node E, determines that a bit whose value is 1 among the three bits corresponds to entity U and entity V, and sends unicast packet G to entity U and entity V, where unicast packet G includes data in multicast packet A.
In the second case, referring to
In the second case, a process of sending a multicast packet by each entity in node D1 is as follows:
(61) Entity A receives multicast packet A, looks up a multicast forwarding table (referring to Table 16) based on the multicast routing identifier (that is, 101011110) of node D1 in multicast packet A, and determines that the first and second bits whose values are 1 among the nine bits correspond to entity O and entity Q and that the other bits whose values are 1 correspond to entity B.
(62) After finding entity O and entity Q, entity A sends unicast packet B to entity O and entity Q, where unicast packet B includes data in multicast packet A.
(63) After finding entity B, entity A sends multicast packet C to entity B, where multicast packet C includes multicast routing identifier 1 (that is, 000011110) of node D1, and multicast routing information and data of node T. For multicast routing information 1 of node D1 in multicast packet C, refer to
It should be noted that, because the first three bits in the multicast routing identifier of node D1 are processed by entity A, before sending multicast packet C, entity A updates the multicast routing identifier of node D1 to multicast routing identifier 1 of node D1.
(64) Entity B receives multicast packet C, looks up a multicast forwarding table (referring to Table 17) based on multicast routing identifier 1 (that is, 000011110) of node D1 in multicast packet C, determines that all bits whose values are 1 among the nine bits correspond to entity C, and sends multicast packet C to entity C.
(65) Entity C receives multicast packet C, looks up a multicast forwarding table (referring to Table 18) based on multicast routing identifier 1 (that is, 000011110) of node D1 in multicast packet C, and determines that the first and second bits whose values are 1 among the nine bits correspond to entity S and entity T and that the other bits whose values are 1 correspond to entity D.
(66) After finding entity S and entity T, entity C sends unicast packet D to entity S, where unicast packet D includes data in multicast packet A, and entity C sends multicast packet D to entity T, where multicast packet D includes multicast routing information and data of node T in multicast packet A. Entity T receives multicast packet D, looks up a multicast forwarding table (referring to Table 12) based on multicast routing identifier 110 of node T in multicast packet D, determines that a bit whose value is 1 among the three bits corresponds to entity X and entity Y, and sends unicast packet E to entity X and entity Y, where unicast packet E includes data in multicast packet A.
(67) After finding entity D, entity C sends multicast packet E to entity D, where multicast packet E includes multicast routing identifier 2 (that is, 000000110) and data of node D1. For multicast routing information 2 of node D1 in multicast packet E, refer to
It should be noted that, because the middle three bits in the multicast routing identifier of node D1 are processed by entity C, before sending multicast packet E, entity C updates multicast routing identifier 1 of node D1 to multicast routing identifier 2 of node D1.
(68) Entity D receives multicast packet E, looks up a multicast forwarding table (referring to Table 19) based on multicast routing identifier 2 (that is, 000000110) of node D1 in multicast packet E, determines that all bits whose values are 1 among the nine bits correspond to entity E, and sends multicast packet E to entity E.
(69) Entity E receives multicast packet E, looks up a multicast forwarding table (referring to Table 20) based on multicast routing identifier 2 (that is, 000000110) of node D1 in multicast packet E, determines that a bit whose value is 1 among the nine bits corresponds to entity U and entity V, and sends unicast packet F to entity U and entity V, where unicast packet F includes data in multicast packet A.
In the third case, referring to
(71) If receiving multicast packet A, and determining that a value of the first bit in a multicast routing identifier (that is, 1101101) of node D1 in multicast packet A is 1, entity A looks up the multicast forwarding table (referring to Table 21) based on last six bits in the multicast routing identifier of node D1, and determines that the first and second bits whose values are 1 among the six bits correspond to entity O and entity Q and that the other bits whose values are 1 correspond to entity B.
(72) After finding entity O and entity Q, entity A sends unicast packet B to entity O and entity Q, where unicast packet B includes data in multicast packet A.
(73) After finding entity B, entity A sends multicast packet C to entity B, where multicast packet C includes multicast routing identifier 1 (that is, 1000101) of node D1, multicast routing information of node C, and multicast routing information and data of node E. For multicast routing information 1 of node D1 in multicast packet C, refer to
It should be noted that, because the first three bits in the multicast routing identifier of node D1 are processed by entity A, before sending multicast packet C, entity A updates the multicast routing identifier of node D1 to multicast routing identifier 1 of node D1.
(74) If receiving multicast packet C, and determining that a value of the first bit in multicast routing identifier 1 (that is, 1000101) of node D1 in multicast packet C is 1, entity B looks up the multicast forwarding table (referring to Table 22) based on the last six bits in multicast routing identifier 1 of node D1, determines that all bits whose values are 1 among the six bits correspond to entity C, and sends multicast packet C to entity C.
(75) If receiving multicast packet C, and determining that a value of the first bit in multicast routing identifier 1 (that is, 1000101) of node D1 in multicast packet C is 1, entity C looks up multicast forwarding table 1 (referring to Table 23) based on last six bits in multicast routing identifier 1 of node D1, and determines that the first bit (that is, the fourth bit) whose value is 1 among the six bits corresponds to entity C (that is, entity C) and that the other bits whose values are 1 correspond to entity D.
(76) After finding entity C (that is, entity C), entity C obtains multicast routing information of a node (that is, node C) corresponding to the first bit (that is, the fourth bit) whose value is 1 among the six bits, and determines that a value of the first bit in the multicast routing identifier (that is, 0011) of node C is 0. In this case, entity C looks up multicast forwarding table 2 (referring to Table 11) based on the last three bits in the multicast routing identifier of node C. If it is determined that a bit whose value is 1 among the three bits corresponds to entity S and entity T, entity C sends a packet to entity S and entity T. Unicast packet D sent to entity S includes data in multicast packet A, and multicast packet D sent to entity T includes multicast routing information and data of node T in multicast packet A. For multicast information of node T included in multicast packet D, refer to
Node T receives multicast packet D, looks up a multicast forwarding table (referring to Table 12) based on multicast routing identifier 110 of node T in multicast packet D, determines that a bit whose value is 1 among the three bits corresponds to entity X and entity Y, and sends unicast packet E to entity X and entity Y, where unicast packet E includes data in multicast packet A.
(77) After finding entity D, entity C sends multicast packet F to entity D, where multicast packet F includes multicast routing identifier 2 (that is, 1000001) of node D1, and multicast routing information and data of node E. For multicast routing information 2 of node D1 in multicast packet F, refer to
It should be noted that, because the multicast routing information of node C is processed by entity C, before sending multicast packet F, entity C updates multicast routing identifier 1 of node D1 to multicast routing identifier 2 of node D1.
(78) If receiving multicast packet F, and determining that a value of the first bit in multicast routing identifier 2 (that is, 1000001) of node D1 in multicast packet F is 1, entity D looks up multicast forwarding table 1 (referring to Table 24) based on the last six bits in multicast routing identifier 2 of node D1, determines that a bit whose value is 1 among the six bits corresponds to entity E, and sends multicast packet F to entity E.
(79) If receiving multicast packet F, and determining that a value of the first bit in multicast routing identifier 2 (that is, 1000001) of node D1 in multicast packet F is 1, entity E looks up multicast forwarding table 1 (referring to Table 25) based on the last six bits in multicast routing identifier 2 of node D1, determines that a bit whose value is 1 among the six bits corresponds to entity E (that is, entity E), obtains multicast routing information of a node (that is, node E) corresponding to the first bit whose value is 1 (that is, the sixth bit) among the six bits, and determines that a value of the first bit in the multicast routing identifier (that is, 0110) of node E is 0. In this case, entity E looks up multicast forwarding table 2 (referring to Table 15) based on the last three bits in the multicast routing identifier of node E, determines that a bit whose value is 1 among the three bits corresponds to entity U and entity V, and sends unicast packet G to entity U and entity V, where unicast packet G includes data in multicast packet A.
Based on the topological connection and the multicast tree of a part of the entities shown in (a) in
In (a) in
A process of sending a multicast packet by each entity in node Z is as follows:
(81) If receiving multicast packet A, and determining that a value of the first bit in a multicast routing identifier (that is, 10111) of node Z in multicast packet A is 1, entity A looks up multicast forwarding table 1 (referring to Table 26) based on last four bits in the multicast routing identifier of node Z, and determines that the first and second bits (that is, the second and third bits) whose values are 1 among the four bits correspond to entity C and that the third bit (that is, the fourth bit) whose value is 1 corresponds to entity B.
(82) Entity A sends multicast packet B to entity B, and sends multicast packet C to entity C. Multicast packet B includes multicast routing identifier 1 (that is, 10001) of node Z. For multicast routing information 1 of node Z in multicast packet B, refer to (b) in
Because entity B does not process the second and third bits among the last four bits in the multicast routing identifier of node Z, before sending multicast packet B, entity A may update the multicast routing identifier of node Z to multicast routing identifier 1 of node Z. Because entity C does not process the fourth bit among the last four bits in the multicast routing identifier of node Z, before sending multicast packet C, entity A may update the multicast routing identifier of node Z to multicast routing identifier 2 of node Z.
(83) If receiving multicast packet B, and determining that a value of the first bit in multicast routing identifier 1 (that is, 10001) of node Z in multicast packet B is 1, entity B looks up multicast forwarding table 1 (referring to Table 27) based on the last four bits in multicast routing identifier 1 of node Z, determines that the first bit (that is, the fourth bit) whose value is 1 among the four bits corresponds to entity D, and sends multicast packet B to entity D. If receiving multicast packet B, and determining that a value of the first bit in multicast routing identifier 1 (that is, 10001) of node Z in multicast packet B is 1, entity D looks up multicast forwarding table 1 (referring to Table 28) based on the last fourth bits in multicast routing identifier 1 of node Z, determines that the first bit (that is, the fourth bit) whose value is 1 among the four bits corresponds to entity V, and sends unicast packet D to entity V, where unicast packet D includes data in multicast packet A.
(84) If receiving multicast packet C, and determining that a value of the first bit in multicast routing identifier 2 (that is, 10110) of node Z in multicast packet C is 1, entity C looks up multicast forwarding table 1 (referring to Table 29) based on the last four bits in multicast routing identifier 2 of node Z, determines that the first bit (that is, the second bit) whose value is 1 among the four bits corresponds to entity R, sends unicast packet E to entity R, where unicast packet E includes data in multicast packet A, and the second bit (that is, the third bit) whose value is 1 corresponds to entity E, and sends multicast packet F to entity E. Multicast packet F includes multicast routing identifier 3 (that is, 10010) of node Z.
It should be noted that, before sending multicast packet F, entity C has processed the second bit among the last four bits of multicast routing identifier 2 of node Z, and therefore updates multicast routing identifier 2 of node Z to multicast routing identifier 3 of node Z.
(85) If receiving multicast packet F, and determining that a value of the first bit in multicast routing identifier 3 (that is, 10010) of node Z in multicast packet F is 1, entity E looks up multicast forwarding table 1 (referring to Table 30) based on the last four bits in multicast routing identifier 3 of node Z, determines that a bit (that is, the third bit) whose value is 1 among the four bits corresponds to entity E (that is, entity E), and determines that a value of the first bit in the multicast routing identifier (that is, 011) of node E is 0. In this case, entity E looks up multicast forwarding table 2 (referring to Table 31) based on the last two bits in the multicast routing identifier of node E, obtains entity S and entity T, and sends unicast packet G to entity S and entity T, where unicast packet G includes data in multicast packet A.
Based on the topological connection and the multicast tree of a part of the entities shown in (b) in
In (b) in
A process of sending a multicast packet by each entity in node Z is as follows:
(91) If receiving multicast packet A, and determining that a value of the first bit in a multicast routing identifier (that is, 110111) of node Z in multicast packet A is 1, entity A looks up multicast forwarding table 1 (referring to Table 32) based on last five bits in the multicast routing identifier of node Z, and determines that the first bit (that is, the first bit) whose value is 1 among the five bits corresponds to entity A, and that the second bit (that is, the third bit) whose value is 1 and the third bit (that is, the fourth bit) whose value is 1 correspond to entity C, and that the fourth bit (that is, the fifth bit) whose value is 1 corresponds to entity B.
(92) After finding entity A (that is, entity A), entity A obtains multicast routing information of a node (that is, node X) corresponding to the first bit (that is, the first bit) whose value is 1 among the five bits, looks up a multicast forwarding table (referring to Table 33) based on a multicast routing identifier (that is, 1) of node X, determines entity O, and sends unicast packet H to entity O, where unicast packet H includes data in multicast packet A.
(93) Entity A sends multicast packet B to entity B, and sends multicast packet C to entity C. Multicast packet B includes multicast routing identifier 1 (that is, 100001) of node Z. For multicast routing information 1 of node Z in multicast packet B, refer to (b) in
Because entity B does not process the third and fourth bits among the last five bits in the multicast routing identifier of node Z, before sending multicast packet B, entity A may update the multicast routing identifier of node Z to multicast routing identifier 1 of node Z. Because entity C does not process the fifth bit among the last five bits in the multicast routing identifier of node Z, before sending multicast packet C, entity A may update the multicast routing identifier of node Z to multicast routing identifier 2 of node Z.
(94) If receiving multicast packet B, and determining that a value of the first bit in multicast routing identifier 1 (that is, 100001) of node Z in multicast packet B is 1, entity B looks up multicast forwarding table 1 (referring to Table 34) based on the last five bits in multicast routing identifier 1 of node Z, determines that the first bit (that is, the fifth bit) whose value is 1 among the five bits corresponds to entity D, and sends multicast packet B to entity D. If receiving multicast packet B, and determining that a value of the first bit in multicast routing identifier 1 (that is, 100001) of node Z in multicast packet B is 1, entity D looks up multicast forwarding table 1 (referring to Table 35) based on the last five bits in multicast routing identifier 1 of node Z, determines that the first bit (that is, the fifth bit) whose value is 1 among the five bits corresponds to entity V, and sends unicast packet D to entity V, where unicast packet D includes data in multicast packet A.
(95) If receiving multicast packet C, and determining that a value of the first bit in multicast routing identifier 2 (that is, 100110) of node Z in multicast packet C is 1, entity C looks up multicast forwarding table 1 (referring to Table 36) based on the last five bits in multicast routing identifier 2 of node Z, determines that the first bit (that is, the third bit) whose value is 1 among the five bits corresponds to entity R, sends unicast packet E to entity R, where unicast packet E includes data in multicast packet A, and the second bit (that is, the fourth bit) whose value is 1 corresponds to entity E, and sends multicast packet F to entity E. Multicast packet F includes multicast routing identifier 3 (that is, 100010) of node Z.
It should be noted that, before sending multicast packet F, entity C has processed the third bit among the last five bits of multicast routing identifier 2 of node Z, and therefore updates multicast routing identifier 2 of node Z to multicast routing identifier 3 of node Z.
(96) If receiving multicast packet F, and determining that a value of the first bit in multicast routing identifier 3 (that is, 100010) of node Z in multicast packet F is 1, entity E looks up multicast forwarding table 1 (referring to Table 37) based on the last five bits in multicast routing identifier 3 of node Z, determines that a bit (that is, the fourth bit) whose value is 1 among the five bits corresponds to entity E (that is, entity E), obtains multicast routing information of a node (that is, node E) corresponding to the fourth bit among the last five bits in multicast routing identifier 3 of node Z, and determines that a value of the first bit in the multicast routing identifier (that is, 011) of node E is 0. In this case, entity E looks up multicast forwarding table 2 (referring to Table 38) based on the last two bits in the multicast routing identifier of node E, obtains entity S and entity T, and sends unicast packet G to entity S and entity T, where unicast packet G includes data in multicast packet A.
Compared with PIM-SM, the method provided in the foregoing embodiment of this disclosure has the following advantages:
1. A quantity of entries in a multicast forwarding table in a node does not increase as a quantity of multicast streams increases. Therefore, even if the quantity of multicast streams is large, it is not necessary to extend more table space in a router to support forwarding of a multicast packet. Therefore, scalability is good.
2. The multicast packet is generated from a source node, and the multicast packet includes multicast routing information of a non-leaf subnode. Therefore, a forwarding path may be actively controlled by adjusting the multicast packet. For example, if there are a plurality of paths, a controller or the source node may select an optimal path by using a control plane algorithm.
3. The multicast packet is generated from the source node. Therefore, when a node joins or leaves a multicast tree, the source node can learn the case, and manageability is high. For example, the source node may collect user preferences by using an application layer, and adjust data in the multicast packet according to the preferences.
4. The node does not need to send join signaling. Therefore, the node does not need to process a large amount of periodic signaling, thereby avoiding increase of computational load, power consumption, and processing resources of the node.
Compared with BIER, the method provided in the foregoing embodiment of this disclosure has the following advantages:
To make embodiments of this disclosure clearer, the following uses Embodiment 1, Embodiment 2, and Embodiment 3 as examples to describe the method provided in the foregoing embodiment. In Embodiment 1, the method provided in the foregoing embodiment is described by using an example in which a multicast tree is a multicast tree shown in
In a multicast tree shown in
It should be noted that, because node B has only one subtree, that is, node B has only one non-leaf subnode, a position of multicast routing information of the non-leaf subnode may be obtained through calculation by using a length indicated by the first field and a length of another field. Therefore, multicast packet 1 may not carry an addressing field of node B. Based on multicast packet 1 received by node B, a process in which each node in the multicast tree sends the multicast packet is as follows:
It should be noted that because node R has two subtrees, that is, node R has two non-leaf subnodes, a position of multicast routing information of one non-leaf subnode may be indicated by an addressing field of node R in multicast packet 2, and a position of multicast routing information of the other non-leaf subnode may be obtained through calculation based on a length indicated by the first field in multicast packet 2, a length indicated by the addressing field of node R, and a length of another field.
(102) Node R receives and parses multicast packet 2, determines the position of the Cnt field (the 9th to 16th bits in the multicast information of node R) based on the length of the first field and the length of the Cnt field, determines, based on a value at the position, that the value of the Cnt field is 2, learns that there are two Idx fields subsequently (that is, node R has two subnodes), determines positions of the two Idx fields based on lengths of the Idx fields (a position of the first Idx field is the 17th and 18th bits in the multicast information of node R, and a position of the second Idx field is the 19th and 20th bits in the multicast information of node R), determines, based on values at the positions, that a value of the first Idx field is 1 and that a value of the second Idx field is 2, and looks up a multicast forwarding table (referring to the following Table 40) of node R for a next-hop address corresponding to the values of the Idx fields, to obtain addresses of node S and node E.
(103) Node R determines a position (the 29th to 58th bits in the multicast information of node R) of multicast routing information of node S in multicast packet 2 based on the length of the first field, a length of a multicast routing identifier of node R, the length of the addressing field of node R, the length of the multicast routing information of node S indicated by the addressing field of node R, and a total length of the multicast routing information of node R indicated by the first field, extracts the multicast routing information of node S based on the position, performs multicast encapsulation to obtain multicast packet 3, and sends multicast packet 3 to node S. For a structure of multicast information of node S in multicast packet 3, refer to
It should be noted that node C has only one subnode, that is, node 2, and node 2 is a leaf node, and node D has only one subnode, that is, node 3, and node 3 is a leaf node. In this case, quantities of Idx fields of node C and node D do not change, and both are 1. Therefore, node S may statically maintain lengths of Idx fields of node C and node D. In this case, multicast packet 3 may not include an addressing field of node S.
(104) Node R determines a position (the 59th to 67th bits in the multicast information of node R) of multicast routing information of node E in multicast packet 2 based on the length of the first field, the length of the multicast routing identifier of node R, the length of the addressing field of node R, the length of the multicast routing information of node S indicated by the addressing field of node R, and the total length of the multicast routing information of node R indicated by the first field, extracts the multicast routing information of node E based on the position, performs multicast encapsulation to obtain multicast packet 4, and sends multicast packet 4 to node E. For a structure of multicast information of node E in multicast packet 4, refer to
(105) Node S receives and parses multicast packet 3, determines the position of the Cnt field (the 9th to 16th bits in the multicast information of node S) based on the length of the first field and the length of the Cnt field, determines, based on a value at the position, that the value of the Cnt field is 2, learns that there are two Idx fields subsequently (that is, node S has two subnodes), determines positions of the two Idx fields based on lengths of the Idx fields (a position of the first Idx field is the 17th and 18th bits in the multicast information of node S, and a position of the second Idx field is the 19th and 20th bits in the multicast information of node S), determines, based on values at the positions, that a value of the first Idx field is 1 and that a value of the second Idx field is 2, and looks up a multicast forwarding table (referring to the following Table 41) of node S for a next-hop address corresponding to the values of the Idx fields, to obtain addresses of node C and node D.
(106) Node S determines a position of multicast routing information of node C in multicast packet 3 (the 21th to 29th bits in the multicast information of node S) based on the length of the first field, a length of a multicast routing identifier of node S, and a statically maintained length (that is, 9) of the multicast routing information of node C, extracts the multicast routing information of node C based on the position, performs multicast encapsulation to obtain multicast packet 5, and sends multicast packet 5 to node C. For a structure of multicast information of node C in multicast packet 5, refer to
(107) Node S determines a position (the 30th to 38th bits in the multicast information of node S) of multicast routing information of node D in multicast packet 3 based on the length of the first field, the length of the multicast routing identifier of node S, the statically maintained length (that is, 9) of the multicast routing information of node C, and a total length of the multicast routing information of node S indicated by the first field, extracts the multicast routing information of node D based on the position, performs multicast encapsulation to obtain multicast packet 6, and sends multicast packet 6 to node D. A structure of multicast information of node D in multicast packet 6 is similar to a structure of the multicast routing information of node C, and may be understood with reference. Details are not described again.
(108) Node C receives and parses multicast packet 5, determines the position of the Cnt field (the 9th to 16th bits in the multicast information of node C) based on the length of the first field and the length of the Cnt field, determines, based on a value at the position, that the value of the Cnt field is 1, learns that there is one Idx field subsequently (that is, node C has one subnode), determines a position of the Idx field (the 17th bit in the multicast information of node C) based on a length of the Idx field, determines, based on a value at the position, that a value of the Idx field is 1, looks up a multicast forwarding table (referring to the following Table 42) of node C for a next-hop address corresponding to the value of the Idx field, to obtain an address of node 2, and sends unicast packet 6 to node 2, where unicast packet 6 includes data in multicast packet 1.
Multicast packet processing processes of node D, node E, and node C are similar, and may be understood with reference. Details are not described again.
In a multicast tree shown in
It should be noted that, because node B has only one subtree, that is, node B has only one non-leaf subnode, a position of multicast routing information of the non-leaf subnode may be obtained through calculation by using a length indicated by the first field and a length of another field. Therefore, multicast packet 1 may not carry an addressing field of node B. Based on multicast packet 1 received by node B, a process in which each node in the multicast tree sends the multicast packet is as follows:
It should be noted that because node R has two subtrees, that is, node R has two non-leaf subnodes, a position of multicast routing information of one non-leaf subnode may be indicated by an addressing field of node R in multicast packet 2, and a position of multicast routing information of the other non-leaf subnode may be obtained through calculation based on a length indicated by the first field in multicast packet 2, a length indicated by the addressing field of node R, and a length of another field.
(112) Node R receives and parses multicast packet 2, determines the position of the bit sequence (the 9th to 11th bits in the multicast information of node R) based on the length of the first field and the length of the bit sequence, determines, based on the position, that a value of the bit sequence is 011, and looks up a multicast forwarding table (referring to the following Table 44) of node R for next-hop addresses corresponding to bits (that is, the second bit and the third bit) that are not 0, to obtain addresses of node S and node E.
(113) Node R determines a position (the 20th to 26th bits in the multicast information of node R) of multicast routing information of node S in multicast packet 2 based on the length of the first field, a length of a multicast routing identifier of node R, the length of the addressing field of node R, a length of the multicast routing information of node S indicated by the addressing field of node R, and a total length of the multicast routing information of node R indicated by the first field, extracts the multicast routing information of node S based on the position, performs multicast encapsulation to obtain multicast packet 3, and sends multicast packet 3 to node S. For a structure of multicast information of node S in multicast packet 3, refer to
It should be noted that a first node set corresponding to node C and node D includes only two nodes and that one of the two nodes is a leaf node. Therefore, bit widths of multicast routing identifiers of node C and node D do not change, and both are 2. Therefore, node S may statically maintain the bit widths of the multicast routing identifiers of node C and node D. In this case, multicast packet 3 may not include an addressing field of node S.
(114) Node R determines a position (the 27th and 28th bits in the multicast information of node R) of multicast routing information of node E in multicast packet 2 based on the length of the first field, the length of the multicast routing identifier of node R, the length of the addressing field of node R, the length of the multicast routing information of node S indicated by the addressing field of node R, and the total length of the multicast routing information of node R indicated by the first field, extracts the multicast routing information of node E based on the position, performs multicast encapsulation to obtain multicast packet 4, and sends multicast packet 4 to node E. For a structure of multicast information of node E in multicast packet 4, refer to
(115) Node S receives and parses multicast packet 3, determines the position of the bit sequence (the 9th to 11th bits in the multicast information of node S) based on the length of the first field and the length of the bit sequence, determines, based on the position, that the value of the bit sequence is 011, and looks up a multicast forwarding table (referring to the following Table 45) of node S for next-hop addresses corresponding to bits (that is, the second bit and the third bit) that are not 0, to obtain addresses of node C and node D.
(116) Node S determines a position of multicast routing information of node C in multicast packet 3 (the 12th and 13th bits in the multicast information of node S) based on the length of the first field, a length of a multicast routing identifier of node S, and a total length of the multicast routing information of node S that is indicated by the first field, extracts the multicast routing information of node C based on the position, performs multicast encapsulation to obtain multicast packet 5, and sends multicast packet 5 to node C. For a structure of multicast information of node C in multicast packet 5, refer to
(117) Node S determines a position (the 14th and 15th bits in the multicast information of node S) of multicast routing information of node D in multicast packet 3 based on the length of the first field, the length of the multicast routing identifier of node S, and the total length of the multicast routing information of node S that is indicated by the first field, extracts the multicast routing information of node D based on the position, performs multicast encapsulation to obtain multicast packet 6, and sends multicast packet 6 to node D. A structure of multicast information of node D in multicast packet 6 is similar to a structure of the multicast routing information of node C, and may be understood with reference. Details are not described again.
(118) Node C receives and parses multicast packet 5, determines the position of the bit sequence (the 9th and 10th bits in the multicast information of node C) based on the length of the first field and the length of the bit sequence, determines, based on the position, that the value of the bit sequence is 01, and looks up a multicast forwarding table (referring to the following Table 46) of node C for a next-hop address corresponding to a bit (that is, the second bit) that is not 0, to obtain an address of node 2, and sends unicast packet 6 to node 2, where unicast packet 6 includes data in multicast packet 1.
Multicast packet processing processes of node D, node E, and node C are similar, and may be understood with reference. Details are not described again.
In a multicast tree shown in (a) in
A first node set corresponding to node 3 includes two nodes (that is, node 1 and node 5). In this case, a bit width of a bit sequence of node 3 is 2, where the first bit corresponds to node 1, the second bit corresponds to node 5, and node 5 is a subnode of node 3. Therefore, values of the two bits are 01.
A first node set corresponding to node 5 includes three nodes (that is, node 3, node D1, and node D2). In this case, a bit width of a bit sequence of node 5 is 3, where the first bit corresponds to node 3, the second bit corresponds to node D1, the third bit corresponds to node D2, and node D1 and node D2 are subnodes of node 5. Therefore, values of the three bits are 011.
A first node set corresponding to node D1 includes five nodes (that is, node A, node B, node C, node D, and node E). In this case, a bit width of a bit sequence of node D1 is 5, and five bits sequentially correspond to node A, node B, node C, node D, and node E. Node A, node C, and node E are subnodes of node D1. Therefore, values of the five bits are 10101.
A first node set corresponding to node A includes three nodes (that is, node O, node P, and node Q). In this case, a bit width of a bit sequence of node A is 3, where the first bit corresponds to node O, the second bit corresponds to node P, the third bit corresponds to node Q, and node O and node Q are subnodes of node A. Therefore, values of the three bits are 101.
A first node set corresponding to node C includes three nodes (that is, node R, node S, and node T). In this case, a bit width of a bit sequence of node C is 3, where the first bit corresponds to node R, the second bit corresponds to node S, the third bit corresponds to node T, and node S and node T are subnodes of node C. Therefore, values of the three bits are 011.
A first node set corresponding to node T includes three nodes (that is, node X, node Y, and node Z). In this case, a bit width of a bit sequence of node T is 3, where the first bit corresponds to node X, the second bit corresponds to node Y, the third bit corresponds to node Z, and node X and node Y are subnodes of node T. Therefore, values of the three bits are 110.
A first node set corresponding to node E includes three nodes (that is, node U, node V, and node W). In this case, a bit width of a bit sequence of node E is 3, where the first bit corresponds to node U, the second bit corresponds to node V, the third bit corresponds to node W, and node U and node V are subnodes of node E. Therefore, values of the three bits are 110.
A first node set corresponding to node D2 includes three nodes (that is, node F, node G, and node H). In this case, a bit width of a bit sequence of node D2 is 3, where the first bit corresponds to node F, the second bit corresponds to node G, the third bit corresponds to node H, and node G and node H are subnodes of node D2. Therefore, values of the three bits are 011.
It is assumed that a bit width of a first field is 1 byte. For a multicast packet (denoted as multicast packet 1) sent by node 1 to node B, refer to
It should be noted that, because node 3 has only one subtree, that is, node 3 has only one non-leaf subnode, a position of multicast routing information of the non-leaf subnode may be obtained through calculation by using a length indicated by the first field and a length of another field. Therefore, multicast packet 1 may not carry an addressing field of node 3. Based on multicast packet 1 generated by node 1, a process in which each node in the multicast tree sends the multicast packet is as follows:
(122) Node 5 receives and parses multicast packet 2, determines the position of the bit sequence (the 9th to 11th bits in the multicast information of node 5) based on the length of the first field and the length of the bit sequence, determines, based on the position, that a value of the bit sequence is 011, and looks up a multicast forwarding table (referring to the following Table 48) of node 5 for next-hop addresses corresponding to bits (that is, the second bit and the third bit) that are not 0, to obtain addresses of entity A and entity F.
(123) Node 5 determines a position (the 20th to 48th bits in the multicast information of node 5) of multicast routing information of node D1 in multicast packet 2 based on the length of the first field, the length of the bit sequence of node 5, a length of an addressing field of node 5, a length of the multicast routing information of node D1 indicated by the addressing field of node 5, and a total length of the multicast routing information of node 5 indicated by the first field, extracts the multicast routing information of node D1 based on the position, performs multicast encapsulation to obtain multicast packet 3, and sends multicast packet 3 to entity A. For a structure of multicast information of node D1 in multicast packet 3, refer to
(124) Entity A in node D1 receives multicast packet 3, and forwards the multicast packet. For a specific process, refer to the foregoing step (51) to step (59). It may be understood that the multicast packet A is replaced with multicast packet 3.
(125) Node 5 determines a position (the 49th to 5th bits in the multicast information of node 5) of multicast routing information of node D2 in multicast packet 2 based on the length of the first field, a length of a multicast routing identifier of node 5, the length of the addressing field of node 5, the length of the multicast routing information of node D1 indicated by the addressing field of node 5, and the total length of the multicast routing information of node 5 indicated by the first field, extracts the multicast routing information of node D2 based on the position, performs multicast encapsulation to obtain multicast packet 4, and sends multicast packet 4 to entity F. For a structure of multicast information of node D2 in multicast packet 4, refer to
(126) Entity F in node D2 receives and parses multicast packet 4, determines the position of the bit sequence (the 9th to 11th bits in the multicast information of node D2) based on the length of the first field and the length of the bit sequence, determines, based on the position, that a value of the bit sequence is 011, and looks up a multicast forwarding table (referring to the following Table 49) of node D2 for next-hop addresses corresponding to bits (that is, the second bit and the third bit) that are not 0, to obtain an address of entity G and an address of entity H, and sends unicast packet 5 to entity G and entity H, where unicast packet 5 includes data in multicast packet 1.
In the foregoing embodiment, the method provided in this disclosure is described by using an example in which the multicast packet does not include a type field. If a current node supports a plurality of types of multicast routing identifiers, the multicast packet may include a type field, and the node may parse the type field to obtain a type of the multicast routing identifier, and identify the multicast routing identifier based on the type of the multicast routing identifier.
In the foregoing embodiments, a bit width of any field in the multicast packet is an example. In actual implementation, the bit width of any field may not be byte-aligned, or may be byte-aligned (for example, the field is 1 byte, 2 bytes, or more bytes). This is not limited in this disclosure.
In the foregoing embodiments, after receiving a multicast packet, a node (or an entity in the node) may determine, according to an indication of a field in outer encapsulation, whether a packet header of the multicast packet includes multicast encapsulation. If a destination address in the outer encapsulation is an address of the node (or the entity), and it is determined that the packet header of the multicast packet includes the multicast encapsulation, the node (or the entity) may remove the outer encapsulation to obtain the multicast encapsulation, and perform corresponding processing on the multicast packet based on the multicast encapsulation.
In the foregoing embodiments, before sending a multicast packet to a plurality of nodes (or entities), a node (or an entity) may replicate the received multicast packet, and send N−1 copies of the multicast packet to N nodes (or entities), and edit the replicated multicast packet and the received multicast packet to obtain multicast packets that need to be sent. If the multicast packet is sent to only one node (or entity), the multicast packet may not be replicated, and the received multicast packet is directly edited. When a node (or an entity) replicates a multicast packet, the node (or entity) may replicate all multicast packets at a time, and then edit and send the multicast packets in parallel. Alternatively, one multicast packet may be replicated at a time, and the multicast packet may be edited and sent.
In this disclosure, in the multicast packets shown in (a) in
It should be noted that, in the description of embodiments of this disclosure, that a node (or an entity) sends a multicast packet to another node (or entity) means that a source address of the multicast packet is an address of the node (or entity), and that a destination address of the multicast packet is an address of the other node (or entity). In the foregoing embodiments of this disclosure, a meaning indicated when a value of any bit (which may be a single bit or may be a bit in a bit sequence) is 1 may also be represented by 0, and a meaning indicated when a value of any bit is 0 may also be represented by 1. This is not limited. For example, in the foregoing embodiments, when a value of a bit in the bit sequence is 1, it indicates that the bit is a subnode of node D1, or when a value of the bit is 0, it indicates that the bit is not a subnode of node D1. In actual implementation, when a value of a bit in the bit sequence is 0, it indicates that the bit is a subnode of node D1, or when a value of the bit is 1, it indicates that the bit is not a subnode of node D1. Other bits are similar, and are not described one by one.
The solutions provided in embodiments of this disclosure have been described above mainly from a perspective of the method. It may be understood that, to implement the foregoing functions, the node or entity includes at least one of a corresponding hardware structure and a software module for performing each function. A person skilled in the art should be easily aware that units and algorithm steps in the examples described with reference to embodiments disclosed in this specification can be implemented by hardware or a combination of hardware and computer software in this disclosure. Whether a function is performed by hardware or by driving hardware by computer software depends on particular applications and design constraints of the technical solutions. A person skilled in the art may use different methods to implement the described functions for each particular application, but it should not be considered that the implementation goes beyond the scope of this disclosure.
In embodiments of this disclosure, the node or entity may be divided into functional units based on the foregoing method examples. For example, the functional units may be obtained through division in a one-to-one correspondence with the functions, or two or more functions may be integrated into one processing unit. The integrated unit may be implemented in a form of hardware, or may be implemented in a form of a software functional unit. It should be noted that the unit division in embodiments of this disclosure is an example, and is merely logical function division. There may be another division manner in an actual implementation.
For example,
When the schematic diagram of the structure shown in
When the schematic diagram of the structure shown in
When the schematic diagram of the structure shown in
When the schematic diagram of the structure shown in
For example, the communications apparatus 300 may be a device, or may be a chip or a chip system.
When the communications apparatus 300 is a device, the processing unit 3001 may be a processor, and the communications unit 3002 may be a communications interface, a transceiver, an input interface, and/or an output interface. Optionally, the transceiver may be a transceiver circuit. Optionally, the input interface may be an input circuit, and the output interface may be an output circuit.
When the communications apparatus 300 is a chip or a chip system, the processing unit 3001 may be a processor, a processing circuit, a logic circuit, or the like. The communications unit 3002 may be a communications interface, an input interface and/or an output interface, an interface circuit, an output circuit, an input circuit, a pin, a related circuit, or the like in the chip or the chip system.
When the integrated unit in
When the processing unit 3001 is a processor, and the communications unit 3002 is a communications interface, and the storage unit 3003 is a memory, the communications apparatus 300 in this embodiment of this disclosure may be the communications apparatus 310 shown in
The processor 3101, the communications interface 3104, and the memory 3103 may be connected by using a communications bus 3102 to implement mutual communication and transfer a control signal and/or a data signal. The memory 3103 is configured to store a computer program. The processor 3101 is configured to invoke the computer program from the memory 3103 and run the computer program, to control the communications interface 3104 to receive and send signals.
In a first possible implementation, the processor 3101 may be a central processing unit (CPU), a microprocessor, an application-specific integrated circuit (ASIC), or one or more integrated circuits configured to control program execution in the solution of this disclosure. The communications interface 3104 may be any transceiver-type apparatus.
In a second possible implementation, the processor 3101 may be a logic circuit, and the communications interface 3104 may include an input interface and/or an output interface.
The communications interface 3104 uses any apparatus such as a transceiver, and is configured to communicate with another device or a communications network.
The memory 3103 may be a ROM, another type of static storage device that can store static information and instructions, a RAM, or another type of dynamic storage device that can store information and instructions, or may be an electrically erasable programmable ROM (EEPROM), a compact disc (CD) ROM (CD-ROM) or another CD storage, an optical disc storage (including a CD, a laser disc, an optical disc, a DIGITAL VERSATILE DISC (DVD), a BLU-RAY disc, or the like), a magnetic disk storage medium or another magnetic storage device, or any other medium that can be configured to carry or store expected program code in a form of an instruction or a data structure and that can be accessed by a computer. However, the memory 3103 is not limited thereto. The memory may exist independently, and is connected to the processor by using the communications bus 3102. Alternatively, the memory may be integrated with the processor.
The memory 3103 is configured to store the computer-executable instructions for executing the solutions of this disclosure, and the processor 3101 controls execution. The processor 3101 is configured to execute the computer-executable instructions stored in the memory 3103, to implement the method provided in embodiments of this disclosure.
Optionally, the computer-executable instructions in this embodiment of this disclosure may also be referred to as application program code. This is not further limited in this embodiment of this disclosure.
When the schematic diagram of the structure shown in
When the schematic diagram of the structure shown in
When the schematic diagram of the structure shown in
When the schematic diagram of the structure shown in
An embodiment of this disclosure further provides a computer-readable storage medium, including instructions. When the instructions are run on a computer, the computer is enabled to perform any one of the foregoing methods.
An embodiment of this disclosure further provides a computer program product including instructions. When the computer program product runs on a computer, the computer is enabled to perform any one of the foregoing methods.
An embodiment of this disclosure further provides a communications system. The communications system includes one or more nodes in the foregoing embodiments, or the communications system includes one or more entities in the foregoing embodiments, or the communications system includes one or more nodes and one or more entities in the foregoing embodiments.
All or some of the foregoing embodiments may be implemented by software, hardware, firmware, or any combination thereof. When a software program is used to implement embodiments, embodiments may be implemented completely or partially in a form of a computer program product. The computer program product includes one or more computer instructions. When the computer-executable instructions are loaded and executed on the computer, the processes or functions according to embodiments of this disclosure are all or partially generated. The computer may be a general-purpose computer, a dedicated computer, a computer network, or another programmable apparatus. The computer instructions may be stored in the computer-readable storage medium or may be transmitted from the computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website, computer, server, or data center to another website, computer, server, or data center in a wired (for example, a coaxial cable, an optical fiber, or a digital subscriber line (DSL)) or wireless (for example, infrared, radio, or microwave) manner. The computer-readable storage medium may be any usable medium accessible by a computer, or may be a data storage device, such as a server or a data center, integrating one or more usable media. The usable medium may be a magnetic medium (for example, a floppy disk, a hard disk, or a magnetic tape), an optical medium (for example, a DVD), a semiconductor medium (for example, a solid-state disk (SSD)), or the like.
Although this disclosure is described with reference to embodiments, in a process of implementing this disclosure that claims protection, a person skilled in the art may understand and implement another variation of the disclosed embodiments by viewing the accompanying drawings, disclosed content, and the appended claims. In the claims, the word “comprise” (comprising) does not exclude another component or step, and “a” or “one” does not exclude a case of plurality. A single processor or another unit may implement several functions listed in the claims. Some measures are described in dependent claims that are different from each other, but this does not mean that these measures cannot be combined to produce a better effect.
Although this disclosure is described with reference to specific features and embodiments thereof, it is clear that various modifications and combinations may be made to them without departing from the spirit and scope of this disclosure. Correspondingly, this specification and accompanying drawings are merely example descriptions of this disclosure defined by the appended claims, and are considered as any of or all modifications, variations, combinations, or equivalents that cover the scope of this disclosure. Apparently, a person skilled in the art can make various changes and variations to this disclosure without departing from the spirit and scope of this disclosure. Therefore, this disclosure is also intended to cover the changes and variations provided that the changes and variations of this disclosure fall within the scope of the claims of this disclosure or equivalent technologies thereof
Number | Date | Country | Kind |
---|---|---|---|
202110304363.4 | Mar 2021 | CN | national |
This is a continuation of International Patent Application No. PCT/CN2022/076838 filed on Feb. 18, 2022, which claims priority to Chinese Patent Application No. 202110304363.4 filed on Mar. 22, 2021. The disclosures of the aforementioned applications are hereby incorporated by reference in their entireties.
Number | Date | Country | |
---|---|---|---|
Parent | PCT/CN2022/076838 | Feb 2022 | US |
Child | 18472896 | US |