CN112511419B - Distributed forwarding system - Google Patents

Distributed forwarding system Download PDF

Info

Publication number
CN112511419B
CN112511419B CN202011231628.4A CN202011231628A CN112511419B CN 112511419 B CN112511419 B CN 112511419B CN 202011231628 A CN202011231628 A CN 202011231628A CN 112511419 B CN112511419 B CN 112511419B
Authority
CN
China
Prior art keywords
router
forwarding
port
switch
target
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202011231628.4A
Other languages
Chinese (zh)
Other versions
CN112511419A (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.)
Beijing Armyfly Technology Co Ltd
Original Assignee
Beijing Armyfly Technology Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Beijing Armyfly Technology Co Ltd filed Critical Beijing Armyfly Technology Co Ltd
Priority to CN202011231628.4A priority Critical patent/CN112511419B/en
Publication of CN112511419A publication Critical patent/CN112511419A/en
Application granted granted Critical
Publication of CN112511419B publication Critical patent/CN112511419B/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/22Alternate 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/28Routing or path finding of packets in data switching networks using route fault recovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/44Distributed 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/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
    • H04L45/745Address table lookup; Address filtering
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L47/00Traffic control in data switching networks
    • H04L47/10Flow control; Congestion control
    • H04L47/12Avoiding congestion; Recovering from congestion
    • H04L47/125Avoiding congestion; Recovering from congestion by balancing the load, e.g. traffic engineering

Landscapes

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

Abstract

The embodiment of the invention discloses a distributed forwarding system. The system comprises: and each router in the virtual redundant routing protocol network is connected with each other, and at least two routers in the virtual redundant routing protocol network are in a forwarding state. According to the technical scheme, distributed forwarding of the data message is achieved through the router with at least two forwarding states, the load of the router is reduced, the time of router fault switching is shortened, and the packet loss condition of the message is reduced. In addition, the router stores three layers of table entries comprising the corresponding relation between the Internet protocol IP addresses and the Media Access Control (MAC) addresses of all hosts in the virtual redundant routing protocol network, wherein all the routers can directly reach the Internet protocol IP addresses, the MAC tables of the corresponding relation between the MAC addresses and the physical output interfaces are obtained through two layers of learning, the problem of expansion of ARP table entries is solved through table entry separation, particularly in the case of multiple output ports, n load sharing ports are arranged, and the table entries multiply n times.

Description

