CN113992584B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN113992584B
CN113992584B CN202111248595.9A CN202111248595A CN113992584B CN 113992584 B CN113992584 B CN 113992584B CN 202111248595 A CN202111248595 A CN 202111248595A CN 113992584 B CN113992584 B CN 113992584B
Authority
CN
China
Prior art keywords
routing table
vpn
table entry
message
target
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
CN202111248595.9A
Other languages
Chinese (zh)
Other versions
CN113992584A (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.)
New H3C Security Technologies Co Ltd
Original Assignee
New H3C Security 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 New H3C Security Technologies Co Ltd filed Critical New H3C Security Technologies Co Ltd
Priority to CN202111248595.9A priority Critical patent/CN113992584B/en
Publication of CN113992584A publication Critical patent/CN113992584A/en
Application granted granted Critical
Publication of CN113992584B publication Critical patent/CN113992584B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering
    • 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/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]

Landscapes

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

Abstract

The embodiment of the invention provides a message forwarding method and a device, which relate to the technical field of networks, receive a three-layer message to be forwarded, identify a target VPN to which the message belongs, search for a routing table item which can be used by the target VPN when the message is forwarded based on identification information of each routing table item recorded in a pre-established partial intercommunication routing table, wherein the partial intercommunication routing table records: routing table entries intercommunicated among the VPNs and identification information of each routing table entry, the identification information of each routing table entry indicates: selecting a routing table item matched with the target IP address recorded in the message from the searched routing table items by all VPNs capable of using the routing table item to forward the message; and forwarding the message based on the next hop address recorded in the selected routing table entry. The scheme provided by the embodiment of the invention can reduce the waste of the storage resources of the routing table entries in the network equipment.

Description

