WO2014101066A1 - Media access control information synchronization method and device - Google Patents

Media access control information synchronization method and device Download PDF

Info

Publication number
WO2014101066A1
WO2014101066A1 PCT/CN2012/087738 CN2012087738W WO2014101066A1 WO 2014101066 A1 WO2014101066 A1 WO 2014101066A1 CN 2012087738 W CN2012087738 W CN 2012087738W WO 2014101066 A1 WO2014101066 A1 WO 2014101066A1
Authority
WO
WIPO (PCT)
Prior art keywords
synchronization
mac
board
information
mac information
Prior art date
Application number
PCT/CN2012/087738
Other languages
French (fr)
Chinese (zh)
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 PCT/CN2012/087738 priority Critical patent/WO2014101066A1/en
Priority to CN201280002843.4A priority patent/CN104322018A/en
Publication of WO2014101066A1 publication Critical patent/WO2014101066A1/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/64Hybrid switching systems
    • H04L12/6418Hybrid transport
    • 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

Definitions

  • the present invention relates to the field of communications, and in particular, to a method and apparatus for synchronizing media access control information. Background technique
  • MAC Media Access Control
  • TCAM Ternary Content Addressable Memory
  • the complexity of the network makes the network burden more and more heavy.
  • the processing of cross-board MAC learning forwarding in distributed devices directly affects the performance and reliability of the device.
  • the MAC learning method of the prior art is hardware learning.
  • the data stream flows from the upstream board, and the source MAC address of the received packet is learned by the uplink board port. After the MAC learning of the board is completed, the packet is received. Continue to forward to the downstream board through the interconnect port. The downstream board learns the source MAC address of the packet from the interconnect port.
  • the downlink board is a board that supports TCAM extended MAC learning
  • the MAC learning of the external extended TCAM requires the processor to assist learning.
  • the Line Processing Unit (LPU) of the downlink board is used.
  • the learned MAC information is learned into a temporary entry, and the LPU notifies the processor to migrate the learned MAC entry to the extended TCAM, so the processor overhead is required.
  • the downstream board After receiving the packet from the interconnection port, the downstream board does not query whether the source MAC address of the packet has been learned in the external TCAM. Instead, the packet is processed by the processor for each packet. The occupancy rate of the device is too high, and the MAC learning function of the external expansion TCAM is poor.
  • the packets may not be sent and received on the same link as shown in Figure 1.
  • the packet sent by user 1 passes through the interface board (Line Proces s ing Un it, LPU) of switch B in the ETH-TRUNK.
  • the link between the LPUs of the switch A is sent to the switch A.
  • both the LPU 4 and the LPU 2 perform the MAC learning of the user 1;
  • the present invention provides a method and device for synchronizing MAC information, which can use the first synchronization message to synchronize the source MAC information in the obtained data message.
  • a first aspect of the present invention provides a method for synchronizing media access control MAC information, the method comprising:
  • the first board receives the data packet.
  • the first board performs MAC learning according to the data packet to generate a first MAC table.
  • the first board extracts first synchronization MAC information according to the first MAC table
  • the first board encapsulates the first synchronization MAC information into the first synchronization packet; the first board sends the first synchronization packet to the second board, so that the second single The board acquires the first synchronization MAC information from the first synchronization packet.
  • the first board is configured to encapsulate the first synchronization MAC information into the first synchronization message, where the first board is configured according to the first synchronization MAC address. Generating MAC table synchronization information, and encapsulating the MAC table synchronization information into the first synchronization packet.
  • the first board In conjunction with the first implementation of the first aspect of the invention, the second embodiment of the first aspect of the invention In the current mode, the first board generates the MAC address synchronization information according to the first synchronization MAC information, including: the first board uses the first number of MAC entries as the first synchronization MAC information each time, according to the The first synchronous MAC information generates MAC table synchronization information.
  • the method further includes: the first board timing extracts the second synchronization MAC information from the local first MAC table, and encapsulates the second synchronization MAC into the second synchronization.
  • the first board sends a second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization packet, according to the packet
  • the second synchronization MAC information updates a second MAC table that is locally saved by the second board.
  • a second aspect of the present invention provides a method for synchronizing media access control MAC information, where the method includes:
  • the second board receives the first synchronization message sent by the first board, where the first synchronization message carries the first synchronization MAC information extracted by the first board from the first MAC table.
  • the second board acquires the first synchronization MAC information carried in the first synchronization packet; the second board updates the second saved by the second board according to the first synchronization MAC information.
  • MAC table The second board acquires the first synchronization MAC information carried in the first synchronization packet; the second board updates the second saved by the second board according to the first synchronization MAC information.
  • the acquiring, by the second board, the first synchronization MAC information that is carried in the first synchronization packet includes: the second board extracting the first And synchronizing the MAC table synchronization information carried in the packet, and acquiring the first synchronization MAC information according to the first MAC table synchronization information.
  • the method further includes: the second board receives the second synchronization packet periodically sent by the first board, and the second synchronization packet carries the second synchronization.
  • MAC information the second synchronization MAC information is extracted from the first MAC table by the first board timing; And acquiring, by the second board, the second synchronization MAC information from the second synchronization packet, and updating the locally saved second MAC table according to the second synchronization MAC information.
  • a third aspect of the present invention provides a device for synchronizing media access control MAC information, the device comprising:
  • a receiving unit configured to receive a data packet sent to the first board
  • a generating unit configured to perform MAC learning according to the data packet, to generate a first MAC table
  • an extracting unit configured to extract, according to the first MAC table, first synchronization MAC information
  • the encapsulating unit is configured to encapsulate the first synchronous MAC information into the first synchronization packet, and the sending unit is configured to send the first synchronization packet to the second board, so that the second board is The first synchronization MAC information is obtained in the first synchronization packet.
  • the encapsulating unit is configured to generate MAC table synchronization information according to the first synchronization MAC information, and encapsulate the MAC table synchronization information into the first synchronization packet. in.
  • the generating unit is specifically configured to use the first quantity of MAC entries as the first synchronous MAC information each time. And generating MAC table synchronization information according to the first synchronization MAC information.
  • the sending unit is configured to multicast the first synchronization packet to multiple second boards.
  • the extracting unit is further configured to: periodically extract the second synchronous MAC information from the first MAC table, and encapsulate the second synchronous MAC into the second synchronous packet;
  • the sending unit is further configured to send the second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization message, according to the The second synchronization MAC information is used to update the second MAC table locally saved by the second board.
  • a fourth aspect of the present invention provides a device for synchronizing MAC information of a medium access control, characterized in that the device includes:
  • a sending unit configured to receive a first synchronization packet sent by the first board, where the first synchronization packet is sent The first synchronization MAC information that is extracted by the first board from the first MAC table, the acquiring unit, configured to acquire the first synchronous MAC message encapsulated in the first synchronization packet, and the update unit, And updating the locally saved second MAC table according to the first synchronous MAC information.
  • the acquiring unit is specifically configured to: obtain MAC address synchronization information encapsulated in the first synchronization packet, and acquire the first synchronization MAC according to the MAC table synchronization information. information.
  • the receiving unit is further configured to receive a second synchronization packet periodically sent by the first board, where the second synchronization packet carries a second synchronization MAC address.
  • the second synchronization MAC information is extracted by the first board according to the first MAC table;
  • the acquiring unit is further configured to acquire the second synchronization MAC information from the second synchronization message;
  • the updating unit is further configured to update the locally saved second MAC table according to the second synchronization MAC information.
  • a fifth aspect of the present invention provides a medium access control MAC information synchronization apparatus, the apparatus comprising: a network interface; a processor; a memory; an application physically stored in the memory, the application program includes The processor executes the instructions of the method of the first aspect above.
  • a sixth aspect of the present invention provides a medium access control MAC information synchronization apparatus, the apparatus comprising: a network interface; a processor; a memory; an application physically stored in the memory, the application program includes The processor executes the instructions of the method of the second aspect above.
  • the first board performs MAC learning according to the received data packet, extracts synchronous MAC information from the MAC table, and encapsulates the synchronous MAC information into the first synchronization packet and sends the message to the second single
  • the board enables the second board to obtain the synchronous MAC information, and implements the cross-board synchronization of the MAC information, which effectively solves the burden on the CPU caused by the board to learn the MAC information, and improves the reliability of the network.
  • 1 is a schematic diagram of sending and receiving of a prior art message
  • 2 is a flowchart of a method for synchronizing MAC information according to an embodiment of the present invention
  • FIG. 3 is a flowchart of another method for synchronizing MAC information according to an embodiment of the present invention.
  • FIG. 4 is a schematic structural diagram of a MAC information synchronization apparatus according to an embodiment of the present invention.
  • FIG. 5 is a schematic structural diagram of another MAC information synchronization apparatus according to an embodiment of the present invention.
  • FIG. 6 is a schematic structural diagram of a MAC information synchronization apparatus according to an embodiment of the present invention.
  • FIG. 7 is a schematic structural diagram of another MAC information synchronization apparatus according to an embodiment of the present invention. detailed description
  • FIG. 2 is a flowchart of a method for synchronizing MAC information according to an embodiment of the present invention.
  • This embodiment is a processing procedure of a sending end of a synchronous packet. As shown in the figure, the embodiment specifically includes:
  • Step 101 The first board receives the data packet.
  • Data packets can be sent by other boards.
  • Step 102 The first board performs MAC learning according to the data packet to generate a first MAC table. After receiving the data packet, the first board needs to learn MAC. That is, the first board saves the source MAC address and the information such as the VL AN and the port information of the data packet that are carried in the data packet to the first MAC table in the local area of the first board.
  • Step 103 The first board extracts first synchronization MAC information according to the first MAC table.
  • the first board extracts one or more entries from the locally saved first MAC table as the first synchronization MAC information, and each entry includes a MAC address, port information, and a VLAN.
  • Step 104 The first board encapsulates the first synchronous MAC information into the first synchronization message.
  • the first board Preferably, the first board generates MAC table synchronization information according to the first synchronization MAC information, and encapsulates the first MAC table synchronization information into a data field of the first synchronization message.
  • the first synchronization packet further carries a packet type, and the packet type indicates that the first synchronization packet is a packet for performing MAC information synchronization.
  • the MAC table synchronization information includes MCAST_ID, MAC Number, and MAC Entry.
  • MCAST-ID table The multicast group index (occupying two bytes), the MAC N ber represents the number of MAC entries encapsulated in the message (occupying two bytes), and the MAC Entry indicates the MAC entry information encapsulated in the message.
  • the first synchronization packet is defined as follows.
  • the DA is the destination MAC address, that is, the MAC address of the receiving end of the synchronization text.
  • 0-0-0 can be uniformly filled.
  • the SA is the source MAC address, which is the MAC address of the first card.
  • ETYPE is the message type, for example, it is customized to 0x8100. It is used to indicate that the packet is a synchronization packet.
  • the TAG is a VLAN TAG, and the VLAN TAG is fixed to 1. That is, the VLAN to which the synchronization belongs is 1.
  • LEN/TYPE is the length of the first synchronization packet. If the actual length of the MAC table synchronization information encapsulated in the first synchronization packet is smaller than the minimum length of the first synchronization packet (for example, 68), the padding is automatically added later. Use characters.
  • DATA is a data field used to carry MAC table synchronization information.
  • Step 105 The first board sends the first synchronization message to the second board, so that the second board obtains the first synchronization MAC information from the first synchronization message.
  • the MAC address entries in the first MAC table learned by the first board may be many. If all the learned MAC entries are encapsulated into the same first synchronization packet, the first packet may be encapsulated. The synchronous packet exceeds the allowed length. Therefore, the first synchronization packet can be encapsulated in batch mode.
  • the MAC table synchronization information is generated according to the first synchronization MAC information, and a first synchronization message is encapsulated and then transmitted.
  • the first board can apply for the multicast group index, and send the first synchronization packet to the multicast group by using the applied multicast index.
  • the other second board can copy the received first synchronization packet and forward it to each interface card.
  • the embodiment further includes the following steps:
  • Step 106 The first board timing extracts the second synchronization MAC information from the first MAC table, and encapsulates the second synchronization MAC information into the second synchronization message.
  • Each board maintains its own MAC address table.
  • the entries in the first MAC address table of the first card are aged or deleted, the MAC address table of the first MAC address table is consistent with the other MAC cards. Maintain the MAC table of each board through timing synchronization.
  • the first board can set an update period according to the number of the MAC entries in the first MAC table, and the first board extracts the MAC entry from the first MAC table as the second synchronous MAC information every time the update time is reached. And encapsulating the second synchronous MAC information into the second synchronization packet.
  • the second synchronization packet further carries a packet type, and the packet type indicates that the second synchronization packet is a packet for performing MAC information synchronization.
  • Step 107 The first board sends the second synchronization packet to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization packet, according to the second board.
  • the second synchronization MAC information updates a second MAC table that is locally saved by the second board.
  • the first board sends the second synchronization packet to the plurality of second boards in a multicast manner, so as to avoid sending multiple second synchronization packets. .
  • FIG. 3 is a flowchart of a method for synchronizing another MAC information according to an embodiment of the present invention.
  • the processing procedure of the receiving end of the synchronous packet is as shown in the figure.
  • Step 201 The second board receives the first synchronization message sent by the first board, where the first synchronization message carries the first synchronization MAC information extracted by the first board from the first MAC table.
  • the first synchronization packet is the first synchronization packet sent by the first board in the foregoing step 105.
  • the first synchronization MAC information includes one or more MAC entries, and each MAC entry includes a MAC address. Address, port information, and VLAN.
  • the first synchronization message carries first MAC table synchronization information generated by the first synchronization MAC information.
  • the first synchronization packet further carries a packet type, and the packet type indicates that the first synchronization packet is a packet for performing MAC information synchronization.
  • Step 202 The second board acquires the first synchronization MAC information carried in the first synchronization packet.
  • the second board obtains the first MAC table synchronization information from the DATA field of the first synchronization message, and acquires the first synchronization MAC information according to the first MAC table synchronization information.
  • Step 203 The second board updates the second MAC table saved by the second board according to the first synchronization MAC information.
  • the embodiment further includes the following steps:
  • Step 204 The second board receives the second synchronization packet periodically sent by the first board, where the second synchronization packet carries the second synchronization MAC information, where the second synchronization MAC information is timed by the first board. Extracted from the first MAC table.
  • the process of generating the second synchronization message may refer to step 106.
  • the second synchronization packet further carries a packet type, and the packet type indicates that the second synchronization packet is a packet for performing MAC information synchronization.
  • Step 205 The second board obtains the second synchronization MAC information from the second synchronization packet, and updates the locally saved second MAC table according to the second synchronization MAC information.
  • the second board obtains the second MAC table synchronization information from the second synchronization packet, thereby obtaining the second
  • the second synchronization MAC information in the MAC table synchronization information is used to update the locally saved second MAC table by using the second synchronization MAC information, so that the second MAC table locally on the second board and the first MAC of the first board The table is consistent.
  • the first board performs MAC learning according to the received data packet, extracts first synchronization MAC information from the first MAC table, and encapsulates the first synchronization MAC information into the first
  • a synchronization packet is sent to the second board, so that the second board obtains the first
  • the MAC information is used to implement the cross-board synchronization of the MAC information, which effectively solves the CPU burden caused by the board in order to learn the MAC information, and improves the reliability of the network.
  • 4 is a schematic structural diagram of a device for synchronizing MAC information according to an embodiment of the present invention.
  • a device for synchronizing MAC information is a device for transmitting a synchronization message, and the device is configured to perform the method shown in FIG. 2, and specifically includes: a receiving unit. 11. Generating unit 12, extracting unit 13, encapsulating unit 14, and transmitting unit 15.
  • the receiving unit 11 is configured to receive a data packet sent to the first board, and the generating unit 12 is configured to perform MAC learning according to the data packet to generate a first MAC table, and the extracting unit 13 is configured to use, according to the first
  • the MAC table extracts the first synchronization MAC information
  • the encapsulating unit 14 is configured to encapsulate the first synchronization MAC information into the first synchronization packet
  • the sending unit 15 is configured to send the first synchronization report to the second board.
  • the second board obtains the first synchronization MAC information from the first synchronization packet.
  • the encapsulating unit 14 is configured to generate MAC table synchronization information according to the first synchronization MAC information, and encapsulate the MAC table synchronization information into the first synchronization packet.
  • the generating unit 12 is specifically configured to use the first number of MAC entries as the first synchronization MAC information, and generate MAC table synchronization information according to the first synchronization MAC information.
  • the sending unit 15 is configured to multicast the first synchronization packet to multiple second boards.
  • the extracting unit 13 is further configured to periodically extract a second synchronization from the first MAC table.
  • the MAC information is encapsulated in the second synchronization packet, and the sending unit 15 is further configured to send the second synchronization packet to the second board, so that the second The board obtains the second synchronization MAC information from the second synchronization packet, and updates the second MAC table locally saved by the second board according to the second synchronization MAC information.
  • a device for synchronizing MAC information is a device for receiving a synchronization message, and the device is configured to perform the method shown in FIG. Specifically, it includes: a receiving unit 21, an obtaining unit 22, and an updating unit 23.
  • the receiving unit 21 is configured to receive a first synchronization packet that is sent by the first board, where the first synchronization packet carries the first synchronization MAC information that is extracted by the first board from the first MAC table, where the a synchronization MAC address includes one or more MAC entries; an obtaining unit 22, configured to acquire the first synchronization MAC information carried in the first synchronization packet, and an update unit 23, configured to use, according to the first synchronization
  • the MAC information updates the locally saved second MAC table.
  • the acquiring unit 22 is configured to obtain the MAC table synchronization information carried in the first synchronization packet, and obtain the first synchronization MAC information according to the MAC table synchronization information.
  • the receiving unit 21 is further configured to receive a second synchronization packet that is sent by the first board at a timing, where the second synchronization packet carries second synchronization MAC information, where the second synchronization MAC information is configured by The first board timing is extracted according to the first MAC table; the acquiring unit 22 is further configured to acquire the second synchronization MAC information from the second synchronization packet; the updating unit is further configured to The second synchronization MAC information updates the locally saved second MAC table.
  • the information synchronization device of the embodiment of the present invention receives the first synchronization packet and the second synchronization packet sent by the first board through the second board, and updates the second MAC table locally saved by the second board to implement MAC information.
  • the cross-board synchronization effectively solves the burden on the CPU caused by the board to learn MAC information and improves the reliability of the network.
  • FIG. 6 is a schematic structural diagram of a device for synchronizing MAC information according to an embodiment of the present invention.
  • the embodiment includes a network interface 61, a processor 62, and a memory 63.
  • the system bus 64 is used to connect the network interface 61, the processor 62, and the memory 63.
  • the network interface 61 is for communicating with an external device.
  • the memory 63 may be a persistent storage such as a hard disk drive and a flash memory having a software module and a device driver.
  • the software modules are capable of executing the various functional modules of the above described method of the present invention; the device drivers can be network and interface drivers.
  • the first board receives the data packet.
  • the first board performs MAC learning according to the data packet to generate a first MAC table.
  • the first board extracts first synchronization MAC information according to the first MAC table.
  • the first board encapsulates the first synchronization MAC information into a first synchronization message
  • the first board sends the first synchronization message to the second board, so that the second board obtains the first synchronization MAC information from the first synchronization message.
  • the first board is configured to encapsulate the first synchronization MAC information into the first synchronization message, where the first board generates MAC table synchronization information according to the first synchronization MAC information, where The MAC table synchronization information is encapsulated into the first synchronization message.
  • the generating, by the first board, the MAC address synchronization information according to the first synchronization MAC information that: the first board uses the first number of MAC entries as the first synchronization MAC information each time, according to the The first synchronous MAC information generates MAC table synchronization information.
  • the sending, by the first board, the first synchronization packet to the second board includes: the first board multicasting, sending, to the multiple second boards, the first synchronization message.
  • the first board multicasting sending, to the multiple second boards, the first synchronization message.
  • the first board periodically extracts the second synchronization MAC information from the local first MAC table, and encapsulates the second synchronization MAC into the second synchronization message.
  • the first board sends a second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization packet, according to the first
  • the second synchronous MAC information updates the second MAC table locally saved by the second board.
  • FIG. 7 is a schematic structural diagram of a MAC information synchronization apparatus according to an embodiment of the present invention. As shown in the figure, the embodiment includes a network interface 71, a processor 72, and a memory 73.
  • the system bus 74 is used to connect the network interface 71, the processor 72, and the memory 73.
  • the network interface 71 is for communicating with an external device.
  • the memory 73 may be a persistent storage such as a hard disk drive and a flash memory having a software module and a device driver therein.
  • the software modules are capable of performing the various functional modules of the above described method of the present invention; the device drivers can be network and interface drivers.
  • the second board receives the first synchronization message sent by the first board, where the first synchronization message carries the first synchronization MAC information that is extracted by the first board from the first MAC table.
  • the second board acquires the first synchronization MAC information encapsulated in the first synchronization packet; the second board updates the second saved by the second board according to the first synchronization MAC information.
  • MAC table The second board acquires the first synchronization MAC information encapsulated in the first synchronization packet; the second board updates the second saved by the second board according to the first synchronization MAC information.
  • the acquiring, by the second board, the first synchronization MAC information encapsulated in the first synchronization packet includes: the second board extracting a MAC table synchronization carried in the first synchronization packet And acquiring the first synchronous MAC information according to the first MAC table synchronization information.
  • the second board receives the second synchronization packet that is periodically sent by the first board, where the second synchronization packet carries the second synchronization MAC information, and the second synchronization MAC information is used by the first synchronization packet. Board timing is extracted from the first MAC table;
  • the second board obtains the second synchronization MAC information from the second synchronization packet, and updates the locally saved second MAC table according to the second synchronization MAC information.
  • the first board performs MAC learning according to the received data packet, extracts first synchronization MAC information from the first MAC table, and encapsulates the first synchronization MAC information into the first synchronization report.
  • the method is sent to the second board, so that the second board obtains the first synchronous MAC information, and the board information is synchronized across the board, which effectively solves the burden on the CPU caused by the board to learn the MAC information, and improves the load. Network reliability.
  • RAM random access memory
  • ROM read-only memory
  • EEPROM electrically programmable ROM
  • EEPROM electrically erasable programmable ROM
  • registers hard disk, removable disk, CD-ROM, or technical field Any other form of storage medium known.

Landscapes

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

Abstract

The embodiments of the present invention relate to a MAC information synchronization method and device. The method comprises: receiving a data message by a first single board; performing MAC study according to the data message, and generating a first MAC table; extracting first synchronization MAC information according to the first MAC table; packaging the first synchronization MAC information into a first synchronization message; and sending the first synchronization message to a second single board to enable the second single board to acquire the first synchronization MAC information from the first synchronization message. In the information synchronization method and device in the embodiments of the present invention, a first single board performs MAC study according to a received data message, extracts synchronization MAC information from a MAC table, and packages the synchronization MAC information into a first synchronization message to be sent to a second single board, thereby enabling the second single board to acquire the synchronization MAC information, realizing the synchronization of MAC information across boards, efficiently solving the problem that a single board causes burden on a CPU for studying the MAC information, and promoting the network reliability.

Description

介质访问控制信息的同步方法和装置 技术领域  Method and device for synchronizing medium access control information
本发明涉及通信领域, 尤其涉及一种介质访问控制信息的同步方法和装 置。 背景技术  The present invention relates to the field of communications, and in particular, to a method and apparatus for synchronizing media access control information. Background technique
随着网络技术的发展, 网络设备也越来越复杂, 二层网络中设备上需要 学习并指导报文转发的介质访问控制 (Media Access Control, MAC)信息也 越来越多。 为了扩容, 带扩展三态内容可寻址寄存器 ( Ternary Content Addressable Memory , TCAM) 的设备也越来越多。  With the development of network technologies, network devices are becoming more and more complex. Media Access Control (MAC) information on devices in the Layer 2 network that needs to learn and guide packet forwarding is also increasing. In order to expand, there are more and more devices with extended Ternary Content Addressable Memory (TCAM).
网络的复杂性使得网络负担也越来越重。 特别是在分布式设备中对跨板 MAC学习转发的处理直接影响到设备的性能和可靠性。  The complexity of the network makes the network burden more and more heavy. In particular, the processing of cross-board MAC learning forwarding in distributed devices directly affects the performance and reliability of the device.
在分布式设备中, 现有技术的 MAC学习方法是硬件学习, 例如数据流从 上行单板流入, 上行单板端口学习接收到的报文的源 MAC, 完成本板的 MAC学 习后, 报文继续通过互联端口转发到下行单板。 下行单板学习从互联端口进 来报文的源 MAC。  In the distributed device, the MAC learning method of the prior art is hardware learning. For example, the data stream flows from the upstream board, and the source MAC address of the received packet is learned by the uplink board port. After the MAC learning of the board is completed, the packet is received. Continue to forward to the downstream board through the interconnect port. The downstream board learns the source MAC address of the packet from the interconnect port.
在上述跨板学习中, 如果下行单板是支持 TCAM外扩 MAC学习的单板, 外 扩 TCAM的 MAC学习是需要处理器进行辅助学习的, 下行单板的接口板(Line Processing Unit, LPU )将学习到的 MAC信息学习成临时表项, LPU通知处理 器把学到的 MAC表项迁移到外扩 TCAM中, 因此需要占用处理器的开销。  In the above-mentioned cross-board learning, if the downlink board is a board that supports TCAM extended MAC learning, the MAC learning of the external extended TCAM requires the processor to assist learning. The Line Processing Unit (LPU) of the downlink board is used. The learned MAC information is learned into a temporary entry, and the LPU notifies the processor to migrate the learned MAC entry to the extended TCAM, so the processor overhead is required.
现有技术的下行单板从互联端口接收到报文后不会先查询外部 TCAM中是 否已经学到了该报文的源 MAC,而是对每一个报文都会通过处理器进行 MAC学 习, 导致处理器占用率过高, 外扩 TCAM的 MAC学习功能差。 当系统存在跨板 ETH-TRUNK ,即以太 TRENK上存在不同单板上的端口互联 时, 如图 1所示报文的发送和接收可能不是在同一条链路。 After receiving the packet from the interconnection port, the downstream board does not query whether the source MAC address of the packet has been learned in the external TCAM. Instead, the packet is processed by the processor for each packet. The occupancy rate of the device is too high, and the MAC learning function of the external expansion TCAM is poor. When there is a cross-board ETH-TRUNK, that is, there are port interconnections on different boards on the Ethernet TRENK, the packets may not be sent and received on the same link as shown in Figure 1.
例如, 用户 1和用户 2通过交换机间的跨板 ETH-TRUNK通信时, 用户 1 发送的报文, 通过该 ETH-TRUNK 中交换机 B 的接口板(L ine Proces s ing Un i t , LPU ) 4和交换机 A的 LPU2之间的链路发送到交换机 A中, 在转发该 文的过程中, LPU4和 LPU2都会进行用户 1的 MAC学习;  For example, when user 1 and user 2 communicate through the inter-board ETH-TRUNK, the packet sent by user 1 passes through the interface board (Line Proces s ing Un it, LPU) of switch B in the ETH-TRUNK. The link between the LPUs of the switch A is sent to the switch A. In the process of forwarding the text, both the LPU 4 and the LPU 2 perform the MAC learning of the user 1;
用户 2向用户 1发送报文时, 由于 ETH-TRUNK上使用了负载分担, 所述 报文被发送到交换机 B中的 LPU 3 , 但是 LPU3没有进行过用户 1的 MAC学习, 因此不知道用户 1的 MAC地址, 无法直接将所述报文发送给用户 1 , 只能通过 广播发送, 因此大大浪费了转发带宽。 发明内容  When user 2 sends a packet to user 1, the load is used on ETH-TRUNK, and the packet is sent to LPU 3 in switch B. However, LPU3 has not performed MAC learning of user 1, so user 1 is not known. The MAC address cannot be directly sent to the user 1 and can only be sent by broadcast, thus greatly reducing the forwarding bandwidth. Summary of the invention
本发明提供了一种 MAC信息的同步方法和装置, 可以利用第一同步报文 将获取到的数据报文中的源 MAC信息进行同步处理。  The present invention provides a method and device for synchronizing MAC information, which can use the first synchronization message to synchronize the source MAC information in the obtained data message.
本发明第一方面提供了一种介质访问控制 MAC信息的同步方法, 所述方 法包括:  A first aspect of the present invention provides a method for synchronizing media access control MAC information, the method comprising:
第一单板接收数据报文;  The first board receives the data packet.
第一单板根据所述数据报文进行 MAC学习, 生成第一 MAC表;  The first board performs MAC learning according to the data packet to generate a first MAC table.
所述第一单板根据所述第一 MAC表提取第一同步 MAC信息;  The first board extracts first synchronization MAC information according to the first MAC table;
所述第一单板将所述第一同步 MAC信息封装到第一同步报文中; 所述第一单板向第二单板发送所述第一同步报文, 以使所述第二单板从 所述第一同步报文中获取所述第一同步 MAC信息。  The first board encapsulates the first synchronization MAC information into the first synchronization packet; the first board sends the first synchronization packet to the second board, so that the second single The board acquires the first synchronization MAC information from the first synchronization packet.
在本发明第一方面第一种实现方式中,所述第一单板将所述第一同步 MAC 信息封装到第一同步报文包括: 所述第一单板根据所述第一同步 MAC信息生 成 MAC表同步信息, 将所述 MAC表同步信息封装入所述第一同步报文中。  In a first implementation manner of the first aspect of the present invention, the first board is configured to encapsulate the first synchronization MAC information into the first synchronization message, where the first board is configured according to the first synchronization MAC address. Generating MAC table synchronization information, and encapsulating the MAC table synchronization information into the first synchronization packet.
结合本发明第一方面的第一种实现方式, 在本发明第一方面的第二种实 现方式中, 所述第一单板根据所述第一同步 MAC信息生成 MAC表同步信息包 括: 所述第一单板每次将第一数量的 MAC表项作为第一同步 MAC信息, 根据 所述第一同步 MAC信息生成 MAC表同步信息。 In conjunction with the first implementation of the first aspect of the invention, the second embodiment of the first aspect of the invention In the current mode, the first board generates the MAC address synchronization information according to the first synchronization MAC information, including: the first board uses the first number of MAC entries as the first synchronization MAC information each time, according to the The first synchronous MAC information generates MAC table synchronization information.
结合本发明第一方面以上各实现方式, 所述第一单板向第二单板发送所 述第一同步报文包括: 所述第一单板向多个第二单板组播发送所述第一同步 报文。  According to the foregoing implementation manners of the first aspect of the present invention, the sending, by the first board, the first synchronization packet to the second board: The first synchronization message.
结合本发明第一方面以上各实现方式, 所述方法还包括: 所述第一单板 定时从本地第一 MAC表中提取第二同步 MAC信息, 将所述第二同步 MAC封装 入第二同步报文; 所述第一单板向所述第二单板发送第二同步报文, 以使所 述第二单板从所述第二同步报文中获取所述第二同步 MAC信息, 根据所述第 二同步 MAC信息更新所述第二单板本地保存的第二 MAC表。  With reference to the foregoing implementation manners of the first aspect of the present invention, the method further includes: the first board timing extracts the second synchronization MAC information from the local first MAC table, and encapsulates the second synchronization MAC into the second synchronization. The first board sends a second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization packet, according to the packet The second synchronization MAC information updates a second MAC table that is locally saved by the second board.
本发明第二方面提供一种介质访问控制 MAC信息的同步方法, 所述方法 包括:  A second aspect of the present invention provides a method for synchronizing media access control MAC information, where the method includes:
第二单板接收第一单板发送的第一同步报文, 所述第一同步报文携带所 述第一单板从第一 MAC表中提取的第一同步 MAC信息;  The second board receives the first synchronization message sent by the first board, where the first synchronization message carries the first synchronization MAC information extracted by the first board from the first MAC table.
所述第二单板获取所述第一同步报文中携带的所述第一同步 MAC信息; 所述第二单板根据所述第一同步 MAC信息更新所述第二单板保存的第二 MAC表。  The second board acquires the first synchronization MAC information carried in the first synchronization packet; the second board updates the second saved by the second board according to the first synchronization MAC information. MAC table.
在本发明第二方面第一种实现方式中, 所述第二单板获取所述第一同步 报文中携带的所述第一同步 MAC信息包括: 所述第二单板提取所述第一同步 报文中携带的 MAC表同步信息, 根据所述第一 MAC表同步信息获取所述第一 同步 MAC信息。  In the first implementation manner of the second aspect of the present invention, the acquiring, by the second board, the first synchronization MAC information that is carried in the first synchronization packet includes: the second board extracting the first And synchronizing the MAC table synchronization information carried in the packet, and acquiring the first synchronization MAC information according to the first MAC table synchronization information.
结合本发明第二方面以上各实现方式, 所述方法还包括: 所述第二单板 接收所述第一单板定时发送的第二同步报文, 所述第二同步报文携带第二同 步 MAC信息, 所述第二同步 MAC信息由所述第一单板定时从所述第一 MAC表 中提取; 所述第二单板从所述第二同步报文中获取所述第二同步 MAC信息, 根据 所述第二同步 MAC信息更新本地保存的所述第二 MAC表。 With the implementation of the second aspect of the present invention, the method further includes: the second board receives the second synchronization packet periodically sent by the first board, and the second synchronization packet carries the second synchronization. MAC information, the second synchronization MAC information is extracted from the first MAC table by the first board timing; And acquiring, by the second board, the second synchronization MAC information from the second synchronization packet, and updating the locally saved second MAC table according to the second synchronization MAC information.
本发明第三方面提供一种介质访问控制 MAC信息的同步装置, 所述装置 包括:  A third aspect of the present invention provides a device for synchronizing media access control MAC information, the device comprising:
接收单元, 用于接收发送给第一单板的数据报文;  a receiving unit, configured to receive a data packet sent to the first board;
生成单元, 用于根据所述数据报文进行 MAC学习, 生成第一 MAC表; 提取单元, 用于根据所述第一 MAC表提取第一同步 MAC信息;  a generating unit, configured to perform MAC learning according to the data packet, to generate a first MAC table, and an extracting unit, configured to extract, according to the first MAC table, first synchronization MAC information;
封装单元 , 用于将所述第一同步 MAC信息封装到第一同步报文中; 发送单元, 用于向第二单板发送所述第一同步报文, 以使所述第二单板 从所述第一同步报文中获取所述第一同步 MAC信息。  The encapsulating unit is configured to encapsulate the first synchronous MAC information into the first synchronization packet, and the sending unit is configured to send the first synchronization packet to the second board, so that the second board is The first synchronization MAC information is obtained in the first synchronization packet.
在本发明第三方面第一种实现方式中, 所述封装单元具体用于根据所述 第一同步 MAC信息生成 MAC表同步信息, 将所述 MAC表同步信息封装到所述 第一同步报文中。  In a first implementation manner of the third aspect, the encapsulating unit is configured to generate MAC table synchronization information according to the first synchronization MAC information, and encapsulate the MAC table synchronization information into the first synchronization packet. in.
结合本发明第三方面的第一种实现方式, 在本发明第三方面的第二种实 现方式中, 所述生成单元具体用于每次将第一数量的 MAC表项作为第一同步 MAC信息, 根据所述第一同步 MAC信息生成 MAC表同步信息。  With reference to the first implementation manner of the third aspect of the present invention, in a second implementation manner of the third aspect of the present disclosure, the generating unit is specifically configured to use the first quantity of MAC entries as the first synchronous MAC information each time. And generating MAC table synchronization information according to the first synchronization MAC information.
结合本发明第三方面以上各实现方式, 所述发送单元具体用于向多个第 二单板组播发送所述第一同步报文。  According to the foregoing implementation manners of the third aspect of the present invention, the sending unit is configured to multicast the first synchronization packet to multiple second boards.
结合本发明第三方面以上各实现方式, 所述提取单元还用于定时从所述 第一 MAC表中提取第二同步 MAC信息, 将所述第二同步 MAC封装入第二同步 报文; 所述发送单元还用于向所述第二单板发送所述第二同步报文, 以使所 述第二单板从所述第二同步报文中获取所述第二同步 MAC信息, 根据所述第 二同步 MAC信息更新所述第二单板本地保存的第二 MAC表。  With reference to the foregoing implementation manners of the third aspect of the present invention, the extracting unit is further configured to: periodically extract the second synchronous MAC information from the first MAC table, and encapsulate the second synchronous MAC into the second synchronous packet; The sending unit is further configured to send the second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization message, according to the The second synchronization MAC information is used to update the second MAC table locally saved by the second board.
本发明第四方面提供了一种介质访问控制 MAC信息的同步装置, 其特征 在于, 所述装置包括:  A fourth aspect of the present invention provides a device for synchronizing MAC information of a medium access control, characterized in that the device includes:
发送单元, 用于接收第一单板发送的第一同步报文, 所述第一同步报文 中携带所述第一单板从第一 MAC表中提取的第一同步 MAC信息; 获取单元, 用于获取所述第一同步报文中封装的所述第一同步 MAC信; 更新单元, 用于根据所述第一同步 MAC信息更新本地保存的第二 MAC表。 在本发明第四方面第一种实现方式中, 所述获取单元具体用于提取所述 第一同步报文中封装的 MAC表同步信息, 根据所述 MAC表同步信息获取所述 第一同步 MAC信息。 a sending unit, configured to receive a first synchronization packet sent by the first board, where the first synchronization packet is sent The first synchronization MAC information that is extracted by the first board from the first MAC table, the acquiring unit, configured to acquire the first synchronous MAC message encapsulated in the first synchronization packet, and the update unit, And updating the locally saved second MAC table according to the first synchronous MAC information. In a first implementation manner of the fourth aspect of the present invention, the acquiring unit is specifically configured to: obtain MAC address synchronization information encapsulated in the first synchronization packet, and acquire the first synchronization MAC according to the MAC table synchronization information. information.
在本发明第四方面第二种实现方式中, 所述接收单元还用于接收所述第 一单板定时发送的第二同步报文, 所述第二同步报文中携带第二同步 MAC信 息, 所述第二同步 MAC信息由所述第一单板定时根据所述第一 MAC表提取; 所述获取单元还用于从所述第二同步报文中获取所述第二同步 MAC信息; 所 述更新单元还用于根据所述第二同步 MAC信息更新本地保存的所述第二 MAC 表。  In a second implementation manner of the fourth aspect of the present invention, the receiving unit is further configured to receive a second synchronization packet periodically sent by the first board, where the second synchronization packet carries a second synchronization MAC address. The second synchronization MAC information is extracted by the first board according to the first MAC table; the acquiring unit is further configured to acquire the second synchronization MAC information from the second synchronization message; The updating unit is further configured to update the locally saved second MAC table according to the second synchronization MAC information.
本发明第五方面提供一种介质访问控制 MAC信息的同步装置, 所述装置 包括: 网络接口; 处理器; 存储器; 物理存储在所述存储器中的应用程序, 所述应用程序包括用于使所述处理器执行上述第一方面的方法的指令。  A fifth aspect of the present invention provides a medium access control MAC information synchronization apparatus, the apparatus comprising: a network interface; a processor; a memory; an application physically stored in the memory, the application program includes The processor executes the instructions of the method of the first aspect above.
本发明第六方面提供一种介质访问控制 MAC信息的同步装置, 所述装置 包括: 网络接口; 处理器; 存储器; 物理存储在所述存储器中的应用程序, 所述应用程序包括用于使所述处理器执行上述第二方面的方法的指令。  A sixth aspect of the present invention provides a medium access control MAC information synchronization apparatus, the apparatus comprising: a network interface; a processor; a memory; an application physically stored in the memory, the application program includes The processor executes the instructions of the method of the second aspect above.
本发明实施例中, 第一单板根据接收到的数据报文进行 MAC学习, 从 MAC 表中提取同步 MAC信息, 并将所述同步 MAC信息封装到第一同步报文中发送 给第二单板, 从而使得第二单板获取到同步 MAC信息, 实现了 MAC信息的跨 板同步, 有效解决了单板为了学习 MAC信息而造成的 CPU的负担, 提升了网 络的可靠性。 附图说明  In the embodiment of the present invention, the first board performs MAC learning according to the received data packet, extracts synchronous MAC information from the MAC table, and encapsulates the synchronous MAC information into the first synchronization packet and sends the message to the second single The board enables the second board to obtain the synchronous MAC information, and implements the cross-board synchronization of the MAC information, which effectively solves the burden on the CPU caused by the board to learn the MAC information, and improves the reliability of the network. DRAWINGS
图 1为现有技术报文发送和接收的示意图; 图 2为本发明实施例 MAC信息的同步方法的流程图; 1 is a schematic diagram of sending and receiving of a prior art message; 2 is a flowchart of a method for synchronizing MAC information according to an embodiment of the present invention;
图 3为本发明实施例另一 MAC信息的同步方法的流程图;  3 is a flowchart of another method for synchronizing MAC information according to an embodiment of the present invention;
图 4为本发明实施例 MAC信息的同步装置的结构示意图;  4 is a schematic structural diagram of a MAC information synchronization apparatus according to an embodiment of the present invention;
图 5为本发明实施例另一 MAC信息的同步装置的结构示意图;  FIG. 5 is a schematic structural diagram of another MAC information synchronization apparatus according to an embodiment of the present invention; FIG.
图 6为本发明实施例 MAC信息的同步装置的结构示意图;  6 is a schematic structural diagram of a MAC information synchronization apparatus according to an embodiment of the present invention;
图 7为本发明实施例另一 MAC信息的同步装置的结构示意图。 具体实施方式  FIG. 7 is a schematic structural diagram of another MAC information synchronization apparatus according to an embodiment of the present invention. detailed description
下面通过附图和实施例, 对本发明的技术方案做进一步的详细描述。 图 2为本发明实施例 MAC信息的同步方法的流程图, 本实施例为同步报 文的发送端的处理过程, 如图所示, 本实施例具体包括:  The technical solution of the present invention will be further described in detail below through the accompanying drawings and embodiments. FIG. 2 is a flowchart of a method for synchronizing MAC information according to an embodiment of the present invention. This embodiment is a processing procedure of a sending end of a synchronous packet. As shown in the figure, the embodiment specifically includes:
步骤 101 , 第一单板接收数据报文。  Step 101: The first board receives the data packet.
数据报文可以是其他单板发送过来的。  Data packets can be sent by other boards.
步骤 102 , 第一单板根据所述数据报文进行 MAC学习, 生成第一 MAC表。 第一单板收到数据报文后, 需要进行 MAC学习。 即第一单板将数据报文 中携带的源 MAC地址和 VL AN等信息、 以及接收所述数据报文的端口信息保存 到第一单板本地的第一 MAC表中。  Step 102: The first board performs MAC learning according to the data packet to generate a first MAC table. After receiving the data packet, the first board needs to learn MAC. That is, the first board saves the source MAC address and the information such as the VL AN and the port information of the data packet that are carried in the data packet to the first MAC table in the local area of the first board.
步骤 103、 所述第一单板根据所述第一 MAC表提取第一同步 MAC信息。 第一单板从本地保存的该第一 MAC表中提取一个或多个表项作为第一同 步 MAC信息, 每个表项包括 MAC地址、 端口信息和 VLAN。  Step 103: The first board extracts first synchronization MAC information according to the first MAC table. The first board extracts one or more entries from the locally saved first MAC table as the first synchronization MAC information, and each entry includes a MAC address, port information, and a VLAN.
步骤 104 , 第一单板将所述第一同步 MAC信息封装到第一同步报文中。 优选的, 第一单板根据第一同步 MAC信息生成 MAC表同步信息, 将第一 MAC表同步信息封装入第一同步报文的数据字段中。所述第一同步报文中还携 带报文类型, 所述报文类型表示所述第一同步报文为用于进行 MAC信息同步 的报文。  Step 104: The first board encapsulates the first synchronous MAC information into the first synchronization message. Preferably, the first board generates MAC table synchronization information according to the first synchronization MAC information, and encapsulates the first MAC table synchronization information into a data field of the first synchronization message. The first synchronization packet further carries a packet type, and the packet type indicates that the first synchronization packet is a packet for performing MAC information synchronization.
MAC表同步信息包括 MCAST_ ID、 MAC Number和 MAC Entry。 MCAST—ID表 示组播组索引 (占用两个字节) , MAC N菌 ber表示消息中封装的 MAC表项的 个数(占用两个字节) , MAC Entry表示消息中封装的 MAC表项信息。 The MAC table synchronization information includes MCAST_ID, MAC Number, and MAC Entry. MCAST-ID table The multicast group index (occupying two bytes), the MAC N ber represents the number of MAC entries encapsulated in the message (occupying two bytes), and the MAC Entry indicates the MAC entry information encapsulated in the message.
具体的, 为了保证第一同步报文能够在单板之间正确传输并被正确识别, 如表 1所示, 对第一同步报文定义如下。  Specifically, to ensure that the first synchronization packet can be correctly transmitted between the boards and correctly identified, as shown in Table 1, the first synchronization packet is defined as follows.
DA为目的 MAC地址, 即该同步 文接收端的 MAC地址, 例如可以统一填 0-0-0。  The DA is the destination MAC address, that is, the MAC address of the receiving end of the synchronization text. For example, 0-0-0 can be uniformly filled.
SA为源 MAC地址, 即第一单板的 MAC地址。  The SA is the source MAC address, which is the MAC address of the first card.
ETYPE是报文类型, 例如自定义为 0x8100。 用于表示该报文为同步报文。 TAG是 VLAN TAG, VLAN TAG固定为 1 , 即同步才艮文所属的 VLAN为 1。 LEN/TYPE是第一同步报文的长度, 如果封装入第一同步报文中的 MAC表 同步信息的实际长度小于第一同步报文的最小长度(例如 68 ),则后面会自动 加上填充用字符。  ETYPE is the message type, for example, it is customized to 0x8100. It is used to indicate that the packet is a synchronization packet. The TAG is a VLAN TAG, and the VLAN TAG is fixed to 1. That is, the VLAN to which the synchronization belongs is 1. LEN/TYPE is the length of the first synchronization packet. If the actual length of the MAC table synchronization information encapsulated in the first synchronization packet is smaller than the minimum length of the first synchronization packet (for example, 68), the padding is automatically added later. Use characters.
DATA是数据字段, 用于承载 MAC表同步信息。  DATA is a data field used to carry MAC table synchronization information.
表 1
Figure imgf000009_0001
步骤 105 ,第一单板向第二单板发送所述第一同步报文, 以使所述第二单 板从第一同步报文中获取所述第一同步 MAC信息。
Table 1
Figure imgf000009_0001
Step 105: The first board sends the first synchronization message to the second board, so that the second board obtains the first synchronization MAC information from the first synchronization message.
具体的, 第一单板学习到的第一 MAC表中的 MAC表项可能很多, 如果将 所有学习到的 MAC表项都封装到同一个第一同步报文的话, 可能会导致封装 的第一同步报文超过允许的长度, 因此可以使用批量方式来封装第一同步报 文。  Specifically, the MAC address entries in the first MAC table learned by the first board may be many. If all the learned MAC entries are encapsulated into the same first synchronization packet, the first packet may be encapsulated. The synchronous packet exceeds the allowed length. Therefore, the first synchronization packet can be encapsulated in batch mode.
例如, 每次将第一数量(如 400 )个 MAC表项作为第一同步 MAC信息, 根 据所述第一同步 MAC信息生成 MAC表同步信息, 封装入一个第一同步报文然 后发送。 另外, 为了提升第一同步报文发送到第二单板的效率, 第一单板可以申 请组播组索引, 利用申请到的组播索引将第一同步报文以组播组的方式发送 到其他第二单板。 其他第二单板可以将接收到的第一同步报文进行复制, 并 转发到各接口单板。 For example, each time the first number (such as 400) MAC entries are used as the first synchronization MAC information, the MAC table synchronization information is generated according to the first synchronization MAC information, and a first synchronization message is encapsulated and then transmitted. In addition, in order to improve the efficiency of sending the first synchronization packet to the second board, the first board can apply for the multicast group index, and send the first synchronization packet to the multicast group by using the applied multicast index. Other second boards. The other second board can copy the received first synchronization packet and forward it to each interface card.
另外, 再如图 2所示, 可选地, 本实施例还包括如下步骤:  In addition, as shown in FIG. 2, optionally, the embodiment further includes the following steps:
步骤 106 ,第一单板定时从所述第一 MAC表中提取第二同步 MAC信息,将 所述第二同步 MAC信息封装入第二同步报文中。  Step 106: The first board timing extracts the second synchronization MAC information from the first MAC table, and encapsulates the second synchronization MAC information into the second synchronization message.
因为每个单板都是独立维护自己的 MAC表, 当第一单板的第一 MAC表中 的表项老化或删除时, 为了保证第一 MAC表与其他各单板的 MAC表的一致性, 通过定时同步来维护各个单板的 MAC表。  Each board maintains its own MAC address table. When the entries in the first MAC address table of the first card are aged or deleted, the MAC address table of the first MAC address table is consistent with the other MAC cards. Maintain the MAC table of each board through timing synchronization.
第一单板可以根据第一 MAC表中 MAC表项的多少设定更新周期, 每到更 新时间的时候 ,第一单板从所述第一 MAC表中提取 MAC表项作为第二同步 MAC 信息, 并将所述第二同步 MAC信息封装入第二同步报文中。  The first board can set an update period according to the number of the MAC entries in the first MAC table, and the first board extracts the MAC entry from the first MAC table as the second synchronous MAC information every time the update time is reached. And encapsulating the second synchronous MAC information into the second synchronization packet.
所述第二同步报文中还携带报文类型, 所述报文类型表示所述第二同步 报文为用于进行 MAC信息同步的报文。  The second synchronization packet further carries a packet type, and the packet type indicates that the second synchronization packet is a packet for performing MAC information synchronization.
步骤 107 ,第一单板向所述第二单板发送所述第二同步报文, 以使所述第 二单板从所述第二同步报文中获取所述第二同步 MAC信息, 根据所述第二同 步 MAC信息更新所述第二单板本地保存的第二 MAC表。  Step 107: The first board sends the second synchronization packet to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization packet, according to the second board. The second synchronization MAC information updates a second MAC table that is locally saved by the second board.
当存在多个第二单板时, 第一单板具体通过组播的方式将所述第二同步 报文发送到所述多个第二单板, 这样可以避免发送多个第二同步报文。  When a plurality of second boards are present, the first board sends the second synchronization packet to the plurality of second boards in a multicast manner, so as to avoid sending multiple second synchronization packets. .
图 3为本发明实施例另一 MAC信息的同步方法的流程图, 本实施例为同 步报文的接收端的处理过程, 如图所示, 本实施例具体包括:  FIG. 3 is a flowchart of a method for synchronizing another MAC information according to an embodiment of the present invention. In this embodiment, the processing procedure of the receiving end of the synchronous packet is as shown in the figure.
步骤 201 ,第二单板接收第一单板发送的第一同步报文,所述第一同步报 文携带所述第一单板从第一 MAC表中提取的第一同步 MAC信息。  Step 201: The second board receives the first synchronization message sent by the first board, where the first synchronization message carries the first synchronization MAC information extracted by the first board from the first MAC table.
所述第一同步报文为上述步骤 105中所述第一单板发送的第一同步报文。 所述第一同步 MAC信息包括一个或多个 MAC表项, 每个 MAC表项包括 MAC地 址、 端口信息和 VLAN。 The first synchronization packet is the first synchronization packet sent by the first board in the foregoing step 105. The first synchronization MAC information includes one or more MAC entries, and each MAC entry includes a MAC address. Address, port information, and VLAN.
在另一个实施方式中, 所述第一同步报文携带由所述第一同步 MAC信息 生成的第一 MAC表同步信息。  In another embodiment, the first synchronization message carries first MAC table synchronization information generated by the first synchronization MAC information.
所述第一同步报文中还携带报文类型, 所述报文类型表示所述第一同步 报文为用于进行 MAC信息同步的报文。  The first synchronization packet further carries a packet type, and the packet type indicates that the first synchronization packet is a packet for performing MAC information synchronization.
步骤 202 , 第二单板获取所述第一同步报文中携带的第一同步 MAC信息。 第二单板从第一同步报文的 DATA字段中获取第一 MAC表同步信息,根据 所述第一 MAC表同步信息获取所述第一同步 MAC信息。  Step 202: The second board acquires the first synchronization MAC information carried in the first synchronization packet. The second board obtains the first MAC table synchronization information from the DATA field of the first synchronization message, and acquires the first synchronization MAC information according to the first MAC table synchronization information.
步骤 203 , 第二单板根据该第一同步 MAC信息更新第二单板保存的第二 MAC表。  Step 203: The second board updates the second MAC table saved by the second board according to the first synchronization MAC information.
再如图 3所示, 可选地, 本实施例还包括如下步骤:  As shown in FIG. 3, optionally, the embodiment further includes the following steps:
步骤 204 ,第二单板接收第一单板定时发送的第二同步报文,所述第二同 步报文携带第二同步 MAC信息, 所述第二同步 MAC信息由所述第一单板定时 从所述第一 MAC表中提取。  Step 204: The second board receives the second synchronization packet periodically sent by the first board, where the second synchronization packet carries the second synchronization MAC information, where the second synchronization MAC information is timed by the first board. Extracted from the first MAC table.
第二同步报文的生成过程可以参考步骤 106。  The process of generating the second synchronization message may refer to step 106.
所述第二同步报文中还携带报文类型, 所述报文类型表示所述第二同步 报文为用于进行 MAC信息同步的报文。  The second synchronization packet further carries a packet type, and the packet type indicates that the second synchronization packet is a packet for performing MAC information synchronization.
步骤 205 , 所述第二单板从所述第二同步报文中获取所述第二同步 MAC 信息, 根据所述第二同步 MAC信息更新本地保存的第二 MAC表。  Step 205: The second board obtains the second synchronization MAC information from the second synchronization packet, and updates the locally saved second MAC table according to the second synchronization MAC information.
第二单板从第二同步报文中获取到第二 MAC表同步信息, 从而得到第二 The second board obtains the second MAC table synchronization information from the second synchronization packet, thereby obtaining the second
MAC表同步信息中的第二同步 MAC信息,利用所述第二同步 MAC信息更新本地 保存的第二 MAC表,从而使第二单板本地的第二 MAC表与第一单板的第一 MAC 表保持一致。 The second synchronization MAC information in the MAC table synchronization information is used to update the locally saved second MAC table by using the second synchronization MAC information, so that the second MAC table locally on the second board and the first MAC of the first board The table is consistent.
本发明实施例的信息同步方法中, 第一单板根据接收到的数据报文进行 MAC学习, 从第一 MAC表中提取第一同步 MAC信息, 并将所述第一同步 MAC信 息封装到第一同步报文中发送给第二单板, 从而使得第二单板获取到第一同 步 MAC信息, 实现了 MAC信息的跨板同步, 有效解决了单板为了学习 MAC信 息而造成的 CPU的负担, 提升了网络的可靠性。 图 4为本发明实施例 MAC信息的同步装置的结构示意图, 本实施例 MAC 信息的同步装置是同步报文的发送装置, 所述装置用来执行图 2所示的方法, 具体包括: 接收单元 11、 生成单元 12、 提取单元 13、 封装单元 14和发送单 元 15。 In the information synchronization method of the embodiment of the present invention, the first board performs MAC learning according to the received data packet, extracts first synchronization MAC information from the first MAC table, and encapsulates the first synchronization MAC information into the first A synchronization packet is sent to the second board, so that the second board obtains the first The MAC information is used to implement the cross-board synchronization of the MAC information, which effectively solves the CPU burden caused by the board in order to learn the MAC information, and improves the reliability of the network. 4 is a schematic structural diagram of a device for synchronizing MAC information according to an embodiment of the present invention. In this embodiment, a device for synchronizing MAC information is a device for transmitting a synchronization message, and the device is configured to perform the method shown in FIG. 2, and specifically includes: a receiving unit. 11. Generating unit 12, extracting unit 13, encapsulating unit 14, and transmitting unit 15.
接收单元 11用于接收发送给第一单板的数据报文; 生成单元 12 , 用于根 据所述数据报文进行 MAC学习, 生成第一 MAC表; 提取单元 13 , 用于根据所 述第一 MAC表提取第一同步 MAC信息;封装单元 14 ,用于将所述第一同步 MAC 信息封装到第一同步报文中; 发送单元 15 , 用于向第二单板发送所述第一同 步报文, 以使所述第二单板从所述第一同步报文中获取所述第一同步 MAC信 息。  The receiving unit 11 is configured to receive a data packet sent to the first board, and the generating unit 12 is configured to perform MAC learning according to the data packet to generate a first MAC table, and the extracting unit 13 is configured to use, according to the first The MAC table extracts the first synchronization MAC information, the encapsulating unit 14 is configured to encapsulate the first synchronization MAC information into the first synchronization packet, and the sending unit 15 is configured to send the first synchronization report to the second board. And the second board obtains the first synchronization MAC information from the first synchronization packet.
可选地, 所述封装单元 14具体用于根据所述第一同步 MAC信息生成 MAC 表同步信息, 将所述 MAC表同步信息封装入所述第一同步报文中。  Optionally, the encapsulating unit 14 is configured to generate MAC table synchronization information according to the first synchronization MAC information, and encapsulate the MAC table synchronization information into the first synchronization packet.
可选地, 所述生成单元 12具体用于每次将第一数量的 MAC表项作为第一 同步 MAC信息, ^据所述第一同步 MAC信息生成 MAC表同步信息。  Optionally, the generating unit 12 is specifically configured to use the first number of MAC entries as the first synchronization MAC information, and generate MAC table synchronization information according to the first synchronization MAC information.
可选地, 所述发送单元 15具体用于向多个第二单板组播发送所述第一同 步报文。  Optionally, the sending unit 15 is configured to multicast the first synchronization packet to multiple second boards.
具体的, 所述提取单元 13还用于定时从所述第一 MAC表中提取第二同步 Specifically, the extracting unit 13 is further configured to periodically extract a second synchronization from the first MAC table.
MAC信息, 将所述第二同步 MAC封装入第二同步才艮文中; 所述发送单元 15还 用于向所述第二单板发送所述第二同步报文, 以使所述第二单板从所述第二 同步报文中获取所述第二同步 MAC信息, 根据所述第二同步 MAC信息更新所 述第二单板本地保存的第二 MAC表。 The MAC information is encapsulated in the second synchronization packet, and the sending unit 15 is further configured to send the second synchronization packet to the second board, so that the second The board obtains the second synchronization MAC information from the second synchronization packet, and updates the second MAC table locally saved by the second board according to the second synchronization MAC information.
图 5为本发明实施例 MAC信息的同步装置的结构示意图, 本实施例 MAC 信息的同步装置是同步报文的接收装置, 所述装置用于执行图 3所示的方法, 具体包括: 接收单元 21、 获取单元 22和更新单元 23。 5 is a schematic structural diagram of a device for synchronizing MAC information according to an embodiment of the present invention. In this embodiment, a device for synchronizing MAC information is a device for receiving a synchronization message, and the device is configured to perform the method shown in FIG. Specifically, it includes: a receiving unit 21, an obtaining unit 22, and an updating unit 23.
接收单元 21 , 用于接收第一单板发送的第一同步报文, 所述第一同步报 文携带所述第一单板从第一 MAC表中提取的第一同步 MAC信息, 所述第一同 步 MAC信息包括一个或多个 MAC表项; 获取单元 22 , 用于获取所述第一同步 报文中携带的所述第一同步 MAC信息; 更新单元 23 , 用于根据所述第一同步 MAC信息更新本地保存的第二 MAC表。  The receiving unit 21 is configured to receive a first synchronization packet that is sent by the first board, where the first synchronization packet carries the first synchronization MAC information that is extracted by the first board from the first MAC table, where the a synchronization MAC address includes one or more MAC entries; an obtaining unit 22, configured to acquire the first synchronization MAC information carried in the first synchronization packet, and an update unit 23, configured to use, according to the first synchronization The MAC information updates the locally saved second MAC table.
可选地, 所述获取单元 22具体用于获取所述第一同步报文中携带的 MAC 表同步信息, 根据所述 MAC表同步信息获取所述第一同步 MAC信息。  Optionally, the acquiring unit 22 is configured to obtain the MAC table synchronization information carried in the first synchronization packet, and obtain the first synchronization MAC information according to the MAC table synchronization information.
可选地, 所述接收单元 21还用于接收所述第一单板定时发送的第二同步 报文, 所述第二同步报文携带第二同步 MAC信息, 所述第二同步 MAC信息由 所述第一单板定时根据所述第一 MAC表提取; 所述获取单元 22还用于从所述 第二同步报文中获取所述第二同步 MAC信息; 所述更新单元还用于根据所述 第二同步 MAC信息更新本地保存的所述第二 MAC表。  Optionally, the receiving unit 21 is further configured to receive a second synchronization packet that is sent by the first board at a timing, where the second synchronization packet carries second synchronization MAC information, where the second synchronization MAC information is configured by The first board timing is extracted according to the first MAC table; the acquiring unit 22 is further configured to acquire the second synchronization MAC information from the second synchronization packet; the updating unit is further configured to The second synchronization MAC information updates the locally saved second MAC table.
本发明实施例的信息同步装置, 通过第二单板接收第一单板发送的第一 同步报文和第二同步报文, 更新第二单板本地保存的第二 MAC表, 实现了 MAC 信息的跨板同步, 有效解决了单板为了学习 MAC信息而造成的 CPU的负担, 提升了网络的可靠性。  The information synchronization device of the embodiment of the present invention receives the first synchronization packet and the second synchronization packet sent by the first board through the second board, and updates the second MAC table locally saved by the second board to implement MAC information. The cross-board synchronization effectively solves the burden on the CPU caused by the board to learn MAC information and improves the reliability of the network.
图 6为本发明实施例 MAC信息的同步装置的结构示意图, 如图所示, 本 实施例包括网络接口 61、 处理器 62和存储器 63。 系统总线 64用于连接网络 接口 61、 处理器 62和存储器 63。  FIG. 6 is a schematic structural diagram of a device for synchronizing MAC information according to an embodiment of the present invention. As shown in the figure, the embodiment includes a network interface 61, a processor 62, and a memory 63. The system bus 64 is used to connect the network interface 61, the processor 62, and the memory 63.
网络接口 61用于与外部设备通信。  The network interface 61 is for communicating with an external device.
存储器 63可以是永久存储器, 例如硬盘驱动器和闪存, 存储器 63中具 有软件模块和设备驱动程序。 软件模块能够执行本发明上述方法的各种功能 模块; 设备驱动程序可以是网络和接口驱动程序。  The memory 63 may be a persistent storage such as a hard disk drive and a flash memory having a software module and a device driver. The software modules are capable of executing the various functional modules of the above described method of the present invention; the device drivers can be network and interface drivers.
在启动时, 这些软件组件被加载到存储器 63中, 然后被处理器 62访问 并执行如下功能的指令: 第一单板接收数据报文; At startup, these software components are loaded into memory 63 and then accessed by processor 62 and execute instructions of the following functions: The first board receives the data packet.
所述第一单板根据所述数据报文进行 MAC学习, 生成第一 MAC表; 所述第一单板根据所述第一 MAC表提取第一同步 MAC信息;  The first board performs MAC learning according to the data packet to generate a first MAC table. The first board extracts first synchronization MAC information according to the first MAC table.
所述第一单板将所述第一同步 MAC信息封装到第一同步报文;  The first board encapsulates the first synchronization MAC information into a first synchronization message;
所述第一单板向第二单板发送所述第一同步报文, 以使所述第二单板从 所述第一同步报文中获取所述第一同步 MAC信息。  The first board sends the first synchronization message to the second board, so that the second board obtains the first synchronization MAC information from the first synchronization message.
上述功能及指令可以根据图 2及其相应的说明进行扩展。  The above functions and instructions can be extended according to Figure 2 and its corresponding description.
可选地, 所述第一单板将所述第一同步 MAC信息封装到第一同步报文包 括: 所述第一单板根据所述第一同步 MAC信息生成 MAC表同步信息, 将所述 MAC表同步信息封装入所述第一同步报文中。  Optionally, the first board is configured to encapsulate the first synchronization MAC information into the first synchronization message, where the first board generates MAC table synchronization information according to the first synchronization MAC information, where The MAC table synchronization information is encapsulated into the first synchronization message.
可选地, 所述第一单板根据所述第一同步 MAC信息生成 MAC表同步信息 包括: 所述第一单板每次将第一数量的 MAC表项作为第一同步 MAC信息, 根 据所述第一同步 MAC信息生成 MAC表同步信息。  Optionally, the generating, by the first board, the MAC address synchronization information according to the first synchronization MAC information, that: the first board uses the first number of MAC entries as the first synchronization MAC information each time, according to the The first synchronous MAC information generates MAC table synchronization information.
可选地, 所述第一单板向第二单板发送所述第一同步报文包括: 所述第 一单板向多个第二单板组播发送所述第一同步报文。 令:  Optionally, the sending, by the first board, the first synchronization packet to the second board includes: the first board multicasting, sending, to the multiple second boards, the first synchronization message. Order:
所述第一单板定时从本地第一 MAC表中提取第二同步 MAC信息, 将所述 第二同步 MAC封装入第二同步报文;  The first board periodically extracts the second synchronization MAC information from the local first MAC table, and encapsulates the second synchronization MAC into the second synchronization message.
所述第一单板向所述第二单板发送第二同步报文, 以使所述第二单板从 所述第二同步报文中获取所述第二同步 MAC信息, 根据所述第二同步 MAC信 息更新所述第二单板本地保存的第二 MAC表。  The first board sends a second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization packet, according to the first The second synchronous MAC information updates the second MAC table locally saved by the second board.
图 7为本发明实施例 MAC信息的同步装置的结构示意图, 如图所示, 本 实施例包括网络接口 71、 处理器 72和存储器 73。 系统总线 74用于连接网络 接口 71、 处理器 72和存储器 73。  FIG. 7 is a schematic structural diagram of a MAC information synchronization apparatus according to an embodiment of the present invention. As shown in the figure, the embodiment includes a network interface 71, a processor 72, and a memory 73. The system bus 74 is used to connect the network interface 71, the processor 72, and the memory 73.
网络接口 71用于与外部设备通信。 存储器 73可以是永久存储器, 例如硬盘驱动器和闪存, 存储器 73中具 有软件模块和设备驱动程序。 软件模块能够执行本发明上述方法的各种功能 模块; 设备驱动程序可以是网络和接口驱动程序。 The network interface 71 is for communicating with an external device. The memory 73 may be a persistent storage such as a hard disk drive and a flash memory having a software module and a device driver therein. The software modules are capable of performing the various functional modules of the above described method of the present invention; the device drivers can be network and interface drivers.
在启动时, 这些软件组件被加载到存储器 73中, 然后被处理器 72访问 并执行以下过程的指令:  At startup, these software components are loaded into memory 73 and then accessed by processor 72 and execute the instructions of the following process:
第二单板接收第一单板发送的第一同步报文, 所述第一同步报文中携带 所述第一单板从第一 MAC表中提取的第一同步 MAC信息;  The second board receives the first synchronization message sent by the first board, where the first synchronization message carries the first synchronization MAC information that is extracted by the first board from the first MAC table.
所述第二单板获取所述第一同步报文中封装的所述第一同步 MAC信息; 所述第二单板根据所述第一同步 MAC信息更新所述第二单板保存的第二 MAC表。  The second board acquires the first synchronization MAC information encapsulated in the first synchronization packet; the second board updates the second saved by the second board according to the first synchronization MAC information. MAC table.
上述功能和指令可以根据图 3及其相应的说明进行扩展。 可选地, 所述 第二单板获取所述第一同步报文中封装的所述第一同步 MAC信息包括: 所述 第二单板提取所述第一同步报文中携带的 MAC表同步信息,根据所述第一 MAC 表同步信息获取所述第一同步 MAC信息。 所述第二单板接收所述第一单板定时发送的第二同步报文, 所述第二同 步报文中携带第二同步 MAC信息, 所述第二同步 MAC信息由所述第一单板定 时从所述第一 MAC表中提取;  The above functions and instructions can be extended according to Figure 3 and its corresponding description. Optionally, the acquiring, by the second board, the first synchronization MAC information encapsulated in the first synchronization packet includes: the second board extracting a MAC table synchronization carried in the first synchronization packet And acquiring the first synchronous MAC information according to the first MAC table synchronization information. The second board receives the second synchronization packet that is periodically sent by the first board, where the second synchronization packet carries the second synchronization MAC information, and the second synchronization MAC information is used by the first synchronization packet. Board timing is extracted from the first MAC table;
所述第二单板从所述第二同步报文中获取所述第二同步 MAC信息, 根据 所述第二同步 MAC信息更新本地保存的所述第二 MAC表。  The second board obtains the second synchronization MAC information from the second synchronization packet, and updates the locally saved second MAC table according to the second synchronization MAC information.
本发明上述实施例中, 第一单板根据接收到的数据报文进行 MAC学习, 从第一 MAC表中提取第一同步 MAC信息, 并将所述第一同步 MAC信息封装到 第一同步报文中发送给第二单板, 从而使得第二单板获取到第一同步 MAC信 息, 实现了 MAC信息的跨板同步, 有效解决了单板为了学习 MAC信息而造成 的 CPU的负担, 提升了网络的可靠性。  In the foregoing embodiment of the present invention, the first board performs MAC learning according to the received data packet, extracts first synchronization MAC information from the first MAC table, and encapsulates the first synchronization MAC information into the first synchronization report. The method is sent to the second board, so that the second board obtains the first synchronous MAC information, and the board information is synchronized across the board, which effectively solves the burden on the CPU caused by the board to learn the MAC information, and improves the load. Network reliability.
本领域技术人员应该还可以进一步意识到, 结合本文中所公开的实施例 描述的各示例的单元及算法步骤, 能够以电子硬件、 计算机软件或者二者的 结合来实现, 为了清楚地说明硬件和软件的可互换性, 在上述说明中已经按 照功能一般性地描述了各示例的组成及步骤。 这些功能究竟以硬件还是软件 方式来执行, 取决于技术方案的特定应用和设计约束条件。 专业技术人员可 以对每个特定的应用来使用不同方法来实现所描述的功能, 但是这种实现不 应认为超出本发明的范围。 Those skilled in the art will further appreciate that the embodiments disclosed herein are incorporated The unit and algorithm steps of the various examples described can be implemented in electronic hardware, computer software, or a combination of both. In order to clearly illustrate the interchangeability of hardware and software, the foregoing description has been generally described in terms of function. The composition and steps of each example. Whether these functions are performed in hardware or software depends on the specific application and design constraints of the solution. A person skilled in the art can use different methods to implement the described functions for each particular application, but such implementation should not be considered to be beyond the scope of the present invention.
结合本文中所公开的实施例描述的方法或算法的步骤可以用硬件、 处理 器执行的软件模块, 或者二者的结合来实施。 软件模块可以置于随机存储器 ( RAM ) 、 内存、 只读存储器(ROM ) 、 电可编程 R0M、 电可擦除可编程 R0M、 寄存器、 硬盘、 可移动磁盘、 CD-R0M、 或技术领域内所公知的任意其它形式 的存储介质中。  The steps of a method or algorithm described in connection with the embodiments disclosed herein can be implemented in hardware, a software module executed by a processor, or a combination of both. Software modules can be placed in random access memory (RAM), memory, read-only memory (ROM), electrically programmable ROM, electrically erasable programmable ROM, registers, hard disk, removable disk, CD-ROM, or technical field Any other form of storage medium known.
以上所述的具体实施方式, 对本发明的目的、 技术方案和有益效果进行 了进一步详细说明, 所应理解的是, 以上所述仅为本发明的具体实施方式而 已, 并不用于限定本发明的保护范围, 凡在本发明的精神和原则之内, 所做 的任何修改、 等同替换、 改进等, 均应包含在本发明的保护范围之内。  The above described embodiments of the present invention are further described in detail, and the embodiments of the present invention are intended to be illustrative only. The scope of the protection, any modifications, equivalents, improvements, etc., made within the spirit and scope of the invention are intended to be included within the scope of the invention.

Claims

权 利 要 求 书 claims
1、 一种介质访问控制 MAC信息的同步方法,其特征在于,所述方法包括: 第一单板接收数据报文; 1. A method for synchronizing media access control MAC information, characterized in that the method includes: the first single board receives a data message;
第一单板根据所述数据报文进行 MAC学习, 生成第一 MAC表; The first board performs MAC learning based on the data message and generates a first MAC table;
所述第一单板根据所述第一 MAC表提取第一同步 MAC信息; The first single board extracts first synchronization MAC information according to the first MAC table;
所述第一单板将所述第一同步 MAC信息封装到第一同步报文中; 所述第一单板向第二单板发送所述第一同步报文, 以使所述第二单板从 所述第一同步报文中获取所述第一同步 MAC信息。 The first board encapsulates the first synchronization MAC information into a first synchronization message; the first board sends the first synchronization message to the second board, so that the second unit The board obtains the first synchronization MAC information from the first synchronization message.
2、 根据权利要求 1所述的 MAC信息的同步方法,其特征在于,所述第一 单板将所述第一同步 MAC信息封装到第一同步报文包括: 所述第一单板根据 所述第一同步 MAC信息生成 MAC表同步信息, 将所述 MAC表同步信息封装入 所述第一同步报文中。 2. The synchronization method of MAC information according to claim 1, characterized in that the first board encapsulates the first synchronization MAC information into a first synchronization message including: the first board encapsulates the first synchronization MAC information according to the The first synchronized MAC information generates MAC table synchronized information, and the MAC table synchronized information is encapsulated into the first synchronized message.
3、 根据权利要求 2所述的 MAC信息的同步方法,其特征在于,所述第一 单板根据所述第一同步 MAC信息生成 MAC表同步信息包括: 所述第一单板每 次将第一数量的 MAC表项作为第一同步 MAC信息, 根据所述第一同步 MAC信 息生成 MAC表同步信息。 3. The synchronization method of MAC information according to claim 2, characterized in that, the first single board generating MAC table synchronization information according to the first synchronized MAC information includes: the first single board will generate the MAC table synchronization information each time. A number of MAC table entries are used as first synchronized MAC information, and MAC table synchronization information is generated according to the first synchronized MAC information.
4、 根据权利要求 1-3中任意一项所述的 MAC信息的同步方法,其特征在 于, 所述第一单板向第二单板发送所述第一同步报文包括: 所述第一单板向 多个第二单板组播发送所述第一同步报文。 4. The method for synchronizing MAC information according to any one of claims 1-3, characterized in that: sending the first synchronization message by the first board to the second board includes: the first board The single board multicasts the first synchronization message to multiple second single boards.
5、 根据权利要求 1—4任意一项所述的 MAC信息的同步方法, 其特征在 于, 所述方法还包括: 5. The MAC information synchronization method according to any one of claims 1 to 4, characterized in that the method further includes:
所述第一单板定时从本地第一 MAC表中提取第二同步 MAC信息, 将所述 第二同步 MAC封装入第二同步报文; The first single board regularly extracts the second synchronization MAC information from the local first MAC table, and encapsulates the second synchronization MAC into a second synchronization message;
所述第一单板向所述第二单板发送第二同步报文, 以使所述第二单板从 所述第二同步报文中获取所述第二同步 MAC信息, 根据所述第二同步 MAC信 息更新所述第二单板本地保存的第二 MAC表。 The first board sends a second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization message, according to the second synchronization message. The second synchronized MAC information updates the second MAC table stored locally on the second board.
6、 一种介质访问控制 MAC信息的同步方法,其特征在于,所述方法包括: 第二单板接收第一单板发送的第一同步报文, 所述第一同步报文携带所 述第一单板从第一 MAC表中提取的第一同步 MAC信息; 6. A method for synchronizing media access control MAC information, characterized in that the method includes: the second board receives the first synchronization message sent by the first board, and the first synchronization message carries the first synchronization message. The first synchronized MAC information extracted by a single board from the first MAC table;
所述第二单板获取所述第一同步报文中携带的所述第一同步 MAC信息; 所述第二单板根据所述第一同步 MAC信息更新所述第二单板保存的第二 The second board obtains the first synchronization MAC information carried in the first synchronization message; the second board updates the second synchronization MAC information saved by the second board according to the first synchronization MAC information.
MAC表。 MAC table.
7、 根据权利要求 6所述的 MAC信息的同步方法,其特征在于,所述第二 单板获取所述第一同步报文中携带的所述第一同步 MAC信息包括: 所述第二 单板提取所述第一同步报文中携带的 MAC表同步信息, 根据所述第一 MAC表 同步信息获取所述第一同步 MAC信息。 7. The synchronization method of MAC information according to claim 6, wherein the second board obtains the first synchronization MAC information carried in the first synchronization message including: the second unit: The board extracts the MAC table synchronization information carried in the first synchronization message, and obtains the first synchronization MAC information according to the first MAC table synchronization information.
8、 根据权利要求 6或 7所述的 MAC信息的同步方法,其特征在于,所述 方法还包括: 8. The MAC information synchronization method according to claim 6 or 7, characterized in that the method further includes:
所述第二单板接收所述第一单板定时发送的第二同步报文, 所述第二同 步报文携带第二同步 MAC信息, 所述第二同步 MAC信息由所述第一单板定时 从所述第一 MAC表中提取; The second board receives a second synchronization message sent regularly by the first board. The second synchronization message carries second synchronization MAC information. The second synchronization MAC information is obtained by the first board. Extract from the first MAC table regularly;
所述第二单板从所述第二同步报文中获取所述第二同步 MAC信息, 根据 所述第二同步 MAC信息更新本地保存的所述第二 MAC表。 The second single board obtains the second synchronization MAC information from the second synchronization message, and updates the locally saved second MAC table according to the second synchronization MAC information.
9、 一种介质访问控制 MAC信息的同步装置,其特征在于,所述装置包括: 接收单元, 用于接收发送给第一单板的数据报文; 9. A device for synchronizing media access control MAC information, characterized in that the device includes: a receiving unit, configured to receive a data message sent to the first board;
生成单元, 用于根据所述数据报文进行 MAC学习, 生成第一 MAC表; 提取单元, 用于根据所述第一 MAC表提取第一同步 MAC信息; A generating unit, configured to perform MAC learning based on the data message and generate a first MAC table; an extraction unit, configured to extract the first synchronized MAC information based on the first MAC table;
封装单元 , 用于将所述第一同步 MAC信息封装到第一同步报文中; 发送单元, 用于向第二单板发送所述第一同步报文, 以使所述第二单板 从所述第一同步报文中获取所述第一同步 MAC信息。 An encapsulation unit, used to encapsulate the first synchronization MAC information into a first synchronization message; A sending unit, used to send the first synchronization message to the second board, so that the second board can The first synchronization MAC information is obtained from the first synchronization message.
10、 根据权利要求 9所述的 MAC信息的同步装置, 其特征在于, 所述封 装单元具体用于根据所述第一同步 MAC信息生成 MAC表同步信息,将所述 MAC 表同步信息封装到所述第一同步报文中。 10. The device for synchronizing MAC information according to claim 9, wherein the encapsulating unit is specifically configured to generate MAC table synchronization information according to the first synchronized MAC information, and convert the MAC Table synchronization information is encapsulated into the first synchronization message.
11、 根据权利要求 10所述的 MAC信息的同步装置,其特征在于,所述生 成单元具体用于每次将第一数量的 MAC表项作为第一同步 MAC信息, 根据所 述第一同步 MAC信息生成 MAC表同步信息。 11. The device for synchronizing MAC information according to claim 10, wherein the generating unit is specifically configured to use a first number of MAC table entries as first synchronized MAC information each time, according to the first synchronized MAC The information generates MAC table synchronization information.
12、 根据权利要求 9-11任意一项所述的 MAC信息的同步装置,其特征在 于, 所述发送单元具体用于向多个第二单板组播发送所述第一同步报文。 12. The device for synchronizing MAC information according to any one of claims 9-11, wherein the sending unit is specifically configured to multicast the first synchronization message to multiple second boards.
13、 根据权利要求 9-12任意一项所述的 MAC信息的同步装置,其特征在 于: 13. The MAC information synchronization device according to any one of claims 9-12, characterized by:
所述提取单元还用于定时从所述第一 MAC表中提取第二同步 MAC信息, 将所述第二同步 MAC封装入第二同步报文; The extraction unit is also configured to regularly extract second synchronization MAC information from the first MAC table, and encapsulate the second synchronization MAC into a second synchronization message;
所述发送单元还用于向所述第二单板发送所述第二同步报文, 以使所述 第二单板从所述第二同步报文中获取所述第二同步 MAC信息, 根据所述第二 同步 MAC信息更新所述第二单板本地保存的第二 MAC表。 The sending unit is further configured to send the second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization message, according to The second synchronized MAC information updates the second MAC table stored locally on the second board.
14、 一种介质访问控制 MAC信息的同步装置, 其特征在于, 所述装置包 括: 14. A device for synchronizing media access control MAC information, characterized in that the device includes:
发送单元, 用于接收第一单板发送的第一同步报文, 所述第一同步报文 中携带所述第一单板从第一 MAC表中提取的第一同步 MAC信息; A sending unit, configured to receive a first synchronization message sent by the first board, where the first synchronization message carries the first synchronization MAC information extracted by the first board from the first MAC table;
获取单元, 用于获取所述第一同步报文中封装的所述第一同步 MAC信息; 更新单元, 用于根据所述第一同步 MAC信息更新本地保存的第二 MAC表。 An acquisition unit, configured to acquire the first synchronization MAC information encapsulated in the first synchronization message; and an update unit, configured to update the locally saved second MAC table according to the first synchronization MAC information.
15、 根据权利要求 14所述的 MAC信息的同步装置,其特征在于,所述获 取单元具体用于提取所述第一同步报文中封装的 MAC表同步信息, 根据所述 MAC表同步信息获取所述第一同步 MAC信息。 15. The device for synchronizing MAC information according to claim 14, wherein the obtaining unit is specifically configured to extract the MAC table synchronization information encapsulated in the first synchronization message, and obtain the MAC table synchronization information according to the The first synchronized MAC information.
16、 根据权利要求 14或 15所述的 MAC信息的同步装置, 其特征在于: 所述接收单元还用于接收所述第一单板定时发送的第二同步报文, 所述 第二同步报文中携带第二同步 MAC信息, 所述第二同步 MAC信息由所述第一 单板定时根据所述第一 MAC表提取; 所述获取单元还用于从所述第二同步报文中获取所述第二同步 MAC信息; 所述更新单元还用于根据所述第二同步 MAC信息更新本地保存的所述第 二 MAC表。 16. The MAC information synchronization device according to claim 14 or 15, characterized in that: the receiving unit is also used to receive a second synchronization message sent regularly by the first single board, and the second synchronization message The text carries second synchronized MAC information, and the second synchronized MAC information is regularly extracted by the first board according to the first MAC table; The obtaining unit is also used to obtain the second synchronization MAC information from the second synchronization message; the update unit is also used to update the locally saved second MAC table according to the second synchronization MAC information. .
17、 一种介质访问控制 MAC信息的同步装置, 其特征在于, 所述装置包 括: 17. A device for synchronizing media access control MAC information, characterized in that the device includes:
网络接口; Network Interface;
处理器; processor;
存储器; memory;
物理存储在所述存储器中的应用程序, 所述应用程序包括用于使所述处 理器执行以下过程的指令: An application program physically stored in the memory, the application program including instructions for causing the processor to perform the following processes:
第一单板接收数据报文; The first board receives the data message;
所述第一单板根据所述数据报文进行 MAC学习, 生成第一 MAC表; 所述第一单板根据所述第一 MAC表提取第一同步 MAC信息; The first board performs MAC learning based on the data message and generates a first MAC table; the first board extracts first synchronization MAC information based on the first MAC table;
所述第一单板将所述第一同步 MAC信息封装到第一同步报文; The first single board encapsulates the first synchronization MAC information into a first synchronization message;
所述第一单板向第二单板发送所述第一同步报文, 以使所述第二单板从 所述第一同步报文中获取所述第一同步 MAC信息。 The first board sends the first synchronization message to the second board, so that the second board obtains the first synchronization MAC information from the first synchronization message.
18、 根据权利要求 17所述的 MAC信息的同步装置,其特征在于,所述第 一单板将所述第一同步 MAC信息封装到第一同步报文包括: 所述第一单板根 据所述第一同步 MAC信息生成 MAC表同步信息, 将所述 MAC表同步信息封装 入所述第一同步报文中。 18. The device for synchronizing MAC information according to claim 17, wherein the first board encapsulates the first synchronized MAC information into a first synchronization message including: the first board encapsulates the first synchronized MAC information according to the The first synchronized MAC information generates MAC table synchronized information, and the MAC table synchronized information is encapsulated into the first synchronized message.
19、 根据权利要求 18所述的 MAC信息的同步装置,其特征在于,所述第 一单板根据所述第一同步 MAC信息生成 MAC表同步信息包括: 所述第一单板 每次将第一数量的 MAC表项作为第一同步 MAC信息, 根据所述第一同步 MAC 信息生成 MAC表同步信息。 19. The device for synchronizing MAC information according to claim 18, wherein the first board generating MAC table synchronization information according to the first synchronized MAC information includes: each time the first board generates the MAC table synchronization information, A number of MAC table entries are used as first synchronized MAC information, and MAC table synchronization information is generated according to the first synchronized MAC information.
20、 根据权利要求 17-19中任意一项所述的 MAC信息的同步装置, 其特 征在于, 所述第一单板向第二单板发送所述第一同步报文包括: 所述第一单 板向多个第二单板组播发送所述第一同步报文。 20. The device for synchronizing MAC information according to any one of claims 17 to 19, characterized in that: sending the first synchronization message by the first board to the second board includes: the first one The board multicasts the first synchronization message to multiple second boards.
21、 根据权利要求 17-21中任意一项所述的 MAC信息的同步装置, 其特 所述第一单板定时从本地第一 MAC表中提取第二同步 MAC信息, 将所述 第二同步 MAC封装入第二同步报文; 21. The device for synchronizing MAC information according to any one of claims 17-21, wherein the first single board regularly extracts the second synchronized MAC information from the local first MAC table, and synchronizes the second synchronized MAC information with the second synchronized MAC information. MAC encapsulates the second synchronization message;
所述第一单板向所述第二单板发送第二同步报文, 以使所述第二单板从 所述第二同步报文中获取所述第二同步 MAC信息, 根据所述第二同步 MAC信 息更新所述第二单板本地保存的第二 MAC表。 The first board sends a second synchronization message to the second board, so that the second board obtains the second synchronization MAC information from the second synchronization message, according to the second synchronization message. The second synchronized MAC information updates the second MAC table stored locally on the second board.
22、 一种介质访问控制 MAC信息的同步装置, 其特征在于, 所述装置包 括: 22. A device for synchronizing media access control MAC information, characterized in that the device includes:
网络接口; Network Interface;
处理器; processor;
存储器; memory;
物理存储在所述存储器中的应用程序, 所述应用程序包括用于使所述处 理器执行以下过程的指令: An application program physically stored in the memory, the application program including instructions for causing the processor to perform the following processes:
第二单板接收第一单板发送的第一同步报文, 所述第一同步报文中携带 所述第一单板从第一 MAC表中提取的第一同步 MAC信息; The second board receives the first synchronization message sent by the first board, and the first synchronization message carries the first synchronization MAC information extracted by the first board from the first MAC table;
所述第二单板获取所述第一同步报文中封装的所述第一同步 MAC信息; 所述第二单板根据所述第一同步 MAC信息更新所述第二单板保存的第二 MAC表。 The second board obtains the first synchronization MAC information encapsulated in the first synchronization message; the second board updates the second synchronization MAC information stored by the second board according to the first synchronization MAC information. MAC table.
23、 根据权利要求 24所述的 MAC信息的同步装置,其特征在于,所述第 二单板获取所述第一同步报文中封装的所述第一同步 MAC信息包括: 所述第 二单板提取所述第一同步报文中携带的 MAC表同步信息, 根据所述第一 MAC 表同步信息获取所述第一同步 MAC信息。 23. The device for synchronizing MAC information according to claim 24, wherein the second single board obtains the first synchronized MAC information encapsulated in the first synchronization message including: the second single board The board extracts the MAC table synchronization information carried in the first synchronization message, and obtains the first synchronization MAC information according to the first MAC table synchronization information.
24、 根据权利要求 22或 23所述的 MAC信息的同步装置, 其特征在于, 所述第二单板接收所述第一单板定时发送的第二同步报文, 所述第二同 步报文中携带第二同步 MAC信息, 所述第二同步 MAC信息由所述第一单板定 时从所述第一 MAC表中提取; 24. The MAC information synchronization device according to claim 22 or 23, characterized in that, The second single board receives a second synchronization message sent regularly by the first single board. The second synchronization message carries second synchronization MAC information. The second synchronization MAC information is provided by the first unit. Board timing is extracted from the first MAC table;
所述第二单板从所述第二同步报文中获取所述第二同步 MAC信息, 根据 所述第二同步 MAC信息更新本地保存的所述第二 MAC表。 The second single board obtains the second synchronization MAC information from the second synchronization message, and updates the locally saved second MAC table according to the second synchronization MAC information.
PCT/CN2012/087738 2012-12-27 2012-12-27 Media access control information synchronization method and device WO2014101066A1 (en)

