Table item management method and device

By setting the hardware MAC address table in the network device to prohibit aging and performing the software table entry polling task, using the aging filter bitmap mask to skip the aging deletion process, the problem that the user terminal is online but the hardware MAC address table entry has been aged, and the user's Internet experience is improved.

CN119743469AActive Publication Date: 2025-04-01NEW H3C TECH CO LTD
View PDF 13 Cites 0 Cited by

Patent Information

Application Number
CN202411955798.5
Authority / Receiving Office
CN · China
Patent Type
Applications(China)
Current Assignee / Owner
Filing Date
2024-12-27
Publication Date
2025-04-01
Estimated Expiration
2044-12-27

AI Technical Summary

Technical Problem

In network devices, when the MAC address aging time is less than the offline detection time, the user terminal is online but the hardware MAC address table entry has been aged, resulting in the user terminal needing to be re-authenticated and online, affecting the user's online experience.

Method used

By setting the hardware MAC address table to prohibit aging, and performing the software table entry polling task, polling each storage location of the software MAC address table, using the aging filter bitmap mask for logic and calculation, identifying the MAC address table entry matching the aging filter parameters, and skipping its aging and deletion process.

Benefits of technology

The aging and deletion process of skipping the MAC address table entry matching the aging filter parameters is realized, avoiding the problem that user terminals need to be re-authenticated and launched due to the aging of the hardware MAC address table entry, and improving the user's Internet experience.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN119743469A_ABST
    Figure CN119743469A_ABST
Patent Text Reader

Abstract

The embodiment of the invention provides a table item management method and device, relates to the technical field of communication, is applied to network equipment, and comprises the following steps: setting a hardware MAC address table to be prohibited from aging; executing a software table item polling task, and polling each storage position of the software MAC address table; a software table item polling task is carried out, and logic and operation are carried out on the authentication type of the first software MAC address table item of the polled storage position and the aging filtering bitmap mask; wherein an aging filtering parameter bit of the aging filtering bitmap mask is set as a binary value 1; determining that a corresponding bit binary value of an aging filtering parameter bit in the logic and operation result is 1, and identifying that the first software MAC address table item is matched with the aging filtering parameter; and polling a next storage position of the software MAC address table to skip aging deletion processing of the first software MAC address table entry. According to the scheme, the problem that the hardware MAC address table entry is aged when the user terminal is online can be solved, and the internet surfing experience of the user is improved.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present application relates to the field of communication technology, and in particular to a table entry management method and device. Background Art

[0002] For a user terminal that has successfully authenticated and gone online on a network device, the network device will record the MAC address entry of the user terminal in the hardware Media Access Control (MAC) address table, and record the information entry of the user terminal in the online user list. The network device is configured with a MAC address aging time and an offline detection time. If no message is received from the user terminal within the MAC aging time, the hardware chip of the network device will age the MAC address entry of the user terminal in the hardware MAC address table; if no message is received from the user terminal within the offline detection time, the network device will cut off the connection of the user terminal and delete the information entry of the user terminal in the online user list.

[0003] Since the MAC address aging time and offline detection time are independent of each other, if the MAC address aging time is less than the offline detection time, the user terminal will be online, but the hardware MAC address table entry has been aged. In this case, the user terminal needs to re-authenticate and go online before it can access network resources, affecting the user's Internet experience. Summary of the invention

[0004] The purpose of the embodiment of the present application is to provide a table entry management method and device to solve the problem that the user terminal is online but the hardware MAC address table entry has been aged, thereby improving the user's Internet experience. The specific technical solution is as follows:

[0005] In a first aspect, an embodiment of the present application provides a table entry management method, which is applied to a network device, and the method includes:

[0006] Set the hardware MAC address table to prohibit aging;

[0007] Execute the software table entry polling task to poll each storage location of the software MAC address table;

[0008] The software table item polling task performs a logical AND operation on the authentication type of the first software MAC address table item of the polled storage location and the aging filter bitmap mask; wherein the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1;

[0009] The software table entry polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logic and operation result is 1, and identifies that the first software MAC address table entry matches the aging filter parameter;

[0010] The software table entry polling task polls the next storage location of the software MAC address table to skip the aging and deletion processing of the first software MAC address table entry.

[0011] In a second aspect, an embodiment of the present application provides a table entry management device, which is applied to a network device, and the device includes:

[0012] The setting module is used to set the hardware MAC address table to prohibit aging;

[0013] An execution module is used to execute a software table item polling task to poll each storage location of a software MAC address table; the software table item polling task performs a logic AND operation on the authentication type of the first software MAC address table item of the polled storage location and an aging filter bitmap mask; wherein the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1; the software table item polling task determines that the corresponding bit binary value of the aging filter parameter bit in the logic AND operation result is 1, and identifies that the first software MAC address table item matches the aging filter parameter; the software table item polling task polls the next storage location of the software MAC address table to skip the aging deletion processing of the first software MAC address table item.

[0014] In a third aspect, an embodiment of the present application provides a network device, comprising a processor and a machine-readable storage medium, wherein the machine-readable storage medium stores machine-executable instructions that can be executed by the processor, and the processor is prompted by the machine-executable instructions to implement the method provided in the first aspect.

[0015] In a fourth aspect, an embodiment of the present application provides a computer-readable storage medium, wherein the computer-readable storage medium stores a computer program, and when the computer program is executed by a processor, the method provided in the first aspect is implemented.

[0016] In a fifth aspect, an embodiment of the present application further provides a computer program product comprising instructions, which, when executed on a computer, enables the computer to execute the method provided in the first aspect.

[0017] Beneficial effects of the embodiments of the present application:

[0018] In the technical solution provided in the embodiment of the present application, the network device is configured with an aging filter bitmap mask, and the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1. When the corresponding bit binary value of the aging filter parameter bit in the result of the logical AND operation of the authentication type of a MAC address table item and the aging filter bitmap mask is 1, it means that the corresponding bit binary value of the aging filter parameter bit of the authentication type of the MAC address table item is 1, and the MAC address table item matches the aging filter parameter, and the aging deletion process can be skipped. For user terminals whose MAC address aging time is less than the offline detection time, the authentication type of the MAC address of the user terminal can be set to an authentication type that matches the aging filter parameter, thereby skipping the aging deletion process of the MAC address of the user terminal.

[0019] In addition, the network device is configured with a software table item polling task to poll each storage location of the software MAC address table. In this way, the software table item polling task can poll the software MAC address table items in each storage location, thereby realizing the aging deletion process of skipping the software MAC address table items that match the aging filtering parameters, so that each MAC address table item that needs to skip the aging deletion process can avoid being deleted by aging, and each MAC address table item that does not need to skip the aging deletion process can be deleted by aging in time, which solves the problem that the user terminal is online but the hardware MAC address table item has been aged, and improves the user's Internet experience.

[0020] Of course, implementing any product or method of the present application does not necessarily require achieving all of the advantages described above at the same time. BRIEF DESCRIPTION OF THE DRAWINGS

[0021] In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings required for use in the embodiments or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are only some embodiments of the present application, and for ordinary technicians in this field, other embodiments can also be obtained based on these drawings.

[0022] Figure 1 A first schematic diagram of a MAC address authentication network provided in an embodiment of the present application;

[0023] Figure 2 A schematic diagram of a first flow chart of the table entry management method provided in an embodiment of the present application;

[0024] Figure 3 A schematic diagram of the execution of a software table item polling task provided in an embodiment of the present application;

[0025] Figure 4 A second flow chart of the table entry management method provided in the embodiment of the present application;

[0026] Figure 5 A third flow chart of the table entry management method provided in the embodiment of the present application;

[0027] Figure 6 A schematic diagram of a setting process of an aging bit provided in an embodiment of the present application;

[0028] Figure 7 A second schematic diagram of MAC address authentication networking provided in an embodiment of the present application;

[0029] Figure 8 A schematic diagram of the structure of the table entry management device provided in the embodiment of the present application;

[0030] Fig. 9 A schematic diagram of the structure of a network device provided in an embodiment of the present application. DETAILED DESCRIPTION

[0031] The following will be combined with the drawings in the embodiments of the present application to clearly and completely describe the technical solutions in the embodiments of the present application. Obviously, the described embodiments are only part of the embodiments of the present application, not all of the embodiments. Based on the embodiments in the present application, all other embodiments obtained by ordinary technicians in this field based on the present application belong to the scope of protection of the present application.

[0032] MAC address authentication is an authentication method that controls the network access rights of user terminals based on ports and MAC addresses, without the need to install client software. Figure 1 In the networking shown, the MAC address authentication function is enabled on ports 101 to 103 and port 107 of the network device 100. User terminals 104 to 106 are respectively connected to the network device 100, the access port of user terminal 104 is port 101, the access port of user terminal 105 is port 102, and the access port of user terminal 106 is port 103.

[0033] When the network device 100 detects the message sent by the user terminal 104 for the first time through the port 101, the MAC address authentication operation of the user terminal 104 is started, that is, the Remote Authentication Dial InUser Service (RADIUS) server performs MAC address authentication on the user terminal 104. During the MAC address authentication process, the user does not need to manually enter the user name or password. If the MAC address authentication of the user terminal 104 is successful, the network device 100 allows the user terminal 104 to access the network resources through the port 101, and sends the hardware MAC address table item 1 corresponding to the user terminal 104, that is, the hardware MAC address table item 1 is recorded in the hardware MAC address table, and the information table item 1 of the user terminal 104 is recorded in the online user list; if the MAC address authentication of the user terminal 104 fails, the network device 100 discards the message sent by the user terminal 104, and does not allow the user terminal 104 to access the Internet through the port 101.

[0034] Similarly, the network device 100 performs MAC address authentication operations on the user terminal 105 and the user terminal 106 .

[0035] The MAC address aging function and the MAC address offline detection function can be enabled on ports 101 to 103 of the network device 100. Take port 101 as an example. After the MAC address aging function of port 101 is enabled, if no message sent by the user terminal 104 is received within the MAC aging time, the hardware chip of the network device 100 ages and deletes the hardware MAC address table entry 1. After the MAC address offline detection function of port 101 is enabled, if no message sent by the user terminal 104 is received within the offline detection time, the network device 100 cuts off the connection of the user terminal 104 and deletes the information table entry 1, that is, the user terminal 104 is offline.

[0036] Since the MAC address aging time and offline detection time are independent of each other, if the MAC address aging time is less than the offline detection time, the user terminal will be online, but the hardware MAC address table entry has been aged. In this case, the user terminal needs to re-authenticate and go online before it can access network resources, affecting the user's Internet experience.

[0037] Especially for dumb terminals, you need to disable the MAC address offline detection function of the specified port to ensure that the dumb terminal is always online. If the hardware MAC address table of the dumb terminal ages, it will cause the dumb terminal to be online but unable to access the Internet.

[0038] To solve the above problems, the present application provides a table entry management method, such as Figure 2 As shown, applied to a network device, the method includes:

[0039] Step S201, setting the hardware MAC address table to prohibit aging;

[0040] Step S202, executing a software table entry polling task to poll each storage location of the software MAC address table;

[0041] Step S203, the software table item polling task, performs a logical AND operation on the authentication type of the first software MAC address table item of the polled storage location and the aging filter bitmap mask; wherein the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1;

[0042] Step S204, the software table entry polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logic and operation result is 1, and identifies that the first software MAC address table entry matches the aging filter parameter;

[0043] Step S205: The software entry polling task polls the next storage location of the software MAC address table to skip the aging and deletion process of the first software MAC address entry.

[0044] In the technical solution provided by the embodiment of the present application, in the technical solution provided by the embodiment of the present application, the network device is configured with an aging filter bitmap mask, and the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1. When the corresponding bit binary value of the aging filter parameter bit is 1 in the result of the logical AND operation of the authentication type of a MAC address table item and the aging filter bitmap mask, it means that the corresponding bit binary value of the aging filter parameter bit of the authentication type of the MAC address table item is 1, and the MAC address table item matches the aging filter parameter, and the aging deletion process can be skipped. For user terminals whose MAC address aging time is less than the offline detection time, the authentication type of the MAC address of the user terminal can be set to an authentication type that matches the aging filter parameter, thereby skipping the aging deletion process of the MAC address of the user terminal.

[0045] In addition, the network device is configured with a software table item polling task to poll each storage location of the software MAC address table. In this way, the software table item polling task can poll the software MAC address table items in each storage location, thereby realizing the aging deletion process of skipping the software MAC address table items that match the aging filtering parameters, so that each MAC address table item that needs to skip the aging deletion process can avoid being deleted by aging, and each MAC address table item that does not need to skip the aging deletion process can be deleted by aging in time, which solves the problem that the user terminal is online but the hardware MAC address table item has been aged, and improves the user's Internet experience.

[0046] In the embodiment of the present application, the network device may be a switching device, a router, etc.

[0047] In the above step S201, the network device may implement prohibition of hardware MAC address aging in any of the following ways.

[0048] Method 1: Disable the automatic aging mechanism of the MAC address of the hardware chip.

[0049] In the embodiment of the present application, the automatic aging mechanism of the MAC address of the hardware chip is: if no message sent by the user terminal is received within the MAC aging time, the hardware MAC address table entry corresponding to the user terminal is aged and deleted. The hardware MAC address table entry corresponding to the user terminal is the hardware MAC address table entry that includes the MAC address of the user terminal in the hardware MAC address table.

[0050] After disabling the MAC address automatic aging mechanism, the hardware chip of the network device will no longer automatically age and delete the hardware MAC address table entries.

[0051] Method 2: Set the MAC address aging time of the hardware chip to no aging.

[0052] In the embodiment of the present application, the network device can set the MAC address aging time to be empty. When the hardware chip reads that the MAC address aging time is set to be empty, it can be determined that the MAC address aging time is not aged.

[0053] The network device can also set the register corresponding to the MAC address aging time. According to the value of the register, determine whether the MAC address aging time is non-aging. For example, when the register is set to 1, it means that the MAC address aging time is non-aging; when the register is set to 0, it means that the MAC address aging time is aging. At this time, the hardware chip can age the hardware MAC address table entry according to the MAC address aging time, that is, if no message sent by the user terminal is received within the MAC aging time, the hardware MAC address table entry corresponding to the user terminal will be aged and deleted.

[0054] In the embodiment of the present application, the network device can enable the MAC address authentication function of the designated port, enable the MAC address offline detection function of the designated port, or disable the MAC address offline detection function of the designated port. For example, if the designated port is the access port of a dumb terminal, the network device can disable the MAC address offline detection function of the designated port to ensure that the dumb terminal is always online.

[0055] In the above step S202, the MAC addresses included in the software MAC address table and the hardware MAC address table are the same, that is, the table item specifications of the hardware MAC address table and the software MAC address table. The MAC address table items included in the software MAC address table are software MAC address table items, and the MAC address table items included in the hardware MAC address table are hardware MAC address table items. A software MAC address table item is stored at a storage location of the software MAC address table, and correspondingly, a hardware MAC address table item is stored at a storage location of the hardware MAC address table. The software MAC address table item and the hardware MAC address table item may include a MAC address, an access port, and an authentication type, as shown in Table 1.

[0056] Table 1

[0057]

