Nothing Special   »   [go: up one dir, main page]

CN116016337A - Message forwarding method and device, electronic equipment and storage medium - Google Patents

Message forwarding method and device, electronic equipment and storage medium Download PDF

Info

Publication number
CN116016337A
CN116016337A CN202310004705.XA CN202310004705A CN116016337A CN 116016337 A CN116016337 A CN 116016337A CN 202310004705 A CN202310004705 A CN 202310004705A CN 116016337 A CN116016337 A CN 116016337A
Authority
CN
China
Prior art keywords
message
information
path
forwarding
path table
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
CN202310004705.XA
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.)
Suzhou Sheng Ke Science And Technology Co ltd
Original Assignee
Suzhou Sheng Ke Science And Technology 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 Suzhou Sheng Ke Science And Technology Co ltd filed Critical Suzhou Sheng Ke Science And Technology Co ltd
Priority to CN202310004705.XA priority Critical patent/CN116016337A/en
Publication of CN116016337A publication Critical patent/CN116016337A/en
Pending legal-status Critical Current

Links

Images

Classifications

    • 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/50Reducing energy consumption in communication networks in wire-line communication networks, e.g. low power modes or reduced link rate

Landscapes

  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The embodiment of the invention provides a message forwarding method, a message forwarding device, electronic equipment and a storage medium, and relates to the technical field of communication, wherein the method comprises the following steps: determining message information of a received message, taking the message information as an index, determining effective indication bits corresponding to the message information from a predefined access control list, determining an ineffective path corresponding to the effective indication bits from a path table based on the effective indication bits, deleting the ineffective path from the path table to obtain an effective path table, and forwarding the received message based on the effective path table. The effective path table is obtained after the effective filtering is carried out on the path table, the current message is forwarded based on the effective path table, the message is prevented from being forwarded through an ineffective path, and the message forwarding efficiency and the load balancing effect are improved.

Description

