Disclosure of Invention
The invention aims to provide a method and a device for forwarding a TRILL multicast message, which are used for solving the problems of complexity and risk degree caused by returning the message when the local termination of the TRILL multicast message and the forwarding at a network side are simultaneously effective.
In order to achieve the above object, the present invention provides a method for forwarding a TRILL multicast packet, which is applied to a TRILL network of a switch with a pipeline structure, where the TRILL network at least includes an interface unit, an Ingress RB, a storage scheduling unit, and an Egress RB, and the method for forwarding a TRILL multicast packet includes: receiving a TRILL multicast message through an interface unit; acquiring network side outlet information and local outlet information of the received TRILL multicast message in Ingress RB; copying the TRILL multicast message at a storage scheduling unit according to the network side outlet information and the local outlet information; and identifying that the copied TRILL multicast message is a network forwarding message or a local outlet message in the Egress RB, and editing and outputting the copied TRILL multicast message according to the identification result.
Optionally, the Ingress RB at least includes a packet parsing module, a tunnel packet processing module, an L2 module, and an L3 module; and, the network side export information and the local export information of the TRILL multicast message obtained from the Ingress RB include: analyzing the TRILL multicast message through the message analysis module; judging whether the analyzed TRILL multicast message needs local decapsulation or not through the tunnel message processing module; inquiring network side outlet information of the TRILL multicast message which does not need local decapsulation in the L3 module according to the parsed multicast index of the TRILL multicast message; and inquiring network side outlet information in the L3 module according to the analyzed multicast index of the TRILL multicast message, and performing local decapsulation in the L2 module to obtain an inner layer message with a TRILL tunnel header stripped, and obtaining one or more pieces of local outlet information according to the type of the inner layer message.
Optionally, the obtaining one or more pieces of local egress information according to the type of the inner layer packet includes: if the inner layer message is a known unicast message, obtaining local outlet information; and if the inner layer message is one of unknown unicast messages, unknown multicast messages and unknown broadcast messages, obtaining a plurality of local outlet information according to the setting of the corresponding message.
Optionally, the copying, by the storage scheduling unit, the TRILL multicast packet according to the network side egress information and the local egress information includes: setting a flag bit from a local outlet or a network side outlet for the copied TRILL multicast message; and the identifying that the copied TRILL multicast message is a network forwarding message or a local exit message in the Egress RB comprises: and identifying the flag bit of the copied TRILL multicast message, and judging that the copied TRILL multicast message is a network forwarding message or a local outlet message according to the flag bit.
Optionally, the editing and outputting the copied TRILL multicast packet according to the identification result includes: if the copied TRILL multicast message is a network forwarding message, acquiring information required by forwarding the TRILL multicast message on a network side, editing a TRILL header, and forwarding the TRILL multicast message; if the copied TRILL multicast message is a Local egress message, the TRILL header is stripped, VLAN (Virtual Local Area Network) processing is performed, and the TRILL multicast message is forwarded.
The invention also provides a forwarding device of the TRILL multicast message, which is applied to the TRILL network of the switch of the pipeline structure, wherein the TRILL network at least comprises an interface unit, an Ingress RB, a storage scheduling unit and an Egress RB, and the forwarding device of the TRILL multicast message comprises: the receiving module is used for receiving the TRILL multicast message through the interface unit; an exit information acquisition module, configured to acquire network side exit information and local exit information of the received TRILL multicast packet in Ingress RB; the message copying module is used for copying the TRILL multicast message in a storage scheduling unit according to the network side outlet information and the local outlet information; and the message output module is used for identifying that the copied TRILL multicast message is a network forwarding message or a local outlet message in the Egress RB, and editing and outputting the copied TRILL multicast message according to the identification result.
Optionally, the Ingress RB at least includes a packet parsing module, a tunnel packet processing module, an L2 module, and an L3 module; and, the exit information acquiring module includes: the analysis submodule is used for analyzing the TRILL multicast message through the message analysis module; the judging submodule is used for judging whether the analyzed TRILL multicast message needs local decapsulation or not through the tunnel message processing module; the first processing submodule is used for inquiring network side outlet information of the TRILL multicast message which does not need local decapsulation according to the analyzed multicast index of the TRILL multicast message in the L3 module; and the second processing submodule is used for inquiring network side outlet information of the TRILL multicast message needing local decapsulation according to the analyzed multicast index of the TRILL multicast message at the L3 module, performing local decapsulation at the L2 module to obtain an inner layer message with a TRILL tunnel header stripped, and obtaining one or more pieces of local outlet information according to the type of the inner layer message.
Optionally, for the second processing sub-module: if the inner layer message is a known unicast message, obtaining local outlet information; and if the inner layer message is one of unknown unicast messages, unknown multicast messages and unknown broadcast messages, obtaining a plurality of local outlet information according to the setting of the corresponding message.
Optionally, the forwarding device for a TRILL multicast packet further includes: and the flag bit setting module is used for setting a flag bit from a local outlet or a network side outlet for the TRILL multicast message copied by the message copying module.
Optionally, the message output module includes: the identification submodule is used for identifying the flag bit of the copied TRILL multicast message and judging that the copied TRILL multicast message is a network forwarding message or a local outlet message according to the flag bit; the network side message editing submodule is used for acquiring information required by forwarding the TRILL multicast message on the network side when the copied TRILL multicast message is a network forwarding message, editing a TRILL header and forwarding the TRILL multicast message; and the local message editing submodule is used for peeling off the TRILL header when the copied TRILL multicast message is a local exit message, carrying out VLAN processing and then forwarding the TRILL multicast message.
Through the technical scheme, the invention has the technical effects that: by adopting the scheme related in the TRILL multicast message forwarding method and device, the TRILL network can simultaneously execute network side forwarding and local decapsulation, and the network side forwarding and the local decapsulation are processed through different stages of a production line without a loopback structure, so that mixed processing at an ingress RB end and classified processing at an Egress RB end are realized, and complexity, risk and uncertainty caused by a loopback mode are avoided.
Additional features and advantages of the invention will be set forth in the detailed description which follows.
Detailed Description
The following detailed description of embodiments of the invention refers to the accompanying drawings. It should be understood that the detailed description and specific examples, while indicating the present invention, are given by way of illustration and explanation only, not limitation.
An embodiment of the present invention provides a method for forwarding a TRILL multicast packet, which is applied to a TRILL network of a switch with a pipeline structure, as shown in fig. 2, where the TRILL network at least includes an interface unit 11, an Ingress RB12, a storage scheduling unit 13, and an Egress RB14, but does not include a loopback structure shown by a dotted line in fig. 1. Based on the TRILL network without a loopback structure as shown in fig. 2, as shown in fig. 3, the forwarding method of the TRILL multicast packet according to the embodiment of the present invention mainly includes the following steps:
step S301, the interface unit 11 receives the TRILL multicast packet.
The interface unit 11 is an interface for implementing information interaction with other networks or devices in the TRILL network, where the interaction includes sending and receiving, that is, the interface unit can send a TRILL multicast packet in addition to receiving the TRILL multicast packet.
Step S302, obtaining the network side export information and the local export information of the received TRILL multicast packet in Ingress RB 12.
In the TRILL network of the switch with the pipeline structure, the Ingress RB12 flow is mainly used for decapsulating a message to search for a message destination exit.
In this embodiment, the Ingress RB12 obtains the network-side egress information and the local egress information in a pipeline processing manner, as shown in fig. 4, the Ingress RB12 in the pipeline mainly includes a packet parsing module 41, a tunnel packet processing module 42, an L2 module 43, and an L3 module 44.
The message parsing module 41 is mainly used to identify an entry message type, for example, it may be determined whether the entry message is a TRILL tunnel message; and after the type of the ingress packet is identified, parsing a key field segment of a packet header, such as a field segment required by post-level processing, such as a mac header, a VLAN header, a TRILL header, and the like.
The tunnel message processing module 42 is mainly configured to process a tunnel message identified by a previous stage (in this embodiment, corresponding to the message parsing module 41). For the TRILL tunnel packet, the more specific function of the tunnel packet processing module 42 is to determine whether local termination is required, and send a termination flag bit; and simultaneously, the next hop information required by forwarding of the TRILL message network side is given.
The basic function of the L2 module 43 is to complete the query of the local switching outlets. If the TRILL multicast packet needs to be terminated locally, the L2 module 43 completes the egress query according to the terminated DMAC and VLAN information.
The basic function of the L3 module 44 is to perform routing query and routing forwarding. When forwarding the TRILL network side packet, the routing query process is skipped, and the multicast next-hop table entry of the L3 module 44 is multiplexed to obtain the network side exit.
It should be noted that, reference may be made to related documents in the prior art for specific implementation of the basic functions of the four modules, and this embodiment mainly uses the basic functions of the four modules to simultaneously acquire the network-side egress information and the local egress information of the TRILL multicast packet.
Specifically, based on the Ingress RB12 in the pipeline form, as shown in fig. 5, in this embodiment, acquiring the network-side egress information and the local egress information of the received TRILL multicast packet in the Ingress RB12 mainly includes the following steps:
step S501, the TRILL multicast packet is analyzed by the packet analysis module 41.
The packet parsing module 41 may identify the TRILL packet through the ethernet type ethertype. Here, the TRILL header, the MAC entry, the multicast index, and information indicating whether the packet needs to be decapsulated locally, etc. of the packet may be obtained by parsing the TRILL multicast packet.
Step S502, the tunnel packet processing module 42 determines whether the analyzed TRILL multicast packet needs to be decapsulated locally.
The TRILL multicast packet is forwarded on the network side, but whether the packet is decapsulated locally needs to be queried according to information in the TRILL header, so as to determine whether decapsulation is performed. For example, the determination of whether to perform local decapsulation is a conclusion obtained by performing table item query according to the relevant information such as the user configuration table item, the entry message trill header, and the mac header. From the final message outlet, after the TRILL multicast message comes in, there are two results according to the difference of table lookup results: firstly, only TRILL multicast network side forwarding is carried out; and secondly, carrying out TRILL multicast network side forwarding and local decapsulation at the same time.
Step S503, for the TRILL multicast packet that does not need to be decapsulated locally, querying, at the L3 module 44, network side exit information according to the multicast index of the analyzed TRILL multicast packet.
The method includes the steps that for the TRILL multicast message which does not need local decapsulation, local termination is not needed, and only network side forwarding is needed. In this way, the network-side egress information may be directly queried in the L3 module 44 according to the multicast index of the analyzed TRILL multicast packet.
Step S504, for the TRILL multicast packet that needs to be locally decapsulated, query the exit information on the network side at the L3 module 44 according to the parsed multicast index of the TRILL multicast packet, and locally decapsulate the TRILL multicast packet at the L2 module 43 to obtain an inner layer packet with a TRILL tunnel header stripped, and obtain one or more pieces of local exit information according to the type of the inner layer packet.
The specific process of decapsulation may be: and inquiring a two-layer forwarding table according to the DMAC (digital access controller) and VLAN (virtual local area network) information of the inner-layer MAC head of the TRILL message, and acquiring the export information.
In step S504, the L3 module 44 obtains the network-side egress information of the TRILL multicast packet, and the L2 module 43 obtains the local egress information of the TRILL multicast packet. That is, the local decapsulation is implemented by the L2 module 43, and it processes the inner layer packet with the TRILL tunnel header stripped off according to the normal two-layer packet forwarding flow, and may determine the type of the inner layer packet according to the processing result.
Wherein obtaining one or more local breakout information according to the type of the inner layer packet comprises: if the inner layer message is a known unicast message, obtaining local outlet information; and if the inner layer message is an unknown unicast message, a multicast message or a broadcast message, acquiring a plurality of local outlet information according to the setting of the corresponding message.
Thus, through steps S501-S504, the network side forwarding and local decapsulation of the packet are performed at different stages of the Ingress RB12 pipeline, that is, the network side forwarding and local decapsulation of the packet are performed simultaneously by using a pure pipeline structure without loopback, so that the network side egress information and the local egress information exist simultaneously, which is beneficial to subsequently and effectively implementing the local termination and network side forwarding of the TRILL multicast packet simultaneously.
Step S303, the storage scheduling unit 13 copies the TRILL multicast packet according to the network side egress information and the local egress information.
The storage scheduling unit 13 may schedule and obtain a corresponding outlet according to the network side outlet information and the local outlet information, and copy the message to the obtained outlet. In addition, when the message is copied, a flag bit from a local outlet or a network side outlet can be set for the copied TRILL multicast message, and the flag bit indicates that the copied message comes from the local outlet or the network side outlet.
Step S304, identifying that the copied TRILL multicast message is a network forwarding message or a local exit message in the Egress RB14, and editing and outputting the copied TRILL multicast message according to the identification result.
Wherein, the identification process of the Egress RB14 mainly comprises: the flag bit from the local outlet or the network side outlet set for the copied TRILL multicast message can be identified, and the copied TRILL multicast message is judged to be a network forwarding message or a local outlet message according to the flag bit.
The editing and outputting the copied TRILL multicast packet according to the identification result may specifically include: if the message is forwarded by the network, acquiring the required information forwarded by the TRILL multicast message at the network side, editing a TRILL header, and forwarding the TRILL multicast message; if the message is a local exit message, the TRILL header is stripped, the VLAN processing is carried out, and then the TRILL multicast message is forwarded.
Wherein editing the TRILL header may include: and modifying information such as Egress nickname, Ingress nickname, VLAN, hop _ cnt and the like in the TRILL header, and adding a new rbridge mac header.
Wherein, stripping the TRILL header and performing VLAN processing comprises: after the outer layer mac head and the TRILL head are stripped, the VLAN information of the inner layer mac head is modified and then local forwarding is carried out.
In summary, in the embodiment, the TRILL network executes network side forwarding and local decapsulation at the same time, and instead of using the loopback structure, the network side forwarding and the local decapsulation are processed at different stages of the pipeline, so that hybrid processing at the ingress RB end and classified processing at the Egress RB end are realized, and complexity, risk and uncertainty caused by the loopback manner are avoided.
Based on the same inventive concept as the TRILL multicast packet forwarding method, another embodiment of the present invention further provides a forwarding apparatus for a TRILL multicast packet, which is applied to a TRILL network of a switch with a pipeline structure, and as shown in fig. 2, the TRILL network includes an interface unit 11, an Ingress RB12, a storage scheduling unit 13, and an Egress RB 14. As shown in fig. 6, the forwarding device of a TRILL multicast packet in this embodiment includes: a receiving module 61, configured to receive a TRILL multicast packet through an interface unit; an egress information obtaining module 62, configured to obtain, in Ingress RB, network-side egress information and local egress information of the received TRILL multicast packet; a message copying module 63, configured to copy, in a storage scheduling unit, the TRILL multicast message according to the network side egress information and the local egress information; and a message output module 64, configured to identify, in the Egress RB, that the copied TRILL multicast message is a network forwarding message or a local Egress message, and edit and output the copied TRILL multicast message according to the identification result.
Further, as shown in fig. 4, the Ingress RB12 may include a packet parsing module 41, a tunnel packet processing module 42, an L2 module 43, and an L3 module 44. Accordingly, as shown in fig. 7, the exit information obtaining module 62 of the present embodiment may include: the parsing submodule 621 is configured to parse the TRILL multicast packet through the packet parsing module; a determining submodule 622, configured to determine, by using the tunnel packet processing module, whether the analyzed TRILL multicast packet needs to be locally decapsulated; the first processing sub-module 623 is configured to query, according to the multicast index of the analyzed TRILL multicast packet, network side exit information of the TRILL multicast packet that does not need to be locally decapsulated in the L3 module; and a second processing submodule 624, configured to query, at the L3 module, network side egress information for the TRILL multicast packet that needs to be locally decapsulated according to the parsed multicast index of the TRILL multicast packet, and locally decapsulate the L2 module to obtain an inner layer packet with a TRILL tunnel header stripped, and obtain one or more pieces of local egress information according to the type of the inner layer packet.
Wherein for the second processing submodule 624: if the inner layer message is a known unicast message, obtaining local outlet information; and if the inner layer message is an unknown unicast message, a multicast message or a broadcast message, acquiring a plurality of local outlet information according to the setting of the corresponding message.
Further, the forwarding device for the TRILL multicast packet may further include: a flag setting module (not shown in fig. 6), configured to set a flag from a local exit or a network side exit for the TRILL multicast packet copied by the packet copying module.
Further, as shown in fig. 8, the message output module 64 may include: the identifier module 641 is configured to identify a flag bit of the copied TRILL multicast packet, and determine, according to the flag bit, that the copied TRILL multicast packet is a network forwarding packet or a local egress packet; the network side message editing submodule 642 is configured to, when the copied TRILL multicast message is a network forwarding message, acquire information required for forwarding the TRILL multicast message on the network side, edit a TRILL header, and forward the TRILL multicast message; and a local message editing submodule 643, configured to strip the TRILL header when the copied TRILL multicast message is a local egress message, perform VLAN processing, and forward the TRILL multicast message.
The specific implementation details and effects of the forwarding device of the TRILL multicast packet in this embodiment are the same or similar to those of the forwarding method of the TRILL multicast packet, and are not described herein again.
The preferred embodiments of the present invention have been described in detail with reference to the accompanying drawings, however, the present invention is not limited to the specific details of the above embodiments, and various simple modifications can be made to the technical solution of the present invention within the technical idea of the present invention, and these simple modifications are within the protective scope of the present invention.
It should be noted that the various features described in the above embodiments may be combined in any suitable manner without departing from the scope of the invention. The invention is not described in detail in order to avoid unnecessary repetition.
In addition, any combination of the various embodiments of the present invention is also possible, and the same should be considered as the disclosure of the present invention as long as it does not depart from the spirit of the present invention.