[0058] The MAC address is the MAC address of the user terminal. In the embodiment of the present application, the MAC address may be a dynamic MAC address. The use of a dynamic MAC address can avoid the problem that when a user terminal migrates from one port (such as the first port) of a network device to another port (such as the second port) of the network device, the user terminal can only re-authenticate and go online after the MAC address offline detection function of the first port detects that the user terminal is offline.

[0059] The access port is the port at which the user terminal accesses the network device, and the authentication type is the type used to authenticate whether to skip the aging and deletion process. The authentication type may include one or more of the MAC address type, the port number type, and the virtual LAN type. The MAC address type, the port number type, and the virtual LAN type may be divided according to whether to skip the aging and deletion process, or according to the purpose, and there is no limitation on this.

[0060] For example, the MAC address type may include MAC address type 11 and MAC address type 12, MAC address type 11 is a type that skips the aging and deletion process, and MAC address type 12 is a type that does not skip the aging and deletion process; or, the MAC address type may include MAC address type 21, MAC address type 22, and MAC address type 23, MAC address type 21 is a type of MAC address used for authentication, MAC address type 22 is a type of MAC address used for billing, and MAC address type 23 is a type of MAC address used for traffic monitoring.

[0061] For another example, the port number type may include port number type 11 and port number type 12, port number type 11 is a type that skips the aging and deletion process, and port number type 12 is a type that does not skip the aging and deletion process; or, the port number type may include port number type 21 and port number type 22, port number type 21 is a single port type, and port number type 22 is an aggregated port type.

[0062] The authentication type can be represented by a corresponding parameter value, for example, the authentication type is 10000000. The authentication type can also be represented by left shift, for example, the authentication type is 7, that is, the parameter value is 1<<7, that is, 10000000.

[0063] The software table entry polling task is used to loop through each storage location of the software MAC address table and age and delete the software MAC address table entries that have reached the aging time. The network device executes the software table entry polling task and then polls each storage location of the software MAC address table, that is, polls each software MAC address table entry in the software MAC address table.

[0064] In some embodiments, in order to reduce the processing pressure of the upper-layer software (such as the CPU) of the network device, the network device may intermittently poll the software MAC address table. Specifically: the network device pre-sets the number of pollings each time; the software table item polling task determines that the number of storage locations that have been polled in the software MAC address table is equal to the preset number of pollings each time, and the software table item polling task enters a sleep state; when the sleep time ends, the software table item polling task determines that the last storage location of the software MAC address table has not been polled, and polls the next storage location of the software MAC address table; or, when the sleep time ends, the software table item polling task determines that the last storage location of the software MAC address table has been polled, and polls the first storage location of the software MAC address table.

[0065] In an embodiment of the present application, when the network device is executing the software table item polling task and polling each storage location of the software MAC address table, the network device can determine the number of storage locations polled this time after polling a storage location. If the number of storage locations polled is less than the preset number of polling each time, the next storage location of the software MAC address table will continue to be polled; if the number of storage locations polled is equal to the preset number of polling each time, the current polling will be stopped.

[0066] After waiting for the sleep time, the network device continues to execute the software table item polling task starting from the last storage location polled last time, polling each storage location of the software MAC address table. When executing this polling, it can be determined whether the last storage location polled last time is the last storage location of the software MAC address table; if not, it means that the last storage location of the software MAC address table has not been polled, and the next storage location of the software MAC address table is polled; if so, it means that the last storage location of the software MAC address table has been polled, and the first storage location of the software MAC address table is polled.

[0067] For example Figure 3 The schematic diagram of the execution of the software table item polling task is shown in FIG. The software MAC address table includes 20 software MAC address table items, namely, table item 1 to table item 20. The number of polls each time is 10, and the sleep time is △t. At time t1, the network device starts to execute the software table item polling task, that is, polling from table item 1. At time t2, the network device executes the software table item polling task and polls table item 10. At this time, 10 storage locations are polled this time, and the software table item polling task enters the sleep state.

[0068] When time t3 is reached, the software table item polling task sleeps for △t, and the sleep time ends. The last storage location polled last time is item 10, which is not the last storage location. Therefore, the next storage location of the software MAC address table (i.e., item 11) is polled. At time t4, the network device executes the software table item polling task and polls item 20. At this time, 10 storage locations have been polled, and the software table item polling task enters the sleep state.

[0069] When time t5 is reached, the software table entry polling task sleeps for △t, and the sleep time ends. The last storage location polled last time is table entry 20, which is the last storage location. Therefore, the first storage location (i.e. table entry 1) of the software MAC address table is polled. The software MAC address table is polled in this way in a cycle to achieve aging and deletion of the software MAC address table entries that have reached the aging time.

[0070] In the embodiment of the present application, the network device distributes the software table item polling task to every moment, thereby reducing the CPU processing pressure at a single time.

[0071] In an embodiment of the present application, the above-mentioned sleep time can be pre-set by the user, or it can be obtained in the following manner: before executing the software table item polling task, set the polling quantity of each software table item polling task; based on the software table item specifications of the software MAC address table, the polling quantity each time and the software MAC address table aging time, determine the polling time of each software MAC address table within the aging time of the MAC address table; the software MAC address table aging time is equal to the aging cycle of the hardware MAC address table; based on each polling time and the polling quantity each time, calculate the sleep time of the software table item polling task within each polling time.

[0072] The above polling time can be determined by the following formula:

[0073] T=S / (M / N).

[0074] Among them, T is the polling time of each time, S is the aging time of the software MAC address table, M is the software table entry specification of the software MAC address table, and N is the number of polling each time. N can be adjusted according to the processing capability of the upper-layer software.

[0075] When determining the polling time for each time, the network device can determine the processing time T' required for each polling quantity N according to the processing capability of the upper-layer software, and further determine the sleep time △t=T-T'.

[0076] In the embodiment of the present application, the MAC address aging time is equal to the aging cycle of the hardware chip aging MAC address table. In addition, the table item specifications of the hardware MAC address table and the software MAC address table. The hardware MAC address table items correspond one to one with the software MAC address table items. By calculating the sleep time in the above manner, it can be determined that the time required for the software MAC address table to complete a polling traversal is less than or equal to the aging cycle, ensuring the timely aging and deletion of the hardware MAC address table items.

[0077] In the above step S203, the first software MAC address table entry is a software MAC address table entry of any storage location polled by the network device.

[0078] The network device is pre-configured with an aging filter parameter, which is a parameter indicating the authentication type for skipping the aging deletion process. The authentication type and the number of aging filter parameters corresponding to the aging filter parameter can be set according to actual needs. Based on the aging filter parameter, the network device configures a bitmap mask representing the aging filter parameter corresponding to each authentication type, namely, the aging filter bitmap mask. In the aging filter bitmap mask, each aging filter parameter corresponds to a bit, namely, the aging filter parameter bit, and the aging filter parameter bit is set to a binary value of 1.

[0079] The network device executes the software table item polling task, polls the first software MAC address table item, performs a logical AND operation on the authentication type of the first software MAC address table item and the aging filter bitmap mask, and obtains a logical AND operation result. According to the logical AND operation result, the network device can determine whether the first software MAC address table item matches the aging filter parameter.

[0080] For example, two MAC address types need to skip the aging deletion process, so the network device is configured with two aging filter parameters and an aging filter bitmap mask corresponding to the MAC address type. In the aging filter bitmap mask, the aging filter parameter bits corresponding to the two MAC address types are bit4 and bit7 respectively. The aging filter bitmap mask can be a binary bit string "0000000010010000". In the result of the logical AND operation, the corresponding bits of the aging filter parameter bits are bit4 and bit7 respectively. If bit4 is 1 or bit7 is 1 in the result of the logical AND operation, it is determined that the software MAC address table entry matches the aging filter parameter. If bit4 is 0 and bit7 is 0 in the result of the logical AND operation, it is determined that the software MAC address table entry does not match the aging filter parameter.

