CN115883448A - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN115883448A
CN115883448A CN202111143922.4A CN202111143922A CN115883448A CN 115883448 A CN115883448 A CN 115883448A CN 202111143922 A CN202111143922 A CN 202111143922A CN 115883448 A CN115883448 A CN 115883448A
Authority
CN
China
Prior art keywords
message
network device
link
router
forwarding
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Pending
Application number
CN202111143922.4A
Other languages
Chinese (zh)
Inventor
张畅
余宗宝
易鹏
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Huawei Technologies Co Ltd
Original Assignee
Huawei Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Huawei Technologies Co Ltd filed Critical Huawei Technologies Co Ltd
Priority to CN202111143922.4A priority Critical patent/CN115883448A/en
Publication of CN115883448A publication Critical patent/CN115883448A/en
Pending legal-status Critical Current

Links

Images

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The application relates to a message forwarding method and device. The method involves a first network device and a second network device. In the method, a first network device may aggregate ports of multiple links that can reach a second network device on its own device into a virtual bonding port, and then shunt received messages sent by a user device to different links to forward the messages to the second network device. Therefore, messages can be transmitted to the opposite terminal equipment by utilizing the multiple links, the condition that the load on a single link is overlarge is avoided, the data transmission efficiency can be improved, and the user experience is improved.

Description

