CN115118655A - Cross-network message forwarding method and device, electronic equipment and readable storage medium - Google Patents

Cross-network message forwarding method and device, electronic equipment and readable storage medium Download PDF

Info

Publication number
CN115118655A
CN115118655A CN202210709183.9A CN202210709183A CN115118655A CN 115118655 A CN115118655 A CN 115118655A CN 202210709183 A CN202210709183 A CN 202210709183A CN 115118655 A CN115118655 A CN 115118655A
Authority
CN
China
Prior art keywords
network
vrf
message
gateway node
virtual
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.)
Granted
Application number
CN202210709183.9A
Other languages
Chinese (zh)
Other versions
CN115118655B (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.)
Alibaba China Co Ltd
Original Assignee
Alibaba China 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 Alibaba China Co Ltd filed Critical Alibaba China Co Ltd
Priority to CN202210709183.9A priority Critical patent/CN115118655B/en
Publication of CN115118655A publication Critical patent/CN115118655A/en
Application granted granted Critical
Publication of CN115118655B publication Critical patent/CN115118655B/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/58Association of routers
    • H04L45/586Association of routers of virtual routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • H04L45/745Address table lookup; Address filtering

Abstract

The embodiment of the specification provides a cross-network message forwarding method, which is applied to a first gateway node; the method comprises the following steps: receiving a communication message sent by a first host in the first virtual subnet to a second host in the second virtual subnet; acquiring message characteristics of the communication message, and matching the acquired message characteristics with a matching rule maintained on the first gateway node and used for determining a VRF instance corresponding to the communication message so as to determine a target VRF instance matched with the communication message from the VRF instances; and inquiring a routing table item corresponding to the communication message in a VRF routing table corresponding to the target VRF instance, and forwarding the communication message to the second host in the second virtual subnet based on the inquired routing table item. Through the technical scheme, the defects in the traditional VRF method can be overcome, the VRF configuration is more flexible, the cross-network forwarding of the communication message can be realized, and the user networking experience is improved.

Description

