CN107124369B - Method and device for acquiring number of MAC (media Access control) table entries - Google Patents
Method and device for acquiring number of MAC (media Access control) table entries Download PDFInfo
- Publication number
- CN107124369B CN107124369B CN201710265843.8A CN201710265843A CN107124369B CN 107124369 B CN107124369 B CN 107124369B CN 201710265843 A CN201710265843 A CN 201710265843A CN 107124369 B CN107124369 B CN 107124369B
- Authority
- CN
- China
- Prior art keywords
- stack
- mac
- master
- slot position
- local
- 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
Links
- 238000000034 method Methods 0.000 title claims abstract description 45
- 239000000725 suspension Substances 0.000 claims description 7
- 230000001360 synchronised effect Effects 0.000 claims description 6
- 238000010586 diagram Methods 0.000 description 3
- 230000006855 networking Effects 0.000 description 2
- 238000004891 communication Methods 0.000 description 1
- 238000005516 engineering process Methods 0.000 description 1
- 230000004048 modification Effects 0.000 description 1
- 238000012986 modification Methods 0.000 description 1
Images
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/74—Address processing for routing
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L45/00—Routing or path finding of packets in data switching networks
- H04L45/58—Association of routers
- H04L45/583—Stackable routers
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
The application provides a method and a device for acquiring the number of MAC table entries. In the method and the device, the MAC table entry quantity obtaining operation is shared to the parallel execution of the member slots in the stack, so that the problems of low efficiency and the like caused by the serial obtaining of the MAC table entry quantity are completely avoided, and the purpose of accurately and quickly obtaining the MAC table entry quantity is achieved.
Description
Technical Field
The present application relates to network communication technologies, and in particular, to a method and an apparatus for acquiring a number of MAC entries.
Background
The MAC table entry in the MAC address table records information such as the MAC address, the output interface, the VLAN to which the output interface belongs and the like. When the network equipment forwards the message, the matched MAC address table is inquired in the MAC address table according to the target MAC address of the message, and if the MAC address table contains the MAC table item matched with the target MAC address, the message is directly forwarded through an output interface in the matched MAC table item.
The number of MAC entries (also called MAC address number) in the MAC address table represents the service forwarding capability of the network device, and the larger the number of MAC entries, the stronger the service forwarding capability. At present, in order to conveniently manage users in a networking (distinguished by MAC addresses), the number of MAC table entries is generally required to be acquired.
Disclosure of Invention
The application provides a method and a device for acquiring the number of MAC table entries, so that the number of the MAC table entries can be accurately and quickly acquired.
The technical scheme provided by the application comprises the following steps:
a method for obtaining the number of MAC table items is applied to a main control board on a Master device Master in a stack, and comprises the following steps:
sending asynchronous messages to each member slot position in the stack to enable each member slot position in the stack to acquire the number of local MAC table items; each member slot in the stack includes: the Master control slot position of the Master control board and the interface board slot position of each interface board, the Master control slot position of the Master control board on the Slave of each backup device in the stack, the standby Master control slot position of the standby Master control board and the interface board slot position of each interface board;
acquiring the number of MAC table entries of a local main master control slot;
and when the set time is up, sending a synchronization message to each member slot position in the stack to acquire the number of local MAC table entries acquired by each member slot position in the stack, and accumulating the number of MAC table entries of the local main master control slot position and the number of MAC table entries local to each member slot position in the stack to acquire the number of MAC table entries in the stack.
A MAC table number obtaining device is applied to a main control board on a Master device Master in a stack and comprises the following components:
the asynchronous message sending unit is used for sending asynchronous messages to each member slot position in the stack so as to enable each member slot position in the stack to acquire the number of local MAC table entries; each member slot in the stack includes: the Master control slot position of the Master control board and the interface board slot position of each interface board, the Master control slot position of the Master control board on the Slave of each backup device in the stack, the standby Master control slot position of the standby Master control board and the interface board slot position of each interface board;
the acquisition unit is used for acquiring the number of the MAC table items of the local main master control slot;
the synchronous message sending unit is used for sending a synchronous message to each member slot position in the stack to obtain the number of local MAC table items obtained by each member slot position in the stack when the set time is up;
and the counting unit is used for accumulating the MAC table entry number of the local main master control slot position and the MAC table entry number local to each member slot position in the stack to obtain the MAC table entry number in the stack.
According to the technical scheme, the MAC table entry quantity obtaining operation is shared to each member slot position in the stack to be executed in parallel, and the problems of low efficiency and the like caused by serial obtaining of the MAC table entry quantity are completely avoided.
Drawings
The accompanying drawings, which are incorporated in and constitute a part of this specification, illustrate embodiments consistent with the present disclosure and together with the description, serve to explain the principles of the disclosure.
Fig. 1 is a flowchart of a method for acquiring the number of MAC entries according to the present application;
fig. 2 is a flowchart of another method for obtaining the number of MAC entries according to the present application;
FIG. 3 is a schematic view of an embodiment provided herein;
fig. 4 is a diagram illustrating the structure of the apparatus according to the present application.
Detailed Description
The number of the MAC table entries represents the number of the MAC addresses, and the number of the MAC addresses represents the number of the users, so that the number of the users can be determined by acquiring the number of the MAC table entries, and the users in the networking can be conveniently managed according to the number of the users (distinguished by the MAC addresses).
Referring to fig. 1, fig. 1 is a flowchart of a method for obtaining the number of MAC entries according to the present application. The method is applied to a main control board on Master equipment (Master) in the stack. As shown in fig. 1, the process may include the following steps:
And 102, polling each member slot position in the stack by a main control board on the Master, sending a synchronization message to each member slot position polled to enable each member slot position to acquire the local MAC table entry quantity, and waiting for and receiving the MAC table entry quantity returned by each member slot position.
Here, each member slot in the stack includes: the Master control slot position of the Master Slave board and the interface board slot position of each interface board on the Master, the Master control slot position of the Master board on the Slave of each Slave device in the stack, the Master control slot position of the Slave Master board and the interface board slot position of each interface board.
That is, the Master main control board on the Master sends a synchronization message to synchronize the slot numbers of the members in the stack to obtain the number of the MAC entries local to the slot numbers of the members in the stack, which is a way of serially obtaining the number of the MAC entries local to the slot numbers of the members in the stack.
Thus, the flow shown in fig. 1 is completed.
As can be seen from the flow shown in fig. 1, the Master main control board on the Master serially obtains the number of MAC entries local to each member slot in the stack by sending the synchronization message. The mode of serially acquiring the number of the MAC entries is very inefficient, and the situation that the MAC entries are not completely acquired after timeout often occurs, which affects user experience.
Therefore, the application provides another method for rapidly acquiring the number of the MAC table entries, which is applied to a multi-slot environment. In the method, a main control board on a Master acquires the number of the MAC table entries of each member slot position in the stack in parallel, the time for acquiring the number of the local MAC table entries of each member slot position in the stack is equivalent to the time for acquiring the number of the local MAC table entries of a single slot position, the linear increase of the number of the MAC table entries cannot be caused along with the increase of the member slot positions, and the acquisition efficiency of the number of the MAC table entries in a multi-slot position environment is greatly improved.
Referring to fig. 2, fig. 2 is a flowchart of another method for obtaining the number of MAC entries according to the present application. The method is applied to a main Master control board on a Master in a stack. As shown in fig. 2, the process may include the following steps:
It can be seen that, in step 201, the Master main control board on the Master sends an asynchronous message to each member slot in the stack to trigger each member slot in the stack to acquire the number of local MAC entries, which is equivalent to that the Master main control board on the Master acquires the number of local MAC entries of each member slot in the stack in parallel.
Here, each member slot in the stack includes: the Master control slot position of the Master control board on the Master, the interface board slot position of each interface board, the Master control slot position of the Master control board on each Slave in the stack, the Master control slot position of the Master control board on the Master and the interface board slot position of each interface board.
Here, the purpose of setting the time is to wait for each member slot in the stack to successfully acquire the number of local MAC entries. Therefore, when the set time is up, the main Master control board on the Master sends a synchronization message to each member slot position in the stack to obtain the number of the local MAC table entries successfully obtained by each member slot position in the stack.
Thus, the flow shown in fig. 2 is completed.
As can be seen from the flow shown in fig. 2, in the present application, the operation of obtaining the number of MAC entries is shared to the parallel execution of each member slot in the stack, which completely avoids the problems of low efficiency and the like caused by obtaining the number of MAC entries serially.
The flow shown in fig. 2 is described below by a specific embodiment:
referring to fig. 3, fig. 3 is a schematic diagram of an embodiment provided in the present application. As shown in fig. 3, the flow of this embodiment may include:
When the MAC address number needs to be acquired, an MAC address number acquisition command may be issued to the Master main control board on the Master in the stack to trigger the Master main control board on the Master to start the MAC address number acquisition process, specifically see step 302.
Specifically, in step 302, sending an asynchronous message to each member slot in the stack and acquiring the number of MAC entries local to the local master control slot may include: polling the member slot position in the stack, taking the polled member slot position as the current slot position, sending an asynchronous message to the current slot position, judging whether the current slot position is the last polled member slot position, if not, returning to the operation of polling the member slot position in the stack, and if so, acquiring the local MAC table entry number of the local main master control slot position.
It should be noted that, in the present application, the Master main control board on the Master in the stack sends an asynchronous message to each member slot in the stack, and the purpose of the asynchronous message is to enable each member slot in the stack to obtain the number of local MAC entries. And when each member slot in the stack receives an asynchronous message sent by a main control board on a Master in the stack, running each process to count the number of each local MAC table entry. When counting the number of local MAC entries in each member slot in the stack, the Master board on the Master does not wait for each member slot in the stack to return to count the number of local MAC entries in the stage of starting the MAC address number obtaining process, but enters the started MAC address number obtaining process into a sleep-suspended state, specifically in step 303.
Step 303, the Master main control board on the Master in the stack enters the sleep suspended state of the started MAC address number obtaining process, and starts a corresponding timer.
Here, the timer is corresponding to the MAC address number getting process entering the sleep suspended state, and is used to indicate the duration of time for the MAC address number getting process entering the sleep suspended state.
Specifically, as an embodiment, the timer is used to time the number of local MAC entries successfully obtained by each member slot in the stack. In a specific implementation, the timing time of the timer is greater than or equal to a difference between a first time and a second time, the first time is a time estimated in advance to obtain the number of all MAC entries in the stack, and the second time is a time when the main control board obtains the number of MAC entries of the local main control slot.
And step 304, when the timing time of the timer reaches, the Master main control board on the Master in the stack switches the MAC address number obtaining process from the sleep suspension state to the start state, so as to send a synchronization message to each member slot in the stack to obtain the number of MAC entries local to each member slot in the stack.
That is, when the timing time of the timer reaches, the Master board on the Master in the stack restarts the MAC address number obtaining process (i.e., the MAC address number obtaining process is switched from the sleep suspended state to the start state in step 304).
As described above, the timing of the timer is intended to wait for each member slot in the stack to successfully acquire the number of local MAC entries, i.e., when the timing of the timer arrives, it means that each member slot in the stack has successfully acquired the number of local MAC entries. Thus, as described in step 304, after the Master main control board on the Master restarts the MAC address number obtaining process, the number of local MAC entries that each member slot in the stack has successfully obtained may be obtained by sending a synchronization message to each member slot in the stack, which enables the Master main control board on the Master in the stack to share the task of obtaining the number of MAC entries in the stack, which is originally responsible for itself, to each member slot in the stack, and finally induces each member slot in the stack to obtain the number of local MAC entries by itself to obtain the number of MAC entries in the stack, specifically see step 305.
As an example, step 305 may be followed by further comprising: and closing the MAC address number acquisition process in the starting state.
The flow shown in fig. 3 is completed.
The method provided by the present application is described above, and the device provided by the present application is described below:
referring to fig. 4, fig. 4 is a diagram illustrating the structure of the apparatus according to the present invention. The device is applied to the main Master control board on the Master equipment Master in the pile-up, and comprises:
the asynchronous message sending unit is used for sending asynchronous messages to each member slot position in the stack so as to enable each member slot position in the stack to acquire the number of local MAC table entries; each member slot in the stack includes: the Master control slot position of the Master control board and the interface board slot position of each interface board, the Master control slot position of the Master control board on the Slave of each backup device in the stack, the standby Master control slot position of the standby Master control board and the interface board slot position of each interface board;
the acquisition unit is used for acquiring the number of the MAC table items of the local main master control slot;
the synchronous message sending unit is used for sending a synchronous message to each member slot position in the stack to obtain the number of local MAC table items obtained by each member slot position in the stack when the set time is up;
and the counting unit is used for accumulating the MAC table entry number of the local main master control slot position and the MAC table entry number local to each member slot position in the stack to obtain the MAC table entry number in the stack.
Preferably, the sending of the asynchronous message to each member slot in the stack by the asynchronous message sending unit is performed after the primary main control board starts an MAC address number obtaining process according to the MAC address number obtaining command.
Preferably, the set time is: the started time for the MAC address quantity acquisition process to enter a sleep suspension state is used for waiting for each member slot position in the stack to successfully acquire the quantity of local MAC table items;
the synchronization message sending unit is used for executing the operation of sending the synchronization message to each member slot in the stack after the MAC address quantity acquisition process is switched from the sleep suspension state to the starting state.
Preferably, the set time is greater than or equal to a difference between a first time and a second time, the first time is a time estimated in advance to acquire the number of all MAC entries in the stack, and the second time is a time when the master board acquires the number of MAC entries of the local master slot.
Thus, the description of the apparatus shown in fig. 4 is completed.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.
Claims (8)
1. A method for obtaining MAC table number is characterized in that the method is applied to a main control board on a Master device Master in a stack, and comprises the following steps:
sending asynchronous messages to each member slot position in the stack to enable each member slot position in the stack to acquire the number of local MAC table items;
acquiring the number of MAC table entries of a local main master control slot;
when the set time is up, sending a synchronization message to each member slot position in the stack to obtain the number of local MAC table items obtained by each member slot position in the stack, and accumulating the number of MAC table items of the local main master control slot position and the number of MAC table items local to each member slot position in the stack to obtain the number of MAC table items in the stack;
each member slot in the stack comprises one or more of the following:
a standby main control slot position of a standby main control board on the Master;
interface board slot positions of each interface board on the Master;
a main master control slot position of a main master control board on each standby equipment Slave in the stack;
a standby main control slot position of a standby main control board on the Slave;
and interface board slots of each interface board of the Slave.
2. The method of claim 1, wherein the sending the asynchronous message to each member slot in the stack is performed after the primary master control board starts a MAC address number obtaining process according to a MAC address number obtaining command.
3. The method of claim 2, wherein the set time is: the started time for the MAC address quantity acquisition process to enter a sleep suspension state is used for waiting for each member slot position in the stack to successfully acquire the quantity of local MAC table items;
and the sending of the synchronization message to each member slot in the stack is executed after the MAC address quantity acquisition process is switched from a sleep suspension state to a starting state.
4. The method according to claim 1 or 3, wherein the set time is greater than or equal to a difference between a first time and a second time, the first time being a time estimated in advance to obtain the number of all MAC entries in the stack, and the second time being a time when the primary master control board obtains the number of MAC entries of the local primary master slot.
5. An apparatus for acquiring the number of MAC entries, which is applied to a Master main control board on a Master device Master in a stack, includes:
the asynchronous message sending unit is used for sending asynchronous messages to each member slot position in the stack so as to enable each member slot position in the stack to acquire the number of local MAC table entries;
the acquisition unit is used for acquiring the number of the MAC table items of the local main master control slot;
the synchronous message sending unit is used for sending a synchronous message to each member slot position in the stack to obtain the number of local MAC table items obtained by each member slot position in the stack when the set time is up;
the counting unit is used for accumulating the MAC table item quantity of the local main master control slot position and the MAC table item quantity of each member slot position in the stack to obtain the MAC table item quantity in the stack;
each member slot in the stack comprises one or more of the following:
a standby main control slot position of a standby main control board on the Master;
interface board slot positions of each interface board on the Master;
a main master control slot position of a main master control board on each standby equipment Slave in the stack;
a standby main control slot position of a standby main control board on the Slave;
and interface board slots of each interface board of the Slave.
6. The apparatus of claim 5, wherein the asynchronous message sending unit sends the asynchronous message to each member slot in the stack after the primary main control board starts a MAC address number obtaining process according to the MAC address number obtaining command.
7. The apparatus of claim 6, wherein the set time is: the started time for the MAC address quantity acquisition process to enter a sleep suspension state is used for waiting for each member slot position in the stack to successfully acquire the quantity of local MAC table items;
the synchronization message sending unit is used for executing the operation of sending the synchronization message to each member slot in the stack after the MAC address quantity acquisition process is switched from the sleep suspension state to the starting state.
8. The apparatus according to claim 5 or 7, wherein the set time is greater than or equal to a difference between a first time and a second time, the first time being a time estimated in advance to obtain the number of all MAC entries in the stack, and the second time being a time when the primary master board obtains the number of MAC entries of the local primary master slot.
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710265843.8A CN107124369B (en) | 2017-04-21 | 2017-04-21 | Method and device for acquiring number of MAC (media Access control) table entries |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201710265843.8A CN107124369B (en) | 2017-04-21 | 2017-04-21 | Method and device for acquiring number of MAC (media Access control) table entries |
Publications (2)
Publication Number | Publication Date |
---|---|
CN107124369A CN107124369A (en) | 2017-09-01 |
CN107124369B true CN107124369B (en) | 2020-01-03 |
Family
ID=59724993
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201710265843.8A Active CN107124369B (en) | 2017-04-21 | 2017-04-21 | Method and device for acquiring number of MAC (media Access control) table entries |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN107124369B (en) |
Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6934292B1 (en) * | 1999-11-09 | 2005-08-23 | Intel Corporation | Method and system for emulating a single router in a switch stack |
CN101110846A (en) * | 2007-08-29 | 2008-01-23 | 杭州华三通信技术有限公司 | Management method and equipment for MAC address table item |
CN101527643A (en) * | 2009-03-26 | 2009-09-09 | 杭州华三通信技术有限公司 | Method, system and main equipment for acquiring stacking system information |
CN103186440A (en) * | 2011-12-28 | 2013-07-03 | 中兴通讯股份有限公司 | Method, device and system for detecting in-place state of sub cards |
CN103414801A (en) * | 2013-08-12 | 2013-11-27 | 杭州华三通信技术有限公司 | Method and device for synchronizing medium access control addresses in stacking system |
CN104283811A (en) * | 2013-07-09 | 2015-01-14 | 杭州华三通信技术有限公司 | Message forwarding method and device |
CN105939402A (en) * | 2016-03-03 | 2016-09-14 | 杭州迪普科技有限公司 | MAC table entry obtaining method and device |
US9602441B2 (en) * | 2013-09-20 | 2017-03-21 | International Business Machines Corporation | Virtual stacking of switches |
-
2017
- 2017-04-21 CN CN201710265843.8A patent/CN107124369B/en active Active
Patent Citations (8)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
US6934292B1 (en) * | 1999-11-09 | 2005-08-23 | Intel Corporation | Method and system for emulating a single router in a switch stack |
CN101110846A (en) * | 2007-08-29 | 2008-01-23 | 杭州华三通信技术有限公司 | Management method and equipment for MAC address table item |
CN101527643A (en) * | 2009-03-26 | 2009-09-09 | 杭州华三通信技术有限公司 | Method, system and main equipment for acquiring stacking system information |
CN103186440A (en) * | 2011-12-28 | 2013-07-03 | 中兴通讯股份有限公司 | Method, device and system for detecting in-place state of sub cards |
CN104283811A (en) * | 2013-07-09 | 2015-01-14 | 杭州华三通信技术有限公司 | Message forwarding method and device |
CN103414801A (en) * | 2013-08-12 | 2013-11-27 | 杭州华三通信技术有限公司 | Method and device for synchronizing medium access control addresses in stacking system |
US9602441B2 (en) * | 2013-09-20 | 2017-03-21 | International Business Machines Corporation | Virtual stacking of switches |
CN105939402A (en) * | 2016-03-03 | 2016-09-14 | 杭州迪普科技有限公司 | MAC table entry obtaining method and device |
Also Published As
Publication number | Publication date |
---|---|
CN107124369A (en) | 2017-09-01 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN110635987B (en) | Message transmission method, device, equipment and machine readable storage medium | |
CN107689988B (en) | Message pushing method and device, electronic equipment and terminal equipment | |
EP3264810A1 (en) | Perception-free authentication method and system, and control method and system based on method | |
EP3284222A1 (en) | Master communication device for a token network | |
CN103945520A (en) | Communication system, master control end device and communication method | |
CN103631652A (en) | Method and system for achieving virtual machine migration | |
WO2012034408A1 (en) | Method and system for processing media access control address aging | |
US10037253B2 (en) | Fault handling methods in a home service system, and associated household appliances and servers | |
EP2549690B1 (en) | Media access control address keep-alive device and method for convergence port | |
CN104052565A (en) | Time synchronization method and communication terminal | |
CN100496056C (en) | A method and node device for updating address resolution protocol entries | |
CN105391612A (en) | Virtual extensible local area network (VXLAN) tunnel end point (VTEP) adjacency learning method and VXLAN VTEP adjacency learning device | |
CN107124369B (en) | Method and device for acquiring number of MAC (media Access control) table entries | |
CN109617821B (en) | Transmission method, main control board and equipment of multicast message | |
CN105591892B (en) | A kind of starting method and apparatus of smooth restarting process | |
WO2014122981A1 (en) | Message transmission device, message transmission method, and message transmission program | |
CN109274763B (en) | Information synchronization method and dual-computer hot standby equipment | |
CN104703172B (en) | A multi-system-based card inspection method, device and terminal | |
CN102932190A (en) | Method and device for solving single point of failure of equipment section | |
CN111064622B (en) | Network device, synchronization apparatus, and information transmission method | |
JPWO2018025491A1 (en) | Control network system and its node equipment | |
CN102571430A (en) | Method for synchronizing network devices and network devices | |
CN102075315B (en) | Data synchronization method and device among forwarding boards | |
US20160094956A1 (en) | Communication apparatus, control method therefor, program, and storage medium | |
JP2007201874A5 (en) |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
PB01 | Publication | ||
PB01 | Publication | ||
SE01 | Entry into force of request for substantive examination | ||
SE01 | Entry into force of request for substantive examination | ||
GR01 | Patent grant | ||
GR01 | Patent grant |