WO2011120459A2 - Message forwarding method, equipment and network device - Google Patents

Message forwarding method, equipment and network device Download PDF

Info

Publication number
WO2011120459A2
WO2011120459A2 PCT/CN2011/073689 CN2011073689W WO2011120459A2 WO 2011120459 A2 WO2011120459 A2 WO 2011120459A2 CN 2011073689 W CN2011073689 W CN 2011073689W WO 2011120459 A2 WO2011120459 A2 WO 2011120459A2
Authority
WO
WIPO (PCT)
Prior art keywords
next hop
address
mac address
identification information
layer
Prior art date
Application number
PCT/CN2011/073689
Other languages
French (fr)
Chinese (zh)
Other versions
WO2011120459A3 (en
Inventor
於少峰
任广涛
龙志平
Original Assignee
华为技术有限公司
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 华为技术有限公司 filed Critical 华为技术有限公司
Priority to CN201180000590.2A priority Critical patent/CN102217253B/en
Priority to PCT/CN2011/073689 priority patent/WO2011120459A2/en
Publication of WO2011120459A2 publication Critical patent/WO2011120459A2/en
Publication of WO2011120459A3 publication Critical patent/WO2011120459A3/en

Links

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/66Layer 2 routing, e.g. in Ethernet based MAN's

Definitions

  • the embodiments of the present invention relate to network communication technologies, and in particular, to a packet forwarding method, device, and network device. Background technique
  • An existing Layer 3 switch is configured to bind a physical port in the same virtual local area network (VLAN) to a virtual port (VLANIF) and configure an Internet Protocol (IP) address for the virtual port.
  • IP Internet Protocol
  • MAC Media Access Control
  • the VLANIF-based Layer 3 forwarding process is as follows: When receiving a packet, the forwarding module first searches the Layer 3 routing table according to the destination IP address of the packet, and obtains the outbound interface information and the next hop IP address corresponding to the destination IP address. The outbound interface information and the next hop IP address look up the Address Resolution Protocol (ARP) table, obtain the corresponding MAC address and the outbound port information, and forward the packet to the physical port corresponding to the outbound port information. The network device corresponding to the MAC address. If the forwarding module searches for the ARP table based on the outbound interface information and the next hop IP address, it does not match the corresponding MAC address and the outbound port information. The ARP loss (MISS) message is reported to the ARP module. The ARP module sends the ARP module to the VLANIF. All the physical ports send ARP request packets for ARP learning.
  • ARP Address Resolution Protocol
  • the Layer 3 switch deletes the ARP table on the primary port.
  • the forwarding module receives the packet, the ARP packet is sent to the ARP module because the ARP table cannot be found.
  • the ARP module broadcasts an ARP request packet to all physical ports in the corresponding VLANIF. Perform ARP learning to establish an ARP table for storing the user's IP address, MAC address, and corresponding outgoing port information for the alternate port.
  • the embodiments of the present invention provide a packet forwarding method, a device, and a network device, which are used to solve the problem that the device is busy and the traffic is interrupted when the primary port and the standby port are switched in the prior art, and the efficiency of packet forwarding is improved.
  • the embodiment of the invention provides a packet forwarding method, including:
  • next hop MAC address corresponding to the next hop identification information is composed;
  • the embodiment of the invention provides a message forwarding device, which includes:
  • the first obtaining module is configured to query the Layer 3 routing table according to the destination Internet Protocol IP address of the received packet, and obtain the next hop identification information;
  • a second obtaining module configured to query an address resolution protocol ARP table according to the next hop identifier information, and obtain a next hop media access control MAC address corresponding to the next hop identifier information, where the ARP table is The first hop MAC address is configured by the next hop MAC address, and the third hopping module is configured to query the layer 2 forwarding table according to the next hop MAC address to obtain the next hop MAC address. Corresponding outgoing port information; The forwarding module is configured to forward the packet from the egress port corresponding to the egress port information.
  • the embodiment of the invention provides a network device, which includes the packet forwarding device provided by the embodiment of the invention.
  • the packet forwarding method, the device, and the network device in the embodiment of the present invention use the destination IP address of the received packet to query the Layer 3 routing table to obtain the next hop identification information, and then query the next hop identification information according to the next hop identification information.
  • the ARP table consisting of the next hop MAC address corresponding to the hop information and the next hop identifier information, obtains the corresponding MAC address, and then queries the Layer 2 forwarding table according to the obtained MAC address, and obtains the location from the Layer 2 forwarding table.
  • the technical solution of forwarding the packet from the outbound port of the MAC address, and the ARP table includes only the next hop identification information and the corresponding MAC address, and no longer includes the MAC address corresponding to the MAC address.
  • the ARP learning is not required.
  • the learning of the Layer 2 forwarding table is used to update the correspondence between the MAC address and the outgoing port information. This solves the problem of generating a large number of ARP Miss reports when the port is switched.
  • the message and the ARP request packet cause the device to be busy and the traffic is interrupted in an instant, which improves the forwarding efficiency of the packet.
  • FIG. 1 is a flowchart of a packet forwarding method according to an embodiment of the present invention
  • FIG. 2 is a schematic structural diagram of a packet forwarding apparatus according to an embodiment of the present invention.
  • FIG. 3 is a schematic structural diagram of a packet forwarding apparatus according to another embodiment of the present invention. detailed description
  • FIG. 1 is a flowchart of a packet forwarding method according to an embodiment of the present invention. As shown in FIG. 1, the method of this embodiment includes:
  • Step 11 Query the Layer 3 routing table according to the destination IP address of the received packet to obtain the next hop identification information.
  • the Layer 3 switch When other devices on the network send packets to the Layer 3 switch, they will carry the IP address information (source IP address and destination IP address) in the packets to be forwarded by the Layer 3 switch.
  • the Layer 3 switch performs Layer 3 forwarding based on the Layer 3 routing table stored therein.
  • the Layer 3 routing table stores the destination IP address and the next hop identification information corresponding to the destination IP address.
  • the next hop identification information in this embodiment is mainly the information of the outbound interface corresponding to the destination IP address and the next hop IP address of the outbound interface of the route.
  • the outbound interface information includes the outbound interface type and the outbound interface index.
  • the outbound interface is the physical port of the VLANIF
  • the outbound interface is VLANIF
  • the outbound interface index is the VLANIF ID of the VLANIF. For example, if the VLANIF corresponding to VLAN 100 is created, the outbound interface index corresponding to VLANIF is VLAN 100.
  • the Layer 3 switch parses the packet and obtains the destination IP address of the packet.
  • the Layer 3 routing table is queried with the destination IP address of the packet. If the IP address of the same IP address is found in the Layer 3 routing table, The next hop identification information corresponding to the IP address with the same destination IP address.
  • the local Layer 3 switch is the last hop of the received packet, that is, the destination IP address of the packet is the IP address of a physical port of the Layer 3 switch, the next hop identification information is obtained.
  • the lieutenant will not include the next hop IP address, but only the routing outbound interface information. If the local Layer 3 switch is not the last hop, the obtained next hop identification information includes both the outbound interface information and the next hop IP address.
  • the physical interface of the outbound interface is the VLANIF identifier, which is the VLAN ID corresponding to the VLANIF.
  • Step 12 Query the ARP table according to the next hop identification information, and obtain the information corresponding to the next hop identification information. a next hop MAC address, where the ARP table is composed of the next hop identification information and the next if mega MAC address corresponding to the next hop identification information;
  • the next hop MAC address refers to the MAC address of the physical device corresponding to the next hop IP address.
  • the ARP table is composed of the next hop identification information and a corresponding next hop MAC address. That is, when the next hop identification information includes the next hop IP address, the ARP table includes only the corresponding information of the outbound interface information, the next hop IP address, and the next hop MAC address; and the next hop identification information does not include the next hop IP address.
  • the ARP table only includes the outbound interface information, the IP address of a physical port on the Layer 3 switch (that is, the destination IP address of the port), and the MAC address of the device directly connected to the physical port.
  • the Layer 3 switch specifically searches for the ARP table by using the outbound interface identifier (and the next hop IP address).
  • the MAC address (that is, the next hop MAC address) of the entry in the ARP table that matches the route outbound interface identifier and the next hop IP address.
  • the next hop MAC address can uniquely identify the next message received.
  • the Layer 3 switch queries the ARP table with the outgoing interface identifier and the destination IP address in the packet, and obtains the route and the route in the ARP table.
  • the MAC address (that is, the next hop MAC address) in the entry that matches the destination IP address and the destination IP address in the packet.
  • the physical device corresponding to the next hop MAC address is directly connected to the Layer 3 switch through the physical port corresponding to the outbound interface identifier, and is the final receiver of the packet.
  • Step 13 Query the Layer 2 forwarding table according to the next hop MAC address, and obtain the outbound port corresponding to the next hop MAC address.
  • the Layer 3 switch obtains the next hop MAC address after querying the ARP table.
  • the Layer 2 forwarding table is further queried according to the obtained next hop MAC address, to obtain the port information corresponding to the next hop MAC address (that is, the outbound port information).
  • a Layer 2 forwarding table is also stored on the Layer 3 switch, and the Layer 2 forwarding table stores three layers.
  • the port information of the switch and the MAC address of the network device connected to each physical port are used by the Layer 3 switch for Layer 2 forwarding.
  • the Layer 3 switch uses the obtained next hop MAC address as an input to query the Layer 2 forwarding table, and obtains the port information corresponding to the MAC address of the Layer 2 forwarding table that is the same as the next hop MAC address.
  • Step 14 Forward the packet from the egress port corresponding to the egress port information.
  • the Layer 3 switch After obtaining the egress port corresponding to the next hop MAC address, the Layer 3 switch forwards the packet from the egress port, that is, forwards the packet to the network device corresponding to the next hop MAC address.
  • the Layer 3 switch first searches the Layer 3 routing table according to the destination IP address of the packet, obtains the next hop identification information, and then queries the ARP table according to the next hop identification information to obtain the next hop MAC address. Then, the device searches for the Layer 2 forwarding table according to the obtained next hop MAC address, obtains the egress port, and forwards the packet through the egress port, so that the ARP table can include only the next hop identification information and the corresponding MAC address, and no longer includes The port information corresponding to the MAC address. Therefore, when intra-VLAN port switching occurs, ARP learning is not required. The learning of the MAC address and port information can be updated by learning the Layer 2 forwarding table.
  • the switch has a large number of ARP Miss packets and ARP request packets, which causes the Layer 3 switch to be busy and interrupted. This improves the forwarding efficiency of packets.
  • the primary port and the backup port are switched, and the network device connected to the primary port is connected to the Layer 3 switch through another physical port (backup port).
  • the switch between the switch and the network device has been switched.
  • the outbound interface before and after the switch belongs to the same VLAN. Therefore, the mapping between the VLANIF identifier and the MAC address does not change.
  • the ARP table in this embodiment only includes the VLANIF identifier, the next hop IP address, and the next hop.
  • the correspondence between the MAC addresses and the port information is not included. Therefore, the information in the ARP table does not change when the egress port is switched.
  • the ARP Miss message and the large number of ARP requests are not generated.
  • the packet is used to reduce the load on the Layer 3 switch.
  • the ARP learning does not cause traffic interruption caused by ARP learning, which improves the efficiency and quality of forwarding packets.
  • the Layer 3 switch when receiving a packet, the Layer 3 switch establishes a physical port by obtaining the physical MAC address used to receive the packet and parsing the received packet to obtain the source MAC address. The correspondence between the MAC addresses of the network devices connected to the physical ports to form a Layer 2 forwarding table.
  • the Layer 3 switch dynamically updates the Layer 2 forwarding table according to the actual usage of its physical ports. The update process is the same as the process of forming the Layer 2 forwarding table.
  • the Layer 3 switch learns that the physical port is switched according to the received packet, and updates the Layer 2 forwarding table according to the switched physical port, that is, the MAC address corresponding to the original port.
  • the corresponding port information is updated to the outbound port after the switch; the updated Layer 2 forwarding table stores the correspondence between the information of the outbound port and the MAC address corresponding to the original port. Since the Layer 2 forwarding table on the Layer 3 switch is usually maintained by a dedicated hardware module, its update speed is relatively fast.
  • the Layer 3 switch when the port is switched, when the Layer 3 switch queries the Layer 2 forwarding table to perform Layer 2 forwarding according to the MAC address obtained by querying the ARP table, the Layer 3 switch can obtain the correct outgoing port.
  • the outbound port ensures that packets are forwarded through the correct outbound interface, which ensures that packets are successfully forwarded.
  • the method before the next hop MAC address corresponding to the next hop identification information is obtained by querying the ARP table according to the next hop identification information, the method further includes: generating an ARP table according to the received ARP response message. .
  • the Layer 3 switch when receiving the first packet, the Layer 3 switch generates an ARP request packet according to the destination IP address of the first packet, and broadcasts on the physical port of the corresponding VLANIF according to the VLAN value carried in the packet.
  • the ARP request packet after receiving the ARP request packet, the other network device in the same VLAN that is connected to the Layer 3 switch in the network determines whether the IP address of the device is the same as the IP address used for the MAC address in the ARP request packet. If they are not the same, they do not respond.
  • the ARP response packet carries the IP address and MAC address of the network device.
  • the Layer 3 switch After receiving the ARP response packet, the Layer 3 switch receives the information of the outgoing interface of the ARP response packet, that is, the VLAN ID and VLANIF type of the VLANIF, and the IP address and MAC address of the network device in the ARP response packet. Store to form ARP table. The information of the outbound interface and the IP address of the network device are used as the next hop identification information, and the MAC address of the network device is used as the next hop MAC address.
  • the Layer 3 switch learns only the information of the egress port to the VLANIF layer, instead of learning the specific physical port, and realizes the separation between the ARP table and the physical port.
  • the device does not need to perform ARP learning when the intra-VLAN port is switched.
  • the queried ARP is used to obtain the next hop MAC address.
  • the Layer 2 forwarding table is used to find the egress port according to the obtained next hop MAC address.
  • the packet forwarding method in this embodiment first searches for the Layer 3 routing table to obtain the next hop identification information, queries the ARP table according to the next hop identification information, and obtains the next hop MAC address, and then searches for the second layer according to the next hop MAC address.
  • the message is forwarded to the Layer 2 forwarding module by the Layer 3 forwarding module.
  • the Layer 2 forwarding module forwards the packet based on the obtained egress port.
  • the Layer 3 forwarding and Layer 2 forwarding are combined to successfully forward the packet.
  • the ARP table is separated from the physical port information, and ARP learning is not required when the intra-VLAN port is switched. This solves the problem that a large number of ARP Miss messages and a large number of ARP request packets are generated due to intra-VLAN port switching.
  • the three-layer switch is very busy and the traffic is interrupted, which improves the success rate of packet forwarding.
  • FIG. 2 is a schematic structural diagram of a packet forwarding apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus in this embodiment includes: a first acquiring module 21, a second obtaining module 22, a third obtaining module 23, and a forwarding module 24.
  • the first obtaining module 21 is configured to query the Layer 3 routing table according to the destination IP address of the received packet to obtain the next hop identification information.
  • the destination IP address and destination are stored in the Layer 3 routing table in this embodiment.
  • the next hop identification information corresponding to the IP address; the next hop identification information is the information of the outbound interface corresponding to the destination IP address and the next hop IP address of the outbound interface of the route.
  • the information of the outbound interface includes the outbound interface type and Outbound interface index.
  • the second hop block 22 is connected to the first hop module 21, and is configured to query the ARP table according to the next hop identification information acquired by the first obtaining module 21, and obtain a next hop MAC corresponding to the next hop identifier information.
  • the ARP table in this embodiment is composed of the next hop identification information and the next hop MAC address corresponding to the next hop identification information.
  • the third obtaining module 23 is connected to the second obtaining module 22,
  • the second layer forwarding table is used to query the second-layer forwarding table according to the next hop MAC address obtained by the second obtaining module 22, and obtain the outbound port information corresponding to the next hop MAC address.
  • the forwarding module 24 is connected to the third obtaining module 23, and is configured to forward the outbound port corresponding to the outbound port information obtained by the third obtaining block 23 from the packet.
  • the foregoing function module of the packet forwarding device in this embodiment can be used to perform the process of the packet forwarding method provided in the foregoing embodiment.
  • the working principle is not described here. For details, refer to the description of the method embodiment.
  • the packet forwarding device of the present embodiment obtains the next hop identification information by using the first acquiring module to query the Layer 3 routing table, and the second obtaining module queries the AP table to obtain the next hop MAC address, and then queries the second layer through the third obtaining module.
  • the forwarding table obtains the egress port, and the forwarding module forwards the packet from the egress port, so that the ARP table can include only the next hop identification information and the corresponding MAC address, and no longer includes the port information corresponding to the MAC address, therefore,
  • the packet forwarding device in this embodiment does not need to perform ARP learning when forwarding packets.
  • the learning of the Layer 2 forwarding table can be used to update the correspondence between the MAC address and the port information.
  • FIG. 3 is a schematic structural diagram of a packet forwarding apparatus according to another embodiment of the present invention. The embodiment is implemented based on the embodiment shown in FIG. 2. As shown in FIG. 3, the apparatus of this embodiment further includes: a generating module 31.
  • the generating module 31 is configured to generate an ARP table according to the received ARP response packet before the second obtaining module 22 queries the ARP table.
  • the packet forwarding device generates an ARP request packet according to the first packet received, and broadcasts the generated ARP request packet to all the physical ports in the VLAN where the packet is sent.
  • the ARP request packet is received.
  • the network device determines whether the IP address of the requesting MAC address in the ARP request packet is the same as the IP address of the ARP request packet, and determines that the same network device generates an ARP response packet including the IP address and the MAC address and sends the packet to the packet forwarding.
  • the device is specifically sent to the generating module 31 in the message forwarding device.
  • the generating module 31 is configured to receive the information of the routing interface of the ARP response packet.
  • the outbound interface information mainly refers to the VLAN value corresponding to the VALNIF (that is, the VLANIF identifier) and the VLANIF type.
  • the IP address and MAC address of the device are stored to form an ARP table.
  • the message forwarding device of this embodiment further includes: an update module 32.
  • the update module 32 is configured to update the port information corresponding to the next hop MAC address in the Layer 2 forwarding table to be the switched out port when the egress port is switched.
  • the update module 32 can obtain the physical port connected to the physical port and the physical port by obtaining the physical port used to receive the packet and parsing the source MAC address in the received packet when receiving the packet.
  • the correspondence between the MAC addresses is generated or updated according to the obtained correspondence. If the physical port corresponding to the obtained MAC address is different from that stored in the Layer 2 forwarding table, the port information corresponding to the MAC address in the Layer 2 forwarding table is changed to the information of the newly acquired physical port.
  • the packet forwarding device in this embodiment may be the last hop or not the last hop of the received packet. If the packet forwarding device in this embodiment is the last hop of the packet, the next hop identification information acquired by the first obtaining module 21 does not include the next hop IP address, but only the routing outbound interface information (mainly If the packet forwarding device of the present embodiment is not the last hop of the packet, the next hop identification information acquired by the first obtaining module 21 includes the outbound interface information (mainly The route outbound interface identifier and the next hop IP address.
  • the embodiment provides an implementation structure of the second obtaining module 22.
  • Second acquisition module 22 Second acquisition module
  • the second obtaining module 22 includes: a first acquisition unit 221 and a second acquisition unit 222. If the outbound interface is the VLANIF as an example, the second obtaining module 22 works as follows: When the next hop identification information acquired by the first obtaining module 21 includes the VLANIF identifier and the next hop IP address, the first acquiring unit 221 The VLANIF identifier and the next hop IP address are used as input parameters to query the ARP table to obtain the next hop MAC address. When the next hop identification information acquired by the first obtaining module 21 does not include the next hop IP address, the second acquisition is performed. The unit 222 uses the VLANIF identifier and the destination IP address in the packet as input parameters to query the ARP table to obtain the next hop MAC address.
  • the packet forwarding device in this embodiment may be a network device having a packet forwarding function, such as a Layer 3 switch.
  • the first obtaining module 21, the second obtaining module 22, and the generating module in the packet forwarding device of this embodiment The block 31 is mainly processed based on the layer 3 routing table, and can be divided into three layers of function modules; and the third obtaining module 23, the forwarding module 24, and the updating module 32 are mainly processed based on the layer 2 forwarding table, which can be divided into The second layer of functional modules.
  • the packet forwarding device of the present embodiment first searches for the Layer 3 routing table to obtain the next hop identification information by using the foregoing function module or unit, and queries the ARP table according to the next hop identification information to obtain the next hop MAC address.
  • the Layer 2 forwarding table is searched according to the next hop MAC address, and the packet is forwarded by the Layer 3 function module to the Layer 2 function module, and then the Layer 2 function module forwards the packet according to the obtained egress port, and forwards the Layer 3 packet.
  • Layer 2 forwarding is combined.
  • the ARP table is separated from the physical port information. ARP learning is not required when the intra-VLAN port is switched. This solves the problem of VLAN switching in the prior art. A large number of ARP Miss messages and a large number of ARP request packets cause the Layer 3 switch to be busy and interrupted. This improves the success rate of packet forwarding.
  • An embodiment of the present invention provides a network device, where the network device includes a packet forwarding device.
  • the network device includes a packet forwarding device.
  • the description of the working process of the packet forwarding device refer to the description of the embodiment shown in FIG. 1.
  • the structure refer to the description of the embodiment shown in FIG. 2 and FIG. 3, and details are not described herein again.
  • the network device in this embodiment may be a Layer 3 switch, etc., and may use the process of the packet forwarding method provided by the foregoing method to forward the packet, which solves the problem that a large number of ARP Miss messages are generated due to port switching in the VLAN.
  • the problem that the Layer 3 switch is busy and the traffic is interrupted due to a large number of ARP request packets improves the success rate of packet forwarding.

Landscapes

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

Abstract

Embodiments of the present invention provide a message forwarding method, equipment and network device, wherein the message forwarding method includes the following steps: a layer 3 routing table is queried, according to the destination internet protocol (IP) address of a received message, to acquire the next-hop identification information; an address resolution protocol (ARP) table is queried, according to the next-hop identification information, to acquire the next-hop media access control (MAC) address corresponding to the next-hop identification information, wherein the ARP table is composed of the next-hop identification information and the next-hop MAC address corresponding to the next-hop identification information; a layer 2 forwarding table is queried, according to the next-hop MAC address, to acquire the exit port information corresponding to the next-hop MAC address; the message is forwarded out via the exit port corresponding to the exit port information. By applying the technical solution of the present invention to forward the message, the instantaneous busy problem of the device and the problem of the traffic interruption can be solved, wherein the problems are caused by that a large number of ARP Miss messages and ARP request messages are generated when the port switch in a virtual local area network (VLAN) occurs in the prior art. Therefore, the forwarding efficiency of the message is improved.

Description

报文转发方法、 装置及网络设备  Message forwarding method, device and network device
技术领域 Technical field
本发明实施例涉及网络通信技术, 尤其涉及一种报文转发方法、 装置及 网络设备。 背景技术  The embodiments of the present invention relate to network communication technologies, and in particular, to a packet forwarding method, device, and network device. Background technique
现有三层交换机通过将同一虚拟局域网( Virtual Local Area Network; 简 称为: VLAN ) 内的物理端口绑定为虚拟端口 (VLANIF ) , 并为虚拟端口配 置网际协议 ( Internet Protocol;简称为: IP )地址、媒体访问控制( Media Access Control; 简称为: MAC ) 地址等来实现三层转发。  An existing Layer 3 switch is configured to bind a physical port in the same virtual local area network (VLAN) to a virtual port (VLANIF) and configure an Internet Protocol (IP) address for the virtual port. Media Access Control (MAC) addresses are used to implement Layer 3 forwarding.
基于 VLANIF的三层转发过程为: 转发模块在接收到报文时, 首先根据 报文的目的 IP地址查找三层路由表, 获取目的 IP地址对应的出接口信息和 下一跳 IP 地址, 再根据出接口信息和下一跳 IP 地址查找地址解析协议 ( Address Resolution Protocol; 简称为: ARP )表, 获取对应的 MAC地址和 出端口信息, 将才艮文从该出端口信息对应的物理端口转发给 MAC地址对应 的网络设备。如果转发模块根据出接口信息和下一跳 IP地址查找 ARP表时, 未匹配到相应的 MAC地址和出端口信息, 将会上报 ARP 丟失 (MISS ) 消 息给 ARP模块,以使 ARP模块向该 VLANIF下的所有物理端口发送 ARP请 求报文进行 ARP学习。  The VLANIF-based Layer 3 forwarding process is as follows: When receiving a packet, the forwarding module first searches the Layer 3 routing table according to the destination IP address of the packet, and obtains the outbound interface information and the next hop IP address corresponding to the destination IP address. The outbound interface information and the next hop IP address look up the Address Resolution Protocol (ARP) table, obtain the corresponding MAC address and the outbound port information, and forward the packet to the physical port corresponding to the outbound port information. The network device corresponding to the MAC address. If the forwarding module searches for the ARP table based on the outbound interface information and the next hop IP address, it does not match the corresponding MAC address and the outbound port information. The ARP loss (MISS) message is reported to the ARP module. The ARP module sends the ARP module to the VLANIF. All the physical ports send ARP request packets for ARP learning.
其中, 在 VLAN内端口备份( Port Backup )的场景下, 当主端口故障时, 用户会切换到备用端口上, 而三层交换机会将主端口下的 ARP表删除。 在这 种情况下, 转发模块接收到报文时会因查找不到 ARP 表而上报 ARP 丟失 ( Miss ) 消息给 ARP模块, ARP模块向相应 VLANIF下的所有物理端口广 播 ARP请求报文, 以通过重新进行 ARP学习为备用端口建立存储用户的 IP 地址、 MAC地址以及对应出端口等信息的 ARP表。 在实现本发明的过程中, 发明人发现现有技术至少存在以下不足: 当主 端口上的用户较多时, 会造成大量 ARP Miss消息和大量 ARP请求报文, 这 将导致设备瞬间很忙, 并且在 ARP学习过程中还会导致流量的中断, 降低了 报文转发的效率。 发明内容 In the scenario of port backup in the port, when the primary port fails, the user switches to the standby port, and the Layer 3 switch deletes the ARP table on the primary port. In this case, when the forwarding module receives the packet, the ARP packet is sent to the ARP module because the ARP table cannot be found. The ARP module broadcasts an ARP request packet to all physical ports in the corresponding VLANIF. Perform ARP learning to establish an ARP table for storing the user's IP address, MAC address, and corresponding outgoing port information for the alternate port. In the process of implementing the present invention, the inventor has found that the prior art has at least the following disadvantages: When there are many users on the primary port, a large number of ARP Miss messages and a large number of ARP request messages are generated, which will cause the device to be very busy in an instant, and During the ARP learning process, traffic is interrupted, which reduces the efficiency of packet forwarding. Summary of the invention
本发明实施例提供一种报文转发方法、 装置及网络设备, 用以解决现有技 术中主端口和备用端口切换时导致设备很忙、 流量中断的问题, 提高报文转发 的效率。  The embodiments of the present invention provide a packet forwarding method, a device, and a network device, which are used to solve the problem that the device is busy and the traffic is interrupted when the primary port and the standby port are switched in the prior art, and the efficiency of packet forwarding is improved.
本发明实施例提供一种报文转发方法, 包括:  The embodiment of the invention provides a packet forwarding method, including:
根据接收到 4艮文的目的网际协议 IP地址查询三层路由表, 获取下一跳标识 信息;  Querying the Layer 3 routing table according to the destination Internet Protocol IP address of the received message, and obtaining the next hop identification information;
根据所述下一跳标识信息查询地址解析协议 ARP表, 获取与所述下一跳标 识信息对应的下一跳媒体访问控制 MAC地址, 所述 ARP表由所述下一跳标识 信息和所述下一跳标识信息对应的下一跳 MAC地址组成;  Querying an address resolution protocol ARP table according to the next hop identifier information, and acquiring a next hop media access control MAC address corresponding to the next hop identifier information, where the ARP table is configured by the next hop identifier information and the The next hop MAC address corresponding to the next hop identification information is composed;
根据所述下一跳 MAC地址查询二层转发表, 获取所述下一跳 MAC地址对 应的出端口信息;  Querying the Layer 2 forwarding table according to the next hop MAC address, and obtaining the outbound port information corresponding to the next hop MAC address;
将所述才艮文从所述出端口信息对应的出端口转发出去。  And forwarding the packet from the egress port corresponding to the egress port information.
本发明实施例提供一种报文转发装置, 包括:  The embodiment of the invention provides a message forwarding device, which includes:
第一获取模块, 用于根据接收到报文的目的网际协议 IP地址查询三层路由 表, 获取下一跳标识信息;  The first obtaining module is configured to query the Layer 3 routing table according to the destination Internet Protocol IP address of the received packet, and obtain the next hop identification information;
第二获取模块, 用于根据所述下一跳标识信息查询地址解析协议 ARP表, 获取与所述下一跳标识信息对应的下一跳媒体访问控制 MAC地址, 所述 ARP 表由所述下一跳标识信息和所述下一跳标识信息对应的下一跳 MAC地址组成; 第三获取模块, 用于根据所述下一跳 MAC地址查询二层转发表, 获取所述 下一跳 MAC地址对应的出端口信息; 转发模块, 用于将所述报文从所述出端口信息对应的出端口转发出去。 本发明实施例提供一种网络设备, 包括本发明实施例提供的报文转发装置。 本发明实施例的报文转发方法、 装置及网络设备, 采用根据接收到的报文 的目的 IP地址查询三层路由表, 获取下一跳标识信息, 然后根据下一跳标识信 息查询由下一跳标识信息和下一跳标识信息对应的下一跳 MAC 地址组成的 ARP表, 获取对应的 MAC地址, 再根据获取的 MAC地址查询二层转发表, 从 所述二层转发表中获取与所述 MAC地址对应的出端口信息,从而将报文从获取 的出端口转发出去的技术方案, 由于 ARP表仅包括下一跳标识信息和与之对应 的 MAC地址, 不再包括与 MAC地址对应的出端口信息, 在端口发生切换时, 不需要进行 ARP学习, 而利用二层转发表的学习来实现 MAC地址与出端口信 息对应关系的更新,解决了在端口发生切换时因产生大量 ARP Miss报文和 ARP 请求报文导致设备瞬间很忙和流量中断的问题, 提高了报文的转发效率。 附图说明 a second obtaining module, configured to query an address resolution protocol ARP table according to the next hop identifier information, and obtain a next hop media access control MAC address corresponding to the next hop identifier information, where the ARP table is The first hop MAC address is configured by the next hop MAC address, and the third hopping module is configured to query the layer 2 forwarding table according to the next hop MAC address to obtain the next hop MAC address. Corresponding outgoing port information; The forwarding module is configured to forward the packet from the egress port corresponding to the egress port information. The embodiment of the invention provides a network device, which includes the packet forwarding device provided by the embodiment of the invention. The packet forwarding method, the device, and the network device in the embodiment of the present invention use the destination IP address of the received packet to query the Layer 3 routing table to obtain the next hop identification information, and then query the next hop identification information according to the next hop identification information. The ARP table consisting of the next hop MAC address corresponding to the hop information and the next hop identifier information, obtains the corresponding MAC address, and then queries the Layer 2 forwarding table according to the obtained MAC address, and obtains the location from the Layer 2 forwarding table. The technical solution of forwarding the packet from the outbound port of the MAC address, and the ARP table includes only the next hop identification information and the corresponding MAC address, and no longer includes the MAC address corresponding to the MAC address. When the port is switched, the ARP learning is not required. The learning of the Layer 2 forwarding table is used to update the correspondence between the MAC address and the outgoing port information. This solves the problem of generating a large number of ARP Miss reports when the port is switched. The message and the ARP request packet cause the device to be busy and the traffic is interrupted in an instant, which improves the forwarding efficiency of the packet. DRAWINGS
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实施 例或现有技术描述中所需要使用的附图作一简单地介绍, 显而易见地, 下面描 述中的附图是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出 创造性劳动的前提下, 还可以根据这些附图获得其他的附图。  In order to more clearly illustrate the embodiments of the present invention or the technical solutions in the prior art, a brief description of the drawings used in the embodiments or the prior art description will be briefly described below. Obviously, the drawings in the following description It is a certain embodiment of the present invention, and other drawings can be obtained from those skilled in the art without any creative work.
图 1为本发明一实施例提供的报文转发方法的流程图;  FIG. 1 is a flowchart of a packet forwarding method according to an embodiment of the present invention;
图 2为本发明一实施例提供的报文转发装置的结构示意图;  FIG. 2 is a schematic structural diagram of a packet forwarding apparatus according to an embodiment of the present invention;
图 3为本发明又一实施例提供的报文转发装置的结构示意图。 具体实施方式  FIG. 3 is a schematic structural diagram of a packet forwarding apparatus according to another embodiment of the present invention. detailed description
为使本发明实施例的目的、 技术方案和优点更加清楚, 下面将结合本发明 实施例中的附图, 对本发明实施例中的技术方案进行清楚、 完整地描述, 显然, 所描述的实施例是本发明一部分实施例, 而不是全部的实施例。 基于本发明中 的实施例, 本领域普通技术人员在没有作出创造性劳动前提下所获得的所有其 他实施例, 都属于本发明保护的范围。 The technical solutions in the embodiments of the present invention are clearly and completely described in the following with reference to the accompanying drawings in the embodiments of the present invention. It is a partial embodiment of the invention, and not all of the embodiments. Based on the present invention All other embodiments obtained by those skilled in the art without creative efforts are within the scope of the present invention.
图 1为本发明一实施例提供的报文转发方法的流程图。 如图 1所示, 本实 施例的方法包括:  FIG. 1 is a flowchart of a packet forwarding method according to an embodiment of the present invention. As shown in FIG. 1, the method of this embodiment includes:
步骤 11、 根据接收到报文的目的 IP地址查询三层路由表, 获取下一跳标识 信息;  Step 11: Query the Layer 3 routing table according to the destination IP address of the received packet to obtain the next hop identification information.
网络中的其他设备向三层交换机发送报文时, 会在发送的报文中携带 IP地 址信息(源 IP地址和目的 IP地址 ), 以供三层交换机进行三层转发。 三层交换 机进行三层转发基于其上存储的三层路由表, 该三层路由表中存储有目的 IP地 址和与目的 IP地址对应的下一跳标识信息。 本实施例的下一跳标识信息主要是 指与目的 IP地址对应的路由出接口的信息和该路由出接口的下一跳 IP地址,路 由出接口的信息包括出接口类型和出接口索引。 当路由出接口为 VLANIF下的 物理端口时, 该出接口的类型为 VLANIF , 出接口索引即 VLANIF 标识为该 VLANIF对应的 VLAN值。 例如: 如果创建 VLAN 100对应的 VLANIF, 则 VLANIF对应的出接口索引即为 VLAN 100。  When other devices on the network send packets to the Layer 3 switch, they will carry the IP address information (source IP address and destination IP address) in the packets to be forwarded by the Layer 3 switch. The Layer 3 switch performs Layer 3 forwarding based on the Layer 3 routing table stored therein. The Layer 3 routing table stores the destination IP address and the next hop identification information corresponding to the destination IP address. The next hop identification information in this embodiment is mainly the information of the outbound interface corresponding to the destination IP address and the next hop IP address of the outbound interface of the route. The outbound interface information includes the outbound interface type and the outbound interface index. When the outbound interface is the physical port of the VLANIF, the outbound interface is VLANIF, and the outbound interface index is the VLANIF ID of the VLANIF. For example, if the VLANIF corresponding to VLAN 100 is created, the outbound interface index corresponding to VLANIF is VLAN 100.
三层交换机解析报文并获取报文的目的 IP地址,以报文的目的 IP地址为输 入查询三层路由表; 如果在三层路由表中查询到与目的 IP地址相同的 IP地址, 则获取与目的 IP地址相同的 IP地址所对应的下一跳标识信息。  The Layer 3 switch parses the packet and obtains the destination IP address of the packet. The Layer 3 routing table is queried with the destination IP address of the packet. If the IP address of the same IP address is found in the Layer 3 routing table, The next hop identification information corresponding to the IP address with the same destination IP address.
其中, 对于接收到的报文而言, 若本地三层交换机是其最后一跳, 即报文 的目的 IP地址为三层交换机的某个物理端口的 IP地址,则获取的下一跳标识信 息中将不包括下一跳 IP地址, 而仅包括路由出接口信息。 若本地三层交换机不 是其最后一跳, 则获取的下一跳标识信息同时包括路由出接口信息和下一跳 IP 地址。  If the local Layer 3 switch is the last hop of the received packet, that is, the destination IP address of the packet is the IP address of a physical port of the Layer 3 switch, the next hop identification information is obtained. The lieutenant will not include the next hop IP address, but only the routing outbound interface information. If the local Layer 3 switch is not the last hop, the obtained next hop identification information includes both the outbound interface information and the next hop IP address.
在本实施例中, 以路由出接口为 VLANIF下的物理端口为例, 则出接口信 息主要是指 VLANIF标识, 亦即 VLANIF对应的 VLAN值。  In this embodiment, the physical interface of the outbound interface is the VLANIF identifier, which is the VLAN ID corresponding to the VLANIF.
步骤 12、 根据下一跳标识信息查询 ARP表, 获取与下一跳标识信息对应的 下一跳 MAC地址, 所述 ARP表由下一跳标识信息和下一跳标识信息对应的下 一 if兆 MAC地址组成; Step 12: Query the ARP table according to the next hop identification information, and obtain the information corresponding to the next hop identification information. a next hop MAC address, where the ARP table is composed of the next hop identification information and the next if mega MAC address corresponding to the next hop identification information;
其中, 下一跳 MAC地址是指下一跳 IP地址对应的物理设备的 MAC地址。 在本实施例中 , ARP表由下一跳标识信息和与之对应的下一跳 MAC地址组成。 即当下一跳标识信息包括下一跳 IP地址时, ARP表中仅包括路由出接口信息、 下一跳 IP地址和下一跳 MAC地址的对应关系; 当下一跳标识信息不包括下一 跳 IP地址时, ARP表仅包括路由出接口信息、三层交换机上某个物理端口的 IP 地址(即^艮文的目的 IP地址)和与该物理端口直接连接的设备的 MAC地址。  The next hop MAC address refers to the MAC address of the physical device corresponding to the next hop IP address. In this embodiment, the ARP table is composed of the next hop identification information and a corresponding next hop MAC address. That is, when the next hop identification information includes the next hop IP address, the ARP table includes only the corresponding information of the outbound interface information, the next hop IP address, and the next hop MAC address; and the next hop identification information does not include the next hop IP address. At the address, the ARP table only includes the outbound interface information, the IP address of a physical port on the Layer 3 switch (that is, the destination IP address of the port), and the MAC address of the device directly connected to the physical port.
具体的, 当下一跳标识信息包括路由出接口标识(例如 VLANIF标识 )和 下一跳 IP地址时, 三层交换机具体以路由出接口标识(和下一跳 IP地址为输入 查询 ARP表, 并获取 ARP表中与路由出接口标识和下一跳 IP地址均匹配的表 项中的 MAC地址(即下一跳 MAC地址) 。 其中, 该下一跳 MAC地址可唯一 标识接收该 4艮文的下一台物理设备。  Specifically, when the next hop identification information includes the outbound interface identifier (such as the VLANIF identifier) and the next hop IP address, the Layer 3 switch specifically searches for the ARP table by using the outbound interface identifier (and the next hop IP address). The MAC address (that is, the next hop MAC address) of the entry in the ARP table that matches the route outbound interface identifier and the next hop IP address. The next hop MAC address can uniquely identify the next message received. A physical device.
当下一跳标识信息仅包括路由出接口标识而不包括下一跳 IP地址时, 三层 交换机以路由出接口标识和报文中的目的 IP地址为输入查询 ARP表, 并获取 ARP表中与路由出接口标识和报文中的目的 IP地址均匹配的表项中的 MAC地 址(即下一跳 MAC地址) 。 此时, 该下一跳 MAC地址对应的物理设备, 通过 路由出接口标识对应的物理端口与三层交换机直接相连, 并且为该报文的最终 接收者。  When the next hop identification information includes only the outbound interface identifier and the next hop IP address, the Layer 3 switch queries the ARP table with the outgoing interface identifier and the destination IP address in the packet, and obtains the route and the route in the ARP table. The MAC address (that is, the next hop MAC address) in the entry that matches the destination IP address and the destination IP address in the packet. At this time, the physical device corresponding to the next hop MAC address is directly connected to the Layer 3 switch through the physical port corresponding to the outbound interface identifier, and is the final receiver of the packet.
步骤 13、根据下一跳 MAC地址查询二层转发表, 获取下一跳 MAC地址对 应的出端口;  Step 13. Query the Layer 2 forwarding table according to the next hop MAC address, and obtain the outbound port corresponding to the next hop MAC address.
由于在本实施例中, ARP表中未存储有下一跳 MAC地址对应的网络设备 与三层交换机相连接的端口信息, 因此, 三层交换机在查询 ARP表获取到下一 跳 MAC地址后, 进一步根据获取的下一跳 MAC地址查询二层转发表, 以获取 下一跳 MAC地址对应的端口信息 (即出端口信息 ) 。  In this embodiment, after the ARP table does not store the port information of the network device corresponding to the next hop MAC address and the Layer 3 switch, the Layer 3 switch obtains the next hop MAC address after querying the ARP table. The Layer 2 forwarding table is further queried according to the obtained next hop MAC address, to obtain the port information corresponding to the next hop MAC address (that is, the outbound port information).
其中, 在三层交换机上还存储有二层转发表, 该二层转发表中存储有三层 交换机的端口信息以及各物理端口所连接的网络设备的 MAC地址,以供三层交 换机进行二层转发。 具体的, 三层交换机以获取的下一跳 MAC地址作为输入查 询二层转发表, 并获取二层转发表中与该下一跳 MAC地址相同的 MAC地址对 应的端口信息。 A Layer 2 forwarding table is also stored on the Layer 3 switch, and the Layer 2 forwarding table stores three layers. The port information of the switch and the MAC address of the network device connected to each physical port are used by the Layer 3 switch for Layer 2 forwarding. Specifically, the Layer 3 switch uses the obtained next hop MAC address as an input to query the Layer 2 forwarding table, and obtains the port information corresponding to the MAC address of the Layer 2 forwarding table that is the same as the next hop MAC address.
步骤 14、 将报文从所述出端口信息对应的出端口转发出去。  Step 14: Forward the packet from the egress port corresponding to the egress port information.
在获取下一跳 MAC地址对应的出端口后,三层交换机将报文从该出端口转 发出去, 即转发给下一跳 MAC地址对应的网络设备。  After obtaining the egress port corresponding to the next hop MAC address, the Layer 3 switch forwards the packet from the egress port, that is, forwards the packet to the network device corresponding to the next hop MAC address.
本实施例的报文转发方法, 三层交换机首先根据报文的目的 IP地址查找三 层路由表, 获取下一跳标识信息, 然后根据下一跳标识信息查询 ARP表获取下 一跳 MAC地址,再根据获取的下一跳 MAC地址查找二层转发表,获取出端口, 通过出端口将报文转发出去, 使得 ARP表可以仅包括下一跳标识信息和对应的 MAC地址 , 而不再包括与 MAC地址对应的端口信息 , 因此, 在发生 VLAN内 端口切换时, 不需要进行 ARP学习, 可以利用二层转发表的学习来实现 MAC 地址与端口信息对应关系的更新, 解决了在发生 VLAN内端口切换时因产生大 量 ARP Miss报文和 ARP请求报文而导致三层交换机瞬间很忙和流量中断的问 题, 提高了报文的转发效率。  In the packet forwarding method of the embodiment, the Layer 3 switch first searches the Layer 3 routing table according to the destination IP address of the packet, obtains the next hop identification information, and then queries the ARP table according to the next hop identification information to obtain the next hop MAC address. Then, the device searches for the Layer 2 forwarding table according to the obtained next hop MAC address, obtains the egress port, and forwards the packet through the egress port, so that the ARP table can include only the next hop identification information and the corresponding MAC address, and no longer includes The port information corresponding to the MAC address. Therefore, when intra-VLAN port switching occurs, ARP learning is not required. The learning of the MAC address and port information can be updated by learning the Layer 2 forwarding table. The switch has a large number of ARP Miss packets and ARP request packets, which causes the Layer 3 switch to be busy and interrupted. This improves the forwarding efficiency of packets.
基于上述实施例, 在 VLAN支持端口备份的情况下, 主端口与备份端口发 生切换, 说明与主端口连接的网络设备, 重新通过另一个物理端口 (备份端口) 与三层交换机连接, 说明三层交换机与该网络设备之间的出端口发生了切换。 其中, 由于切换前后的出端口属于同一 VLAN , 因此, VLANIF标识与 MAC地 址的对应关系并未发生变化;又因为本实施例的 ARP表中仅包括 VLANIF标识、 下一跳 IP地址和下一跳 MAC地址的对应关系, 而不包括端口信息, 因此, 当 出端口发生切换时, ARP表中的信息不会发生变化, 不需要触发 ARP学习, 也 就不会产生大量 ARP Miss消息和大量 ARP请求报文, 减轻了端口切换时三层 交换机的负担,同时由于不进行 ARP学习也就不会产生由于 ARP学习造成的流 量中断, 提高了转发报文的效率和质量。 进一步, 对三层交换机而言, 在接收到报文时, 三层交换机会通过获取接 收报文时所使用的物理端口和解析接收到的报文以获取其中的源 MAC地址,来 建立物理端口与物理端口所连接的网络设备的 MAC地址的对应关系,以形成二 层转发表。 另外, 三层交换机也会根据其各物理端口的实际使用情况对二层转 发表进行动态更新, 其更新过程与上述形成二层转发表的过程相同。 因此, 当 发生 VLAN内的端口切换时, 三层交换机会根据接收到的报文学习到物理端口 发生了切换, 并根据切换后的物理端口更新二层转发表, 即将原出端口对应的 MAC地址对应的端口信息更新为切换后的出端口; 在更新后的二层转发表中将 会存储切换后的出端口的信息与原出端口对应的 MAC地址的对应关系。由于三 层交换机上的二层转发表通常由专门的硬件模块进行维护, 因此, 其更新速度 相对比较快。 Based on the foregoing embodiment, when the VLAN supports port backup, the primary port and the backup port are switched, and the network device connected to the primary port is connected to the Layer 3 switch through another physical port (backup port). The switch between the switch and the network device has been switched. The outbound interface before and after the switch belongs to the same VLAN. Therefore, the mapping between the VLANIF identifier and the MAC address does not change. The ARP table in this embodiment only includes the VLANIF identifier, the next hop IP address, and the next hop. The correspondence between the MAC addresses and the port information is not included. Therefore, the information in the ARP table does not change when the egress port is switched. The ARP Miss message and the large number of ARP requests are not generated. The packet is used to reduce the load on the Layer 3 switch. In addition, the ARP learning does not cause traffic interruption caused by ARP learning, which improves the efficiency and quality of forwarding packets. Further, for a Layer 3 switch, when receiving a packet, the Layer 3 switch establishes a physical port by obtaining the physical MAC address used to receive the packet and parsing the received packet to obtain the source MAC address. The correspondence between the MAC addresses of the network devices connected to the physical ports to form a Layer 2 forwarding table. In addition, the Layer 3 switch dynamically updates the Layer 2 forwarding table according to the actual usage of its physical ports. The update process is the same as the process of forming the Layer 2 forwarding table. Therefore, when a port switch in a VLAN occurs, the Layer 3 switch learns that the physical port is switched according to the received packet, and updates the Layer 2 forwarding table according to the switched physical port, that is, the MAC address corresponding to the original port. The corresponding port information is updated to the outbound port after the switch; the updated Layer 2 forwarding table stores the correspondence between the information of the outbound port and the MAC address corresponding to the original port. Since the Layer 2 forwarding table on the Layer 3 switch is usually maintained by a dedicated hardware module, its update speed is relatively fast.
基于上述, 在端口发生切换的情况下, 当三层交换机根据查询 ARP表获取 的 MAC地址, 去查询二层转发表以进行二层转发时, 可以获取正确的出端口, 即可以获取到切换后的出端口, 从而保证报文通过正确的出端口转发, 即可以 保证报文被成功转发。  Based on the above, when the port is switched, when the Layer 3 switch queries the Layer 2 forwarding table to perform Layer 2 forwarding according to the MAC address obtained by querying the ARP table, the Layer 3 switch can obtain the correct outgoing port. The outbound port ensures that packets are forwarded through the correct outbound interface, which ensures that packets are successfully forwarded.
在上述各实施例中, 在根据下一跳标识信息查询 ARP表, 获取下一跳标识 信息对应的下一跳 MAC地址之前还包括: 根据接收到的 ARP响应 ^艮文, 生成 ARP表的过程。 具体的, 三层交换机在接收到第一个报文时, 根据第一个报文 的目的 IP地址生成 ARP请求报文,并根据报文携带的 VLAN值在相应 VLANIF 下的所有物理端口上广播该 ARP请求报文; 网络中与三层交换机连接的属于同 一 VLAN的其他网络设备接收到 ARP请求报文后, 判断本身的 IP地址是否与 ARP请求报文中请求 MAC地址用的 IP地址相同; 如果不相同, 则不做响应; 如果相同,则向三层交换机发送 ARP响应报文,该 ARP响应报文中携带有该网 络设备的 IP地址和 MAC地址。 三层交换机接收到 ARP响应报文后, 将接收 ARP响应报文的路由出接口的信息(即 VLANIF对应的 VLAN值和 VLANIF类 型等) 以及 ARP响应报文中网络设备的 IP地址和 MAC地址进行存储以形成 ARP表。 其中, 路由出接口的信息和网络设备的 IP地址作为下一跳标识信息, 而网络设备的 MAC地址作为下一跳 MAC地址。 In the above embodiments, before the next hop MAC address corresponding to the next hop identification information is obtained by querying the ARP table according to the next hop identification information, the method further includes: generating an ARP table according to the received ARP response message. . Specifically, when receiving the first packet, the Layer 3 switch generates an ARP request packet according to the destination IP address of the first packet, and broadcasts on the physical port of the corresponding VLANIF according to the VLAN value carried in the packet. The ARP request packet; after receiving the ARP request packet, the other network device in the same VLAN that is connected to the Layer 3 switch in the network determines whether the IP address of the device is the same as the IP address used for the MAC address in the ARP request packet. If they are not the same, they do not respond. If they are the same, they send an ARP response packet to the Layer 3 switch. The ARP response packet carries the IP address and MAC address of the network device. After receiving the ARP response packet, the Layer 3 switch receives the information of the outgoing interface of the ARP response packet, that is, the VLAN ID and VLANIF type of the VLANIF, and the IP address and MAC address of the network device in the ARP response packet. Store to form ARP table. The information of the outbound interface and the IP address of the network device are used as the next hop identification information, and the MAC address of the network device is used as the next hop MAC address.
由上述分析可见, 在本实施例中, 三层交换机在 ARP学习过程中, 仅将出 端口的信息学习到 VLANIF层面, 而不是学习到具体的物理端口, 实现了 ARP 表与物理端口的分离, 使得在发生 VLAN内端口切换时不需要进行 ARP学习, 而通过查询 ARP获取下一跳 MAC地址, 然后根据获取的下一跳 MAC地址查 找二层转发表找到出端口, 完成报文的转发。  It can be seen from the above analysis that in the ARP learning process, the Layer 3 switch learns only the information of the egress port to the VLANIF layer, instead of learning the specific physical port, and realizes the separation between the ARP table and the physical port. The device does not need to perform ARP learning when the intra-VLAN port is switched. The queried ARP is used to obtain the next hop MAC address. Then, the Layer 2 forwarding table is used to find the egress port according to the obtained next hop MAC address.
本实施例的报文转发方法, 首先查找三层路由表获取下一跳标识信息, 在 根据下一跳标识信息查询 ARP表获取下一跳 MAC地址,然后根据下一跳 MAC 地址查找二层转发表, 使报文由三层转发模块转发到二层转发模块, 进而由二 层转发模块根据获取的出端口将报文转发出去, 将三层转发和二层转发相结合, 在成功转发报文的同时, 使得 ARP表与物理端口信息相分离, 在发生 VLAN内 端口切换时不需要进行 ARP学习,解决了现有技术中因发生 VLAN内端口切换 产生大量 ARP Miss消息以及大量 ARP请求报文导致的三层交换机瞬间很忙和 流量中断的问题, 提高了报文转发的成功率。  The packet forwarding method in this embodiment first searches for the Layer 3 routing table to obtain the next hop identification information, queries the ARP table according to the next hop identification information, and obtains the next hop MAC address, and then searches for the second layer according to the next hop MAC address. The message is forwarded to the Layer 2 forwarding module by the Layer 3 forwarding module. The Layer 2 forwarding module forwards the packet based on the obtained egress port. The Layer 3 forwarding and Layer 2 forwarding are combined to successfully forward the packet. At the same time, the ARP table is separated from the physical port information, and ARP learning is not required when the intra-VLAN port is switched. This solves the problem that a large number of ARP Miss messages and a large number of ARP request packets are generated due to intra-VLAN port switching. The three-layer switch is very busy and the traffic is interrupted, which improves the success rate of packet forwarding.
图 2为本发明一实施例提供的报文转发装置的结构示意图。 如图 2所示, 本实施例的装置包括: 第一获取模块 21、 第二获取模块 22、 第三获取模块 23 和转发模块 24。  FIG. 2 is a schematic structural diagram of a packet forwarding apparatus according to an embodiment of the present invention. As shown in FIG. 2, the apparatus in this embodiment includes: a first acquiring module 21, a second obtaining module 22, a third obtaining module 23, and a forwarding module 24.
其中, 第一获取模块 21 , 用于根据接收到的报文的目的 IP地址查询三层路 由表, 获取下一跳标识信息; 本实施例的三层路由表中存储有目的 IP地址和与 目的 IP地址对应的下一跳标识信息;下一跳标识信息是指与目的 IP地址对应的 路由出接口的信息和该路由出接口的下一跳 IP地址, 路由出接口的信息包括出 接口类型和出接口索引。 第二获耳 莫块 22, 与第一获耳 莫块 21连接, 用于根据 第一获取模块 21获取的下一跳标识信息查询 ARP表, 获取与下一跳标识信息 对应的下一跳 MAC地址; 本实施例的 ARP表由下一跳标识信息和下一跳标识 信息对应的下一跳 MAC地址组成。第三获取模块 23 ,与第二获取模块 22连接, 用于根据第二获取模块 22获取的下一跳 MAC地址查询二层转发表, 获取下一 跳 MAC地址对应的出端口信息。 转发模块 24, 与第三获取模块 23连接, 用于 将报文从第三获 莫块 23获取的出端口信息所对应的出端口转发出去。 The first obtaining module 21 is configured to query the Layer 3 routing table according to the destination IP address of the received packet to obtain the next hop identification information. The destination IP address and destination are stored in the Layer 3 routing table in this embodiment. The next hop identification information corresponding to the IP address; the next hop identification information is the information of the outbound interface corresponding to the destination IP address and the next hop IP address of the outbound interface of the route. The information of the outbound interface includes the outbound interface type and Outbound interface index. The second hop block 22 is connected to the first hop module 21, and is configured to query the ARP table according to the next hop identification information acquired by the first obtaining module 21, and obtain a next hop MAC corresponding to the next hop identifier information. The ARP table in this embodiment is composed of the next hop identification information and the next hop MAC address corresponding to the next hop identification information. The third obtaining module 23 is connected to the second obtaining module 22, The second layer forwarding table is used to query the second-layer forwarding table according to the next hop MAC address obtained by the second obtaining module 22, and obtain the outbound port information corresponding to the next hop MAC address. The forwarding module 24 is connected to the third obtaining module 23, and is configured to forward the outbound port corresponding to the outbound port information obtained by the third obtaining block 23 from the packet.
本实施例报文转发装置的上述功能模块可用于执行上述实施例提供的报文 转发方法的流程, 其工作原理不再赘述, 详见方法实施例的描述。  The foregoing function module of the packet forwarding device in this embodiment can be used to perform the process of the packet forwarding method provided in the foregoing embodiment. The working principle is not described here. For details, refer to the description of the method embodiment.
本实施例的报文转发装置, 通过第一获取模块查询三层路由表获取下一跳 标识信息, 通过第二获取模块查询 A P表获取下一跳 MAC地址, 再通过第三 获取模块查询二层转发表获取出端口, 由转发模块将报文从出端口转发出去, 使得 ARP表可以仅包括下一跳标识信息和对应的 MAC 地址, 而不再包括与 MAC地址对应的端口信息 , 因此, 在发生 VLAN内端口切换时 , 通过本实施例 的报文转发装置转发报文时, 不需要进行 ARP学习, 可以利用二层转发表的学 习来实现 MAC地址与端口信息对应关系的更新, 解决了在发生 VLAN内端口 切换时因产生大量 ARP Miss报文和 ARP请求报文而导致三层交换机瞬间很忙 和流量中断的问题, 提高了报文的转发效率。  The packet forwarding device of the present embodiment obtains the next hop identification information by using the first acquiring module to query the Layer 3 routing table, and the second obtaining module queries the AP table to obtain the next hop MAC address, and then queries the second layer through the third obtaining module. The forwarding table obtains the egress port, and the forwarding module forwards the packet from the egress port, so that the ARP table can include only the next hop identification information and the corresponding MAC address, and no longer includes the port information corresponding to the MAC address, therefore, When the intra-VLAN port switching occurs, the packet forwarding device in this embodiment does not need to perform ARP learning when forwarding packets. The learning of the Layer 2 forwarding table can be used to update the correspondence between the MAC address and the port information. When a port in a VLAN is switched, a large number of ARP Miss packets and ARP request packets are generated, causing the Layer 3 switch to be busy and interrupted. This improves the forwarding efficiency of packets.
图 3 为本发明又一实施例提供的报文转发装置的结构示意图。 本实施例基 于图 2所示的实施例实现, 如图 3所示, 本实施例的装置还包括: 生成模块 31。  FIG. 3 is a schematic structural diagram of a packet forwarding apparatus according to another embodiment of the present invention. The embodiment is implemented based on the embodiment shown in FIG. 2. As shown in FIG. 3, the apparatus of this embodiment further includes: a generating module 31.
生成模块 31 , 用于在第二获取模块 22查询 ARP表之前根据接收到的 ARP 响应报文, 生成 ARP表。 具体的, 报文转发装置会根据接收到的第一个报文生 成 ARP请求报文,并向该报文所在的 VLAN下的所有物理端口广播生成的 ARP 请求报文; 收到 ARP请求报文的网络设备根据判断 ARP请求报文中请求 MAC 地址的 IP地址与本身的 IP地址是否相同,判断结果为相同的网络设备生成包括 其 IP地址和 MAC地址的 ARP响应报文并发送给报文转发装置, 具体是发送给 报文转发装置中的生成模块 31。 该生成模块 31根据接收 ARP响应报文的路由 接口的信息 (例如: 如果路由出接口为 VLANIF, 则路由出接口信息主要是指 VALNIF对应的 VLAN值(即 VLANIF标识 )和 VLANIF类型等)以及网络设 备的 IP地址和 MAC地址进行存储, 形成 ARP表。 进一步, 本实施例的报文转发装置还包括: 更新模块 32。 该更新模块 32, 用于在出端口发生切换时,更新二层转发表中下一跳 MAC地址对应的端口信息 为切换后的出端口。 具体的, 更新模块 32可以在接收到报文时, 通过获取接收 报文所使用的物理端口以及解析接收到的报文中的源 MAC地址,来获取物理端 口与物理端口所连接的网络设备的 MAC地址的对应关系,根据获取的对应关系 生成或更新二层转发表。如果获取的 MAC地址对应的物理端口与二层转发表中 已存储的不同,则将二层转发表中该 MAC地址对应的端口信息改为新获取的物 理端口的信息。 The generating module 31 is configured to generate an ARP table according to the received ARP response packet before the second obtaining module 22 queries the ARP table. Specifically, the packet forwarding device generates an ARP request packet according to the first packet received, and broadcasts the generated ARP request packet to all the physical ports in the VLAN where the packet is sent. The ARP request packet is received. The network device determines whether the IP address of the requesting MAC address in the ARP request packet is the same as the IP address of the ARP request packet, and determines that the same network device generates an ARP response packet including the IP address and the MAC address and sends the packet to the packet forwarding. The device is specifically sent to the generating module 31 in the message forwarding device. The generating module 31 is configured to receive the information of the routing interface of the ARP response packet. For example, if the outbound interface is a VLANIF, the outbound interface information mainly refers to the VLAN value corresponding to the VALNIF (that is, the VLANIF identifier) and the VLANIF type. The IP address and MAC address of the device are stored to form an ARP table. Further, the message forwarding device of this embodiment further includes: an update module 32. The update module 32 is configured to update the port information corresponding to the next hop MAC address in the Layer 2 forwarding table to be the switched out port when the egress port is switched. Specifically, the update module 32 can obtain the physical port connected to the physical port and the physical port by obtaining the physical port used to receive the packet and parsing the source MAC address in the received packet when receiving the packet. The correspondence between the MAC addresses is generated or updated according to the obtained correspondence. If the physical port corresponding to the obtained MAC address is different from that stored in the Layer 2 forwarding table, the port information corresponding to the MAC address in the Layer 2 forwarding table is changed to the information of the newly acquired physical port.
其中, 对于接收到的报文而言, 本实施例的报文转发装置可能是其最后一 跳, 也可能不是其最后一跳。 如果本实施例的报文转发装置为报文的最后一跳, 则第一获取模块 21获取的下一跳标识信息中将不包括下一跳 IP地址,而仅包括 路由出接口信息 (主要是指路由出接口标识, 例如 VLANIF标识) ; 如果本实 施例的报文转发装置不是报文的最后一跳, 则第一获取模块 21获取的下一跳标 识信息同时包括路由出接口信息(主要是指路由出接口标识 )和下一跳 IP地址。  The packet forwarding device in this embodiment may be the last hop or not the last hop of the received packet. If the packet forwarding device in this embodiment is the last hop of the packet, the next hop identification information acquired by the first obtaining module 21 does not include the next hop IP address, but only the routing outbound interface information (mainly If the packet forwarding device of the present embodiment is not the last hop of the packet, the next hop identification information acquired by the first obtaining module 21 includes the outbound interface information (mainly The route outbound interface identifier and the next hop IP address.
基于上述, 本实施例提供一种第二获取模块 22的实现结构。 第二获取模块 Based on the above, the embodiment provides an implementation structure of the second obtaining module 22. Second acquisition module
22包括: 第一获取单元 221和第二获取单元 222。 以路由出接口为 VLANIF为 例, 则第二获取模块 22的工作原理为: 当第一获取模块 21获取的下一跳标识 信息包括 VLANIF标识和下一跳 IP地址时, 由第一获取单元 221以 VLANIF标 识和下一跳 IP地址为输入参数, 查询 ARP表, 获取下一跳 MAC地址; 当第一 获取模块 21获取的下一跳标识信息不包括下一跳 IP地址时, 由第二获取单元 222以 VLANIF标识和报文中的目的 IP地址为输入参数, 查询 ARP表, 获取下 一跳 MAC地址。 22 includes: a first acquisition unit 221 and a second acquisition unit 222. If the outbound interface is the VLANIF as an example, the second obtaining module 22 works as follows: When the next hop identification information acquired by the first obtaining module 21 includes the VLANIF identifier and the next hop IP address, the first acquiring unit 221 The VLANIF identifier and the next hop IP address are used as input parameters to query the ARP table to obtain the next hop MAC address. When the next hop identification information acquired by the first obtaining module 21 does not include the next hop IP address, the second acquisition is performed. The unit 222 uses the VLANIF identifier and the destination IP address in the packet as input parameters to query the ARP table to obtain the next hop MAC address.
本实施例报文转发装置的上述各功能模块或单元可用于执行上述实施例提 供的报文转发方法中的相应流程, 其工作原理不再赘述。  The foregoing various functional modules or units of the packet forwarding device in this embodiment may be used to perform the corresponding processes in the packet forwarding method provided in the foregoing embodiment, and the working principle is not described herein.
本实施例的报文转发装置可以是三层交换机等具有报文转发功能的网络设 备。 本实施例报文转发装置中的第一获取模块 21、 第二获取模块 22以及生成模 块 31主要基于三层路由表进行处理, 可将其划分为三层的功能模块; 而第三获 取模块 23、 转发模块 24以及更新模块 32主要基于二层转发表进行处理, 可将 其划分为二层的功能模块。 综上所述, 本实施例的报文转发装置通过上述功能模块或单元, 首先查找 三层路由表获取下一跳标识信息, 在根据下一跳标识信息查询 ARP表获取下一 跳 MAC地址, 然后根据下一跳 MAC地址查找二层转发表, 使艮文由三层功能 模块转发到二层功能模块, 进而由二层功能模块根据获取的出端口将报文转发 出去, 将三层转发和二层转发相结合, 在成功转发报文的同时, 使得 ARP表与 物理端口信息相分离, 在发生 VLAN内端口切换时不需要进行 ARP学习, 解决 了现有技术中因发生 VLAN内端口切换产生大量 ARP Miss消息以及大量 ARP 请求报文导致的三层交换机瞬间很忙和流量中断的问题, 提高了报文转发的成 功率。 The packet forwarding device in this embodiment may be a network device having a packet forwarding function, such as a Layer 3 switch. The first obtaining module 21, the second obtaining module 22, and the generating module in the packet forwarding device of this embodiment The block 31 is mainly processed based on the layer 3 routing table, and can be divided into three layers of function modules; and the third obtaining module 23, the forwarding module 24, and the updating module 32 are mainly processed based on the layer 2 forwarding table, which can be divided into The second layer of functional modules. In summary, the packet forwarding device of the present embodiment first searches for the Layer 3 routing table to obtain the next hop identification information by using the foregoing function module or unit, and queries the ARP table according to the next hop identification information to obtain the next hop MAC address. Then, the Layer 2 forwarding table is searched according to the next hop MAC address, and the packet is forwarded by the Layer 3 function module to the Layer 2 function module, and then the Layer 2 function module forwards the packet according to the obtained egress port, and forwards the Layer 3 packet. Layer 2 forwarding is combined. When the packets are forwarded successfully, the ARP table is separated from the physical port information. ARP learning is not required when the intra-VLAN port is switched. This solves the problem of VLAN switching in the prior art. A large number of ARP Miss messages and a large number of ARP request packets cause the Layer 3 switch to be busy and interrupted. This improves the success rate of packet forwarding.
本发明一实施例提供一种网络设备, 该网络设备包括报文转发装置。 其中, 报文转发装置的工作流程可参见图 1 所示实施例的描述, 而其结构可参见图 2 和图 3所示实施例的描述, 在此不再赘述。  An embodiment of the present invention provides a network device, where the network device includes a packet forwarding device. For the description of the working process of the packet forwarding device, refer to the description of the embodiment shown in FIG. 1. For the structure, refer to the description of the embodiment shown in FIG. 2 and FIG. 3, and details are not described herein again.
本实施例的网络设备可以是三层交换机等, 可以采用上述方法实施例提供 的报文转发方法的流程来转发报文, 解决了现有技术中因发生 VLAN内端口切 换产生大量 ARP Miss消息以及大量 ARP请求报文导致的三层交换机瞬间很忙 和流量中断的问题, 提高了报文转发的成功率。  The network device in this embodiment may be a Layer 3 switch, etc., and may use the process of the packet forwarding method provided by the foregoing method to forward the packet, which solves the problem that a large number of ARP Miss messages are generated due to port switching in the VLAN. The problem that the Layer 3 switch is busy and the traffic is interrupted due to a large number of ARP request packets improves the success rate of packet forwarding.
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤可 以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读取存 储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述的存储 介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的介质。  A person skilled in the art can understand that all or part of the steps of implementing the above method embodiments may be completed by using hardware related to program instructions, and the foregoing program may be stored in a computer readable storage medium, and the program is executed when executed. The foregoing steps include the steps of the foregoing method embodiments; and the foregoing storage medium includes: a medium that can store program codes, such as a ROM, a RAM, a magnetic disk, or an optical disk.
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的精神和范围。  It should be noted that the above embodiments are only for explaining the technical solutions of the present invention, and are not intended to be limiting; although the present invention has been described in detail with reference to the foregoing embodiments, it will be understood by those skilled in the art that: The technical solutions described in the foregoing embodiments are modified, or some of the technical features are equivalently replaced. The modifications and substitutions do not depart from the spirit and scope of the technical solutions of the embodiments of the present invention.

Claims

权 利 要 求 Rights request
1、 一种报文转发方法, 其特征在于, 包括:  A packet forwarding method, which is characterized by:
根据接收到 4艮文的目的网际协议 IP地址查询三层路由表,获取下一跳标识 信息;  The Layer 3 routing table is queried according to the destination Internet Protocol IP address of the received message, and the next hop identification information is obtained.
根据所述下一跳标识信息查询地址解析协议 ARP表 ,获取与所述下一跳标 识信息对应的下一跳媒体访问控制 MAC地址, 所述 ARP表由所述下一跳标识 信息和所述下一跳标识信息对应的下一跳 MAC地址组成;  Querying the address resolution protocol ARP table according to the next hop identification information, and acquiring a next hop media access control MAC address corresponding to the next hop identification information, where the ARP table is configured by the next hop identification information and the The next hop MAC address corresponding to the next hop identification information is composed;
根据所述下一跳 MAC地址查询二层转发表,获取所述下一跳 MAC地址对 应的出端口信息;  Querying the Layer 2 forwarding table according to the next hop MAC address, and obtaining the outbound port information corresponding to the next hop MAC address;
将所述才艮文从所述出端口信息对应的出端口转发出去。  And forwarding the packet from the egress port corresponding to the egress port information.
2、根据权利要求 1所述的报文转发方法, 其特征在于, 所述根据所述下一 跳标识信息查询 ARP表 , 获取与所述下一跳标识信息对应的下一跳 MAC地址 包括:  The packet forwarding method according to claim 1, wherein the querying the ARP table according to the next hop identification information, and acquiring the next hop MAC address corresponding to the next hop identification information includes:
当所述下一跳标识信息包括路由出接口标识和下一跳 IP地址时,根据所述 路由出接口标识和所述下一跳 IP地址查询所述 ARP表,获取所述下一跳 MAC 地址;  When the next hop identification information includes the outbound interface identifier and the next hop IP address, the ARP table is queried according to the route outbound interface identifier and the next hop IP address, and the next hop MAC address is obtained. ;
当所述下一跳标识信息不包括所述下一跳 IP地址时,根据所述路由出接口 标识和所述目的 IP地址查询所述 ARP表, 获取所述下一跳 MAC地址。  When the next hop identification information does not include the next hop IP address, the ARP table is queried according to the route outbound interface identifier and the destination IP address, and the next hop MAC address is obtained.
3、根据权利要求 1所述的报文转发方法, 其特征在于, 在根据所述下一跳 标识信息查询 ARP表, 获取与所述下一跳标识信息对应的下一跳 MAC地址之 前包括:  The packet forwarding method according to claim 1, wherein the querying the ARP table according to the next hop identification information to obtain the next hop MAC address corresponding to the next hop identification information includes:
根据接收到的 ARP响应报文, 生成所述 ARP表。  The ARP table is generated according to the received ARP response packet.
4、 根据权利要求 1-3任一项所述的报文转发方法, 其特征在于, 还包括: 当所述出端口发生切换时, 更新所述二层转发表中所述下一跳 MAC地址 对应的端口信息为切换后的出端口信息。  The packet forwarding method according to any one of claims 1-3, further comprising: updating the next hop MAC address in the layer 2 forwarding table when the egress port is switched The corresponding port information is the outgoing port information after the switch.
5、 一种报文转发装置, 其特征在于, 包括: 第一获取模块,用于根据接收到报文的目的网际协议 IP地址查询三层路由 表, 获取下一跳标识信息; 5. A message forwarding device, comprising: The first obtaining module is configured to query the Layer 3 routing table according to the destination Internet Protocol IP address of the received packet, and obtain the next hop identification information;
第二获取模块, 用于根据所述下一跳标识信息查询地址解析协议 ARP表, 获取与所述下一跳标识信息对应的下一跳媒体访问控制 MAC地址, 所述 ARP 表由所述下一跳标识信息和所述下一跳标识信息对应的下一跳 MAC地址组成; 第三获取模块, 用于根据所述下一跳 MAC地址查询二层转发表, 获取所 述下一跳 MAC地址对应的出端口信息;  a second obtaining module, configured to query an address resolution protocol ARP table according to the next hop identifier information, and obtain a next hop media access control MAC address corresponding to the next hop identifier information, where the ARP table is The first hop MAC address is configured by the next hop MAC address, and the third hopping module is configured to query the layer 2 forwarding table according to the next hop MAC address to obtain the next hop MAC address. Corresponding outgoing port information;
转发模块, 用于将所述报文从所述出端口信息对应的出端口转发出去。 The forwarding module is configured to forward the packet from the egress port corresponding to the egress port information.
6、根据权利要求 5所述的报文转发装置,其特征在于,第二获取模块包括: 第一获取单元 , 用于在所述下一跳标识信息包括路由出接口标识和下一跳The message forwarding device according to claim 5, wherein the second obtaining module comprises: a first acquiring unit, configured to: in the next hop identification information, a route outbound interface identifier and a next hop
IP地址时,根据所述路由出接口标识和所述下一跳 IP地址, 查询所述 ARP表, 获取所述下一跳 MAC地址; The IP address is obtained by querying the ARP table according to the route outbound interface identifier and the next hop IP address, and acquiring the next hop MAC address.
第二获取单元, 用于在所述下一跳标识信息不包括所述下一跳 IP地址时, 根据所述路由出接口标识和所述目的 IP地址查询所述 ARP表, 获取所述下一 跳 MAC地址。  a second obtaining unit, configured to: when the next hop identification information does not include the next hop IP address, query the ARP table according to the route outbound interface identifier and the destination IP address, and obtain the next next Jump the MAC address.
7、 根据权利要求 5所述的报文转发装置, 其特征在于, 还包括:  The message forwarding device according to claim 5, further comprising:
生成模块, 用于根据接收到的 ARP响应报文, 生成所述 ARP表。  And a generating module, configured to generate the ARP table according to the received ARP response packet.
8、 根据权利要求 5-7任一项所述的报文转发装置, 其特征在于, 还包括: 更新模块, 用于在所述出端口发生切换时, 更新所述二层转发表中所述下 一跳 MAC地址对应的端口信息为切换后的出端口信息。  The message forwarding device according to any one of claims 5-7, further comprising: an update module, configured to update the layer 2 forwarding table when the egress port is switched The port information corresponding to the next hop MAC address is the outbound port information after the switch.
9、 一种网络设备, 其特征在于, 包括权利要求 5-8任一项所述的报文转发 装置。  A network device, comprising the message forwarding device according to any one of claims 5-8.
PCT/CN2011/073689 2011-05-05 2011-05-05 Message forwarding method, equipment and network device WO2011120459A2 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
CN201180000590.2A CN102217253B (en) 2011-05-05 2011-05-05 Message forwarding method, equipment and network device
PCT/CN2011/073689 WO2011120459A2 (en) 2011-05-05 2011-05-05 Message forwarding method, equipment and network device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/073689 WO2011120459A2 (en) 2011-05-05 2011-05-05 Message forwarding method, equipment and network device

Publications (2)

Publication Number Publication Date
WO2011120459A2 true WO2011120459A2 (en) 2011-10-06
WO2011120459A3 WO2011120459A3 (en) 2012-03-22

Family

ID=44712671

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/073689 WO2011120459A2 (en) 2011-05-05 2011-05-05 Message forwarding method, equipment and network device

Country Status (2)

Country Link
CN (1) CN102217253B (en)
WO (1) WO2011120459A2 (en)

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210320863A1 (en) * 2018-12-28 2021-10-14 Huawei Technologies Co., Ltd. Packet processing method, apparatus, and device, and packet forwarding method, apparatus, and device

Families Citing this family (18)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103139071B (en) * 2011-11-29 2016-07-13 华为技术有限公司 Message forwarding method, device and system
CN103988186A (en) * 2012-10-12 2014-08-13 华为技术有限公司 Memory system, memory module, memory module access method and computer system
CN103795635B (en) * 2012-11-01 2017-04-12 华为技术有限公司 Processing method, device and system for controlling message broadcast
CN102938794B (en) * 2012-11-14 2016-01-13 华为技术有限公司 ARP message forwarding method, switch and controller
CN103929357A (en) * 2013-01-11 2014-07-16 浙江大华技术股份有限公司 Data transmission method and network equipment
CN103179228B (en) 2013-04-02 2015-08-19 杭州华三通信技术有限公司 Internet Protocol address analytic method and fringe node
WO2015079284A1 (en) * 2013-11-26 2015-06-04 Pismo Labs Technology Ltd. Methods and systems for processing internet protocol packets
CN104717138B (en) * 2013-12-11 2019-07-12 中兴通讯股份有限公司 A kind of method and interchanger for realizing message forwarding
CN105337855B (en) * 2014-08-14 2019-02-05 华为技术有限公司 A kind of modified message method and apparatus of processing
CN105812263B (en) * 2016-03-10 2019-03-29 盛科网络(苏州)有限公司 A method of realizing that routing ARP information is separated with editor's information in asic chip
CN105939274A (en) * 2016-05-17 2016-09-14 杭州迪普科技有限公司 Message forwarding method and apparatus
CN106209642A (en) * 2016-06-30 2016-12-07 杭州迪普科技有限公司 A kind of method and device turning transmitting IP packet
CN108600106B (en) * 2018-04-28 2019-06-14 北京邮电大学 A kind of DEU data exchange unit and method of low time delay
CN111327535B (en) * 2018-12-13 2023-03-24 深圳市中兴微电子技术有限公司 Message forwarding method and device and forwarding equipment
CN110224936B (en) * 2019-06-12 2021-11-09 四川灵通电讯有限公司 Routing method based on MAC address and network interface
CN112311680B (en) * 2020-10-30 2022-07-12 新华三技术有限公司合肥分公司 Message forwarding method and device
CN114938348A (en) * 2021-02-04 2022-08-23 北京金山云网络技术有限公司 Data stream forwarding method and device, electronic equipment and storage medium
CN115766334A (en) * 2022-12-20 2023-03-07 瑞斯康达科技发展股份有限公司 Three-layer switch, network system and data transmission method

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127681A (en) * 2007-09-05 2008-02-20 杭州华三通信技术有限公司 Method and device for binding server MAC address with uplink port
CN101771732A (en) * 2010-01-06 2010-07-07 福建星网锐捷网络有限公司 Message processing method, device and network equipment
CN101815107A (en) * 2010-05-13 2010-08-25 华为技术有限公司 Method, system and equipment for managing address in Ethernet ring

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20040162781A1 (en) * 2003-02-14 2004-08-19 Kennsco, Inc. Monitoring and alert systems and methods
CN101257447A (en) * 2008-03-14 2008-09-03 华为技术有限公司 Method, system and routing apparatus of load sharing

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101127681A (en) * 2007-09-05 2008-02-20 杭州华三通信技术有限公司 Method and device for binding server MAC address with uplink port
CN101771732A (en) * 2010-01-06 2010-07-07 福建星网锐捷网络有限公司 Message processing method, device and network equipment
CN101815107A (en) * 2010-05-13 2010-08-25 华为技术有限公司 Method, system and equipment for managing address in Ethernet ring

Cited By (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US20210320863A1 (en) * 2018-12-28 2021-10-14 Huawei Technologies Co., Ltd. Packet processing method, apparatus, and device, and packet forwarding method, apparatus, and device

Also Published As

Publication number Publication date
CN102217253B (en) 2013-10-09
WO2011120459A3 (en) 2012-03-22
CN102217253A (en) 2011-10-12

Similar Documents

Publication Publication Date Title
WO2011120459A2 (en) Message forwarding method, equipment and network device
EP2920932B1 (en) Apparatus for a high performance and highly available multi-controllers in a single sdn/openflow network
EP2654250A2 (en) Virtual local area network identity transformation method and apparatus
EP2560321B1 (en) Ethernet multicast method and device
WO2015043327A1 (en) Routing method, device and system
US10645006B2 (en) Information system, control apparatus, communication method, and program
JP2012217178A5 (en)
US20160330167A1 (en) Arp Implementation Method, Switch Device, and Control Device
WO2015000362A1 (en) Service node configuration method, service node pond register and system
US9143437B1 (en) Apparatus and method for multicast data packet forwarding
WO2016086713A1 (en) Equal-cost multi-path outbound interface update method and apparatus
WO2012075731A1 (en) Method and device for link fault detecting and recovering based on arp interaction
WO2015014187A1 (en) Data forwarding method and apparatus that support multiple tenants
WO2018214809A1 (en) Message transmission method and device, and storage medium
WO2013123847A1 (en) Packet transmission method and network device
WO2009036678A1 (en) Method, device and network system for message forwarding
WO2009012668A1 (en) Network architecture of mutiple address spaces, and method for host information register and data transmission
US9215078B2 (en) Multicast method and multicast device
WO2015139166A1 (en) Address identifier allocation method, and related device and system
WO2011134295A1 (en) Method and device for converging layer 2 multicast network
WO2016058261A1 (en) Network-based flat routing method
WO2014075216A1 (en) Method and network device for establishing virtual cluster
WO2013029438A1 (en) Ethernet interface protection method and network side device
WO2015010519A1 (en) Topology structure discovery method and device
WO2012068854A1 (en) Method and apparatus for updating media access control (mac) address

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180000590.2

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11762033

Country of ref document: EP

Kind code of ref document: A2

NENP Non-entry into the national phase in:

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 11762033

Country of ref document: EP

Kind code of ref document: A2