Cross-network message forwarding method and device, electronic equipment and readable storage medium
Technical Field
The present disclosure relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet across a network, an electronic device, and a readable storage medium.
Background
Virtual Routing Forwarding (VRF) technology can virtually create multiple independent Virtual routers on one physical router, and each Virtual router has its own Routing table, so that data or service isolation can be realized by the VRF technology.
However, if a user constructs a virtual network based on multiple different physical networks, because routing network segments of the different physical networks may have conflicts, multiple VRFs need to be created on a gateway node to interface the different physical networks, at this time, an entry of a user packet is unique, and an exit corresponds to the multiple VRFs, then when packet forwarding is performed across the physical networks, because the conventional VRF technology can only be divided according to a physical interface or a vlan interface of a device, one entry determines one VRF, and the multiple VRFs cannot be distinguished, so that the conventional method for determining the VRF according to the port cannot find the correct VRF.
Disclosure of Invention
In view of this, one or more embodiments of the present disclosure provide a method, an apparatus, an electronic device, and a readable storage medium for forwarding a packet across a network, so as to solve the problems in the related art.
To achieve the above object, one or more embodiments of the present disclosure provide the following technical solutions:
according to a first aspect of embodiments of the present specification, a cross-network packet forwarding method is provided, in which a virtual network obtained by performing network virtualization on a plurality of physical networks is accessed to the plurality of physical networks through a gateway node; wherein the virtual networks include a first virtual subnet and a second virtual subnet, the first virtual subnet accesses a first physical network of the plurality of physical networks through a first gateway node, and the second virtual subnet accesses a second physical network of the plurality of physical networks through a second gateway node; a plurality of VRF instances respectively corresponding to the plurality of physical networks are respectively maintained on the first gateway node and the second gateway node; the method is applied to the first gateway node; the method comprises the following steps:
receiving a communication message sent by a first host in the first virtual subnet to a second host in the second virtual subnet;
acquiring message characteristics of the communication message, and matching the acquired message characteristics with a matching rule which is maintained on the first gateway node and is used for determining a VRF instance corresponding to the communication message, so as to determine a target VRF instance matched with the communication message from the VRF instances;
and inquiring a routing table item corresponding to the communication message in a VRF routing table corresponding to the target VRF instance, and forwarding the communication message to the second host in the second virtual subnet based on the inquired routing table item.
According to a second aspect of the embodiments of the present specification, there is provided a cross-network packet forwarding apparatus, which performs network virtualization on a plurality of physical networks to obtain a virtual network, and accesses the plurality of physical networks through a gateway node; wherein the virtual networks include a first virtual subnet and a second virtual subnet, the first virtual subnet accesses a first physical network of the plurality of physical networks through a first gateway node, and the second virtual subnet accesses a second physical network of the plurality of physical networks through a second gateway node; a plurality of VRF instances respectively corresponding to the plurality of physical networks are respectively maintained on the first gateway node and the second gateway node; the apparatus is applied to the first gateway node; the device comprises:
the receiving module is used for receiving a communication message sent by a first host in the first virtual subnet to a second host in the second virtual subnet;
the first matching module is used for acquiring the message characteristics of the communication message, matching the acquired message characteristics with the matching rule which is maintained on the first gateway node and used for determining the VRF instance corresponding to the communication message, and determining a target VRF instance matched with the communication message from the VRF instances;
and the forwarding module is used for inquiring a routing table item corresponding to the communication message in a VRF routing table corresponding to the target VRF instance, and forwarding the communication message to the second host in the second virtual subnet based on the inquired routing table item.
According to a third aspect of embodiments herein, there is provided an electronic device, including a communication interface, a processor, a memory, and a bus, where the communication interface, the processor, and the memory are connected to each other through the bus;
the memory stores machine-readable instructions, and the processor executes the method by calling the machine-readable instructions.
According to a fourth aspect of embodiments herein, there is provided a machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, carry out the above-mentioned method.
The technical scheme provided by the embodiment of the specification can have the following beneficial effects:
by the technical scheme, the message characteristics of the communication message are matched with the matching rules to determine the target VRF instance corresponding to the communication message, so that the decoupling of the VRF routing table and the physical port or the vlan interface is realized, the defect that the VRF instance must be bound with the physical port or the vlan interface in the traditional VRF method is overcome, and the VRF configuration is more flexible. And according to the routing table items inquired from the VRF table corresponding to the matched target VRF instance, cross-network forwarding of the communication message between the virtual subnets accessed to different physical networks can be realized, and networking experience of a user is improved.
Drawings
Fig. 1 is a schematic diagram of a conventional VRF method provided in an exemplary embodiment of the present description;
fig. 2 is a flowchart of a cross-network message forwarding method according to an exemplary embodiment of the present disclosure;
fig. 3 is a schematic diagram of a virtual network networking according to an exemplary embodiment of the present disclosure;
fig. 4 is a schematic structural diagram of a first gateway node according to an exemplary embodiment of the present disclosure;
fig. 5 is a schematic diagram illustrating an implementation of cross-network packet forwarding based on a programmable network device according to an exemplary embodiment of the present disclosure;
fig. 6 is a schematic structural diagram of an electronic device where a cross-network message forwarding apparatus is located according to an exemplary embodiment of the present specification;
fig. 7 is a block diagram of an inter-network packet forwarding apparatus according to an exemplary embodiment of the present disclosure.
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 implementations described in the following exemplary embodiments do not represent all implementations consistent with one or more embodiments of the present specification. Rather, they are merely examples of apparatus and methods consistent with certain aspects of one or more embodiments of the specification, as detailed in the claims which follow.
It should be noted that: in other embodiments, the steps of the corresponding methods are not necessarily performed in the order shown and described herein. In some other embodiments, the method may include more or fewer steps than those described herein. Moreover, a single step described in this specification may be broken down into multiple steps for description in other embodiments; multiple steps described in this specification may be combined into a single step in other embodiments.
Referring to fig. 1, fig. 1 is a schematic diagram of a conventional VRF method according to an exemplary embodiment of the present disclosure. As shown in fig. 1, a single routing device Router has access to network1 and network2, and the same network segment 2.2.2.0/24 exists in both network1 and network 2. Assuming that the PC1 is required to access only network1, and the PC2 is required to access only network2, since the routing device will use the interfaces interface2 and interface4 as the outlets of the network number 2.2.2.0/24 under the condition that no VRF is created, when the routing device receives the message of the PC1 or PC2 accessing the destination network 2.2.2.0/24, the message will be routed to the wrong network.
By creating VRFs, as shown in fig. 1, VRFs 1 and VRF1 are created on the routing device, interface1 and interface2 are bound into VRF1, and interface3 and interface4 are bound into VRF2, so that each VRF has its own independent routing table, which is equivalent to isolating a single routing device into multiple routing devices for use, and different VRFs are independent from each other.
After creating the VRF, after the routing device receives the packet that the PC1 enters from the interface1, the packet may be forwarded to the interface3 according to the routing table of the VRF1, and the packet from the PC2 is forwarded to the interface4 according to the routing table of the VRF 2.
It can be seen that the conventional VRF technology can solve the routing problem when a single routing device accesses a plurality of mutually independent networks, and the conventional VRF technology is currently widely applied to various routing switching devices on the market.
However, as can be seen from the foregoing, the conventional VRF technology can only be divided according to the physical interface of the device or the vlan interface, and cannot solve the problem that when a user constructs a virtual network on the basis of a plurality of different physical networks, a packet is forwarded across the physical networks.
In view of this, the present specification provides a technical solution for determining a target VRF instance corresponding to a communication packet by matching packet features of the communication packet with matching rules, and implementing cross-network forwarding of the communication packet between virtual subnetworks accessed to different physical networks according to a routing table entry queried in a VRF table corresponding to the matched target VRF instance.
During implementation, a communication message sent by a first host in the first virtual subnet to a second host in the second virtual subnet may be received;
the virtual network obtained by network virtualization of a plurality of physical networks can be accessed to the plurality of physical networks through a gateway node; wherein the virtual networks include a first virtual subnet and a second virtual subnet, the first virtual subnet accesses a first physical network of the plurality of physical networks through a first gateway node, and the second virtual subnet accesses a second physical network of the plurality of physical networks through a second gateway node; a plurality of VRF instances respectively corresponding to the plurality of physical networks are respectively maintained on the first gateway node and the second gateway node;
then, the message characteristics of the communication message can be acquired, and the acquired message characteristics are matched with a matching rule maintained on the first gateway node and used for determining a VRF instance corresponding to the communication message, so that a target VRF instance matched with the communication message is determined from the VRF instances;
for example, a quintuple feature of the communication packet may be acquired, the acquired quintuple feature may be matched with a matching rule maintained on the first gateway node and used for determining a VRF instance corresponding to the communication packet, and a target VRF instance matched with the communication packet may be determined from a plurality of VRF instances maintained by the first gateway node.
Then, a routing table entry corresponding to the communication packet may be queried in a VRF routing table corresponding to the target VRF instance, and the communication packet is forwarded to the second host in the second virtual subnet based on the queried routing table entry;
for example, whether a routing table entry corresponding to the communication packet exists in a VRF routing table corresponding to the target VRF instance may be queried, and if so, the communication packet is forwarded to the second host in the second virtual subnet based on the queried routing table entry, thereby implementing cross-network packet forwarding.
By the technical scheme, the message characteristics of the communication message are matched with the matching rules to determine the target VRF instance corresponding to the communication message, so that the decoupling of the VRF routing table and the physical port or the vlan interface is realized, the defect that the VRF instance must be bound with the physical port or the vlan interface in the traditional VRF method is overcome, and the VRF configuration is more flexible. And according to the routing table entry inquired in the VRF table corresponding to the matched target VRF instance, cross-network forwarding of the communication message between virtual subnets accessed to different physical networks can be realized, and user networking experience is improved.
The cross-network message forwarding method of the present specification is described in detail below with reference to the accompanying drawings.
Referring to fig. 2, fig. 2 is a flowchart of a cross-network packet forwarding method provided in an exemplary embodiment of the present disclosure, and is applied to a first gateway node. The virtual network obtained by network virtualization of a plurality of physical networks can be accessed to the physical networks through a gateway node; the virtual networks comprise a first virtual subnet and a second virtual subnet, the first virtual subnet accesses a first physical network of the plurality of physical networks through a first gateway node, and the second virtual subnet accesses a second physical network of the plurality of physical networks through a second gateway node; a plurality of VRF instances are maintained on the first gateway node and the second gateway node, respectively, corresponding to the plurality of physical networks, respectively.
As shown in fig. 2, the method comprises the following steps:
step 201, receiving a communication message sent by a first host in the first virtual subnet to a second host in the second virtual subnet;
step 202, obtaining message characteristics of the communication message, and matching the obtained message characteristics with matching rules maintained on the first gateway node for determining a VRF instance corresponding to the communication message, so as to determine a target VRF instance matched with the communication message from the multiple VRF instances;
step 203, querying a routing table entry corresponding to the communication packet in a VRF routing table corresponding to the target VRF instance, and forwarding the communication packet to the second host in the second virtual subnet based on the queried routing table entry.
For better explaining the present solution, the following description is made with reference to fig. 2 and fig. 3, and fig. 3 is a schematic diagram of a virtual network networking provided in an exemplary embodiment of the present specification.
In this embodiment, a virtual network may be obtained by performing network virtualization on a plurality of physical networks, and the simulated virtual network accesses the plurality of physical networks through the gateway node.
The virtual network comprises a first virtual subnet and a second virtual subnet, the first virtual subnet accesses a first physical network of the plurality of physical networks through a first gateway node, and the second virtual subnet accesses a second physical network of the plurality of physical networks through a second gateway node.
The network virtualization is a virtualization technology, and a physical network can be virtualized into a plurality of independent virtual networks through the network virtualization, or an independent virtual network can be created on the basis of a plurality of physical networks. Common Network virtualization technologies may include Virtual Local Area Network (VLAN) technology, Virtual eXtensible Local Area Network (VXLAN) technology, Virtual Private Network (VPN) technology, and the like.
For example, as shown in fig. 3, it is assumed that three tenants use the networking service of the virtual network, and virtual subnets of each tenant participating in networking are distributed on mutually independent physical networks, and each virtual subnet accesses to a different physical network through a gateway node.
Taking tenant 1 as an example, the virtual network of tenant 1 includes virtual subnet 1-1, virtual subnet 1-2 and virtual subnet 1-3, virtual subnet 1-1 accesses physical network1 through gateway node 1, virtual subnet 1-2 accesses physical network2 through gateway node 2, and virtual subnet 1-3 accesses physical network 4 through gateway node 4.
Wherein a plurality of VRF instances respectively corresponding to the plurality of physical networks are maintained on the first gateway node and the second gateway node, respectively.
For example, as shown in fig. 3, the gateway node 1 maintains a plurality of VRF instances corresponding to a plurality of physical networks, and the packet received by the gateway node 1 may be forwarded to different physical networks according to the VRF instances 1 to 4 maintained by the gateway node 1. The packet may be forwarded to the physical network2, for example according to VRF instance 1.
It should be noted that the first gateway node is not specifically referred to, but is a gateway node that sends a communication packet to a second host when the first gateway node is used as the communication packet sent by the first host to the second host, and similarly, the second gateway node is a gateway node that receives the communication packet received by the second host.
In an embodiment shown, the physical network is an underlay network, and the virtual network is an overlay network created by network virtualization of the underlay network.
The overlay network and the underlay network are a group of relative concepts, the underlay network is a physical network formed by interconnecting a plurality of types of physical equipment, is responsible for data packet transmission among networks, and is the bottom physical foundation of the overlay network. In an underlay network, the interconnected devices may be various types of switches, routers, load balancing devices, firewalls, etc., but the connectivity of the IP must be ensured by routing protocols between the various devices. In addition, the underlay network may be a two-layer network or a three-layer network, which is not limited in this specification.
And the overlay network is a logical network created by network virtualization of the underlay network. In an overlay network, an overlay topology may be formed between devices through logical links. And data transmission is carried out between the interconnected overlay devices through establishing a tunnel.
For example, assuming that physical network2 in fig. 3 may be an underlay network, virtual subnets 1-2 and 2-2 (representing virtual subnets in the virtual network of tenant 2) may be overlay networks created by network virtualization of the underlay network.
In an embodiment shown, the virtual network is a virtual cloud network simulated for tenants of a cloud service, which is obtained by performing network virtualization on a plurality of physical networks.
For example, a cloud service provider can perform network virtualization on a plurality of remote high-quality physical networks to obtain a simulated virtual cloud network, thereby implementing a cross-regional virtual cloud service and providing high-quality remote networking for tenants.
In one embodiment, the plurality of physical networks correspond to different operator networks.
For example, the physical networks may be operator networks provided by network operators such as mobile, telecommunication, internet access, etc., respectively, and when a user constructs a virtual network on multiple physical networks, the virtual network spans multiple network operators.
Assuming that different physical networks in fig. 3 may correspond to different operator networks, virtual subnets constructed based on different physical networks are distributed on different operator networks. As can be seen from the foregoing, the conventional VRF technology cannot solve the routing problem when networking is performed across multiple network operators, but can solve the routing problem based on the embodiments in this specification, so as to provide a high-quality service for constructing a virtual network across operators for users.
In step 201, a communication packet sent by a first host in the first virtual subnet to a second host in the second virtual subnet may be received.
For example, as shown in fig. 3, the host 1 in the virtual subnet 1-1 can send a communication packet to the host 2 in the virtual subnet 1-2, and the communication packet is forwarded by the gateway node 1 by sending the communication packet to the gateway node 1.
As can be seen from the foregoing, when the host 1 in the virtual subnet 1-1 can send a communication packet to the host 2 in the virtual subnet 1-2, the communication packet needs to be forwarded according to the routing table of the VRF instance 1, and in the virtual network networking scenario in fig. 3, the virtual subnet of the tenant 1 has more than one egress interface, so that the method for determining the VRF by relying on the physical interface or the vlan interface in the conventional VRF technology cannot be applied to the virtual network networking scenario.
In step 202, after receiving the communication packet, the first gateway node may obtain a packet feature of the communication packet, and then match the obtained packet feature with a matching rule maintained on the first gateway node and used for determining a VRF instance corresponding to the communication packet, so as to determine a target VRF instance matched with the communication packet from multiple VRF instances.
For example, as shown in fig. 3, after the gateway node 1 receives the communication packet from the host 1, the gateway node 1 may obtain a packet feature of the communication packet, and then match the obtained packet feature with a matching rule maintained on the gateway node 1 and used for determining a VRF instance corresponding to the communication packet.
For example, assuming that the obtained packet features are the destination IP, the matching rule may be as shown in table 1 below:
TABLE 1
Matching items Target VRF instances
Destination IP1-5 VRF example 1
Destination IP6-10 VRF example 2
Destination IP11-15 VRF example 3
Destination IP16-20 VRF example 4
Then, when the message feature of the communication message acquired by the gateway node 1 is the destination IP3, a destination VRF instance matched with the communication message may be determined from the multiple VRF instances according to the matching rule in table 1, and is the VRF instance 1.
In the above-mentioned VRF example, the VRF routing table, the interface associated with the VRF, and the management information of the VRF may be included separately.
In addition, if the target VRF instance matched with the communication message is not determined in the matching rule for determining the VRF instance corresponding to the communication message, the communication message may be forwarded according to a default routing table maintained on the first gateway node.
In step 203, after determining the target VRF instance, a routing table entry corresponding to the communication packet may be queried in a VRF routing table corresponding to the target VRF instance, and the communication packet may be forwarded to the second host in the second virtual subnet based on the queried routing table entry.
For example, assuming that the determined target VRF instance is VRF instance 1, the routing table entry corresponding to the communication packet may be queried in the VRF routing table corresponding to VRF instance 1.
Continuing with the example, assume that VRF instance 1 corresponds to a VRF routing table as shown in table 2 below:
TABLE 2
Numbering Network number Protocol Outlet interface Next hop
1 Destination IP1 Protocol 1 Interface3 Next hop address 1
2 Destination IP2 Protocol 1 Interface3 Next hop address 2
3 Destination IP3 Protocol 2 Interface3 Next hop address 3
4 Destination IP4 Protocol 3 Interface3 Next hop address 4
5 Destination IP5 Protocol 3 Interface3 Next hop address 5
Then, when the message characteristic of the communication message is the destination IP3, according to the above-mentioned VRF routing table corresponding to the target VRF instance 1, that is, table 2, the routing table entry corresponding to the communication message may be determined to be the routing table entry numbered 3, and according to the routing table entry, the communication message may be forwarded to the second host in the second virtual subnet.
In addition, if no routing table entry corresponding to the communication packet is found in the VRF routing table corresponding to the target VRF instance, the communication packet may be forwarded according to a default routing table maintained on the first gateway node.
In an embodiment shown, in response to a received routing update packet, the routing update packet may be matched with a matching rule maintained at the first gateway node and used for determining a VRF instance corresponding to the routing update packet, so as to determine, from the multiple VRF instances, a VRF instance matched with the routing update packet, and update a VRF routing table corresponding to the VRF instance according to the routing update packet.
The route update message may be a route update message generated by a static route configured by a user, or may be a route update message generated by a common routing protocol, such as BGP, OSPF, ISIS, and the like, which is not limited in this specification.
In an example, after the gateway node 1 receives the route update packet, the matching rule for determining the VRF instance corresponding to the route update packet may be demarked according to the next hop address recorded in the route update packet. And if the VRF instance which is determined from the plurality of VRF instances and matched with the route updating message is the VRF instance 1, updating the VRF routing table corresponding to the VRF instance 1 according to the route updating message.
In addition, if the VRF instance matching the route update packet is not determined in the matching rule for determining the VRF instance corresponding to the route update packet, the default routing table maintained on the first gateway node may be updated according to the route update packet.
In one illustrated embodiment, the matching rules include matching rules created based on corresponding network characteristics of the plurality of different operator networks.
For example, when the virtual network is built on top of networks of different network operators, the matching rules may be created according to network characteristics corresponding to the different operator networks. Further, when receiving route update messages corresponding to different operator networks, the route update messages can be updated to the VRF routing table corresponding to the operator networks according to the matching rules.
When creating the matching rule according to the network characteristics corresponding to different operator networks, the matching rule for determining the VRF instance corresponding to the communication packet may be created, or the matching rule for determining the VRF instance corresponding to the route update packet may be created.
In one embodiment shown, the matching rule for determining the VRF instance corresponding to the communication packet is based on network characteristics at least including five-tuple information; the matching rule for determining the VRF instance corresponding to the routing update message is based on the network characteristics at the time of creation and at least comprises a protocol number of a routing update protocol.
In one example, the matching rule for determining the VRF instance corresponding to the communication packet may be created based on five-tuple information corresponding to different operator networks.
In another example, the matching rule for determining the VRF instance corresponding to the route update message may be created based on the protocol number of the route update protocol corresponding to the different operator network. For example, for the BGP protocol, the matching rule may be matched according to the AS number of the BGP protocol to determine the VRF routing table corresponding to the route update packet.
In one embodiment shown, the first gateway node comprises an access switch device connected downstream to the first virtual sub-network; and a programmable network device in upstream connection with the first physical network; the plurality of VRF instances are maintained on the programmable network device.
Taking the gateway node 1 in fig. 3 as an example, please refer to fig. 4, and fig. 4 is a schematic structural diagram of a first gateway node provided in an exemplary embodiment of the present description, as shown in fig. 4, the gateway node 1 may include an access switch device and a programmable network device. The access switch device is connected with each virtual subnet in a downlink mode, the programmable network device is connected with the physical network1 in an uplink mode, and a plurality of VRF instances are maintained on the programmable network device.
In one illustrated embodiment, the programmable network device comprises an SNA device.
The SNA (Smart Network application) equipment is an integrated high-performance Network platform which integrates programmable switching capacity and ultra-strong computing power.
By the technical scheme, the message characteristics of the communication message are matched with the matching rules to determine the target VRF instance corresponding to the communication message, so that the decoupling of the VRF routing table and the physical port or the vlan interface is realized, the defect that the VRF instance must be bound with the physical port or the vlan interface in the traditional VRF method is overcome, and the VRF configuration is more flexible. And according to the routing table items inquired from the VRF table corresponding to the matched target VRF instance, cross-network forwarding of the communication message between the virtual subnets accessed to different physical networks can be realized, and networking experience of a user is improved.
It should be noted that the above-mentioned cross-network packet forwarding method applied to the first gateway node may also be applied to a programmable network device in the first gateway node, and the development and customization may be performed according to the self-requirement through the programmable network device, so that different packets and forwarding logics may be customized for different requirements and different scenarios.
For example, based on the programmable network device, the user may configure the VRF instance, and may set a matching rule maintained on the gateway node for determining the VRF instance corresponding to the communication packet and a matching rule for determining the VRF instance corresponding to the route update packet.
Referring to fig. 5, fig. 5 is a schematic diagram illustrating implementation of cross-network packet forwarding based on a programmable network device according to an exemplary embodiment of the present disclosure, as shown in fig. 5, when implementing cross-network packet forwarding based on a programmable network device, the cross-network packet forwarding may be logically divided into two major parts, namely a control plane and a data plane, where the control plane is mainly responsible for issuing a configuration of a user to the data plane to support normal operation of the data plane, and the data plane is mainly responsible for processing a communication packet.
When the data plane forwards the communication message, the method may include the following steps:
step S501, receiving a communication message.
As can be seen from the foregoing, the communication packet may be a communication packet sent by a first host in a first virtual subnet to a second host in a second virtual subnet.
Step S502, the message characteristics of the communication message are matched with the matching rules in the strategy matching module.
The user can set a matching rule for determining the VRF instance corresponding to the communication message through a user configuration module of the control plane, and the matching rule is sent to a strategy matching module of the data plane so that the strategy matching module matches the matching rule in the strategy matching module according to the message characteristics of the communication message when receiving the communication message.
In step S503, if the matching is successful, a target VRF instance matching the communication packet may be determined from the multiple VRF instances.
Wherein, a user can create a plurality of VRF instances through a user configuration module of the control plane.
It is worth to be noted that, because the scheme overcomes the disadvantage that the conventional VRF technology can only divide the VRF according to the physical interface or the vlan interface of the device, the physical interface or the vlan interface does not need to be bound when the VRF instance is created.
If the matching fails, the communication message can be forwarded according to a default routing table located on the data plane.
In step S504, after the target VRF instance is determined, a routing table entry corresponding to the communication packet may be queried in a VRF routing table corresponding to the target VRF instance.
It should be noted that the VRF routing table may also be updated according to the routing update message, for example, a routing table entry in the VRF routing table is added, deleted, or changed.
The route update message may be a route update message generated by a static route configured by a user, or may be a route update message generated by a common routing protocol, such as BGP, OSPF, ISIS, and the like.
It should be noted that, when receiving the route update message, the route update message may be first matched with the matching rule in the route message agent module located at the control plane, and if the matching is successful, the VRF routing table corresponding to the route update message may be updated according to the route update message; if the matching fails, the default routing table on the data plane can be updated according to the routing update message.
The matching rule in the routing message agent module of the control plane may be configured by a user through a user configuration module of the control plane.
As can be seen from the foregoing, the matching rules in either the policy matching module or the routing message broker module can be created based on the corresponding network characteristics of a plurality of different operator networks.
The network characteristics based on which the matching rules are used for determining the VRF instances corresponding to the communication messages at least comprise quintuple information; and the matching rule is used for determining the VRF instance corresponding to the routing updating message, and the network characteristics based on when the VRF instance is created at least comprise the protocol number of the routing updating protocol.
Step S505, if the query is successful, the communication packet is forwarded to the second host in the second virtual subnet based on the queried routing table entry.
If the query fails, the communication message can be forwarded according to a default routing table.
It should be noted that the programmable network device applying the method is located in the virtual network networking scenario described above, and for the detailed implementation process of the step S501 to the step S505, reference may be made to the foregoing description, which is not described herein again.
In an exemplary embodiment of the present specification, there is also provided an apparatus capable of implementing the above method.
FIG. 6 is a schematic block diagram of an apparatus provided in an exemplary embodiment. Referring to fig. 6, at the hardware level, the apparatus includes a processor 602, an internal bus 604, a network interface 606, a memory 608 and a non-volatile memory 610, but may also include hardware required for other services. One or more embodiments of the present description may be implemented in software, such as by processor 602 reading a corresponding computer program from non-volatile memory 610 into memory 609 and then executing. Of course, besides software implementation, the one or more embodiments in this specification do not exclude other implementations, such as logic devices or combinations of software and hardware, and so on, that is, the execution subject of the following processing flow is not limited to each logic unit, and may also be hardware or logic devices.
Referring to fig. 7, in a software implementation, a cross-network packet forwarding apparatus 700 is provided and applied to a first gateway node. The virtual network obtained by network virtualization of a plurality of physical networks can be accessed to the physical networks through a gateway node; the virtual networks comprise a first virtual subnet and a second virtual subnet, the first virtual subnet accesses a first physical network of the plurality of physical networks through a first gateway node, and the second virtual subnet accesses a second physical network of the plurality of physical networks through a second gateway node; a plurality of VRF instances are maintained on the first gateway node and the second gateway node, respectively, corresponding to the plurality of physical networks, respectively.
As shown in fig. 7, the apparatus includes:
a receiving module 701, configured to receive a communication packet sent by a first host in the first virtual subnet to a second host in the second virtual subnet;
a first matching module 702, configured to obtain a packet feature of the communication packet, and match the obtained packet feature with a matching rule maintained on the first gateway node and used to determine a VRF instance corresponding to the communication packet, so as to determine, from the multiple VRF instances, a target VRF instance matched with the communication packet;
the forwarding module 703 queries a routing table entry corresponding to the communication packet in a VRF routing table corresponding to the target VRF instance, and forwards the communication packet to the second host in the second virtual subnet based on the queried routing table entry.
Optionally, the physical network is an underlay network, and the virtual network is an overlay network created by network virtualization of the underlay network.
Optionally, the virtual network is a virtual cloud network simulated by a tenant of a cloud service, which is obtained by performing network virtualization on a plurality of physical networks.
Optionally, the plurality of physical networks respectively correspond to different operator networks.
Optionally, the apparatus 700 further includes:
the second matching module 704, in response to the received route update packet, matches the route update packet with a matching rule maintained at the first gateway node and used for determining a VRF instance corresponding to the route update packet, so as to determine, from the multiple VRF instances, a VRF instance matched with the route update packet, and update, according to the route update packet, a VRF routing table corresponding to the VRF instance.
Optionally, the matching rule includes a matching rule created based on network characteristics corresponding to the plurality of different operator networks.
Optionally, the network feature based on when creating the matching rule used for determining the VRF instance corresponding to the communication packet at least includes five tuple information; the matching rule for determining the VRF instance corresponding to the routing update message is based on the network characteristics at the time of creation and at least comprises a protocol number of a routing update protocol.
Optionally, the first gateway node includes an access switch device connected downstream to the first virtual subnet; and a programmable network device in upstream connection with the first physical network; the plurality of VRF instances are maintained on the programmable network device.
Optionally, the programmable network device includes an SNA device.
The specific implementation process of the functions and actions of each module in the apparatus 700 is detailed in the implementation process of the corresponding step in the cross-network message forwarding method, and relevant points may refer to part of the description of the method embodiment, which is not described herein again.
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 modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the units or modules can be selected according to actual needs to achieve the purpose of the solution in the specification. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
In a typical configuration, a computer includes one or more processors (CPUs), input/output interfaces, network interfaces, and memory.
The memory may include forms of volatile memory in a computer readable medium, Random Access Memory (RAM) and/or non-volatile memory, such as Read Only Memory (ROM) or flash memory (flash RAM). Memory is an example of a computer-readable medium.
Computer-readable media, including both permanent and non-permanent, removable and non-removable media, may implement the information storage by any method or technology. The information may be computer readable instructions, data structures, modules of a program, or other data. Examples of computer storage media include, but are not limited to, phase change memory (PRAM), Static Random Access Memory (SRAM), Dynamic Random Access Memory (DRAM), other types of Random Access Memory (RAM), Read Only Memory (ROM), Electrically Erasable Programmable Read Only Memory (EEPROM), flash memory or other memory technology, compact disc read only memory (CD-ROM), Digital Versatile Disks (DVD) or other optical storage, magnetic cassettes, magnetic disk storage, quantum memory, graphene-based storage media or other magnetic storage devices, or any other non-transmission medium, that may be used to store information that may be accessed by a computing device. As defined herein, a computer readable medium does not include a transitory computer readable medium such as a modulated data signal and a carrier wave.
It should also be noted that 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 an … …" does not exclude the presence of other like elements in a process, method, article, or apparatus that comprises the element.
The foregoing description has been directed to specific embodiments of this disclosure. Other embodiments are within the scope of the following claims. In some cases, the actions or steps recited in the claims may be performed in a different order than in the embodiments and still achieve desirable results. In addition, the processes depicted in the accompanying figures do not necessarily require the particular order shown, or sequential order, to achieve desirable results. In some embodiments, multitasking and parallel processing may also be possible or may be advantageous.
The terminology used in the description of the one or more embodiments is for the purpose of describing the particular embodiments only and is not intended to be limiting of the description of the one or more embodiments. As used in one or more embodiments of the present specification 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 should be understood that although the terms first, second, third, etc. may be used in one or more embodiments of the present description 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 one or more embodiments herein. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
The above description is only for the purpose of illustrating the preferred embodiments of the one or more embodiments of the present disclosure, and is not intended to limit the scope of the one or more embodiments of the present disclosure, and any modifications, equivalent substitutions, improvements, etc. made within the spirit and principle of the one or more embodiments of the present disclosure should be included in the scope of the one or more embodiments of the present disclosure.