Message forwarding method and device
Technical Field
The present invention relates to the field of network technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
A Network device may be configured with different Virtual Private Networks (VPNs) with mutually isolated routes, and different Network forwarding functions are implemented by the different VPNs, where the Network device records route table entries that can be used by the different VPNs, and after receiving a three-layer packet to be forwarded, the VPN in the Network device may search a route table entry matching a destination IP address of the packet from the route table entries that can be used by the VPN, and forward the packet based on the searched route table entry. For example, when a network device is provided with a VPN1 and a VPN2, and a VPN1 can use a routing table entry 1 and a VPN2 can use a routing table entry 2, the network device stores a routing table entry 1 that can be used by the VPN1 and a routing table entry 2 that can be used by the VPN 2.
However, if the messages need to be forwarded between different VPNs, routing intercommunication between different VPNs is required, and therefore, a plurality of intercommunicated routing table entries need to be stored in the network device and correspond to different VPNs, so that after the messages are received by the different intercommunicated VPNs in the network device, the messages can be forwarded based on the intercommunicated routing table entries. For example, if the routes of the VPN1 and the VPN2 are intercommunicated, the switching chip may store the routing table entry 1 and the routing table entry 2 corresponding to the VPN1, the routing table entry 1 and the routing table entry 2 corresponding to the VPN2, and both the routing table entry 1 and the routing table entry 2 are stored in two parts. Therefore, the method in the prior art is adopted to forward the message, and the network device needs to store repeated routing table entries, thereby causing the waste of the storage resources of the routing table entries in the network device.
Disclosure of Invention
The embodiment of the invention aims to provide a message forwarding method and a message forwarding device so as to reduce the waste of routing table entry storage resources in network equipment. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present invention provides a packet forwarding method, where the method includes:
receiving a three-layer message to be forwarded;
identifying a target VPN to which the message belongs;
based on the identification information of each routing table entry recorded in a part of pre-established intercommunication routing table, searching for a routing table entry which can be used by a target VPN when the message is forwarded, wherein the intercommunication routing table records: routing table entries intercommunicated among the VPNs and identification information of each routing table entry, the identification information of each routing table entry indicates: all VPNs capable of using the routing table entry to forward the message;
selecting a routing table item matched with the target IP address recorded in the message from the searched routing table items;
and forwarding the message based on the next hop address recorded in the selected routing table entry.
In a second aspect, an embodiment of the present invention provides a packet forwarding apparatus, where the apparatus includes:
the message receiving module is used for receiving a three-layer message to be forwarded;
the VPN identification module is used for identifying a target VPN to which the message belongs;
a first table item searching module, configured to search, based on identification information of each routing table item recorded in a pre-created partial interworking routing table, a routing table item that can be used by a target VPN when forwarding a packet, where: the method comprises the following steps that routing table items communicated among a plurality of VPNs and identification information of each routing table item are displayed, and the identification information of each routing table item represents that: all VPNs capable of using the routing table entry to forward the message;
the table item selection module is used for selecting a routing table item matched with the target IP address recorded in the message from the searched routing table items;
and the message forwarding module is used for forwarding the message based on the next hop address recorded in the selected routing table entry.
The embodiment of the invention has the following beneficial effects:
the embodiment of the invention provides a message forwarding method, which is characterized in that after a three-layer message to be forwarded is received, a target VPN to which the message belongs is identified, and based on identification information which corresponds to each routing table entry recorded in a pre-established partial intercommunication routing table and represents all VPNs capable of using the routing table entry to forward the message, the routing table entries capable of being used by the target VPN when the message is forwarded are searched. And then selecting a routing table item matched with the destination IP address recorded in the message from the searched routing table items, thereby forwarding the message based on the next hop address recorded in the selected routing table item.
As can be seen from the above, in the embodiment of the present invention, for each routing table entry, identification information indicating all VPNs capable of using the routing table entry to forward a message is recorded, so that routing table entries capable of being used by a target VPN can be screened out based on the identification information of each routing table entry, and a message to be forwarded is forwarded by matching routing table entries with the screened routing table entries. Therefore, for each routing table entry, only one routing table entry needs to be stored in the network device, and each VPN using the routing table entry can search the routing table entry and further forward the packet based on the routing table entry. Therefore, in the solution provided in the embodiment of the present invention, for different routing table entries, the network device only needs to store one routing table entry to implement configuration of routing table entries of different VPNs, so as to reduce waste of routing table entry storage resources in the network device.
Drawings
In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present invention, and other drawings can be obtained by those skilled in the art according to the drawings.
Fig. 1 is a schematic flow chart of a first message forwarding method according to an embodiment of the present invention;
fig. 2 is a schematic flowchart of a second packet forwarding method according to an embodiment of the present invention;
fig. 3 is a schematic structural diagram of a first packet forwarding device according to an embodiment of the present invention;
fig. 4 is a schematic structural diagram of a second packet forwarding device according to an embodiment of the present invention.
Detailed Description
The technical solutions in the embodiments of the present invention will be clearly and completely described below with reference to the drawings in the embodiments of the present invention, and it is obvious that the described embodiments are only a part of the embodiments of the present invention, and not all of the embodiments. All other embodiments, which can be derived from the embodiments given herein by one of ordinary skill in the art, are within the scope of the invention.
Referring to fig. 1, a flowchart of a first message forwarding method provided in the embodiment of the present invention is schematically illustrated, where the method includes the following steps S101 to S105.
Specifically, the embodiment of the present invention may be applied to a network device, where a plurality of VPNs are configured in the network device, and route isolation exists between the plurality of VPNs.
S101: and receiving a three-layer message to be forwarded.
S102: and identifying the target VPN to which the message belongs.
Specifically, a Virtual Local Area Network (VLAN) to which the packet belongs may be determined, and a VPN belonging to the VLAN may be determined as a target VPN.
S103: based on the identification information of each routing table entry recorded in the pre-created partial intercommunication routing table, the routing table entry which can be used by the target VPN when the message is forwarded is searched.
Wherein, the part intercommunicating routing table records: the method comprises the following steps that routing table items communicated among a plurality of VPNs and identification information of each routing table item are displayed, and the identification information of each routing table item represents that: all VPNs capable of using the routing table entry to forward the message.
Specifically, a partial interworking routing table may be recorded in the switch chip, and each entry in the partial interworking routing table records a routing entry and identification information of the routing entry.
In an embodiment of the present invention, the identification information of each routing table entry may be traversed, and whether the destination VPN can use the routing table entry for packet forwarding is determined for each identification information, so as to determine the routing table entry that the destination VPN can use.
For each routing table entry, the identification information of the routing table entry may be a set of identifications of VPNs capable of using the routing table entry, and the identification of a VPN may be a number of a VPN, for example, a number 1 of a VPN1, a number 2 of a VPN2, and so on. If both VPN1 and VPN4 can use the routing table entry M, the identification information of the routing table entry M may be 1 and 4.
In addition, each bit in the identification information corresponds to each VPN configured in the network device one to one, and for each bit, if the value of the bit is a preset value, it indicates that the VPN corresponding to the bit can forward the packet using the routing table entry. The number of bits contained in the identification information is the same as the number of VPNs configured by the network device.
For example, the preset value may be 1, if the value of the bit is 1, it indicates that the VPN corresponding to the bit can use the routing table entry to forward the packet, and if the value of the bit is 0, it indicates that the VPN corresponding to the bit cannot use the routing table entry to forward the packet. The preset value may also be 0, if the value of the bit is 0, it indicates that the VPN corresponding to the bit can use the routing table entry to forward the packet, and if the value of the bit is 1, it indicates that the VPN corresponding to the bit cannot use the routing table entry to forward the packet.
If 8 VPNs are configured in the network device, the identification information may include 8 bits, and each bit may correspond to VPN1-VPN8 from back to front according to an arrangement order of each bit, and the preset value may be 1. If the first mask is "00000001", it indicates that the routing table entry corresponds to VPN1, and if the first mask is "00000101", it indicates that the routing table entry corresponds to VPN1 and VPN3, that is, VPN1 and VPN3 route interworking. If the first mask is "11111111", it indicates that the routing table entry corresponds to both VPN1 and VPN8, and the routing table entry is a routing table entry in a public VPN, and each VPN can use the routing table entry.
In an embodiment of the present invention, if the preset value is 1, the step S103 can be implemented by the following step a.
Step A: and respectively carrying out bitwise AND calculation on the identification of the target VPN and the identification information of each routing table item, and determining the routing table item with the calculation result of 1 as the routing table item which can be used by the target VPN when the message is forwarded.
The bit number contained in the identification of the target VPN is the same as the bit number contained in the identification information, the bit value of the target sequence in the identification of the target VPN is 1, the bit values of the positions except the target sequence are 0, and the target sequence is as follows: the corresponding order of the target VPNs in the identification information.
Specifically, since the value of the target ordered bit in the identifier of the target VPN is 1 and the values of the bits at other positions are 0, after performing bitwise and calculation on the identifier of the target VPN and the identification information of the routing table entry, if the value of the target ordered bit in the identification information is also 1, the calculation result is 1, and if the value of the target ordered bit in the identification information is 0, the calculation result is 0.
Therefore, if the calculation result is 1, it indicates that the value of the bit at the target sequence in the identification information is 1, which means that the VPN corresponding to the bit at the target sequence can use the routing table entry corresponding to the identification information. And respectively carrying out bitwise AND calculation on the identification of the target VPN and the identification information of each routing table item, wherein all the routing table items with the calculation result of 1 are routing table items which can be used by the target VPN when the message is forwarded.
Specifically, a Forwarding Information Base (FIB) table originally included in the switch chip may be multiplexed, each FIB entry in the FIB table is originally recorded with each routing entry configured in the network device, and one data item may be added to the FIB table for recording the identification Information, so that the FIB table is multiplexed into a partial interworking routing table.
S104: and selecting the routing table item matched with the destination IP address recorded in the message from the searched routing table items.
Specifically, the manner of selecting the routing table entry matching the target IP address recorded in the packet is the same as that in the prior art, and is not described herein again.
S105: and forwarding the message based on the next hop address recorded in the selected routing table entry.
Specifically, the packet may be forwarded to the next hop address recorded in the selected routing table entry.
As can be seen from the above, in the embodiment of the present invention, for each routing table entry, identification information indicating all VPNs capable of using the routing table entry to forward a message is recorded, so that routing table entries capable of being used by a target VPN can be screened out based on the identification information of each routing table entry, and a message to be forwarded is forwarded by matching routing table entries with the screened routing table entries. Therefore, for each routing table entry, only one routing table entry needs to be stored in the network device, and each VPN that can use the routing table entry can find the routing table entry and further forward the packet based on the routing table entry. Therefore, in the solution provided in the embodiment of the present invention, for different routing table entries, the network device only needs to store one routing table entry to implement configuration of routing table entries of different VPNs, so as to reduce waste of routing table entry storage resources in the network device.
Referring to fig. 2, which is a flowchart illustrating a second message forwarding method according to an embodiment of the present invention, in this embodiment, the method further includes step S106, where a routing table entry that can be used by the target VPN when forwarding the message is found in step S106, and after the routing table entry is found, the message may be forwarded based on steps S104 to S105.
S106: based on the VPN identification corresponding to each routing table entry recorded in the pre-created complete intercommunication routing table, the routing table entry which can be used by the target VPN when the message is forwarded is searched.
Wherein, the complete intercommunication routing table records: the VPN of the complete intercommunication routing table entries can use the routing table entries and the VPN identifications corresponding to the routing table entries, and the VPN identifications of the complete intercommunication routing table entries are the same.
Specifically, if all the routing table entries in the VPNs are intercommunicated, it is described that the routing table entries that can be used by the VPNs after the routing intercommunicated are completely the same. Therefore, in the embodiment of the present invention, the identifiers of the VPNs intercommunicated by the routing table entries are unified into the same identifier, the unified identifier may be referred to as a super VPN identifier, and the routing table entries and the identifiers of the VPNs corresponding to the routing table entries are recorded in the completely intercommunicated routing table entries. For the completely intercommunicated VPN, the completely intercommunicated routing table entry records a routing table entry that can be used by both completely intercommunicated VPNs, and a uniform identifier of the completely intercommunicated VPN indicates that the VPN identified as the recorded identifier can use the routing table entry.
Therefore, after the target VPN is determined, the identifier of the target VPN may be used as an index for searching for the routing table entry, and the routing table entry corresponding to the identifier is searched for, that is, the routing table entry that can be used by the target VPN. Since the identifiers of the completely intercommunicated VPNs are unified, no matter which VPN of the completely intercommunicated VPNs receives the message, the routing table entry can be found based on the unified identifier.
Specifically, the FIB table may be multiplexed as a complete interworking routing table entry.
The method comprises the steps that a routing table entry and an identification of a VPN capable of using the routing table entry are originally recorded in each table entry in an FIB table, and for the completely intercommunicated VPN, the identification of the completely intercommunicated VPN recorded in the FIB table is updated to be a unified identification of the VPN, so that the completely intercommunicated VPNs can use the routing table entries to carry out message forwarding.
As can be seen from the above, if the routing table entries of the communicated VPNs are communicated, the routing table entries that can be used by the VPNs are completely the same. Therefore, it is not necessary to separately record the VPNs capable of using the routing table items to forward the message for each routing table item, but directly unify the identifiers of the completely intercommunicated VPNs into the same identifier, and record the unified identifier of the VPNs corresponding to the routing table items in the completely intercommunicated routing table, and each routing table item is only stored once, so that it can be shown that the completely intercommunicated VPNs can use each routing table item. The network equipment does not need to record the routing table entry repeatedly, and the scheme provided by the embodiment of the invention can save the storage space for recording the routing table entry in the network equipment.
Corresponding to the message forwarding method, the embodiment of the invention also provides a message forwarding device.
Referring to fig. 3, a schematic structural diagram of a first packet forwarding device according to an embodiment of the present invention is shown, where the device includes:
a message receiving module 301, configured to receive a three-layer message to be forwarded;
a VPN identification module 302, configured to identify a target VPN to which the packet belongs;
a first table item searching module 303, configured to search, based on identification information of each routing table item recorded in a pre-created partial interworking routing table, a routing table item that can be used by a target VPN when forwarding a packet, where: routing table entries intercommunicated among the VPNs and identification information of each routing table entry, the identification information of each routing table entry indicates: all VPNs capable of using the routing table entry to forward the message;
a table item selecting module 304, configured to select a routing table item matching the destination IP address recorded in the packet from the found routing table items;
a message forwarding module 305, configured to forward the message based on the next hop address recorded in the selected routing table entry.
As can be seen from the above, in the embodiment of the present invention, for each routing table entry, identification information indicating all VPNs capable of using the routing table entry to forward a message is recorded, so that routing table entries capable of being used by a target VPN can be screened out based on the identification information of each routing table entry, and a message to be forwarded is forwarded by matching routing table entries with the screened routing table entries. Therefore, for each routing table entry, only one routing table entry needs to be stored in the network device, and each VPN using the routing table entry can search the routing table entry and further forward the packet based on the routing table entry. Therefore, in the solution provided in the embodiment of the present invention, for different routing table entries, the network device only needs to store one routing table entry to implement configuration of routing table entries of different VPNs, so as to reduce waste of routing table entry storage resources in the network device.
In an embodiment of the present invention, each bit in the identification information corresponds to each VPN configured in the network device one to one, and for each bit, if a value of the bit is a preset value, it indicates that the VPN corresponding to the bit can forward a packet using the routing table entry.
In an embodiment of the present invention, the preset value is 1, and the first table entry searching module 303 is specifically configured to:
respectively carrying out bitwise AND calculation on the identifier of the target VPN and the identification information of each routing table entry, and determining the routing table entry with the calculation result of 1 as the routing table entry which can be used by the target VPN in message forwarding, wherein the bit number contained in the identifier of the target VPN is the same as the bit number contained in the identification information, the value of the bit at the target sequence in the identifier of the target VPN is 1, the values of the bits at other positions except the target sequence are 0, and the target sequence is as follows: the corresponding order of the target VPNs in the identification information.
Referring to fig. 4, which is a schematic structural diagram of a second message forwarding apparatus according to an embodiment of the present invention, the apparatus further includes a second table entry searching module 306, configured to search a routing table entry that can be used by a target VPN when forwarding a message in the following manner
Based on the identifier of the VPN corresponding to each routing table entry recorded in the completely intercommunicating routing table created in advance, the routing table entry that can be used by the target VPN when forwarding the packet is searched, wherein the completely intercommunicating routing table records: the VPN of the complete intercommunication routing table entries can use the routing table entries and the VPN identifications corresponding to the routing table entries, and the VPN identifications of the complete intercommunication routing table entries are the same.
As can be seen from the above, if the routing table entries of the communicated VPNs are communicated, the routing table entries that can be used by the VPNs are completely the same. Therefore, it is not necessary to separately record the VPNs capable of using the routing table items to forward the message for each routing table item, but directly unify the identifiers of the completely intercommunicated VPNs into the same identifier, and record the unified identifier of the VPNs corresponding to the routing table items in the completely intercommunicated routing table, and each routing table item is only stored once, so that it can be shown that the completely intercommunicated VPNs can use each routing table item. The network equipment does not need to record the routing table entry repeatedly, and the scheme provided by the embodiment of the invention can save the storage space for recording the routing table entry in the network equipment.
Embodiments of the invention may be implemented, in whole or in part, by software, hardware, firmware, or any combination thereof. When implemented in software, it may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. The procedures or functions according to the embodiments of the invention are brought about in whole or in part when the computer program instructions are loaded and executed on a computer. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, the computer instructions may be transmitted from one website, computer, server, or data center to another website, computer, server, or data center by wire (e.g., coaxial cable, fiber optic, digital Subscriber Line (DSL)) or wirelessly (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., solid State Disk (SSD)), among others.
It should be noted that, in this document, 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. Also, 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 a … …" does not exclude the presence of another identical element in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, as for the apparatus embodiment, since it is substantially similar to the method embodiment, the description is relatively simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above are only preferred embodiments of the present invention, and are not intended to limit the scope of the present invention. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention shall fall within the protection scope of the present invention.

