CN116055396A - Data forwarding method, device, routing equipment and storage medium - Google Patents

Data forwarding method, device, routing equipment and storage medium Download PDF

Info

Publication number
CN116055396A
CN116055396A CN202310122544.4A CN202310122544A CN116055396A CN 116055396 A CN116055396 A CN 116055396A CN 202310122544 A CN202310122544 A CN 202310122544A CN 116055396 A CN116055396 A CN 116055396A
Authority
CN
China
Prior art keywords
forwarding
priority
mac address
terminal
routing device
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
CN202310122544.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.)
TP Link Technologies Co Ltd
Original Assignee
TP Link 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 TP Link Technologies Co Ltd filed Critical TP Link Technologies Co Ltd
Priority to CN202310122544.4A priority Critical patent/CN116055396A/en
Publication of CN116055396A publication Critical patent/CN116055396A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/50Queue scheduling
    • H04L47/62Queue scheduling characterised by scheduling criteria
    • H04L47/625Queue scheduling characterised by scheduling criteria for service slots or service orders
    • H04L47/6275Queue scheduling characterised by scheduling criteria for service slots or service orders based on priority
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks
    • Y02D30/70Reducing energy consumption in communication networks in wireless communication networks

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Mobile Radio Communication Systems (AREA)

Abstract

The application is applicable to the technical field of networks, and provides a data forwarding method, a device, routing equipment and a storage medium, wherein the method comprises the following steps: receiving a target data packet to be forwarded; determining the forwarding priority of the target data packet according to a first priority forwarding list; forwarding the target data packet based on the forwarding priority. By adopting the method, the forwarding priority corresponding to the terminal accessed to the first routing equipment can be recorded in the first priority forwarding list, and the subsequent first routing equipment can forward the data according to the forwarding priority after receiving the target data packet of the terminal, so that the rationality of network resource utilization can be improved, and the forwarding time of the target data packet with higher real-time requirement is reduced.

Description

