Method and equipment for limiting forwarding across VPN (Virtual Private Network) loops
By setting loopback VLAN tags and searching for appropriate routing and forwarding items in the VPN routing and forwarding table, the cross-VPN loop forwarding problem between VPNs is solved, device bandwidth consumption and routing loop issues are avoided, and business stability and cost savings are achieved. .
Patent Information
- Application Number
- CN202410678319.3
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-05-29
- Publication Date
- 2024-09-20
- Estimated Expiration
- 2044-05-29
AI Technical Summary
Route learning problems between VPNs lead to continuous loops in cross-VPN forwarding, consuming device bandwidth and making it difficult to locate and resolve.
By setting the loopback initial VLAN, loopback intermediate VLAN and loopback termination VLAN, the source virtual private network VPN instance is identified based on the access circuit of the data packet, and the appropriate routing and forwarding table entry is found in the routing forwarding table to determine the datagram. The packets carry double-layer VLAN tags and data packets are sent through the loopback interface to avoid loop forwarding.
It effectively avoids the bandwidth consumed by VPN routing loops within the device, ensures business stability, and reduces the labor costs required to locate and solve routing loop problems.
Smart Images

Figure CN118677831A
Abstract
Description
Technical Field
[0001] The present application relates to communication technology, and more specifically to a method and device for limiting cross-VPN loop forwarding. Background Art
[0002] Virtual Private Network (VPN) technology uses public networks to establish a dedicated data communication network with strong access isolation to meet the network virtualization needs of large-scale networks, remote interconnection and other business scenarios. It interconnects the same departments, groups, and businesses; it isolates different departments, groups, and business logics. VPN resources cannot be accessed by terminals in other VPNs in the network, providing a secure and reliable connection to ensure data transmission.
[0003] However, in certain business scenarios, it is necessary to establish communication between different VPNs to achieve resource sharing or specific business needs. The service provider edge device (PE) sets a static route in the routing table of the source VPN, and the destination address of the static route is the host address or network segment in the destination VPN, the next hop is the destination VPN, and the outbound interface is the loopback interface. In this way, the PE device loops back the data message sent to the destination VPN host through the loopback port according to the static route, and then continues to search for the matching next hop in the destination VPN routing table, and sends the data message forwarded across VPNs to the next hop of the destination VPN.
[0004] However, when there is a problem with the PE device configuration or the route learning between VPNs, the PE device can dynamically generate a default route entry as a cross-VPN loop route, and add the default route to the routing forwarding table, resulting in a cross-VPN forwarding loop. As a result, the PE device loops back the data packets sent to the destination VPN host through the loopback port according to the static route, and finds in the destination VPN routing table that the next hop of the default route is the source VPN. In this way, the data packets forwarded across VPNs are repeatedly forwarded between the two VPNs, forming a continuous loop. Summary of the invention
[0005] The purpose of the present application is to provide a method and device for limiting cross-VPN loop forwarding, so as to avoid VPN loop routing consuming device bandwidth without restriction.
[0006] To achieve the above-mentioned purpose, the present application provides a method for limiting cross-VPN loop forwarding, the method comprising: setting a loopback initial VLAN virtual local area network, a loopback intermediate VLAN, and a loopback termination VLAN; identifying a source virtual private network VPN instance based on an access circuit AC of a data message; finding a first routing forwarding table entry in a routing forwarding table of the source VPN instance based on a destination IP address of the data message; wherein the next hop of the first routing forwarding table entry is the destination VPN instance and the outgoing interface is a loopback interface; determining that the data message carries a double-layer VLAN tag; setting the inner layer customer VLAN tag of the data message as the loopback initial VLAN tag; and sending the data message through the loopback interface.
[0007] To achieve the above purpose, the present application also provides a device for limiting cross-VPN loop forwarding, which includes a setting module and a forwarding module. The setting module is used to set a loopback initial VLAN virtual local area network, a loopback intermediate VLAN, and a loopback termination VLAN; the forwarding module is used to identify the source virtual private network VPN instance based on the access circuit AC of the data message; based on the destination IP address of the data message, find the first routing forwarding table entry in the routing forwarding table of the source VPN instance; wherein the next hop of the first routing forwarding table entry is the destination VPN instance and the outgoing interface is the loopback interface; determine that the data message carries a double-layer VLAN tag; set the inner customer VLAN tag of the data message to the loopback initial VLAN tag; and send the data message through the loopback interface.
[0008] The beneficial effect of the present application is that it effectively avoids the device bandwidth consumed by the VPN routing loop inside the device, ensures business stability, and on the other hand, does not require a lot of manpower costs to locate, analyze, and solve the routing loop problem. BRIEF DESCRIPTION OF THE DRAWINGS
[0009] Figure 1 Shown is a flow chart of an embodiment of a method for limiting cross-VPN loop forwarding provided by the present application;
[0010] Figure 2A-2B A schematic diagram of a routing forwarding table that causes a VPN routing loop in a PE device provided in an embodiment of the present application;
[0011] Figure 3A-3B A schematic diagram of adding an inner VLAN tag to limit the number of cross-VPN loop forwarding times provided in an embodiment of the present application;
[0012] Figure 4A-4B A schematic diagram of limiting VPN routing loop forwarding through inner VLAN tags is provided for an embodiment of the present application;
[0013] Figure 5A schematic diagram of a routing forwarding table of a PE device that eliminates VPN routing loops provided by another embodiment of the present application;
[0014] Figure 6 The figure shows a schematic diagram of an embodiment of a device for limiting forwarding across VPN loops provided by the present application. DETAILED DESCRIPTION
[0015] The present invention will be described in detail with multiple examples shown in multiple figures. In the following detailed description, multiple specific details are used to provide a comprehensive understanding of the present application. Known methods, steps, components and circuits are not described in detail in the examples to avoid making these examples difficult to understand.
[0016] Among the terms used, the term "include" means including but not limited to; the term "contain" means including but not limited to; the terms "above", "within" and "below" are inclusive of the number; the terms "greater than" and "less than" are exclusive of the number. The term "based on" means based on at least a part thereof.
[0017] Figure 1 The flowchart of the embodiment of the method for limiting cross-VPN loop forwarding provided by the present application is shown; the method comprises the following steps:
[0018] Step 101, setting a loopback initial VLAN virtual local area network, a loopback intermediate VLAN, and a loopback termination VLAN;
[0019] Step 102, identifying a source virtual private network VPN instance based on the access circuit AC of the data message;
[0020] Step 103, based on the destination IP address of the data message, find a first routing forwarding table entry in the routing forwarding table of the source VPN instance; wherein the next hop of the first routing forwarding table entry is the destination VPN instance and the outgoing interface is the loopback interface;
[0021] Step 104, determining that the data message carries a double VLAN tag;
[0022] Step 105, setting the inner customer VLAN tag of the data message to the loopback initial VLAN tag;
[0023] Step 106, sending the data message through the loopback interface.
[0024] Figure 1 The beneficial effect of the embodiment is that it effectively avoids the device bandwidth consumed by the VPN routing loop inside the device, ensures the stability of the service, and on the other hand, does not need to spend a lot of manpower costs to locate, analyze and solve the routing loop problem.
[0025] Figure 2A-2BThe figure shows a schematic diagram of the routing table that causes a VPN routing loop in a PE device. In the routing table 201 of VPN instance A on the PE device, the destination IP address in the host routing table entry 2011 is 192.0.0.1, the next hop is VPN instance B, and the outgoing interface is the loopback interface; in the routing table 202 of VPN instance B on the PE device, the next hop of the default routing table entry 2021 is VPN instance A, and the outgoing interface is the loopback interface.
[0026] The loopback initial VLAN1, loopback intermediate VLAN2, and loopback termination VLAN3 are set inside the PE device.
[0027] The ACL table of the PE device also sets a loop termination access control list (ACL); the matching items of the loop termination ACL list include the inbound interface is a loopback interface, the outbound interface is a loopback interface, the inner CVLAN (Customer VLAN) tag is a VLAN3 tag; and the action item is discard.
[0028] Figure 3A-3B A schematic diagram of adding an inner VLAN tag to limit the number of cross-VPN loop forwarding times provided in an embodiment of the present application.
[0029] Figure 3A In the figure, the PE device receives an Ethernet data packet 300 carrying an SVLAN tag 311 and a CVLAN tag 321 from a CE (Customer Edge) device. The PE device identifies the AC according to the receiving port of the Ethernet data packet 300 and the VLAN 1000 (not shown) to which the SVLAN tag 311 belongs, and identifies the VPN instance A to which the Ethernet data packet 300 belongs according to the AC. The PE device finds a MAC address table entry (not shown) with a Layer 3 forwarding attribute according to the destination MAC address (not shown) of the Ethernet data packet 300, SVLAN 1000, and CVLAN 10, and determines to perform Layer 3 forwarding.
[0030] The PE device searches the routing table 201 of the VPNA instance according to the destination IP address 192.0.0.1 of the Ethernet data packet 300, finds a matching routing table entry 2011, determines that the outgoing interface is the loopback interface, and sets the inner CVLAN tag 321 to VLAN1.
[0031] The PE device changes the VLAN 1000 of the outer SVLAN tag 311 to the VLAN 2000 bound to the VPN instance B, and then loops back the Ethernet data packet 300 through the loopback interface.
[0032] Figure 3BIn the figure, the PE device receives an Ethernet data packet 300 carrying a VLAN tag 311 from the CE device. The PE device identifies the AC according to the receiving port of the Ethernet data packet 300 and the VLAN 1000 (not shown) to which the VLAN tag 311 belongs, and identifies the VPN instance A to which the Ethernet data packet 300 belongs according to the AC.
[0033] The PE device finds a MAC address entry with a layer-3 forwarding attribute according to the destination MAC address (not shown) of the Ethernet data packet 300 and VLAN 1000, and determines to perform layer-3 forwarding.
[0034] The PE device searches the routing table 201 of the VPNA instance according to the destination IP address 192.0.0.1 of the Ethernet data message 300, finds the matching routing table entry 2011, and determines that the outgoing interface is the loopback interface; adds an inner VLAN tag 321 to the Ethernet data message 300, and sets the inner VLAN tag 321 to the loopback initial VLAN, that is, VLAN1.
[0035] The PE device changes the outer VLAN 311 tag to VLAN 2000 bound to VPN instance B, and then loops back Ethernet data packet 300 through the loopback interface.
[0036] Figure 4A-4B A schematic diagram of limiting VPN routing loop forwarding through inner VLAN tags is provided for an embodiment of the present application.
[0037] Figure 4A In the figure, the PE device receives the Ethernet data packet 300 encapsulated with the loopback initial VLAN tag VLAN1 through the loopback port, and identifies the VPN instance B to which it belongs according to VLAN2000. The PE device finds the MAC address table entry with the Layer 3 forwarding attribute (not shown in the figure) according to the destination MAC address of the Ethernet data packet 300 (not shown in the figure) and the VLAN2000 to which it belongs, and determines to perform Layer 3 forwarding.
[0038] The PE device searches the routing table 202 of the VPNB instance according to the destination IP address 192.0.0.1 of the Ethernet datagram 300, finds the matching routing table entry 2021, and determines that the outgoing interface is the loopback interface; sets the inner CVLAN tag 321 to identify the loopback intermediate VLAN, that is, VLAN 2. The PE device sets the outer SVLAN tag 311 to identify VLAN 1000 of VPN instance A; and sends the datagram 300 through the loopback interface.
[0039] Figure 4BIn the figure, the PE device receives Ethernet datagram 300 through the loopback port; the outer SVLAN tag is VLAN1000; the inner CVLAN tag is VLAN2. The PE device receives the looped Ethernet datagram 300 through the loopback port, and identifies the VPN instance A to which it belongs according to VLAN1000. The PE device finds the MAC address table entry with the Layer 3 forwarding attribute according to the destination MAC address (not shown) of the Ethernet datagram 300 and the VLAN 2000 to which it belongs, and determines to perform Layer 3 forwarding.
[0040] The PE device finds a matching routing table entry 2011 in the routing table 201 of the VPNA instance according to the destination IP address 192.0.0.1 of the Ethernet data packet 300, and determines that the outgoing interface is the loopback interface; determines that VLAN2 of the inner CVLAN tag 321 is not equal to the loopback termination VLAN3; sets the inner CVLAN tag 321 to VLAN3, and sets the outer SVLAN to VLAN2000 identifying VPNB.
[0041] Afterwards, the PE device receives the Figure 4B As shown in the Ethernet data packet 300 , the PE device does not find a matching routing table entry according to the data packet 300 , then finds a loop termination ACL table entry according to the input interface, output interface, and inner CVLAN tag VLAN3 of the Ethernet data packet 300 , and discards the data packet 300 .
[0042] The PE device discards Ethernet data packet 300 through the loop ACL entry to avoid repeated forwarding between VPN instances.
[0043] In actual application networking, especially in larger network environments, networking and configuration are complex, most routing table entries are dynamically generated, and the number is huge. It is difficult to discover the problem of routing loops before the above-mentioned internal routing loops cause more obvious impacts. The above-mentioned means of limiting the number of forwarding times between VPNs can effectively control the internal routing loops.
[0044] Compared with the existing technology that reduces the TTL (Time to Live) value in the IP packet header by 1 each time the internal loop is forwarded across VPN, it will not affect the packet in the network after the internal loop disappears.
[0045] Figure 5 A schematic diagram of a routing forwarding table of a PE device that eliminates a VPN routing loop is provided in another embodiment of the present application.
[0046] The PE device receives the Ethernet data packet 300 encapsulated with the loopback initial VLAN tag VLAN3 through the loopback port, and identifies the VPN instance B to which it belongs according to VLAN2000. The PE device finds the MAC address table entry with the Layer 3 forwarding attribute (not shown in the figure) according to the destination MAC address of the Ethernet data packet 300 (not shown in the figure) and the VLAN2000 to which it belongs, and determines to perform Layer 3 forwarding.
[0047] The PE device searches the routing table 202 of the VPNB instance according to the destination IP address 192.0.0.1 of the Ethernet data message 300, finds the matching routing table entry 2022, determines that the next hop is the peer tunnel interface address 192.0.0.148 and the outgoing interface is the local tunnel interface Tunnel1; strips off the inner customer VLAN tag 321; strips off the Ethernet header of the Ethernet data message 300, and based on the IP address of the local tunnel interface as the source IP address and the peer tunnel interface address as the destination IP address, encapsulates the VPN tunnel header for the data message Tunnel1, and sends it through the local tunnel interface tunnel1.
[0048] Figure 6 The schematic diagram of the device embodiment for limiting forwarding across VPN loops provided by the present application is shown. The device 60 includes at least: a network interface, a switching chip, a CPU and a memory. The switching chip includes at least a forwarding module. The processor executes the setting module by running the processor executable instructions in the memory.
[0049] The setting module is used to set a loopback initial VLAN virtual local area network, a loopback intermediate VLAN, and a loopback termination VLAN; the forwarding module is used to identify the source virtual private network VPN instance based on the access circuit AC of the data message; based on the destination IP address of the data message, find the first routing forwarding table item in the routing forwarding table of the source VPN instance; wherein the next hop of the first routing forwarding table item is the destination VPN instance and the output interface is the loopback interface; determine that the data message carries a double-layer VLAN tag; set the inner layer customer VLAN tag of the data message to the loopback initial VLAN tag; and send the data message through the loopback interface.
[0050] The forwarding module is also used to determine whether the data message carries a single-layer VLAN tag; add an inner layer customer VLAN tag identifier that identifies the loopback initial VLAN to the data message; add an outer layer service VLAN tag that identifies the destination VPN instance to the data message; and send the data message through the loopback interface.
[0051] The forwarding module is also used to receive the looped-back data message through the loopback interface; identify the destination VPN instance based on the outer service VLAN tag; find the second routing forwarding table item in the destination VPN instance routing forwarding table based on the destination IP address of the data message; wherein the next hop of the routing forwarding table item is the source VPN instance and the outgoing interface is the loopback interface; set the inner customer VLAN tag to identify the loopback intermediate VLAN; set the outer service VLAN tag to identify the VLAN of the source VPN instance; and send the data message through the loopback interface.
[0052] The forwarding module is also used to receive the looped-back data message through the loopback interface; identify the source VPN instance based on the outer service VLAN tag; find the first routing forwarding table item in the source VPN instance routing forwarding table based on the destination IP address of the data message; set the inner customer VLAN tag to identify the loopback termination VLAN; and set the outer service VLAN tag to identify the VLAN of the destination VPN instance.
[0053] The forwarding module is also used to receive the looped-back data message through the loopback interface; identify the source VPN instance based on the outer service VLAN tag; find the third routing forwarding table item in the source VPN instance routing forwarding table based on the destination IP address of the data message; wherein the next hop of the third routing forwarding table item is the address of the opposite tunnel interface and the outgoing interface is the local tunnel interface; strip off the inner customer VLAN tag; strip off the Ethernet header of the data message, encapsulate the VPN tunnel header for the data message based on the IP address of the local tunnel interface as the source IP address and the address of the opposite tunnel interface as the destination IP address, and send it through the local tunnel interface.
[0054] The forwarding module is also used to receive the looped-back data message through the loopback interface; discard the data message according to the loop termination access control table item; wherein the matching item of the loop termination access control table item is that the input interface and the output interface are the loopback interface and the inner customer VLAN tag is set to identify the loopback termination VLAN; the action item of the loop termination access control table item is discard.
[0055] The above description is only a preferred embodiment of the present application and is not intended to limit the present application. Any modifications, equivalent substitutions, improvements, etc. made within the spirit and principles of the present application shall be included in the scope of protection of the present application.
Claims
1. A method for limiting forwarding across VPN loops, characterized in that: The method comprises, Set up a loopback initial VLAN virtual LAN, a loopback intermediate VLAN, and a loopback termination VLAN; The access circuit AC identifies the source virtual private network VPN instance based on the data message; Based on the destination IP address of the data message, a first routing forwarding table entry is found in the routing forwarding table of the source VPN instance; wherein the next hop of the first routing forwarding table entry is the destination VPN instance and the outgoing interface is the loopback interface; Determining that the data message carries a double-layer VLAN tag; Setting the inner client VLAN tag of the data message as the loopback initial VLAN tag; The data message is sent through the loopback interface.
2. The method according to claim 1, characterized in that When it is determined that the data message carries a single-layer VLAN tag; the method further includes: Adding an inner layer customer VLAN tag identifying the loopback initial VLAN to the data message; Adding an outer service VLAN tag identifying the destination VPN instance to the data message; The data message is sent through the loopback interface.
3. The method according to claim 1 or 2, characterized in that: Receiving the looped-back data message through the loopback interface; Identifying the destination VPN instance based on the outer service VLAN tag; In the destination VPN instance routing forwarding table, based on the destination IP address of the data message, find a second routing forwarding table entry; wherein the next hop of the routing forwarding table entry is the source VPN instance and the outgoing interface is the loopback interface; Setting the inner customer VLAN tag to identify the loopback intermediate VLAN; Setting the outer service VLAN tag to identify the VLAN of the source VPN instance; The data message is sent through the loopback interface.
4. The method according to claim 2, characterized in that: Receiving the looped-back data message through the loopback interface; identifying the source VPN instance based on the outer service VLAN tag; In the source VPN instance routing forwarding table, based on the destination IP address of the data message, find the first routing forwarding table entry; Setting the inner customer VLAN tag to identify the loopback termination VLAN; The outer service VLAN tag is set to identify the VLAN of the destination VPN instance.
5. The method according to claim 4, characterized in that Receiving the looped-back data message through the loopback interface; identifying the source VPN instance based on the outer service VLAN tag; In the source VPN instance routing forwarding table, based on the destination IP address of the data message, find the third routing forwarding table entry; wherein the next hop of the third routing forwarding table entry is the peer tunnel interface address and the outgoing interface is the local tunnel interface; Stripping off the inner customer VLAN tag; The Ethernet header of the data message is stripped off, and based on the IP address of the local tunnel interface as the source IP address and the address of the opposite end tunnel interface as the destination IP address, a VPN tunnel header is encapsulated for the data message, and the data message is sent through the local tunnel interface.
6. The method according to claim 4, characterized in that Receiving the looped-back data message through the loopback interface; According to the loop termination access control table entry, the data message is discarded; wherein the matching item of the loop termination access control table entry is that the input interface and the output interface are the loopback interface and the inner customer VLAN tag is set to identify the loopback termination VLAN; the action item of the loop termination access control table entry is discard.
7. A device for limiting forwarding across VPN loops, characterized in that: The device comprises, A setting module is used to set a loopback initial VLAN virtual local area network, a loopback intermediate VLAN, and a loopback termination VLAN; A forwarding module, used for identifying a source virtual private network VPN instance based on an access circuit AC of a data message; Based on the destination IP address of the data message, a first routing forwarding table entry is found in the routing forwarding table of the source VPN instance; wherein the next hop of the first routing forwarding table entry is the destination VPN instance and the outgoing interface is the loopback interface; Determine that the data message carries a double-layer VLAN tag; set the inner layer customer VLAN tag of the data message as a loopback initial VLAN tag; and send the data message through the loopback interface.
8. The device according to claim 7, characterized in that The forwarding module is also used to determine that the data message carries a single-layer VLAN tag; add an inner layer customer VLAN tag identifying the loopback initial VLAN to the data message; add an outer layer service VLAN tag identifying the destination VPN instance to the data message; and send the data message through the loopback interface.
9. The device according to claim 7 or 8, characterized in that The forwarding module is also used to receive the looped-back data message through the loopback interface; identify the destination VPN instance based on the outer service VLAN tag; find a second routing forwarding table entry in the destination VPN instance routing forwarding table based on the destination IP address of the data message; wherein the next hop of the routing forwarding table entry is the source VPN instance and the outgoing interface is the loopback interface; set the inner customer VLAN tag to identify the loopback intermediate VLAN; set the outer service VLAN tag to identify the VLAN of the source VPN instance; and send the data message through the loopback interface.
10. The device according to claim 8, characterized in that The forwarding module is further configured to receive the looped-back data message through the loopback interface; identify the source VPN instance based on the outer service VLAN tag; and find the first routing forwarding table entry in the source VPN instance routing forwarding table based on the destination IP address of the data message; Setting the inner customer VLAN tag to identify the loopback termination VLAN; The outer service VLAN tag is set to identify the VLAN of the destination VPN instance.
11. The device according to claim 10, characterized in that The forwarding module is also used to receive the looped-back data message through the loopback interface; identify the source VPN instance based on the outer service VLAN tag; find the third routing forwarding table entry in the source VPN instance routing forwarding table based on the destination IP address of the data message; wherein the next hop of the third routing forwarding table entry is the address of the opposite tunnel interface and the outgoing interface is the local tunnel interface; strip off the inner customer VLAN tag; strip off the Ethernet header of the data message, encapsulate the VPN tunnel header for the data message based on the IP address of the local tunnel interface as the source IP address and the address of the opposite tunnel interface as the destination IP address, and send it through the local tunnel interface.
12. The device according to claim 10, characterized in that The forwarding module is also used to receive the looped-back data message through the loopback interface; discard the data message according to the loop termination access control table item; wherein the matching item of the loop termination access control table item is that the input interface and the output interface are the loopback interface and the inner layer customer VLAN tag is set to identify the loopback termination VLAN; the action item of the loop termination access control table item is discard.
Citation Information
Patent Citations
Loopback control method and device
CN101051961A
Method, system and node for transmitting operation management and maintenance packet of ethernet
CN101179479A
Method and device for realizing multiple virtual private network (VPN) examples
CN101626338A
Point-to-point remote loopback test method, system and device
CN102025569A
A method for implementing MPLS zero-label pop-up and an edge device
CN102291316A