Claims (12)

1. A cross-network message forwarding method is characterized in that a virtual network obtained by network virtualization of a plurality of physical networks is accessed to the physical networks through gateway nodes; wherein the virtual networks include a first virtual subnet and a second virtual subnet, the first virtual subnet accesses a first physical network of the plurality of physical networks through a first gateway node, and the second virtual subnet accesses a second physical network of the plurality of physical networks through a second gateway node; a plurality of VRF instances respectively corresponding to the plurality of physical networks are respectively maintained on the first gateway node and the second gateway node; the method is applied to the first gateway node; the method comprises the following steps:
receiving a communication message sent by a first host in the first virtual subnet to a second host in the second virtual subnet;
acquiring message characteristics of the communication message, and matching the acquired message characteristics with a matching rule which is maintained on the first gateway node and is used for determining a VRF instance corresponding to the communication message, so as to determine a target VRF instance matched with the communication message from the VRF instances;
and inquiring a routing table item corresponding to the communication message in a VRF routing table corresponding to the target VRF instance, and forwarding the communication message to the second host in the second virtual subnet based on the inquired routing table item.
2. The method of claim 1, the physical network being an underlay network, the virtual network being an overlay network created by network virtualization of the underlay network.
3. The method of claim 1, wherein the virtual network is a virtual cloud network simulated by tenants of a cloud service by network virtualization of a plurality of physical networks.
4. The method of claim 1, the plurality of physical networks each corresponding to a different operator network.
5. The method of claim 1, further comprising:
and responding to the received route updating message, matching the route updating message with a matching rule which is maintained on the first gateway node and is used for determining a VRF instance corresponding to the route updating message, so as to determine the VRF instance matched with the route updating message from the VRF instances, and updating a VRF routing table corresponding to the VRF instance according to the route updating message.
6. The method of claim 5, the matching rules comprising matching rules created based on corresponding network characteristics of the plurality of different operator networks.
7. The method of claim 6, wherein the matching rule for determining the VRF instance corresponding to the communication packet is based on network characteristics including at least five tuple information;
and the matching rule for determining the VRF instance corresponding to the routing update message is created based on network characteristics at least comprising a protocol number of a routing update protocol.
8. The method of claim 1, the first gateway node comprising an access switch device downstream connected to the first virtual subnet; and a programmable network device connected upstream to the first physical network; the plurality of VRF instances are maintained on the programmable network device.
9. The method of claim 8, the programmable network device comprising an SNA device.
10. A cross-network message forwarding device is used for performing network virtualization on a plurality of physical networks to obtain a virtual network, and accessing the plurality of physical networks through a gateway node; wherein the virtual networks include a first virtual subnet and a second virtual subnet, the first virtual subnet accesses a first physical network of the plurality of physical networks through a first gateway node, and the second virtual subnet accesses a second physical network of the plurality of physical networks through a second gateway node; a plurality of VRF instances respectively corresponding to the plurality of physical networks are respectively maintained on the first gateway node and the second gateway node; the apparatus is applied to the first gateway node; the device comprises:
the receiving module is used for receiving a communication message sent by a first host in the first virtual subnet to a second host in the second virtual subnet;
the first matching module is used for acquiring the message characteristics of the communication message, matching the acquired message characteristics with a matching rule which is maintained on the first gateway node and is used for determining a VRF instance corresponding to the communication message, and determining a target VRF instance matched with the communication message from the VRF instances;
and the forwarding module is used for inquiring a routing table item corresponding to the communication message in a VRF routing table corresponding to the target VRF instance, and forwarding the communication message to the second host in the second virtual subnet based on the inquired routing table item.
11. An electronic device, comprising:
a processor;
a memory for storing processor-executable instructions;
wherein the processor implements the method of any one of claims 1-9 by executing the executable instructions.
12. A machine-readable storage medium having stored thereon machine-readable instructions which, when executed by a processor, implement the steps of the method of any one of claims 1-9.
CN202210709183.9A 2022-06-21 2022-06-21 Cross-network message forwarding method and device, electronic equipment and readable storage medium Active CN115118655B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202210709183.9A CN115118655B (en) 2022-06-21 2022-06-21 Cross-network message forwarding method and device, electronic equipment and readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202210709183.9A CN115118655B (en) 2022-06-21 2022-06-21 Cross-network message forwarding method and device, electronic equipment and readable storage medium