Message forwarding method and device, electronic equipment and storage medium
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and apparatus for forwarding a message, an electronic device, and a storage medium.
Background
ECMP is widely applied load balancing technology in three-layer routing network at present, it binds a group of reachable destination network paths into an equivalent path group, when the data flow needs to be forwarded to the corresponding destination, through the conversation characteristic field of the data message, such as source IP address, destination IP address, four-layer protocol type, four-layer source port, four-layer destination port, generate Hash value embodying conversation characteristic through Hash algorithm, take remainder for equivalent path group path number based on Hash value, use remainder to obtain a forwarding path from equivalent path group, realize flow load balancing of path in equivalent path group through the above-mentioned technology.
The above message forwarding method has the following disadvantages: the selected path group set is determined by the destination IP of the message and cannot be used for screening path group members based on other characteristic information of the message, so that the load balancing effect is poor.
Disclosure of Invention
The invention aims to provide a session maintaining method, a session maintaining device, electronic equipment and a storage medium, which can achieve the effect of improving load balancing.
In order to achieve the above purpose, the technical solution adopted in the embodiment of the present application is as follows:
in a first aspect, an embodiment of the present application provides a method for forwarding a message, which is applied to a switch chip, where the method includes:
determining message information of a received message;
the message information is used as an index, and a valid indication bit corresponding to the message information is determined from a predefined access control list;
based on the valid indication bit, determining an invalid path corresponding to the valid indication bit from a path table, wherein the path table comprises all paths of an ECMP group;
deleting the invalid path from the path table to obtain an effective path table;
and forwarding the received message based on the effective path table.
In an alternative embodiment, the step of determining the message information of the received message includes:
analyzing and forwarding the received message;
analyzing to obtain the source address information, the destination address information and the four-layer protocol information of the received message;
and forwarding and searching based on the destination address information to obtain forwarding information, source port information and destination ECMP group information.
In an alternative embodiment, searching the predefined access control list according to the destination ECMP group information;
and determining valid indication bits corresponding to members in the destination ECMP group information in the predefined access control list.
In an alternative embodiment, the method further comprises:
searching the predefined access control list according to the source address information, the four-layer protocol information, the destination address information, the forwarding information or the source port information;
and determining valid indication bits corresponding to the source address information, the four-layer protocol information, the forwarding information, the destination address information or the source port information in the predefined access control list.
In an optional embodiment, the step of determining, based on the valid indicator bit, an invalid path corresponding to the valid indicator bit from the path table includes:
determining a path index corresponding to the effective indication bit from the path table according to the effective indication bit corresponding to the message information;
an invalid path is determined from the path table based on the path index.
In an alternative embodiment, the method further comprises:
and forwarding the message based on the path table when the valid indication bit corresponding to the message information is not found in the predefined access control list.
In an alternative embodiment, the step of forwarding the received packet based on the valid path table includes:
calculating a hash value based on the message information of the message;
determining the number of members in the effective path table;
performing remainder taking operation based on the hash value and the member number to obtain a remainder taking value;
determining a target path from the effective path table based on the remainder value;
and forwarding the message based on the target path.
In a second aspect, an embodiment of the present application provides a packet forwarding device, where the device includes:
the first determining module is used for determining message information of the received message;
the second determining module is used for taking the message information as an index and determining a valid indicating bit corresponding to the message information from a predefined access control list;
a third determining module, configured to determine, based on the valid indication bit, an invalid path corresponding to the valid indication bit from a path table, where the path table includes all paths of the ECMP group;
the deleting module is used for deleting the invalid path from the path table to obtain an effective path table;
and the forwarding module is used for forwarding the received message based on the effective path table.
In a third aspect, an embodiment of the present application provides an electronic device, including a memory and a processor, where the memory stores a computer program, and the processor implements steps of the packet forwarding method when executing the computer program.
In a fourth aspect, embodiments of the present application provide a computer readable storage medium having stored thereon a computer program which, when executed by a processor, implements the steps of the message forwarding method.
The application has the following beneficial effects:
according to the method, the device and the system, the message information of the received message is determined, the message information is used as an index, the effective indication bit corresponding to the message information is determined from a predefined access control list, the invalid path corresponding to the effective indication bit is determined from the path table based on the effective indication bit, the invalid path is deleted from the path table, an effective path table is obtained, and the received message is forwarded based on the effective path table. The effective path table is obtained after the effective filtering is carried out on the path table, the current message is forwarded based on the effective path table, the message is prevented from being forwarded through an ineffective path, and the message forwarding efficiency and the load balancing effect are improved.
Drawings
In order to more clearly illustrate the technical solutions of the embodiments of the present invention, the drawings that are needed in the embodiments will be briefly described below, it being understood that the following drawings only illustrate some embodiments of the present invention and therefore should not be considered as limiting the scope, and other related drawings may be obtained according to these drawings without inventive effort for a person skilled in the art.
Fig. 1 is a schematic block diagram of an electronic device according to an embodiment of the present invention;
fig. 2 is a schematic flow chart of a message forwarding method according to an embodiment of the present invention;
fig. 3 is a schematic diagram of an application scenario of a message forwarding method according to an embodiment of the present invention;
FIG. 4 is a second flow chart of a message forwarding method according to the embodiment of the present invention;
FIG. 5 is a third flow chart of a message forwarding method according to an embodiment of the present invention;
FIG. 6 is a flowchart of a message forwarding method according to an embodiment of the present invention;
fig. 7 is a block diagram of a message forwarding device according to an embodiment of the present invention.
Detailed Description
For the purpose of making the objects, technical solutions and advantages of the embodiments of the present invention more apparent, the technical solutions of the embodiments of the present invention will be clearly and completely described below with reference to the accompanying drawings in the embodiments of the present invention, and it is apparent that the described embodiments are some embodiments of the present invention, but not all embodiments of the present invention. The components of the embodiments of the present invention generally described and illustrated in the figures herein may be arranged and designed in a wide variety of different configurations.
Thus, the following detailed description of the embodiments of the invention, as presented in the figures, is not intended to limit the scope of the invention, as claimed, but is merely representative of selected embodiments of the invention. All other embodiments, which can be made by those skilled in the art based on the embodiments of the invention without making any inventive effort, are intended to be within the scope of the invention.
It should be noted that: like reference numerals and letters denote like items in the following figures, and thus once an item is defined in one figure, no further definition or explanation thereof is necessary in the following figures.
In the description of the present invention, it should be noted that, if the terms "upper", "lower", "inner", "outer", and the like indicate an azimuth or a positional relationship based on the azimuth or the positional relationship shown in the drawings, or the azimuth or the positional relationship in which the inventive product is conventionally put in use, it is merely for convenience of describing the present invention and simplifying the description, and it is not indicated or implied that the apparatus or element referred to must have a specific azimuth, be configured and operated in a specific azimuth, and thus it should not be construed as limiting the present invention.
Furthermore, the terms "first," "second," and the like, if any, are used merely for distinguishing between descriptions and not for indicating or implying a relative importance.
In the description of the present application, it should also be noted that, unless explicitly specified and limited otherwise, the terms "disposed," "mounted," "connected," and "connected" are to be construed broadly, and may be, for example, fixedly connected, detachably connected, or integrally connected; can be mechanically or electrically connected; can be directly connected or indirectly connected through an intermediate medium, and can be communication between two elements. The specific meaning of the terms in this application will be understood by those of ordinary skill in the art in a specific context.
Through a great deal of researches of the inventor, ECMP is widely applied in the current three-layer routing network, a group of reachable destination network paths are bound into an equivalent path group, when a data stream needs to be forwarded to a corresponding destination, a session characteristic field of the data message, such as a source IP address, a destination IP address, a four-layer protocol type, a four-layer source port and a four-layer destination port, a Hash value representing the session characteristic is generated through a Hash algorithm, a remainder is obtained for the number of paths of the equivalent path group based on the Hash value, a forwarding path is obtained from the equivalent path group by using the remainder, and the flow load balance of the paths in the equivalent path group is realized through the technology.
The above message forwarding method has the following disadvantages: the selected path group set is determined by the destination IP of the message and cannot be used for screening path group members based on other characteristic information of the message, so that the load balancing effect is poor.
And the traditional load sharing balance path selection module adopts a Hash remainder taking mode, and has the following defects: the selected path group set is determined by the destination IP of the message and cannot be screened based on other characteristic information of the message.
In view of the above-mentioned problems, the present embodiment provides a method, an apparatus, an electronic device, and a storage medium for forwarding a message, where the method, the apparatus, the electronic device, and the storage medium are capable of determining, by determining message information of a received message, using the message information as an index, determining valid indication bits corresponding to the message information from a predefined access control list, determining invalid paths corresponding to the valid indication bits from a path table based on the valid indication bits, deleting the invalid paths from the path table, obtaining an valid path table, and forwarding the received message based on the valid path table. The effective path table is obtained after the validity of the path table is filtered, the current message is forwarded based on the effective path table, the message is prevented from being forwarded through an ineffective path, the message forwarding efficiency is improved, the load balancing effect is improved, and the scheme provided by the embodiment is explained in detail below.
The embodiment provides an electronic device capable of forwarding a message. In one possible implementation, the electronic device may be a user terminal, for example, the electronic device may be, but is not limited to, a server, a smart phone, a personal computer (PersonalComputer, PC), a tablet, a personal digital assistant (Personal Digital Assistant, PDA), a mobile internet device (Mobile Internet Device, MID), or the like.
Referring to fig. 1, fig. 1 is a schematic structural diagram of an electronic device 100 according to an embodiment of the disclosure. The electronic device 100 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1. The components shown in fig. 1 may be implemented in hardware, software, or a combination thereof.
The electronic device 100 includes a message forwarding apparatus 110, a memory 120, and a processor 130.
The memory 120 and the processor 130 are electrically connected directly or indirectly to each other to realize data transmission or interaction. For example, the components may be electrically connected to each other via one or more communication buses or signal lines. The message forwarding device 110 includes at least one software function module that may be stored in the memory 120 in the form of software or firmware (firmware) or cured in an Operating System (OS) of the electronic device 100. The processor 130 is configured to execute executable modules stored in the memory 120, such as software functional modules and computer programs included in the packet forwarding device 110.
The Memory 120 may be, but is not limited to, a random access Memory (RandomAccess Memory, RAM), a Read Only Memory (ROM), a programmable Read Only Memory (Programmable Read-Only Memory, PROM), an erasable Read Only Memory (Erasable ProgrammableRead-Only Memory, EPROM), an electrically erasable Read Only Memory (Electric Erasable ProgrammableRead-Only Memory, EEPROM), etc. The memory 120 is configured to store a program, and the processor 130 executes the program after receiving an execution instruction.
Referring to fig. 2, fig. 2 is a flowchart of a message forwarding method applied to the electronic device 100 of fig. 1, and the method includes various steps described in detail below.
Step 201: and determining message information of the received message.
Step 202: and taking the message information as an index, and determining a valid indication bit corresponding to the message information from a predefined access control list.
Step 203: based on the valid indication bits, invalid paths corresponding to the valid indication bits are determined from the path table.
Wherein the path table includes all paths of the ECMP group.
Step 204: and deleting the invalid path from the path table to obtain an effective path table.
Step 205: and forwarding the received message based on the effective path table.
As shown in fig. 3, an application scenario diagram of a message forwarding method is shown, which includes a first layer network device, a second layer network device and an internet, where the first layer network device includes a plurality of access switches, such as access switch 1-1, access switch 1-2, access switch 1-3 and …, and access switch 1-n, and the second layer network device includes a plurality of aggregation switches, such as aggregation switch 2-1, aggregation switch 2-2, and aggregation switch 2-3 and …, and aggregation switch 2-n. The access exchanger 1-1 and the aggregation exchanger 2-1, the aggregation exchanger 2-2 and the aggregation exchanger 2-3 … aggregate exchanger 2-n, the exchanger 1-2 and the aggregation exchanger 2-1 and the aggregation exchanger 2-2 … aggregate exchanger 2-n, the access exchanger 1-3 and the aggregation exchanger 2-1, the aggregation exchanger 2-2 and the aggregation exchanger 2-3 … aggregate exchanger 2-n, and the connection between the access exchanger 1-n and the aggregation exchanger 2-1, the aggregation exchanger 2-2 and the aggregation exchanger 2-3 … aggregate exchanger 2-n form a path table.
In an example, when forwarding a message based on the first layer network device and the second layer network device, for example, the access switch 1-1 in the first layer network device receives the message a, and determines message information of the message a, where the message information includes, but is not limited to, source address information, four-layer protocol information, destination address information, forwarding information, source port information, destination ECMP group information, and the like, where the forwarding information, the source port information, and the destination ECMP group information are obtained by forwarding and searching based on the destination address information of the message, and the source address information, the four-layer protocol information, the destination address information, the forwarding information, the source port information, and the destination ECMP group information in the message information are used as indexes, where the destination ECMP group information is the mandatory information, and a corresponding valid indication position is determined from a predefined access control list. And the source address information, the destination address information, the four-layer protocol information, the forwarding information or the source port information can be used as an index, and an effective indication bit corresponding to the index is determined from a predefined access control list, wherein the effective indication bit indicates that an ineffective path in a path table is determined, if the effective indication bit corresponds to 1, the paths of the access switch 1-1 and the aggregation switch 2-1 are determined to be ineffective paths from the path table based on the effective indication bit 1, and then the ineffective paths are deleted in the path table containing all paths, so that an effective path table is obtained, and a received message is forwarded based on the effective path table, so that the message is not forwarded to the ineffective path again, and the message forwarding fails.
Based on the message information of the received message, there are various implementations for determining the valid indication bit corresponding to the message information, and in one implementation, as shown in fig. 4, the method includes the following steps:
step 201-1: and analyzing and forwarding the received message.
Step 201-2: and analyzing to obtain the source address information, the destination address information and the four-layer protocol information of the received message.
Step 201-3: and forwarding and searching based on the destination address information to obtain forwarding information, source port information and destination ECMP group information.
Step 202-1: and searching a predefined access control list according to the destination ECMP group information.
Step 202-2: valid indicator bits corresponding to members in the destination ECMP group information are determined in a predefined access control list.
Obtaining message information including, but not limited to, source address information, four-layer protocol information, destination address information, forwarding information, source port information, destination ECMP group information based on the received message, wherein the destination ECMP group information is an indispensable path searching element
In an example, since the predefined access control list includes a correspondence between valid indicator bits and members of the destination ECMP group, the members of the destination ECMP group are used as indexes to query the predefined access control list in sequence, and the valid indicator bits corresponding to the members of the destination ECMP group are determined from the predefined access control list. Assuming that the destination ECMP group has 8 members, the valid indicator bits consist of 8bits, bit0 corresponds to path 0, bit 1 corresponds to path 1 … bits7 corresponds to path 7.
For the searching mode of the effective path, in another example, searching the predefined access control list according to the source address information, the four-layer protocol information, the destination address information, the forwarding information or the source port information; valid indicator bits corresponding to the source address information, the four-layer protocol information, the destination address information, the forwarding information, or the source port information are determined in a predefined access control list.
That is, the access control list is queried based on the source address information, the access control list is queried based on the four-layer protocol information, the access control list is queried based on the forwarding information, the access control list is queried based on the source port information, and the access control list is queried based on the destination address information. And determining valid indication bits corresponding to the source address information, the four-layer protocol information, the destination address information, the forwarding information or the source port information in a predefined access control list.
In another example, when a valid indicator bit corresponding to the message information is not found in the predefined access control list, forwarding the message based on the path table. For example: when the first layer network device includes the access switch 1 and the access switch 2, the second layer network device includes the aggregation switch a and the aggregation switch B, and all paths in the path table include: the path A-1 of the aggregation switch A and the path A-2 of the access switch 2, the path B-1 of the aggregation switch B and the access switch 1, and the path B-2 of the aggregation switch B and the access switch 2. And (3) based on the message information of the message, no corresponding ACL list item is found in a predefined access control list, and the message is forwarded based on a path table formed by a converging switch A and a path A-1 of an access switch 1, a converging switch A and a path A-2 of an access switch 2, a converging switch B and a path B-1 of the access switch 1 and a path B-2 of the converging switch B and the access switch 2.
When needed, the access control list is configured based on the message information of the received message.
In an example, when the first layer network device includes an access switch 1 and an access switch 2, the second layer network device includes an aggregation switch a and an aggregation switch B, when the access switch fails to connect with a path a-1 of the aggregation switch a, a message is received by the access switch 2, when the access switch 2 selects the aggregation switch a to forward the message, and the aggregation switch a forwards the message based on the paths of the aggregation switch a and the access switch 2, at this time, the message is sent from the switch 2 to the switch 2, a preconfigured access control list is configured based on message information received by the current switch 2, and a valid indication bit in the configured access control list indicates that the paths of the aggregation switch a and the access switch 2 are invalid paths.
There are various implementations of determining invalid paths in a path table, and in one implementation, as shown in fig. 5, the method includes the steps of:
step 203-1: and determining a path index corresponding to the valid indication bit from the path table according to the valid indication bit corresponding to the message information.
Step 203-2: based on the path index, an invalid path is determined from the path table.
After the corresponding message information is found in the predefined access control list based on the message information, determining a path index corresponding to the valid indication bit based on the valid indication bit corresponding to the message information, and finding invalid paths in all paths from the path table.
In an example, when the paths of the access switch 1-3 and the aggregation switch 2-1 of the first layer network device are invalid paths in the packet forwarding scenario, when the packet a is sent from the access switch 1-1 to the access switch 1-3 through the aggregation switch, a valid indicator bit corresponding to the packet information of the packet a is determined from a predefined access control list based on the packet information of the packet a, and the paths of the aggregation switch 2-1 and the access switch 1-3 are found from the path table to be invalid paths based on the valid indicator bit.
In another example, when the first layer network device includes the access switch 1 and the access switch 2, the second layer network device includes the aggregation switch a and the aggregation switch B, when the access switch 1 fails to connect with the path a-1 of the aggregation switch a, the invalid path indicated by the valid indication bit determined in the predefined access control list is the path a-1 of the aggregation switch a and the access switch 1 based on the message information of the message when the message is received by the access switch 1, and the invalid path indicated by the valid indication bit determined in the predefined access control list is the path a-1 of the aggregation switch a and the path a-2 of the aggregation switch a and the comparison switch 2 based on the message information of the message. When the switch 1 receives the message, all paths in the path table are: and deleting invalid paths of the paths A-1 of the aggregation switch A and the access switch 1 from the paths A-1 of the aggregation switch A and the access switch 1, the paths A-2 of the aggregation switch A and the access switch 2, and the effective path table formed by the paths B-1 of the aggregation switch B and the access switch 1 and the paths B-2 of the aggregation switch B and the access switch 2, and forwarding the message based on the paths in the effective path table.
When the exchanger 2 receives the message, deleting the invalid paths of the converging exchanger A and the path A-1 of the access exchanger 1 and the path A-2 of the converging exchanger A and the access exchanger 2 in the path table, and finally obtaining an effective path table formed by the converging exchanger B and the path B-1 of the access exchanger 1 and the path B-2 of the converging exchanger B and the access exchanger 2, and forwarding the message based on the paths in the effective path table.
There are various ways to forward the packet for the effective path table, in one implementation, as shown in fig. 6, the method includes the following steps:
step 301: based on the message information of the message, a hash value is calculated.
Step 302: the number of members in the active path table is determined.
Step 303: and performing remainder taking operation based on the hash value and the number of members to obtain a remainder taking value.
Step 304: the target path is determined from the active path table based on the remainder value.
Step 305: and forwarding the message based on the target path.
Illustratively, when the first layer network device includes the access switch 1 and the access switch 2, and the second layer network device includes the aggregation switch a and the aggregation switch B, when the access switch 1 receives the message, the effective path table is determined as follows: the method comprises the steps that a path A-2 of a convergence switch A and a path B-1 of an access switch 2, a path B-2 of a convergence switch B and an access switch 1 correspond to a first residual value, a path A-2 of the convergence switch A and the access switch 2 correspond to a second residual value, a path B-1 of the convergence switch B and the access switch 1 correspond to a third residual value.
Determining message information of a message received by the access switch 1, calculating a hash value of the message based on the message information, determining the number of members in the ECMP group as 2, calculating a hash value of the message received by the access switch 1 and a target residual value of the number of members 2, comparing the target residual value with first residual values corresponding to paths A-2 of the aggregation switch A and the access switch 2 respectively, and forwarding the message received by the access switch 1 by taking the aggregation switch A and the path A-2 of the access switch 2 as target paths when the target residual value is successfully matched with the first residual value corresponding to the paths A-2 of the aggregation switch A and the access switch 2.
When the target residual value is not matched with the first residual value of the path A-2 of the aggregation switch A and the path A-2 of the access switch 2, the target residual value is compared with the second residual value corresponding to the path B-1 of the aggregation switch B and the access switch 1, and when the target residual value is successfully matched with the second residual value corresponding to the path B-1 of the aggregation switch B and the access switch 1, the path B-1 of the aggregation switch B and the access switch 1 is used as a target path to forward the message received by the access switch 1. When the target residual value is not matched with the second residual value of the path B-1 of the aggregation switch B and the access switch 1, the target residual value is compared with a third residual value corresponding to the path B-2 of the aggregation switch B and the access switch 2, and when the target residual value is successfully matched with the third residual value corresponding to the path B-2 of the aggregation switch B and the access switch 2, the path B-2 of the aggregation switch B and the access switch 2 is used as a target path to forward the message received by the access switch 1.
The invention improves the path selection module in the existing load sharing balance, introduces a filtering mechanism based on a strategy, firstly filters the validity of the path table, and then uses the member set which is valid for the current message for the selection of the load sharing balance path, thereby solving the defect that the traditional path selection set can only be truly based on the IP of the message destination, and further, the load sharing balance can select the member set based on the strategy in the scene.
Referring to fig. 7, an embodiment of the present application further provides a packet forwarding apparatus 110 applied to the electronic device 100 shown in fig. 1, where the packet forwarding apparatus 110 includes:
a first determining module 111, configured to determine message information of a received message;
a second determining module 112, configured to determine, from a predefined access control list, a valid indicator bit corresponding to the message information using the message information as an index;
a third determining module 113, configured to determine, based on the valid indication bit, an invalid path corresponding to the valid indication bit from a path table, where the path table includes all paths of the ECMP group;
a deleting module 114, configured to delete the invalid path from the path table, to obtain an valid path table;
and the forwarding module 115 is configured to forward the received packet based on the valid path table.
The present application also provides an electronic device 100, the electronic device 100 comprising a processor 130 and a memory 120. Memory 120 stores computer-executable instructions that, when executed by processor 130, implement the message forwarding method.
The embodiment of the application further provides a computer readable storage medium, where a computer program is stored, and when the computer program is executed by the processor 130, the method for forwarding the message is implemented.
In the embodiments provided in the present application, it should be understood that the disclosed apparatus and method may be implemented in other manners as well. The apparatus embodiments described above are merely illustrative, for example, flow diagrams and block diagrams in the figures illustrate the architecture, functionality, and operation of possible implementations of apparatus, methods and computer program products according to various embodiments of the present application. In this regard, each block in the flowchart or block diagrams may represent a module, segment, or portion of code, which comprises one or more executable instructions for implementing the specified logical function(s). It should also be noted that in some alternative implementations, the functions noted in the block may occur out of the order noted in the figures. For example, two blocks shown in succession may, in fact, be executed substantially concurrently, or the blocks may sometimes be executed in the reverse order, depending upon the functionality involved. It will also be noted that each block of the block diagrams and/or flowchart illustration, and combinations of blocks in the block diagrams and/or flowchart illustration, can be implemented by special purpose hardware-based systems which perform the specified functions or acts, or combinations of special purpose hardware and computer instructions.
In addition, the functional modules in the embodiments of the present application may be integrated together to form a single part, or each module may exist alone, or two or more modules may be integrated to form a single part. The functions, if implemented in the form of software functional modules and sold or used as a stand-alone product, may be stored in a computer-readable storage medium. Based on such understanding, the technical solution of the present application may be embodied essentially or in a part contributing to the prior art or in a part of the technical solution, in the form of a software product stored in a storage medium, including several instructions for causing a computer device (which may be a personal computer, a server, or a network device, etc.) to perform all or part of the steps of the methods described in the embodiments of the present application. And the aforementioned storage medium includes: a U-disk, a removable hard disk, a Read-Only Memory (ROM), a random access Memory (RAM, random Access Memory), a magnetic disk, or an optical disk, or other various media capable of storing program codes.
It is noted that relational terms such as first and second, and the like are used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Moreover, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing is merely various embodiments of the present application, but the scope of the present application is not limited thereto, and any person skilled in the art can easily think about changes or substitutions within the technical scope of the present application, and the changes and substitutions are intended to be covered in the scope of the present application. Therefore, the protection scope of the present application shall be subject to the protection scope of the claims.

Claims (10)

1. The message forwarding method is applied to a switching chip and is characterized by comprising the following steps:
determining message information of a received message;
the message information is used as an index, and a valid indication bit corresponding to the message information is determined from a predefined access control list;
based on the valid indication bit, determining an invalid path corresponding to the valid indication bit from a path table, wherein the path table comprises all paths of an ECMP group;
deleting the invalid path from the path table to obtain an effective path table;
and forwarding the received message based on the effective path table.
2. The method of claim 1, wherein the step of determining message information of the received message comprises:
analyzing and forwarding the received message;
analyzing to obtain the source address information, the destination address information and the four-layer protocol information of the received message;
and forwarding and searching based on the destination address information to obtain forwarding information, source port information and destination ECMP group information.
3. The method according to claim 2, wherein the step of determining the valid indicator bit corresponding to the message information from the predefined access control list by using the message information as an index includes:
searching the predefined access control list according to the target ECMP group information;
and determining valid indication bits corresponding to members in the destination ECMP group information in the predefined access control list.
4. A method according to claim 3, characterized in that the method further comprises:
searching the predefined access control list according to the source address information, the four-layer protocol information, the destination address information, the forwarding information or the source port information;
and determining valid indication bits corresponding to the source address information, the four-layer protocol information, the forwarding information, the destination address information or the source port information in the predefined access control list.
5. The method according to claim 3 or 4, wherein the step of determining, based on the valid indicator bits, invalid paths corresponding to the valid indicator bits from the path table includes:
determining a path index corresponding to the effective indication bit from the path table according to the effective indication bit corresponding to the message information;
an invalid path is determined from the path table based on the path index.
6. The method according to claim 1, wherein the method further comprises:
and forwarding the message based on the path table when the valid indication bit corresponding to the message information is not found in the predefined access control list.
7. The method of claim 1, wherein the step of forwarding the received message based on the active path table comprises:
calculating a hash value based on the message information of the message;
determining the number of members in the effective path table;
performing remainder taking operation based on the hash value and the member number to obtain a remainder taking value;
determining a target path from the effective path table based on the remainder value;
and forwarding the message based on the target path.
8. A message forwarding device, the device comprising:
the first determining module is used for determining message information of the received message;
the second determining module is used for taking the message information as an index and determining a valid indicating bit corresponding to the message information from a predefined access control list;
a third determining module, configured to determine, based on the valid indication bit, an invalid path corresponding to the valid indication bit from a path table, where the path table includes all paths of the ECMP group;
the deleting module is used for deleting the invalid path from the path table to obtain an effective path table;
and the forwarding module is used for forwarding the received message based on the effective path table.
9. An electronic device comprising a memory storing a computer program and a processor implementing the steps of the method of any one of claims 1-7 when the computer program is executed by the processor.
10. A storage medium having stored thereon a computer program, which when executed by a processor performs the steps of the method according to any of claims 1-7.
CN202310004705.XA 2023-01-03 2023-01-03 Message forwarding method and device, electronic equipment and storage medium Pending CN116016337A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202310004705.XA CN116016337A (en) 2023-01-03 2023-01-03 Message forwarding method and device, electronic equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202310004705.XA CN116016337A (en) 2023-01-03 2023-01-03 Message forwarding method and device, electronic equipment and storage medium

Publications (1)

Publication Number Publication Date
CN116016337A true CN116016337A (en) 2023-04-25

Family

ID=86031514

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202310004705.XA Pending CN116016337A (en) 2023-01-03 2023-01-03 Message forwarding method and device, electronic equipment and storage medium

Country Status (1)

Country Link
CN (1) CN116016337A (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117499346A (en) * 2023-12-28 2024-02-02 苏州元脑智能科技有限公司 Method and device for issuing access control information

Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5845091A (en) * 1996-02-15 1998-12-01 Bay Networks, Inc. Forwarding of internetwork packets to a destination network via a selected one of a plurality of paths
US20150365328A1 (en) * 2014-06-17 2015-12-17 Comcast Cable Communications, Llc Flow-based load balancing
CN106685821A (en) * 2017-02-20 2017-05-17 华为技术有限公司 Multipath selection method and multipath selection equipment
CN106992933A (en) * 2016-01-21 2017-07-28 中兴通讯股份有限公司 Policybased routing processing, message forwarding method and device
CN109218175A (en) * 2017-06-30 2019-01-15 华为技术有限公司 A kind of delet method of path data, a kind of message forwarding method and device
CN111131053A (en) * 2018-10-30 2020-05-08 中国电信股份有限公司 Path selection method and device and router
CN112333093A (en) * 2020-11-23 2021-02-05 迈普通信技术股份有限公司 Policy routing path determining method and device, network equipment and readable storage medium

Patent Citations (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5845091A (en) * 1996-02-15 1998-12-01 Bay Networks, Inc. Forwarding of internetwork packets to a destination network via a selected one of a plurality of paths
US20150365328A1 (en) * 2014-06-17 2015-12-17 Comcast Cable Communications, Llc Flow-based load balancing
CN106992933A (en) * 2016-01-21 2017-07-28 中兴通讯股份有限公司 Policybased routing processing, message forwarding method and device
CN106685821A (en) * 2017-02-20 2017-05-17 华为技术有限公司 Multipath selection method and multipath selection equipment
CN109218175A (en) * 2017-06-30 2019-01-15 华为技术有限公司 A kind of delet method of path data, a kind of message forwarding method and device
CN111131053A (en) * 2018-10-30 2020-05-08 中国电信股份有限公司 Path selection method and device and router
CN112333093A (en) * 2020-11-23 2021-02-05 迈普通信技术股份有限公司 Policy routing path determining method and device, network equipment and readable storage medium

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
张天明;王培康;: "移动ad hoc网络AODV协议的分析与改进", 计算机辅助工程, no. 03, 15 September 2008 (2008-09-15) *

Cited By (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN117499346A (en) * 2023-12-28 2024-02-02 苏州元脑智能科技有限公司 Method and device for issuing access control information
CN117499346B (en) * 2023-12-28 2024-03-01 苏州元脑智能科技有限公司 Method and device for issuing access control information

Similar Documents

Publication Publication Date Title
EP3035613B1 (en) Ccn routing using hardware-assisted hash tables
EP2613502B1 (en) Locator resolution in communications networks
KR101215208B1 (en) Outbound transmission of packet based on routing search key constructed from packet destination address and outbound interface
US7930413B2 (en) System and method for controlling access to a network resource
CN102915306B (en) A kind of searching method and system
CN114157633B (en) Message forwarding method and device
CN116016337A (en) Message forwarding method and device, electronic equipment and storage medium
US9866480B1 (en) Hash range lookup command
CN104010291B (en) Network registering method and its device and mobile terminal
CN111107181B (en) NAT rule matching method and device, electronic equipment and storage medium
US20160142281A1 (en) Method and apparatus for compressing content name
CN111294285A (en) Network data distribution method and load balancer
US12185229B2 (en) Discovery of which NEF or AF is serving a UE
CN115955435B (en) A multicast table processing method, device and electronic equipment
CN101350772A (en) Method for selecting line of router with multiple WAN interfaces, system and router
WO2022007550A1 (en) Load balancing method, apparatus, network device, and system
CN115277884B (en) Subnet replacement method and device, exchange chip, electronic equipment and storage medium
RU2714383C2 (en) Method and device for processing switch routing conflict
CN109831384A (en) Name Lookup method and router
US7570644B2 (en) Routing method for a telecommunications network and router for implementing said method
CN101959092A (en) Path acquisition method and device for wavelength switching optical network nodes
US20110235640A1 (en) Method and system for forwarding and switching over protected paths
CN116055389B (en) Multicast message copying method and device, electronic equipment and storage medium
CN111107142B (en) Service access method and device
CN105009542B (en) A kind of method and apparatus for handling message

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