Data forwarding method, device, routing equipment and storage medium
Technical Field
The application belongs to the technical field of networks, and particularly relates to a data forwarding method, a data forwarding device, routing equipment and a storage medium.
Background
With the continuous development of network communication technology, more and more types of information can be forwarded through a network, and the forwarding pressure of network equipment is increased. How to effectively and reasonably allocate network resources of network equipment to forward data becomes a problem to be solved urgently.
In the existing network communication technology, the main bearing data forwarding function in the network is the routing equipment, and each data is sequentially forwarded according to the sequence of the data sent by the terminal or the data forwarded by the network reaching the routing equipment. However, the real-time requirements of different types of data are different, if each data is forwarded according to the time sequence of arrival at the routing device, the data with low real-time requirements may be forwarded before the data with high real-time requirements, so that unnecessary time delay is increased, the rationality of network resource utilization is reduced, and the use experience of users is greatly affected.
Disclosure of Invention
The embodiment of the application provides a data forwarding method, a device, routing equipment and a storage medium, which can solve the problems that the conventional data forwarding method forwards various data according to the time sequence of arrival at the routing equipment, and the data with low real-time requirement is easy to forward before the data with high real-time requirement, so that unnecessary time delay is increased, the rationality of network resource utilization is reduced, and the use experience of a user is greatly influenced.
In a first aspect, an embodiment of the present application provides a method for forwarding data, which is applied to a first routing device, and includes:
Receiving a target data packet to be forwarded;
determining the forwarding priority of the target data packet according to a first priority forwarding list, wherein the first priority forwarding list comprises the MAC address of a terminal and the forwarding priority corresponding to the MAC address, and the forwarding priority corresponding to the MAC address of the terminal is determined according to the wired port or the wireless frequency band of the terminal accessed to the first routing device;
forwarding the target data packet based on the forwarding priority.
In a possible implementation manner of the first aspect, the determining, according to a first priority forwarding list, a forwarding priority of the target data packet includes:
and inquiring the forwarding priority corresponding to the source MAC address and/or the destination MAC address in a first priority forwarding list according to the source MAC address and/or the destination MAC address of the target data packet.
In a possible implementation manner of the first aspect, the determining, according to a first priority forwarding list, a forwarding priority of the target data packet includes:
inquiring a first priority corresponding to the source MAC address in a first priority forwarding list according to the source MAC address of the target data packet;
inquiring a second priority corresponding to the destination MAC address in a first priority forwarding list according to the destination MAC address of the target data packet;
And taking the priority with high level in the first priority and the second priority as the forwarding priority of the target data packet.
In a possible implementation manner of the first aspect, before the determining, according to the first priority forwarding list, a forwarding priority of the target data packet, the method further includes:
receiving configuration operation of a user, wherein the configuration operation is used for setting forwarding priority of a wired port and/or forwarding priority of a wireless frequency band of the first routing device;
determining a forwarding priority corresponding to the MAC address of the terminal according to the wired port or the wireless frequency band of the terminal accessed to the first routing equipment;
and creating the first priority forwarding list according to the MAC address of the terminal and the forwarding priority corresponding to the MAC address.
In a possible implementation manner of the first aspect, after the creating the first priority forwarding list according to the MAC address of the terminal and the forwarding priority corresponding to the MAC address, the method further includes:
and transmitting an entry corresponding to the terminal in the first priority forwarding list to at least one second routing device in the local area network, so that the second routing device adds the MAC address of the terminal and the forwarding priority corresponding to the MAC address into a second priority forwarding list of the second routing device.
In a possible implementation manner of the first aspect, after the creating the first priority forwarding list according to the MAC address of the terminal and the forwarding priority corresponding to the MAC address, the method further includes:
if any terminal is detected to be disconnected with the first routing equipment, deleting the MAC address of any terminal and the forwarding priority corresponding to the MAC address from the first priority forwarding list;
generating a removal instruction about any terminal, and sending the removal instruction to the second routing equipment; the removing instruction is configured to notify the second routing device to delete the MAC address of the any terminal and the forwarding priority corresponding to the MAC address from the second priority forwarding list.
In a possible implementation manner of the first aspect, the method further includes:
receiving a plurality of items in a second priority forwarding list sent by second routing equipment in the local area network;
and respectively adding the MAC addresses recorded by the entries and the forwarding priorities corresponding to the MAC addresses into the first priority forwarding list.
In a second aspect, an embodiment of the present application provides an apparatus for forwarding data, including:
A target data packet receiving unit, configured to receive a target data packet to be forwarded;
a forwarding priority determining unit, configured to determine a forwarding priority of the target data packet according to a first priority forwarding list, where the first priority forwarding list includes a MAC address of a terminal and a forwarding priority corresponding to the MAC address, and the forwarding priority corresponding to the MAC address of the terminal is determined according to a wired port or a radio frequency band of the terminal to which the terminal is connected to the first routing device;
and the target data packet forwarding unit is used for forwarding the target data packet based on the forwarding priority.
In a third aspect, an embodiment of the present application provides a routing device, including a memory, a processor, and a computer program stored in the memory and executable on the processor, the processor implementing the method according to any one of the first aspects when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium storing a computer program which, when executed by a processor, implements a method as in any one of the first aspects above.
In a fifth aspect, embodiments of the present application provide a computer program product, which, when run on a server, causes the server to perform the method of any one of the first aspects above.
Compared with the prior art, the embodiment of the application has the beneficial effects that: the first priority forwarding list records the MAC addresses of all terminals accessed to the first routing equipment and the forwarding priorities corresponding to the MAC addresses, the forwarding priorities corresponding to the MAC addresses are determined according to the forwarding priorities corresponding to the wired ports and/or the wireless frequency bands used when the corresponding terminals are accessed to the first routing equipment, and when a target data packet needing to be forwarded is received, the source MAC and/or the destination MAC of the target data packet can be identified, so that the forwarding priorities corresponding to the target data packet are determined through the first priority forwarding list, and then the target data packet is forwarded according to the forwarding priorities, and the purpose of dynamically adjusting the forwarding priorities of the target data packet is achieved. Compared with the existing data forwarding technology, the routing device in the embodiment of the application does not determine the forwarding priority of the data packet according to the arrival sequence of the data packet, but determines the MAC address of the terminal corresponding to the target data packet, and inquires the forwarding priority of the MAC address in the first priority forwarding list and uses the forwarding priority as the forwarding priority of the target data packet, so that for the target data packet with higher real-time requirement, the terminal can access the first routing device by using a wired port or a wireless frequency band with higher forwarding priority, and the subsequent first routing device can forward preferentially after receiving the target data packet corresponding to the wired port or the wireless frequency band, thereby improving the rationality of network resource utilization and reducing the forwarding time of the target data packet with higher real-time requirement.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present application, the following description will briefly introduce the drawings that are needed in the embodiments or the description of the prior art, it is obvious that the drawings in the following description are only some embodiments of the present application, and that other drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic diagram of a connection between a routing device and a user terminal according to an embodiment of the present application;
fig. 2 is a schematic implementation diagram of a method for forwarding data according to an embodiment of the present application;
FIG. 3 is a schematic diagram of forwarding priority setting provided in an embodiment of the present application;
fig. 4 is a flowchart of a specific implementation of a method for forwarding data provided in the second embodiment of the present application before S202;
fig. 5 is a schematic diagram of forwarding priority setting provided in an embodiment of the present application;
fig. 6 is a schematic diagram of forwarding priority setting provided in another embodiment of the present application;
fig. 7 is a flowchart of a specific implementation of a method for forwarding data in S202 according to a third embodiment of the present application;
fig. 8 is a schematic diagram illustrating determination of forwarding priority of a target packet according to an embodiment of the present application;
Fig. 9 is a flowchart of a specific implementation of a method for forwarding data according to a fourth embodiment of the present application;
fig. 10 is a schematic diagram of forwarding priority setting provided in another embodiment of the present application;
fig. 11 is a schematic structural diagram of a data forwarding device according to an embodiment of the present application;
fig. 12 is a schematic structural diagram of a routing device according to an embodiment of the present application.
Detailed Description
In the following description, for purposes of explanation and not limitation, specific details are set forth, such as particular system configurations, techniques, etc. in order to provide a thorough understanding of the embodiments of the present application. It will be apparent, however, to one skilled in the art that the present application may be practiced in other embodiments that depart from these specific details. In other instances, detailed descriptions of well-known systems, devices, circuits, and methods are omitted so as not to obscure the description of the present application with unnecessary detail.
It should be understood that the terms "comprises" and/or "comprising," when used in this specification and the appended claims, specify the presence of stated features, integers, steps, operations, elements, and/or components, but do not preclude the presence or addition of one or more other features, integers, steps, operations, elements, components, and/or groups thereof.
In addition, in the description of the present application and the appended claims, the terms "first," "second," "third," and the like are used merely to distinguish between descriptions and are not to be construed as indicating or implying relative importance.
The method for forwarding data provided by the embodiment of the application can be applied to a routing device, the routing device can comprise one or more wired ports, a user terminal can access the routing device through the wired ports, the routing device can also transmit one or more wireless networks with different service set identifiers (Service Set Identifier, SSID), the routing device can transmit the wireless networks with the same SSID through one or more wireless frequency bands, and the user terminal can access the wireless networks through a wireless communication module to establish wireless communication connection with the routing device. Wherein, the above-mentioned user terminal includes but is not limited to: smartphones, smartwatches, tablet computers, notebook computers, ultra-mobile personal computer (UMPC), netbooks, etc. can require electronic devices that implement data forwarding. The embodiment of the application does not limit the specific type of the electronic device.
Fig. 1 is a schematic diagram illustrating connection between a routing device and a user terminal according to an embodiment of the present application. Referring to fig. 1 (a), the lan includes a routing device, where the routing device may establish a communication connection with one or more user terminals, where the communication connection includes a wired communication connection and a wireless communication connection, and then receive data packets to be forwarded sent by each user terminal, and similarly, the routing device may also be connected to the internet and receive data packets sent by the internet, so that the routing device may identify forwarding priorities of the data packets sent by the user terminal and the data packets received from the internet according to the data forwarding method provided by the embodiment of the present application, and forward each data packet based on the forwarding priorities.
Referring to fig. 1 (b), the lan includes at least two routing devices, which are a first routing device and a second routing device, respectively, where the first routing device and the second routing device may each establish a communication connection with a plurality of user terminals, and the two routing devices may also be connected to the internet. Unlike the embodiment shown in fig. 1 (a), the first routing device and the second routing device may be further in communication connection with each other, and data interaction may be performed between the two routing devices, where both the two routing devices may set forwarding priority of the received data packet by using the method for forwarding data provided in the embodiment of the present application, and forward the data packet based on the forwarding priority. The specific networking manner may be set according to actual situations, and will not be described herein.
Referring to fig. 2, fig. 2 shows an implementation schematic diagram of a method for forwarding data, which is applied to a first routing device and includes the following steps:
in S201, a target packet to be forwarded is received.
In this embodiment, the first routing device may establish a communication connection with the terminal, and receive the target data packet related to the terminal. The target data packet may be divided into two different types of data packets according to different forwarding directions, which are a first data packet sent by the terminal to the first routing device and a second data packet forwarded by the first routing device to the terminal.
In some application scenarios, when the terminal communicates with a server in the internet, the terminal may send the first data packet to the first routing device, and the first routing device may determine the forwarding priority corresponding to the first routing device according to the embodiment of the present application, and perform the operation of the subsequent steps; when the server receives the request from the terminal and replies the message, the network address corresponding to the reply message is the gateway address corresponding to the first routing device because the terminal accesses the internet through the first routing device, in this case, after the first routing device receives the reply message from the server, the destination MAC of the message is modified into the MAC of the terminal device through route searching, and at this time, the first routing device can determine the forwarding priority of the message as well and execute the operation of the subsequent steps.
In S202, the forwarding priority of the target data packet is determined according to a first priority forwarding list, where the first priority forwarding list includes a MAC address of a terminal and a forwarding priority corresponding to the MAC address, and the forwarding priority corresponding to the MAC address of the terminal is determined according to a wired port or a radio frequency band of the terminal accessed to the first routing device.
In this embodiment, the first routing device needs to determine the forwarding priority corresponding to the target data packet after receiving the target data packet, where the forwarding priority is determined according to a preset first priority forwarding list, so that the first routing device may extract the first priority forwarding list from the local storage unit. The first priority forwarding list records the MAC address of the access terminal and the forwarding priority corresponding to the MAC address. The forwarding priority of the terminal MAC address is determined according to the wired port or the radio frequency band of the terminal accessing the first routing device. The first routing device may configure forwarding priorities for specific wired ports and radio frequency bands, and forwarding priorities corresponding to other wired ports or radio frequency bands that are not configured may be set as default values. Of course, the administrator may also set forwarding priorities for all the wired ports and the radio bands in the first routing device. The first routing device may determine a destination MAC address and/or a source MAC address of the destination packet, and then use a forwarding priority corresponding to the destination MAC address and/or the source MAC address as a forwarding priority of the destination packet.
In one possible implementation, the first routing device may be provided with at least two forwarding priorities, a high forwarding priority and a low forwarding priority, respectively. The first routing device can forward the data packets with high forwarding priority preferentially, and forward the data packets with low forwarding priority after forwarding all the data packets with high forwarding priority.
Illustratively, fig. 3 shows a schematic diagram of forwarding priority setting provided in an embodiment of the present application. Referring to fig. 3, the first routing device includes two wired ports, namely, a port 1 and a port 2, and the first routing device may also transmit two wireless networks with different SSID, namely, SSID1 and SSID2, at the same time, where the wireless networks of the two SSID operate in different wireless frequency bands. The wireless frequency band corresponding to the port 1 and the SSID1 is configured to have priority forwarding authority by a user, namely, the corresponding forwarding priority is high forwarding priority, and the port 2 and the SSID2 are not configured, then the default forwarding priority is low forwarding priority, so when the first priority forwarding list is generated, the first routing device obtains the MAC addresses of the terminal accessed by the port 1 and the SSID1, takes the forwarding priority corresponding to the port 1 and the SSID1 as the forwarding priority of the MAC address of the access terminal, and generates the first priority forwarding list; optionally, for the wired port and the wireless band where the forwarding priority is not set, the first routing device may also obtain the MAC address of the terminal to which the first routing device is connected, and set the forwarding priority corresponding to the MAC address of the terminal to a default value, for example, to a low forwarding priority. At this time, if the wired port to which the terminal is connected is port 1, the forwarding priority of the MAC address of the terminal may be set to a high forwarding priority, and if the wired port to which the terminal is connected is port 2, the forwarding priority of the MAC address of the terminal may be set to a low forwarding priority, and so on.
Optionally, the first priority forwarding list may not record the MAC addresses of the wired ports and the terminals accessed by the radio frequency bands, where the forwarding priorities are not set, and the forwarding priorities corresponding to the MAC addresses. Therefore, if the first routing device detects that the source MAC address and the destination MAC address of a certain target packet are not recorded in the first priority forwarding list, the forwarding priority of the target packet is set to a default value, for example, to a low forwarding priority.
In one possible implementation, the first routing device may divide two or more forwarding priorities, where the smaller the value of the forwarding priority, the higher the corresponding forwarding priority. Illustratively, table 1 shows a schematic diagram of a first priority forwarding list provided in an embodiment of the present application. Referring to table 1, the first routing device includes three wired ports, port 1, port 2, and port 3. In this case, the first routing device may record forwarding priorities corresponding to all wired ports and radio frequency bands in the first priority forwarding list, and if the terminal accesses the first routing device through the wired ports or the radio frequency bands, the first routing device may record the MAC address of the terminal, and use the forwarding priority corresponding to the wired ports or the radio frequency bands used when the terminal accesses the first routing device as the forwarding priority corresponding to the MAC address of the terminal. After receiving the target data packet, the first routing device determines a destination MAC address and/or a source MAC address of the target data packet, then inquires a forwarding priority corresponding to the MAC address in the first priority forwarding list, and takes the forwarding priority corresponding to the MAC address as the forwarding priority of the target data packet.
Sequence number Attribute information Forwarding priority
1 MAC 1 2
2 MAC 2 1
3 MAC 3 3
TABLE 1
Compared with the prior art, in the embodiment of the application, the first routing device only needs to determine the destination MAC address and/or the source MAC address of the target data packet, and can determine the corresponding forwarding priority of the target data packet by querying the first priority forwarding list and using the forwarding priority corresponding to the MAC address as the forwarding priority corresponding to the target data packet, without adjusting the data format of the data packet, i.e., the data forwarding method provided in the embodiment of the application can support network use constructed in any protocol and data encapsulation format. In some prior art, in order to distinguish forwarding priorities corresponding to different data packets, an adjustment process is often required to be performed on a protocol or a data format used in a local area network, for example, based on a VLAN in 802.1q or based on a private protocol, a new packet header is added to a header or a tail of a data packet, or a priority label corresponding to a field identifier of a Type of Service (TOS) of an IP packet header is used. The above manner needs to limit the network protocol or the data packet format, if the above setting manner is not adopted or not supported in a certain network, the data packet can not be forwarded according to the priority based on the above manner, thereby greatly reducing the application range.
Therefore, in order to solve the above-mentioned problems in the prior art, in the embodiment of the present application, the destination MAC address and/or the source MAC address of the target packet are determined, that is, the forwarding priority corresponding to the MAC address is used as the forwarding priority corresponding to the target packet by querying the first priority forwarding list, so that the priority forwarding policy can be applied to all networks and no adjustment is required for the packet format, thereby improving the application range of the method for forwarding data provided in the embodiment of the present application.
In S203, forwarding the target data packet based on the forwarding priority.
In this embodiment, after determining the forwarding priority of the target data packet, the first routing device determines the forwarding opportunity corresponding to the forwarding priority of the target data packet according to the forwarding priority of the target data packet, where the forwarding rule of the first routing device is: and forwarding each target data packet in turn according to the order of forwarding priority from high to low. Therefore, if the forwarding queue in the first routing device includes other data packets with forwarding priority higher than that of the target data packet, forwarding all the data packets with forwarding priority higher than that of the target data packet first, and then forwarding the target data packet; otherwise, if no other data packet with the forwarding priority higher than that of the target data packet is forwarded, the target data packet is forwarded preferentially.
In one possible implementation, if there are multiple packets with the same forwarding priority in the forwarding queue (which may include the target packet described above), the first routing device may forward each packet with the same forwarding priority in turn according to the receiving time of the packet.
As can be seen from the foregoing, in the data forwarding method provided in the embodiment of the present application, a corresponding first priority forwarding list is set in a first routing device, where the first priority forwarding list records the MAC addresses of all terminals that access the first routing device, and forwarding priorities corresponding to the MAC addresses, where the forwarding priorities corresponding to the MAC addresses are determined according to forwarding priorities corresponding to wired ports and/or radio bands used when the corresponding terminals access the first routing device, and when a target data packet that needs to be forwarded is received, the source MAC and/or the destination MAC of the target data packet can be identified, so that the forwarding priority corresponding to the target data packet is determined by using the first priority forwarding list, and then the target data packet is forwarded according to the forwarding priority, thereby achieving the purpose of dynamically adjusting the forwarding priority of the target data packet. Compared with the existing data forwarding technology, the routing device in the embodiment of the application does not determine the forwarding priority of the data packet according to the arrival sequence of the data packet, but determines the destination MAC address and/or the source MAC address of the target data packet, and inquires the forwarding priority of the MAC address in the first priority forwarding list, and uses the forwarding priority as the forwarding priority of the target data packet, so that for the target data packet with higher real-time requirements, the terminal can access the first routing device by using a wired port or a wireless frequency band with higher forwarding priority, and the subsequent first routing device can forward preferentially after receiving the target data packet corresponding to the wired port or the wireless frequency band, thereby improving the rationality of network resource utilization and reducing the forwarding time length of the target data packet with higher real-time requirements.
And, because the above-mentioned forwarding priority is determined according to the destination MAC address and/or source MAC address of the target data packet, and the forwarding priority of the MAC address is determined according to the wired port or the wireless band of the terminal accessed to the first routing device, and is irrelevant to the service content of the target data packet, even if the service content in the target data packet is encrypted, the corresponding forwarding priority can be determined. Therefore, the determination of the forwarding priority in the embodiment of the present application does not depend on the analysis of the service content of the target data packet, and the forwarding priority of the data packet of the private protocol or the specific traffic (such as encrypting the data packet by the VPN service) can also be determined by the embodiment of the present application, so that the application range of the data forwarding method provided in the embodiment of the present application can be improved.
Fig. 4 shows a flowchart of a specific implementation of a method for forwarding data provided in the second embodiment of the present application before S202. Referring to fig. 4, with respect to the embodiment shown in fig. 2, before determining the forwarding priority of the target packet according to the first priority forwarding list, the method provided in this embodiment further includes: s401 to S403 are specifically described below:
In S401, a configuration operation of a user is received, where the configuration operation is used to set a forwarding priority of a wired port and/or a forwarding priority of a radio band of the first routing device.
In S402, a forwarding priority corresponding to the MAC address of the terminal is determined according to the wired port or the radio frequency band of the terminal accessed to the first routing device.
In S403, the first priority forwarding list is created according to the MAC address of the terminal and the forwarding priority corresponding to the MAC address.
In this embodiment, when the user needs to set the operation mode of the first routing device, the user may open a setting interface corresponding to the first routing device. The setting interface may include a corresponding priority forwarding mode start control. The user can adjust the on state of the priority forwarding mode by clicking the start control in the setting interface. If the first routing device receives an opening instruction of a corresponding priority forwarding mode initiated by a user, that is, when the priority forwarding mode is switched from an off state to an on state, a first priority forwarding list stored locally in the first routing device is created.
In one possible implementation manner, the priority forwarding mode may be turned on by default, in which case, when the first routing device receives a power-on instruction, the priority forwarding mode is automatically set to an on state, and a corresponding first priority forwarding list is created.
In this embodiment, after the first routing device opens the priority forwarding mode, a forwarding priority setting interface may be generated, where the setting interface includes a plurality of selectable options, and the selectable options include all wired ports included in the first routing device and a radio frequency band transmitted by the first routing device. The user may select a wired port or a wireless frequency band needing to be forwarded preferentially from the selectable options, and configure a corresponding forwarding priority for the selected wired port or wireless frequency band, where the first routing device determines the forwarding priority of the corresponding wired port or wireless frequency band according to the setting operation of the user.
For example, the first routing device includes two wired ports, namely, port 1 and port 2, and the number of wireless bands to be transmitted is two, and different wireless bands correspond to different SSID, for example, the wireless network in the 2.4G band is SSID1, and the wireless network in the 5G band is SSID2. In this case, the above-mentioned selectable items include four, namely, port 1, port 2, SSID1 and SSID2, and the user can select a wired port and a wireless band to be set from the above-mentioned four selectable items and configure a forwarding priority for the selected wired port or wireless band. For example, when the user selects the port 1 and SSID1 and configures forwarding priorities of the two items, the MAC addresses of the terminals accessing the port 1 and SSID1 are obtained, the priorities of the port 1 and SSID1 are used as the forwarding priorities of the MAC addresses of the access terminals, an entry corresponding to the MAC address is generated according to the MAC address and the forwarding priority corresponding to the MAC address, and the entry is added to the first priority forwarding list.
Optionally, after the priority forwarding mode is started, when the user does not need to prioritize forwarding of the data packet, the priority forwarding mode may be closed, and the first routing device may delete the first priority forwarding list in response to a closing instruction of the priority forwarding mode of the user.
Optionally, the user may modify the forwarding priority of the wired port or the radio band, and the first routing device may delete the first priority forwarding list in response to a modification operation of the forwarding priority by the user, and reconfigure the forwarding priority based on the modification operation, and reconfigure a new first priority forwarding list. Preferably, when the user modifies the forwarding priority of a certain wired port or radio frequency band, only the relevant entry of the modified port or radio frequency band in the first priority forwarding list may be adjusted, that is, only the forwarding priority of the MAC address of the terminal accessing the wired port to be modified, or the forwarding priority of the MAC address of the terminal accessing the radio frequency band to be modified is modified.
In the embodiment of the application, by starting the priority forwarding mode and setting the wired port or the wireless frequency band which needs to be forwarded preferentially, in the subsequent forwarding process, a terminal which needs to be forwarded preferentially can be accessed to the first routing equipment through the wireless network corresponding to the wired port or the wireless frequency band which is provided with the forwarding priority, and all data packets sent by the terminal are set to be the preset forwarding priority, so that the utilization efficiency of network resources can be improved.
In this embodiment, the first routing device may receive a setting operation of a user on the wired port and the wireless band, and determine forwarding priorities corresponding to the wired port and the wireless band. After the user is set, the first routing device identifies the access information of the terminal accessed to the first routing device, namely, determines which wired port or which wireless frequency band is accessed by the terminal accessed to the first routing device.
If the terminal accesses the first routing device through the wired port, the forwarding priority of the wired port used by the terminal accessing the first routing device is used as the forwarding priority corresponding to the MAC address of the terminal, and the first routing device records the MAC address of the terminal and the corresponding forwarding priority in the first priority forwarding list, so that in the subsequent forwarding process, if the source MAC address or the destination MAC address of the target packet is the same as any terminal MAC address in the first priority forwarding list, the first routing device can set the forwarding priority of the target packet according to the forwarding priority corresponding to the MAC address.
If the terminal accesses the first routing device through the radio frequency band, the forwarding priority of the radio frequency band of the radio network used by the terminal accessing the first routing device is used as the forwarding priority corresponding to the MAC address of the terminal, and the first routing device records the MAC address of the terminal and the corresponding forwarding priority in the first priority forwarding list, so that in the subsequent forwarding process, if the source MAC address or the destination MAC address of the target packet is the same as any terminal MAC address in the first priority forwarding list, the first routing device can set the forwarding priority of the target packet according to the forwarding priority corresponding to the MAC address.
Illustratively, fig. 5 shows a schematic diagram of forwarding priority setting provided in an embodiment of the present application. As shown in fig. 5, the user terminal a accesses the first routing device through the port 1, and the user terminal B accesses the first routing device through the port 2. The first routing device configures a forwarding priority corresponding to the port 1, for example, sets the forwarding priority to 1, but does not set the port 2, and the forwarding priority of the wired port that is not set defaults to 2. In this case, the user terminal a accesses the first routing device through the port 1, and the first routing device records the MAC address of the user terminal a, that is, the MAC a, and takes the forwarding priority of the port 1 as the forwarding priority of the MAC a, for example, the forwarding priority is 1. When the first routing device receives a data packet a, the MAC address carried by the data packet is MAC a, and then the forwarding priority of the MAC a is taken as the forwarding priority of the data packet a, that is, the forwarding priority is 1. The MAC address carried by the data packet includes a source MAC address and a destination MAC address, and the forwarding priority of the data packet may be determined according to the destination MAC address and/or the source MAC address. Correspondingly, the user terminal B accesses the first routing device through the port 2, and the first routing device sets the forwarding priority of the MAC address of the user terminal B to a default value, for example, to 2, because the forwarding priority corresponding to the port 2 is not set. When the first routing device receives the data packet B, the first routing device recognizes that the MAC address corresponding to the data packet B is the MAC B, so that the forwarding priority of the data packet B is set to a default value, that is, the forwarding priority is 2. Correspondingly, the identification manner when the first routing device is accessed through the wireless network can also refer to the above process, and the description is omitted here.
In the embodiment of the application, after the forwarding priorities corresponding to the wired port and the wireless frequency band are set, the forwarding priorities of the wired port and the wireless frequency band can be used as the forwarding priorities of the terminals accessed in a corresponding mode, so that the purpose of preferentially forwarding all data packets sent by one wired port or wireless frequency band can be achieved, service content does not need to be identified, and the applicability of forwarding priority setting can be improved.
Further, as another embodiment of the present application, after S401, it may further include:
in S404, an entry corresponding to the terminal in the first priority forwarding list is sent to at least one second routing device in the local area network, so that the second routing device adds the MAC address of the terminal and the forwarding priority corresponding to the MAC address to the second priority forwarding list of the second routing device.
In this embodiment, in order to facilitate that other routing devices in the local area network can preferentially forward the data packet with the source MAC address or the destination MAC address being the designated terminal MAC address, the first routing device may send an entry corresponding to the terminal MAC in the generated first priority forwarding list to other routing devices in the local area network, such as the second routing device, so that other routing devices can query the first priority forwarding list according to the source MAC address or the destination MAC address of the target data packet, obtain the forwarding priority corresponding to the designated MAC address, and set the forwarding priority of the target data packet.
Illustratively, fig. 6 shows a schematic diagram of forwarding priority setting provided in another embodiment of the present application. The user sets the forwarding priority of the port 1 and the forwarding priority of the radio frequency band corresponding to the SSID1, for example, the forwarding priority of the port 1 is 1, and the forwarding priority of the radio frequency band corresponding to the SSID1 is also 1, so when the user terminal a accesses the first routing device through the port 1, the first routing device sets the forwarding priority of the MAC address (i.e., MAC a) of the terminal a according to the forwarding priority of the wired port accessed by the terminal, and as described above, the forwarding priority of the port 1 is 1, and the forwarding priority of the MAC a is also 1, and generates a corresponding entry, and sends the entry to the second routing device.
In this embodiment of the present application, the first routing device may send, to other routing devices in the local area network, an entry of the forwarding priority recorded in the first priority forwarding list, where the forwarding priority of the terminal MAC address is recorded, so that forwarding priorities of the target data packet between the routing devices in the entire local area network may be consistent.
Further, as another embodiment of the present application, after S404, further includes: s405 to S406 are specifically described as follows:
In S405, if it is detected that any one of the terminals is disconnected from the first routing device, the MAC address of the any one of the terminals and the forwarding priority corresponding to the MAC address are deleted from the first priority forwarding list.
In S406, generating a removal instruction about the any terminal, and transmitting the removal instruction to the second routing device; the removing instruction is configured to notify the second routing device to delete the MAC address of the any terminal and the forwarding priority corresponding to the MAC address from the second priority forwarding list.
In this embodiment, when it is detected that a terminal disconnects from the communication with the first routing device, the first routing device deletes the MAC address of the terminal and the forwarding priority corresponding to the MAC address from the first priority forwarding list, so as to avoid a situation that the terminal accesses the first routing device again and the same MAC address corresponds to multiple forwarding priorities. In addition, because the terminal can adopt different wired ports or wireless frequency bands to access the first routing equipment in the subsequent use process, the forwarding priority of the MAC address corresponding to the terminal can be changed at the moment, so that in order to improve the timeliness of the forwarding priority of each MAC address in the first priority forwarding list, related deleting operation is carried out when the terminal is disconnected with the first routing equipment.
In this embodiment, since the first routing device sends the first priority forwarding list to the second routing device in the local area network, in order to keep the priority forwarding list synchronized in the local area network, the first routing device generates a removal instruction about the MAC address and sends the removal instruction to the second routing device in the local area network. The second routing device deletes the MAC address carried in the removal instruction and the forwarding priority corresponding to the MAC address from the second priority forwarding list locally stored in the second routing device.
In the embodiment of the application, when the terminal disconnects from the first routing device, the MAC address and the forwarding priority corresponding to the MAC address are deleted in the first priority forwarding list, and synchronous deletion is performed between other routing devices in the local area network, so that timeliness and synchronism of information in the priority forwarding list are improved.
Fig. 7 is a flowchart of a specific implementation of the method for forwarding data in S202 according to the third embodiment of the present application. Referring to fig. 7, with respect to the embodiment described in fig. 1, in a method for forwarding data provided in this embodiment, S202 includes: s701, specifically described in detail below:
in S701, according to the source MAC address and/or the destination MAC address of the destination packet, a forwarding priority corresponding to the source MAC address and/or the destination MAC address in the first priority forwarding list is queried.
In this embodiment, the MAC address corresponding to the terminal and the forwarding priority corresponding to the MAC address may be recorded in the priority forwarding list of the first routing device. Therefore, when the first routing device receives the target data packet, the first routing device needs to determine the corresponding forwarding priority according to the MAC address of the first routing device. The packet corresponding to the data packet is recorded with a destination MAC address and a source MAC address, that is, one data packet may correspond to two MAC addresses, namely, the source MAC address and the destination MAC address. The first routing device may determine the forwarding priority corresponding to the target data packet through the two MAC addresses.
In this embodiment, if the forwarding priority of the source MAC address of the target packet is recorded in the first priority forwarding list, but the forwarding priority of the destination MAC address is not recorded, the forwarding priority of the source MAC address is taken as the forwarding priority of the target packet.
If the first priority forwarding list records the forwarding priority of the destination MAC address of the target data packet, but does not record the forwarding priority of the source MAC address, the forwarding priority of the destination MAC address is used as the forwarding priority of the target data packet.
If the forwarding priorities of the source MAC address and the destination MAC address of the target data packet are not recorded in the first priority forwarding list, the forwarding priority of the target data packet is set to be a default value.
If the forwarding priority of the source MAC address and the destination MAC address of the target data packet is recorded in the first priority forwarding list, the forwarding priority with higher level is selected as the forwarding priority of the target data packet.
Fig. 8 is a schematic diagram illustrating determination of forwarding priority of a target packet according to an embodiment of the present application. As shown in fig. 8, the user terminal a accesses the first routing device through the port 1. Thus, the forwarding priority of MAC a is determined according to the forwarding priority of port 1, for example, if the forwarding priority of port 1 is 1, then the forwarding priority of MAC a is also 1. Similarly, if the forwarding priority of the port 2 is 2, the forwarding priority corresponding to the MAC B of the user terminal B is also 2.
At this time, the user terminal a sends a data packet A1 to the first routing device, and because the source MAC address of the data packet A1 is MAC a, the forwarding priority of the data packet A1 can be determined to be 1 by querying the first priority forwarding list; for the packet B1 sent by the user terminal B to the first routing device, as described above, it may be determined that its corresponding forwarding priority is 2. Correspondingly, when the first routing device receives the reply data packet A2 of the data packet A1, the destination MAC address of the reply data packet A2 is MAC a, so that the corresponding forwarding priority is also 1; when the first routing device receives the reply packet B2 of the packet B1, its forwarding priority is set to 2 because its destination MAC address is MAC B.
For example, the source MAC address in the data packet C is MAC a, and the destination MAC address is MAC B, that is, both the two MAC addresses of the data packet are recorded in the first priority forwarding list, the first routing device may query to obtain two forwarding priorities, and the first routing device may select the forwarding priority with a higher level as the forwarding priority of the data packet C. Since the forwarding priority of MAC a is higher than that of MAC B, the forwarding priority of the data packet C is determined according to the forwarding priority of MAC a, i.e., the forwarding priority is set to 1.
In one possible implementation manner, the first routing device determines the forwarding priority of the target data packet may be: the first ROUTING device adds a monitoring process in the kernel network protocol stack nf_br_pre_routing, and is configured to determine a forwarding priority corresponding to a source MAC of a received packet, for example, set a forwarding priority of the packet according to a forwarding priority corresponding to the source MAC address in the first priority forwarding list. The first ROUTING device may add a listening process in the kernel network protocol stack nf_br_post_routing, for determining a forwarding priority corresponding to a destination MAC of the received data packet, for example, setting the forwarding priority of the data packet according to a forwarding priority corresponding to the destination MAC address in the first priority forwarding list.
For a message sent to the internet, after route searching, the first routing device modifies the source MAC of the message from the MAC address of the terminal in the local area network to the MAC address of the gateway, and the destination MAC of the message becomes the MAC address of the next hop route. However, the listening process in nf_br_pre_routing is earlier than the MAC address translation, so that the forwarding priority of the corresponding packet can still be queried according to the source MAC address.
For a message received from the internet, the routing device modifies the destination MAC of the message from the gateway MAC address to the MAC address of the terminal in the local area network after route lookup, and the source MAC of the message becomes the MAC address of the gateway. However, the monitoring process in nf_br_post_routing is later than the MAC address conversion, so that the forwarding priority of the corresponding packet can still be queried according to the destination MAC address.
In one possible implementation manner, if the target data packet is forwarded between different terminals in the lan, that is, the target terminal and the source terminal of the target data packet are both connected to the routing device in the lan, the step S701 may specifically include two steps from S7011 to S7013, which is specifically described as follows:
In S7011, the first ROUTING device identifies a source MAC address through a listening process of nf_br_pre_routing, and queries, according to the source MAC address of the target packet, a first priority corresponding to the source MAC address in the first priority forwarding list.
In S7012, the first ROUTING device identifies a destination MAC through a monitoring process of nf_br_post_routing, and queries a second priority corresponding to the destination MAC address in the first priority forwarding list according to the destination MAC address of the destination packet; thus, the destination packet will correspond to two priorities.
In S7013, the first routing device uses the priority with the higher level of the first priority and the second priority as the forwarding priority of the target packet, that is, when there are two priorities, the higher priority is used as the forwarding priority of the target packet.
Fig. 9 shows a flowchart of a specific implementation of a method for forwarding data according to a fourth embodiment of the present application. Referring to fig. 9, with respect to the embodiments described in any of fig. 1 to 8, a method for forwarding data provided in this embodiment further includes: s901 to S902 are specifically described as follows:
in S901, entries in a second prioritized forwarding list sent by a second routing device in a local area network are received.
In S902, the MAC addresses recorded in the entries and the forwarding priorities corresponding to the MAC addresses are added to the first priority forwarding list.
In this embodiment, in order to synchronize with the priority forwarding list of the other routing device (i.e., the second routing device), the first routing device receives a plurality of entries in the second priority forwarding list sent by the second routing device, and adds the MAC address recorded by the entries and the forwarding priority corresponding to the MAC address into the first priority forwarding list, so as to realize synchronization of the forwarding priority in the local area network.
Fig. 10 is a schematic diagram illustrating forwarding priority setting according to another embodiment of the present application. Referring to fig. 10, the first routing device includes two wired ports and a wireless network transmitting two wireless bands different from each other, where the wired ports are a port A1 and a port A2, and the wireless networks are SSID A1 and SSID A2, respectively. The forwarding priority of the port A1 is 2, that is, the priority forwarding port. Correspondingly, the second routing device which is in the same local area network with the first routing device also comprises two wired ports and wireless networks with two different wireless frequency bands, wherein the wired ports are respectively a port B1 and a port B2, and the wireless networks are respectively an SSID B1 and an SSID B2. The forwarding priority of the port B2 is 2, that is, the priority forwarding port. The terminal a accesses the first routing device through the wired port A1, so that the forwarding priority corresponding to the MAC address of the terminal a (i.e. MAC a) is also 2, and the terminal B accesses the second routing device through the wired port B2, so that the forwarding priority corresponding to the MAC address of the terminal B (i.e. MAC B) is also 2, at this time, the first routing device sends the second routing device an entry of the MAC a in the first priority forwarding list recorded with the MAC a and the forwarding priority of the MAC a, and the second routing device adds the MAC a to the corresponding second priority forwarding list, and sets the forwarding priority of the MAC a in the second priority forwarding list to 2, see the second priority forwarding list in fig. 10.
Correspondingly, the second routing device sends the entry of the MAC B in the second priority forwarding list to the first routing device, the first routing device adds the forwarding priority recorded with the MAC B and the MAC B to the first priority forwarding list, and sets the forwarding priority of the MAC B in the first priority forwarding list to 2, see the first priority forwarding list in fig. 10.
In the embodiment of the application, the user terminal needing to perform priority forwarding can realize the synchronization of forwarding priorities in all routing devices in the local area network through the priority forwarding list corresponding to the synchronization in the local area network, so that the uniformity of the forwarding priorities of the local area network is improved.
Fig. 11 is a block diagram of a data forwarding device according to an embodiment of the present invention, where the data forwarding device includes units for executing steps implemented by the encryption device according to the corresponding embodiment of fig. 2. Please refer to fig. 2 and the related description of the embodiment corresponding to fig. 2. For convenience of explanation, only the portions related to the present embodiment are shown.
Referring to fig. 11, the apparatus for forwarding data includes:
a target data packet receiving unit 111, configured to receive a target data packet to be forwarded;
A forwarding priority determining unit 112, configured to determine a forwarding priority of the target data packet according to a first priority forwarding list, where the first priority forwarding list includes a MAC address of a terminal and a forwarding priority corresponding to the MAC address, and the forwarding priority corresponding to the MAC address of the terminal is determined according to a wired port or a wireless frequency band of the terminal to which the terminal is connected to the first routing device;
a target data packet forwarding unit 113, configured to forward the target data packet based on the forwarding priority.
Optionally, the forwarding priority determining unit 112 is specifically configured to query, according to a source MAC address and/or a destination MAC address of the target packet, a forwarding priority corresponding to the source MAC address and/or the destination MAC address in the first priority forwarding list.
Optionally, the forwarding priority determining unit 112 includes:
a first priority determining unit, configured to query, according to a source MAC address of the target packet, a first priority corresponding to the source MAC address in a first priority forwarding list;
a second priority determining unit, configured to query, according to a destination MAC address of the target packet, a second priority corresponding to the destination MAC address in the first priority forwarding list;
And the priority comparison unit is used for taking the priority with high level in the first priority and the second priority as the forwarding priority of the target data packet.
Optionally, the apparatus comprises:
and the user configuration unit is used for receiving configuration operation of a user, and the configuration operation is used for setting forwarding priority of the wired port and/or forwarding priority of the wireless frequency band of the first routing equipment.
A priority setting unit, configured to determine a forwarding priority corresponding to an MAC address of the terminal according to a wired port or a radio frequency band of the terminal to which the terminal is connected;
and the first priority forwarding list creation unit is used for creating the first priority forwarding list according to the MAC address of the terminal and the forwarding priority corresponding to the MAC address.
Optionally, the apparatus further comprises:
and the first priority list sending unit is used for sending the item corresponding to the terminal in the first priority forwarding list to at least one second routing device in the local area network, so that the second routing device adds the MAC address of the terminal and the forwarding priority corresponding to the MAC address into the second priority forwarding list of the second routing device.
Optionally, the apparatus further comprises:
a terminal disconnection unit, configured to delete, if it is detected that any terminal is disconnected from the first routing device, an MAC address of the any terminal and a forwarding priority corresponding to the MAC address from the first priority forwarding list;
a removal instruction sending unit, configured to generate a removal instruction about the any terminal, and send the removal instruction to the second routing device; the removing instruction is configured to notify the second routing device to delete the MAC address of the any terminal and the forwarding priority corresponding to the MAC address from the second priority forwarding list.
Optionally, the apparatus further comprises:
a second priority list sending unit, configured to receive a plurality of entries in a second priority forwarding list sent by a second routing device in the local area network;
and the priority synchronization unit is used for respectively adding the MAC addresses recorded by the entries and the forwarding priorities corresponding to the MAC addresses into the first priority forwarding list.
Therefore, the data forwarding device provided in the embodiment of the present invention may also set a corresponding first priority forwarding list in the first routing device, where the first priority forwarding list records the MAC addresses of the terminals connected to the first routing device and the forwarding priorities corresponding to the MAC addresses, where the forwarding priorities corresponding to the MAC addresses are determined according to the forwarding priorities corresponding to the wired ports and/or the radio frequency bands used when the corresponding terminals are connected to the first routing device, and when a target data packet to be forwarded is received, the source MAC and/or the destination MAC of the target data packet may be identified, so that the forwarding priorities corresponding to the target data packet are determined by the first priority forwarding list, and then the target data packet is forwarded according to the forwarding priorities, thereby achieving the purpose of dynamically adjusting the forwarding priorities of the target data packet. Compared with the existing data forwarding technology, the routing device in the embodiment of the application does not determine the forwarding priority of the data packet according to the arrival sequence of the data packet, but determines the MAC address of the terminal corresponding to the target data packet, and inquires the forwarding priority of the MAC address in the first priority forwarding list and uses the forwarding priority as the forwarding priority of the target data packet, so that for the target data packet with higher real-time requirement, the terminal can access the first routing device by using a wired port or a wireless frequency band with higher forwarding priority, and the subsequent first routing device can forward preferentially after receiving the target data packet corresponding to the wired port or the wireless frequency band, thereby improving the rationality of network resource utilization and reducing the forwarding time of the target data packet with higher real-time requirement.
It should be understood that, in the block diagram of the apparatus for forwarding data shown in fig. 11, each module is configured to perform each step in the embodiment corresponding to fig. 2 to 10, and each step in the embodiment corresponding to fig. 2 to 10 has been explained in detail in the foregoing embodiment, and specific reference is made to fig. 2 to 10 and related descriptions in the embodiment corresponding to fig. 2 to 10, which are not repeated herein.
Fig. 12 is a block diagram of a routing device according to another embodiment of the present application. As shown in fig. 12, the routing device 1200 of this embodiment includes: a processor 1210, a memory 1220 and a computer program 1230 stored in the memory 1220 and executable on the processor 1210, for example a program for a method of data forwarding. The steps in the embodiments of the method for forwarding data described above are implemented by the processor 1210 when executing the computer program 1230, e.g. S201 to S203 shown in fig. 2. Alternatively, the processor 1210 may perform the functions of the modules in the embodiment corresponding to fig. 8, for example, the functions of the units 111 to 113 shown in fig. 11, when the computer program 1230 is executed, and refer to the related description in the embodiment corresponding to fig. 11.
By way of example, the computer program 1230 may be partitioned into one or more modules, which are stored in the memory 1220 and executed by the processor 1210 to complete the present application. One or more of the modules may be a series of computer program instruction segments capable of performing particular functions to describe the execution of the computer program 1230 in the routing device 1200. For example, the computer program 1230 may be divided into individual unit modules, each module functioning specifically as described above.
Routing device 1200 may include, but is not limited to, processor 1210, memory 1220. It will be appreciated by those skilled in the art that fig. 12 is merely an example of a routing device 1200 and is not limiting of the routing device 1200, and may include more or fewer components than shown, or may combine certain components, or different components, e.g., the routing device may also include input-output devices, network access devices, buses, etc.
The processor 1210 may be a central processing unit, or may be other general purpose processors, digital signal processors, application specific integrated circuits, off-the-shelf programmable gate arrays or other programmable logic devices, discrete hardware components, or the like. A general purpose processor may be a microprocessor or any conventional processor or the like.
The memory 1220 may be an internal storage unit of the routing device 1200, such as a hard disk or a memory of the routing device 1200. The memory 1220 may also be an external storage device of the routing device 1200, such as a plug-in hard disk, a smart memory card, a flash memory card, etc. provided on the routing device 1200. Further, the memory 1220 may also include both internal storage units and external storage devices of the routing device 1200.
The above embodiments are only for illustrating the technical solution of the present application, and are not limiting thereof; although the present application has been described in detail with reference to the foregoing embodiments, it should be understood by those of ordinary skill in the art that: the technical scheme described in the foregoing embodiments can be modified or some technical features thereof can be replaced by equivalents; such modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present application, and are intended to be included in the scope of the present application.