[0081] In the above step S204, the network device performs the software table item polling task and obtains a logic and operation result. The network device determines that the corresponding bit binary value of the aging filter parameter bit in the logic and operation result is 1, and then it can be determined that the current first software MAC address table item matches the aging filter parameter, and then the aging deletion process can be skipped, and step S205 is executed, that is, polling the next storage location of the software MAC address table.

[0082] In an embodiment of the present application, the network device skips the aging and deletion process of the first software MAC address table entry, and the network device also sets the hardware MAC address table to prohibit aging, thereby achieving non-aging of the first software MAC address table entry and the first hardware MAC address table entry associated with the first software MAC address table entry.

[0083] For the software MAC address table entry of the newly polled storage location, the network device may re-execute step S203 to step S204 to determine whether to skip the aging and deletion process of the newly polled software MAC address table entry.

[0084] For example, the authentication type is MAC address type, the MAC address type of software MAC address table entry 1 is 10000000, and the aging filter bitmap mask is 10000000. The aging filter parameter bit is bit7. The MAC address type aging filter bitmap mask of the first software MAC address table entry is logically ANDed, and the result is 10000000. In the result, bit7=1. Therefore, the network device can recognize that the software MAC address table entry 1 matches the aging filter parameter, and then skip the aging deletion process of the software MAC address table entry 1, and poll the next storage location of the software MAC address table.

[0085] In the embodiment of the present application, the network device manages the MAC address table entries at the software level. Users can flexibly configure the MAC address aging mechanism according to the actual business scenario needs, such as flexibly configuring software table entry polling tasks, aging filter parameters and authentication types, etc., which brings hope of solving the drawbacks of many business scenarios. In addition, in the embodiment of the present application, the network device uses a bitmap mask to represent the aging filter parameters, which is convenient for managing the aging filter parameters and for determining whether to skip the aging deletion process, thereby improving the efficiency of table entry management.

[0086] To solve the above problems, the present application provides a table entry management method, such as Figure 4 As shown, applied to a network device, the method includes:

[0087] Step S401, setting the hardware MAC address table to prohibit aging;

[0088] Step S402, executing a software table entry polling task to poll each storage location of the software MAC address table;

[0089] Step S403, the software table item polling task, performs a logical AND operation on the authentication type of the first software MAC address table item of the polled storage location and the aging filter bitmap mask; wherein the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1;

[0090] Step S404, the software table entry polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logic and operation result is 1, and identifies that the first software MAC address table entry matches the aging filter parameter;

[0091] Step S405, the software table entry polling task polls the next storage location of the software MAC address table to skip the aging and deletion processing of the first software MAC address table entry; steps S401 to S405 are the same as the above steps S201 to S205.

[0092] Step S406, the software table entry polling task performs a logical AND operation on the authentication type of the second software MAC address table entry at the polled storage location and the aging filter bitmap mask;

[0093] In the embodiment of the present application, the second software MAC address table entry is a software MAC address table entry of any storage location polled by the network device.

[0094] The network device executes the software table item polling task, polls the second software MAC address table item, performs a logic AND operation on the authentication type of the second software MAC address table item and the aging filter bitmap mask, and obtains a logic AND operation result. According to the logic AND operation result, the network device can determine whether the second software MAC address table item matches the aging filter parameter.

[0095] Step S407, the software table entry polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logic and operation result is 0, and identifies that the second software MAC address table entry does not match the aging filter parameter;

[0096] The network device executes the software table item polling task and obtains a logic and operation result. The network device determines that the corresponding bit binary value of the aging filter parameter bit in the logic and operation result is 0, and then it can be determined that the current second software MAC address table item does not match the aging filter parameter, and then the aging deletion process can be executed, that is, step S408 to step S409 are executed.

[0097] Step S408, the software table entry polling task identifies that the second software MAC address table entry does not have a software aging flag set;

[0098] Step S409: the software entry polling task sets a software aging flag for the second software MAC address entry and sets a hardware aging flag for the second hardware MAC address entry corresponding to the second software MAC address entry.

[0099] The second hardware MAC address table entry is a hardware MAC address table entry corresponding to the second software MAC address table entry in the hardware MAC address table. The aging flag of the software MAC address table entry is called the software aging flag, and the aging flag of the hardware MAC address table entry is called the hardware aging flag. The non-aging flag of the software MAC address table entry is called the software non-aging flag, and the non-aging flag of the hardware MAC address table entry is called the hardware non-aging flag.

[0100] The network device executes the software table polling task, reads the second software MAC address table entry, to determine whether the second software MAC address table entry is set with a software aging flag; if it is determined that the second software MAC address table entry is not set with a software aging flag, executes step S409, sets a software aging flag for the second software MAC address table entry, and notifies the hardware chip, so that the hardware chip sets a hardware aging flag for the second hardware MAC address table entry.

[0101] In the embodiment of the present application, in order to facilitate the management of aging identification, the software MAC address table entry and the hardware MAC address table entry may also include an aging bit (AGE bit), as shown in Table 2.

[0102] Table 2

[0103]

[0104] The AGE bit is used to fill the aging flag. The representation of the aging flag can be set according to actual needs. For example, the aging flag can be FALSE or binary 0, and the non-aging flag can be TURE or binary 1.

[0105] Based on the structure of the MAC address table entry, the network device executes the software table entry polling task and reads the second software MAC address table entry. If the AGE bit of the second software MAC address table entry is read as TURE or binary 1, it can be determined that the software aging flag is not set for the second software MAC address table entry; then the AGE bit of the second software MAC address table entry is set to FALSE or binary 0, and the AGE bit of the second hardware MAC address table entry is set to FALSE or binary 0.

[0106] In an embodiment of the present application, the network device uses a software aging flag to start the aging and deletion processing of the second hardware MAC address table entry, which can realize the aging and deletion processing of the MAC address of the problem that there is no user terminal online but the hardware MAC address table entry has been aged, thereby avoiding the MAC addresses of certain user terminals occupying the storage space of the network device for a long time.

[0107] To solve the above problems, the present application provides a table entry management method, such as Figure 5 As shown, applied to a network device, the method includes:

[0108] Step S501, setting the hardware MAC address table to prohibit aging;

[0109] Step S502, executing a software table entry polling task to poll each storage location of the software MAC address table;

[0110] Step S503, the software table item polling task, performs a logical AND operation on the authentication type of the first software MAC address table item polled at the storage location and the aging filter bitmap mask; wherein the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1;

[0111] Step S504, the software table entry polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logic and operation result is 1, and identifies that the first software MAC address table entry matches the aging filter parameter;

[0112] Step S505, the software table entry polling task polls the next storage location of the software MAC address table to skip the aging and deletion processing of the first software MAC address table entry; steps S501 to S505 are the same as the above steps S201 to S205.

[0113] Step S506, the software table entry polling task performs a logical AND operation on the authentication type of the second software MAC address table entry at the polled storage location and the aging filter bitmap mask;

[0114] Step S507, software table entry polling task, determine the logic and operation result, the corresponding bit binary value of the aging filter parameter bit is 0, identify the second software MAC address table entry does not match the aging filter parameter; steps S501 to S507 are the same as the above steps S401 to S407.

[0115] The network device executes the software table item polling task and obtains a logic and operation result. The network device determines that the corresponding bit binary value of the aging filter parameter bit in the logic and operation result is 0, and then it can be determined that the current second software MAC address table item does not match the aging filter parameter, and then the aging deletion process can be executed, that is, step S508 to step S509 are executed.