Message forwarding method and device
Technical Field
The present application relates to the field of terminal technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
With the rapid development of wireless broadband technology, the radio frequency coverage of a single device cannot meet the requirements of large range and high throughput performance, and therefore, it is gradually becoming an industry trend that multiple wireless devices cooperate to perform hybrid networking. However, as the demand of users increases, the data of users in the network also increases, so that the load on the link is relatively large. When the data volume is particularly large, data to be transmitted may be queued in a buffer of a node, so that the data cannot be normally transmitted, and thus the data cannot be normally received and transmitted, and the network is stuck.
Disclosure of Invention
The application provides a message forwarding method and device, which are used for improving the data transmission efficiency and improving the user experience.
In a first aspect, the present application provides a method for forwarding a packet. In the method, first, a first network device receives a first message sent by a user device, wherein the first message comprises a destination Media Access Control (MAC) address; then, if the first network device determines that the destination MAC address included in the first packet is the MAC address of the second network device, at least one flow corresponding to the first packet is allocated to at least two links included in the first aggregation port. The first network equipment is slave equipment of second network equipment, and the first aggregation port is obtained by aggregation of at least two ports of at least two links which can reach the second network equipment on the first network equipment; finally, the first network device forwards the at least one flow to the second network device according to the assigned link.
It should be understood that the first network device and the second network device are in a master-slave device relationship, and the first aggregation port is aggregated by ports in an uplink direction of the first network device. That is, the slave device (i.e., the first network device) aggregates the uplink into one port.
Through the technical scheme, after the slave equipment receives the message sent by the user equipment, the message can be distributed to the plurality of links in the uplink aggregation port of the slave equipment and forwarded to the master equipment, so that the data transmission efficiency can be improved, the problem that the data cannot be transmitted due to the overlarge data volume and the network is blocked is avoided, and the user experience can be improved. And, the forwarding of the message is carried out based on the direction of the physical link, the forwarding direction of the message can be controlled, and the problem of broadcast packet flooding is avoided.
In one possible design, before the first network device determines that the destination MAC address included in the first packet is the MAC address of the second network device, the method further includes: the first network equipment determines that the first message comprises a plurality of quintuple information.
By the technical scheme, before the slave device determines that the received first message is sent to the master device, the slave device needs to determine that quintuple information can be extracted from the first message, so that whether corresponding data can be searched in an IP FDB table or not can be conveniently and subsequently judged, and a forwarding link of the first message is determined.
In one possible design, the allocating, by the first network device, at least one flow corresponding to the first packet on the at least two links includes:
and the first network equipment distributes at least one flow corresponding to the first message on the at least two links according to the five-tuple information and the residual bandwidths of the at least two links.
Through the technical scheme, the slave device can obtain the residual bandwidth of the multiple links, then the forwarding link of the stream corresponding to each quintuple information is determined based on the quintuple information and the residual bandwidth, different streams are distributed to different links, the data transmission efficiency is improved, and the user experience is improved.
In one possible design, before the first network device distributes at least one flow corresponding to the first packet over the at least two links, the method further includes:
the first network device determines that at least one flow record corresponding to the first message does not exist in the first flow table. The first flow table includes record information of the flow forwarded by the first network device, and the record information includes quintuple information, a receiving port of the flow, and a forwarding port of the flow.
By the technical scheme, the slave device can store the record information of the flow forwarded by the slave device, and after the five-tuple information is extracted by the slave device, whether the same five-tuple information is forwarded by the slave device can be judged by looking up the flow table. And if the record information is not found, distributing a forwarding link for the stream corresponding to the quintuple information according to the quintuple information and the residual bandwidth of the link.
In one possible design, the method further includes: if the first network device determines that the record of the at least one flow corresponding to the first message exists in the first flow table, the first network device forwards the at least one flow corresponding to the first message according to the forwarding port of the flow recorded in the first flow table.
Through the technical scheme, if the slave device finds the record of the current five-tuple information in the flow table, the flow corresponding to the current five-tuple information can be forwarded according to the forwarding exit information of the record in the flow table, a link does not need to be allocated again, and the data transmission efficiency can be improved.
In one possible design, before forwarding, by the first network device, the at least one stream to the second network device according to the allocated link, the method further includes: the first network device determines that the first message is a non-game message.
By the technical scheme, before the slave device forwards the first message to the master device in a shunting manner, the slave device can determine a forwarding link of the first message according to the service type of the first message. When the first message is a non-game message, that is, the first message is a delay insensitive service, the first message may be forwarded to the master device in a distributed manner.
In one possible design, the method further includes: if the first network device determines that the first message is a game message, a first link is selected to forward at least one stream corresponding to the first message to a second network device, wherein the first link is a link with the lowest time delay in at least two links included in the first aggregation port.
Through the technical scheme, when the first message is the game message, namely the first message is a delay-sensitive service, the link with the lowest delay can be selected to forward the message to the main equipment, so that the lowest delay in the message forwarding process can be ensured, the low delay and zero blocking of the game service can be ensured, and the user experience can be improved.
In one possible design, the method further includes: and the first network equipment receives a second message sent by the second network equipment through the first link. The first link is a link with the lowest time delay selected from at least two links included in the first aggregation port when the second network device determines that the first message is the game message, and the second message is sent to the second network device by the server.
Through the technical scheme, after the main device receives the first message, whether the first message is a game message can be judged. If the first message is a game message, that is, the first message is a delay-sensitive service, the master device may select the link with the lowest delay to forward the feedback message to the slave device, so that the lowest delay in the message forwarding process can be ensured, the low delay and zero blocking of the game service can be ensured, and the user experience can be improved.
In one possible design, the method further includes: and the first network equipment receives a third message forwarded by the second network equipment through the distributed link, wherein the third message is sent to the second network equipment by the server.
Through the technical scheme, after the master device receives the first message, the first message can be sent to the server, the server feeds back the corresponding message to the master device, and the master device forwards the message fed back by the server to the slave device according to the original link.
In a second aspect, the present application further provides a message forwarding method. The method is applied to the second network device. The method can comprise the following steps: firstly, a second network device receives a first message sent by a first network device according to a distributed link; the second network device then determines whether the first message (i.e., the upstream message) is a game message. Specifically, if the second network device determines that the first message is a game message, the second network device sends a second message (i.e., a downlink message) to the first network device through the first link, where the first link is a link with the lowest time delay selected by the second network device from at least two links included in the first aggregation port, and the second message is sent to the second network device by the server; if the second network device determines that the first message is a non-game message, a third message (namely a downlink message) is sent to the first network device through the distributed link, and the third message is sent to the second network device by the server.
By the technical scheme, after the main equipment receives the first message, whether the first message is a game message can be judged. If the first message is a game message, that is, the first message is a delay-sensitive service, the master device may select a link with the lowest delay to forward the feedback message to the slave device, so as to ensure that the delay in the message forwarding process is the lowest, ensure that the game service has low delay and zero jamming, and improve user experience.
In a third aspect, the present application provides a first network device. The first network device includes one or more processors; one or more memories; and one or more computer programs; wherein one or more computer programs are stored in the one or more memories, the one or more computer programs comprising instructions which, when invoked for execution by the one or more processors, cause the first network device to perform the method of any of the first aspects and possible designs of the first aspects described above.
Illustratively, the instructions, when executed by one or more processors, cause the first network device to perform the steps of: receiving a first message sent by user equipment, wherein the first message comprises a target Media Access Control (MAC) address; if the destination MAC address included in the first message is determined to be the MAC address of the second network device, allocating at least one flow corresponding to the first message on at least two links included in a first aggregation port, wherein the first network device is a slave device of the second network device, and the first aggregation port is obtained by aggregating at least two ports, which can reach the at least two links of the second network device, of the first network device; and forwarding at least one stream corresponding to the first message to the second network equipment according to the distributed link.
In a fourth aspect, the present application provides a second network device. The second network device includes one or more processors; one or more memories; and one or more computer programs; wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs comprising instructions which, when executed by the one or more processors, cause the second network device to perform the method of the second aspect described above.
Illustratively, the instructions, when executed by the one or more processors, cause the second network device to perform the steps of: receiving a first message sent by first network equipment according to the distributed link; if the first message is determined to be a game message, sending a second message to the first network device through the first link, wherein the first link is a link with the lowest time delay selected by the second network device from at least two links included in the first aggregation port, and the second message is sent to the second network device by the server; and if the first message is determined to be a non-game message, sending a third message to the first network equipment through the distributed link, wherein the third message is sent to the second network equipment by the server.
In a fifth aspect, the present application further provides a computer-readable storage medium. The computer readable storage medium has stored therein instructions that, when run on the first network device, cause the first network device to perform the method of the first aspect and any possible design of the first aspect thereof.
In a sixth aspect, the present application further provides a computer-readable storage medium. The computer readable storage medium has stored therein instructions which, when run on the second network device, cause the second network device to perform the method of the second aspect.
In a seventh aspect, an embodiment of the present application provides a computer program product. The computer program product, when run on a first network device, causes the first network device to perform the method of the first aspect of the embodiments of the present application and any of the possible designs of the first aspect.
In an eighth aspect, embodiments of the present application provide a computer program product. When the computer program product is run on a second network device, the second network device is caused to perform the method of the second aspect of the embodiments of the present application.
For various possible schemes in the third aspect to the eighth aspect and possible technical effects achieved by the various possible schemes, please refer to the technical effect description that can be achieved for the various possible schemes in the first aspect and the second aspect, and details are not described here.
Drawings
Fig. 1 is a schematic diagram of a networking provided in an embodiment of the present application;
fig. 2 is a schematic view of an application scenario of the message forwarding method according to the embodiment of the present application;
fig. 3A to fig. 3C are schematic diagrams illustrating a connection process of a router according to an embodiment of the present application;
fig. 4 is a flowchart of a message forwarding method according to an embodiment of the present application;
fig. 5 is a flowchart of a link allocation method according to an embodiment of the present application;
fig. 6 is a schematic diagram of link weights provided in an embodiment of the present application;
fig. 7 is a schematic diagram of a forwarding path of a flow according to an embodiment of the present application;
FIG. 8 is a schematic tree diagram according to an embodiment of the present application;
fig. 9 is a flowchart of another packet forwarding method according to an embodiment of the present application;
fig. 10 is a schematic diagram of a message forwarding device according to an embodiment of the present application.
Detailed Description
The terminology used in the following examples is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in the specification of this application and the appended claims, the singular forms "a", "an", "the" and "the" are intended to include the plural forms as well, such as "one or more", unless the context clearly indicates otherwise. It should also be understood that in the following embodiments of the present application, "at least one", "one or more" means one or more than two (including two). The term "and/or" is used to describe an association relationship that associates objects, meaning that three relationships may exist; for example, a and/or B, may represent: a exists singly, A and B exist simultaneously, and B exists singly, wherein A and B can be singular or plural. The character "/" generally indicates that the former and latter associated objects are in an "or" relationship.
Reference throughout this specification to "one embodiment" or "some embodiments," or the like, means that a particular feature, structure, or characteristic described in connection with the embodiment is included in one or more embodiments of the present application. Thus, appearances of the phrases "in one embodiment," "in some embodiments," "in other embodiments," or the like, in various places throughout this specification are not necessarily all referring to the same embodiment, but rather mean "one or more but not all embodiments" unless specifically stated otherwise. The terms "comprising," "including," "having," and variations thereof mean "including, but not limited to," unless expressly specified otherwise. The term "coupled" includes both direct and indirect connections, unless otherwise noted.
In the following, the terms "first", "second" are used for descriptive purposes only and are not to be understood as indicating or implying relative importance or implicitly indicating the number of technical features indicated. Thus, a feature defined as "first" or "second" may explicitly or implicitly include one or more of that feature.
In the embodiments of the present application, words such as "exemplary" or "for example" are used to mean serving as examples, illustrations or descriptions. Any embodiment or design described herein as "exemplary" or "such as" is not necessarily to be construed as preferred or advantageous over other embodiments or designs. Rather, use of the word "exemplary" or "such as" is intended to present relevant concepts in a concrete fashion.
Exemplarily, fig. 1 is a schematic networking diagram provided in an embodiment of the present application. The router comprises a master router, a slave router, a user device, a mobile phone, a tablet computer and the like, wherein the router A, the router B, the router C, the router D, the router E and the router F can be routers, the other routers are slave routers, and the user device can be connected under the router D, the router E and the router F, for example, the mobile phone, the tablet computer and the like. In the schematic diagram (a) shown in fig. 1, if a mobile phone is connected to the router D, the forwarding direction of the packet sent by the mobile phone is: D-B-A. If the mobile phone is connected to the router E, the forwarding direction of the message sent by the mobile phone is: E-B-A. If the mobile phone is connected to the router F, the forwarding direction of the message sent by the mobile phone is: F-C-A.
In the schematic diagram (b) shown in fig. 1, if a mobile phone is connected to the router D, the forwarding direction of the packet sent by the mobile phone is: D-B-A; D-A; D-E-B-A; D-E-C-A. If the mobile phone is connected to the router E, the forwarding direction of the message sent by the mobile phone is as follows: E-B-A; E-C-A; E-C-B-A. If the mobile phone is connected to the router F, the forwarding direction of the message sent by the mobile phone is: F-C-A; F-A; F-E-B-A.
For the networking schematic diagram shown in fig. 1, the networking shown in (a) can only establish a single link networking, and has limitations on physical links. (b) The networking shown requires the chip to support 802.11s protocol, which has hardware limitation, and the 802.11s protocol only supports wireless link. Taking fig. 1 (ase:Sub>A) as an example, assuming that ase:Sub>A mobile phone is connected below the router D, when ase:Sub>A user sets up multiple tasks such as watching ase:Sub>A video on the mobile phone, downloading ase:Sub>A file, etc., the load on the link D-B-ase:Sub>A will be relatively large, and multiple tasks may need to be queued, which may cause network congestion.
In view of this, an embodiment of the present application provides a message forwarding method, which allocates a received message to multiple links, so as to avoid the problem of network congestion caused by a large load on one link, so that data transmission is faster, that is, data transmission efficiency is improved, and user experience is improved.
Fig. 2 exemplarily shows an application scenario of the packet forwarding method provided in the embodiment of the present application. As shown in fig. 2, the scenario may include a Master Device (MD) (e.g., a master router device) 11, a Slave Device (SD) (e.g., a slave router device) 12, and a User Device (UD) 13. The slave device 12 and the user device 13 may be interconnected via a communication network. Illustratively, the communication network may be a local area network, such as a wireless fidelity (Wi-Fi) hotspot network. The user equipment 13 may comprise at least one and at least one user equipment 13 may be connected to the same slave device 12 via a communication network. Of course, at least one user device 13 may also be connected to different slave devices 12 via a communication network. It should be understood that fig. 1 is only a schematic illustration, and the number of the user devices 13 and the number of the slave devices 12 in the embodiment of the present application are not particularly limited.
The master device MD functions as follows: (1) responsible for managing the slave devices belonging to an autonomous area; (2) Completing communication interaction with other main equipment based on a communication protocol (MDP) between the main equipment; (3) The service function of the slave device can be synchronously undertaken, and the service is provided for the outside. The slave device SD functions as follows: (1) The service function is completed by matching with the main equipment, and the service is provided to the outside; (2) And providing a management signaling channel and a service forwarding channel for the next-stage slave equipment. The functions of the user device UD are as follows: the autonomous network connected with the main equipment obtains service, and does not provide service to the outside.
In the embodiment of the present application, a service from any user device UD to InterNet internets needs to go to the master device MD through the tree diagram shown in fig. 2, and then communicate with an InterNet server through a Wide Area Network (WAN) port of the master device.
The following describes a process of connecting a slave device with a master device by taking a router as an example. As shown in fig. 3A, the wan port of the master router a is directly connected to the internet, the slave router B can be intelligently connected to the master router a by one key, and then the master router a issues a domain account password of Power Line Communication (PLC) to the slave router B, and issues a Service Set Identifier (SSID) and a password of 2.4G and 5G bands to the slave router B, so that the slave router B can be connected to the master router a by three ways, i.e., PLC, 2.4G and 5G.
As shown in fig. 3B, when the slave router C accesses the local area network formed between the master router a and the slave router B, the master router a issues a domain account password of the PLC, and after the slave router C receives the ssid and the password of the 2.4G/5G frequency band, and initiates a connection from the PLC link of the router C, the router with the best PLC metric value (e.g., the link bandwidth value after the link is established is the largest) is selected, for example, the slave router B accesses the same, and for the 2.4G/5G frequency band, the slave router C may select the router with the best metric value of the 2.4G frequency band and the 5G frequency band, for example, the master router a accesses.
As shown in fig. 3C, when the slave router D accesses the local area network composed of the master router a, the slave router B, and the slave router C, the master router a issues the domain account password of the PLC, and after the ssid and the password of the 2.4G/5G frequency band are sent to the slave router D and connection is initiated from the PLC link of the router D, the router with the best PLC metric value (e.g., the link bandwidth value is the largest after the link is established) may be selected, for example, the slave router B accesses the local area network. When initiating a connection from a 2.4G link of router D, the access from router B with the best link quality may be selected, and when initiating a connection from a 5G link of router D, the router with the best 5G metric value, for example, the access from router C, may be selected.
It should be understood that the router selected by the link in fig. 3B and 3C when initiating the connection is only an illustrative example, and the application is not limited thereto.
Based on the above description, it can be known that the routers can access through different links, and therefore, the packet can be forwarded between the routers based on the physical link establishment direction. Illustratively, the message forwarding direction of the PLC link is from the slave unit to the master unit; the message forwarding direction of the Wifi link is from a Station (STA) to a wireless Access Point (AP); the message forwarding direction of the Ethernet eth link is from the port to the main port.
In some embodiments of the present application, a slave router may aggregate ports that can reach a master router from its own router into one virtual bonding port (or may be understood as that the slave router aggregates all internet-enabled ports into one virtual bonding port), and hang the virtual bonding port on a kernel two-layer bridge of the router. When the user equipment connected with the router accesses the internet, the message is forwarded to the bonding port of the router, and then the bonding port can distribute the message to different links according to the message. For example, taking fig. 3C as an example, the slave router B may aggregate all the reachable ports of a (i.e., the ports of the PLC link, the ports of the 2.4G link, and the ports of the 5G link) into one virtual bonding port, and hang the virtual bonding port on the kernel two-layer bridge of the router B. When a mobile phone or a tablet connected with the router B accesses the internet, the message is transferred to the bonding port of the router B by the bridge, and the bonding port of the router B distributes the message to different links.
The following describes a packet forwarding method according to an embodiment of the present application by taking a router as an example. Exemplarily, fig. 4 is a flowchart of a message forwarding method provided in the embodiment of the present application. As shown in fig. 4, the method may include the steps of:
it should be understood that "slave router" described below refers to a slave network device (which may also be referred to as a "first network device"), and "master router" refers to a master network device (which may also be referred to as a "second network device").
S401, receiving the message sent by the user equipment from the router.
It should be appreciated that when a user is surfing the internet on a user device, such as a cell phone, the cell phone may send a message to the connected router.
The message may include quintuple information, a Media Access Control (MAC) address of a source, and a destination MAC address. The quintuple information may include a source Internet Protocol (IP) address, a source port number, a destination IP address, a destination port number, a Protocol number.
In some embodiments, after receiving the packet sent by the user equipment from the router, whether the packet is to be sent to the bonding port of the slave router may be determined by the destination MAC in the packet. Illustratively, the slave router may look up the MAC address of the BRIDGE FDB table to determine if the destination MAC is in the table. Taking fig. 1 as an example, it is assumed that the router D receives a message sent by a mobile phone, and at this time, the router D may determine whether the message is sent to a bonding port of the router D according to a destination MAC included in the message sent by the mobile phone. Since the bonding port at the router D is formed by aggregating three ports in the uplink direction, if the destination MAC is one of the MAC of the router a, the MAC of the router B, and the MAC of the router E, the packet needs to be sent to the bonding port of the router D.
S402, judging whether the link included in the bonding port of the slave router is a link or not. If only one link of the bonding port of the slave router is available, the message is forwarded according to the unique link. If the link of the bonding port of the slave router includes a plurality of pieces, S403 is continuously performed.
In some embodiments, the slave router may decide how to forward the packet according to the number of links included in its bonding port. When the bonding port comprises only one link, the slave router can only forward from the only link. Illustratively, if there is only one PLC link from the router to the master router, the slave router can forward the message to the master router through the only PLC link.
S403, the slave router judges whether the IP FDB table is full. And if the IP FDB table is full, forwarding the message to equipment corresponding to the destination MAC in the message according to the link with the largest bandwidth. If the IP FDB table is not full, execution continues with S404.
It should be understood that in this application the IP FDB table can be written as: the IP data Forwarding base (IP FDB) is alternatively called: a data forwarding table. The IP FDB table may include quintuple information of the packet, a receiving port (abbreviated as a receiving port or an ingress) of the packet, a forwarding port (abbreviated as an egress port or an egress), and the like.
In some embodiments, after the router receives the packet, the packet may be divided into at least one Flow (Flow) according to the quintuple information in the packet, and then an ingress and an egress of each Flow are learned and recorded in the IP FDB table. And the router may be provided with a timer, the timer may be started after the router receives the message, and when the time of the timer reaches the update time (or referred to as aging time) of each record, the record may be deleted, that is, the stream record may be deleted. For example, the IP FDB table may be referred to as table 1 below.
TABLE 1
Quintuple Inlet An outlet Update time (seconds)
Flow1 eth 2.4G 120
Flow2 eth 5G 5
Flow3 5G plc 15
Flow4 2.4G 5G_2 100
It should be understood that table 1 is only an illustrative illustration, and the exit, the entry, the update time, and the like in the embodiment of the present application are not particularly limited. It should be noted that the quintuple information of the same flow is completely the same, and the quintuple information of different flows is different.
The data storage capacity of the IP FDB table has an upper limit value, for example, if the maximum number of data records that can be stored in the IP FDB table is 100, the 101 th record cannot be stored in the IP FDB table. Of course, the maximum upper limit value of the IP FDB table may be 200, and the like, which is not limited in the present application. In some embodiments, if the IP FDB table is full, the slave router forwards the packet to a device corresponding to a destination MAC in the packet according to the link with the largest bandwidth.
S404, judging whether the quintuple information can be extracted from the message or not from the router. And if the message can not extract the quintuple information, forwarding the message to the link with the largest bandwidth. If the message can extract the quintuple information, S405 is continued.
As a possible implementation manner, the slave router may determine whether the packet can extract quintuple information according to the type of the packet. Quintuple information can be extracted from a Transmission Control Protocol (TCP) message and a User Datagram Protocol (UDP) message, and quintuple information cannot be extracted from a non-TCP/UDP message, such as an Address Resolution Protocol (ARP) message. It can also be understood that the TCP message and the UDP message contain quintuple information, and the ARP message does not contain quintuple information.
In the embodiment of the application, if the message cannot extract the quintuple information, the message is forwarded to the device corresponding to the destination MAC in the message. Illustratively, assuming that the link with the largest bandwidth in the links included in the bonding port of the slave router is a 5G link, and the device corresponding to the destination MAC is the master router, the slave router may forward the packet from the 5G link to the master router.
As one possible implementation, when the packet cannot extract the quintuple information, the router may learn the MAC of the router included in the packet forwarding path. Also, the router may record the learned MAC, for example, in table 2 below.
TABLE 2
Source MAC An outlet Update time (seconds)
MAC1 2.4G 120
MAC2 5G 5
MAC3 PLC 15
MAC4 5G_2 100
It should be appreciated that table 2 is merely illustrative and that the source MAC may comprise a MAC of a router device that may be included in a forwarding path from an outgoing message to a forwarding MAC to a destination MAC. Taking the schematic diagram shown in fig. 3C as an example, assume that the forwarding path is: D-B-ase:Sub>A, the handset is connected under router D, and the source MAC may include the MAC of handset, the MAC of router D, the MAC of router B, and the MAC of router ase:Sub>A.
S405, the slave router judges whether the quintuple information can be inquired in the IP FDB table. And if the router can inquire the quintuple information in the IP FDB table, forwarding the message according to the stored link. If the slave router does not inquire the quintuple information in the IP FDB table, S406 is continuously performed.
In some embodiments, after determining that the quintuple information can be extracted from the router, it may be determined whether the quintuple information is received for the first time, i.e., whether a record of the quintuple exists may be queried from the saved IP FDB table. If the record of the quintuple can be inquired in the IP FDB table, the router is not the first time to receive the quintuple information; if the record of the quintuple is not inquired in the IP FDB table, the router is indicated to receive the quintuple information for the first time or the quintuple information is deleted after the updating time in the IP FDB table is up.
When the quintuple information of the message currently received from the router is stored in the IP FDB table, an outlet corresponding to the quintuple information, that is, which link to forward the message from, can be queried in the IP FDB table. And then, the slave router forwards the message according to the exit recorded in the IP FDB table.
S406, the slave router judges whether the destination MAC of the message is the MAC of the master router. And if the destination MAC of the message is not the MAC of the main router, forwarding the message according to the link with the largest bandwidth. If the destination MAC of the packet is the MAC of the master router, S407 continues to be performed.
In some embodiments, the slave router may determine whether the destination MAC carried in the packet is the MAC of the master router, that is, whether the packet is a packet sent to the master router. If the message is not sent to the main router, the message is forwarded according to the link with the largest bandwidth.
S407, the slave router judges whether the message is a game message. If the message is a game message, forwarding the message according to the link with the lowest time delay; if the message is not a game message, S408 is continuously executed.
It should be understood that S407 is an optional step. I.e., before S408 is performed, the slave router may also determine whether the message is a game message. If the message is a game message, forwarding the message according to the link with the lowest time delay; if the message is not a game message, S408 is continuously executed. Specifically, the slave router may include a service identification module, such as a Service Classification (SC) module, where the service identification module may identify the type of the packet based on an SC feature library. Wherein, a plurality of identification rules can be included in the SC feature library. For example, the SC may identify the message as a game message according to the IP address of the game server, the special communication protocol number of the game message, the transmission characteristics of the message, and the like. See table 3 below for an illustration of the transmission characteristics of the message.
TABLE 3
Figure BDA0003285022660000091
It should be understood that table 3 is only an illustrative example, and more user behaviors may be included in a game scene, which is not listed here.
And S408, the slave router distributes the message to a link included by the bonding port for forwarding.
Illustratively, assuming that the links included in the bonding port of the slave router are a PLC link, a 5G link, and a 2.4G link, the slave router may allocate at least one flow of packets to different links for forwarding to the master router. That is, it is ensured that all links included in the bonding port of the router are transmitting data, and the problem of excessive load on one link is avoided. Meanwhile, when the slave router accesses the network, the selected links are all optimal links, so that the transmission rate is faster.
It should be noted that, in the embodiment of the present application, links are allocated according to flows, so that the same flow can be forwarded on one link, and a problem of network congestion occurring when the same flow is forwarded on different links is avoided. Of course, in the present application, a link may also be allocated according to a message, which is not limited in particular.
The following describes in detail a forwarding process of distributing a packet to different links in this embodiment. Fig. 5 is a flowchart of a link allocation method according to an embodiment of the present application. As shown in fig. 5, the method may include the steps of:
s501, obtaining a link metric value from the router.
The link metric value may include, among other things, a maximum bandwidth of the link, a remaining bandwidth (remaining bandwidth = maximum bandwidth of the link — actually used bandwidth), a time delay, a connection status, a channel occupancy, and so on.
S502, the slave router determines a forwarding link of the message according to the quintuple information of the message and the link metric value.
In some embodiments, the slave router may obtain a link metric value from the network, may then obtain a remaining bandwidth of the link according to the obtained link metric value, and may then determine a forwarding link of the packet according to the remaining bandwidth and the five-tuple information.
Assume that there are three links between the slave router B and the master router a, including, for example, a 5G link, a 2.4G link, a PLC link. As a possible implementation manner, a hash value of the five-tuple information may be calculated by a hash (hash) algorithm, and then the forwarding link is determined based on the calculated hash value and the weight occupied by the remaining bandwidth on different links. Exemplarily, as shown in fig. 6, a schematic diagram of link weights provided for the embodiment of the present application is shown. Referring to fig. 6, it is assumed that the ratio of the remaining bandwidth of the 5G link, the remaining bandwidth of the 2.4G link, and the remaining bandwidth of the PLC link is: 1.
It should be noted that, if the frequency bands of the packet at the exit and the entrance of the router are the same, that is, the packet enters the router a from the 2.4G entrance and the exit of the router a is the 2.4G frequency band, or the packet enters the router a from the 5G entrance and the exit of the router a is the 5G frequency band, the weight value can be halved when the exit is calculated. For example, the frequency band from the mobile phone to the router 1 is 5G, the frequency bands of the router 1 and the main router 2 are 5g, and the weight value of the 5G link is 6, so that when the exit direction of the packet is calculated at the router 1, the weight value of the 5G link is 3.
In some embodiments, the forwarding link of the packet may be determined according to a remainder of a ratio of the hash value to the sum of the weights. Illustratively, the conversion relationship between the remainder value and the link can be seen in table 4 below.
TABLE 4
Remainder value Link circuit
0≤n<1 5G
1≤n<4 2.4G
4≤n<10 PLC
It should be understood that the above table 4 is only an illustrative example, and when the remaining weight ratio of the links is different, the corresponding relationship between the remainder value and the links may also be changed. That is, when the remainder value 0 is not less than n <1, the message is forwarded from the router to the outlet of the 5G link; when n is more than or equal to 1 and less than 4, the slave router forwards the message from the outlet of the 2.4G link; and when n is more than or equal to 4 and less than 10, the slave router forwards the message from the outlet of the PLC link.
S503, the slave router forwards the message to the master router according to the determined forwarding link.
Continuing with table 3 as an example, assuming that the hash value after the five tuple information hash of Flow1 is compared with the sum of the link weights and the remainder is 5, the slave router may forward Flow1 to the master router according to the PLC link. I.e., different streams, may be forwarded to the master router over the same or different links.
Exemplarily, as shown in fig. 7, a forwarding path diagram of a flow provided in an embodiment of the present application is shown. Assuming that the packet is ase:Sub>A packet from which the quintuple cannot be extracted, the packet may be forwarded according to ase:Sub>A fixed link, for example, the packet may include ase:Sub>A forwarding path shown by ase:Sub>A thick black line in (ase:Sub>A) in fig. 7, that is, the forwarding path may include D-B-ase:Sub>A; E-B-A; F-C-A.
When the packet is a packet from which five-tuple information can be extracted, assuming that the packet may include two flows, such as Flow1 and Flow2, flow1 may forward the packet according to a forwarding path indicated by a thick black line shown in (b) of fig. 7, and Flow2 may forward the packet according to a forwarding path indicated by a thick black line shown in (c) of fig. 7. It should be understood that fig. 7 is only a schematic illustration, and in practical applications, the forwarding path of the flow may be other paths, which is not limited in this application. It should be understood that the arrows below the routers D, F in fig. 7 indicate that the user equipment is connected below the routers D, F.
In the above manner, different flows may be allocated to different links for forwarding, for example, forwarding paths of flows in the group network shown in fig. 7 may be converted into a tree diagram, for example, as shown in fig. 8, so that the flows in fig. 7 may be forwarded according to an independent tree. In fig. 8, B0, D0, E0, C0, and F0 are B, D, E, C, and F shown in fig. 7 (a); b1, D1, C1, F1 in fig. 8 are B, D, C, F shown in fig. 7 (B); b2, C2, D2, and F2 in fig. 8 are B, C, D, and F shown in fig. 7 (C).
In the embodiment of the present application, because the bonding port is formed by aggregating uplink ports, the forwarding of the packet between the routers is a directional forwarding process. The learning forwarding behavior of the two-layer bridge can be controlled based on the physical directivity, the two-layer forwarding is guaranteed not to form a ring through the directivity, and the broadcast packet flooding is avoided. Secondly, forwarding different streams through different links in a shunting manner to realize multipath concurrence, so that the tree diagram shown in fig. 8 can be obtained after forwarding paths of different streams are converged.
In the above embodiment, the slave router may forward the message to the master router, so that the master router may send the message to the server after receiving the message, and the server feeds back the corresponding message to the master router, and the master router forwards the message fed back by the server to the slave router according to the path of the received message. In the above embodiment, the slave router identifies whether the message is a game message, and selects the link with the lowest delay to send to the master router when the message is a game message. Correspondingly, when the master router feeds back the message to the slave router, the message is forwarded according to the link with the lowest time delay, so that the data transmission can be faster.
Based on the above embodiment, the present application further provides a message forwarding method. Exemplarily, fig. 9 is a flowchart of a message forwarding method provided in the embodiment of the present application. As shown in fig. 9, the method may include the steps of:
s901, receiving a message sent by user equipment from a router.
S902, judging whether the link included in the bonding port of the slave router is a link or not. If only one link of the bonding port of the slave router is available, the message is forwarded according to the unique link. If the link of the bonding port of the slave router includes a plurality of links, S903 is continuously performed.
S903, judging whether the IP FDB table is full from the router. And if the IP FDB table is full, forwarding the message to equipment corresponding to the destination MAC in the message according to the link with the largest bandwidth. If the IP FDB table is not full, execution continues with S904.
And S904, judging whether the message can extract quintuple information from the router. And if the message can not extract the quintuple information, forwarding the message to the link with the largest bandwidth. If the message can extract the quintuple information, S905 is continued.
S905, the slave router judges whether the quintuple information can be inquired in the IP FDB table. If the router can inquire the quintuple information in the IP FDB table, the message is forwarded according to the stored link. If the five-tuple information is not queried in the IP FDB table from the router, the process proceeds to S906.
S906, the slave router judges whether the destination MAC of the message is the MAC of the master router. And if the destination MAC of the message is not the MAC of the main router, forwarding the message according to the link with the largest bandwidth. If the destination MAC of the packet is the MAC of the master router, S907 continues to be performed.
And S907, the slave router distributes the message to the link included by the bonding port and forwards the message to the master router.
S908, the main router judges whether the message is a game message. If the message is a game message, forwarding a feedback message to the slave router according to the link with the lowest time delay; if the message is not a game message, the feedback message is forwarded to the slave router according to the forwarding path of the received message.
It should be noted that the difference between the embodiment shown in fig. 9 and the embodiment shown in fig. 4 is that the slave router in the embodiment shown in fig. 4 determines whether the message is a game message, whereas the master router in the embodiment shown in fig. 9 determines whether the message is a game message. In contrast, the method in the embodiment shown in fig. 9 is a forwarding path of downlink data, that is, in the forwarding process of uplink data, the game packet may not be forwarded to the main router through the link with the lowest delay, but in the uplink and downlink directions in the embodiment shown in fig. 4, the forwarding path of the game packet is forwarded through the link with the lowest delay.
It should be understood that the specific implementation process of S901 to S906 and S907 in the embodiment shown in fig. 9 may refer to the detailed description of S401 to S406 and S408 in the embodiment shown in fig. 4, and the specific implementation process of S908 may refer to the detailed description of S407 in the embodiment shown in fig. 4, which is different only in execution subject, and is not repeated herein for brevity.
In the scheme of the embodiment of the application, a whole house 300M can be realized through multi-path bandwidth superposition (ETH + PLC +5G + 2.4G) among routers. Moreover, by identifying the service and measuring the link, the delay sensitive service can be always forwarded according to the low-delay link, for example, the low delay and zero jam of the game service can be ensured.
Further, in the embodiment of the present application, since forwarding of a packet is performed between router devices in a networking scenario, when the packet is a broadcast packet, there may be a case that the same router device receives multiple identical broadcast packets. Therefore, in order to solve the problem of the duplicate broadcast packets, a flag may be added to the broadcast packet when the router receives the broadcast packet, so that when the router receives the broadcast packet again, any one of the broadcast packets may be discarded, thereby ensuring that the broadcast packet received by the router does not have the duplicate broadcast packet.
All or part of the above embodiments provided in the present application may be freely and arbitrarily combined with each other. The combined technical solution is also within the scope of the present application.
In order to implement the functions in the method provided by the embodiments of the present application, the network device may include a hardware structure and/or a software module, and implement the functions in the form of a hardware structure, a software module, or a hardware structure and a software module. Whether any of the above-described functions is implemented as a hardware structure, a software module, or a hardware structure plus a software module depends upon the particular application and design constraints imposed on the technical solution.
Based on the foregoing embodiments, an embodiment of the present application further provides a message forwarding apparatus, which may be a router device in the foregoing embodiments, for example, may be a first network device or a second network device. The device is used for realizing the method of the embodiment shown in fig. 4, 5 and 9. Referring to fig. 10, the apparatus 1000 includes: a transceiver 1001, a processor 1002, and a memory 1003. The transceiver 1001, the processor 1002, and the memory 1003 are connected to each other.
Optionally, the transceiver 1001, the processor 1002, and the memory 1003 are connected to each other by a bus 1004. The bus 1004 may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown in FIG. 10, but that does not indicate only one bus or one type of bus.
The memory 1003 is used for storing program instructions, data, and the like. In particular, the program instructions may include program code comprising computer operational instructions. The memory 1003 may include Random Access Memory (RAM) and may further include non-volatile memory (non-volatile memory), such as at least one disk memory. The processor 1002 executes the program instructions and data stored in the memory 1003 to implement the functions described above, thereby implementing the methods provided by the above embodiments.
In the embodiments of the present application, the processor 1001 may be a general-purpose processor, a digital signal processor, an application specific integrated circuit, a field programmable gate array or other programmable logic device, a discrete gate or transistor logic device, or a discrete hardware component, and may implement or execute the methods, steps, and logic blocks disclosed in the embodiments of the present application. A general purpose processor may be a microprocessor or any conventional processor or the like. The steps of a method disclosed in connection with the embodiments of the present application may be directly implemented by a hardware processor, or may be implemented by a combination of hardware and software modules in a processor. Software modules may be located in the memory 1002, and the processor 1001 reads the program instructions in the memory 1002 and performs the steps of any one of the above-described embodiment methods in conjunction with the hardware thereof.
In this embodiment, the memory 1002 may be a non-volatile memory, such as a Hard Disk Drive (HDD) or a solid-state drive (SSD), and may also be a volatile memory (RAM). The memory can also be, but is not limited to, any other medium that can be used to carry or store desired program code in the form of instructions or data structures and that can be accessed by a computer. The memory in the embodiments of the present application may also be a circuit or any other device capable of implementing a storage function for storing instructions and/or data.
It is clear to those skilled in the art that, for convenience and brevity of description, the specific working processes of the above-described apparatuses and units may refer to the corresponding processes in the foregoing method embodiments, and are not described herein again.
Based on the above embodiments, the present application also provides a computer storage medium, in which a computer program is stored, and when the computer program is executed by a computer, the computer causes the computer to execute the method provided by the above embodiments.
Also provided in an embodiment of the present application is a computer program product including instructions that, when executed on a computer, cause the computer to perform the method provided in the above embodiment.
Embodiments of the present application are described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by instructions. These instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.