Priority Applications (2)

Application Number Priority Date Filing Date Title
PCT/CN2012/087738 WO2014101066A1 (en) 2012-12-27 2012-12-27 Media access control information synchronization method and device
CN201280002843.4A CN104322018A (en) 2012-12-27 2012-12-27 Media access control information synchronization method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2012/087738 WO2014101066A1 (en) 2012-12-27 2012-12-27 Media access control information synchronization method and device

Publications (1)

Publication Number Publication Date
WO2014101066A1 true WO2014101066A1 (en) 2014-07-03

Family

ID=51019712

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2012/087738 WO2014101066A1 (en) 2012-12-27 2012-12-27 Media access control information synchronization method and device

Country Status (2)

Country Link
CN (1) CN104322018A (en)
WO (1) WO2014101066A1 (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN109274592B (en) * 2018-11-22 2021-03-09 新华三技术有限公司 MAC address table item processing method and device and computer readable medium
CN113079095B (en) * 2020-01-06 2022-09-02 烽火通信科技股份有限公司 Method and system for improving MAC learning rate through hardware compression and packaging

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179514A (en) * 2007-12-18 2008-05-14 杭州华三通信技术有限公司 Method and device of maintaining MAC item of distributed network processing system
CN101656676A (en) * 2009-09-18 2010-02-24 杭州华三通信技术有限公司 Method and equipment for updating media access control (MAC) address list items
CN101877667A (en) * 2009-04-30 2010-11-03 华为技术有限公司 Message forwarding method, device and system

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101179514A (en) * 2007-12-18 2008-05-14 杭州华三通信技术有限公司 Method and device of maintaining MAC item of distributed network processing system
CN101877667A (en) * 2009-04-30 2010-11-03 华为技术有限公司 Message forwarding method, device and system
CN101656676A (en) * 2009-09-18 2010-02-24 杭州华三通信技术有限公司 Method and equipment for updating media access control (MAC) address list items

Also Published As

Publication number Publication date
CN104322018A (en) 2015-01-28

Similar Documents

Publication Publication Date Title
US11240065B2 (en) NSH encapsulation for traffic steering
US9608841B2 (en) Method for real-time synchronization of ARP record in RSMLT cluster
KR101536141B1 (en) Apparatus and method for converting signal between ethernet and can in a vehicle
US20130250956A1 (en) Non-fragmented ip packet tunneling in a network
CN108432194B (en) Congestion processing method, host and system
EP2680507B1 (en) Packet forwarding method and system, and relay agent device
WO2016198013A1 (en) Packet transmission method and apparatus
JP6722816B2 (en) Packet transfer
WO2017088557A1 (en) Processing method and apparatus for sending and receiving data packet
CN102970227A (en) Method and device for achieving virtual extensible local area network (VXLAN) message transmitting in application specific integrated circuit (ASIC)
CN104796353B (en) Message forwarding method, interchanger
CN108259635B (en) ARP (Address resolution protocol) table item learning method and DR (digital radiography) equipment
CN105745883A (en) Method for synchronizing forwarding tables, network device, and system
US20170078115A1 (en) Multi-homed access
EP3032782B1 (en) Packet transmission method and apparatus
WO2014101066A1 (en) Media access control information synchronization method and device
EP2981036A1 (en) Multicast communication method and aggregation switch
WO2016095571A1 (en) Method and device for establishing a multicast channel
EP3499817A1 (en) Method for synchronizing topology information in sfc network and routing network element
US20160094367A1 (en) Migrating multicast flow
CN102868642A (en) Method and device for achieving NVGRE message transmission in application specific integrated circuit (ASIC)
WO2012062156A1 (en) Method and device for configuring vpls mac entry space
US9998376B2 (en) Control device, communication system, control method, and non-transitory recording medium
WO2015188706A1 (en) Data frame processing method, device and system
CN114006780A (en) Method, equipment and system for forwarding message

Legal Events

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

Ref document number: 12891268

Country of ref document: EP

Kind code of ref document: A1

NENP Non-entry into the national phase

Ref country code: DE

122 Ep: pct application non-entry in european phase

Ref document number: 12891268

Country of ref document: EP

Kind code of ref document: A1