[0116] Step S508, the software table entry polling task identifies that the second software MAC address table entry has a software aging flag set;

[0117] Step S509, the software table item polling task, identifies that in the hardware MAC address table, the second hardware MAC address table item corresponding to the second software MAC address table item has no hardware aging flag set, and sets a hardware aging flag for the second hardware MAC address table item; or, identifies that in the hardware MAC address table, the second hardware MAC address table item corresponding to the second software MAC address table item has a hardware aging flag set; and ages and deletes the second software MAC address table item and the second hardware MAC address table item.

[0118] In an embodiment of the present application, the network device executes a software table entry polling task and reads the second software MAC address table entry to determine whether the second software MAC address table entry is set with a software aging flag; if it is determined that the second software MAC address table entry has been set with a software aging flag, step S509 is executed to read the second hardware MAC address table entry to determine whether the second hardware MAC address table entry is set with a hardware aging flag.

[0119] In an embodiment of the present application, if the hardware chip receives a message matching a second hardware MAC address entry within an aging cycle of the hardware MAC address table, the hardware chip may set a hardware aging non-flag for the second hardware MAC address entry.

[0120] If the hardware chip does not receive a message matching the second hardware MAC address entry within an aging period of the hardware MAC address table, the hardware chip may set a hardware aging flag for the second hardware MAC address entry.

[0121] If it is determined that the hardware aging flag is not set for the second hardware MAC address table entry, that is, the hardware non-aging flag is set for the second hardware MAC address table entry, it means that a message matching the second hardware MAC address table entry is received in the past aging cycle, and the network device notifies the hardware chip, so that the hardware chip sets the hardware aging flag for the second hardware MAC address table entry; thereafter, the network device can continue to execute the software table entry polling task and poll the next storage location of the software MAC address table.

[0122] If it is determined that the hardware aging flag has been set for the second hardware MAC address table entry, it means that no message matching the second hardware MAC address table entry has been received in the past aging cycle, and the network device deletes the second software MAC address table entry due to aging, and notifies the hardware chip, so that the hardware chip deletes the second software MAC address table entry due to aging. After that, the network device can continue to execute the software table entry polling task and poll the next storage location of the software MAC address table.

[0123] In the embodiment of the present application, in order to facilitate the management of the aging flag, the software MAC address table entry and the hardware MAC address table entry may further include an aging bit (AGE bit), as shown in Table 2. Based on the structure of the MAC address table entry shown in Table 2, the network device executes the software table entry polling task, reads the second software MAC address table entry, and if the AGE bit of the second software MAC address table entry is read as FALSE or binary 0, it can be determined that the second software MAC address table entry has been set with a software aging flag, and then reads the second hardware MAC address table entry.

[0124] If the AGE bit of the second software MAC address table entry is read as TURE or binary 1, it is determined that the second hardware MAC address table entry does not have a hardware aging flag set, and the network device can set the AGE bit of the second hardware MAC address table entry to FALSE or binary 0. After that, the network device can continue to execute the software table entry polling task and poll the next storage location of the software MAC address table.

[0125] If the AGE bit of the second software MAC address table entry is read as FALSE or binary 0, it can be determined that the hardware aging flag has been set for the second hardware MAC address table entry, and the network device can age and delete the second software MAC address table entry, and notify the hardware chip so that the hardware chip ages and deletes the second software MAC address table entry. After that, the network device continues to execute the software table entry polling task and polls the next storage location of the software MAC address table.

[0126] In an embodiment of the present application, the network device uses a software aging flag to start the aging and deletion processing of the second hardware MAC address table entry, which can realize the aging and deletion processing of the MAC address of the problem that there is no user terminal online but the hardware MAC address table entry has been aged, thereby avoiding the MAC addresses of certain user terminals occupying the storage space of the network device for a long time.

[0127] When the authentication type matches the aging filter parameter, the aging bit setting process for the software MAC address table entry that matches the aging filter parameter can be found in Figure 6 The software aging bit is the aging bit of the software MAC address table entry, and the hardware aging bit is the aging bit of the hardware MAC address table entry. Figure 6 The software MAC address table entries and the hardware MAC address table entries in the table correspond to each other, that is, they include the same MAC address. The software MAC address table and the hardware MAC address table are the same in the initial state. In the initial state, the software aging bit and the hardware aging bit are the software non-aging flag and the hardware non-aging flag, respectively.

[0128] Step S601, read the software aging bit of the software MAC address table entry; if the software aging bit is a software non-aging flag, execute step S602; if the software aging bit is a software aging flag, execute step S603;

[0129] Step S602, setting the software aging bit to the software aging flag, and setting the hardware aging bit of the hardware MAC address entry to the hardware aging flag; waiting for the next polling, and re-execute step S601;

[0130] While waiting for the software MAC address entry to be polled next time, if the hardware chip receives a message matching the hardware MAC address entry within an aging cycle, the hardware chip can set the hardware aging bit of the hardware MAC address entry to a hardware non-aging flag.

[0131] While waiting for the software MAC address entry to be polled next time, if the hardware chip does not receive a message matching the hardware MAC address entry within an aging cycle, the hardware chip may keep the hardware aging bit of the hardware MAC address entry as a hardware aging flag.

[0132] Step S603, read the hardware aging bit of the hardware MAC address table entry; if the hardware aging bit is a hardware non-aging flag, execute step S604; if the hardware aging bit is a hardware aging flag, execute step S605;

[0133] Step S604, setting the hardware aging bit as the hardware aging flag; waiting for the next polling, and re-execute step S601.

[0134] Step S605: aging and deleting software MAC address entries and hardware MAC address entries.

[0135] The description of the above steps S601 to S605 is relatively simple, and the details can be found in the above related descriptions.

[0136] In the embodiment of the present application, the MAC address aging mechanism is managed by the upper-layer software of the network device, which further improves the configuration flexibility of the MAC address aging mechanism. In addition, the hardware chip only needs to manage the hardware MAC address table items, and does not need to manage the software MAC address table items, and does not need to frequently notify the upper-layer software to modify the software MAC address table items. In the MAC address aging mechanism, the upper-layer software only needs to read the hardware MAC address table items once in an aging cycle, which reduces the number of communications between the hardware chip and the upper-layer software, reduces the burden on the upper-layer software, and improves the aging processing efficiency.

[0137] In the embodiment of the present application, the network device may also use other methods to implement aging and deletion of software MAC address table entries and hardware MAC address table entries.

[0138] For example, the network device can cancel the prohibition of aging of the hardware MAC address table. In the embodiment of the present application, the network device controls each hardware MAC address table item separately. For software MAC address table items whose authentication type matches the aging filter parameter, the network device only enables the hardware chip to age the hardware MAC address table items corresponding to the software MAC address table items; for software MAC address table items whose authentication type does not match the aging filter parameter, the network device continues to prohibit the hardware chip from aging the hardware MAC address table items corresponding to the software MAC address table items, thereby solving the problem that the user terminal is online but the hardware MAC address table items have been aged.

[0139] Combine the following Figure 1 The networking shown illustrates the table entry management method provided in the embodiment of the present application. Figure 1 The user terminal 105 is a dumb terminal.

[0140] 1) The network device 100 turns off the automatic aging mechanism of the MAC address of the hardware chip, or sets the MAC address aging time of the hardware chip to no aging; creates a software table entry polling task, which indicates to loop through the software MAC address table and delete the software MAC address table entries that have reached the aging time.

[0141] The authentication type includes the MAC address type and the port number type. The MAC address type that skips the aging deletion process is 7. 7 also indicates that the port number type that skips the aging process for the MAC address type used for authentication is 5. The aging filter bitmap mask 1 of the aging filter parameter corresponding to the MAC address type 7 is 0x00000080, which is 10000000 in binary. In the aging filter bitmap mask 1, the aging filter parameter bit is bit7. The aging filter bitmap mask 2 of the aging filter parameter corresponding to the port number type 5 is 0x00000020, which is 100000 in binary. In the aging filter bitmap mask 2, the aging filter parameter bit is bit5. The authentication type is the number of bits shifted left.