Claims (14)

1. A message forwarding method is characterized in that the method comprises the following steps:
a first network device receives a first message sent by a user device, wherein the first message comprises a destination Media Access Control (MAC) address;
if the first network device determines that a destination MAC address included in the first packet is an MAC address of a second network device, allocating at least one flow corresponding to the first packet to at least two links included in a first aggregation port, where the first network device is a slave device of the second network device, and the first aggregation port is obtained by aggregating at least two ports of at least two links that can reach the second network device on the first network device;
and the first network equipment forwards at least one stream corresponding to the first message to the second network equipment according to the distributed link.
2. The method of claim 1, wherein before the first network device determines that the destination MAC address included in the first packet is the MAC address of the second network device, the method further comprises:
the first network equipment determines that the first message comprises a plurality of quintuple information.
3. The method as claimed in claim 2, wherein the allocating, by the first network device, at least one flow corresponding to the first packet to the at least two links includes:
and the first network equipment distributes at least one flow corresponding to the first message on the at least two links according to the five-tuple information and the residual bandwidths of the at least two links.
4. The method of any of claims 1-3, wherein the first network device allocates at least one flow corresponding to the first packet on the at least two links before, the method further comprising:
the first network device determines that at least one flow record corresponding to the first packet does not exist in a first flow table, where the first flow table includes record information of a flow forwarded by the first network device, and the record information includes five-tuple information, a receiving port of the flow, and a forwarding port of the flow.
5. The method of claim 4, wherein the method further comprises:
and if the first network device determines that the first flow table has at least one flow record corresponding to the first message, forwarding the at least one flow corresponding to the first message according to a forwarding port of the flow recorded in the first flow table.
6. The method of any of claims 1-5, wherein prior to the first network device forwarding the at least one flow to the second network device according to the assigned link, the method further comprises:
and the first network equipment determines that the first message is a non-game message.
7. The method of claim 6, wherein the method further comprises:
if the first network device determines that the first message is a game message, a first link is selected to forward at least one stream corresponding to the first message to the second network device, where the first link is a link with the lowest time delay in at least two links included in the first aggregation port.
8. The method of any one of claims 1-7, further comprising:
the first network device receives a second message sent by the second network device through a first link, where the first link is a link with the lowest time delay selected by the second network device from at least two links included in the first aggregation port when the first message is determined to be a game message, and the second message is sent to the second network device by a server.
9. The method of any one of claims 1-5, further comprising:
and the first network equipment receives a third message forwarded by the second network equipment through the distributed link, wherein the third message is sent to the second network equipment by the server.
10. A message forwarding method is characterized in that the method comprises the following steps:
the second network equipment receives a first message sent by the first network equipment according to the distributed link;
if the second network device determines that the first message is a game message, sending a second message to the first network device through a first link, wherein the first link is a link with the lowest time delay selected by the second network device from at least two links included in the first aggregation port, and the second message is sent to the second network device by a server;
and if the second network equipment determines that the first message is a non-game message, sending a third message to the first network equipment through the distributed link, wherein the third message is sent to the second network equipment by a server.
11. A first network device, wherein the first network device comprises one or more processors; one or more memories and one or more computer programs;
wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs comprising instructions that, when executed by the one or more processors, cause the first network device to perform the method of any of claims 1-9.
12. A second network device, wherein the second network device comprises one or more processors; one or more memories and one or more computer programs;
wherein the one or more computer programs are stored in the one or more memories, the one or more computer programs comprising instructions that, when executed by the one or more processors, cause the second network device to perform the method of claim 10.
13. A computer-readable storage medium having instructions stored therein, which when run on a first network device, cause the first network device to perform the method of any one of claims 1 to 9.
14. A computer readable storage medium having instructions stored therein, which when run on a second network device, cause the second network device to perform the method of claim 10.
CN202111143922.4A 2021-09-28 2021-09-28 Message forwarding method and device Pending CN115883448A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111143922.4A CN115883448A (en) 2021-09-28 2021-09-28 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111143922.4A CN115883448A (en) 2021-09-28 2021-09-28 Message forwarding method and device