Claims (10)

1. A method for forwarding data, applied to a first routing device, comprising:
receiving a target data packet to be forwarded;
determining the forwarding priority of the target data packet according to a first priority forwarding list, wherein the first priority forwarding list comprises the MAC address of a terminal and the forwarding priority corresponding to the MAC address, and the forwarding priority corresponding to the MAC address of the terminal is determined according to the wired port or the wireless frequency band of the terminal accessed to the first routing device;
forwarding the target data packet based on the forwarding priority.
2. The method of claim 1, wherein said determining the forwarding priority of the target packet based on the first prioritized forwarding list comprises:
And inquiring the forwarding priority corresponding to the source MAC address and/or the destination MAC address in a first priority forwarding list according to the source MAC address and/or the destination MAC address of the target data packet.
3. The method of claim 1, wherein said determining the forwarding priority of the target packet based on the first prioritized forwarding list comprises:
inquiring a first priority corresponding to the source MAC address in a first priority forwarding list according to the source MAC address of the target data packet;
inquiring a second priority corresponding to the destination MAC address in a first priority forwarding list according to the destination MAC address of the target data packet;
and taking the priority with high level in the first priority and the second priority as the forwarding priority of the target data packet.
4. The method of claim 1, further comprising, prior to said determining a forwarding priority for said target data packet based on a first priority forwarding list:
receiving configuration operation of a user, wherein the configuration operation is used for setting forwarding priority of a wired port and/or forwarding priority of a wireless frequency band of the first routing device;
determining a forwarding priority corresponding to the MAC address of the terminal according to the wired port or the wireless frequency band of the terminal accessed to the first routing equipment;
And creating the first priority forwarding list according to the MAC address of the terminal and the forwarding priority corresponding to the MAC address.
5. The method according to claim 4, further comprising, after the creating the first priority forwarding list according to the MAC address of the terminal and the forwarding priority corresponding to the MAC address:
and transmitting an entry corresponding to the terminal in the first priority forwarding list to at least one second routing device in the local area network, so that the second routing device adds the MAC address of the terminal and the forwarding priority corresponding to the MAC address into a second priority forwarding list of the second routing device.
6. The method according to claim 5, further comprising, after the creating the first priority forwarding list according to the MAC address of the terminal and the forwarding priority corresponding to the MAC address:
if any terminal is detected to be disconnected with the first routing equipment, deleting the MAC address of any terminal and the forwarding priority corresponding to the MAC address from the first priority forwarding list;
generating a removal instruction about any terminal, and sending the removal instruction to the second routing equipment; the removing instruction is configured to notify the second routing device to delete the MAC address of the any terminal and the forwarding priority corresponding to the MAC address from the second priority forwarding list.
7. The method of any one of claims 1-6, further comprising:
receiving a plurality of items in a second priority forwarding list sent by second routing equipment in the local area network;
and respectively adding the MAC addresses recorded by the entries and the forwarding priorities corresponding to the MAC addresses into the first priority forwarding list.
8. An apparatus for forwarding data, comprising:
a target data packet receiving unit, configured to receive a target data packet to be forwarded;
a forwarding priority determining unit, configured to determine a forwarding priority of the target data packet according to a first priority forwarding list, where the first priority forwarding list includes a MAC address of a terminal and a forwarding priority corresponding to the MAC address, and the forwarding priority corresponding to the MAC address of the terminal is determined according to a wired port or a radio frequency band of the terminal to which the terminal is connected to the first routing device;
and the target data packet forwarding unit is used for forwarding the target data packet based on the forwarding priority.
9. A routing device comprising a memory, a processor and a computer program stored in the memory and executable on the processor, wherein the processor implements the method of any of claims 1 to 7 when executing the computer program.
10. A computer readable storage medium storing a computer program, characterized in that the computer program when executed by a processor implements the method according to any one of claims 1 to 7.
CN202310122544.4A 2023-02-03 2023-02-03 Data forwarding method, device, routing equipment and storage medium Pending CN116055396A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310122544.4A CN116055396A (en) 2023-02-03 2023-02-03 Data forwarding method, device, routing equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310122544.4A CN116055396A (en) 2023-02-03 2023-02-03 Data forwarding method, device, routing equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116055396A true CN116055396A (en) 2023-05-02

