Message forwarding method and device, wireless controller and computer readable storage medium
By using a tunnel multicast forwarding table to directly route multicast packets to the correct APs, the method addresses the inefficiencies in AC processing and encapsulation, enhancing multicast packet forwarding efficiency in WLAN systems.
Patent Information
- Application Number
- CN202410063742.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-01-15
- Publication Date
- 2025-07-15
AI Technical Summary
In WLAN, the wireless controller in tunnel forwarding mode has low efficiency in forwarding multicast service messages, mainly due to the need to copy and encapsulate multicast service messages multiple times. Especially when the number of APs is huge, the processing pressure of the AC will increase sharply and the system throughput will decrease.
By establishing a tunnel multicast forwarding table in the wireless controller, recording the correspondence between the multicast address and the tunnel information of the wireless access point where the wireless terminal is located, querying the tunnel information based on the multicast address, accurately forwarding multicast service messages, reducing copying and packaging processing on the wireless controller.
It improves the efficiency of multicast service packet forwarding of wireless controllers in tunnel forwarding mode, and reduces the processing pressure and bandwidth waste of wireless controllers.
Smart Images

Figure CN120321316A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technologies, and in particular, to a method and apparatus for packet forwarding, a wireless controller, and a computer-readable storage medium. Background Art
[0002] Currently, when a WLAN (Wireless Local Area Network) is deployed in an AC (Access Controller) + AP (Access Point) manner, there are two forwarding modes: direct forwarding mode and tunnel forwarding mode. In the tunnel forwarding mode, supervision, charging, etc. of wireless services can be implemented through the AC. When the tunnel forwarding mode is adopted, service packets of wireless terminals will all pass through the AC for encapsulation / decapsulation and forwarding processing.
[0003] In the tunnel forwarding mode, wireless services are encapsulated in packets in accordance with the CAPWAP (Control And Provisioning of Wireless Access Points Protocol) specified format (the entire service packet serves as the payload, and four headers, namely an Ethernet header, an IP (Internet Protocol) header, a UDP (User Datagram Protocol) header, and a CAPWAP header, are added to the outer layer. The IP address in the IP layer header of the outer layer headers is the IP address of the AC and the AP), and the encapsulated packets are forwarded between the AC and the AP in a unicast manner. Among them, the downlink service packets (packets sent to wireless terminals) are CAPWAP-encapsulated by the AC and sent to the AP, and the AP performs protocol transformation after CAPWAP decapsulation and then sends them to the wireless terminals.
[0004] For multicast service packets sent to wireless terminals, the AC needs to perform multiple replications and CAPWAP encapsulations on the packets. The actual number of replications and encapsulations is determined by the number of APs in the same broadcast domain. When the number of APs is extremely large, the processing pressure on the AC will increase sharply, and the system throughput rate will also decrease accordingly, thereby reducing the forwarding efficiency of the AC for multicast service packets in the tunnel forwarding mode. Summary of the Invention
[0005] In view of this, an object of the present invention is to provide a method and apparatus for packet forwarding, a wireless controller, and a computer-readable storage medium, so as to improve the forwarding efficiency of the wireless controller for multicast service packets in the tunnel forwarding mode.
[0006] To achieve the above object, the technical solutions adopted in the embodiments of the present invention are as follows:
[0007] In a first aspect, the present invention provides a packet forwarding method applied to a wireless controller. The wireless controller establishes tunnels with multiple wireless access points. The method includes:
[0008] Query a tunnel multicast forwarding table according to the multicast address in the received multicast service packet to obtain all tunnel information corresponding to the multicast address; the tunnel multicast forwarding table is used to record the correspondence between the multicast address and the tunnel information of all wireless terminals in the multicast group located at the wireless access points.
[0009] Send the multicast service packet to the corresponding wireless access point respectively according to all the tunnel information corresponding to the multicast address.
[0010] In an optional embodiment, the method further includes:
[0011] When receiving a membership report packet sent by a wireless terminal, obtain the IP address of the wireless terminal and the multicast address joined by the wireless terminal from the membership report packet;
[0012] Obtain the tunnel identifier of the wireless access point where the wireless terminal is located according to the IP address of the wireless terminal;
[0013] Query all the tunnel information corresponding to the multicast address in the tunnel multicast forwarding table; when all the tunnel identifiers in all the tunnel information corresponding to the multicast address are different from the tunnel identifier corresponding to the IP address, or the multicast address is not recorded in the tunnel multicast forwarding table, add the correspondence between the multicast address and the new tunnel information in the tunnel multicast forwarding table; the new tunnel information includes the tunnel identifier corresponding to the IP address and the survival period.
[0014] Query all the multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; when all the multicast addresses in all the multicast group information corresponding to the IP address of the wireless terminal are different from the multicast address in the membership report packet, or the IP address of the wireless terminal is not recorded in the terminal multicast group table, add the correspondence between the IP address of the wireless terminal and the new multicast group information in the terminal multicast group table; the terminal multicast group table is used to record the correspondence between the IP address of the wireless terminal and the multicast group information; the new multicast group information includes the multicast address in the membership report packet and the survival period; the survival period is the current time plus a preset timeout period.
[0015] In an optional embodiment, the method further includes:
[0016] When receiving a leave report packet sent by a wireless terminal, obtain the multicast address from which the wireless terminal withdraws from the leave report packet;
[0017] According to all tunnel information corresponding to the multicast addresses from which the wireless terminals have exited as described in the tunnel multicast forwarding table, send specific group query messages to the corresponding wireless access points respectively;
[0018] Within the preset timeout period after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
[0019] In an optional embodiment, the method further includes:
[0020] Send general group query messages to all wireless access points under the same broadcast domain respectively, and the wireless access points send the general group query messages to each wireless terminal under the wireless access points;
[0021] When a reply message corresponding to the general group query message is received through the corresponding wireless access point within the preset timeout period after sending the general group query message, update the survival period in the tunnel information of the corresponding wireless access point in the tunnel multicast forwarding table according to the multicast address in the reply message corresponding to the general group query message, and update the survival period in the multicast group information corresponding to the multicast address in the terminal multicast group table according to the IP address in the reply message corresponding to the general group query message;
[0022] When the preset timeout period is exceeded after sending the general group query message to the wireless access point, and there is tunnel information in the tunnel information of the wireless access point corresponding to all multicast addresses in the tunnel multicast forwarding table whose survival period has not been updated, send specific group query messages to the corresponding wireless access points according to the tunnel information whose survival period has not been updated;
[0023] When the preset timeout period is exceeded after sending the general group query message to the wireless access point, and there is multicast group information in the multicast group information corresponding to all wireless terminals under the wireless access point in the terminal multicast group table whose survival period has not been updated, send specific group query messages to the corresponding wireless access points respectively according to all tunnel information corresponding to the multicast addresses in the unupdated multicast group information;
[0024] Within the preset timeout period after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
[0025] In an optional embodiment, the method further includes:
[0026] When a wireless terminal is offline, query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table;
[0027] Query all tunnel information corresponding to the multicast address in the multicast group information in the tunnel multicast forwarding table, and send a specific group query message to the corresponding wireless access point according to each piece of tunnel information;
[0028] Within the preset timeout period after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
[0029] In an alternative embodiment, the step of updating the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point within the preset timeout period after sending the specific group query message to the wireless access point includes:
[0030] Within the preset timeout period after sending the specific group query message to the wireless access point, if a reply message corresponding to the specific group query message is received through the corresponding wireless access point, update the survival period in the tunnel information of the corresponding wireless access point in the tunnel multicast forwarding table according to the multicast address in the reply message corresponding to the specific group query message; update the survival period in the multicast group information corresponding to the multicast address in the terminal multicast group table according to the IP address in the reply message corresponding to the specific group query message;
[0031] When the preset timeout period is exceeded after sending the specific group query message to the wireless access point and the survival period in the tunnel information of the wireless access point corresponding to the multicast address in the specific group query message has not been updated, clear the tunnel information of the wireless access point corresponding to the multicast address in the specific group query message in the tunnel multicast forwarding table;
[0032] When the preset timeout period is exceeded after sending the specific group query message to the wireless access point and the survival period in the multicast group information corresponding to the wireless terminal that has joined the multicast address in the specific group query message under the wireless access point has not been updated, clear the multicast group information corresponding to the wireless terminal that has joined the multicast address in the specific group query message under the wireless access point in the terminal multicast group table.
[0033] In an alternative embodiment, the method further includes:
[0034] When a wireless terminal roams, obtain the tunnel identifier of the wireless access point where the wireless terminal is located according to the IP address of the wireless terminal;
[0035] Query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table;
[0036] When all other wireless terminals under the wireless access point where the wireless terminal is located after roaming are not in the same multicast group as the wireless terminal, add the correspondence between the multicast address in the multicast group information and the tunnel information of the wireless access point where the wireless terminal is located after roaming in the tunnel multicast forwarding table; the tunnel information of the wireless access point where the wireless terminal is located after roaming includes the tunnel identifier corresponding to the IP address;
[0037] When all other wireless terminals under the wireless access point where the wireless terminal is located before roaming are not in the same multicast group as the wireless terminal, clear the correspondence between the multicast address in the multicast group information and the tunnel information of the wireless access point where the wireless terminal is located before roaming in the tunnel multicast forwarding table.
[0038] In a second aspect, the present invention provides a message forwarding device, which is applied to a wireless controller. The wireless controller establishes tunnels with multiple wireless access points. The device includes:
[0039] A processing module, configured to query a tunnel multicast forwarding table according to the multicast address in the received multicast service message to obtain all tunnel information corresponding to the multicast address; the tunnel multicast forwarding table is used to record the correspondence between the multicast address and the tunnel information of all wireless terminals in the multicast group located at the wireless access point;
[0040] A sending module, configured to send the multicast service message to the corresponding wireless access point respectively according to all tunnel information corresponding to the multicast address.
[0041] In a third aspect, the present invention provides a wireless controller, including a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the message forwarding method described in any one of the foregoing embodiments are implemented.
[0042] In a fourth aspect, the present invention provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by a processor, the steps of the message forwarding method described in any one of the foregoing embodiments are implemented.
[0043] The method, device, wireless controller and computer-readable storage medium for packet forwarding provided by the embodiments of the present invention. The wireless controller establishes tunnels with multiple wireless access points. The wireless controller queries the tunnel multicast forwarding table according to the multicast address in the received multicast service packet to obtain all tunnel information corresponding to the multicast address. The tunnel multicast forwarding table is used to record the corresponding relationship between the multicast address and the tunnel information of all wireless terminals in the multicast group located at the wireless access points. According to all the tunnel information corresponding to the multicast address, the multicast service packets are respectively sent to the corresponding wireless access points. Since the tunnel multicast forwarding table records the corresponding relationship between the multicast address and the tunnel information of all wireless terminals in the multicast group located at the wireless access points, according to the multicast address in the received multicast service packet and the tunnel multicast forwarding table, the destination of the multicast service packet can be determined, so that the multicast service packet can be accurately forwarded to the wireless access point where the wireless terminal in the multicast group is located, without sending it to all wireless access points in the same broadcast domain, reducing the replication and encapsulation processing of the multicast service packet on the wireless controller, and improving the forwarding efficiency of the wireless controller for the multicast service packet in the tunnel forwarding mode.
[0044] To make the above objects, features and advantages of the present invention more obvious and understandable, the following specific preferred embodiments are given, and in conjunction with the accompanying drawings, the detailed description is as follows. BRIEF DESCRIPTION OF THE DRAWINGS
[0045] To more clearly illustrate the technical solutions of the embodiments of the present invention, the following will briefly introduce the drawings required for the embodiments. It should be understood that the following drawings only show some embodiments of the present invention, and therefore should not be regarded as limiting the scope. For those of ordinary skill in the art, without creative efforts, other relevant drawings can be obtained based on these drawings.
[0046] Figure 1 FIG. shows a schematic diagram of an application environment applicable to the embodiments of the present invention;
[0047] Figure 2 FIG. shows a schematic flowchart of a packet forwarding method provided by the embodiments of the present invention;
[0048] Figure 3 FIG. shows another schematic flowchart of a packet forwarding method provided by the embodiments of the present invention;
[0049] Figure 4 FIG. shows a functional module diagram of a packet forwarding device provided by the embodiments of the present invention;
[0050] Figure 5 FIG. shows another functional module diagram of a packet forwarding device provided by the embodiments of the present invention;
[0051] Figure 6A block diagram of a wireless controller provided by an embodiment of the present invention is shown.
[0052] Icons: 100 - wireless controller; 200 - wireless access point; 300 - wireless terminal; 600 - packet forwarding device; 110 - memory; 120 - processor; 130 - communication module; 610 - processing module; 620 - sending module; 630 - data maintenance module. Detailed implementation manners
[0053] Next, the technical solutions in the embodiments of the present invention will be clearly and completely described in conjunction with the accompanying drawings in the embodiments of the present invention. Obviously, the described embodiments are only a part of the embodiments of the present invention, rather than all the embodiments. Usually, the components of the embodiments of the present invention described and shown in the accompanying drawings here can be arranged and designed in various different configurations.
[0054] Therefore, the following detailed description of the embodiments of the present invention provided in the accompanying drawings is not intended to limit the scope of the claimed present invention, but merely represents selected embodiments of the present invention. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative efforts belong to the scope of protection of the present invention.
[0055] It should be noted that relational terms such as "first" and "second" are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any actual relationship or order between these entities or operations. Moreover, the terms "comprising", "including" or any other variant thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements not only includes those elements, but also includes other elements not expressly listed, or also includes elements inherent to such process, method, article or device. Without further limitation, an element defined by the statement "including a..." does not exclude the existence of additional identical elements in the process, method, article or device including the element.
[0056] In the prior art, when a wireless controller forwards multicast service packets in tunnel forwarding mode, it needs to spread the multicast service packets across the entire broadcast domain, regardless of whether the wireless terminals on the corresponding APs have joined the multicast group. This not only increases the processing volume of packet replication and encapsulation, but also wastes bandwidth. Based on this, the embodiments of the present invention optimize the forwarding of multicast service packets. By determining the destination of the multicast service packets according to the multicast address in the received multicast service packets and the tunnel multicast forwarding table, the multicast service packets can be accurately forwarded to the wireless access points where the wireless terminals in the multicast group are located, without the need to send them to all wireless access points in the same broadcast domain, reducing the replication and encapsulation processing of multicast service packets on the wireless controller and improving the forwarding efficiency of the wireless controller for multicast service packets in tunnel forwarding mode.
[0057] Next, each embodiment of the present invention will be described in detail with reference to the accompanying drawings.
[0058] Please refer to Figure 1 , which is a schematic diagram of an application environment applicable to the embodiments of the present invention. The wireless controller 100 is communicatively connected to a plurality of wireless access points 200. At least one wireless terminal 300 is connected to each wireless access point 200, and each wireless terminal 300 can join different multicast groups. The wireless controller 100 establishes tunnels with the plurality of wireless access points 200, and the wireless access points 200 correspond to the tunnels one by one. The wireless controller 100 uses the tunnel forwarding mode to forward service packets.
[0059] In this embodiment, for the multicast service packets sent to the wireless terminal 300, the wireless controller 100 can determine the destination of the multicast service packets, so as to accurately forward the multicast service packets to the wireless access point 200 where the wireless terminal 300 in the multicast group is located, without the need to send them to all wireless access points 200 in the same broadcast domain, reducing the replication and encapsulation processing of multicast service packets on the wireless controller 100 and improving the forwarding efficiency of the wireless controller 100 for multicast service packets in tunnel forwarding mode.
[0060] Please refer to Figure 2 , which is a schematic flowchart of a packet forwarding method provided by an embodiment of the present invention. It should be noted that the packet forwarding method of the present invention is not limited to Figure 2 and the following specific order. It should be understood that in other embodiments, the order of some steps of the packet forwarding method of the present invention can be interchanged according to actual needs, or some of the steps can also be omitted or deleted. The packet forwarding method can be applied to the above-mentioned wireless controller 100. The following will elaborate on Figure 2 the specific process shown.
[0061] Step S201: Query the tunnel multicast forwarding table based on the multicast address in the received multicast service packet to obtain all tunnel information corresponding to the multicast address; the tunnel multicast forwarding table is used to record the correspondence between the multicast address and the tunnel information of all wireless access points where the wireless terminals in the multicast group are located.
[0062] In this embodiment, the tunnel multicast forwarding table can be stored in the wireless controller 100. The tunnel information of all wireless access points where the wireless terminals in each multicast group are located can be represented by a tunnel list. Then, the tunnel multicast forwarding table is indexed by the multicast address and stores the tunnel list corresponding to each multicast group. Each item in the tunnel list corresponds to the tunnel information of a tunnel.
[0063] In this embodiment, by querying the tunnel multicast forwarding table based on the multicast address in the multicast service packet, the tunnel list corresponding to the multicast address can be obtained, and thus all tunnel information corresponding to the multicast address can be obtained.
[0064] Step S202: Send the multicast service packet to the corresponding wireless access point respectively according to all the tunnel information corresponding to the multicast address.
[0065] In this embodiment, since there is a one-to-one correspondence between the wireless access point and the tunnel, after obtaining all the tunnel information corresponding to the multicast address, the multicast service packet can be copied and encapsulated respectively according to each tunnel information, and then sent to the wireless access point corresponding to the tunnel information.
[0066] It can be seen that in the packet forwarding method provided by the embodiment of the present invention, the wireless controller queries the tunnel multicast forwarding table based on the multicast address in the received multicast service packet to obtain all the tunnel information corresponding to the multicast address; the tunnel multicast forwarding table is used to record the correspondence between the multicast address and the tunnel information of all wireless access points where the wireless terminals in the multicast group are located; according to all the tunnel information corresponding to the multicast address, the multicast service packet is sent to the corresponding wireless access point respectively. Since the tunnel multicast forwarding table records the correspondence between the multicast address and the tunnel information of all wireless access points where the wireless terminals in the multicast group are located, the destination of the multicast service packet can be determined according to the multicast address in the received multicast service packet and the tunnel multicast forwarding table, reducing the diffusion of the multicast service packet in the broadcast domain, so that the multicast service packet can be accurately forwarded to the wireless access point where the wireless terminal in the multicast group is located, without sending it to all wireless access points in the same broadcast domain, reducing the replication and encapsulation processing of the multicast service packet on the wireless controller, and improving the forwarding efficiency of the wireless controller for the multicast service packet in the tunnel forwarding mode.
[0067] In one embodiment, to achieve the precise forwarding of multicast service packets, it is necessary to establish a tunnel multicast forwarding table and a terminal multicast group table in the wireless controller, and store the forwarding relationship through these two data structures, namely the tunnel multicast forwarding table and the terminal multicast group table.
[0068] Among them, the terminal multicast group table is used to record the correspondence between the IP address of the wireless terminal and the multicast group information. This terminal multicast group table is indexed by the wireless terminal and stores the information of the multicast groups joined by the wireless terminal.
[0069] Next, the establishment process of the tunnel multicast forwarding table and the terminal multicast group table will be described. Please refer to Figure 3 , the packet forwarding method provided by the embodiment of the present invention may further include:
[0070] Step S301, when receiving a membership report packet sent by a wireless terminal, obtain the IP address of the wireless terminal and the multicast address joined by the wireless terminal from the membership report packet.
[0071] In this embodiment, when the wireless terminal 300 joins a multicast group, it will send a membership report packet. This membership report packet is CAPWAP encapsulated by the wireless access point 200 where the wireless terminal 300 is located and sent to the wireless controller 100 through the CAPWAP tunnel; after the wireless controller 100 decapsulates it, it parses the membership report packet to obtain the IP address of the wireless terminal 300 and the multicast address that the wireless terminal 300 wants to join. Among them, this membership report packet can be a protocol packet of IGMP (Internet Group Management Protocol) or MLD (Multicast Listener Discover).
[0072] Step S302, obtain the tunnel identifier of the wireless access point where the wireless terminal is located according to the IP address of the wireless terminal.
[0073] In this embodiment, the wireless controller 100 also stores a terminal flow table, which is used to record the correspondence between the IP addresses of all online wireless terminals 300 and the tunnel identifiers of the wireless access points 200 where the wireless terminals 300 are located. Each item in the terminal flow table can be understood as a flow record corresponding to a wireless terminal 300. This flow record can be generated by the wireless controller 100 according to the association packet reported by the wireless terminal 300 after the wireless terminal 300 goes online.
[0074] When the wireless controller 100 parses the IP address of the wireless terminal 300, by querying the terminal flow table, the tunnel identifier corresponding to the IP address of the wireless terminal 300 can be obtained from the terminal flow table.
[0075] Step S303: Query all tunnel information corresponding to the multicast address in the tunnel multicast forwarding table; when all tunnel identifiers in the tunnel information corresponding to the multicast address are different from the tunnel identifier corresponding to the IP address, or when the multicast address is not recorded in the tunnel multicast forwarding table, add the corresponding relationship between the multicast address and the new tunnel information in the tunnel multicast forwarding table; the new tunnel information includes the tunnel identifier corresponding to the IP address and the survival period.
[0076] In this embodiment, each item of tunnel information in the tunnel multicast forwarding table may include a tunnel identifier, a survival period, an active query count, etc. The survival period can be the current time plus a preset timeout when configured. For example, the preset timeout can be 120s; the active query count can be configured with a default value, for example, the default value is 1.
[0077] In an example, the tunnel multicast forwarding table can be as shown in Table 1:
[0078] Table 1
[0079]
[0080] Suppose the multicast address obtained by the wireless controller 100 from the member report message is M1, and the tunnel identifier obtained according to the IP address of the wireless terminal 300 is TID3. When the wireless controller 100 queries the tunnel multicast forwarding table shown in Table 1 according to the multicast address M1, it can obtain that the tunnel identifiers in the tunnel information corresponding to the multicast address M1 are TID1 and TID2 respectively. Since the tunnel identifier corresponding to the IP address of the wireless terminal 300 is TID3, which is different from both TID1 and TID2, a corresponding relationship between the multicast address M1 and the new tunnel information is added to the tunnel multicast forwarding table. The tunnel identifier in the new tunnel information is TID3, and the survival period is the current time T n1 + the preset timeout D, then the updated tunnel multicast forwarding table is as shown in Table 2:
[0081] Table 2
[0082]
[0083] Similarly, suppose the multicast address obtained by the wireless controller 100 from the member report message is M3, and the tunnel identifier obtained according to the IP address of the wireless terminal 300 is TID1. When the wireless controller 100 queries the tunnel multicast forwarding table shown in Table 2 according to the multicast address M3, it cannot obtain the tunnel information corresponding to the multicast address M3, indicating that the multicast address M3 is not recorded in the tunnel multicast forwarding table. At this time, a corresponding relationship between the multicast address M3 and the new tunnel information is added to the tunnel multicast forwarding table. The tunnel identifier in the new tunnel information is TID1, and the survival period is the current time T n2 + the preset timeout D, then the updated tunnel multicast forwarding table is as shown in Table 3:
[0084] Table 3
[0085]
[0086] It can be understood that after the wireless controller 100 finds all the corresponding tunnel information in the tunnel multicast forwarding table according to the multicast address in the member report message, it compares the tunnel identifier in the found tunnel information with the tunnel identifier corresponding to the IP address of the wireless terminal 300. When it is determined that there is the same tunnel identifier, it indicates that the correspondence between the multicast address joined by the wireless terminal 300 and the tunnel information of the wireless access point where the wireless terminal is located has been recorded in the tunnel multicast forwarding table, and at this time, there is no need to update the tunnel multicast forwarding table.
[0087] Step S304, query all the multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; when all the multicast addresses in all the multicast group information corresponding to the IP address of the wireless terminal are different from the multicast address in the member report message, or the IP address of the wireless terminal is not recorded in the terminal multicast group table, add the correspondence between the IP address of the wireless terminal and the new multicast group information in the terminal multicast group table; the terminal multicast group table is used to record the correspondence between the IP address of the wireless terminal and the multicast group information; the new multicast group information includes the multicast address and the survival period in the member report message; the survival period is the current time plus a preset timeout time.
[0088] In this embodiment, each piece of multicast group information in the terminal multicast group table may include a multicast address, a survival period, etc. The survival period can be the current time plus a preset timeout time when configured. For example, the preset timeout time can be 120s.
[0089] In an example, the terminal multicast group table may be as shown in Table 4:
[0090] Table 4
[0091] IP address of the wireless terminal Multicast address TTL (Time To Live) IP1 M1 T1 IP2 M1 T2 IP3 M2 T3 … … …
[0092] Assume that the multicast address obtained by the wireless controller 100 from the member report message is M3, and the obtained IP address is IP1. The wireless controller 100 queries the terminal multicast group table shown in Table 4 according to the IP address IP1, and can obtain all the multicast group information corresponding to the IP address IP1. Among them, the multicast address in the multicast group information corresponding to IP1 is M1, which is different from the multicast address M3 in the member report message. Therefore, add the correspondence between the IP address IP1 of the wireless terminal and the new multicast group information in the terminal multicast group table. The multicast address in the new multicast group information is M3, and the survival period is the current time T n3 + the preset timeout time D, then the updated terminal multicast group table is as shown in Table 5:
[0093] Table 5
[0094]
[0095] Similarly, assume that the multicast address obtained by the wireless controller 100 from the member report message is M1, and the obtained IP address is IP4. The wireless controller 100 queries the terminal multicast group table shown in Table 5 according to the IP address IP4 of the wireless terminal, and cannot obtain the multicast group information corresponding to the IP address IP4, indicating that the IP address IP4 is not recorded in the terminal multicast group table. At this time, add the corresponding relationship between the IP address IP4 and the new multicast group information to the terminal multicast group table. The multicast address in the new multicast group information is M1, and the survival period is the current time T n4 + the preset timeout D, then the updated terminal multicast group table is shown in Table 6:
[0096] Table 6
[0097]
[0098]
[0099] In practical applications, the wireless terminal 300 may actively leave the group, silently leave the group, roam, and disassociate (go offline). At this time, the corresponding relationships stored in the tunnel multicast forwarding table and the terminal multicast group table will also change. Therefore, in the above several cases, it is necessary to update the tunnel multicast forwarding table and the terminal multicast group table to implement the maintenance of the tunnel multicast forwarding table and the terminal multicast group table, so as to ensure the accurate forwarding and processing of multicast service messages.
[0100] For the case where the wireless terminal 300 actively leaves the group, the message forwarding method provided by the embodiment of the present invention may further include:
[0101] When receiving the leave group report message sent by the wireless terminal, obtain the multicast address from which the wireless terminal exits from the leave group report message; according to all the tunnel information corresponding to the multicast address from which the wireless terminal exits in the tunnel multicast forwarding table, send specific group query messages to the corresponding wireless access points respectively; within the preset timeout after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
[0102] In this embodiment, when the wireless terminal 300 actively leaves the group, a leave group report message (which can be a protocol message of IGMP or MLD) will be sent. After the leave group report message is sent to the wireless controller 100 through the tunnel, the wireless controller 100 performs tunnel decapsulation and parses the leave group report message to obtain information such as the IP address of the wireless terminal and the multicast address from which the wireless terminal exits.
[0103] The wireless controller 100 queries the tunnel multicast forwarding table through the multicast address in the leave report message to obtain all tunnel information corresponding to the multicast address, and then sends a specific group query message to each wireless access point 200 corresponding to the tunnel information. The wireless access point 200 sends the specific group query message to the corresponding wireless terminal 300. The specific group query message carries the multicast address in the leave report message and is used to query which multicast members (wireless terminals) exist in the specified multicast address. That is to say, each wireless terminal 300 that receives the specific group query message will determine whether it belongs to the multicast members in the multicast address specified in the specific group query message. If it is a multicast member in the multicast address, it will generate a corresponding reply message for the specific group query message and send the reply message corresponding to the specific group query message to the wireless access point 200, and the wireless access point will send it to the wireless controller 100 through the corresponding tunnel.
[0104] After the wireless controller 100 sends a specific group query message to each wireless access point 200, it can start a timer to determine whether it receives the reply message corresponding to the specific group query message sent by the corresponding wireless access point 200 within a preset timeout period, or compare the reception time of the reply message corresponding to the specific group query message with the survival period in the corresponding entry to determine whether the message reply times out, and then perform operations such as clearing the entries and updating the survival period in the tunnel multicast forwarding table and the terminal multicast group table to achieve dynamic updates of the tunnel multicast forwarding table and the terminal multicast group table.
[0105] In this embodiment, when the wireless controller 100 sends a specific group query message to the corresponding wireless access point 200 according to each tunnel information corresponding to the multicast address in the leave report message, it can update the survival period in the tunnel information corresponding to the multicast address in the tunnel multicast forwarding table to the current time plus the preset timeout period, and update the survival period in the multicast group information corresponding to the wireless terminal that joins the multicast address under the wireless access point 200 in the terminal multicast group table to the current time plus the preset timeout period.
[0106] For the case where the wireless terminal 300 actively leaves the group, within the preset timeout period after the wireless controller 100 sends a specific group query message to the wireless access point, according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point, the tunnel multicast forwarding table and the terminal multicast group table are updated. Specifically, within the preset timeout period after sending the specific group query message to the wireless access point, if a reply message corresponding to the specific group query message is received through the corresponding wireless access point, then the lifetime in the tunnel information of the corresponding wireless access point in the tunnel multicast forwarding table is updated according to the multicast address in the reply message corresponding to the specific group query message; the lifetime in the multicast group information corresponding to the multicast address is updated in the terminal multicast group table according to the IP address in the reply message corresponding to the specific group query message; when the preset timeout period is exceeded after sending the specific group query message to the wireless access point, and the lifetime in the tunnel information of the wireless access point corresponding to the multicast address in the specific group query message has not been updated, the tunnel information of the wireless access point corresponding to the multicast address in the specific group query message is cleared in the tunnel multicast forwarding table; when the preset timeout period is exceeded after sending the specific group query message to the wireless access point, and the lifetime in the multicast group information corresponding to the wireless terminal that joins the multicast address in the specific group query message under the wireless access point has not been updated, the multicast group information corresponding to the wireless terminal that joins the multicast address in the specific group query message under the wireless access point is cleared in the terminal multicast group table.
[0107] For example, assume that the wireless controller 100 establishes tunnels with three wireless access points 200 (AP1, AP2, and AP3 respectively). The wireless terminals connected to AP1 (corresponding tunnel identifier is TID1) are STA1 (IP address is IP1) and STA2 (IP address is IP2). The wireless terminals connected to AP2 (corresponding tunnel identifier is TID2) are STA3 (IP address is IP3). The wireless terminals connected to AP3 (corresponding tunnel identifier is TID3) are STA4 (IP address is IP4). STA1 and STA3 are multicast members in multicast group 1 (multicast address is M1), and STA2 and STA4 are multicast members in multicast group 2 (multicast address is M2). The tunnel multicast forwarding table and the terminal multicast group table are shown in Table 7 and Table 8 respectively:
[0108] Table 7
[0109]
[0110] Table 8
[0111] IP address of the wireless terminal Multicast address TTL (Time To Live) IP1 M1 T5 IP2 M2 T6 IP3 M1 T7 IP4 M2 T8
[0112] When the multicast address in the leave report sent by STA1 is M1, the wireless controller 100 needs to send specific group query messages for the multicast address M1 to AP1 and AP2 respectively. When sending a specific group query message to AP1, the lifetime in the tunnel information of the tunnel with tunnel ID TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table is updated. Since the wireless terminal STA1 that has joined multicast group 1 is under AP1, the lifetime in the multicast group information with multicast address M1 corresponding to IP1 in the terminal multicast group table needs to be updated. Since the wireless terminal STA1 connected to AP1 has left multicast group 1 and the wireless terminal STA2 connected to AP1 does not belong to the multicast members in multicast group 1, after the wireless controller 100 sends a specific group query message for the multicast address M1 to AP1, no wireless terminal will return a reply message corresponding to the specific group query message through AP1. Therefore, when the lifetime in the tunnel information of the tunnel with tunnel ID TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table is not updated within the preset timeout period, the tunnel information of the tunnel with tunnel ID TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table is cleared; when it is determined that the lifetime in the multicast group information with multicast address M1 corresponding to IP1 in the terminal multicast group table is not updated within the preset timeout period, the multicast group information with multicast address M1 corresponding to IP1 in the terminal multicast group table is cleared.
[0113] It should be noted that when performing the operation of clearing table entries in the tunnel multicast forwarding table and the terminal multicast group table, if a certain multicast address in the tunnel multicast forwarding table corresponds to only one tunnel information, when clearing this tunnel information, the corresponding multicast address can be deleted together; if a certain IP address in the terminal multicast group table corresponds to only one multicast group information, when clearing this multicast group information, the corresponding IP address can be deleted together.
[0114] Similarly, when the wireless controller 100 sends a specific group query message for the multicast address M1 to the AP2, the lifetime in the tunnel information of the tunnel with tunnel identifier TID2 corresponding to the multicast address M1 in the tunnel multicast forwarding table is updated. Since the wireless terminal STA3 that joins the multicast group 1 exists under the AP2, the lifetime in the multicast group information with multicast address M1 corresponding to IP3 in the terminal multicast group table needs to be updated. Since the wireless terminal STA3 connected to the AP2 is a multicast member in the multicast group 1, after STA3 receives the specific group query message for the multicast address M1, it will return a reply message corresponding to the specific group query message through the AP2. After the wireless controller 100 receives the reply message corresponding to the specific group query message sent by STA3 through the AP2 within the preset timeout period, it updates the lifetime in the tunnel information of the tunnel with tunnel identifier TID2 corresponding to the multicast address M1 in the tunnel multicast forwarding table, and updates the lifetime in the multicast group information with multicast address M1 corresponding to IP3 in the terminal multicast group table. In this way, data maintenance of the tunnel multicast forwarding table and the terminal multicast group table can be achieved in the scenario where a wireless terminal actively leaves the group.
[0115] For the case where the wireless terminal 300 silently leaves the group, the message forwarding method provided by the embodiment of the present invention may further include:
[0116] Sending a general group query message (General Query) to all wireless access points in the same broadcast domain respectively, and sending the general group query message to each wireless terminal under the wireless access point through the wireless access point; when a reply message corresponding to the general group query message is received through the corresponding wireless access point within the preset timeout period after sending the general group query message, updating the lifetime in the tunnel information of the corresponding wireless access point in the tunnel multicast forwarding table according to the multicast address in the reply message corresponding to the general group query message, and updating the lifetime in the multicast group information corresponding to the multicast address in the terminal multicast group table according to the IP address in the reply message corresponding to the general group query message; when the preset timeout period is exceeded after sending the general group query message to the wireless access point, and there is tunnel information in which the lifetime has not been updated in the tunnel information of the wireless access points corresponding to all multicast addresses in the tunnel multicast forwarding table, sending a specific group query message to the corresponding wireless access point according to the tunnel information in which the lifetime has not been updated; when the preset timeout period is exceeded after sending the general group query message to the wireless access point, and there is multicast group information in which the lifetime has not been updated in the multicast group information corresponding to all wireless terminals under the wireless access point in the terminal multicast group table, sending specific group query messages to the corresponding wireless access points respectively according to all tunnel information corresponding to the multicast addresses in the multicast group information in which the update has not occurred; within the preset timeout period after sending the specific group query message to the wireless access point, updating the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
[0117] In this embodiment, the main difference between the general group query message and the specific group query message is that the general group query message does not specify the multicast address to be queried. Therefore, the specific group query message only needs to be sent to some of the wireless access points and does not need to be spread to the entire broadcast domain, while the general group query message needs to be sent to all wireless access points. The wireless terminal that receives the general group query message will report all the multicast addresses it has joined to the wireless controller, that is, the reply message corresponding to the general group query message will carry all the multicast addresses joined by the wireless terminal and the IP address of the wireless terminal.
[0118] In this embodiment, the general group query message can be actively sent by the wireless controller or, after the general group query message sent by an intermediate forwarding device (such as a router) is detected, the general group query message is spread to the entire broadcast domain.
[0119] In this embodiment, when the wireless controller sends a general group query message to each wireless access point, it updates the survival period in the corresponding entries in the tunnel multicast forwarding table and the terminal multicast group table. For the tunnel multicast forwarding table, the survival period in the tunnel information of this wireless access point corresponding to all multicast addresses is updated to the current time plus a preset timeout period; for the terminal multicast group table, the survival period in the multicast group information corresponding to all wireless terminals connected under this wireless access point is updated to the current time plus a preset timeout period.
[0120] When, within the preset timeout period after sending the general group query message, the reply message corresponding to the general group query message is received through the corresponding wireless access point, the IP address of the wireless terminal that sent this reply message and the multicast addresses currently joined by the wireless terminal can be obtained from the reply message corresponding to the general group query message.
[0121] Taking the above Tables 7 and 8 as examples, assume that the wireless terminal STA1 under AP1 silently leaves the group (i.e., exits the multicast address M1). The wireless terminals connected to AP1 are STA1 and STA2. STA1 belongs to the multicast members in multicast group 1, and STA2 belongs to the multicast members in multicast group 2. When the wireless controller 100 sends a general group query message to AP1, it will set the survival time in the tunnel information with tunnel identifier TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table, and the survival time in the tunnel information with tunnel identifier TID1 corresponding to the multicast address M2; in the terminal multicast group table, it will set the multicast group information with multicast address M1 corresponding to STA1 connected to AP1, and the multicast group information with multicast address M2 corresponding to STA2. The wireless controller 100 receives a reply message corresponding to the general group query message sent by STA2 through AP1 within the preset timeout period. The reply message carries the IP address IP2 of STA2 and the multicast address M2 that STA2 currently joins. The wireless controller 100 updates the survival time in the tunnel information with tunnel identifier TID1 corresponding to the multicast address M2 in the tunnel multicast forwarding table, and updates the survival time in the multicast group information with multicast address M2 corresponding to the IP address IP2 in the terminal multicast group table. When the preset timeout period is exceeded and it is found that the survival time in the tunnel information with tunnel identifier TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table has not been updated, it is initially determined that the tunnel information with tunnel identifier TID1 corresponding to the multicast address M1 needs to be cleared; similarly, when the preset timeout period is exceeded and it is found that the survival time in the multicast group information with multicast address M1 corresponding to the IP address IP1 in the terminal multicast group table has not been updated, it is initially determined that the multicast group information with multicast address M1 corresponding to IP1 in the terminal multicast group table needs to be cleared.
[0122] In this embodiment, when it is initially determined that the entries in the tunnel multicast forwarding table and the terminal multicast group table need to be cleared, the clearing operation will not be immediately executed. Instead, the wireless controller 100 initiates a specific group query to avoid misjudgment and ensure the data accuracy in the tunnel multicast forwarding table and the terminal multicast group table.
[0123] Specifically, when it is preliminarily determined that the tunnel information with the tunnel identifier TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table needs to be cleared, it can be further determined whether the number of active queries in the tunnel information with the tunnel identifier TID1 corresponding to the multicast address M1 is 0. If it is not 0, a specific group query message (carrying the multicast address M1) for the multicast address M1 can be sent to the corresponding wireless access point AP1, and the lifetime in the tunnel information with the tunnel identifier TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table is updated. At the same time, the number of active queries in the tunnel information with the tunnel identifier TID1 corresponding to the multicast address M1 is decremented by 1; the lifetime in the multicast group information with the multicast address M1 corresponding to IP1 in the terminal multicast group table is updated. When more than the preset timeout period has passed after sending the specific group query message to AP1 and no reply message sent by the wireless terminal STA1 according to the specific group query message has been received, then neither the lifetime in the tunnel information with the tunnel identifier TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table nor the lifetime in the multicast group information with the multicast address M1 corresponding to IP1 in the terminal multicast group table has been updated within the preset timeout period. At this time, the tunnel information with the tunnel identifier TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table and the multicast group information with the multicast address M1 corresponding to IP1 in the terminal multicast group table can be cleared.
[0124] Similarly, when it is preliminarily determined that the multicast group information of the multicast address M1 corresponding to IP1 in the terminal multicast group table needs to be cleared, the wireless controller 100 queries the tunnel multicast forwarding table according to the multicast address M1, and finds the tunnel information with tunnel identifiers TID1 and TID2. If the active query count in the tunnel information is not 0, the wireless controller 100 can send a specific group query message (carrying the multicast address M1) for the multicast address M1 to AP1 and AP2 through the corresponding tunnel. When sending the specific group query message to AP1, update the survival period in the tunnel information of the tunnel with tunnel identifier TID1 corresponding to the multicast address M1 in the tunnel multicast forwarding table, and decrement the active query count by 1; update the survival period in the multicast group information corresponding to the wireless terminal (i.e., STA1) that joins the multicast address M1 under AP1 in the terminal multicast group table; when sending the specific group query message to AP2, update the survival period in the tunnel information of the tunnel with tunnel identifier TID2 corresponding to the multicast address M1 in the tunnel multicast forwarding table, and decrement the active query count by 1; update the survival period in the multicast group information corresponding to the wireless terminal (i.e., STA3) that joins the multicast address M1 under AP2 in the terminal multicast group table. Subsequently, referring to the process of updating the tunnel multicast forwarding table and the terminal multicast group table after the wireless controller 100 sends specific group query messages for the multicast address M1 to AP1 and AP2 respectively in the above scenario where the wireless terminal actively leaves the group, the data maintenance of the tunnel multicast forwarding table and the terminal multicast group table in the scenario where the wireless terminal silently leaves the group is realized.
[0125] For the case where the wireless terminal 300 is offline, the packet forwarding method provided by the embodiment of the present invention may further include:
[0126] When a wireless terminal is offline, query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; query all tunnel information corresponding to the multicast address in the multicast group information in the tunnel multicast forwarding table, and send a specific group query message to the corresponding wireless access point according to each tunnel information; within a preset timeout period after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
[0127] In this embodiment, the wireless controller 100 can actively query whether the wireless terminals 300 under each wireless access point 200 are online, so as to determine whether there are offline wireless terminals 300; of course, the wireless terminal 300 can also report a disassociation message when it is offline, so as to facilitate the wireless controller 100 to discover the offline wireless terminal 300.
[0128] When the wireless controller 100 discovers an offline wireless terminal, it can query the terminal multicast group table based on the IP address of the wireless terminal, so as to obtain the multicast group information of all multicast groups joined by the wireless terminal.
[0129] Still taking the above Table 7 and Table 8 as an example, assume that the wireless terminal STA1 is offline. The wireless controller 100 finds the multicast group information with the multicast address M1 according to the IP address IP1 of the wireless terminal STA1, and finds the tunnel information with the tunnel identifiers TID1 and TID2 in the tunnel multicast forwarding table according to the multicast address M1, so as to determine that a specific group query message (carrying the multicast address M1) for the multicast address M1 needs to be sent to AP1 and AP2. Among them, the updated content of the survival time when sending the specific group query message, and the content of updating the tunnel multicast forwarding table and the terminal multicast group table after sending the specific group query message can refer to the relevant content in the above scenarios of the wireless terminal actively leaving the group and silently leaving the group, which will not be elaborated here. In this way, the data maintenance of the tunnel multicast forwarding table and the terminal multicast group table in the wireless terminal offline scenario can be realized.
[0130] For the situation where the wireless terminal 300 roams, the message forwarding method provided by the embodiment of the present invention may further include:
[0131] When a wireless terminal roams, obtain the tunnel identifier of the wireless access point where the wireless terminal is located according to the IP address of the wireless terminal; query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; when all other wireless terminals under the wireless access point where the wireless terminal is located after roaming are not in the same multicast group as the wireless terminal, add the corresponding relationship between the multicast address in the multicast group information and the tunnel information of the wireless access point where the wireless terminal is located after roaming in the tunnel multicast forwarding table; the tunnel information of the wireless access point where the wireless terminal is located after roaming includes the tunnel identifier corresponding to the IP address; when all other wireless terminals under the wireless access point where the wireless terminal is located before roaming are not in the same multicast group as the wireless terminal, clear the corresponding relationship between the multicast address in the multicast group information and the tunnel information of the wireless access point where the wireless terminal is located before roaming in the tunnel multicast forwarding table.
[0132] In this embodiment, when a wireless terminal roams, the wireless access point accessed by the wireless terminal will change, but the multicast group information of the wireless terminal does not change. Therefore, the data maintenance of the tunnel multicast forwarding table is mainly involved in the roaming scenario.
[0133] Still taking the above Tables 7 and 8 as an example, after the wireless terminal STA1 roams from AP1 to AP2, the wireless controller 100 queries the terminal flow table according to the IP address IP1 of STA1, and can obtain the tunnel identifier TID2 of the wireless access point AP2 where the wireless terminal is currently located; according to the IP address IP1 of STA1, query the terminal multicast group table, and the multicast group information corresponding to the multicast address M1 of the IP address IP1 of STA1 can be obtained.
[0134] In addition to STA1, there is also STA3 among the wireless terminals under the wireless access point AP2 where STA1 is located after roaming. Since both STA1 and SAT3 are multicast members in multicast group 1, and the corresponding relationship between the multicast address M1 and the tunnel information with the tunnel identifier TID2 has been recorded in the tunnel multicast forwarding table, there is no need to update the tunnel multicast forwarding table. It can be understood that if the wireless terminal STA1 roams from AP1 to AP3, at this time, the wireless terminals under AP3 include STA1 and STA4. Since STA1 and STA4 are multicast members of different multicast groups, it is necessary to add the corresponding relationship between the multicast address M1 and the tunnel information with the tunnel identifier TID3 (the tunnel information of the wireless access point AP3 where STA1 is located after roaming) in the tunnel multicast forwarding table.
[0135] The wireless terminals STA2 and STA1 under the wireless access point AP1 where STA1 is located before roaming are multicast members of different multicast groups. When STA1 roams to AP2, there are no multicast members in the multicast group to which STA1 belongs that need to use the tunnel information of AP1. Therefore, it is necessary to clear the corresponding relationship between the multicast address M1 and the tunnel information with the tunnel identifier TID1 in the tunnel multicast forwarding table.
[0136] To execute the corresponding steps in the above embodiments and all possible ways, an implementation manner of a packet forwarding device is given below. Please refer to Figure 4 , which is a functional module diagram of the packet forwarding device 600 provided by the embodiment of the present invention. It should be noted that for the packet forwarding device 600 provided in this embodiment, its basic principle and the technical effects generated are the same as those in the above embodiments. For the sake of brief description, for the parts not mentioned in this embodiment, reference can be made to the corresponding content in the above embodiments. The packet forwarding device 600 includes: a processing module 610 and a sending module 620.
[0137] The processing module 610 is configured to query the tunnel multicast forwarding table according to the multicast address in the received multicast service packet to obtain all tunnel information corresponding to the multicast address; the tunnel multicast forwarding table is used to record the corresponding relationship between the multicast address and the tunnel information of all wireless access points where the wireless terminals in the multicast group are located.
[0138] It can be understood that the processing module 610 can execute the above step S201.
[0139] A sending module 620, configured to send multicast service packets to corresponding wireless access points respectively according to all tunnel information corresponding to a multicast address.
[0140] It can be understood that the sending module 620 can execute the above-mentioned step S202.
[0141] Optionally, please refer to Figure 5 , the packet forwarding device 600 provided in an embodiment of the present invention may further include a data maintenance module 630. The data maintenance module 630 is configured to, when receiving a membership report packet sent by a wireless terminal, obtain the IP address of the wireless terminal and the multicast address joined by the wireless terminal from the membership report packet; obtain the tunnel identifier of the wireless access point where the wireless terminal is located according to the IP address of the wireless terminal; query all tunnel information corresponding to the multicast address in the tunnel multicast forwarding table; when the tunnel identifiers in all tunnel information corresponding to the multicast address are all different from the tunnel identifier corresponding to the IP address, or when the multicast address is not recorded in the tunnel multicast forwarding table, add the corresponding relationship between the multicast address and the new tunnel information in the tunnel multicast forwarding table; the new tunnel information includes the tunnel identifier corresponding to the IP address and the survival period; query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; when the multicast addresses in all multicast group information corresponding to the IP address of the wireless terminal are all different from the multicast address in the membership report packet, or when the IP address of the wireless terminal is not recorded in the terminal multicast group table, add the corresponding relationship between the IP address of the wireless terminal and the new multicast group information in the terminal multicast group table; the terminal multicast group table is used to record the corresponding relationship between the IP address of the wireless terminal and the multicast group information; the new multicast group information includes the multicast address in the membership report packet and the survival period; the survival period is the current time plus a preset timeout period.
[0142] It can be understood that the data maintenance module 630 can execute the above-mentioned steps S301 to S304.
[0143] Optionally, the data maintenance module 630 may further be configured to, when receiving a leave group report packet sent by a wireless terminal, obtain the multicast address from which the wireless terminal withdraws from the leave group report packet; respectively send specific group query packets to corresponding wireless access points according to all tunnel information corresponding to the multicast address from which the wireless terminal withdraws in the tunnel multicast forwarding table; within a preset timeout period after sending the specific group query packets to the wireless access points, update the tunnel multicast forwarding table and the terminal multicast group table according to whether reply packets corresponding to the specific group query packets are received through the corresponding wireless access points.
[0144] Optionally, the data maintenance module 630 can also be used to separately send general group query messages to all wireless access points in the same broadcast domain, and the wireless access points send the general group query messages to each wireless terminal under the wireless access points; when a reply message corresponding to the general group query message is received through the corresponding wireless access point within a preset timeout period after sending the general group query message, update the survival period in the tunnel information of the corresponding wireless access point in the tunnel multicast forwarding table according to the multicast address in the reply message corresponding to the general group query message, and update the survival period in the multicast group information corresponding to the multicast address in the terminal multicast group table according to the IP address in the reply message corresponding to the general group query message; when the preset timeout period is exceeded after sending the general group query message to the wireless access point and there is tunnel information in the tunnel information of the wireless access points corresponding to all multicast addresses in the tunnel multicast forwarding table whose survival period has not been updated, send a specific group query message to the corresponding wireless access point according to the tunnel information whose survival period has not been updated; when the preset timeout period is exceeded after sending the general group query message to the wireless access point and there is multicast group information in the multicast group information corresponding to all wireless terminals under the wireless access point in the terminal multicast group table whose survival period has not been updated, send specific group query messages to the corresponding wireless access points respectively according to all tunnel information corresponding to the multicast address in the unupdated multicast group information; within a preset timeout period after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
[0145] Optionally, when a wireless terminal goes offline, the data maintenance module 630 can also be used to query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; query all tunnel information corresponding to the multicast address in the multicast group information in the tunnel multicast forwarding table, and send specific group query messages to the corresponding wireless access points according to each tunnel information; within a preset timeout period after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
[0146] Optionally, the data maintenance module 630 is specifically configured to, within a preset timeout period after sending a specific group query message to a wireless access point, if a reply message corresponding to the specific group query message is received through the corresponding wireless access point, update the survival period in the tunnel information of the corresponding wireless access point in the tunnel multicast forwarding table according to the multicast address in the reply message corresponding to the specific group query message; update the survival period in the multicast group information corresponding to the multicast address in the terminal multicast group table according to the IP address in the reply message corresponding to the specific group query message; when the preset timeout period is exceeded after sending the specific group query message to the wireless access point and the survival period in the tunnel information of the wireless access point corresponding to the multicast address in the specific group query message has not been updated, clear the tunnel information of the wireless access point corresponding to the multicast address in the specific group query message in the tunnel multicast forwarding table; when the preset timeout period is exceeded after sending the specific group query message to the wireless access point and the survival period in the multicast group information of the wireless terminal that joins the multicast address in the specific group query message under the wireless access point has not been updated, clear the multicast group information of the wireless terminal that joins the multicast address in the specific group query message under the wireless access point in the terminal multicast group table.
[0147] Optionally, the data maintenance module 630 can also be used to, when a wireless terminal roams, obtain the tunnel identifier of the wireless access point where the wireless terminal is located according to the IP address of the wireless terminal; query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; when all other wireless terminals under the wireless access point where the wireless terminal is located after roaming are not in the same multicast group as the wireless terminal, add the corresponding relationship between the multicast address in the multicast group information and the tunnel information of the wireless access point where the wireless terminal is located after roaming in the tunnel multicast forwarding table; the tunnel information of the wireless access point where the wireless terminal is located after roaming includes the tunnel identifier corresponding to the IP address; when all other wireless terminals under the wireless access point where the wireless terminal is located before roaming are not in the same multicast group as the wireless terminal, clear the corresponding relationship between the multicast address in the multicast group information and the tunnel information of the wireless access point where the wireless terminal is located before roaming in the tunnel multicast forwarding table.
[0148] As can be seen, the packet forwarding device provided by the embodiment of the present invention includes a processing module and a sending module. The processing module is configured to query the tunnel multicast forwarding table according to the multicast address in the received multicast service packet to obtain all tunnel information corresponding to the multicast address; the tunnel multicast forwarding table is used to record the correspondence between the multicast address and the tunnel information of all wireless access points where the wireless terminals in the multicast group are located; the sending module is configured to send the multicast service packet to the corresponding wireless access point respectively according to all tunnel information corresponding to the multicast address. Since the tunnel multicast forwarding table records the correspondence between the multicast address and the tunnel information of all wireless access points where the wireless terminals in the multicast group are located, the destination of the multicast service packet can be determined according to the multicast address in the received multicast service packet and the tunnel multicast forwarding table, so that the multicast service packet can be accurately forwarded to the wireless access point where the wireless terminal in the multicast group is located, without sending it to all wireless access points in the same broadcast domain, reducing the replication and encapsulation processing of the multicast service packet on the wireless controller, and improving the forwarding efficiency of the wireless controller for the multicast service packet in the tunnel forwarding mode.
[0149] Please refer to Figure 6 , which is a block diagram of a wireless controller 100 provided by an embodiment of the present invention. The wireless controller 100 includes a memory 110, a processor 120, and a communication module 130. The elements of the memory 110, the processor 120, and the communication module 130 are electrically connected directly or indirectly to each other to achieve data transmission or interaction. For example, these elements can be electrically connected to each other through one or more communication buses or signal lines.
[0150] Among them, the memory 110 is used to store programs or data. The memory 110 can be, but is not limited to, a random access memory (RAM), a read only memory (ROM), a programmable read only memory (PROM), an erasable programmable read only memory (EPROM), an electrically erasable programmable read only memory (EEPROM), etc.
[0151] The processor 120 is configured to read / write the data or program stored in the memory 110 and execute corresponding functions. For example, when the computer program stored in the memory 110 is executed by the processor 120, the packet forwarding methods disclosed in the above embodiments can be implemented.
[0152] The communication module 130 is used to establish a communication connection between the wireless controller 100 and other devices through a network, and is used to transmit and receive data through the network.
[0153] It should be understood that Figure 6 The structure shown is only a schematic diagram of the structure of the wireless controller 100, and the wireless controller 100 may further include more or fewer components than those shown Figure 6 shown, or have a different configuration from that Figure 6 shown. Figure 6 Each component shown can be implemented by hardware, software, or a combination thereof.
[0154] An embodiment of the present invention also provides a computer-readable storage medium, on which a computer program is stored. When the computer program is executed by the processor 120, the message forwarding method disclosed in the above embodiments is implemented.
[0155] In several embodiments provided in the present application, it should be understood that the disclosed devices and methods can also be implemented in other ways. The device embodiments described above are merely illustrative. For example, the flowcharts and block diagrams in the drawings show the possible architectures, functions, and operations of devices, methods, and computer program products according to multiple embodiments of the present invention. In this regard, each block in the flowchart or block diagram may represent a module, a program segment, or a part of code, and the module, program segment, or part of code contains one or more executable instructions for implementing the specified logical function. It should also be noted that in some alternative implementations, the functions marked in the blocks may occur in a different order from that marked in the drawings. For example, two consecutive blocks may actually be executed substantially in parallel, and they may sometimes be executed in the reverse order, depending on the functions involved. It should also be noted that each block in the block diagram and / or flowchart, and the combination of blocks in the block diagram and / or flowchart, can be implemented by a dedicated hardware-based system for performing the specified functions or actions, or can be implemented by a combination of dedicated hardware and computer instructions.
[0156] In addition, in each embodiment of the present invention, the functional modules can be integrated together to form an independent part, or each module can exist alone, or two or more modules can be integrated to form an independent part.
[0157] When the above-mentioned functions are implemented in the form of software function modules and sold or used as independent products, they can be stored in a computer-readable storage medium. Based on such an understanding, the technical solution of the present invention, in essence, or the part that contributes to the prior art, or a part of this technical solution, can be embodied in the form of a software product. This computer software product is stored in a storage medium and includes several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to execute all or part of the steps of the methods described in various embodiments of the present invention. The foregoing storage medium includes: various media such as USB flash drives, mobile hard disks, read-only memories (ROMs), random access memories (RAMs), magnetic disks, or optical discs that can store program codes.
[0158] The foregoing are only the preferred embodiments of the present invention and are not intended to limit the present invention. For those skilled in the art, the present invention may have various changes and modifications. Any modifications, equivalent replacements, improvements, etc. made within the spirit and principle of the present invention shall be included within the protection scope of the present invention.
Claims
1. A message forwarding method, characterized in that Applied to a wireless controller, the wireless controller establishes tunnels with multiple wireless access points, and the method includes: Query the tunnel multicast forwarding table according to the multicast address in the received multicast service packet to obtain all tunnel information corresponding to the multicast address; the tunnel multicast forwarding table is used to record the correspondence between the multicast address and the tunnel information of all wireless terminals in the multicast group located at the wireless access points. Send the multicast service packet to the corresponding wireless access point respectively according to all the tunnel information corresponding to the multicast address.
2. The message forwarding method according to claim 1, wherein The method further includes: When receiving a membership report packet sent by a wireless terminal, obtain the IP address of the wireless terminal and the multicast address joined by the wireless terminal from the membership report packet. Obtain the tunnel identifier of the wireless access point where the wireless terminal is located according to the IP address of the wireless terminal. Query all the tunnel information corresponding to the multicast address in the tunnel multicast forwarding table; when the tunnel identifiers in all the tunnel information corresponding to the multicast address are different from the tunnel identifier corresponding to the IP address, or the multicast address is not recorded in the tunnel multicast forwarding table, add the correspondence between the multicast address and the new tunnel information in the tunnel multicast forwarding table; the new tunnel information includes the tunnel identifier corresponding to the IP address and the survival period. Query all the multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; when the multicast addresses in all the multicast group information corresponding to the IP address of the wireless terminal are different from the multicast address in the membership report packet, or the IP address of the wireless terminal is not recorded in the terminal multicast group table, add the correspondence between the IP address of the wireless terminal and the new multicast group information in the terminal multicast group table; the terminal multicast group table is used to record the correspondence between the IP address of the wireless terminal and the multicast group information; the new multicast group information includes the multicast address in the membership report packet and the survival period; the survival period is the current time plus a preset timeout period.
3. The message forwarding method according to claim 2, wherein The method further includes: When receiving a leave group report packet sent by a wireless terminal, obtain the multicast address that the wireless terminal quits from the leave group report packet. Send specific group query packets to the corresponding wireless access points respectively according to all the tunnel information corresponding to the multicast address that the wireless terminal quits in the tunnel multicast forwarding table. Within the preset timeout period after sending the specific group query packet to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply packet corresponding to the specific group query packet is received through the corresponding wireless access point.
4. The message forwarding method according to claim 2, wherein The method further includes: Send general group query packets to all wireless access points under the same broadcast domain respectively, and the wireless access points send the general group query packets to each wireless terminal under the wireless access points. When, within the preset timeout period after sending the general group query message, a reply message corresponding to the general group query message is received through the corresponding wireless access point, update the lease time in the tunnel information of the corresponding wireless access point in the tunnel multicast forwarding table according to the multicast address in the reply message corresponding to the general group query message, and update the lease time in the multicast group information corresponding to the multicast address in the terminal multicast group table according to the IP address in the reply message corresponding to the general group query message; When the preset timeout period is exceeded after sending the general group query message to the wireless access point, and there is tunnel information in the tunnel information of the wireless access point corresponding to all multicast addresses in the tunnel multicast forwarding table whose lease time has not been updated, send a specific group query message to the corresponding wireless access point according to the tunnel information whose lease time has not been updated; When the preset timeout period is exceeded after sending the general group query message to the wireless access point, and there is multicast group information in the multicast group information corresponding to all wireless terminals under the wireless access point in the terminal multicast group table whose lease time has not been updated, send specific group query messages to the corresponding wireless access points respectively according to all tunnel information corresponding to the multicast address in the multicast group information that has not been updated; Within the preset timeout period after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
5. The message forwarding method according to claim 2, wherein The method further includes: When a wireless terminal goes offline, query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; Query all tunnel information corresponding to the multicast address in the multicast group information in the tunnel multicast forwarding table, and send specific group query messages to the corresponding wireless access points according to each piece of tunnel information; Within the preset timeout period after sending the specific group query message to the wireless access point, update the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point.
6. The packet forwarding method according to any one of claims 3-5, characterized in that, The step of updating the tunnel multicast forwarding table and the terminal multicast group table according to whether a reply message corresponding to the specific group query message is received through the corresponding wireless access point within the preset timeout period after sending the specific group query message to the wireless access point includes: Within the preset timeout period after sending the specific group query message to the wireless access point, if a reply message corresponding to the specific group query message is received through the corresponding wireless access point, update the lease time in the tunnel information of the corresponding wireless access point in the tunnel multicast forwarding table according to the multicast address in the reply message corresponding to the specific group query message; update the lease time in the multicast group information corresponding to the multicast address in the terminal multicast group table according to the IP address in the reply message corresponding to the specific group query message; When the preset timeout period is exceeded after the specific group query message is sent to the wireless access point, and the lifetime in the tunnel information of the wireless access point corresponding to the multicast address in the specific group query message has not been updated, clear the tunnel information of the wireless access point corresponding to the multicast address in the specific group query message in the tunnel multicast forwarding table; When the preset timeout period is exceeded after the specific group query message is sent to the wireless access point, and the lifetime in the multicast group information of the wireless terminals joined to the multicast address in the specific group query message under the wireless access point has not been updated, clear the multicast group information of the wireless terminals joined to the multicast address in the specific group query message under the wireless access point in the terminal multicast group table.
7. The message forwarding method according to claim 2, wherein The method further includes: When a wireless terminal roams, obtain the tunnel identifier of the wireless access point where the wireless terminal is located according to the IP address of the wireless terminal; Query all multicast group information corresponding to the IP address of the wireless terminal in the terminal multicast group table; When all other wireless terminals under the wireless access point where the wireless terminal is located after roaming are not in the same multicast group as the wireless terminal, add the correspondence between the multicast address in the multicast group information and the tunnel information of the wireless access point where the wireless terminal is located after roaming in the tunnel multicast forwarding table; the tunnel information of the wireless access point where the wireless terminal is located after roaming includes the tunnel identifier corresponding to the IP address; When all other wireless terminals under the wireless access point where the wireless terminal is located before roaming are not in the same multicast group as the wireless terminal, clear the correspondence between the multicast address in the multicast group information and the tunnel information of the wireless access point where the wireless terminal is located before roaming in the tunnel multicast forwarding table.
8. A message forwarding device, characterized in that, Applied to a wireless controller, the wireless controller establishes tunnels with multiple wireless access points, and the device includes: A processing module, configured to query the tunnel multicast forwarding table according to the multicast address in the received multicast service message to obtain all tunnel information corresponding to the multicast address; the tunnel multicast forwarding table is used to record the correspondence between the multicast address and the tunnel information of all wireless terminals in the multicast group located at the wireless access point; A sending module, configured to send the multicast service message to the corresponding wireless access point respectively according to all tunnel information corresponding to the multicast address.
9. A wireless controller, characterized in that, It includes a processor, a memory, and a computer program stored on the memory and executable on the processor. When the computer program is executed by the processor, the steps of the packet forwarding method according to any one of claims 1-7 are implemented.
10. A computer-readable storage medium, characterized in that, A computer program is stored on the computer-readable storage medium. When the computer program is executed by the processor, the steps of the packet forwarding method according to any one of claims 1-7 are implemented.