Publications (2)

Publication Number Publication Date
CN115118655A true CN115118655A (en) 2022-09-27
CN115118655B CN115118655B (en) 2023-12-12

Family

ID=83327636

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202210709183.9A Active CN115118655B (en) 2022-06-21 2022-06-21 Cross-network message forwarding method and device, electronic equipment and readable storage medium

Country Status (1)

Country Link
CN (1) CN115118655B (en)

Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110110370A1 (en) * 2009-11-12 2011-05-12 Cisco Technology, Inc. Compressed virtual routing and forwarding in a communications network
CN102739501A (en) * 2011-04-01 2012-10-17 中兴通讯股份有限公司 Message forwarding method in two or three layer virtual private network (VPN) and system thereof
CN103546380A (en) * 2013-11-05 2014-01-29 迈普通信技术股份有限公司 Message forwarding method and device based on strategy routing
US20140269700A1 (en) * 2013-03-12 2014-09-18 Dell Products L.P. Systems and methods for an extranet multicast virtual private network in a virtual routing and fowarding based customer edge device
US20160226766A1 (en) * 2015-01-30 2016-08-04 Khaldoon AL-ZOUBI Devices, systems and methods for service chains
CN106487695A (en) * 2015-08-25 2017-03-08 华为技术有限公司 A kind of data transmission method, virtual network managing device and data transmission system
CN107959611A (en) * 2016-10-17 2018-04-24 华为技术有限公司 A kind of method to E-Packet, apparatus and system
US10129144B1 (en) * 2016-06-27 2018-11-13 Amazon Technologies, Inc. Extending virtual routing and forwarding using source identifiers
CN111404811A (en) * 2020-03-16 2020-07-10 杭州迪普科技股份有限公司 Message forwarding method and device
US20210184970A1 (en) * 2019-12-16 2021-06-17 Vmware, Inc. Disambiguating traffic in networking environments with multiple virtual routing and forwarding (vrf) logical routers
US20210328917A1 (en) * 2020-04-16 2021-10-21 Juniper Networks, Inc. Tenant-based mapping for virtual routing and forwarding
CN113542112A (en) * 2020-04-20 2021-10-22 华为技术有限公司 Message forwarding method and network equipment
CN114095305A (en) * 2020-07-21 2022-02-25 华为技术有限公司 BIER message forwarding method, equipment and system
CN114221904A (en) * 2021-12-15 2022-03-22 锐捷网络股份有限公司 Message forwarding method, device and system

Patent Citations (14)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20110110370A1 (en) * 2009-11-12 2011-05-12 Cisco Technology, Inc. Compressed virtual routing and forwarding in a communications network
CN102739501A (en) * 2011-04-01 2012-10-17 中兴通讯股份有限公司 Message forwarding method in two or three layer virtual private network (VPN) and system thereof
US20140269700A1 (en) * 2013-03-12 2014-09-18 Dell Products L.P. Systems and methods for an extranet multicast virtual private network in a virtual routing and fowarding based customer edge device
CN103546380A (en) * 2013-11-05 2014-01-29 迈普通信技术股份有限公司 Message forwarding method and device based on strategy routing
US20160226766A1 (en) * 2015-01-30 2016-08-04 Khaldoon AL-ZOUBI Devices, systems and methods for service chains
CN106487695A (en) * 2015-08-25 2017-03-08 华为技术有限公司 A kind of data transmission method, virtual network managing device and data transmission system
US10129144B1 (en) * 2016-06-27 2018-11-13 Amazon Technologies, Inc. Extending virtual routing and forwarding using source identifiers
CN107959611A (en) * 2016-10-17 2018-04-24 华为技术有限公司 A kind of method to E-Packet, apparatus and system
US20210184970A1 (en) * 2019-12-16 2021-06-17 Vmware, Inc. Disambiguating traffic in networking environments with multiple virtual routing and forwarding (vrf) logical routers
CN111404811A (en) * 2020-03-16 2020-07-10 杭州迪普科技股份有限公司 Message forwarding method and device
US20210328917A1 (en) * 2020-04-16 2021-10-21 Juniper Networks, Inc. Tenant-based mapping for virtual routing and forwarding
CN113542112A (en) * 2020-04-20 2021-10-22 华为技术有限公司 Message forwarding method and network equipment
CN114095305A (en) * 2020-07-21 2022-02-25 华为技术有限公司 BIER message forwarding method, equipment and system
CN114221904A (en) * 2021-12-15 2022-03-22 锐捷网络股份有限公司 Message forwarding method, device and system

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
张宇巍;曾一;杨燕宁;: "基于VPP的虚拟路由器数据平面加速方法", 计算机系统应用, no. 10 *
李立;: "虚拟运营商BGP多线网络构建方案", 电子技术与软件工程, no. 17 *

Also Published As

Publication number Publication date
CN115118655B (en) 2023-12-12

Similar Documents

Publication Publication Date Title
US11563602B2 (en) Method and apparatus for providing a point-to-point connection over a network
US11303553B1 (en) Return path trace
US9253140B2 (en) System and method for optimizing within subnet communication in a network environment
EP3474502B1 (en) Reduced configuration for multi-stage network fabrics
CN109905251B (en) Network management method, device, electronic equipment and storage medium
US11102164B1 (en) Software defined networking operations for programmable connected devices
US10848432B2 (en) Switch fabric based load balancing
CN112970230B (en) Method and system for accessing cloud services
US10257086B2 (en) Source imposition of network routes in computing networks
US20220086025A1 (en) Flexible network interfaces as a framework for a network appliance
US20130151445A1 (en) Method and System for Survival of Data Plane Through a Total Control Plane Failure
CN112351034B (en) Firewall setting method, device, equipment and storage medium
WO2023125239A1 (en) Flood attack defense method and related device
CN113783781A (en) Method and device for interworking between virtual private clouds
CN110022263B (en) Data transmission method and related device
CN108259205B (en) Route publishing method and network equipment
US20200336385A1 (en) BGP Logical Topology Generation Method, and Device
EP3461079A1 (en) Path establishment method and device, and network node
CN110071872B (en) Service message forwarding method and device, and electronic device
WO2016173196A1 (en) Method and apparatus for learning address mapping relationship
CN115118655B (en) Cross-network message forwarding method and device, electronic equipment and readable storage medium
CN116016448A (en) Service network access method, device, equipment and storage medium
CN111641555A (en) Route convergence method and device
CN114301913B (en) Request processing method and system
WO2023169364A1 (en) Routing generation method and apparatus, and data message forwarding method and apparatus

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