Publications (1)

Publication Number Publication Date
CN115883448A true CN115883448A (en) 2023-03-31

Family

ID=85763550

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111143922.4A Pending CN115883448A (en) 2021-09-28 2021-09-28 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN115883448A (en)

Similar Documents

Publication Publication Date Title
JP6463839B2 (en) System and method for flow-based addressing in a mobile environment
KR101097083B1 (en) Provision of qos treatment based upon multiple requests
KR101046893B1 (en) Offer of movement indication to resource requester
JP3761486B2 (en) Wireless LAN system, main device and program
US20150117234A1 (en) Monitoring Link Quality Between Network Devices
US8885504B2 (en) Method, apparatus and system for bandwidth aggregation of mobile internet access node
TW201717694A (en) Quality of service aware access point and device steering
JP2017017704A (en) METHOD, APPARATUS, AND SYSTEM FOR QoS PARAMETER CONFIGURATION IN WLAN
US11882028B2 (en) Packet sending method in distributed router networking, device, and system
US11109277B2 (en) Service configuration method and related product
US11502962B2 (en) Method, apparatus, and system for implementing data transmission
US9338073B2 (en) Enhanced dynamic multicast optimization
US11797472B2 (en) Data cache mechanism through dual sim phone
US20160119819A1 (en) Session aware access point load balancing
US9450880B2 (en) Load condition based transfer of processing responsibility
KR102182767B1 (en) Discovery of multi-hop capabilities and routing on a per link basis
JP4324054B2 (en) Service quality assurance method, service quality assurance device, service quality assurance program, and recording medium recording the program
CN115883448A (en) Message forwarding method and device
JP7379476B2 (en) Multiband communication in wireless mesh networks
US20230123162A1 (en) Dynamic distributed local breakout determination
US20230328623A1 (en) Service-Based Transmission Path Measurement For Multi-Link Enhanced Service Set Networks
CN114257602B (en) Method, device and storage medium for triggering terminal to execute point-to-point service
CN115695895B (en) Method, device, equipment and storage medium for improving data transmission rate
US11570080B1 (en) Multiple state control interfaces between a control plane and a user plane in a disaggregated broadband network gateway architecture
US10165598B2 (en) Wireless medium clearing

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination