CN108737239B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN108737239B
CN108737239B CN201811005588.4A CN201811005588A CN108737239B CN 108737239 B CN108737239 B CN 108737239B CN 201811005588 A CN201811005588 A CN 201811005588A CN 108737239 B CN108737239 B CN 108737239B
Authority
CN
China
Prior art keywords
message
forwarding
inner layer
flow information
layer flow
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.)
Active
Application number
CN201811005588.4A
Other languages
Chinese (zh)
Other versions
CN108737239A (en
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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201811005588.4A priority Critical patent/CN108737239B/en
Publication of CN108737239A publication Critical patent/CN108737239A/en
Application granted granted Critical
Publication of CN108737239B publication Critical patent/CN108737239B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4633Interconnection of networks using encapsulation techniques, e.g. tunneling

Landscapes

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

Abstract

The invention provides a message forwarding method and a message forwarding device, which can acquire inner layer flow information of a second message when the second message received by a network card of network equipment carries a second characteristic; the network card distributes the second message to corresponding forwarding cores according to the characteristics of the inner layer flow information, so that messages with different characteristics of the inner layer flow information are distributed to different forwarding cores, the forwarding cores perform tunnel decapsulation on the second message, and the decapsulated second message is forwarded to a destination device. Therefore, the invention can identify the inner layer flow information of the message before the message is unpacked through the network card, so as to distribute different forwarding cores according to the characteristics of different inner layer flow information, thereby reducing the processing burden of the forwarding cores, avoiding the forwarding reentry action, improving the throughput of network equipment and optimizing the message forwarding speed.

Description

Message forwarding method and device
Technical Field
The present invention relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
The GRE (Generic Routing Encapsulation) protocol is used to encapsulate data packets of a certain protocol (e.g., IP, MPLS, ethernet) so that the encapsulated data packets can be transmitted in another network (e.g., IP). The network layer protocols of the data packets before and after encapsulation may be the same or different. The path of the encapsulated data packet transmitted in the network is called a GRE tunnel. The GRE tunnel is a virtual point-to-point connection, and network devices at both ends of the GRE tunnel respectively encapsulate and decapsulate data packets. The inner layer flow can be changed into the traffic of another flow through GRE encapsulation, and usually a plurality of inner layer traffic flows are changed into the same outer layer flow through GRE encapsulation.
The current software forwarding logic is generally forwarded in streams, that is, the same stream is allocated to the same forwarding core, so as to ensure in-sequence forwarding. However, for GRE encapsulation, multiple inner layer flows are transferred during encapsulation, and these multiple inner layer flows are transferred through multiple forwarding cores, but different inner layer flows are subjected to outer layer encapsulation to obtain the same outer layer flow, and the outer layer flow is only handed to the same forwarding core for processing during decapsulation, so that the decapsulation forwarding operations of the multiple inner layer flows are all processed by the same forwarding core, so that the throughput performance of the network device is limited to that of a certain forwarding core, and a throughput performance bottleneck of the network device is caused.
Disclosure of Invention
In view of this, the present invention provides a message forwarding method and apparatus, so as to avoid the problem of throughput performance bottleneck of network devices.
Specifically, the invention is realized by the following technical scheme:
the invention provides a message forwarding method, which is applied to network equipment and comprises the following steps:
when a network card receives a first message which carries a first characteristic and is sent by a forwarding core, tunnel encapsulation is carried out on the first message;
and the network card forwards the encapsulated first message to the destination equipment through the tunnel corresponding to the tunnel encapsulation.
The invention also provides another message forwarding method, which is applied to network equipment and comprises the following steps:
when a second message received by the network card carries a second characteristic, acquiring inner layer flow information of the second message;
the network card distributes the second message to corresponding forwarding cores according to the characteristics of the inner layer flow information, so that messages with different characteristics of the inner layer flow information are distributed to different forwarding cores, the forwarding cores perform tunnel decapsulation on the second message, and the decapsulated second message is forwarded to a destination device.
Based on the same conception, the invention provides a message forwarding device, which is applied to network equipment and comprises:
the first receiving unit is used for performing tunnel encapsulation on a first message when the network card receives the first message which carries a first characteristic and is sent by the forwarding core;
and the first forwarding unit is used for the network card to forward the encapsulated first message to the destination device through the tunnel corresponding to the tunnel encapsulation.
The invention also provides another message forwarding device, which is applied to network equipment and comprises:
the second receiving unit is used for acquiring the inner layer flow information of a second message when the second message received by the network card carries a second characteristic;
and the second forwarding unit is used for the network card to distribute the second message to the corresponding forwarding cores according to the characteristics of the inner layer flow information, so that messages with different characteristics of the inner layer flow information are distributed to different forwarding cores, the forwarding cores perform tunnel decapsulation on the second message, and forward the decapsulated second message to the destination device.
Therefore, the invention can lead the network card to carry out tunnel encapsulation on the first message when receiving the first message which is sent by the forwarding core and carries the first characteristic; the network card forwards the first encapsulated message to the destination device through the tunnel corresponding to the tunnel encapsulation, so that the message encapsulation process can be realized through the network card, the action of forwarding and reentry is avoided, and the message forwarding rate is optimized. The invention can also obtain the inner layer flow information of the second message when the second message received by the network card carries the second characteristic; the network card distributes the second message to corresponding forwarding cores according to the characteristics of the inner layer flow information, so that messages with different characteristics of the inner layer flow information are distributed to different forwarding cores, the forwarding cores perform tunnel decapsulation on the second message, and the decapsulated second message is forwarded to a destination device. The invention can identify the inner layer flow information of the message before the message is unpacked through the network card, thereby distributing different forwarding cores according to the characteristics of different inner layer flow information, reducing the processing burden of the forwarding cores, avoiding the action of forwarding reentry, improving the throughput of network equipment and optimizing the message forwarding speed.
Drawings
FIG. 1 is a diagram of an exemplary networking of GRE services in an exemplary embodiment of the invention;
fig. 2 is a processing flow diagram of a message forwarding method in an exemplary embodiment of the invention;
FIG. 3a is a flow chart of a prior art process for encapsulating a message;
FIG. 3b is a flow chart of the message encapsulation process of the present invention;
fig. 4 is a flowchart illustrating another method for forwarding packets according to an exemplary embodiment of the present invention;
FIG. 5a is a flow chart of a process for decapsulating a packet in the prior art;
FIG. 5b is a flow chart of the process of message decapsulation of the present invention;
fig. 6a is a hardware structure diagram of a network device where a message forwarding apparatus is located in an exemplary embodiment of the present invention;
fig. 6b is a logical structure diagram of a message forwarding apparatus according to an exemplary embodiment of the present invention;
fig. 7a is a hardware structure diagram of a network device where another packet forwarding apparatus is located in an exemplary embodiment of the present invention;
fig. 7b is a logic structure diagram of another message forwarding device in an exemplary embodiment of the present invention.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the appended claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein refers to and encompasses any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
Fig. 1 is a schematic diagram of a typical networking of GRE services in the embodiment of the present invention, where an intranet section is 10.1.1.1/24 → 10.1.3.1/24, and an outer layer GRE tunnel is 1.1.1.1 → 2.2.2.2. Taking a decapsulation service as an example, the switch B receives a service packet sent by the switch a, where a source address of the packet is 1.1.1.1 and a destination address is 2.2.2.2, and for the packet, tunnel decapsulation is performed first, and an inner layer stream is solved, that is, a packet with a source address of 10.1.1.1/24 and a destination address of 10.1.3.1/24 is decoded, and then the inner layer stream can be forwarded in an intranet.
Because the source and destination addresses of the packet before and after decapsulation are completely inconsistent, and the routing information and the forwarding service to be made are inconsistent, the inner layer flow needs to be re-entered into the IP forwarding flow after decapsulation, and the forwarding service needs to be re-matched. The actual test analysis shows that the data message before de-encapsulation can only be allocated to the same data core for processing. Thus, the overall performance of a single GRE tunnel becomes the performance of single data core processing. In addition, the throughput performance of the GRE is greatly influenced by the action of the reentry forwarding flow.
In order to solve the problems in the prior art, the invention provides a message forwarding method and a message forwarding device, which can enable a network card to perform tunnel encapsulation on a first message when the first message sent by a forwarding core is received and carries a first characteristic; the network card forwards the first message after encapsulation to the target device through the tunnel corresponding to the tunnel encapsulation, so the invention can realize the process of encapsulating the message through the network card, avoid the action of forwarding reentry and optimize the message forwarding speed. The invention can also obtain the inner layer flow information of the second message when the second message received by the network card carries the second characteristic; the network card distributes the second message to corresponding forwarding cores according to the characteristics of the inner layer flow information, so that messages with different characteristics of the inner layer flow information are distributed to different forwarding cores, the forwarding cores perform tunnel decapsulation on the second message, and the decapsulated second message is forwarded to a destination device. The invention can identify the inner layer flow information of the message before the message is unpacked through the network card, thereby distributing different forwarding cores according to the characteristics of different inner layer flow information, reducing the processing burden of the forwarding cores, avoiding the action of forwarding reentry, improving the throughput of network equipment and optimizing the message forwarding speed.
Referring to fig. 2, it is a processing flow chart of a message forwarding method in an exemplary embodiment of the present invention, where the method may be applied to a network device, and the method includes:
step 201, when a network card receives a first message which carries a first characteristic and is sent by a forwarding core, tunnel encapsulation is carried out on the first message;
in this embodiment, when the forwarding core receives a first message carrying a first feature, the first message may be sent to the network card, so that the network card adds a tunnel encapsulation to the first message, where the first feature is that an output port of the first message is a port of a tunnel. Specifically, when the forwarding core determines that the received message is a first message, table lookup forwarding is performed first, that is, an egress port corresponding to the first message is searched according to a destination address of the first message, and when it is found that the egress port of the first message is a port of a tunnel, it is described that the first message needs to be tunnel-encapsulated, so that it can be determined that the first message carries a first feature, and the forwarding core forwards the first message carrying the first feature to the network card.
Step 202, GRE encapsulation is performed on the first packet, and the encapsulated first packet is sent to a forwarding core, so that the forwarding core forwards the encapsulated first packet to an external network through a GRE tunnel;
in this embodiment, when the network card receives the first packet carrying the first feature, it is determined that the first packet needs to be tunnel-encapsulated, so that the network card may perform corresponding tunnel encapsulation on the first packet according to the tunnel type of the output port of the first packet, and forward the encapsulated first packet to the destination device through the corresponding tunnel.
In the prior art, the message is acquired to be encapsulated after the forwarding core is forwarded by looking up a table, and the encapsulated message needs to be forwarded by looking up the table again to acquire a tunnel exit port of the encapsulated message because the outer layer information of the message changes after the message is encapsulated, and then the encapsulated message is sent to the network card to be forwarded according to the tunnel exit port, so that the message in the prior art can be forwarded by looking up the table twice on the forwarding core; in the invention, the network card encapsulates the message, so that the output port of the message can be known, and therefore, when the network card forwards the encapsulated message, the encapsulated message can be directly forwarded to the output port without looking up the table again for forwarding, so that the invention can avoid the forwarding reentry process, further save the forwarding time of the message and improve the forwarding efficiency.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following further detailed description of the aspects of the present invention is provided. In the present invention, the tunnel encapsulation type may include multiple types, and the GRE type is taken as an example in this embodiment.
Taking the GRE networking shown in fig. 1 as an example, assuming that a message entering the switch a of 10.1.1.1/24 → 10.1.3.1/24 needs to perform GRE encapsulation service, the specific forwarding methods in the prior art and the present invention are respectively shown in fig. 3a and fig. 3 b:
referring to fig. 3a, it is a flow chart of a process of encapsulating a message in the prior art, where the process of encapsulating a message in the prior art includes two table lookup forwarding processes, where:
when the forwarding core of the switch a receives the message of 10.1.1.1/24 → 10.1.3.1/24, it can determine that the egress port of the message is a GRE port through table lookup forwarding, so that the message is subjected to encapsulation processing to obtain the message of 1.1.1.1 → 2.2.2.2, and because the information after the message is repackaged changes, the forwarding core will perform table lookup forwarding again on the 1.1.1.1 → 2.2.2 message after encapsulation, and then forward the message to the GRE tunnel through the network card.
Referring to fig. 3b, it is a processing flow chart of the packet encapsulation process of the present invention, and the packet encapsulation process of the present invention only has one table lookup forwarding flow, in this embodiment, in order to make the improvement of the present invention more obvious from the distinction of the prior art, the improved function in the network card is separately described as a module, which is a service module in fig. 3b, where:
when the forwarding core of the switch a receives the message of 10.1.1.1/24 → 10.1.3.1/24, it can determine that the egress port of the message is a GRE port through table lookup and forwarding, so it can be determined that the message carries the first feature, the message needs to be sent to the service module, the service module performs encapsulation processing on the message to obtain a message of 1.1.1.1 → 2.2.2, and then the encapsulated message of 1.1.1.1 → 2.2.2 is directly forwarded to the GRE tunnel by the network card.
From the GRE encapsulation service, the invention replaces the original retransmission process with larger performance consumption by using the single GRE service module, thereby saving the message processing time and improving the message transmission efficiency.
Referring to fig. 4, it is a processing flow chart of another packet forwarding method in an exemplary embodiment of the present invention, where the method may be applied to a network device, and the method includes:
step 401, when a second message received by a network card carries a second feature, acquiring inner layer flow information of the second message;
in this embodiment, when the network card receives the second message, it may be determined whether the second message carries the second feature. Specifically, when the network card receives the second message, it identifies whether the protocol class of the second message is the protocol type corresponding to the tunnel encapsulation, and if so, it indicates that the second message needs to be de-tunneled, it determines that the second message carries the second feature. After determining that the second message carries the second feature, the network card may obtain the inner layer flow information of the second message, where the inner layer flow information may be part or all of the information of the inner layer message of the second message, and the inner layer flow information may include a source IP address and a destination IP address of the inner layer message, or information such as a source MAC address, a destination MAC address, or a protocol type of the inner layer message.
Step 402, the network card allocates the second packet to a corresponding forwarding core according to the characteristics of the inner layer flow information, so that the packets with the characteristics of different inner layer flow information are allocated to different forwarding cores, so that the forwarding cores perform tunnel decapsulation on the second packet, and forward the decapsulated second packet to a destination device.
In this embodiment, the network card may allocate the second packet to a corresponding forwarding core according to the characteristics of the inner layer flow information, so that packets with different characteristics of the inner layer flow information are allocated to different forwarding cores.
It should be noted that the characteristics of the inner layer flow information are identifiers for different types of inner layer flow partitions according to a predetermined partitioning method, for example, if the inner layer flow is partitioned according to a source IP address, the source IP address is the characteristics of the inner layer flow information; if the inner layer flow is divided according to the source MAC address, the source MAC address is the characteristic of the inner layer flow information; if the inner layer flow is divided according to the hash algorithm, the hash value of the message is the characteristic of the inner layer flow information; if the inner layer stream is divided according to the protocol type, the protocol type of the packet is the characteristic of the inner layer stream information, which is only an exemplary description, and the specific implementation method may be determined according to the actual needs, which is not limited in the present invention.
The network card can distribute the second message encapsulated with different inner layer messages to different forwarding cores for processing according to the characteristics of different inner layer flow information, so that the forwarding cores de-tunnel-encapsulate the second message, and forward the de-encapsulated second message to the destination device.
Therefore, the invention can lead the plurality of forwarding cores to de-encapsulate and forward different inner layer flows in parallel, compared with the prior art, the invention can distribute the forwarding cores according to the flows to the message before de-encapsulating, thereby achieving the effect that the message in the same tunnel is distributed to the plurality of forwarding cores for concurrent processing and improving the throughput performance. And the forwarding reentry action is reduced, and the forwarding efficiency is also improved.
In addition, the network card can also calculate the offset of the tunnel package according to the inner layer flow information or the package information of the message; and then sending the offset to the forwarding core so that the forwarding core directly de-tunnels the second message according to the offset, thereby avoiding the forwarding core from calculating the offset and de-encapsulating by using the offset provided by the network card, and therefore improving the de-encapsulation speed of the forwarding core.
In order to make the objects, technical solutions and advantages of the present invention more apparent, the following further detailed description of the aspects of the present invention is provided. In the present invention, the tunnel encapsulation type may include multiple types, and the GRE type is taken as an example in this embodiment.
Taking the GRE networking shown in fig. 1 as an example, assuming that a message of 1.1.1.1 → 2.2.2.2 enters the switch B and needs to perform GRE decapsulation service, the specific forwarding methods in the prior art and the present invention are respectively shown in fig. 5a and fig. 5B:
referring to fig. 5a, it is a processing flow chart of packet decapsulation in the prior art, where the decapsulation of a packet in the prior art includes two table lookup forwarding flows, where:
a first forwarding process: when the switch B receives the message 1.1.1.1 → 2.2.2.2, the network card may allocate the received message 1.1.1.1 → 2.2.2 to the forwarding core in a flow-by-flow manner, and since the message is not decapsulated at present, the message is a flow, and thus the message is allocated with one forwarding core, that is, the forwarding core 1. The forwarding core 1 may decapsulate the packet to obtain an inner layer packet, where the inner layer packet obtained by decapsulation in this embodiment is multiple packets of 10.1.1.1/24 → 10.1.3.1/24, and then because the source and destination addresses of the decapsulated inner layer packet are no longer 1.1.1.1 → 2.2.2.2, that is, the source and destination addresses are changed, the forwarding core 1 further needs to perform table lookup forwarding again on the packet of 10.1.1.1/24 → 10.1.3.1/24.
And a second forwarding process: the forwarding core 1 performs table lookup on the 10.1.1.1/24 → 10.1.3.1/24 inner layer packet again and forwards the inner layer packet to the network device corresponding to the destination IP address of the inner layer packet.
Referring to fig. 5b, which is a processing flow diagram of packet decapsulation according to the present invention, a packet decapsulation process according to the present invention has only one forwarding flow, in this embodiment, in order to make the improvement of the present invention more obvious from the prior art, an improved function in a network card is separately described as a module, which is a service module in fig. 5b, where:
when the switch B receives the message of 1.1.1.1 → 2.2.2.2, the network card can identify the protocol type of the received message of 1.1.1.1 → 2.2.2.2, and because the protocol type of the message is GRE type, the inner layer flow information of the message can be acquired; the network card driver forwards the message of 1.1.1.1 → 2.2.2.2 and the inner layer flow information of the message to the service module, the service module allocates the messages with different characteristics to different forwarding cores according to the characteristics for identifying the inner layer flow information, for example, the service module identifies the characteristics of N pieces of inner layer flow information, and allocates the first message corresponding to the first characteristic to the forwarding core 1 for processing; distributing a second message corresponding to the second characteristic to a forwarding core 2 for processing; in an optional implementation, the offset may be forwarded to the corresponding forwarding core along with the packet, or of course, the offset may also be carried in a control packet between the forwarding core and the network card, and the offset is sent to the corresponding forwarding core, so that after receiving the packet and the offset, the forwarding core directly performs tunnel decapsulation on the packet according to the offset, and then different forwarding cores forward the decapsulated inner layer packet to the network device corresponding to the destination IP address of the inner layer packet by looking up the table.
In the decapsulation processing flow, the invention can determine each forwarding core corresponding to the inner layer message through the characteristics of the inner layer flow information in the decapsulation process, so that different types of inner layer messages are sent to different forwarding cores for decapsulation and forwarding, thereby achieving the effect that the same GRE tunnel flow is allocated to a plurality of forwarding cores for concurrent processing. Therefore, forwarding reentrant actions are reduced, and the effect of improving throughput performance is achieved through concurrent processing.
Based on the same conception, the invention also provides a message forwarding device, which can be realized by software, or by hardware or a combination of the software and the hardware. Taking software implementation as an example, the message forwarding device of the present invention is a device in a logical sense, and is operated after a CPU of the device in which the message forwarding device is located reads a corresponding computer program instruction in a memory.
Referring to fig. 6a, a message forwarding apparatus 600 in an exemplary embodiment of the present invention is applied to a network device, the basic operating environment of the apparatus includes a processor, a memory, a network card and other hardware, and from a logic level, a logic structure of the apparatus 600 is as shown in fig. 6b, where the logic structure includes:
a first receiving unit 601, configured to perform tunnel encapsulation on a first message when a network card receives the first message that is sent by a forwarding core and carries a first feature;
the first forwarding unit 602 is configured to forward, by the network card, the encapsulated first packet to the destination device through the tunnel corresponding to the tunnel encapsulation.
As an embodiment, the first characteristic is that a destination egress port of the first packet is a port of the tunnel.
Referring to fig. 7a, another message forwarding apparatus 700 according to an exemplary embodiment of the present invention is applied to a network device, and the basic operating environment of the apparatus includes a processor, a memory, a network card and other hardware, and from a logic level, the logical structure of the apparatus 700 is as shown in fig. 7b, where the logical structure includes:
a second receiving unit 701, configured to obtain inner layer flow information of a second message received by the network card when the second message carries a second feature;
a second forwarding unit 702, configured to allocate, by the network card, the second packet to a corresponding forwarding core according to the characteristics of the inner layer flow information, so that the packets with the characteristics of different inner layer flow information are allocated to different forwarding cores, so that the forwarding cores de-tunnel and encapsulate the second packet, and forward the de-encapsulated second packet to the destination device.
As an embodiment, the second characteristic is that a protocol type of the second packet is a protocol type corresponding to tunnel encapsulation.
As an embodiment, the apparatus further comprises:
a calculating unit 703, configured to calculate an offset of the tunnel encapsulation; and sending the offset to the forwarding core so that the forwarding core performs tunnel de-encapsulation on the second message according to the offset.
In summary, the present invention can enable the network card to perform tunnel encapsulation on a first message sent by a forwarding core when the first message carries a first feature; the network card forwards the first encapsulated message to the destination device through the tunnel corresponding to the tunnel encapsulation, so that the message encapsulation process can be realized through the network card, the action of forwarding and reentry is avoided, and the message forwarding rate is optimized. The invention can also obtain the inner layer flow information of the second message when the second message received by the network card carries the second characteristic; the network card distributes the second message to corresponding forwarding cores according to the characteristics of the inner layer flow information, so that messages with different characteristics of the inner layer flow information are distributed to different forwarding cores, the forwarding cores perform tunnel decapsulation on the second message, and the decapsulated second message is forwarded to a destination device. The invention can identify the inner layer flow information of the message before the message is unpacked through the network card, thereby distributing different forwarding cores according to the characteristics of different inner layer flow information, reducing the processing burden of the forwarding cores, avoiding the action of forwarding reentry, improving the throughput of network equipment and optimizing the message forwarding speed.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, and the units described as separate parts may or may not be physically separate, and parts displayed as units may or may not be physical units, may be located in one place, or may be distributed on a plurality of network units. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The above description is only for the purpose of illustrating the preferred embodiments of the present invention and is not to be construed as limiting the invention, and any modifications, equivalents, improvements and the like made within the spirit and principle of the present invention should be included in the scope of the present invention.

Claims (4)

1. A message forwarding method is applied to a network device, and the method comprises the following steps:
when a second message received by a network card carries a second characteristic, acquiring inner layer flow information of the second message, wherein the second characteristic is that the protocol type of the second message is a protocol type corresponding to tunnel encapsulation;
the network card distributes the second message to corresponding forwarding cores according to the characteristics of the inner layer flow information, so that messages with different characteristics of the inner layer flow information are distributed to different forwarding cores, the forwarding cores perform tunnel decapsulation on the second message, and the decapsulated second message is forwarded to a destination device.
2. The method of claim 1, further comprising:
calculating the offset of the tunnel encapsulation;
and sending the offset to the forwarding core so that the forwarding core performs tunnel de-encapsulation on the second message according to the offset.
3. A message forwarding apparatus, wherein the apparatus is applied to a network device, and the apparatus comprises:
the second receiving unit is configured to acquire inner layer flow information of a second message when the second message received by the network card carries a second characteristic, where the second characteristic is that a protocol type of the second message is a protocol type corresponding to tunnel encapsulation;
and the second forwarding unit is used for the network card to distribute the second message to the corresponding forwarding cores according to the characteristics of the inner layer flow information, so that messages with different characteristics of the inner layer flow information are distributed to different forwarding cores, the forwarding cores perform tunnel decapsulation on the second message, and forward the decapsulated second message to the destination device.
4. The apparatus of claim 3, further comprising:
the computing unit is used for computing the offset of the tunnel encapsulation; and sending the offset to the forwarding core so that the forwarding core performs tunnel de-encapsulation on the second message according to the offset.
CN201811005588.4A 2018-08-30 2018-08-30 Message forwarding method and device Active CN108737239B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811005588.4A CN108737239B (en) 2018-08-30 2018-08-30 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811005588.4A CN108737239B (en) 2018-08-30 2018-08-30 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN108737239A CN108737239A (en) 2018-11-02
CN108737239B true CN108737239B (en) 2021-08-24

Family

ID=63941725

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811005588.4A Active CN108737239B (en) 2018-08-30 2018-08-30 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN108737239B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN115174482B (en) * 2019-05-21 2023-06-02 超聚变数字技术有限公司 Message distribution method and device of network equipment
CN111654474B (en) * 2020-05-19 2022-11-01 杭州迪普科技股份有限公司 Safety detection method and device
CN113518025B (en) * 2021-05-31 2023-04-25 新华三信息安全技术有限公司 Message management method, device, equipment and machine-readable storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9264330B2 (en) * 2013-10-13 2016-02-16 Nicira, Inc. Tracing host-originated logical network packets
CN106656724A (en) * 2016-12-20 2017-05-10 上海优刻得信息科技有限公司 Message encapsulation method and equipment
CN107612840A (en) * 2017-09-26 2018-01-19 东软集团股份有限公司 A kind of data processing method and device of four-layer load-equalizing equipment
CN107979535A (en) * 2017-10-31 2018-05-01 新华三技术有限公司 Message forwarding method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101964749A (en) * 2010-09-21 2011-02-02 北京网康科技有限公司 Message retransmission method and system based on multi-core architecture

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US9264330B2 (en) * 2013-10-13 2016-02-16 Nicira, Inc. Tracing host-originated logical network packets
CN106656724A (en) * 2016-12-20 2017-05-10 上海优刻得信息科技有限公司 Message encapsulation method and equipment
CN107612840A (en) * 2017-09-26 2018-01-19 东软集团股份有限公司 A kind of data processing method and device of four-layer load-equalizing equipment
CN107979535A (en) * 2017-10-31 2018-05-01 新华三技术有限公司 Message forwarding method and device

Also Published As

Publication number Publication date
CN108737239A (en) 2018-11-02

Similar Documents

Publication Publication Date Title
US10684885B2 (en) Port mirroring in a virtualized computing environment
US10142127B2 (en) Methods and systems to offload overlay network packet encapsulation to hardware
US10237177B2 (en) Transfer device and transfer system
CN112422393B (en) Method for transmitting message of extensible virtual local area network, computer equipment and readable medium
US11979322B2 (en) Method and apparatus for providing service for traffic flow
US10673650B2 (en) Programmable tunnel creation for hardware-based packet processing
CN107872542B (en) Data transmission method and network equipment
US8351352B1 (en) Methods and apparatus for RBridge hop-by-hop compression and frame aggregation
US11729300B2 (en) Generating programmatically defined fields of metadata for network packets
CN113326228B (en) Message forwarding method, device and equipment based on remote direct data storage
CN108737239B (en) Message forwarding method and device
US10616105B1 (en) Extending virtual routing and forwarding using source identifiers
US10601610B2 (en) Tunnel-level fragmentation and reassembly based on tunnel context
JP2021129300A (en) Method, device, and system for forwarding packet in hybrid network
CN110311860B (en) Multilink load balancing method and device under VXLAN
WO2015113410A1 (en) Data packet processing method and apparatus
US9819587B1 (en) Indirect destination determinations to forward tunneled network packets
EP4160950A1 (en) Method and apparatus for sending message, and network device, system and storage medium
WO2013148048A1 (en) Systems and methods for modifying network packets to use unrecognized headers/fields for packet classification and forwarding
US20220393908A1 (en) Message Encapsulation Method and Apparatus, and Message Decapsulation Method and Apparatus
CN106992918B (en) Message forwarding method and device
CN108075991B (en) Message forwarding method and device
CN109246016B (en) Cross-VXLAN message processing method and device
US10887234B1 (en) Programmatic selection of load balancing output amongst forwarding paths
CN108156066B (en) Message forwarding 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
GR01 Patent grant
GR01 Patent grant