[0142] 2) The MAC address authentication function is enabled on ports 101 to 103 and port 107 of the network device 100 to control the network access rights of the user terminal. That is, the MAC address of the user terminal is added to the MAC address table only after the RADIUS server successfully authenticates the MAC address of the user terminal, so that the user terminal can access the network.

[0143] 3) User terminal 104 accesses network device 100 through port 101. When network device 100 detects a message sent by user terminal 104 for the first time, it starts a MAC address authentication operation for user terminal 104. If the MAC address authentication for user terminal 104 is successful, network device 100 records hardware MAC address entry 1 in the hardware MAC address table and software MAC address entry 1 in the software MAC address table. Hardware MAC address entry 1 and software MAC address entry 1 include MAC address 1-1-1 of user terminal 104, and records information entry 1 of user terminal 104 in the online user list.

[0144] User terminal 105 accesses network device 100 through port 102. When network device 100 detects a message sent by user terminal 105 for the first time, it starts MAC address authentication operation for user terminal 105. If MAC address authentication for user terminal 105 is successful, network device 100 records hardware MAC address entry 2 in hardware MAC address table, software MAC address entry 2 in software MAC address table, hardware MAC address entry 2 and software MAC address entry 2 include MAC address 2-2-2 of user terminal 105, and records information entry 2 of user terminal 105 in online user list. Network device 100 turns off MAC address offline detection function of port 102 to ensure that user terminal 105 as dumb terminal is online for a long time.

[0145] User terminal 106 accesses network device 100 through port 103. When network device 100 detects the message sent by user terminal 106 for the first time, it starts the MAC address authentication operation for user terminal 106. If the MAC address authentication for user terminal 106 is successful, network device 100 records hardware MAC address entry 3 in the hardware MAC address table and software MAC address entry 3 in the software MAC address table. Hardware MAC address entry 3 and software MAC address entry 3 include MAC address 3-3-3 of user terminal 106, and records information entry 3 of user terminal 106 in the online user list.

[0146] At this time, the hardware MAC address table and the software MAC address table can be shown in Table 3.

[0147] Table 3

[0148]

[0149] The MAC addresses of the user terminal 104 and the user terminal 106 are dynamic attributes, that is, the MAC addresses of the user terminal 104 and the user terminal 106 are dynamic MAC addresses.

[0150] 4) The network device 100 performs the software table item polling task and polls the software MAC address table. When the software MAC address table item 1 is polled, the MAC address type 7 in the software MAC address table item 1 is logically ANDed with the aging filter bitmap mask 1 to obtain the result 1 of (1<<7)&0x00000080. If bit 7=1 in the result 1, the aging deletion process of the software MAC address table item 1 is skipped, and the software MAC address table item 1 and the hardware MAC address table item 1 to which 1-1-1 belongs are not deleted, and the next software MAC address table item in the software MAC address table is polled.

[0151] In the embodiment of the present application, the software MAC address table entry includes two authentication types. When the aging filter parameter bit in the logical AND operation result of one authentication type is 1, the aging deletion process of the software MAC address table entry is skipped.

[0152] When software MAC address table entry 2 is polled, the MAC address type 7 in software MAC address table entry 2 is logically ANDed with the aging filter bitmap mask 1 to obtain the result 2 of (1<<7)&0x00000080. If bit 7=1 in result 2, the aging deletion process of software MAC address table entry 2 is skipped, and the software MAC address table entry 2 and the hardware MAC address table entry 2 to which 2-2-2 belongs are not deleted. The next software MAC address table entry in the software MAC address table is polled.

[0153] When the software MAC address table entry 3 is polled, the MAC address type 1 in the software MAC address table entry 3 is logically ANDed with the aging filter bitmap mask 1 to obtain the result 3 of (1<<1)&0x00000080, and bit7=0 in the result 3; the port number type 2 in the MAC address table entry 3 is logically ANDed with the aging bitmap mask 2 to obtain the result 4 of (1<<2)&0x00000020, and bit5=0 in the result 4; then the condition for skipping the aging deletion process of the software MAC address table entry 3 is not met, and the network device 100 executes the aging deletion process of the software MAC address table entry 3, as follows:

[0154] The network device 100 reads the AGE bit 31 included in the software MAC address table entry 3. As shown in Table 3, the AGE bit 31 is TURE (software non-aging flag), then the AGE bit 32 of the hardware MAC address table entry 3 and the AGE bit 31 in the software MAC address table entry 3 are both set to FALSE (software aging flag or hardware non-aging flag), as shown in Table 4.

[0155] Table 4

[0156]

[0157] The network device 100 performs the software table polling task, polls the software MAC address table, and before polling the software MAC address table item 3 again, if a message matching the hardware MAC address table item 3 is received within an aging cycle, the hardware chip will set the AGE bit 32 in the hardware MAC address table item 3 to TRUE, as shown in Table 3. If a message matching the hardware MAC address table item 3 is not received within an aging cycle, the hardware chip will keep the AGE bit 32 in the hardware MAC address table item 3 to FALSE, as shown in Table 4.

[0158] When the network device 100 performs the software table item polling task, polls the software MAC address table, and polls the software MAC address table item 3 again, the network device 100 reads the AGE bit 31 in the software MAC address table item 3, as shown in Table 4, and the AGE bit 31 is FALSE, then the AGE bit 32 in the hardware MAC address table item 3 is read. If the AGE bit 32 of the hardware MAC address table item 3 is FALSE, as shown in Table 4, the hardware MAC address table item 3 and the software MAC address table item 3 are aged and deleted. If the AGE bit 32 of the hardware MAC address table item 3 is TRUE, as shown in Table 3, the AGE bit 32 of the hardware MAC address table item 3 is set to FALSE, as shown in Table 4.

[0159] After that, the network device continues to perform the software table polling task and polls the software MAC address table, and repeats this cycle until the hardware MAC address table entry 3 and the software MAC address table entry 3 are deleted.

[0160] 5) If no message is received from the user terminal 104 within the offline detection time, the network device 100 deletes the information entry 1, ie, the user terminal 104 is offline, and deletes the hardware MAC address entry 1 and the software MAC address entry 1.

[0161] If no message sent by the user terminal 106 is received within the offline detection time, the network device 100 deletes the information entry 6, that is, the user terminal 106 is offline, and deletes the hardware MAC address entry 3 and the software MAC address entry 3.

[0162] For user terminal 105, network device 100 turns off the MAC address offline detection function of port 102, and the authentication type of user terminal 105 meets the conditions for skipping the aging deletion process. Network device 100 will not age and delete hardware MAC address table entry 2 and software MAC address table entry 2, ensuring that user terminal 105 is online for a long time.

[0163] 6) When user terminal 104 migrates from port 101 to port 107, Figure 7In the networking shown, since the MAC address 1-1-1 in the hardware MAC address table entry 1 and the software MAC address table entry 1 is a dynamic attribute; when the MAC address offline detection function has not determined that the user terminal 104 is offline at port 101, the network device 100 can re-trigger the MAC address authentication of the user terminal 104 at port 107, update the access port in the hardware MAC address table entry 1 and the software MAC address table entry 1 to port 107, and send it to the hardware MAC address table and the software MAC address table, as shown in Table 5.

[0164] Table 5

[0165]