Distributed forwarding system
Technical Field
The embodiment of the invention relates to the technical field of communication, in particular to a distributed forwarding system.
Background
The virtual router redundancy protocol (Virtual Router Redundancy Protocol, VRRP) is a selection protocol that dynamically allocates the responsibilities of a virtual router to a VRRP router on a local area network. The VRRP router that controls the virtual router IP addresses is called the master router, which is responsible for forwarding packets to these virtual IP addresses. This selection process provides a dynamic failover mechanism once the primary router is unavailable, i.e., a backup router is selected as the new primary router, thereby enabling full network communication.
In the existing VRRP technical protocol, only a primary router can analyze an address resolution protocol (Address Resolution Protocol, ARP) and forward an internet protocol (Internet Protocol, IP) data packet, and other backup routers are in a standby state and cannot perform ARP learning and three-layer data forwarding, so that each backup router does not have an ARP table entry, and when the primary router fails, the backup router starts to process an ARP message under the condition that the primary router is up to the primary router, therefore, the ARP table entry needs to be learned according to three-layer data frames of an unknown route, and because the learning process takes a long time, the requirement of a 50ms carrier class cannot be met, and therefore, a continuous packet loss condition occurs in a data frame forwarded by using the ARP table entry.
Disclosure of Invention
The invention provides a distributed forwarding system, which realizes distributed forwarding of data messages by setting at least two routers in forwarding state, reduces the load of the routers, shortens the time of router fault switching, and reduces the packet loss condition of the messages.
In a first aspect, an embodiment of the present invention provides a distributed forwarding system, including: and each router in the virtual redundant routing protocol network is connected with each other, and at least two routers in the virtual redundant routing protocol network are in a forwarding state.
Optionally, all routers in the virtual redundant routing protocol network store an address resolution protocol ARP table in the local machine, where the ARP table includes a correspondence between internet protocol IP addresses and media access control MAC addresses of all hosts that can directly reach by each router in the virtual redundant routing protocol network.
Optionally, the first router connected to the blocked port of the switch or to the non-working network port of the host performs the following method:
receiving the corresponding relation between the IP address and the MAC address synchronized by the second router and storing the corresponding relation in an ARP table of the local machine, or receiving an ARP request message forwarded by the second router, obtaining the MAC address corresponding to the IP address in the ARP request message through learning and storing the MAC address in the ARP table of the local machine;
The second router is a router connected with a forwarding port of the switch or a working network port of the host.
Optionally, the following method is performed by a second router connected to a forwarding port of the switch or to a working network port of the host:
after receiving the APR request message of the switch or the host, forwarding the APR request message to a first router connected with a blocking port of the switch or a non-working network port of the host; or,
and synchronizing the learned corresponding relation between the IP address and the MAC address to the first router.
Optionally, all routers in the virtual redundant routing protocol network store an MAC table locally, where the MAC table includes a correspondence between MAC addresses obtained through two-layer learning and physical interfaces.
Optionally, the second router connected to the forwarding port of the switch or to the working network port of the host performs the method of:
after receiving the target data message of the switch or the host, inquiring the ARP table and the MAC table stored by the host according to the target data message, and forwarding the target data message according to the inquired target output interface.
Optionally, the second router connected with the forwarding port of the switch or the working network port of the host executes the steps of querying the ARP table and the MAC table stored in the host according to the target data packet, and forwarding the target data packet according to the queried target output interface, including:
Inquiring a target MAC address matched with a target IP address in a target data message in an ARP table, inquiring a target output interface corresponding to the target MAC address in the MAC table, and forwarding the target data message according to the inquired target output interface.
Optionally, the outgoing interface for three-layer forwarding in each entry of the ARP table is a physical loopback interface or a logical loopback interface in the router;
the second router connected with the forwarding port of the switch or the working network port of the host executes the inquiry of the ARP table and the MAC table stored in the host, and forwards the target data message according to the inquired target output interface, and the method comprises the following steps:
inquiring a target MAC address matched with a target IP address in the target data message in the ARP table;
modifying the target data message according to the target MAC address, and carrying out virtual three-layer forwarding on the modified target data message through the physical loopback interface or the logic loopback interface;
and inquiring a target output interface corresponding to the target MAC address in the MAC table, and carrying out two-layer forwarding on the target data message which is subjected to virtual three-layer forwarding through the target output interface.
Optionally, the second router connected to the forwarding port of the switch or to the working network port of the host further performs the method of:
The control layer transmits the corresponding relation between the IP address and the MAC address which are obtained by learning or synchronizing other routers to the forwarding layer;
and the forwarding layer stores the corresponding relation issued by the control layer in a local ARP (address resolution protocol) table entry, and replaces a physical output interface in the local ARP table entry with a physical loopback interface or a logical loopback interface of the router.
Optionally, the router connected to the blocked port of the switch performs the following method:
and after the router connected with the forwarding port of the switch fails, opening the blocking port to enable the blocking port to be in a forwarding state, and switching the router connected with the blocking port of the switch into the current main router of the switch.
Alternatively, the master routers of different switches in the same VLAN are not identical.
The technical scheme of the embodiment of the invention includes that each router in the virtual redundant routing protocol network is connected with each other, and at least two routers in forwarding states are arranged in the virtual redundant routing protocol network, so that the main routers of at least two switches are different, therefore, the VRRP network is not only in forwarding states, but also distributed on different routers in the VRRP network, the distributed forwarding of the data message is realized, the service needing switching after the router fails is reduced, the service switching time is correspondingly reduced, the time spent by three layers of learning ARP tables is correspondingly reduced, and the packet loss is reduced.
Furthermore, each router in the VRRP network stores the corresponding relation between the IP addresses and the MAC addresses of all hosts which can directly reach each router in the VRRP network, when the main router of the switch is switched, the new main router also stores three layers of ARP table entries, the time for three layers to relearn the corresponding relation is further reduced, and compared with the situation that the ARP table entries on the main router are updated and the ARP table entries on the standby router are updated when the main router of the switch periodically synchronizes the three layers of ARP table entries, the time for learning the three layers of ARP table entries is less and the service switching time is faster when the standby router of the switch is switched to the main router because all routers can learn the three layers of ARP table entries.
Further, the embodiment of the invention respectively inquires the three layers of ARP tables and the MAC table to finally determine the target output interface for forwarding the target data message, so that the three layers of ARP tables do not need to have a physical output interface, and the output interface is searched in the two layers of MAC tables, thereby solving the problem that the router takes longer time for learning the physical output interface of the three layers of routers to cause packet loss in the prior art, enabling the router to acquire the physical output interface without carrying out three layers of learning, improving the forwarding speed of the three layers of data messages and reducing the packet loss rate of the messages.
Furthermore, the mode of separating the table items is realized through a physical loop back port or a logical loop back port, so that on one hand, the expansion of the table items is reduced, and on the other hand, a powerful condition is created for the table item synchronization, because interfaces are not considered, the same content is directly synchronized, otherwise, the interfaces are different, if the interfaces are not learned, the synchronization of the table items can not be mastered due to untimely synchronization, and the packet loss is generated.
Drawings
Fig. 1a is a schematic structural diagram of a distributed forwarding system according to a first embodiment of the present invention;
fig. 1b is a schematic structural diagram of a distributed forwarding system according to a first embodiment of the present invention;
FIG. 2a is a flowchart of an implementation of an application scenario to which embodiments of the present invention are applicable;
FIG. 2b is a topology diagram of a virtual redundant routing protocol network to which embodiments of the present invention are applicable;
FIG. 2c is a topology diagram of another virtual redundant routing protocol network to which embodiments of the present invention are applicable;
FIG. 2d is a schematic diagram of an ARP table of router A in an embodiment of the invention;
FIG. 2e is a schematic diagram of a MAC table of router A in an embodiment of the invention;
FIG. 2f is a schematic diagram of an ARP table of router B in an embodiment of the invention;
FIG. 2g is a schematic diagram of a MAC table of router B in an embodiment of the invention;
Fig. 2h is a schematic diagram of an updated MAC table of router B in an embodiment of the present invention.
Detailed Description
The invention is described in further detail below with reference to the drawings and examples. It is to be understood that the specific embodiments described herein are merely illustrative of the invention and are not limiting thereof. It should be further noted that, for convenience of description, only some, but not all of the structures related to the present invention are shown in the drawings.
It should be noted that the embodiment of the present invention is applicable to the following scenarios: 1. in the VRRP network, each router is directly connected with a host, and at least two routers are respectively connected with the working network ports of different hosts, as shown in figure 1a, under the scene, the main routers of at least two hosts are different, namely, the working network ports of the two hosts are connected with different routers; 2. each router in the VRRP-network is directly connected to the switch, wherein at least two routers are connected to the forwarding ports of the switch, and the connection is a scenario of forwarding ports of different switches, as shown in fig. 1B, in this scenario, at least two main routers of the switch are different, i.e. the forwarding ports of the two switches are connected to different routers, e.g. the VRRP-network has two routers 1 and 2, the router 1 is connected to the forwarding port of the switch a, and the router 2 is connected to the forwarding port of the switch B. The present embodiment mainly describes a distributed forwarding system taking the second scenario as an example.
Example 1
Fig. 1b is a schematic structural diagram of a distributed forwarding system according to a first embodiment of the present invention, where the present embodiment is applicable to performing distributed forwarding on a data packet to reduce a load of a router and shorten a failover time of the router, and as shown in fig. 1b, the system includes:
each router 110 in the virtual redundant routing protocol network is connected with each other, and at least two routers 110 in the virtual redundant routing protocol network are in a forwarding state.
In this embodiment, at least two routers in the VRRP network are connected to the forwarding ports of the switches and are connected to the forwarding ports of different switches, and in this scenario, at least two routers are different, i.e., the forwarding ports of the two switches are connected to different routers, for example, the VRRP network has two routers 1 and 2, the router 1 is connected to the forwarding port of the switch a, and the router 2 is connected to the forwarding port of the switch B. In this scenario, it is possible that one router is connected to the forwarding port of switch a and to the blocking port of another switch B. In the scene, any switch can be connected with all routers, or only part of switches are connected with all routers and part of switches are connected with part of routers, so that the following conditions are satisfied: any router is not connected with the forwarding ports of all the switches in the distributed forwarding system, and any router is not connected with the blocking ports of all the switches in the distributed forwarding system, or the main router which at least has two switches is different.
Alternatively, the master routers of switches in the same VLAN are not identical.
In this embodiment, the primary routers of the switch HostA and the switch HostB in the same VLAN are different, that is, the forwarding ports of the switch HostA and the switch HostB in the same VLAN are connected to different routers.
In this embodiment, one end of the switch is connected to at least one terminal device, and the other end of the switch is connected to each router in the virtual redundant routing protocol network, so as to automatically detect whether the router connected to the switch is in a fault state. The switch may have a plurality of ports, and one port with higher priority may be selected from the ports of the switch as a forwarding port according to the priority of the ports, or one port may be randomly selected from the ports as a forwarding port, and the remaining ports are set as blocking ports. The switch forwarding port and the blocking port of the switch are respectively connected with different routers in the virtual redundant routing protocol network and are used for forming a plurality of transmission links, wherein the router connected with the switch forwarding port is currently a main router for the switch, and the router connected with the switch blocking port is currently a standby router for the switch.
In this embodiment, the same router may be connected to the forwarding ports of the switch a and simultaneously connected to the blocking ports of the switch B, where any router cannot be connected to the forwarding ports of all switches, or is connected to the blocking ports of all switches, so that distributed forwarding is facilitated, and the load of the router is reduced.
In this embodiment, by setting at least two routers in forwarding state in the network, the main router of each switch is not concentrated on one router, but is distributed on different routers in the network, so that distributed forwarding of the message can be implemented, and the service that needs to be switched after the current main router of the switch fails is reduced, and the failover time is correspondingly reduced. Meanwhile, whether or not a router in the network fails, the load of the router can be reduced.
Optionally, all routers 110 in the virtual redundant routing protocol network store an ARP table in the local machine, where the ARP table includes a correspondence between IP addresses and MAC addresses of all hosts that can directly reach by each router in the virtual redundant routing protocol network.
In order to make each router in the network switch to a forwarding state, that is, switch to be connected with a forwarding port of the switch, data forwarding can be performed immediately, all routers store an ARP table in a local machine, where the ARP table includes: if VLAN identifications exist, the ARP table comprises the corresponding relations of the IP addresses, the MAC addresses and the VLAN identifications of all the hosts. By pre-storing the ARP table, when the router is switched to the forwarding state, three layers of forwarding of the message can be immediately performed without three layers of learning the ARP table, and the switching time is greatly shortened.
Optionally, the first router connected to the blocked port of the switch or to the non-working network port of the host performs the following method: receiving the corresponding relation between the IP address and the MAC address synchronized by the second router and storing the corresponding relation in an ARP table of the local machine, or receiving an ARP request message forwarded by the second router, obtaining the MAC address corresponding to the IP address in the ARP request message through learning and storing the MAC address in the ARP table of the local machine; the second router is a router connected with a forwarding port of the switch or a working network port of the host.
In this embodiment, a first router connected to a blocking port of a switch or to a non-working network port of a host is a current standby router for the switch or the host, a second router connected to a forwarding port of the switch or to a working network port of the host is a current main router for the switch or the host, if the standby router receives an ARP request message sent by the main router, an IP address and a corresponding MAC address are obtained from the ARP request message, if VLAN identifiers exist in the ARP request message, a corresponding VLAN identifier may also be obtained, and the correspondence is stored in a local ARP table, so that three layers of forwarding can be performed by a subsequent table lookup. If the standby router receives the correspondence between the IP address and the MAC address learned by the main router, the correspondence may further include VLAN identification, and the correspondence is directly stored in a local ARP table.
Optionally, the following method is performed by a second router connected to a forwarding port of the switch or to a working network port of the host: after receiving an APR request message of a switch or a host, forwarding the APR request message to a first router connected with a blocking port of the switch or a non-working network port of the host; or synchronizing the learned corresponding relation between the IP address and the MAC address to the first router.
In this embodiment, the second router connected to the forwarding port of the switch or the working network port of the host is the current main router for the switch or the host, after receiving the ARP request message of the switch or the host, the main router may learn a new ARP table entry from the ARP request message, so that, in order to enable the standby router connected to the blocking port of the switch or the working network port of the host to learn corresponding ARP information synchronously, the ARP request message may be forwarded to the standby router, so that the standby router obtains the corresponding IP address and MAC address from the ARP request message, if VLAN identifiers exist in the ARP request message, may also obtain the VLAN identifiers, and store the correspondence in the local ARP table, to realize that all routers synchronously store the ARP table.
Optionally, all routers in the virtual redundant routing protocol network store an MAC table in the local machine, where the MAC table includes a correspondence between MAC addresses obtained through two-layer learning and physical interfaces.
In this embodiment, in order to enable all routers to quickly obtain the target output interface for forwarding the data packet by the user, to implement two-layer forwarding of the packet, all routers store the MAC table in the local, where the MAC table includes the correspondence between the MAC address obtained by two-layer learning and the physical output interface, so that the router can query the MAC table according to the target MAC address to determine the corresponding target output interface without performing two-layer learning.
Optionally, the router 110 connected to the forwarding port of the switch performs the method of: after receiving the target data message of the switch, inquiring the ARP table and the MAC table stored by the local machine according to the target data message, and forwarding the target data message according to the inquired target output interface.
In this embodiment, the second router connected to the forwarding port of the switch or the working network port of the host is the current master router for the switch or the host, and after receiving the target data packet of the switch or the host, the master router does not need to spend a long time for three-layer learning of the physical outgoing interface, directly queries the ARP table and the MAC table stored in the host according to the destination IP address in the target data packet, and can find the corresponding target outgoing interface, and performs two-layer forwarding on the target data packet through the target outgoing interface, thereby saving the time of three-layer learning and improving the packet forwarding speed.
Optionally, the second router connected with the forwarding port of the switch or the working network port of the host executes the steps of querying the ARP table and the MAC table stored in the host according to the target data packet, and forwarding the target data packet according to the queried target output interface, including: inquiring a target MAC address matched with a target IP address in the target data message in an ARP table, inquiring a target output interface corresponding to the target MAC address in the MAC table, and forwarding the target data message according to the inquired target output interface.
In this embodiment, the second router connected to the forwarding port of the switch or the working network port of the host is the current master router for the switch or the host, after receiving the three-layer target data packet, the second router may obtain the destination IP address from the target data packet, and then query the corresponding relationship between the IP address and the MAC address in the ARP table of the host to find the destination MAC address matched with the destination IP address. And inquiring the corresponding relation between the MAC address and the physical output interface in the local MAC table according to the target MAC address, finding a target output interface of the main router corresponding to the target MAC address, forwarding the target data message to a host corresponding to the target MAC address through the target output interface, and completing forwarding of the target data message.
In this embodiment, if no entry corresponding to the destination IP address is queried from the ARP table of the local device, the router obtains the destination MAC address matching the destination IP address through three-layer ARP learning, and stores the correspondence between the destination IP address and the destination MAC address in the ARP table of the local device, so as to query the MAC address corresponding to the destination IP address next time. If the target exit interface of the main router corresponding to the target MAC address is not queried in the MAC table of the host, the main router performs two-layer learning according to the target MAC address to acquire the target exit interface, stores the corresponding relation between the target MAC address and the target exit interface in the MAC table of the host, and forwards the target data message to the host corresponding to the target MAC address through the target exit interface.
In this embodiment, the router does not need to acquire the target outbound interface corresponding to the target MAC address through three-layer learning, but acquires the target outbound interface through two-layer learning, and the time spent on learning the physical outbound interface by two-layer learning is far less than that of three-layer learning, so that the time for learning the target outbound interface is greatly shortened, and the purpose of rapidly forwarding three-layer data messages is achieved.
Optionally, the outgoing interface for three-layer forwarding in each entry of the ARP table is a physical loopback interface or a logical loopback interface in the router; the second router connected with the forwarding port of the switch or the working network port of the host executes the inquiry of the ARP table and the MAC table stored in the host, and forwards the target data message according to the inquired target output interface, comprising: inquiring a target MAC address matched with a target IP address in a target data message in an ARP table; modifying the target data message according to the target MAC address, and carrying out virtual three-layer forwarding on the modified target data message through a physical loopback interface or a logical loopback interface; and inquiring a target output interface corresponding to the target MAC address in the MAC table, and carrying out two-layer forwarding on the target data message which is subjected to virtual three-layer forwarding through the target output interface.
The logical loopback interface is an idle logical interface of a preset router, and the logical interface refers to a port used for distinguishing services in a logical sense and does not exist physically. Because the exchange chip of the router may or may not support the logic interface, the mode of forwarding the data message by adopting the logic loop back interface is only suitable for the condition that the router supports the logic interface.
In this embodiment, the second router connected to the forwarding port of the switch or the working network port of the host is the current main router for the switch or the host, so that when forwarding the three-layer data packet, only the ARP table needs to be checked to obtain the corresponding relationship between the destination IP address and the destination MAC address, and the destination egress interface corresponding to the destination MAC address or the three-layer learning physical egress interface is not required, and the main router sets the physical egress interface for three-layer forwarding in the ARP table as the physical loopback interface or the logical loopback interface of the main router in advance.
In this embodiment, after receiving the target data packet, the master router may first obtain the destination IP address from the target data packet, query the ARP table stored in the master router according to the destination IP address, obtain the destination MAC address matching the destination IP address, or the destination MAC address matching the destination IP address and the destination VLAN identifier, and modify the target data packet according to the obtained information. For example, the source MAC address in the destination data packet is modified to the MAC address of the master router, the destination MAC address is modified to the destination MAC address, the time-to-live value is reduced by one, the destination VLAN identification is encapsulated, etc. And then, the modified target data message is sent to a physical loopback interface or a logic loopback interface for loopback, a target output interface of the main router is obtained by inquiring a MAC table according to a target MAC address or according to the target MAC address and a target VLAN identifier, and the looped target data message is forwarded in two layers through the target output interface.
Optionally, the second router connected to the forwarding port of the switch or to the working network port of the host further performs the method of: the control layer transmits the corresponding relation between the IP address and the MAC address which are obtained by learning or synchronizing other routers to the forwarding layer; the forwarding layer stores the corresponding relation issued by the control layer in a local ARP (address resolution protocol) table entry, and replaces a physical outgoing interface in the local ARP table entry with a physical loopback interface or a logical loopback interface of the router.
In this embodiment, all routers are complete switching devices, including a control layer and a forwarding layer, where the control layer refers to protocol control, belongs to software control, and the forwarding layer is an implementation layer for data forwarding, and may be a switching chip. The second router connected with the forwarding port of the switch or the working network port of the host is the current main router for the switch or the host, and the main router learns a new ARP table entry or after receiving the corresponding relation between the IP address and the MAC address synchronized by other main routers, the corresponding relation between the obtained IP address and the MAC address can be issued to the switching chip of the forwarding layer through the control layer, so that the switching chip updates the ARP table of the forwarding layer, and the data message is forwarded correctly.
After the forwarding layer stores the corresponding relation in the local ARP table entry, in order to shorten the three-layer forwarding time and avoid three-layer learning physical outgoing interfaces, the physical outgoing interfaces corresponding to the three-layer forwarding in the local ARP table entry are replaced by physical loopback interfaces or logical loopback interfaces of the main router, so that after the main router receives the three-layer data message, the three-layer data message can be quickly looped back into a circle through virtual three-layer forwarding by the physical loopback interfaces or the logical loopback interfaces, and the target outgoing interfaces are quickly acquired through inquiring the two-layer table or the two-layer learning, thereby realizing the two-layer forwarding of the data message.
In this embodiment, by implementing that all routers synchronously store ARP tables, and making the routers replace physical egress interfaces for three-layer forwarding in local ARP entries with their own physical loopback interfaces or logical loopback interfaces, when the routers forward three-layer messages, the routers can quickly loop back three-layer data messages through the physical loopback interfaces or the logical loopback interfaces, and then quickly acquire the target egress interfaces by looking up the two-layer tables, and perform two-layer forwarding on the three-layer data messages, without acquiring the target egress interfaces through three-layer learning, thereby shortening learning time of the target egress interfaces and accelerating forwarding speed of the messages.
Optionally, the router connected to the blocked port of the switch performs the following method: and after the router connected with the forwarding port of the switch fails, opening the blocking port to enable the blocking port to be in a forwarding state, and switching the router connected with the blocking port of the switch into the current main router of the switch.
In this embodiment, if the router connected to the blocking port of the switch determines that the router connected to the forwarding port of the switch is in a failure state, the blocking port may be switched to a forwarding state, so that the router connected to the blocking port of the switch is switched from a non-forwarding state to a forwarding state, becomes a current master router of the switch, and may forward the data packet of the switch, thereby avoiding the router with failure for the switch, and implementing distributed forwarding of the data packet.
In this embodiment, after the blocking port is switched to a new switch forwarding port, if it is detected that the router that has failed before changes from the failure state to the normal working state, data forwarding may be continued, and then the port connected to the original router in the switch may be switched to the switch forwarding port again. Of course, the current switch forwarding port may also be kept unchanged.
The technical scheme of the embodiment of the invention includes that each router in the virtual redundant routing protocol network is connected with each other, and at least two routers in forwarding states are arranged in the virtual redundant routing protocol network, so that the main routers of at least two switches are different, therefore, the VRRP network is not only in forwarding states, but also distributed on different routers in the VRRP network, the distributed forwarding of the data message is realized, the service needing switching after the router fails is reduced, the service switching time is correspondingly reduced, the time spent by three layers of learning ARP tables is correspondingly reduced, and the packet loss is reduced.
Further, the embodiment of the invention respectively inquires the three layers of ARP tables and the MAC table to finally determine the target output interface for forwarding the target data message, so that the three layers of ARP tables do not need to have a physical output interface, and the output interface is searched in the two layers of MAC tables, thereby solving the problem that the router takes longer time for learning the physical output interface of the three layers of routers to cause packet loss in the prior art, enabling the router to acquire the physical output interface without carrying out three layers of learning, improving the forwarding speed of the three layers of data messages and reducing the packet loss rate of the messages.
Example two
Fig. 2a is a flowchart of an implementation of an application scenario to which the embodiment of the present invention is applicable, and this embodiment may be combined with the various alternatives in the above embodiment. Specifically, referring to fig. 2a, the forwarding control method applied to the distributed forwarding system may include the following steps:
first, the switch sets a switch forwarding port and at least one blocking port in each port in the switch.
The application scenario of the present embodiment may be a virtual redundant routing protocol network including two routers as shown in fig. 2b, or may be a virtual redundant routing protocol network including a plurality of routers as shown in fig. 2 c. The forwarding control method will be described below by taking a virtual redundant routing protocol network as shown in fig. 2b as an example.
Illustratively, for a virtual redundant routing protocol network as shown in fig. 2b, the switch HostA of VLAN1, the switch Host C or the switch HostD of access VLAN2 are all three-layer parsed and forwarded by Router a. The switch HostA sets a port 1 in the switch HostA as a forwarding port and sets a port 2 as a blocking port; the switch HostB sets a port 4 in the switch HostB as a forwarding port and sets a port 3 as a blocking port; the switch HostC sets a port 5 in the switch HostC as a forwarding port and sets a port 6 as a blocking port; the switch HostD sets port 8 in itself as a forwarding port and port 7 as a blocking port. Therefore, the primary routers of the switch HostA and the switch HostB in the same VLAN are different, i.e. the forwarding ports of the switch HostA and the switch HostB in the same VLAN are connected to different routers. Likewise, the main routers of the switch HostC and the switch HostdD in the same VLAN are different, i.e. the forwarding ports of the switch HostC and the switch HostD in the same VLAN are connected with different routers.
And then, the switch forwards the data message to a router connected with the current switch forwarding port through the current switch forwarding port so as to perform table lookup forwarding on the data message through the router.
For the virtual redundant routing protocol network shown in fig. 2B, at this time, the address resolution protocol table and the medium access control address table of the Router a connected to the switches Host a and Host C, that is, the VRRP Router a ARP table and the routerA MAC table, and the address resolution protocol table and the medium access control address table of the Router B connected to the switches Host B and Host D, that is, the VRRP Router B ARP table and the routerA MAC table are sequentially shown in fig. 2D-2 g.
At this time, if the HostA of VLAN1 is to access the Host C or the HostD of VLAN2, the data packet may be forwarded to Router a through the switch port 1, and three-layer parsing and forwarding of the data packet are performed by Router a.
If the HostB of VLAN1 is to access Host C or HostD of VLAN2, the data message can be forwarded to Router B through switch port 4, and three layers of parsing and forwarding of the data message are performed by Router B.
If the HostC of VLAN2 is to access Host A or HostB of VLAN1, the data message can be forwarded to Router A through switch port 5, and three layers of parsing and forwarding of the data message are performed by Router A.
If the HostD of VLAN2 is to access Host A or HostB of VLAN1, the data message can be forwarded to Router B through switch port 8, and three-layer parsing and forwarding of the data message are performed by Router B.
And then, in the process of forwarding the data message to the virtual redundant routing protocol network, if the router connected with the forwarding port of the switch is detected to be faulty, the switch selects the target blocking port and switches the target blocking port into a new forwarding port of the switch.
For example, as shown in fig. 2b, if the router RouterA is powered off during the process of forwarding the data packet by the switch HostA, the switch HostA switches its own switch port 2 to a new switch forwarding port, and at the same time, the switch HostC detects that the router RouterA is faulty, switches its own switch port 6 to the new switch forwarding port, that is, both the switch HostA and the HostC use a transmission link with the router RouterA as a forwarding link.
It should be noted that, for a switch that switches a switch forwarding port due to the outage of RouterA, if the switch detects that RouterA is powered up and restored, the switch forwarding port of the switch itself may be switched back to the switch port corresponding to RouterA, and the current switch forwarding port may also be kept unchanged.
It should be noted that, for the virtual redundant routing protocol network shown in fig. 2c, any 1, 2, or 3 routers are powered down, and the switch may use the link aggregation technology to select an available transmission link, i.e. select a new switch forwarding port.
And then, the switch forwards the data message to a router corresponding to the forwarding port of the current switch through the forwarding port of the current switch.
Illustratively, as shown in fig. 2B, if the HostA of VLAN1 is to access the Host C or the HostD of VLAN2, the data packet may be forwarded to Router B through the switch port 2, so as to perform three-layer parsing and forwarding of the data packet through Router B.
If the HostB of VLAN1 is to access Host C or HostD of VLAN2, the data message can be forwarded to Router B through switch port 4, so as to perform three-layer parsing and forwarding of the data message through Router B.
If the HostC of VLAN2 is to access Host A or HostB of VLAN1, the data message can be forwarded to Router B through switch port 6, so as to perform three-layer parsing and forwarding of the data message through Router B.
If the HostD of VLAN2 is to access Host A or HostB of VLAN1, the data message can be forwarded to Router B through switch port 8, so as to perform three-layer parsing and forwarding of the data message through Router B.
And finally, when the router receives the data message, inquiring the ARP table and the MAC table stored by the router, and forwarding the data message according to the inquired target output interface.
Illustratively, as shown in fig. 2b, at this time, the MAC table of the router RouterB may be refreshed by sending two layer data messages between the switches, as shown in fig. 2 h. Taking the switch HostA of VLAN1 accessing the switch Host C of VLAN2 as an example, the table lookup forwarding process of the router is described. The router Router B obtains a destination Internet protocol address in the data message as IPC, queries a local VRRP Router B ARP table according to the IPC to obtain MACC and VLAN2 corresponding to the IPC, modifies the data message according to table lookup information MACC and VLAN2 correspondingly, then sends the modified data message to a physical loopback interface for loopback, queries the Router B MAC table according to the MACC to obtain a corresponding target output interface as a forwarding port 6 of the router Router B, and forwards the looped-back data message in two layers through the forwarding port 6 of the Router B.
It should be noted that, if RouterA is powered up and resumes, routerA may request RouterA to synchronize ARP tables, or RouterA itself learn ARP tables to conform to RouterA's ARP tables.
Note that the above is only a preferred embodiment of the present invention and the technical principle applied. It will be understood by those skilled in the art that the present invention is not limited to the particular embodiments described herein, but is capable of various obvious changes, rearrangements and substitutions as will now become apparent to those skilled in the art without departing from the scope of the invention. Therefore, while the invention has been described in connection with the above embodiments, the invention is not limited to the embodiments, but may be embodied in many other equivalent forms without departing from the spirit or scope of the invention, which is set forth in the following claims.

