CN109495369B - Message forwarding method and device - Google Patents

Message forwarding method and device Download PDF

Info

Publication number
CN109495369B
CN109495369B CN201811611309.9A CN201811611309A CN109495369B CN 109495369 B CN109495369 B CN 109495369B CN 201811611309 A CN201811611309 A CN 201811611309A CN 109495369 B CN109495369 B CN 109495369B
Authority
CN
China
Prior art keywords
gateway device
distributed gateway
mac
mac address
client
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
CN201811611309.9A
Other languages
Chinese (zh)
Other versions
CN109495369A (en
Inventor
陈彦磊
苏平
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies Co Ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201811611309.9A priority Critical patent/CN109495369B/en
Publication of CN109495369A publication Critical patent/CN109495369A/en
Application granted granted Critical
Publication of CN109495369B publication Critical patent/CN109495369B/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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/09Mapping addresses
    • H04L61/10Mapping addresses of different types
    • H04L61/103Mapping addresses of different types across network layers, e.g. resolution of network layer into physical layer addresses or address resolution protocol [ARP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/28Data switching networks characterised by path configuration, e.g. LAN [Local Area Networks] or WAN [Wide Area Networks]
    • H04L12/46Interconnection of networks
    • H04L12/4641Virtual LANs, VLANs, e.g. virtual private networks [VPN]
    • 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
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5007Internet protocol [IP] addresses
    • H04L61/5014Internet protocol [IP] addresses using dynamic host configuration protocol [DHCP] or bootstrap protocol [BOOTP]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

The embodiment of the application provides a message forwarding method and a message forwarding device, relates to the technical field of communication, and is used for solving the problem that a client cannot apply for an IP address due to message forwarding errors in the prior art. The scheme of this application includes: after receiving a DHCP request message sent by a client, a first distributed gateway device acquires an MAC address of the client, forwards the DHCP request message to a three-layer gateway device, then sends the MAC address to a second distributed gateway device, so that the second distributed gateway device generates an MAC table entry, after receiving a DHCP reply message sent by the three-layer gateway device, the second distributed gateway device forwards the DHCP reply message to the first distributed gateway device according to the MAC table entry, and then receives the DHCP reply message sent by the second distributed gateway device.

Description

Message forwarding method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for forwarding a packet.
Background
For Ethernet Virtual Private Network (EVPN), in the networking scenario shown in fig. 1, leaf nodes (leaf)1 and leaf2 are distributed gateways, spine nodes (spine) are three-layer gateways, leaf1, leaf2 and spine are connected two by two, and the connection between leaf1 and leaf2 is Border Gateway Protocol (BGP) neighbor connection. spine is connected to a Dynamic Host Configuration Protocol (DHCP) server, and leaf1 or leaf2 holds the client down, and leaf1 or leaf2 can act as a DHCP relay.
Taking leaf1 as an example, when a client hanging under leaf1 applies for an Internet Protocol (IP) Address, it may send a DHCP Discover message to leaf1, and then leaf1 forwards the DHCP Discover message to spine as a DHCP relay, however, the source Address of the DHCP Discover message forwarded by leaf1 is the interface Address of the interface where leaf1 is connected to the client, so when a subsequent DHCP server sends a reply message, the interface Address will be used as the destination Address. However, Interface addresses of the same Virtual Switch Interface (VSI) on the leaf1 and the leaf2 are the same, which may cause that a packet that should be forwarded to the leaf1 may be forwarded to the leaf2, and cause that the client cannot apply for an IP address.
Disclosure of Invention
In view of this, embodiments of the present application provide a message forwarding method and apparatus, so as to solve the problem in the prior art that a client cannot apply for an IP address due to a message forwarding error. The specific technical scheme is as follows:
in a first aspect, an embodiment of the present application provides a packet forwarding method, where the method is applied to a first distributed gateway device, and the method includes:
after receiving a Dynamic Host Configuration Protocol (DHCP) request message sent by a client, acquiring a Media Access Control (MAC) address of the client, and forwarding the DHCP request message to three-layer gateway equipment;
sending the MAC address to second distributed gateway equipment so that the second distributed gateway equipment generates an MAC table entry, and after receiving a DHCP reply message sent by three-layer gateway equipment, the second distributed gateway equipment forwards the DHCP reply message to the first distributed gateway equipment according to the MAC table entry; the MAC entry includes a corresponding relationship between the MAC address and an outgoing interface, where the outgoing interface is an interface on the second distributed gateway device and used for connecting the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
and receiving a DHCP reply message sent by the second distributed gateway equipment.
In a possible implementation manner, the obtaining the MAC address of the client includes:
sending an Address Resolution Protocol (ARP) request message to the client;
and receiving an ARP reply message returned by the client, wherein the ARP reply message carries the MAC address of the client.
In one possible implementation, the sending the MAC address to the second distributed gateway device includes:
and sending a BGP Ethernet virtual private network EVPN route to the second distributed gateway equipment, wherein the BGP EVPN route carries the MAC address.
In a second aspect, an embodiment of the present application provides a packet forwarding method, where the method is applied to a second distributed gateway device, and the method includes:
receiving a Media Access Control (MAC) address of a client sent by the first distributed gateway equipment;
generating an MAC table item according to the MAC address, wherein the MAC table item comprises a corresponding relation between the MAC address and an output interface, and the output interface is arranged on the second distributed gateway device and used for being connected with the output interface of the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
and after receiving an internet protocol DHCP reply message sent by the three-layer gateway equipment, forwarding the DHCP reply message to the first distributed gateway equipment according to the MAC table entry.
In a possible implementation manner, the receiving a MAC address sent by a first distributed gateway device includes:
and receiving an EVPN route of a BGP Ethernet virtual private network sent by first distributed gateway equipment, wherein the BGP EVPN route carries the MAC address.
In a possible implementation manner, after receiving a DHCP reply message sent by a three-layer gateway device, the forwarding the DHCP reply message to the first distributed gateway device according to the MAC entry includes:
acquiring the MAC address of the client from the DHCP reply message;
searching an output interface corresponding to the MAC address from the MAC table entry;
and forwarding the DHCP reply message to the first distributed gateway equipment through the outgoing interface.
In a third aspect, an embodiment of the present application provides a packet forwarding apparatus, where the apparatus is applied to a first distributed gateway device, and the apparatus includes:
the system comprises an acquisition module, a three-layer gateway device and a control module, wherein the acquisition module is used for acquiring a Media Access Control (MAC) address of a client after receiving a Dynamic Host Configuration Protocol (DHCP) request message sent by the client and forwarding the DHCP request message to the three-layer gateway device;
a sending module, configured to send the MAC address to a second distributed gateway device, so that the second distributed gateway device generates an MAC entry, and after receiving a DHCP reply packet sent by a three-layer gateway device, the second distributed gateway device forwards the DHCP reply packet to the first distributed gateway device according to the MAC entry; the MAC entry includes a corresponding relationship between the MAC address and an outgoing interface, where the outgoing interface is an interface on the second distributed gateway device and used for connecting the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
and the receiving module is used for receiving the DHCP reply message sent by the second distributed gateway equipment.
In a possible implementation manner, the obtaining module is specifically configured to send an address resolution protocol, ARP, request message to the client; and receiving an ARP reply message returned by the client, wherein the ARP reply message carries the MAC address of the client.
In a possible implementation manner, the sending module is specifically configured to send a BGP ethernet virtual private network EVPN route to the second distributed gateway device, where the BGP EVPN route carries the MAC address.
In a fourth aspect, an embodiment of the present application provides a packet forwarding apparatus, where the apparatus is applied to a second distributed gateway device, and the apparatus includes:
a receiving module, configured to receive a media access control MAC address of a client sent by the first distributed gateway device;
a generating module, configured to generate an MAC entry according to the MAC address, where the MAC entry includes a correspondence between the MAC address and an egress interface, and the egress interface is on the second distributed gateway device and is used to connect to an egress interface of the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
and the sending module is used for forwarding the DHCP reply message to the first distributed gateway equipment according to the MAC table item after receiving the Internet protocol DHCP reply message sent by the three-layer gateway equipment.
In a possible implementation manner, the receiving module is specifically configured to receive a BGP EVPN route sent by the first distributed gateway device, where the BGP EVPN route carries the MAC address.
In a possible implementation manner, the sending module is specifically configured to obtain an MAC address of the client from the DHCP reply packet; searching an output interface corresponding to the MAC address from the MAC table entry; and forwarding the DHCP reply message to the first distributed gateway equipment through the outgoing interface.
In a fifth aspect, an embodiment of the present application provides a distributed gateway device, where the distributed gateway device includes: a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: the message forwarding method in the first aspect or the second aspect is implemented.
In a sixth aspect, an embodiment of the present application further provides a computer-readable storage medium, where a computer program is stored in the computer-readable storage medium, and when executed by a processor, the computer program implements the message forwarding method in the first aspect or the second aspect.
In a seventh aspect, an embodiment of the present application further provides a computer program product including instructions, which when run on a computer, causes the computer to execute the message forwarding method in the first aspect or the second aspect.
By adopting the message forwarding method provided by the embodiment of the application, after receiving the DHCP request message sent by the client, the first distributed gateway device can obtain the MAC address of the client, and send the MAC address to the second distributed gateway device, so that the second distributed gateway device can generate the MAC entry according to the MAC address. And then under the condition that the three-layer gateway device sends the DHCP reply message to the second distributed gateway device by mistake, the second distributed gateway device can also forward the DHCP reply message to the first distributed gateway device according to the MAC table entry, so that the client connected with the first distributed gateway device can apply for the IP address.
Of course, not all advantages described above need to be achieved at the same time in the practice of any one product or method of the present application.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic diagram of a networking architecture according to an embodiment of the present application;
fig. 2 is a flowchart of a message forwarding method according to an embodiment of the present application;
fig. 3 is a flowchart of another message forwarding method provided in the embodiment of the present application;
fig. 4 is a flowchart of another message forwarding method provided in the embodiment of the present application;
fig. 5 is a schematic structural diagram of a message forwarding apparatus according to an embodiment of the present application;
fig. 6 is a schematic structural diagram of another packet forwarding device according to an embodiment of the present application;
fig. 7 is a schematic structural diagram of a distributed gateway device according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
In order to solve the problem that a client cannot apply for an IP Address due to a message forwarding error in the prior art, in an embodiment of the present application, after receiving a DHCP request message sent by the client, a first distributed gateway device may obtain a Media Access Control (MAC) Address of the client, and send the MAC Address to a second distributed gateway device, where the second distributed gateway device generates an MAC entry according to the MAC Address, where the MAC entry includes a correspondence between the MAC Address and an egress interface, and the egress interface is an interface on the second distributed gateway device and used for connecting the first distributed gateway device through a Virtual Extensible LAN (VXLAN) tunnel. And if the second distributed gateway equipment receives the DHCP reply message sent by the three-layer gateway equipment, the IP node reply message can be forwarded to the first distributed gateway equipment through the MAC table item.
Therefore, by adopting the method, even if the DHCP reply message is wrongly forwarded, the second distributed gateway equipment can forward the IP address reply message to the first distributed gateway equipment, so that the first distributed gateway equipment can send the IP address reply message to the client, the client applies for the IP address, and the problem that the client cannot acquire the IP address due to the message forwarding error is solved.
The following describes in detail a packet forwarding method provided in this embodiment with reference to fig. 1.
An embodiment of the present application provides a message forwarding method, where the method is applied to a first distributed gateway device (for example, a leaf1 in fig. 1), and as shown in fig. 2, the method includes:
s201, after receiving an Internet protocol DHCP request message sent by a client, obtaining an MAC address of the client, and forwarding the DHCP request message to three-layer gateway equipment.
The DHCP request message may be a DHCP discover message.
After receiving the DHCP request message, the first distributed gateway device may forward the DHCP request message to the three-layer gateway device, and the three-layer gateway device forwards the DHCP request message to the DHCP server.
In addition, after receiving the DHCP request message, the first distributed gateway device may obtain an MAC Address of the client through an Address Resolution Protocol (ARP), where the obtaining method includes: the first distributed gateway equipment sends an ARP request message to the client, and then can receive an ARP reply message returned by the client, wherein the ARP reply message carries the MAC address of the client.
Optionally, after receiving the MAC address of the client, the first distributed gateway device may store a corresponding relationship between the MAC address and an online port of the client. The online port of the client refers to an interface connected to the client on the first distributed gateway device.
S202, sending an MAC address to the second distributed gateway device so that the second distributed gateway device generates an MAC table entry, and after receiving a DHCP reply message sent by the three-layer gateway device, the second distributed gateway device forwards the DHCP reply message to the first distributed gateway device according to the MAC table entry.
The MAC table entry comprises a corresponding relation between an MAC address and an output interface, and the output interface is an interface on the second distributed gateway device and used for being connected with the first distributed gateway device through an extensible virtual local area network VXLAN tunnel. And the DHCP reply message carries the IP address distributed by the DHCP server to the client.
Specifically, the first distributed gateway device may send a BGP EVPN route to the second distributed gateway device, where the BGP EVPN route carries the MAC address of the client.
It should be noted that the first distributed gateway device may be a leaf1 in fig. 1, and correspondingly, the second distributed gateway device is a leaf2 in fig. 1. Alternatively, the first distributed gateway device may be leaf2 in fig. 1, and correspondingly, the second distributed gateway device may be leaf1 in fig. 1.
The three-tier gateway device may be spine in fig. 1.
S203, receiving a DHCP reply message sent by the second distributed gateway equipment.
After receiving the DHCP reply message sent by the second distributed gateway device, the first distributed gateway device may obtain the MAC address of the client carried in the DHCP reply message, and then forward the DHCP reply message to the client according to the DHCP relay entry and the MAC address of the client.
The DHCP relay table entry includes a correspondence between the MAC address of the client and an interface on the first distributed gateway device for connecting the client.
Optionally, the first distributed gateway device may also receive a DHCP reply message sent by the three-layer gateway device, and if an MAC address of the client carried in the DHCP reply message matches an MAC address in a DHCP relay entry, it indicates that the DHCP reply message is correctly forwarded, and the first distributed gateway device may forward the DHCP reply message to the client through an interface corresponding to the MAC in the DHCP relay entry.
If the MAC address of the client carried by the DHCP reply message is not matched with the MAC address in the DHCP relay table entry, judging whether the MAC table entry has the MAC address matched with the MAC address, and if so, forwarding the DHCP reply message to other distributed gateway equipment according to the MAC table entry.
By adopting the message forwarding method provided by the embodiment of the application, after receiving the DHCP request message sent by the client, the first distributed gateway device can obtain the MAC address of the client, and send the MAC address to the second distributed gateway device, so that the second distributed gateway device can generate the MAC entry according to the MAC address. And then under the condition that the three-layer gateway device sends the DHCP reply message to the second distributed gateway device by mistake, the second distributed gateway device can also forward the DHCP reply message to the first distributed gateway device according to the MAC table entry, so that the client connected with the first distributed gateway device can apply for the IP address.
Corresponding to the embodiment shown in fig. 2, an embodiment of the present application further provides a method for forwarding a packet, where the method is applied to a second distributed gateway device (for example, a leaf2 in fig. 1), and as shown in fig. 3, the method includes:
s301, receiving the MAC address of the client sent by the first distributed gateway device.
Specifically, the second distributed gateway device may receive a BGP EVPN route sent by the first distributed gateway device, where the BGP EVPN route carries a MAC address of the client.
S302, generating an MAC table item according to the MAC address.
The MAC table entry comprises a corresponding relation between the MAC address and an output interface, and the output interface is arranged on the second distributed gateway device and is used for being connected with the output interface of the first distributed gateway device through the VXLAN tunnel.
And S303, after receiving the Internet protocol DHCP reply message sent by the three-layer gateway equipment, forwarding the DHCP reply message to the first distributed gateway equipment according to the MAC table entry.
And the DHCP reply message carries the IP address allocated to the client.
After receiving the DHCP reply message, the second distributed gateway device may obtain the MAC address of the Client from the DHCP reply message, and specifically, may obtain the MAC address of the Client from a Client hardware address field.
And then the second distributed gateway equipment judges whether the MAC address is matched with the MAC address in the DHCP relay table entry maintained by the second distributed gateway equipment, if so, the second distributed gateway equipment determines an interface corresponding to the MAC address according to the DHCP relay table entry, and forwards the DHCP reply message to the client connected to the second distributed gateway equipment through the interface.
If the DHCP relay table entry does not have the MAC address, an output interface corresponding to the MAC address is searched from the MAC table entry, and the DHCP reply message is forwarded to the first distributed gateway equipment through the output interface.
By adopting the message forwarding method provided by the embodiment of the application, the second distributed gateway device can receive the MAC address sent by the first distributed gateway device, and further generate the MAC entry according to the MAC address, and under the condition that the third-layer gateway device mistakenly sends the DHCP reply message to the second distributed gateway device, the second distributed gateway device can also forward the DHCP reply message to the first distributed gateway device according to the MAC entry, so that the client connected with the first distributed gateway device can apply for the IP address.
The following describes, with reference to fig. 1, a message forwarding method provided in the embodiment of the present application by using a specific example, as shown in fig. 4, the method includes:
s401, the client sends a DHCP discover message to the leaf 1. Correspondingly, the leaf1 receives the DHCP discover message sent by the client.
S402, leaf1 sends an ARP request message to the client.
S403, the client sends an ARP reply message to the leaf1, wherein the ARP reply message carries the MAC address of the client.
S404, leaf1 sends BGP EVPN route to leaf2, and BGP EVPN route carries MAC address of client.
S405, leaf2 generates a MAC table entry, wherein the MAC table entry comprises the MAC address and an interface connected with leaf1 on leaf 2.
S406, leaf1 forwards the DHCP discover message to spine.
S407, spine forwards the DHCP discover message to the DHCP server.
S408, the DHCP server sends a DHCP offer message to the spine, and the DHCP offer message carries the MAC address of the client.
S409, spine sends DHCP offer message to leaf 2.
It should be noted that spine should send a DHCP offer message to the leaf1, and after receiving the DHCP offer message, the leaf1 may forward the DHCP offer message to the client.
If the spine sends the DHCP offer message to the leaf2 by mistake, the following steps are also executed.
S410, the leaf2 forwards the DHCP offer message to the leaf1 according to the MAC table entry.
Specifically, the leaf2 may obtain the MAC address of the client from the DHCP offer message, then determine whether the MAC address matches the MAC address in the MAC entry, if so, search an interface corresponding to the high MAC address from the MAC entry, and forward the DHCP offer message to the leaf1 through the interface.
S411, leaf1 forwards the DHCP offer message to the client.
It can be understood that the subsequent client also sends a DHCP Request message to the leaf1, and then the leaf1 forwards the DHCP Request message to the spine, and then the spine forwards the DHCP Request message to the DHCP server.
Subsequently, if the DHCP ACK (DHCP acknowledge) packet sent by the DHCP server is forwarded to the leaf2, the leaf2 may forward the DHCP ACK packet to the leaf1 according to the MAC entry by using the method of S410.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides a packet forwarding apparatus, where the apparatus is applied to a first distributed gateway device, and as shown in fig. 5, the apparatus includes: an acquisition module 501, a sending module 502 and a receiving module 503.
An obtaining module 501, configured to obtain a media access control MAC address of a client after receiving a dynamic host configuration protocol DHCP request message sent by the client, and forward the DHCP request message to a three-layer gateway device;
a sending module 502, configured to send an MAC address to a second distributed gateway device, so that the second distributed gateway device generates an MAC entry, and after receiving a DHCP reply message sent by a third-layer gateway device, the second distributed gateway device forwards the DHCP reply message to the first distributed gateway device according to the MAC entry; the MAC table entry comprises a corresponding relation between an MAC address and an output interface, and the output interface is an interface on the second distributed gateway equipment and used for being connected with the first distributed gateway equipment through an extensible virtual local area network VXLAN tunnel;
the receiving module 503 is configured to receive a DHCP reply message sent by the second distributed gateway device.
Optionally, the obtaining module 501 is specifically configured to send an ARP request message to a client; and receiving an ARP reply message returned by the client, wherein the ARP reply message carries the MAC address of the client.
Optionally, the sending module 503 is specifically configured to send a BGP ethernet virtual private network EVPN route to the second distributed gateway device, where the BGP EVPN route carries the MAC address.
Corresponding to the foregoing method embodiment, an embodiment of the present application further provides another packet forwarding apparatus, where the apparatus is applied to a second distributed gateway device, and as shown in fig. 6, the apparatus includes: a receiving module 601, a generating module 602 and a sending module 603.
A receiving module 601, configured to receive a media access control MAC address of a client sent by a first distributed gateway device;
a generating module 602, configured to generate an MAC entry according to the MAC address, where the MAC entry includes a correspondence between the MAC address and an output interface, and the output interface is on the second distributed gateway device and is used to connect with an output interface of the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
the sending module 603 is configured to, after receiving an internet protocol DHCP reply message sent by the three-layer gateway device, forward the DHCP reply message to the first distributed gateway device according to the MAC entry.
Optionally, the receiving module 601 is specifically configured to receive a BGP ethernet virtual private network EVPN route sent by the first distributed gateway device, where the BGP EVPN route carries a MAC address.
Optionally, the sending module 603 is specifically configured to obtain the MAC address of the client from the DHCP reply message; searching an output interface corresponding to the MAC address from the MAC table entry; and forwarding the DHCP reply message to the first distributed gateway equipment through the outgoing interface.
The embodiment of the present application further provides a distributed gateway device, as shown in fig. 7, including a processor 701, a communication interface 702, a memory 703 and a communication bus 704, where the processor 701, the communication interface 702, and the memory 703 complete mutual communication through the communication bus 704,
a memory 703 for storing a computer program;
the processor 701 is configured to implement the steps executed by the first distributed gateway device and the second distributed gateway device in the foregoing method embodiment when executing the program stored in the memory 703.
The communication bus mentioned in the above distributed gateway apparatus may be a Peripheral Component Interconnect (PCI) bus, an Extended Industry Standard Architecture (EISA) bus, or the like. The communication bus may be divided into an address bus, a data bus, a control bus, etc. For ease of illustration, only one thick line is shown, but this does not mean that there is only one bus or one type of bus.
The communication interface is used for communication between the distributed gateway device and other devices.
The Memory may include a Random Access Memory (RAM) or a Non-Volatile Memory (NVM), such as at least one disk Memory. Optionally, the memory may also be at least one memory device located remotely from the processor.
The Processor may be a general-purpose Processor, including a Central Processing Unit (CPU), a Network Processor (NP), and the like; but also Digital Signal Processors (DSPs), Application Specific Integrated Circuits (ASICs), Field Programmable Gate Arrays (FPGAs) or other Programmable logic devices, discrete Gate or transistor logic devices, discrete hardware components.
In another embodiment provided by the present application, a computer-readable storage medium is further provided, in which a computer program is stored, and the computer program, when executed by a processor, implements the steps of any of the message forwarding methods described above.
In yet another embodiment provided by the present application, there is also provided a computer program product containing instructions which, when run on a computer, cause the computer to perform any of the message forwarding methods in the above embodiments.
In the above embodiments, the implementation may be wholly or partially realized by software, hardware, firmware, or any combination thereof. When implemented in software, may be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When loaded and executed on a computer, cause the processes or functions described in accordance with the embodiments of the application to occur, in whole or in part. The computer may be a general purpose computer, a special purpose computer, a network of computers, or other programmable device. The computer instructions may be stored in a computer readable storage medium or transmitted from one computer readable storage medium to another, for example, from one website site, computer, server, or data center to another website site, computer, server, or data center via wired (e.g., coaxial cable, fiber optic, Digital Subscriber Line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.). The computer-readable storage medium can be any available medium that can be accessed by a computer or a data storage device, such as a server, a data center, etc., that incorporates one or more of the available media. The usable medium may be a magnetic medium (e.g., floppy Disk, hard Disk, magnetic tape), an optical medium (e.g., DVD), or a semiconductor medium (e.g., Solid State Disk (SSD)), among others.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
All the embodiments in the present specification are described in a related manner, and the same and similar parts among the embodiments may be referred to each other, and each embodiment focuses on the differences from the other embodiments. In particular, for the system embodiment, since it is substantially similar to the method embodiment, the description is simple, and for the relevant points, reference may be made to the partial description of the method embodiment.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (14)

1. A message forwarding method is applied to a first distributed gateway device, and the method comprises the following steps:
after receiving a Dynamic Host Configuration Protocol (DHCP) request message sent by a client, acquiring a Media Access Control (MAC) address of the client, and forwarding the DHCP request message to three-layer gateway equipment;
sending the MAC address to second distributed gateway equipment so that the second distributed gateway equipment generates an MAC table entry, and after receiving a DHCP reply message sent by three-layer gateway equipment, the second distributed gateway equipment forwards the DHCP reply message to the first distributed gateway equipment according to the MAC table entry; the MAC entry includes a corresponding relationship between the MAC address and an outgoing interface, where the outgoing interface is an interface on the second distributed gateway device and used for connecting the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
and receiving a DHCP reply message sent by the second distributed gateway equipment.
2. The method of claim 1, wherein the obtaining the MAC address of the client comprises:
sending an Address Resolution Protocol (ARP) request message to the client;
and receiving an ARP reply message returned by the client, wherein the ARP reply message carries the MAC address of the client.
3. The method of claim 1 or 2, wherein said sending the MAC address to the second distributed gateway device comprises:
and sending a BGP Ethernet virtual private network EVPN route to the second distributed gateway equipment, wherein the BGP EVPN route carries the MAC address.
4. A message forwarding method is applied to a second distributed gateway device, and the method comprises the following steps:
receiving a Media Access Control (MAC) address of a client sent by the first distributed gateway equipment;
generating an MAC table item according to the MAC address, wherein the MAC table item comprises a corresponding relation between the MAC address and an output interface, and the output interface is arranged on the second distributed gateway device and used for being connected with the output interface of the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
and after receiving an internet protocol DHCP reply message sent by the three-layer gateway equipment, forwarding the DHCP reply message to the first distributed gateway equipment according to the MAC table entry.
5. The method of claim 4, wherein the receiving the MAC address sent by the first distributed gateway device comprises:
and receiving an EVPN route of a BGP Ethernet virtual private network sent by first distributed gateway equipment, wherein the BGP EVPN route carries the MAC address.
6. The method of claim 4, wherein after receiving a DHCP reply message sent by a three-layer gateway device, forwarding the DHCP reply message to the first distributed gateway device according to the MAC entry includes:
acquiring the MAC address of the client from the DHCP reply message;
searching an output interface corresponding to the MAC address from the MAC table entry;
and forwarding the DHCP reply message to the first distributed gateway equipment through the outgoing interface.
7. A message forwarding apparatus, wherein the apparatus is applied to a first distributed gateway device, and the apparatus comprises:
the system comprises an acquisition module, a three-layer gateway device and a control module, wherein the acquisition module is used for acquiring a Media Access Control (MAC) address of a client after receiving a Dynamic Host Configuration Protocol (DHCP) request message sent by the client and forwarding the DHCP request message to the three-layer gateway device;
a sending module, configured to send the MAC address to a second distributed gateway device, so that the second distributed gateway device generates an MAC entry, and after receiving a DHCP reply packet sent by a three-layer gateway device, the second distributed gateway device forwards the DHCP reply packet to the first distributed gateway device according to the MAC entry; the MAC entry includes a corresponding relationship between the MAC address and an outgoing interface, where the outgoing interface is an interface on the second distributed gateway device and used for connecting the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
and the receiving module is used for receiving the DHCP reply message sent by the second distributed gateway equipment.
8. The apparatus of claim 7,
the acquisition module is specifically used for sending an Address Resolution Protocol (ARP) request message to the client; and receiving an ARP reply message returned by the client, wherein the ARP reply message carries the MAC address of the client.
9. The apparatus according to claim 7 or 8,
the sending module is specifically configured to send a BGP ethernet virtual private network EVPN route to the second distributed gateway device, where the BGP EVPN route carries the MAC address.
10. A message forwarding apparatus, wherein the apparatus is applied to a second distributed gateway device, and the apparatus comprises:
a receiving module, configured to receive a media access control MAC address of a client sent by the first distributed gateway device;
a generating module, configured to generate an MAC entry according to the MAC address, where the MAC entry includes a correspondence between the MAC address and an egress interface, and the egress interface is on the second distributed gateway device and is used to connect to an egress interface of the first distributed gateway device through an extensible virtual local area network VXLAN tunnel;
and the sending module is used for forwarding the DHCP reply message to the first distributed gateway equipment according to the MAC table item after receiving the Internet protocol DHCP reply message sent by the three-layer gateway equipment.
11. The apparatus of claim 10,
the receiving module is specifically configured to receive a BGP EVPN route that carries the MAC address and is sent by the first distributed gateway device.
12. The apparatus of claim 10,
the sending module is specifically configured to obtain an MAC address of the client from the DHCP reply message; searching an output interface corresponding to the MAC address from the MAC table entry; and forwarding the DHCP reply message to the first distributed gateway equipment through the outgoing interface.
13. A distributed gateway device comprising a processor and a machine-readable storage medium storing machine-executable instructions executable by the processor, the processor being caused by the machine-executable instructions to: carrying out the method steps of any one of claims 1 to 3 or 4 to 6.
14. A machine-readable storage medium having stored thereon machine-executable instructions that, when invoked and executed by a processor, cause the processor to: carrying out the method steps of any one of claims 1 to 3 or 4 to 6.
CN201811611309.9A 2018-12-27 2018-12-27 Message forwarding method and device Active CN109495369B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811611309.9A CN109495369B (en) 2018-12-27 2018-12-27 Message forwarding method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811611309.9A CN109495369B (en) 2018-12-27 2018-12-27 Message forwarding method and device

Publications (2)

Publication Number Publication Date
CN109495369A CN109495369A (en) 2019-03-19
CN109495369B true CN109495369B (en) 2020-11-27

Family

ID=65712617

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811611309.9A Active CN109495369B (en) 2018-12-27 2018-12-27 Message forwarding method and device

Country Status (1)

Country Link
CN (1) CN109495369B (en)

Families Citing this family (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN113132505A (en) * 2020-01-10 2021-07-16 华为技术有限公司 Method, device, computing equipment and storage medium for sending response message
CN113285780B (en) * 2020-02-20 2022-08-19 华为技术有限公司 Method, device and system for configuring transmission pipeline
US11425044B2 (en) * 2020-10-15 2022-08-23 Cisco Technology, Inc. DHCP layer 2 relay in VXLAN overlay fabric
CN112422713B (en) * 2020-11-18 2022-08-26 中国联合网络通信集团有限公司 IP address obtaining method and VTEP node

Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634844A (en) * 2012-08-24 2014-03-12 中兴通讯股份有限公司 Method and system for realizing distributed multi-port DHCP relay
CN107094110A (en) * 2017-04-19 2017-08-25 新华三技术有限公司 A kind of DHCP message retransmission method and device
CN107547665A (en) * 2016-06-23 2018-01-05 华为技术有限公司 A kind of method, equipment and the system of dhcp address distribution
CN108023971A (en) * 2016-11-04 2018-05-11 新华三技术有限公司 A kind of DHCP message retransmission method and device

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7512969B2 (en) * 2003-11-21 2009-03-31 Time Warner Cable, A Division Of Time Warner Entertainment Company, L.P. System and method for detecting and reporting cable network devices with duplicate media access control addresses

Patent Citations (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103634844A (en) * 2012-08-24 2014-03-12 中兴通讯股份有限公司 Method and system for realizing distributed multi-port DHCP relay
CN107547665A (en) * 2016-06-23 2018-01-05 华为技术有限公司 A kind of method, equipment and the system of dhcp address distribution
CN108023971A (en) * 2016-11-04 2018-05-11 新华三技术有限公司 A kind of DHCP message retransmission method and device
CN107094110A (en) * 2017-04-19 2017-08-25 新华三技术有限公司 A kind of DHCP message retransmission method and device

Also Published As

Publication number Publication date
CN109495369A (en) 2019-03-19

Similar Documents

Publication Publication Date Title
CN109495369B (en) Message forwarding method and device
CN107547349B (en) Virtual machine migration method and device
US9515988B2 (en) Device and method for split DNS communications
US9871762B2 (en) Translating network address
US20110113142A1 (en) Smart client routing
US20150033321A1 (en) Construct large-scale dvpn
CN107094110B (en) DHCP message forwarding method and device
US10574570B2 (en) Communication processing method and apparatus
CN107809386B (en) IP address translation method, routing device and communication system
US8887237B2 (en) Multimode authentication
CN109547350B (en) Route learning method and gateway equipment
CN105591907A (en) Route acquisition method and device
CN108023971B (en) DHCP message forwarding method and device
CN115913597A (en) Method and device for determining lost host
CN109617817B (en) Method and device for generating forwarding table entry of MLAG networking
WO2017219816A1 (en) Data transmission method and network address translation device
US11405275B2 (en) Automatically determining mesh network role of network device
WO2016177185A1 (en) Method and apparatus for processing media access control (mac) address
US10904037B2 (en) Relaying apparatus, relaying method, and relaying system
CN109218182B (en) Method and device for synchronizing routing information
JP6378121B2 (en) Gateway apparatus and communication method
US11063886B2 (en) System and method for directing data packets by a virtual switch over a unidirectional medium
CN109462609B (en) ARP (Address resolution protocol) inhibition table entry generation method and device
US20100172266A1 (en) Dynamic network configuration for a network device
CN114679370A (en) Server hosting method, device, system and storage medium

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