Claims (8)

1. A message forwarding method is characterized in that the method comprises the following steps:
receiving a three-layer message to be forwarded;
identifying a target Virtual Private Network (VPN) to which the message belongs;
based on the identification information of each routing table entry recorded in a pre-created partial intercommunication routing table, searching for a routing table entry which can be used by a target VPN when forwarding a message, wherein the partial intercommunication routing table records: routing table entries intercommunicated among the VPNs and identification information of each routing table entry, the identification information of each routing table entry indicates: all VPNs capable of using the routing table entry to forward the message;
selecting a routing table item matched with the target IP address recorded in the message from the searched routing table items;
and forwarding the message based on the next hop address recorded in the selected routing table entry.
2. The method of claim 1,
each bit in the identification information corresponds to each VPN configured in the network device one to one, and for each bit, if the value of the bit is a preset value, it indicates that the VPN corresponding to the bit can forward the packet using the routing table entry.
3. The method according to claim 2, wherein the preset value is 1, and the searching for the routing table entry that can be used by the target VPN in forwarding the packet based on the identification information of each routing table entry recorded in the pre-created partially interworking routing table comprises:
performing bitwise and calculation on the identifier of the target VPN and the identification information of each routing table entry respectively, and determining the routing table entry with the calculation result of 1 as a routing table entry which can be used by the target VPN when forwarding a packet, wherein the number of bits included in the identifier of the target VPN is the same as the number of bits included in the identification information, the value of the bit at the target sequence in the identifier of the target VPN is 1, the values of the bits at positions other than the target sequence are 0, and the target sequence is: and the corresponding sequence of the target VPN in the identification information.
4. The method according to any one of claims 1-3, further comprising;
searching a routing table entry which can be used by the target VPN when the message is forwarded by the following method:
based on the identifier of the VPN corresponding to each routing table entry recorded in a completely intercommunicated routing table created in advance, the routing table entry that can be used by the target VPN during message forwarding is searched, wherein the completely intercommunicated routing table records: the VPN of the complete intercommunication routing table entries can use the routing table entries and the VPN identifications corresponding to the routing table entries, and the VPN identifications of the complete intercommunication routing table entries are the same.
5. A message forwarding apparatus, the apparatus comprising:
the message receiving module is used for receiving a three-layer message to be forwarded;
a VPN identification module for identifying a target virtual private network VPN to which the message belongs;
a first table item searching module, configured to search, based on identification information of each routing table item recorded in a pre-created partial interworking routing table, a routing table item that can be used by a target VPN when forwarding a packet, where: routing table entries intercommunicated among the VPNs and identification information of each routing table entry, the identification information of each routing table entry indicates: all VPNs capable of using the routing table entry to forward the message;
the table item selection module is used for selecting a routing table item matched with the target IP address recorded in the message from the searched routing table items;
and the message forwarding module is used for forwarding the message based on the next hop address recorded in the selected routing table entry.
6. The apparatus of claim 5, wherein:
each bit in the identification information corresponds to each VPN configured in the network device one to one, and for each bit, if the value of the bit is a preset value, it indicates that the VPN corresponding to the bit can use the routing table entry to forward the packet.
7. The apparatus according to claim 6, wherein the preset value is 1, and the first table entry lookup module is specifically configured to:
performing bitwise and calculation on the identifier of the target VPN and the identification information of each routing table entry respectively, and determining the routing table entry with the calculation result of 1 as a routing table entry which can be used by the target VPN when forwarding a packet, wherein the number of bits included in the identifier of the target VPN is the same as the number of bits included in the identification information, the value of the bit at the target sequence in the identifier of the target VPN is 1, the values of the bits at positions other than the target sequence are 0, and the target sequence is: and the corresponding sequence of the target VPN in the identification information.
8. The apparatus according to any of claims 5-7, wherein the apparatus further comprises a second table entry lookup module configured to lookup a routing table entry that the target VPN can use for packet forwarding
Based on the identifier of the VPN corresponding to each routing table entry recorded in a completely intercommunicated routing table created in advance, the routing table entry that can be used by the target VPN when forwarding the packet is searched, wherein the completely intercommunicated routing table records: the VPN of the complete intercommunication routing table entries can use the routing table entries and the VPN identifications corresponding to the routing table entries, and the VPN identifications of the complete intercommunication routing table entries are the same.
CN202111248595.9A 2021-10-26 2021-10-26 Message forwarding method and device Active CN113992584B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202111248595.9A CN113992584B (en) 2021-10-26 2021-10-26 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202111248595.9A CN113992584B (en) 2021-10-26 2021-10-26 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN113992584A CN113992584A (en) 2022-01-28
CN113992584B true CN113992584B (en) 2023-03-21

Family

ID=79741715

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202111248595.9A Active CN113992584B (en) 2021-10-26 2021-10-26 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN113992584B (en)

Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209644A (en) * 2016-07-25 2016-12-07 杭州迪普科技有限公司 A kind of message forwarding method based on equal-cost route and device
CN108965137A (en) * 2018-07-20 2018-12-07 新华三技术有限公司 A kind of message processing method and device

Family Cites Families (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN104488235B (en) * 2013-04-09 2017-08-04 华为技术有限公司 Message forwarding method and the network equipment
CN104092684B (en) * 2014-07-07 2017-10-03 新华三技术有限公司 A kind of OpenFlow agreements support VPN method and apparatus
CN104486229B (en) * 2014-12-24 2017-09-29 迈普通信技术股份有限公司 A kind of method and apparatus for realizing the forwarding of VPN message
CN107113241B (en) * 2015-12-31 2020-09-04 华为技术有限公司 Route determining method, network configuration method and related device
CN109995634B (en) * 2017-12-29 2021-08-17 中兴通讯股份有限公司 Bearing method and equipment for multicast virtual private network
CN109412952B (en) * 2018-12-13 2019-09-06 北京华三通信技术有限公司 Route information publishing method and device

Patent Citations (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106209644A (en) * 2016-07-25 2016-12-07 杭州迪普科技有限公司 A kind of message forwarding method based on equal-cost route and device
CN108965137A (en) * 2018-07-20 2018-12-07 新华三技术有限公司 A kind of message processing method and device

Also Published As

Publication number Publication date
CN113992584A (en) 2022-01-28

Similar Documents

Publication Publication Date Title
US9686194B2 (en) Adaptive multi-interface use for content networking
JP4885819B2 (en) Communication device
US9467423B2 (en) Network label allocation method, device, and system
EP1909437B1 (en) A method for forwarding service of the data communication device and the forwarding apparatus
CN103023773B (en) Method, device and system for forwarding message in multi-topology network
JP2004140776A (en) Frame transfer method for network and frame transfer program
CN110505621B (en) Terminal migration processing method and device
CN103546380A (en) Message forwarding method and device based on strategy routing
US10404598B1 (en) Managing next hop groups in routers
CN106803809B (en) Message forwarding method and device
CN108494686A (en) Route processing method and device
CN116782336A (en) Communication method and device
CN113992584B (en) Message forwarding method and device
CN113472699A (en) Network table item synchronization method and device
CN113395206B (en) Route determining method, device and network equipment
US11223499B2 (en) Interconnecting networks operating different types of control planes
CN109039902B (en) Method and device for forwarding multicast message
CN103428085A (en) Method and device for rapidly switching RIP (routing information protocol) routings
US10333830B2 (en) Passive routing in mesh network
CN101146035B (en) Label switching path routing search method and system
US7487256B2 (en) Dynamic management method for forwarding information in router having distributed architecture
JP3822595B2 (en) Label switching network, route server, and label edge router
CN102075435A (en) Routing issuing method and device
US6775288B1 (en) Identifying soft permanent virtual circuits
US7423974B2 (en) Disabling mutually recursive routes

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