Claims (9)

1. A distributed forwarding system, comprising: each router in the virtual redundant routing protocol network is connected with each other, and at least two routers in the virtual redundant routing protocol network are in a forwarding state;
all routers in the virtual redundant routing protocol network store an Address Resolution Protocol (ARP) table in the local machine, wherein the ARP table comprises the corresponding relation between the Internet Protocol (IP) addresses and the Media Access Control (MAC) addresses of all hosts which can directly reach all the routers in the virtual redundant routing protocol network;
The first router connected to a blocked port of the switch or to a non-working network port of the host performs the following method:
receiving the corresponding relation between the IP address and the MAC address synchronized by the second router and storing the corresponding relation in an ARP table of the local machine, or receiving an ARP request message forwarded by the second router, obtaining the MAC address corresponding to the IP address in the ARP request message through learning and storing the MAC address in the ARP table of the local machine;
the second router is a router connected with a forwarding port of the switch or a working network port of the host;
any router cannot be connected with the forwarding ports of all the switches or with the blocking ports of all the switches;
the second router connected to the forwarding port of the switch or to the working network port of the host performs the following method:
after receiving the APR request message of the switch or the host, forwarding the APR request message to a first router connected with a blocking port of the switch or a non-working network port of the host; or,
synchronizing the learned correspondence between the IP address and the MAC address to the first router;
the router connected to the blocked port of the switch performs the following method:
After a router connected with a forwarding port of the switch fails, opening a blocking port to enable the blocking port to be in a forwarding state, and switching the router connected with the blocking port of the switch into a current main router of the switch;
the forwarding port and the blocking port of the switch are respectively connected with different routers in the virtual redundant routing protocol network and are used for forming a plurality of transmission links.
2. The system of claim 1, wherein all routers in the virtual redundant routing protocol network locally store a MAC table, and wherein the MAC table includes a correspondence between MAC addresses obtained by two-layer learning and physical interfaces.
3. The system of claim 2, wherein the second router coupled to the forwarding port of the switch or to the working port of the host performs the method of:
after receiving the target data message of the switch or the host, inquiring the ARP table and the MAC table stored by the host according to the target data message, and forwarding the target data message according to the inquired target output interface.
4. A system according to claim 3, wherein the second router connected to the forwarding port of the switch or to the working network port of the host performs the steps of querying the ARP table and the MAC table stored locally according to the target data message, and forwarding the target data message according to the queried target egress interface, comprising:
Inquiring a target MAC address matched with a target IP address in a target data message in an ARP table, inquiring a target output interface corresponding to the target MAC address in the MAC table, and forwarding the target data message according to the inquired target output interface.
5. The system of claim 4, wherein the egress interface for three-layer forwarding in each entry of the ARP table is a physical loopback interface or a logical loopback interface in the router;
the second router connected with the forwarding port of the switch or the working network port of the host executes the inquiry of the ARP table and the MAC table stored in the host, and forwards the target data message according to the inquired target output interface, and the method comprises the following steps:
inquiring a target MAC address matched with a target IP address in the target data message in the ARP table;
modifying the target data message according to the target MAC address, and carrying out virtual three-layer forwarding on the modified target data message through the physical loopback interface or the logic loopback interface;
and inquiring a target output interface corresponding to the target MAC address in the MAC table, and carrying out two-layer forwarding on the target data message which is subjected to virtual three-layer forwarding through the target output interface.
6. The system of claim 5, wherein the second router connected to the forwarding port of the switch or to the working port of the host further performs the method of:
the control layer transmits the corresponding relation between the IP address and the MAC address which are obtained by learning or synchronizing other routers to the forwarding layer;
and the forwarding layer stores the corresponding relation issued by the control layer in a local ARP (address resolution protocol) table entry, and replaces a physical output interface in the local ARP table entry with a physical loopback interface or a logical loopback interface of the router.
7. The system of claim 1, wherein the primary routers of different switches in the same VLAN are not identical.
8. A distributed forwarding system, comprising: each router in the virtual redundant routing protocol network is connected with each other;
the router stores an Address Resolution Protocol (ARP) table in the local machine, wherein the ARP table comprises the corresponding relation between the Internet Protocol (IP) addresses and the Media Access Control (MAC) addresses of all hosts which can directly reach each router in the virtual redundant routing protocol network;
the router stores an MAC table in the local machine, wherein the MAC table comprises the corresponding relation between an MAC address obtained through two-layer learning and a physical output interface;
The first router connected to a blocked port of the switch or to a non-working network port of the host performs the following method:
receiving the corresponding relation between the IP address and the MAC address synchronized by the second router and storing the corresponding relation in an ARP table of the local machine, or receiving an ARP request message forwarded by the second router, obtaining the MAC address corresponding to the IP address in the ARP request message through learning and storing the MAC address in the ARP table of the local machine;
the second router is a router connected with a forwarding port of the switch or a working network port of the host;
any router cannot be connected with the forwarding ports of all the switches or with the blocking ports of all the switches;
the second router connected to the forwarding port of the switch or to the working network port of the host performs the following method:
after receiving the APR request message of the switch or the host, forwarding the APR request message to a first router connected with a blocking port of the switch or a non-working network port of the host; or,
synchronizing the learned correspondence between the IP address and the MAC address to the first router;
the router connected to the blocked port of the switch performs the following method:
After a router connected with a forwarding port of the switch fails, opening a blocking port to enable the blocking port to be in a forwarding state, and switching the router connected with the blocking port of the switch into a current main router of the switch;
the forwarding port and the blocking port of the switch are respectively connected with different routers in the virtual redundant routing protocol network and are used for forming a plurality of transmission links.
9. The system according to claim 8, wherein the egress interface for three-layer forwarding in each entry of the ARP table is a physical loopback interface or a logical loopback interface in the router; the router connected to the forwarding port of the switch or to the second router connected to the working port of the host performs the following method:
inquiring a target MAC address matched with a target IP address in a target data message in the ARP table;
modifying the target data message according to the target MAC address, and carrying out virtual three-layer forwarding on the modified target data message through the physical loopback interface or the logic loopback interface;
and inquiring a target output interface corresponding to the target MAC address in the MAC table, and carrying out two-layer forwarding on the target data message which is subjected to virtual three-layer forwarding through the target output interface.
CN202011231628.4A 2020-11-06 2020-11-06 Distributed forwarding system Active CN112511419B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202011231628.4A CN112511419B (en) 2020-11-06 2020-11-06 Distributed forwarding system

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202011231628.4A CN112511419B (en) 2020-11-06 2020-11-06 Distributed forwarding system

Publications (2)

Publication Number Publication Date
CN112511419A CN112511419A (en) 2021-03-16
CN112511419B true CN112511419B (en) 2023-06-13

Family

ID=74955387

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202011231628.4A Active CN112511419B (en) 2020-11-06 2020-11-06 Distributed forwarding system

Country Status (1)

Country Link
CN (1) CN112511419B (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114979034B (en) * 2022-06-28 2024-03-26 北京东土军悦科技有限公司 Data packet forwarding system, method, device and storage medium

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035058A (en) * 2007-04-28 2007-09-12 杭州华三通信技术有限公司 Transfer method and device of the virtual router redundancy protocol message
CN101242254A (en) * 2008-02-26 2008-08-13 中兴通讯股份有限公司 Virtual redundant router system and method for transmitting virtual redundant routing protocol packet
CN102413046A (en) * 2011-11-24 2012-04-11 杭州华三通信技术有限公司 Method for forwarding flow by means of virtual router redundancy protocol backup set and equipment
CN103200117A (en) * 2013-03-04 2013-07-10 杭州华三通信技术有限公司 Method and device of load balancing

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101035058A (en) * 2007-04-28 2007-09-12 杭州华三通信技术有限公司 Transfer method and device of the virtual router redundancy protocol message
CN101242254A (en) * 2008-02-26 2008-08-13 中兴通讯股份有限公司 Virtual redundant router system and method for transmitting virtual redundant routing protocol packet
CN102413046A (en) * 2011-11-24 2012-04-11 杭州华三通信技术有限公司 Method for forwarding flow by means of virtual router redundancy protocol backup set and equipment
CN103200117A (en) * 2013-03-04 2013-07-10 杭州华三通信技术有限公司 Method and device of load balancing

Also Published As

Publication number Publication date
CN112511419A (en) 2021-03-16

Similar Documents

Publication Publication Date Title
US10686749B2 (en) Packet sending method and network device
CN112615778B (en) Message forwarding method, device, router, storage medium and system
WO2021088808A1 (en) Method for dual-homing device access traffic forwarding, device, and storage medium
US8300523B2 (en) Multi-chasis ethernet link aggregation
US7751329B2 (en) Providing an abstraction layer in a cluster switch that includes plural switches
US8817593B2 (en) Method and apparatus providing failover for a point to point tunnel for wireless local area network split-plane environments
JP5152642B2 (en) Packet ring network system, packet transfer method, and node
CN102439903B (en) Method, device and system for realizing disaster-tolerant backup
US7342874B2 (en) High-availability packet forwarding apparatus and method
CN111865779B (en) Route synchronization method and cross-device link aggregation group
JP4729119B2 (en) Communication device in label switching network
US8959201B2 (en) Limiting control traffic in a redundant gateway architecture
US20130272114A1 (en) Pseudo wire switching method and device
CN111740899A (en) ARP request message forwarding method, cross-device link aggregation group and network device
CN111935013B (en) Flow forwarding control method and device, flow forwarding method and chip, and switch
CN112134796B (en) Method, device and system for realizing flow switching
CN102148677A (en) Method for updating address resolution protocol table entries and core switch
JP2002057682A (en) Network interface changeover method and computer connectable to network
US10447652B2 (en) High availability bridging between layer 2 networks
US7440394B2 (en) Method and system for redundant IP forwarding in a telecommunications network
CN113259235A (en) IPv 6-based dual-active route redundancy method and system
CN107682261B (en) Flow forwarding method and device
CN112511419B (en) Distributed forwarding system
WO2022077972A1 (en) Mlag link failure switching method and apparatus
WO2022017225A1 (en) Message sending method, device and system

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