[0166] In the embodiment of the present application, the user terminal of MAC address authentication is configured with a dynamic MAC address, but the MAC address does not age, so that the user terminal of MAC address authentication is only controlled by the offline detection time, and there will be no packet loss problem caused by the inconsistency between the online user terminal and the hardware MAC address table, where the user terminal is online but the hardware MAC address table entry has been deleted due to aging. In addition, when the user terminal migrates the access port, it can be re-authenticated and online in time, further improving the user's Internet experience.

[0167] Corresponding to the above-mentioned table entry management method, the embodiment of the present application provides a table entry management device, such as Figure 8 As shown, the device is applied to a network device, and includes:

[0168] A setting module 801 is used to set the hardware MAC address table to prohibit aging;

[0169] The execution module 802 is used to execute the software table item polling task, polling each storage location of the software MAC address table; the software table item polling task performs a logical AND operation on the authentication type of the first software MAC address table item of the polled storage location and the aging filter bitmap mask; wherein the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1; the software table item polling task determines that the corresponding bit binary value of the aging filter parameter bit in the logical AND operation result is 1, and identifies that the first software MAC address table item matches the aging filter parameter; the software table item polling task polls the next storage location of the software MAC address table to skip the aging deletion processing of the first software MAC address table item.

[0170] In some embodiments, the execution module 802 can also be used to execute a software table item polling task to poll each storage location of the software MAC address table; the software table item polling task to perform a logical AND operation on the authentication type of the second software MAC address table item of the polled storage location and the aging filter bitmap mask; the software table item polling task to determine that the corresponding bit binary value of the aging filter parameter bit in the logical AND operation result is 0, and identify that the second software MAC address table item does not match the aging filter parameter; the software table item polling task to identify that the second software MAC address table item has not set a software aging flag; the software table item polling task to set a software aging flag for the second software MAC address table item, and set a hardware aging flag for the second hardware MAC address table item corresponding to the second software MAC address table item.

[0171] In some embodiments, the execution module 802 can also be used to execute a software table item polling task, the software table item polling task, the authentication type of the second software MAC address table item at the polled storage location is logically ANDed with the aging filter bitmap mask; the software table item polling task, determining that the binary value of the corresponding bit of the aging filter parameter bit in the logical AND operation result is 0, and identifying that the second software MAC address table item does not match the aging filter parameter; the software table item polling task, identifying that the software aging flag has been set for the second software MAC address table item; the software table item polling task, identifying that in the hardware MAC address table, the second hardware MAC address table item corresponding to the second software MAC address table item has not been set with a hardware aging flag, and setting a hardware aging flag for the second hardware MAC address table item; or, identifying that in the hardware MAC address table, the second hardware MAC address table item corresponding to the second software MAC address table item has been set with a hardware aging flag; aging and deleting the second software MAC address table item and the second hardware MAC address table item.

[0172] In some embodiments, the execution module 802 may also be used to:

[0173] Determine that the number of storage locations polled in the software MAC address table is equal to the preset number of polls per time, and the software table entry polling task enters a dormant state;

[0174] When the sleep time ends, the software table entry polling task determines that the last storage location of the software MAC address table has not been polled, and polls the next storage location of the software MAC address table; or

[0175] When the sleep time ends, the software table entry polling task determines that the last storage location of the software MAC address table has been polled, and then polls the first storage location of the software MAC address table.

[0176] In some embodiments, the above-mentioned entry management device may further include: a determination module and a calculation module;

[0177] The setting module 801 may also be used to set the polling quantity of each software item polling task before executing the software item polling task;

[0178] A determination module, used to determine each polling time within the aging time of the hardware MAC address table based on the software table item specification of the software MAC address table, the number of each polling, and the aging time of the software MAC address table; the aging time of the software MAC address table is equal to the aging cycle of the hardware MAC address table;

[0179] The calculation module is used to calculate the sleep time of the software table item polling task within each polling time based on each polling time and each polling quantity.

[0180] In the technical solution provided in the embodiment of the present application, the network device is configured with an aging filter bitmap mask, and the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1. When the corresponding bit binary value of the aging filter parameter bit in the result of the logical AND operation of the authentication type of a MAC address table item and the aging filter bitmap mask is 1, it means that the corresponding bit binary value of the aging filter parameter bit of the authentication type of the MAC address table item is 1, and the MAC address table item matches the aging filter parameter, and the aging deletion process can be skipped. For user terminals whose MAC address aging time is less than the offline detection time, the authentication type of the MAC address of the user terminal can be set to an authentication type that matches the aging filter parameter, thereby skipping the aging deletion process of the MAC address of the user terminal.

[0181] In addition, the network device is configured with a software table item polling task to poll each storage location of the software MAC address table. In this way, the software table item polling task can poll the software MAC address table items in each storage location, thereby realizing the aging deletion process of skipping the software MAC address table items that match the aging filtering parameters, so that each MAC address table item that needs to skip the aging deletion process can avoid being deleted by aging, and each MAC address table item that does not need to skip the aging deletion process can be deleted by aging in time, which solves the problem that the user terminal is online but the hardware MAC address table item has been aged, and improves the user's Internet experience.

[0182] Corresponding to the above-mentioned table entry management method, the embodiment of the present application also provides a network device, such as Fig. 9 As shown, it includes a processor 901 and a machine-readable storage medium 902, wherein the machine-readable storage medium 902 stores machine-executable instructions that can be executed by the processor 901, and the processor 901 is prompted by the machine-executable instructions to implement any of the above-mentioned table entry management methods.

[0183] In the embodiment of the present application, the network device may further include a communication interface and a communication bus, wherein the processor 901, the communication interface, and the machine-readable storage medium 902 communicate with each other via the communication bus.

[0184] The communication bus can be a Peripheral Component Interconnect (PCI) bus or an Extended Industry Standard Architecture (EISA) bus, etc. The communication bus can be divided into an address bus, a data bus, a control bus, etc. For ease of representation, only one thick line is used in the figure, but it does not mean that there is only one bus or one type of bus.

[0185] The communication interface is used for communication between the above network devices and other devices.

[0186] The machine-readable storage medium may include a random access memory (RAM) or a non-volatile memory (NVM), such as at least one disk storage. Optionally, the machine-readable storage medium may also be at least one storage device located away from the aforementioned processor.

[0187] The processor can be a general-purpose processor, including a central processing unit (CPU), a network processor (NP), etc.; it can also be a digital signal processor (DSP), an application specific integrated circuit (ASIC), a field programmable gate array (FPGA) or other programmable logic devices, discrete gate or transistor logic devices, and discrete hardware components.

[0188] In another embodiment provided in the present application, a computer-readable storage medium is provided, in which a computer program is stored. When the computer program is executed by a processor, any of the above-mentioned table entry management methods is implemented.

[0189] In another embodiment provided by the present application, a computer program product including instructions is also provided, which, when executed on a computer, enables the computer to execute any one of the table entry management methods in the above embodiments.

[0190] In the above embodiments, it can be implemented in whole or in part by software, hardware, firmware or any combination thereof. When implemented using software, it can be implemented in whole or in part in the form of a computer program product. The computer program product includes one or more computer instructions. When the computer program instructions are loaded and executed on a computer, the process or function described in the embodiment of the present application is generated in whole or in part. The computer may be a general-purpose computer, a special-purpose computer, a computer network, or other programmable device. The computer instructions may be stored in a computer-readable storage medium, or transmitted from one computer-readable storage medium to another computer-readable storage medium. For example, the computer instructions may be transmitted from a website site, a computer, a server or a data center by wired (e.g., coaxial cable, optical fiber, digital subscriber line (DSL)) or wireless (e.g., infrared, wireless, microwave, etc.) mode to another website site, computer, server or data center. The computer-readable storage medium may be any available medium that a computer can access or a data storage device such as a server or a data center that includes one or more available media integrated. The available medium may be a magnetic medium (e.g., a floppy disk, a hard disk, a tape), an optical medium (e.g., a DVD), or a semiconductor medium (e.g., a solid-state drive Solid State Disk (SSD)), etc.

