CN107819684B - Synchronous processing method and device - Google Patents

Synchronous processing method and device Download PDF

Info

Publication number
CN107819684B
CN107819684B CN201610818946.8A CN201610818946A CN107819684B CN 107819684 B CN107819684 B CN 107819684B CN 201610818946 A CN201610818946 A CN 201610818946A CN 107819684 B CN107819684 B CN 107819684B
Authority
CN
China
Prior art keywords
mac
mac address
line card
synchronous
message
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN201610818946.8A
Other languages
Chinese (zh)
Other versions
CN107819684A (en
Inventor
刘春艳
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
ZTE Corp
Original Assignee
ZTE Corp
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 ZTE Corp filed Critical ZTE Corp
Priority to CN201610818946.8A priority Critical patent/CN107819684B/en
Publication of CN107819684A publication Critical patent/CN107819684A/en
Application granted granted Critical
Publication of CN107819684B publication Critical patent/CN107819684B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5069Address allocation for group communication, multicast communication or broadcast communication
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

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

Abstract

The invention provides a synchronous processing method and a device, wherein the method comprises the following steps: the first line card learns the MAC address through the network processor NP; and the first line card sends the MAC synchronous multicast message to other line cards through the NP, wherein the MAC synchronous multicast message comprises an MAC address. The invention can solve the problem that the synchronous processing of the line card in the related technology is completed by software and the change of the MAC address table is possibly difficult to reflect in time.

Description

Synchronous processing method and device
Technical Field
The present invention relates to the field of communications, and in particular, to a synchronization processing method and apparatus.
Background
The distributed system consists of a main control board, a standby control board, an exchange board and a plurality of line cards. After each line card receives the ethernet frame, an entry is formed and added to a MAC address table based on the ingress port information and a source Media Access Control (MAC) address of the ethernet frame, and the identification is a self-learning entry, which is MAC address self-learning. And deleting the MAC address table entry which is not refreshed in the configured aging time is the MAC address aging. Each line card constructs a message packet from the self-learning MAC entry and sends the message packet to the switching network, and the switching network multicasts all line card spaces in the network element, so that other line cards learn the MAC entry, namely MAC address synchronization. When other line cards do not learn the MAC strip, the unicast message is flooded on other line cards, thereby greatly occupying the system bandwidth and influencing the forwarding of normal data. Because each line card needs to automatically send packets to traverse all the entries of the MAC table in a fixed period when the MAC address is aged, the self-learning entries construct synchronous message and send the message to the switching network for broadcasting, and the consistency of all the line cards MAC entries of the whole network element is realized, namely synchronous refreshing. And reporting the self-learning items of each line card to the network manager periodically, thereby realizing the consistency of the MAC items of each line card of the network manager and the network element.
However, in the related art, the synchronous processing of the line card is completed by software, and the burden of a line card CPU is too heavy. And software regularly traverses all MAC address entries, and can determine newly learned MAC address entries only by comparing with the MAC address cache table, the process is time-consuming, if the CPU is busy, the time for reading the MAC address table exceeds dozens of minutes, and the MAC address table changes rapidly in practice, so that the change of the MAC address table is difficult to reflect in time. Moreover, when the MAC address drifts, it may take tens of minutes for the platform to report the MAC address drift event, which is not beneficial to engineering maintenance.
Disclosure of Invention
The embodiment of the invention provides a synchronous processing method and a synchronous processing device, which at least solve the problem that the change of an MAC address table is possibly difficult to reflect in time because the synchronous processing of line cards in the related technology is finished by software.
According to an embodiment of the present invention, there is provided a synchronization processing method including: the first line card learns the MAC address through the network processor NP; and the first line card sends an MAC synchronous multicast message to other line cards through the NP, wherein the MAC synchronous multicast message comprises the MAC address.
Optionally, after the first line card sends the MAC synchronization multicast packet to another line card through the NP, the method further includes: the method comprises the steps that a first line card periodically detects whether each MAC address in an MAC set continuously receives a message or not, wherein the MAC set is used for storing the MAC addresses; the first line card refreshes each MAC address with a positive detection result in the MAC set; and the first line card deletes each MAC address with a negative detection result in the MAC set.
Optionally, the refreshing, by the first line card, each MAC address in the MAC set whose detection result is yes includes: the first line card judges whether the source identification of each MAC address is a preset identification or not, wherein the preset identification is used for indicating that each MAC address is an MAC address learned through NP; and the first line card sends an MAC synchronous refreshing message to the other line cards through the NP under the condition that the judgment result is yes.
Optionally, the deleting, by the first line card, each MAC address with a negative detection result in the MAC set includes: judging whether the source identifier of each MAC address is a preset identifier or not, wherein the preset identifier is used for indicating that each MAC address is a MAC address learned through NP; and the first line card sends an MAC synchronous deleting message to the other line cards through the NP under the condition that the judgment result is yes.
Optionally, after the first line card learns the MAC address through the network processor NP, the method further includes: the first line card detects whether the MAC set has a free position to store the MAC address; under the condition that the detection result of the first line card is negative, determining the preset priority of the MAC address; and the first line card covers the MAC address with the priority lower than the preset priority in the MAC set according to the preset priority of the MAC address.
According to another embodiment of the present invention, there is provided a synchronous processing apparatus including: a learning module for learning the MAC address through the network processor NP; and the sending module is used for sending the MAC synchronous multicast message to other line cards through the NP, wherein the MAC synchronous multicast message comprises the MAC address.
Optionally, the method further comprises: the first detection module is used for periodically detecting whether each MAC address in an MAC set continuously receives a message or not, wherein the MAC set is used for storing the MAC address; the refreshing module is used for refreshing each MAC address with a positive detection result in the MAC set; and the deleting module is used for deleting each MAC address with a negative detection result in the MAC set.
Optionally, the refreshing module is further configured to determine whether a source identifier of each MAC address that is the detected result is a predetermined identifier, where the predetermined identifier is used to indicate that each MAC address is a MAC address learned by an NP; and if the judgment result is yes, sending an MAC synchronous refreshing message to the other line cards through the NP.
Optionally, the deleting module is further configured to determine whether a source identifier of each MAC address that is determined as negative in the detection result is a predetermined identifier, where the predetermined identifier is used to indicate that each MAC address is a MAC address learned by an NP; and the first line card sends the MAC synchronous deleting message to the other line cards through the NP under the condition that the judgment result is yes.
Optionally, the method further comprises: the second detection module is used for detecting whether the MAC set has a free position to store the MAC address; the determining module is used for determining the preset priority of the MAC address under the condition that the detection result is negative; and the covering module is used for covering the MAC addresses with the priority lower than the preset priority in the MAC set according to the preset priority of the MAC addresses.
According to still another embodiment of the present invention, there is also provided a storage medium. The storage medium is configured to store program code for performing the steps of: the first line card learns the MAC address through the network processor NP; and the first line card sends an MAC synchronous multicast message to other line cards through the NP, wherein the MAC synchronous multicast message comprises the MAC address.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the first line card sends the MAC synchronous multicast message to other line cards through the NP, the method further comprises the following steps: the method comprises the steps that a first line card periodically detects whether each MAC address in an MAC set continuously receives a message or not, wherein the MAC set is used for storing the MAC addresses; the first line card refreshes each MAC address with a positive detection result in the MAC set; and the first line card deletes each MAC address with a negative detection result in the MAC set.
Optionally, the storage medium is further arranged to store program code for performing the steps of: the first line card refreshing each MAC address with a positive detection result in the MAC set comprises the following steps: the first line card judges whether the source identification of each MAC address is a preset identification or not, wherein the preset identification is used for indicating that each MAC address is an MAC address learned through NP; and the first line card sends an MAC synchronous refreshing message to the other line cards through the NP under the condition that the judgment result is yes.
Optionally, the storage medium is further arranged to store program code for performing the steps of: deleting each MAC address with a negative detection result in the MAC set by the first line card comprises the following steps: judging whether the source identifier of each MAC address is a preset identifier or not, wherein the preset identifier is used for indicating that each MAC address is an MAC address learned through NP; and the first line card sends an MAC synchronous deleting message to the other line cards through the NP under the condition that the judgment result is yes.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the first line card learns the MAC address through the network processor NP, the method further includes: the first line card detects whether the MAC set has a free position to store the MAC address; under the condition that the detection result of the first line card is negative, determining the preset priority of the MAC address; and the first line card covers the MAC address with the priority lower than the preset priority in the MAC set according to the preset priority of the MAC address.
By the invention, the first line card learns the Media Access Control (MAC) address through the network processor NP; and the first line card sends the MAC synchronous multicast message to other line cards through the NP, wherein the MAC synchronous multicast message comprises an MAC address. Because the first line card learns a new MAC address through the PN and sends a message carrying the new MAC address through the NP, MAC address synchronization of all line cards in the network element can be realized, and the learned new MAC address is determined without traversing all MAC addresses in the MAC set of the first line card through the CPU, all line cards in the network element can acquire the newly learned MAC address in time, and the problem that the synchronization processing of the line cards in the related technology is completed by software and the change of an MAC address table is possibly difficult to reflect in time can be solved.
Drawings
The accompanying drawings, which are included to provide a further understanding of the invention and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the invention and together with the description serve to explain the invention without limiting the invention. In the drawings:
fig. 1 is a block diagram of a hardware structure of a line card of a synchronous processing method according to an embodiment of the present invention;
FIG. 2 is a flow diagram of a synchronization processing method according to an embodiment of the present invention;
FIG. 3 is a diagram of a distributed system architecture according to an embodiment of the present invention;
FIG. 4 is a flowchart of an implementation of NP synchronization and synchronous refresh according to an embodiment of the present invention;
fig. 5 is a block diagram of a structure of a synchronous processing device according to an embodiment of the present invention;
fig. 6 is a block diagram of the structure of a synchronous processing device according to an embodiment of the present invention;
fig. 7 is a block diagram of a synchronous processing device according to an embodiment of the present invention.
Detailed Description
The invention will be described in detail hereinafter with reference to the drawings and embodiments. It should be noted that the embodiments and features of the embodiments in the present application may be combined with each other without conflict.
It should be noted that the terms "first," "second," and the like in the description and claims of the present invention and in the drawings described above are used for distinguishing between similar elements and not necessarily for describing a particular sequential or chronological order.
Example 1
The method provided by embodiment 1 of the present application may be executed in a line card, a computer terminal, or a similar computing device. Taking the operation on the line card as an example, fig. 1 is a hardware structure block diagram of the line card of the synchronous processing method according to the embodiment of the present invention. As shown in fig. 1, line card 10 may include one or more (only one shown) processors 102 (processor 102 may include, but is not limited to, a processing device such as a microprocessor MCU or a programmable logic device FPGA, etc.), a memory 104 for storing data, and a transmission device 106 for communication functions. It will be understood by those skilled in the art that the structure shown in fig. 1 is only an illustration and is not intended to limit the structure of the electronic device. For example, line card 10 may also include more or fewer components than shown in fig. 1, or have a different configuration than shown in fig. 1.
The memory 104 may be used to store software programs and modules of application software, such as program instructions/modules corresponding to the synchronization processing method in the embodiment of the present invention, and the processor 102 executes various functional applications and data processing by executing the software programs and modules stored in the memory 104, so as to implement the above-mentioned method. The memory 104 may include high speed random access memory, and may also include non-volatile memory, such as one or more magnetic storage devices, flash memory, or other non-volatile solid-state memory. In some examples, memory 104 may further include memory located remotely from processor 102, which may be connected to line card 10 via a network. Examples of such networks include, but are not limited to, the internet, intranets, local area networks, mobile communication networks, and combinations thereof.
The transmission device 106 is used for receiving or transmitting data via a network. Specific examples of the network described above may include a wireless network provided by a communication provider of line card 10. In one example, the transmission device 106 includes a Network adapter (NIC) that can be connected to other Network devices through a base station to communicate with the internet. In one example, the transmission device 106 can be a Radio Frequency (RF) module, which is used to communicate with the internet in a wireless manner.
In this embodiment, a synchronization processing method operating on the line card is provided, and fig. 2 is a flowchart of the synchronization processing method according to an embodiment of the present invention, as shown in fig. 2, the flowchart includes the following steps:
step S202, the first line card learns the MAC address through the network processor NP;
step S204, the first line card sends MAC synchronous multicast messages to other line cards through NP, wherein the MAC synchronous multicast messages contain MAC addresses.
Through the steps, the first line card learns the new MAC address through the PN and sends the message carrying the new MAC address through the NP to realize the MAC address synchronization of all the line cards in the network element, and the CPU does not need to traverse all the MAC addresses in the MAC set of the first line card to determine the learned new MAC address, so that all the line cards in the network element can acquire the newly learned MAC address in time, the problem that the synchronization processing of the line cards in the related technology is finished by software and the change of an MAC address table is difficult to reflect in time can be solved, and compared with the prior art, the CPU is prevented from being overloaded, the system bandwidth is saved, and the MAC synchronization refreshing efficiency is improved.
For example, after the uplink NP learns a new MAC, the self-learning flag set 1 simultaneously sends an MAC-synchronized multicast packet (which is synchronized with the above-mentioned MAC-synchronized multicast packet in the operation type), and the packet is forwarded to all line cards in the network element by the switching network to perform MAC learning, so as to implement fast MAC address synchronization.
Optionally, after the first line card sends the MAC synchronization multicast packet to the other line cards through the NP, the method further includes: the method comprises the steps that a first line card periodically detects whether each MAC address in an MAC set continuously receives a message or not, wherein the MAC set is used for storing the MAC addresses; refreshing each MAC address with a positive detection result in the MAC set by the first line card; and the first line card deletes each MAC address with a negative detection result in the MAC set. Through the steps, the MAC set of the first line card is periodically updated, so that the MAC address entry corresponding to the normal work of the service is prevented from being lost after the aging period is over, the MAC address corresponding to the abnormal work of the service can be quickly deleted, and the MAC address corresponding to the abnormal work of the service is prevented from being deleted when the aging period is waited.
For example, the cycle duration for periodically detecting whether the service corresponding to each MAC address in the MAC set normally operates by the NP may be set as follows: the setting of the timing synchronization refresh period cannot exceed half of the aging period at the longest, for example, the aging period is 60 seconds, and the synchronization refresh period is less than 30 seconds. While at the same time being greater than the time x required for the NP to traverse all the entries in the MAC address table.
Optionally, each MAC address in the first line card refresh MAC set whose detection result is yes includes: the first line card judges whether the source identification of each MAC address is a preset identification or not, wherein the preset identification is used for indicating that each MAC address is an MAC address learned through NP; and under the condition that the judgment result is yes, the first line card sends an MAC synchronous refreshing message to the switching network through the NP so as to inform other line cards of refreshing the corresponding MAC addresses.
Alternatively, the predetermined identification may be a self-learning identification. Through the steps, the MAC synchronous refreshing message can be sent to the switching network only when the MAC address is the MAC address acquired by self learning, so that other line cards are informed to refresh the corresponding MAC address, and interactive signaling can be reduced.
For example, the uplink line card periodically sends a MAC synchronous multicast message (synchronous refresh message with the MAC) to each self-learned MAC address at regular time, and refreshes MAC tables of all other line cards to avoid entry loss after aging.
Optionally, deleting each MAC address with a negative detection result in the MAC set by the first line card includes: judging whether the source identification of each MAC address is a preset identification or not, wherein the preset identification is used for indicating that each MAC address is an MAC address learned through NP; and under the condition that the judgment result is yes, the first line card sends an MAC synchronous deleting message to the switching network through the NP so as to inform other line cards of deleting the corresponding MAC addresses. Through the steps, the MAC synchronous deleting message can be sent to the switching network only when the MAC address is the MAC address acquired by self learning, so that other line cards are informed to delete the corresponding MAC address, and interactive signaling can be reduced.
For example, after the self-learned MAC address is aged by NP, an MAC synchronous multicast packet (which is deleted synchronously with the above-mentioned MAC) is also sent, and the MAC synchronous multicast packet is forwarded to all line cards in the network element by the switching network to perform a specific MAC aging process, so as to implement rapid aging of the MAC address. For another example, after the synchronized MAC address is aged off by NP, only the address is deleted, and the MAC-synchronized multicast packet is not sent.
Optionally, the self-learned MAC address maintains the aging bit information according to the SMAC of the received service packet, and the synchronized MAC address maintains the aging bit information according to the received MAC synchronization packet.
Optionally, after the first line card learns the MAC address through the network processor NP, the method further includes: the first line card detects whether the MAC set has a free position to store the MAC address; under the condition that the detection result of the first line card is negative, determining the preset priority of the MAC address; and the first line card covers the MAC addresses with the priority lower than the preset priority in the MAC set according to the preset priority of the MAC addresses. Through the steps, the learned new MAC address can be safely stored in the MAC set.
Optionally the timed refresh maintenance mechanism may: the uplink line card uses an independent Packet Generator to generate a special message in a timing mode to finish sending the MAC synchronous multicast message (the operation type is synchronous) of each self-learning MAC entry. The Packet Generator is set to repeat the operation of refreshing and maintaining the MAC address table every n seconds; and the NP traverses all the entries in the MAC address table, and sends the MAC synchronous multicast messages one by one to the entries which are effective in the MAC address table and have self-learning sources. Because the MAC address whose learning source is synchronization also participates in NP aging, the period of MAC address timing refresh cannot exceed half of NP aging period, and is also longer than the time required by NP to traverse all MAC table entries.
The NP implementation scheme in the above embodiment is to implement MAC address synchronization of all line cards in a network element by NP packet transmission. The dynamic MAC item cached by the platform is mainly used for network management display, and does not need to be synchronized to all line cards. There are two sources of MAC address learning: and synchronizing and self-learning. In consideration of complex scenes such as line card socket, board pulling, power failure, reset and the like in practical application, the invention adds the following timing refreshing maintenance mechanism: the self-learning MAC address needs to be refreshed periodically, namely, an MAC synchronous message is sent at regular time and forwarded to all line cards in the network element by the switching network; the self-learning and synchronous MAC address and NP can be aged; and a MAC learning priority concept is added, the self-learned MAC address and the synchronous MAC address judge whether to cover or not based on the priority, and the MAC entries with high priority can cover the MAC entries with low priority.
To facilitate understanding of the above embodiments, the implementation process is described in detail below.
Fig. 3 is a diagram of a distributed system architecture according to an embodiment of the present invention, fig. 4 is a flowchart of implementing NP synchronization and synchronous refresh according to an embodiment of the present invention, and in conjunction with fig. 3, as shown in fig. 4, the synchronization flow includes (MAC and the above MAC):
1. the line card 1 inputs a service flow from an external interface, wherein smac (source mac address of message input) of a message two-layer header is 00:00:01:00:00:01, port information of message input comprises port (physical port number) 1, slot (equipment slot number in which the slot is located) 5, vlan (sub-port vlan id value) 10, the line card 1 learns the smac after receiving the message, adds an entry in a mac table, adds the information to a corresponding field of the entry, and the learning source is self-learning. Meanwhile, a synchronous information packet (the same as the MAC synchronous multicast message) is constructed and sent to the switching network based on the entry information.
2. The switching network multicasts the mac synchronization information packet in the space of the whole network element, so that the line card 1, the line card 2 and the line card 3 receive the packet. The line card 1 receives the packet and compares the slot number to know that the packet is a synchronous information packet sent by the line card 1, and directly discards the packet; the line card 2 and the line card 3 receive the packet, extract smac, port 1, slot 5, and vlan 10 information, add entries to the mac table, and the learning source is synchronous, so that the line card 2 and the line card 3 also have entries of smac 00:00:01:00:00: 00:01 as the line card 1, and discard the synchronous message after the entries are added.
3. The network element global configuration aging period, once the aging period is up, the items which are not refreshed will be aged, namely deleted, if the service flow of the line card 1 continuously sends flow, the line card 1 will not repeatedly learn after learning the smac items, and will not construct the synchronous information packet, and each time the aging table is refreshed to ensure that the items are not aged, thus the synchronous refreshing information packet needs to be sent regularly to ensure that the items of the line card 2 and the line card 3 are not aged and NP of the line card 1 is not dropped.
4. Here, a rule for setting the timing synchronization refresh period is required, the timing synchronization refresh period is set to be not more than half of the aging period at the longest, for example, the aging period is 60 seconds, and the synchronization refresh period is less than 30 seconds. And at the same time, is greater than the time x required by NP to traverse all entries in the MAC address table, the period of MAC address timing refresh must be between x seconds-30 seconds. In the following it is assumed that the timed synchronous refresh period is 10 s.
In conjunction with fig. 3, as shown in fig. 4, the synchronous refresh process includes (MAC and MAC):
5. the line card 1 sends synchronous refresh information packets with serial numbers in a cycle of 10s, the number of the sent packets in 10s is the mac entry number capacity, the sending can be completed in 3s, and 10s is the synchronous refresh cycle. The line card 1 uses the serial number to traverse all the entries of the table entry, judges the learning source of each effective entry, constructs a synchronous information packet (synchronous refreshing message with the MAC) if the effective entry is self-learning, and sends the synchronous information packet to a switching network, and does not construct if the effective entry is synchronous.
6. The switching network multicasts the mac synchronization information packet in the space of the whole network element, and the same line card 1, line card 2 and line card 3 all receive the packet. The line card 1 receives the packet comparison slot number to know that the packet is a synchronous information packet sent by itself, and directly discards the packet; the line card 2 and the line card 3 receive the packet to refresh the aging table to ensure that the entry is not aged, so that the line card 2 and the line card 3 can ensure that the entry is the same as that of the line card 1, and if the traffic flow with the smac of 00:00: 00:01 is input from the line card 2 or the line card 3, the traffic flow is directly sent out from the appointed port of the line card 1 without broadcasting.
7. After the service flow of the line card 1 is interrupted, the entry is definitely aged, once the entry is aged, the line card 1 also sends an MAC synchronous multicast message (which is the same as the MAC synchronous deletion message) to a switching network, the switching network multicasts to all the line cards in the network element, and the line card 2 and the line card 3 delete the MAC entry in time after receiving the message, so that the MAC synchronous address is quickly aged, and the message is prevented from being sent by mistake.
Therefore, the invention provides a method for fast and effectively refreshing MAC address synchronously through NP, only a mark bit is added to the self-learned item of the line card during learning for subsequent distinguishing of self-learning or synchronous item, NP can traverse all items of the MAC table according to cycle time, construct a synchronous refreshing packet for the self-learned item, and realize fast synchronous refreshing. Therefore, the embodiment improves the synchronous refreshing efficiency of the MAC addresses between the line cards, can reduce the flooding time of unicast messages, ensures continuous and uninterrupted service, effectively saves system resources, realizes synchronous refreshing through NP, and can greatly reduce the burden of a CPU.
Through the above description of the embodiments, those skilled in the art can clearly understand that the method according to the above embodiments can be implemented by software plus a necessary general hardware platform, and certainly can also be implemented by hardware, but the former is a better implementation mode in many cases. Based on such understanding, the technical solutions of the present invention may be embodied in the form of a software product, which is stored in a storage medium (e.g., ROM/RAM, magnetic disk, optical disk) and includes instructions for enabling a terminal device (e.g., a mobile phone, a computer, a server, or a network device) to execute the method according to the embodiments of the present invention.
Example 2
In this embodiment, a synchronous processing device is further provided, and the device is used to implement the foregoing embodiments and preferred embodiments, and details are not repeated for what has been described. As used below, the term "module" may be a combination of software and/or hardware that implements a predetermined function. Although the means described in the embodiments below are preferably implemented in software, an implementation in hardware, or a combination of software and hardware is also possible and contemplated.
Fig. 5 is a block diagram of a synchronous processing device according to an embodiment of the present invention, and as shown in fig. 5, the device includes:
a learning module 52 for learning the MAC address via the network processor NP;
and a sending module 54, connected to the learning module 52, configured to send the MAC-multicast synchronization message to other line cards through the NP, where the MAC-multicast synchronization message includes a MAC address.
Fig. 6 is a block diagram of a synchronous processing device according to an embodiment of the present invention, and as shown in fig. 6, the device includes, in addition to all modules shown in fig. 5:
a first detection module 62, configured to periodically detect whether each MAC address in a MAC set continuously receives a packet, where the MAC set is used to store the MAC address;
a refreshing module 64, connected to the first detecting module 62, for refreshing each MAC address in the MAC set whose detection result is yes;
and a deleting module 66, connected to the refreshing module 64, for deleting each MAC address in the MAC set whose detection result is negative.
Optionally, the refreshing module is further configured to determine whether the source identifier of each MAC address that is the detection result is a predetermined identifier, where the predetermined identifier is used to indicate that each MAC address is a MAC address learned by the NP; and if so, sending an MAC synchronous refreshing message to the switching network through the NP so as to inform other line cards of refreshing the corresponding MAC addresses.
Optionally, the deleting module is further configured to determine whether the source identifier of each MAC address that is determined as negative in the detection result is a predetermined identifier, where the predetermined identifier is used to indicate that each MAC address is a MAC address learned by the NP; and under the condition that the judgment result is yes, the first line card sends an MAC synchronous deleting message to the switching network through the NP so as to inform other line cards of deleting the corresponding MAC addresses.
Fig. 7 is a block diagram of a synchronous processing device according to an embodiment of the present invention, and as shown in fig. 7, the device includes, in addition to all modules shown in fig. 5 and 6:
a second detecting module 72, configured to detect whether the MAC set has a free location to store a MAC address;
a determining module 74, connected to the second detecting module 72, for determining the predetermined priority of the MAC address if the detecting result is negative;
and an override module 76, connected to the determining module 74, for overriding the MAC address having a priority lower than the predetermined priority in the MAC set according to the predetermined priority of the MAC address.
It should be noted that, the above modules may be implemented by software or hardware, and for the latter, the following may be implemented, but not limited to: the modules are all positioned in the same processor; alternatively, the modules are respectively located in different processors in any combination.
Example 3
The embodiment of the invention also provides a storage medium. Alternatively, in the present embodiment, the storage medium may be configured to store program codes for performing the following steps:
s1, the first line card learns the MAC address through the network processor NP;
s2, the first line card sends MAC synchronous multicast message to other line cards through NP, wherein the MAC synchronous multicast message contains MAC address.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the first line card sends the MAC synchronous multicast message to other line cards through the NP, the method further comprises the following steps:
s1, the first line card periodically detects whether each MAC address in the MAC set continuously receives the message, wherein the MAC set is used for storing the MAC address;
s2, the first line card refreshes each MAC address with a positive detection result in the MAC set through the NP;
s3, the first line card deletes each MAC address with a negative detection result in the MAC set through the NP.
Optionally, the storage medium is further arranged to store program code for performing the steps of: each MAC address with a positive detection result in the first line card refreshing MAC set comprises the following steps:
s1, the first line card judges whether the source identification of each MAC address is a preset identification or not, wherein the preset identification is used for indicating that each MAC address is an MAC address learned through NP;
and S2, when the judgment result is yes, the first line card sends an MAC synchronous refresh message to the switching network through the NP so as to inform other line cards of refreshing the corresponding MAC addresses.
Optionally, the storage medium is further arranged to store program code for performing the steps of: each MAC address with a negative detection result in the first line card deleting MAC set comprises:
s1, judging whether the source identification of each MAC address with the negative detection result is a preset identification, wherein the preset identification is used for indicating that each MAC address is a MAC address learned through NP;
and S2, when the judgment result is yes, the first line card sends an MAC synchronous deletion message to the switching network through the NP so as to inform other line cards of deleting the corresponding MAC addresses.
Optionally, the storage medium is further arranged to store program code for performing the steps of: after the first line card learns the MAC address through the network processor NP, the method further includes:
s1, the first line card detects whether the MAC set has a free position to store the MAC address;
s2, determining the preset priority of the MAC address by the first line card under the condition that the detection result is negative;
and S3, the first line card covers the MAC address with the priority lower than the preset priority in the MAC set according to the preset priority of the MAC address.
Optionally, in this embodiment, the storage medium may include, but is not limited to: a U-disk, a Read-Only Memory (ROM), a Random Access Memory (RAM), a removable hard disk, a magnetic disk, or an optical disk, and various media capable of storing program codes.
Optionally, in this embodiment, the processor executes, according to the program code stored in the storage medium: the first line card learns the MAC address through the network processor NP; and the first line card sends the MAC synchronous multicast message to other line cards through the NP, wherein the MAC synchronous multicast message comprises an MAC address.
Optionally, in this embodiment, the processor executes, according to the program code stored in the storage medium: after the first line card sends the MAC synchronous multicast message to other line cards through the NP, the method further comprises the following steps: the method comprises the steps that a first line card periodically detects whether each MAC address in an MAC set continuously receives a message or not, wherein the MAC set is used for storing the MAC addresses; refreshing each MAC address with a positive detection result in the MAC set by the first line card; and the first line card deletes each MAC address with a negative detection result in the MAC set.
Optionally, in this embodiment, the processor executes, according to the program code stored in the storage medium: each MAC address with a positive detection result in the first line card refreshing MAC set comprises the following steps: the first line card judges whether the source identification of each MAC address is a preset identification or not, wherein the preset identification is used for indicating that each MAC address is an MAC address learned through NP; and under the condition that the judgment result is yes, the first line card sends an MAC synchronous refreshing message to the switching network through the NP so as to inform other line cards of refreshing the corresponding MAC addresses.
Optionally, in this embodiment, the processor executes, according to the program code stored in the storage medium: each MAC address with a negative detection result in the first line card deleting MAC set comprises: judging whether the source identification of each MAC address is a preset identification or not, wherein the preset identification is used for indicating that each MAC address is an MAC address learned through NP; and under the condition that the judgment result is yes, the first line card sends an MAC synchronous deleting message to the switching network through the NP so as to inform other line cards of deleting the corresponding MAC addresses.
Optionally, in this embodiment, the processor executes, according to the program code stored in the storage medium: after the first line card learns the MAC address through the network processor NP, the method further includes: the first line card detects whether the MAC set has a free position to store the MAC address; under the condition that the detection result of the first line card is negative, determining the preset priority of the MAC address; and the first line card covers the MAC addresses with the priority lower than the preset priority in the MAC set according to the preset priority of the MAC addresses.
Optionally, the specific examples in this embodiment may refer to the examples described in the above embodiments and optional implementation manners, and this embodiment is not described herein again.
It will be apparent to those skilled in the art that the modules or steps of the present invention described above may be implemented by a general purpose computing device, they may be centralized on a single computing device or distributed across a network of multiple computing devices, and alternatively, they may be implemented by program code executable by a computing device, such that they may be stored in a storage device and executed by a computing device, and in some cases, the steps shown or described may be performed in an order different than that described herein, or they may be separately fabricated into individual integrated circuit modules, or multiple ones of them may be fabricated into a single integrated circuit module. Thus, the present invention is not limited to any specific combination of hardware and software.
The above description is only a preferred embodiment of the present invention and is not intended to limit the present invention, and various modifications and changes may be made by those skilled in the art. Any modification, equivalent replacement, or improvement made within the spirit and principle of the present invention should be included in the protection scope of the present invention.

Claims (8)

1. A synchronization processing method, comprising:
the first line card learns the MAC address through the network processor NP;
the first line card sends the MAC synchronous multicast message to other line cards through the NP, wherein the MAC synchronous multicast message contains the MAC address, and after the first line card sends the MAC synchronous multicast message to other line cards through the NP, the method further comprises the following steps:
the method comprises the steps that a first line card periodically detects whether each MAC address in an MAC set continuously receives a message or not, wherein the MAC set is used for storing the MAC addresses, the detection period does not exceed half of an aging period and is longer than the time required by NP to traverse all entries in an MAC address table;
the first line card refreshes each MAC address with a positive detection result in the MAC set;
and the first line card deletes each MAC address with a negative detection result in the MAC set.
2. The method of claim 1, wherein the first line card refreshing each MAC address in the MAC set that detects a yes comprises:
the first line card judges whether the source identification of each MAC address is a preset identification or not, wherein the preset identification is used for indicating that each MAC address is an MAC address learned through NP;
and the first line card sends an MAC synchronous refreshing message to the other line cards through the NP under the condition that the judgment result is yes.
3. The method of claim 1, wherein the first line card deleting each MAC address in the MAC set that is detected as a negative comprises:
judging whether the source identifier of each MAC address is a preset identifier or not, wherein the preset identifier is used for indicating that each MAC address is an MAC address learned through NP;
and the first line card sends an MAC synchronous deleting message to the other line cards through the NP under the condition that the judgment result is yes.
4. The method of claim 1, after the first card learns the MAC address through the network processor NP, further comprising:
the first line card detects whether the MAC set has a free position to store the MAC address;
under the condition that the detection result of the first line card is negative, determining the preset priority of the MAC address;
and the first line card covers the MAC address with the priority lower than the preset priority in the MAC set according to the preset priority of the MAC address.
5. A synchronous processing apparatus, comprising:
a learning module for learning the MAC address through the network processor NP;
a sending module, configured to send an MAC synchronization multicast packet to another line card through the NP, where the MAC synchronization multicast packet includes the MAC address, and the synchronization processing apparatus further includes:
the first detection module is used for periodically detecting whether each MAC address in an MAC set continuously receives a message or not, wherein the MAC set is used for storing the MAC address, the detection period does not exceed half of an aging period and is longer than the time required by NP for traversing all entries in an MAC address table;
the refreshing module is used for refreshing each MAC address with a positive detection result in the MAC set;
and the deleting module is used for deleting each MAC address with a negative detection result in the MAC set.
6. The apparatus of claim 5, wherein the refreshing module is further configured to determine whether a source identifier of each MAC address that the detection result is yes is a predetermined identifier, where the predetermined identifier is used to indicate that each MAC address is a MAC address learned through NP; and if the judgment result is yes, sending an MAC synchronous refreshing message to the other line cards through the NP.
7. The apparatus of claim 5, wherein the deleting module is further configured to determine whether a source identifier of each MAC address that is negative in the detection result is a predetermined identifier, where the predetermined identifier is used to indicate that each MAC address is a MAC address learned by NP; and the first line card sends an MAC synchronous deleting message to the other line cards through the NP under the condition that the judgment result is yes.
8. The apparatus of claim 5, further comprising:
the second detection module is used for detecting whether the MAC set has a free position to store the MAC address;
the determining module is used for determining the preset priority of the MAC address under the condition that the detection result is negative;
and the covering module is used for covering the MAC addresses with the priority lower than the preset priority in the MAC set according to the preset priority of the MAC addresses.
CN201610818946.8A 2016-09-12 2016-09-12 Synchronous processing method and device Active CN107819684B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610818946.8A CN107819684B (en) 2016-09-12 2016-09-12 Synchronous processing method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610818946.8A CN107819684B (en) 2016-09-12 2016-09-12 Synchronous processing method and device

Publications (2)

Publication Number Publication Date
CN107819684A CN107819684A (en) 2018-03-20
CN107819684B true CN107819684B (en) 2022-08-02

Family

ID=61601149

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610818946.8A Active CN107819684B (en) 2016-09-12 2016-09-12 Synchronous processing method and device

Country Status (1)

Country Link
CN (1) CN107819684B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111935338A (en) * 2020-09-17 2020-11-13 南京中兴软件有限责任公司 Method and device for controlling source MAC learning item number
CN112887229B (en) * 2021-01-11 2023-04-07 杭州迪普科技股份有限公司 Session information synchronization method and device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101488862A (en) * 2009-02-23 2009-07-22 中兴通讯股份有限公司 Distributed Ethernet switch and internal MAC address maintaining method thereof
CN102045200A (en) * 2010-12-24 2011-05-04 武汉烽火网络有限责任公司 Conditional synchronization method for MAC address table entry of distributed switch
CN103019858A (en) * 2012-12-03 2013-04-03 中兴通讯股份有限公司 Media access control ageing method and network processor
CN103209130A (en) * 2013-04-22 2013-07-17 杭州华三通信技术有限公司 Method for synchronizing media access control (MAC) address table entries and forwarding chips
CN103401782A (en) * 2013-07-24 2013-11-20 杭州华三通信技术有限公司 MAC (Media Access Control) address synchronizing method and equipment

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
EP1976195B1 (en) * 2007-03-30 2014-05-07 Alcatel-Lucent Method and apparatus for Mac address learning
CN101729410B (en) * 2009-11-10 2012-06-06 中兴通讯股份有限公司 Synchronization method and device of media access control (MAC) address table
CN101958938B (en) * 2010-06-01 2013-07-24 福建星网锐捷网络有限公司 Learning method and device of MAC address table based on network processor
CN105721315B (en) * 2016-04-06 2018-11-23 烽火通信科技股份有限公司 A kind of control method of centralization mac address learning

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101488862A (en) * 2009-02-23 2009-07-22 中兴通讯股份有限公司 Distributed Ethernet switch and internal MAC address maintaining method thereof
CN102045200A (en) * 2010-12-24 2011-05-04 武汉烽火网络有限责任公司 Conditional synchronization method for MAC address table entry of distributed switch
CN103019858A (en) * 2012-12-03 2013-04-03 中兴通讯股份有限公司 Media access control ageing method and network processor
CN103209130A (en) * 2013-04-22 2013-07-17 杭州华三通信技术有限公司 Method for synchronizing media access control (MAC) address table entries and forwarding chips
CN103401782A (en) * 2013-07-24 2013-11-20 杭州华三通信技术有限公司 MAC (Media Access Control) address synchronizing method and equipment

Also Published As

Publication number Publication date
CN107819684A (en) 2018-03-20

Similar Documents

Publication Publication Date Title
US11115426B1 (en) Distributed packet capture for network anomaly detection
CN108616431B (en) Message processing method, device, equipment and machine readable storage medium
US9838221B2 (en) Base station deployment configuration method for base station, base station, and server
US20180048633A1 (en) Perception-free authentication method and system, and control method and system based on the same
US20100278180A1 (en) Packet forwarding method, device and system
US20180372507A1 (en) Information sharing method of smart electricity meter, smart electricity meter and acquisition router
CN109561033B (en) Method and device for multicast replication in Overlay network
US10855576B2 (en) Information transmission method and device
CN102625986A (en) Method, device and network equipment for processing loops in two layer network
EP4064622A1 (en) Method and apparatus for updating routing information, computer device, and storage medium
CN108011958B (en) Network device and MAC address table synchronization method
CN109274592B (en) MAC address table item processing method and device and computer readable medium
CN105282773B (en) The configuration method and system of WiFi equipment
EP3496431A1 (en) Message transmission method and apparatus
US9609590B2 (en) Eco-friendly power over ethernet
CN103281257A (en) Method and device for processing protocol message
CN107483084B (en) Broadband carrier networking method, site and system
CN107547535B (en) Anti-attack MAC address learning method and device and network equipment
CN107819684B (en) Synchronous processing method and device
CN105391612A (en) Virtual extensible local area network (VXLAN) tunnel end point (VTEP) adjacency learning method and VXLAN VTEP adjacency learning device
CN108234358B (en) Multicast message transmission method, device and machine readable storage medium
CN115955439B (en) Data message transmission control method, system, device and storage medium
CN117319982A (en) Method and device for actively discovering unregistered sensor based on edge calculation
CN103780437A (en) Information synchronization method and device
CN104079663A (en) Distributed type real-time synchronizing network system and data annunciating method thereof

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
TA01 Transfer of patent application right
TA01 Transfer of patent application right

Effective date of registration: 20180417

Address after: 518057 Nanshan District science and technology, Guangdong Province, South Road, No. 55, No.

Applicant after: ZTE Corp.

Address before: Yuhuatai District of Nanjing City, Jiangsu province 210012 Bauhinia Road No. 68

Applicant before: Nanjing Zhongxing New Software Co.,Ltd.

SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant