Detailed Description
A plurality of examples shown in the drawings will be described in detail. In the following detailed description, numerous specific details are set forth in order to provide a thorough understanding of the application. Well-known methods, procedures, components and circuits have not been described in detail so as not to obscure the examples.
The terms "comprising" and "including" are used in the sense of including but not limited to, including the numbers "above", "within" and "below" and not including the numbers. The term "based on" means based at least in part on a portion thereof.
Fig. 1 is a flowchart of an embodiment of a method for implementing three-layer forwarding of multicast data messages, which includes the following steps:
Step 101, setting three-layer multicast hardware table items of a multicast replication unit based on three-layer multicast forwarding information and three-layer multicast replication information;
step 102, splitting the three-layer multicast hardware table entry into a channel forwarding information table entry and a channel multicast member copy table entry pointed by the channel forwarding information table entry;
step 103, searching a plurality of channel forwarding information tables according to the forwarded three-layer multicast data message;
104, reading the replication information of the three-layer multicast member from the channel multicast member replication table pointed by the searched three-layer multicast forwarding information table;
Step 105, transmitting a copy three-layer multicast data message with a member port VLAN through a stream guidance port mapped by a member port in the three-layer multicast member copy information;
and 106, receiving the duplicated three-layer multicast data message through the internal forwarding port of the direct connection flow guiding port, and sending the duplicated three-layer multicast data message through the member port corresponding to the internal forwarding port.
The application has the beneficial effects that the three-layer multicast hardware table item is split according to the forwarding channels, so that the duplication forwarding of the three-layer multicast data is initiated on different forwarding channels at the same time, and the exchange time delay of the three-layer multicast data message is reduced.
As shown in FIG. 2, the application adds a multicast copying unit in the ultra-low delay Switch 2A, the multicast copying unit is realized by an FPGA chip 22, the switching unit of the ultra-low delay Switch 2A is realized by a switching (Switch) chip 21, receives protocol/data messages, and sends the multicast data messages after the FPGA chip 22 completes the multicast copying process through a member port.
In the application, the forwarding ports p21-p40 of the switching chip 21 are set as internal forwarding ports and are mapped to the forwarding ports p1-p20 of the switching chip 21, and the forwarding ports p21-p40 of the switching chip 21 are respectively and directly connected with the ports C21-C40 of the FPGA chip 22 one by one. Ports C21-C40 of FPGA chip 22 serve as flow guiding ports for transmitting protocol/data messages with internal forwarding ports of switch chip 21.
The CPU23 software records the corresponding relation between the forwarding ports p1-p20 and the chip ports C21-C40 of the FPGA chip 22, records the VLAN (Virtual Local Area Network ) to which the forwarding ports p1-p20 belong, sets a port mapping table 22a in the FPGA chip 22, and records the mapping relation between the chip ports C21-C40 and the forwarding ports p1-p20 in each VLAN.
In fig. 2, the switch chip 21 sends an IGMP query message 201 through the port p20 to the port C40 of the directly connected FPGA chip 22 through the internal forwarding port p 40.
The FPGA chip 22 caches the IGMP query message 201, and copies one IGMP query message 201 to the CPU23.
The CPU23 identifies VLAN1-VLAN4 to be forwarded and notifies the FGPA chip 22 to transmit within VLAN1-VLAN 4.
The FPGA chip 22 finds the ports p1, p2 belonging to VLAN1, the ports p3, p4 of VLAN2, the ports p5, p6 of VLAN3, and the ports p7, p8 of VLAN4 through the port mapping table 22 a.
The FPGA chip 22 sends the IGMP query message 2011 with VLAN1 through the stream guidance ports c21, c22, sends the IGMP query message 2012 with VLAN2 through the stream guidance ports c23 and c24, sends the IGMP query message 2013 with VLAN3 through the stream guidance ports c25 and c26, and sends the IGMP query message 2015 with VLAN4 through the stream guidance ports c27 and c 28.
After receiving the IGMP query messages 2011-2014 through the internal forwarding ports p21-p28, the switch chip 21 sends the IGMP query messages through the corresponding forwarding ports p1-p 8.
Fig. 3 is a schematic diagram of setting information of three-layer multicast members of software according to an embodiment of the present application;
The switch chip 21 receives the IGMP report message 301 through the port P2 of the VLAN1, and transmits the IGMP report message 301, the receiving port P2, and the VLAN1 to which it belongs through the internal forwarding port P22, and transmits the IGMP report message through the internal forwarding port P22 corresponding to the receiving port P2.
The FPGA chip 22 receives the IGMP report 301 via the port c22 and sends the received membership port P2 and its membership VLAN1 to the processor 23.
The processor 23 records software three-layer multicast member information 23a: G1- > (port 2, VLAN 1) in the software three-layer multicast member information table, wherein the multicast group IP address G1 of the IGMP message 301 corresponds to the member port2 of the IGMP report message 301 and its member VLAN1.
The switch chip 21 receives the IGMP report message 302 through the port P3 of the VLAN2, and transmits the IGMP report message 302, the receiving port P3, and the VLAN2 to which it belongs through the internal forwarding port P23, and the internal forwarding port P23 corresponding to the receiving port P3.
The FPGA chip 22 receives the IGMP report message 302 via the port c23 and sends the received membership port P2 and its membership VLAN2 to the processor 23.
The processor 23 searches the software three-layer multicast member information table for the software three-layer multicast member information 23a corresponding to the multicast group IP address G1 of the IGMP message 302, and refreshes the software three-layer multicast member information 23a: G1- > (port 2, VLAN 1), (port 3, VLAN 2), wherein the software three-layer multicast member information 23a records the member port3 of the IGMP report message 302 and the member VLAN2 thereof.
The switch chip 21 receives the IGMP report message 303 through the port P6 of the VLAN3, and transmits the IGMP report message 303, the receiving port P6, and the VLAN3 to which it belongs through the internal forwarding port P26, and transmits the IGMP report message through the internal forwarding port P26 corresponding to the receiving port P6.
The FPGA chip 22 receives the IGMP report 303 via the port c26 and sends the received membership port P6 and its membership VLAN6 to the processor 23.
The processor 23 searches the software three-layer multicast member information table for the software three-layer multicast member information 23a corresponding to the multicast group IP address G1 of the IGMP message 303, and refreshes the software three-layer multicast member information 23a: G1- > (port 2, VLAN 1), (port 3, VLAN 2), (port 6, VLAN 3), wherein the software three-layer multicast member information 23a records the member port6 of the IGMP report message 303 and the member VLAN3 thereof.
Fig. 4 is a schematic diagram of triggering hardware three-layer multicast group members based on multicast data messages according to an embodiment of the present application.
The switch chip 21 receives the three-layer multicast data message 401 through the forwarding port P19, and sends the three-layer multicast data message 401 to the FPGA chip 22 through the internal forwarding port P39.
The FPGA chip 22 searches the channel forwarding information table of each of the channel 1 and the channel 2 according to the multicast source IP address S1, the multicast source VLAN1000 and the multicast group IP address G1 of the three-layer multicast data message 401, does not find the matched channel forwarding information table entry, caches the three-layer multicast data message 401, copies a three-layer multicast data message 4011, and sends a copy of the three-layer multicast data message 4011 as an unknown three-layer multicast data message to the CPU23.
The CPU23 receives the unknown three-layer multicast data packet 4011, and searches for the software three-layer multicast member information 23a based on the multicast source IP address S1, the multicast source VLAN1000, and the multicast group IP address G1 of the three-layer multicast data packet 4011.
The CPU23 records three-layer multicast software entries 23b (S1, VLAN1000, G1) - > (port 2, VLAN 1), (port 3, VLAN 2), (port 6, VLAN 3) in the software three-layer multicast table.
The CPU23 sets three-layer multicast forwarding information 21a in the multicast forwarding information table of the switch chip 21 according to the three-layer multicast software table 23b (S1, VLAN1000, G1), sets three-layer multicast replication information 21b (port 2, VLAN 1), (port 3, VLAN 2), (port 6, VLAN 3) in the multicast replication table, and the three-layer multicast forwarding information 21a points to the three-layer multicast replication information 21b, that is, the hash value calculated by S1, VLAN1000, G1 in the three-layer multicast forwarding information 21a points to the storage address of the three-layer multicast replication information 21 b.
The switch chip 21 sets a three-layer multicast hardware table entry 500 in the three-layer multicast hardware table 22a of the FPGA chip 22 according to the three-layer multicast forwarding information 21a and the three-layer multicast replication information 21b (S1, VLAN1000, G1) - > (port 2, VLAN 1), (port 3, VLAN 2), (port 6, VLAN 3), three-layer multicast member replication information (port 2, VLAN 1), (port 3, VLAN 2), (port 6, VLAN 3), and records one member port and its member port VLAN, respectively.
Fig. 5a-5b are schematic diagrams of setting a channel forwarding information table entry and a channel multicast member replication table entry according to an embodiment of the present application.
In fig. 5a, the FPGA chip 22 splits the three-layer multicast hardware table 550 into a channel forwarding information table of each channel and a channel multicast member replication table pointed to by the channel according to the channel where the member port is located, and records the channel forwarding information table in the three-layer multicast forwarding table 22b.
The FPGA chip 22 identifies that a member port2 of the (port 2, VLAN 1) of the three-layer multicast member copy information is in the first forwarding channel, sets a channel three-layer multicast forwarding information table entry 5011 in the channel forwarding information table 501 of the first forwarding channel for recording (S1, VLAN1000, G1), sets a channel multicast member copy table entry 5012 in the channel forwarding information table 501 of the first forwarding channel for recording the three-layer multicast member copy information (port 2, VLAN 1), the three-layer multicast forwarding information table entry 5011 points to the channel multicast member copy table entry 5012, that is, the hash value calculated by S1, VLAN1000, G1 of the three-layer multicast forwarding information table entry 5011 points to the storage address of the channel multicast member copy table entry 5012.
The FPGA chip 22 identifies that the member port3 of (port 3, VLAN 2) of the three-layer multicast member replication information is in the first forwarding channel, records the three-layer multicast member replication information (port 2, VLAN 1) and (port 3, VLAN 2) in the channel multicast member replication table entry 5012, such that the three-layer multicast forwarding information table entry 5011 points to the three-layer multicast member replication information (port 2, VLAN 1) and (port 3, VLAN 2) of the channel multicast member replication table entry 5012.
The FPGA chip 22 identifies that a member port6 of the (port 6, VLAN 3) of the three-layer multicast member replication information is in the second forwarding channel, sets a channel three-layer multicast forwarding information table 5021 in a channel forwarding information table 502 of the second forwarding channel for recording (S1, VLAN1000, G1), sets a channel multicast member replication table 5022 in the channel forwarding information table 502 of the second forwarding channel for recording the three-layer multicast member replication information (port 6, VLAN 3), and the three-layer multicast forwarding information table 5021 points to the channel multicast member replication table 5022.
In the embodiment of the application, two forwarding channels are taken as an example, and each forwarding channel comprises four forwarding ports, namely, a first forwarding channel comprises forwarding ports p1-p4, and a second forwarding channel comprises forwarding ports p5-p8. The ultra-low delay switch sets the number of forwarding channels and the number of forwarding ports of each forwarding channel according to the layout of the forwarding ports and the service scene, and can split the three-layer multicast forwarding information table entry and the channel multicast member replication table entry of each forwarding channel based on the embodiment of the application.
After the FGPA chip 22 completes splitting the three-layer multicast forwarding information entries and the channel multicast member replication entries for each forwarding channel, the three-layer multicast hardware entry 500 is emptied, as shown in fig. 5A.
Fig. 6 is a schematic forwarding diagram of a three-layer packet according to an embodiment of the present application.
The FPGA chip 22 performs forwarding for the buffered three-layer multicast data message 401, searches the channel forwarding information tables 501 and 502 at the same time according to the three-layer multicast data message 401, and searches the matched channel three-layer multicast forwarding information table items 5011 and 5021.
The FPGA chip 22 reads the three-layer multicast member replication information (port 2, VLAN 1) and (port 3, VLAN 2) from the channel multicast member replication table entry 5012 pointed to by the found three-layer multicast forwarding information table entry 5011.
The FPGA chip 22 sends a copy three-layer multicast data message 4012 with VLAN1 through the port c22 mapped by the port2, sends a copy three-layer multicast data message 4013 with VLAN2 through the port c23 mapped by the port3, and sends a copy three-layer multicast data message 4014 with VLAN3 through the port c26 mapped by the port 6.
The exchange chip 23 receives the duplicate three-layer multicast data messages 4012, 4013 and 4014 through internal forwarding ports P22, P23 and P26 which are directly connected with the diversion ports C22, C23 and C26 respectively, and sends the duplicate three-layer multicast data messages 4012, 4013 and 4014 through member ports P2, P3 and P6 which are corresponding to the internal forwarding ports P22, P23 and P26.
Subsequently, the FPGA chip 22 receives the three-layer multicast data packet 401 received by the switching unit 21 through the flow guiding port c39, and searches the channel forwarding information tables 501 and 502 in the channel three-layer multicast forwarding table 22b at the same time, and forwards the packet according to the embodiment shown in fig. 6. The CPU23 sets the three-layer multicast forwarding information 21a and the three-layer multicast replication information 21b based on the embodiment shown in fig. 3 and 4, the exchange chip 21 resets the three-layer multicast hardware table, and the FPGA chip 22 completes refreshing of the table according to the channel forwarding information table of each forwarding channel and the channel multicast member replication table pointed by the channel forwarding information table of each forwarding channel in fig. 5a-5 b.
Fig. 7 is a schematic diagram of an embodiment of a device for implementing three-layer packet forwarding according to the present application. The device 70 comprises a network interface, a processor 71, a memory 72, a switching unit 73 and a multicast replication unit 74. The processor 71 is configured to execute the control unit 721 and the configuration unit 722 by executing processor-executable instructions in the memory 72.
The configuration unit 722 is configured to configure three-layer multicast forwarding information and three-layer multicast replication information on the switching unit 73, the three-layer multicast forwarding information records a multicast source IP address, a VLAN to which the multicast source belongs, and a multicast group IP address of a received multicast data packet, the three-layer multicast replication information records three-layer multicast member replication information of more than one multicast group member to which the multicast group IP address has been added, the three-layer multicast member replication information records a member port and a member port VLAN thereof, the switching unit 73 is configured to record three-layer multicast hardware table entries for the multicast replication unit 74, the three-layer multicast forwarding table entries record more than one three-layer multicast member replication information corresponding to the multicast source IP address, the VLAN to which the multicast source belongs, the multicast replication unit 74 splits the three-layer multicast hardware table entries into a channel forwarding information table entry and a channel multicast member table entry pointed thereto, the three-layer multicast data packet forwarding information table is searched for one more than one member port and a member port VLAN thereof, the three-layer multicast forwarding information table is searched for the three-layer multicast forwarding table entry is searched for the three-layer multicast forwarding information, the three-layer multicast forwarding table entry is read from the three-layer multicast forwarding table entry corresponding to the three-layer multicast forwarding table entry, and the three-layer multicast forwarding information is read from the three-layer multicast port layer multicast forwarding table entry is read, and the three-multicast forwarding information is read from the three-layer multicast table entry layer multicast forwarding table entry.
The multicast replication unit 74 is configured to identify a forwarding channel where a member port of the three-layer multicast member replication information is located, set a channel three-layer multicast forwarding information table entry in a channel forwarding information table of the identified forwarding channel to record an IP address of a multicast source, a VLAN to which the multicast source belongs, and an IP address of a multicast group, set a channel multicast member replication table entry in the channel replication information table of the identified forwarding channel to record three-layer multicast member replication information, and split the three-layer multicast hardware table entry into the channel forwarding information table entry and the channel multicast member replication table entry pointed by the channel multicast forwarding information table entry.
The multicast replication unit 74 sends the received IGMP query message of the internet group management protocol to the control unit 721, acquires one or more designated VLANs from the control unit 721 for broadcasting the IGMP query message, sends one or more IGMP query messages through the second port mapped by the forwarding ports of the one or more designated VLANs, receives the IGMP query message through the internal forwarding port directly connected to the second port, and sends the IGMP query message through the forwarding ports of the one or more designated VLANs.
The control unit 721 maintains the software three-layer multicast member information according to the internet group management protocol IGMP report message, wherein the multicast group IP address carried by the software three-layer multicast member information record IGMP report message corresponds to the receiving member port of the IGMP report message and the VLAN thereof.
The multicast replication unit 74 sends the unknown three-layer multicast data message to the control unit 721, the control unit 721 matches the multicast group IP address of the unknown three-layer multicast data message to the software three-layer multicast member information based on the unknown three-layer multicast data message, generates a three-layer multicast software table item based on the software three-layer multicast member information, records the multicast source IP address, the multicast source VLAN and the receiving member port of the IGMP report message corresponding to the multicast group IP address of the unknown three-layer multicast data message and the VLAN thereof, the configuration unit 722 sets new three-layer multicast forwarding information and new three-layer multicast replication information according to the three-layer multicast software table item on the switching unit 73, wherein the new three-layer multicast forwarding information comprises the multicast source IP address, the multicast source VLAN and the multicast group IP address of the unknown three-layer multicast data message, and the new three-layer multicast forwarding information comprises the receiving member port of the IGMP report message and the VLAN thereof.
The foregoing description of the preferred embodiments of the application is not intended to be limiting, but rather to enable any modification, equivalent replacement, improvement or the like to be made within the spirit and principles of the application.