[0191] It should be noted that, in this article, relational terms such as first and second, etc. are only used to distinguish one entity or operation from another entity or operation, and do not necessarily require or imply any such actual relationship or order between these entities or operations. Moreover, the terms "include", "comprise" or any other variants thereof are intended to cover non-exclusive inclusion, so that a process, method, article or device including a series of elements includes not only those elements, but also other elements not explicitly listed, or also includes elements inherent to such process, method, article or device. In the absence of further restrictions, the elements defined by the sentence "comprise a ..." do not exclude the existence of other identical elements in the process, method, article or device including the elements.

[0192] Each embodiment in this specification is described in a related manner, and the same or similar parts between the embodiments can be referred to each other, and each embodiment focuses on the differences from other embodiments. In particular, for the device, network device, storage medium and program product embodiments, since they are basically similar to the method embodiments, the description is relatively simple, and the relevant parts can be referred to the partial description of the method embodiment.

[0193] The above description is only a preferred embodiment of the present application and is not intended to limit the protection scope of the present application. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims

1. A table entry management method, characterized in that: Applied to a network device, the method comprises: Set the hardware MAC address table to prohibit aging; Execute the software table entry polling task to poll each storage location of the software MAC address table; The software table item polling task performs a logical AND operation on the authentication type of the first software MAC address table item of the polled storage location and the aging filter bitmap mask; wherein the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1; The software table entry polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logic and operation result is 1, and identifies that the first software MAC address table entry matches the aging filter parameter; The software table entry polling task polls the next storage location of the software MAC address table to skip the aging and deletion processing of the first software MAC address table entry.

2. The method according to claim 1, characterized in that The method further comprises: The software table item polling task performs a logical AND operation on the authentication type of the second software MAC address table item at the polled storage location and the aging filter bitmap mask; The software table entry polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logic and operation result is 0, and identifies that the second software MAC address table entry does not match the aging filter parameter; The software table entry polling task identifies that the second software MAC address table entry does not have a software aging flag set; The software table entry polling task sets the software aging flag for the second software MAC address table entry, and sets a hardware aging flag for the second hardware MAC address table entry corresponding to the second software MAC address table entry.

3. The method according to claim 1, characterized in that The method further comprises: The software table item polling task performs a logical AND operation on the authentication type of the second software MAC address table item at the polled storage location and the aging filter bitmap mask; The software table entry polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logic and operation result is 0, and identifies that the second software MAC address table entry does not match the aging filter parameter; The software table entry polling task identifies that the second software MAC address table entry has a software aging flag set; The software table entry polling task identifies that in the hardware MAC address table, the second hardware MAC address table entry corresponding to the second software MAC address table entry has no hardware aging flag set, and sets the hardware aging flag for the second hardware MAC address table entry; or identifies that in the hardware MAC address table, the second hardware MAC address table entry corresponding to the second software MAC address table entry has a hardware aging flag set; and ages and deletes the second software MAC address table entry and the second hardware MAC address table entry.

4. The method according to any one of claims 1 to 3, characterized in that: The method further comprises, Determining that the number of storage locations polled by the software MAC address table is equal to a preset number of polls per time, the software table entry polling task enters a dormant state; When the sleep time ends, the software table entry polling task determines that the last storage location of the software MAC address table has not been polled, and polls the next storage location of the software MAC address table; or When the sleep time ends, the software table entry polling task determines that the last storage location of the software MAC address table has been polled, and then polls the first storage location of the software MAC address table.

5. The method according to claim 4, characterized in that Before executing the software table item polling task, the method further includes: Setting the polling quantity per time of the software item polling task; Determine each polling time within the aging time of the hardware MAC address table based on the software table entry specification of the software MAC address table, the polling quantity each time, and the aging time of the software MAC address table; the aging time of the software MAC address table is equal to the aging cycle of the hardware MAC address table; The sleep time of the software entry polling task within each polling time is calculated based on each polling time and each polling quantity.

6. A table entry management device, characterized in that: Applied to network equipment, the device comprises: The setting module is used to set the hardware MAC address table to prohibit aging; An execution module is used to execute a software table item polling task to poll each storage location of a software MAC address table; the software table item polling task performs a logic AND operation on the authentication type of the first software MAC address table item of the polled storage location and an aging filter bitmap mask; wherein the aging filter parameter bit of the aging filter bitmap mask is set to a binary value of 1; the software table item polling task determines that the corresponding bit binary value of the aging filter parameter bit in the logic AND operation result is 1, and identifies that the first software MAC address table item matches the aging filter parameter; the software table item polling task polls the next storage location of the software MAC address table to skip the aging deletion processing of the first software MAC address table item.

7. The device according to claim 6, characterized in that The execution module is further used to execute a software table item polling task to poll each storage location of the software MAC address table; the software table item polling task performs a logical AND operation on the authentication type of the second software MAC address table item at the polled storage location and the aging filter bitmap mask; the software table item polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logical AND operation result is 0, and identifies that the second software MAC address table item does not match the aging filter parameter; the software table item polling task identifies that the software aging flag is not set for the second software MAC address table item; the software table item polling task sets the software aging flag for the second software MAC address table item, and sets the hardware aging flag for the second hardware MAC address table item corresponding to the second software MAC address table item.

8. The device according to claim 6, characterized in that The execution module is further used to execute a software table item polling task, wherein the software table item polling task performs a logical AND operation on the authentication type of the second software MAC address table item at the polled storage location and the aging filter bitmap mask; the software table item polling task determines that the binary value of the corresponding bit of the aging filter parameter bit in the logical AND operation result is 0, and identifies that the second software MAC address table item does not match the aging filter parameter; the software table item polling task identifies that the software aging flag has been set for the second software MAC address table item; the software table item polling task identifies that in the hardware MAC address table, the second hardware MAC address table item corresponding to the second software MAC address table item does not have a hardware aging flag set, and sets the hardware aging flag for the second hardware MAC address table item; Alternatively, it is identified that in the hardware MAC address table, a second hardware MAC address entry corresponding to the second software MAC address entry has a hardware aging flag set; and the second software MAC address entry and the second hardware MAC address entry are aged and deleted.

9. The device according to any one of claims 6 to 8, characterized in that: The execution module is further used for: Determining that the number of storage locations polled by the software MAC address table is equal to a preset number of polls per time, the software table entry polling task enters a dormant state; When the sleep time ends, the software table entry polling task determines that the last storage location of the software MAC address table has not been polled, and polls the next storage location of the software MAC address table; or When the sleep time ends, the software table entry polling task determines that the last storage location of the software MAC address table has been polled, and then polls the first storage location of the software MAC address table.

10. The device according to claim 9, characterized in that The device also includes: a determination module and a calculation module; The setting module is further used to set the polling quantity of each software item polling task before executing the software item polling task; The determining module is used to determine each polling time within the aging time of the hardware MAC address table based on the software table entry specification of the software MAC address table, the polling quantity each time, and the aging time of the software MAC address table; the aging time of the software MAC address table is equal to the aging cycle of the hardware MAC address table; The calculation module is used to calculate the sleep time of the software table item polling task within each polling time based on each polling time and the polling quantity each time.

Citation Information

Patent Citations

  • Data message processing method and device

    CN106603468A

  • Method, line card and switching device for aging MAC address

    CN108111637A

  • MAC address table entry aging processing method and device

    CN111355823A

  • Address table maintenance method and device, and equipment

    CN112491722A

  • Method and equipment for keeping dumb terminal online

    CN112637373A