Family

ID=86122171

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310122544.4A Pending CN116055396A (en) 2023-02-03 2023-02-03 Data forwarding method, device, routing equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116055396A (en)

Similar Documents

Publication Publication Date Title
CN107113240B (en) Method for transmitting message of extensible virtual local area network, computer equipment and readable medium
US10419531B2 (en) Method for setting gateway device identity, and management gateway device
US20190116220A1 (en) Neighbor Discovery for IPV6 Switching Systems
US20200382578A1 (en) Communication Method, System and Apparatus
CN106789526B (en) method and device for connecting multiple system networks
WO2014101777A1 (en) Flow table matching method and device, and switch
CN113872845B (en) Method for establishing VXLAN tunnel and related equipment
US10652142B2 (en) SDN-based ARP implementation method and apparatus
EP4142219A1 (en) Message processing method and apparatus, announcement method and apparatus, network bridge node, source device, storage medium, and message processing system
US10693785B2 (en) Method and system for forwarding data, virtual load balancer, and readable storage medium
EP4192184A1 (en) Pdu session establishment method, terminal device, and chip system
CN112887229B (en) Session information synchronization method and device
JP7101308B2 (en) High-speed transfer table creation
CN110233834B (en) Network system, method, device and equipment for intercepting attack message
US10263901B2 (en) Service packet processing method, apparatus, and system
CN107070790B (en) Route learning method and routing equipment
CN109088957B (en) NAT rule management method, device and equipment
US20210084100A1 (en) Packet Processing Method, Related Device, and Computer Storage Medium
WO2019047611A1 (en) Data transmission method, pnf sdn controller, vnf sdn controller, and system
WO2023011151A1 (en) Communication method and device
CN114640557A (en) Gateway and cloud network system
CA2975407C (en) Processing method for service flow packet, and apparatus
US12003417B2 (en) Communication method and apparatus
WO2024001701A1 (en) Data processing method, apparatus and system
CN108989173B (en) Message transmission method and device

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