Management system and method for unified security MAC (Media Access Control) in switch and switch
The switch security MAC management system built through the Klish command line architecture provides dynamic, static and sticky configuration modes. Combined with the aging mechanism, it solves the complexity and resource occupation problems of traditional switch security MAC management and improves network security and management efficiency.
Patent Information
- Application Number
- CN202410830136.9
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-06-25
- Publication Date
- 2024-09-24
AI Technical Summary
Traditional switches have problems with complex configuration, insufficient security, and inflexible management in terms of secure MAC management. In particular, they cannot achieve dynamic, static, and sticky configurations, and the lack of an aging mechanism leads to excessive resource usage.
Use Klish command line architecture to build a unified secure MAC management system, provide dynamic, static and sticky configuration modes, and introduce a secure MAC aging module to achieve flexible configuration of secure MAC and automatic cleaning of outdated addresses through flow-triggered automatic addition and message filtering mechanism. .
It improves the flexibility and security of switch management, reduces security risks, adapts to dynamic changes in the network environment, and simplifies the administrator's workflow.
Smart Images

Figure CN118694657A
Abstract
Description
Technical Field
[0001] The present invention relates to the field of switch network security, and in particular to a control and processing technology for a switch port security MAC. Background Art
[0002] Switches are an extremely important component in modern network systems. As the core device of the network, they are responsible for data transmission and exchange. Once their data security is threatened, the stability and security of the entire network system will be seriously damaged.
[0003] In order to protect the switch from being able to carry out data transmission services normally and stably and to prevent network intrusion by malicious attackers, the switch usually takes some protective measures to filter illegal messages. MAC address is the unique identifier of network devices, and the switch can identify illegal messages through the MAC address carried in the data message.
[0004] On this basis, the concept of secure MAC was derived, which uses the characteristic of MAC as a unique identifier of network devices to add the MAC of devices that have passed security audits to the secure MAC of the switch.
[0005] Traditional switch management methods have problems such as complex configuration, insufficient security, and inflexible management, which are difficult to meet the security and management needs of modern networks. Especially in terms of secure MAC management, switches used to configure various types of secure MACs in independent forms, which could not achieve flexible configuration in multiple forms such as dynamic, static, and sticky. In addition, traditional switches also lack an effective aging mechanism and cannot automatically clean up outdated or no longer used secure MAC addresses, resulting in excessive resource usage.
[0006] Therefore, providing a switch management solution that is unified, secure, efficient, and has an aging mechanism is an urgent problem to be solved in this field. Summary of the invention
[0007] In view of the problems existing in the secure MAC management of existing switches, the purpose of the present invention is to provide a unified secure MAC management solution in the switch, which implements unified management and secure MAC on the switch based on the Klish architecture to overcome the problems existing in the prior art.
[0008] In order to achieve the above-mentioned object, the first aspect of the present invention provides a management system for a unified secure MAC in a switch, wherein the management system is provided with a configuration command module, wherein the configuration command module is configured to build a secure MAC configuration command based on a Klish command line architecture, wherein the secure MAC configuration command can execute a secure MAC dynamic configuration mode, a secure MAC static configuration mode, and a secure MAC sticky configuration mode;
[0009] When executing the secure MAC dynamic configuration mode, the switch is set to flow-triggered automatic addition, and the switch can automatically learn and add secure MAC addresses based on the received messages;
[0010] When executing the secure MAC static configuration mode, the switch is set to the manual configuration mode, and the switch can configure specific secure MAC address entries through human-computer interaction;
[0011] When executing the secure MAC sticky configuration mode, the switch is set to be able to manually configure specific entries or flow triggers to automatically add, and can automatically add according to received messages.
[0012] In some embodiments of the present invention, the secure MAC configuration command constructed by the configuration command module adopts the Klish command line architecture to form command line input, and supports three secure MAC mode commands and secure MAC configuration extensible commands by editing the Klish xml script file.
[0013] In some implementations of the present invention, when executing the secure MAC dynamic configuration mode, the secure MAC of the switch is triggered by the flow and automatically configured, and after being triggered, the source MAC of the received message is automatically added as the secure MAC.
[0014] In some embodiments of the present invention, during the execution of the secure MAC flow triggered automatic configuration process, the switch is configured to complete the addition of the secure MAC by initializing, allocating a fixed memory according to the length of the linked list, and creating a security_mac_add_main thread task, and performing cyclic writing and reading operations on the linked list content.
[0015] In some embodiments of the present invention, when executing the secure MAC sticky configuration mode, the switch is configured to automatically convert the existing dynamic MAC on the current port into a static Sticky MAC and add it to the secure MAC address, and before the upper limit of the number of secure MACs is reached, the new MAC messages received on subsequent ports will be directly added as sticky MACs.
[0016] In some embodiments of the present invention, the management system is further configured with a secure MAC aging module, and the secure MAC aging module is configured to automatically clean up outdated or no longer used secure MAC addresses based on a set aging mechanism.
[0017] In some embodiments of the present invention, the management system is further configured with a message filtering module, which is configured to screen the message in the software program according to set conditions or filter the message in combination with the secure MAC list and ACL entries when the switch receives the message.
[0018] In order to achieve the above-mentioned object, the second aspect of the present invention provides a management method for a unified secure MAC in a switch, wherein the management method builds a secure MAC configuration command based on the Klish command line architecture, and the secure MAC configuration command can execute a secure MAC dynamic configuration mode, a secure MAC static configuration mode, and a secure MAC sticky configuration mode;
[0019] When executing the secure MAC dynamic configuration mode, the switch is set to flow-triggered automatic addition, and the switch can automatically learn and add secure MAC addresses based on the received messages;
[0020] When executing the secure MAC static configuration mode, the switch is set to the manual configuration mode, and the switch can configure specific secure MAC address entries through human-computer interaction;
[0021] When executing the secure MAC sticky configuration mode, the switch is set to be able to manually configure specific entries or flow triggers to automatically add, and can automatically add according to received messages.
[0022] In some embodiments of the present invention, the secure MAC configuration commands constructed by the management method adopt the Klish command line architecture to form command line input, and support three secure MAC mode commands and secure MAC configuration extensible commands by editing the Klish xml script file.
[0023] In order to achieve the above object, the third aspect of the present invention provides a switch, which performs unified management and secure MAC configuration based on the above-mentioned unified secure MAC management method in the switch.
[0024] The unified secure MAC management solution in the switch provided by the present invention innovatively builds a configuration command system by utilizing the Klish command line architecture, and flexibly adds and expands configuration commands based on the Klish command line architecture according to actual needs. In actual application, more configuration commands related to secure MAC are added according to specific business needs to meet different security and management needs.
[0025] Furthermore, the unified secure MAC management solution in the switch provided by the present invention is innovatively based on the Klish command line architecture to achieve the unification and scalability of configuration commands, greatly improving the work efficiency of administrators; on this basis, by further introducing various forms of secure MAC configuration, aging mechanism, automatic addition of flow triggers, and message filtering and other functions, the solution of the present invention can effectively improve the security of the network, reduce security risks, and adapt to dynamic changes in the network environment; compared with existing solutions, the solution of the present invention has obvious innovation and practicality in switch management and security control. BRIEF DESCRIPTION OF THE DRAWINGS
[0026] The present invention is further described below in conjunction with the accompanying drawings and specific embodiments.
[0027] Figure 1 It is a schematic diagram of a secure MAC table maintenance framework in the solution of the present invention;
[0028] Figure 2 Input flow chart of klish command framework in the scheme of the present invention;
[0029] Figure 3 A flow chart for automatically adding secure MAC to the flow trigger in the solution of the present invention;
[0030] Figure 4 This is a flow chart of secure MAC aging in the solution of the present invention. DETAILED DESCRIPTION
[0031] In order to make the technical means, creative features, objectives and effects achieved by the present invention easy to understand, the present invention is further described below with reference to specific diagrams.
[0032] For the configuration management solution of the secure MAC in the switch, in the past, the command of the secure MAC function was registered in a single way. For the complex and numerous sub-commands or parameters, it is necessary to make corresponding designs when the switch is initially designed and configured for the secure MAC, so that the finished switch can support multiple sub-commands or parameters when configuring the secure MAC function. However, today's switch security scenarios face a complex and changing environment, and security requirements are frequently updated. In practice, it is difficult to fully meet all future requirements from the beginning of the design. Therefore, it is particularly important to introduce a more flexible and scalable command support method for the configuration management of the secure MAC in the switch.
[0033] Klish is a framework that provides a command line interface (CLI) for network devices. It is configured to use XML files to define commands and command structures, allowing developers to freely customize and extend the CLI to meet the needs of subsequent frequent application updates.
[0034] On this basis, the present invention provides a management method for a unified secure MAC in a switch. The management method builds a configuration command framework of the switch based on the Klish command line architecture, and defines a secure MAC configuration command through the configuration command framework. Based on the defined secure MAC configuration command, multiple types of secure MAC configurations such as dynamic, static and sticky secure MAC are implemented, so that the switch can enter a secure MAC dynamic configuration mode, a secure MAC static configuration mode or a secure MAC sticky configuration mode.
[0035] In the secure MAC dynamic configuration mode, the switch is set to automatically learn and add secure MAC addresses based on received messages;
[0036] In the secure MAC static configuration mode, the switch is set to be able to configure the secure MAC address through human-machine interaction;
[0037] In the secure MAC sticky configuration mode, the switch is set to add secure MACs through human-computer interaction. After configuring this mode, the switch is also set to convert the existing dynamic MAC on the port into a static Sticky MAC and add it to the secure MAC address. Before the upper limit of the number of secure MACs is reached, the new MAC received on the subsequent port will be directly added as a Sticky MAC.
[0038] The implementation process of the solution of the present invention and the corresponding technical features are described in detail below.
[0039] The solution of the present invention firstly builds a configuration command framework of the switch based on the Klish command line architecture, and defines a secure MAC configuration command through the configuration command framework.
[0040] Specifically, a configuration command framework is built based on the Klish architecture, and a secure MAC configuration command definition is performed. The corresponding commands are input based on the command line provided by the klish architecture. At the same time, the klish xml script file is edited to support three secure MAC mode commands and secure MAC configuration extension commands.
[0041] Furthermore, after the Klish xml script is configured to input a complete and correct command for the command line of the klish architecture, the command to be executed will be sent in the form of a string through ebus to the unified entry do_port_security interface (referred to as the C code processing interface) for C code processing security MAC configuration commands. In this processing interface, the incoming line of string is parsed character by character to obtain the necessary parameter information and select the next interface path.
[0042] On this basis, the C code processing interface also checks whether the configuration corresponding to the incoming command is standardized during the parsing of the incoming string:
[0043] If it does not match, an error message is returned. If it is correct, the remaining string will be sent to the next interface for processing. Repeat this step to parse all characters and perform corresponding function settings according to the parameter data obtained in the previous steps. Figure 2 shown.
[0044] It should be noted here that when checking the standardization of the configuration corresponding to the command, it can be checked based on the preset standard form. The specific inspection mode can be determined according to actual needs and is not limited here.
[0045] On this basis, the solution of the present invention is based on the configuration command framework built by the Klish architecture, forms corresponding security MAC configuration commands by defining a series of commands and parameters, and sets corresponding functions through different tags based on the Klish xml script.
[0046] As a further explanation, in the configuration command framework constructed here, COMMAND name is used to define the command name, PARAM name is used to define the sub-command name, and ACTION is used as the string content of the specific execution.
[0047] Based on the above configuration command framework, corresponding tags are further used to define extended functions.
[0048] Specifically, in the solution of the present invention, the mode tag is used to expand the sub-commands, and after the mode tag, multiple PARAMnames belong to parallel sub-commands of the same level, the help tag is used to prompt the meaning of the command, and the ptype tag defines the parameter range.
[0049] Furthermore, the solution of the present invention utilizes the capability of the mode tag to place all security mac configuration commands as subcommands of the same level PARAM name after a uniformly defined COMMAND name, so that subcommands can be added simply and quickly, reducing development workload.
[0050] Accordingly, when the solution of the present invention defines the secure mac command based on the above-mentioned configuration command framework, the secure MAC configuration command is input through the configuration command framework built based on the Klish architecture, and then the three secure MAC mode commands and secure MAC configuration extension commands are flexibly supported by editing the Klish xml script file, thereby effectively realizing the subsequent flexible supplementation of the secure MAC configuration scheme, and there is no need to consider all possible configuration situations from the first time the command is designed.
[0051] As a further explanation, the switch configuration command framework built based on the Klish command line architecture in the solution of the present invention can be presented in the form of a command line interface or network management software, which can achieve efficient human-computer interaction, allowing administrators to perform configuration operations by creating and managing command line interfaces or network management software, and conveniently add new configuration commands and functions under the Klish command line architecture to achieve unified management of secure MAC configuration of the switch.
[0052] It should be noted here that the specific presentation form of the switch configuration command framework is not limited thereto, and those skilled in the art may adopt other feasible presentation forms according to actual needs.
[0053] After the switch configuration command framework is built based on the Klish command line architecture, the solution of the present invention can perform various forms of configuration of the secure MAC based on the built switch configuration command framework.
[0054] In the solution of the present invention, when configuring the switch security MAC based on the security MAC configuration command defined in the switch configuration command framework, all security MAC subcommands in the configured security MAC configuration command are under one main command, and subcommands of the same level are mutually exclusive. In this way, the commands of dynamic mode, static mode, and sticky mode (i.e., static mode) are further placed under the same COMMAND name when editing the Klish xml script. In this way, in actual use, it is possible to effectively avoid configuring two or more modes on the same port, thereby avoiding interference when the switch actually processes messages due to the possible mutual influence of multiple settings when issuing the corresponding underlying table items or register settings, resulting in the phenomenon that the security mac function does not work.
[0055] It should be noted that the specific presentation format of the secure MAC configuration command in the solution of the present invention is not limited, as long as the corresponding configuration mode can be implemented during execution.
[0056] In the specific implementation, the secure MAC configuration command can be defined through the switch configuration command framework built based on the Klish command line architecture, and then the switch can identify and execute the secure MAC configuration command, so that the switch can make corresponding settings based on the secure MAC configuration command, thereby entering the secure MAC dynamic configuration mode, secure MAC static configuration mode and secure MAC sticky configuration mode.
[0057] (1) Secure MAC dynamic configuration mode
[0058] When the switch enters the secure MAC dynamic configuration mode, it sets the underlying state of the port based on the corresponding configuration instructions, and sets the forwarding state of the port to redirect to the CPU (redirect to cpu), so that all messages received on the port are redirected to the CPU, waiting for processing at the CPU receiving message interface, so as to intercept the message and call our processing interface to analyze and process the data carried by the message. In addition, because there may be a large number of duplicate messages in the actual network, redirecting the message to the cpu and then calling the processing interface can avoid duplicate and invalid messages blocking data forwarding.
[0059] On this basis, when the switch enters the security MAC dynamic configuration mode, it is further configured into the flow automatic triggering mode, that is, the switch's security MAC is triggered by the flow and automatically configured. After the trigger, the source MAC of the received message is automatically added as the security MAC.
[0060] Specifically, the switch can perform secure MAC flow-triggered automatic configuration based on the secure MAC configuration command. When executing the secure MAC flow-triggered automatic configuration mode, the switch detects network traffic based on preset conditions, and when network traffic that meets the preset conditions is detected, the corresponding source MAC address is automatically added to the secure MAC list as a secure MAC. In this way, the secure MAC list can be dynamically adjusted according to changes in network traffic, thereby improving the security and flexibility of the network.
[0061] Furthermore, during the process of automatically adding a secure MAC triggered by a flow, the switch allocates a fixed memory according to the length of the linked list and creates a security_mac_add_main thread task by initialization, and then completes the addition of the secure MAC by cyclically writing and reading the linked list content.
[0062] As a further example, after the switch enters the secure MAC dynamic configuration mode that supports flow-triggered automatic addition of secure MAC based on the secure MAC configuration command, the switch uses ACL control message forwarding based on the operating capability of the underlying chip to redirect the message received by the port to the CPU. After receiving the message, the CPU calls the constructed message processing interface port_security_addr_check to parse the received message content information, and writes the obtained mac, port, and vlan content into the linked list created by the switch initialization. Then, based on the created security_mac_add_main thread task, the linked list content is continuously written and read in a loop to complete the addition of the secure MAC; here, the operations of reading and writing the linked list use the pv operation semaphore for mutual exclusion.
[0063] As a further explanation, the port_security_addr_check processing interface is used as the message processing interface of this solution. It configures the relevant modes of port security and sets the port message to be sent to the CPU. When the port receives the message data, this interface is called for preprocessing. In this interface, the information carried by the message will be parsed and then written into the linked list created by initialization.
[0064] As a further explanation, in this solution, when the switch is in a corresponding mode that supports secure MAC flow triggered automatic configuration, the switch can automatically add the source MAC address to the secure MAC list by detecting network traffic that meets preset conditions. In order to improve the corresponding detection accuracy and ensure the accuracy of automatically adding secure MAC addresses, the switch can be specifically configured to automatically learn and add secure MAC addresses based on received messages.
[0065] (2) Secure MAC static configuration mode
[0066] When the switch is in the secure MAC static configuration mode, the switch can receive manual operation instructions, identify the manual operation instructions, and configure the secure MAC address accordingly, thereby realizing manual configuration of the secure MAC address.
[0067] Specifically, when the switch enters the secure MAC static configuration mode, it can provide a manual operation instruction input interface through the switch configuration command framework built based on the Klish command line architecture, and manually configure the secure mode or secure MAC entry according to the relevant prompts of the command line.
[0068] (3) Secure MAC sticky configuration mode
[0069] When the switch enters the secure MAC sticky configuration mode (i.e., sticky mode), the existing dynamic MAC configuration on the port is converted into a sticky MAC based on the corresponding configuration instructions; further, the secure MAC entry is configured so that it can be directly added manually.
[0070] On this basis, when the switch enters the secure MAC sticky configuration mode, its port state is the same as the dynamic mode when it enters the secure MAC dynamic configuration mode, that is, it can also be configured to automatically trigger automatic configuration by flow. At this time, the forwarding state of the port will be set to redirect to cpu, and all packets received on the port will be redirected to the CPU and wait for processing on the CPU receiving packet interface.
[0071] In this way, when the switch enters the secure MAC sticky configuration mode, it can achieve the secure MAC flow triggered automatic configuration mode, just like entering the secure MAC dynamic configuration mode. In this mode, the switch can automatically add the source MAC address to the secure MAC list when it detects network traffic that meets the preset conditions. In this way, the secure MAC list can be dynamically adjusted according to changes in network traffic, improving the security and flexibility of the network.
[0072] The following specifically describes the implementation process of the switch in the secure MAC dynamic configuration mode and the secure MAC sticky configuration mode to achieve secure MAC flow triggered automatic configuration in this solution.
[0073] See also Figure 3 , which shows the implementation logic process of the switch in this solution to implement flow-triggered automatic configuration when entering the secure MAC dynamic configuration mode or the secure MAC sticky configuration mode. The specific implementation process is as follows:
[0074] When the switch is initialized, a fixed memory is first allocated to create a linked list, and the security_MAC_add_main task is created to read the data in the linked list.
[0075] When the switch turns on the port security function and is configured in dynamic mode (i.e., secure MAC dynamic configuration mode) or sticky mode (i.e., secure MAC sticky configuration mode), the message received by the switch port will be redirected to the CPU, and the CPU message processing interface will call the message processing interface port_security_addr_check to process the message. In the processing interface, the message will be parsed to obtain key information, such as MAC address, port number, and VLAN, and the parsed key information will be stored in the initially created linked list.
[0076] Next, based on the created security_MAC_add_main task, the data in the linked list is scanned regularly and a series of checks are performed, such as MAC entry duplication check and security MAC total limit check. After the check, the MAC address that meets the conditions will be added to the security MAC table.
[0077] During the check process, if the number of MAC entries in the secure MAC table reaches the set maximum secure MAC number limit, the forwarding state of the port will be modified again, and the message will no longer be sent to the CPU, and no message will be sent to the port_security_addr_check interface for processing.
[0078] It should be noted here that for the above three configuration modes, you can flexibly choose according to the network environment and security requirements in actual application to improve network security and management efficiency.
[0079] The solution of the present invention further adds sub-commands based on the fact that multiple configuration modes can be used to manage the secure MAC in the switch, thereby configuring the corresponding message protocol type, thereby achieving more refined control over the secure MAC filtering message function.
[0080] For the filtering of message types, the solution of the present invention expands the configuration command of configuring the secure MAC mode by configuring the software pre-filtering mechanism, and adds parameters of the message types allowed to pass, such as IP, ARP, etc. At the same time, this subcommand is controlled by the XML script optional tag, that is, this subcommand is not a mandatory option.
[0081] On this basis, it is further configured to record the parameter in the software code when issuing a command.
[0082] According to this setting, after receiving the traffic, the switch analyzes the message and obtains the protocol type of the current message by parsing the ethertype information carried in the message. Then, based on the allowed message type parameters configured in the filtering mechanism, the switch compares and analyzes whether the current message protocol type can pass, and then decides whether to pass or discard it.
[0083] Furthermore, based on the secure MAC-based message screening and filtering scheme, since different forms of secure MAC have different characteristics and application requirements, this scheme adopts different implementation methods for different secure MAC modes when specifically implementing the corresponding message filtering.
[0084] Among them, for the static mode (ie, the secure MAC static configuration mode), the manual adding configuration method is adopted based on the mode configuration. In this solution, the ACL table item control is directly issued when configuring the item to achieve the filtering effect.
[0085] Specifically, when the switch port security is set to static mode (i.e., secure MAC static configuration mode), a discard ACL entry is issued to discard all packets on this port. Each time a static MAC entry is added to the secure MAC table, a corresponding permit acl entry will be issued to forward packets whose source MAC is the same as the static MAC. At the same time, the priority of the permit acl entry is configured to be higher than the aforementioned discard acl entry. In this way, if the smac of the packet received on the port is the added secure mac, the permit acl entry will be prioritized for forwarding. Based on this setting, it is possible to accurately allow only configured packets to pass through, and not allow packets that are not bound to mac to be forwarded, thereby achieving the effect of controlling and filtering illegal packets.
[0086] When the switch port security is set to dynamic mode (i.e., security MAC dynamic configuration mode) or sticky mode (i.e., security MAC sticky configuration mode), based on these two modes, it is necessary to implement the flow-triggered automatic addition of security MAC settings. This solution filters and processes the message by first passing it to the configured security_addr_check processing interface. In this way, when configuring the dynamic mode and sticky mode commands, a port-based redirect_to_cpu ACL table entry will be issued first, and the messages received on the ports configured with dynamic mode and sticky mode will be redirected to the CPU. When the CPU receives the message, it will call the security_addr_check interface to process the message. The security_addr_check interface can parse the message data, obtain the MAC, vlan, port and other information carried by the message at this stage, and then store it in the linked list created when the machine is started.
[0087] At the same time, the security_MAC_add_main thread task created when the switch is initialized will read the security MAC from the linked list. After obtaining the data in the linked list, it will first perform a duplication check. After determining that it is a new entry, it will add the security MAC table. At the same time, it will send a permit acl entry to the hardware bottom layer. The priority of the permit acl entry is configured to be higher than the priority of the redirect_to_cpu acl entry. Therefore, when the smac of the message received on the port is a mac that already exists in the security mac table, the message will hit the permit acl entry and be forwarded normally, and other messages will continue to hit the redirect_to_cpu entry and be sent to the cpu for processing.
[0088] Furthermore, when the security_MAC_add_main thread task completes the operation of adding a secure MAC, it will determine whether the number of added secure MACs has reached the upper limit. If it has reached the upper limit, the underlying acl will be modified to modify the action of the redirect_to_cpu acl table item to deny any any, thereby converting the acl entry into a discard acl table item. In this way, the message added to the secure mac hits the permit acl table item for forwarding, and the illegal message of other unknown mac hits the discard acl for discarding, thereby achieving the purpose of filtering messages by the secure mac function.
[0089] The solution of the present invention not only implements multiple configuration modes to manage secure MAC in the switch, but also further adds an aging mechanism for secure MAC in the switch, and automatically clears outdated or no longer used secure MAC addresses based on the secure MAC aging mechanism.
[0090] Furthermore, with respect to the three secure MAC configuration modes set in the switch, since different forms of secure MAC configuration modes have different characteristics and application requirements, the solution of the present invention configures a corresponding aging mechanism in the switch.
[0091] Among them, for the static mode (i.e., the security MAC static configuration mode), in this mode, the security MAC entries can only be added manually by human-machine exchange, and there is no aging problem. Therefore, this solution does not run any aging mechanism in this mode.
[0092] For dynamic mode (i.e., secure MAC dynamic configuration mode) or sticky mode (i.e., secure MAC sticky configuration mode), based on the need to implement flow-triggered automatic addition of secure MAC settings in these two modes, this solution runs the corresponding aging mechanism in these two modes.
[0093] Specifically, the solution of the present invention sets an aging time and an aging mode (absolute or inactivity) for each configured secure MAC, so that when a secure MAC address is not used within the aging time, the switch will automatically remove it from the secure MAC table.
[0094] As a further explanation, the solution of the present invention preferably uses a timer and a task scheduling mechanism to build a corresponding aging mechanism. When the switch is initialized, it creates a corresponding aging check task based on the task scheduling mechanism and sets a timer to trigger the execution of the task. When the timer expires, the aging check task traverses the secure MAC list, checks the aging status of each address, and performs cleanup operations as needed.
[0095] Here, aging detection is implemented based on the security_mac_aging_check task, and the security_mac_aging_check task is executed regularly to perform aging checks.
[0096] As a further example, Figure 4 As shown, it shows the implementation process of aging management for secure MAC in the solution of the present invention.
[0097] Combined with the diagram, the solution of the present invention constructs a corresponding aging check task based on the security_mac_aging_check task for the security MAC, and sets the aging time and aging mode (absolute or inactivity) respectively;
[0098] Accordingly, the corresponding aging check task will periodically check the dynamic and sticky MAC addresses in the secure MAC table according to the set aging time and mode (absolute or inactivity).
[0099] If in absolute aging mode, the task checks whether the address exceeds the set aging time. If the set aging time is reached, the address is aged.
[0100] If in the inactivity aging mode, the task will use the hit bit of the chip's underlying MAC table entry to determine whether there is still a flow carrying the MAC. If the hit bit is false, it means that the MAC address has not been used for a period of time and needs to be aged; otherwise, the address will be retained in the list.
[0101] Based on this, outdated or no longer used secure MAC addresses can be accurately and automatically cleared to ensure the stability and reliability of switch operation.
[0102] The unified secure MAC management method in the switch given in this example solution can be used as a corresponding software program in specific applications to form a unified secure MAC management system in the corresponding switch. When the software program is running, it will execute the unified secure MAC management method in the switch and store it in a corresponding storage medium for the processor to retrieve and execute.
[0103] The management system of the unified secure MAC in the switch thus formed specifically sets up a configuration command module, which is configured to build a secure MAC configuration command based on the Klish command line architecture. The secure MAC configuration command can execute a secure MAC dynamic configuration mode, a secure MAC static configuration mode, and a secure MAC sticky configuration mode.
[0104] Specifically, the configuration command module here is specifically configured to build a configuration command framework based on the Klish architecture, and to define secure MAC configuration commands. The command line provided based on the klish architecture inputs the corresponding commands, and at the same time, supports three secure MAC mode commands and secure MAC configuration extension commands by editing the klish xml script file.
[0105] Furthermore, the configuration command module is configured to be able to implement three modes: secure MAC dynamic configuration mode, secure MAC static configuration mode and secure MAC sticky configuration mode based on the aforementioned solution.
[0106] Furthermore, the system is also configured with a secure MAC aging module, which is configured to automatically clean up outdated or no longer used secure MAC addresses based on a set aging mechanism.
[0107] Furthermore, according to the corresponding configuration mode, the switch will process the received message according to the corresponding processing flow, and then filter the message by combining the secure MAC list and ACL table items.
[0108] When the unified secure MAC management system in the switch is able to run in the switch, a configuration command line interface or network management software is built based on the Klish architecture, and multiple configuration commands related to the secure MAC can be added to achieve the unification and scalability of the configuration commands, greatly improving the work efficiency of the administrator.
[0109] The following is a corresponding application example to further illustrate the application process and functional characteristics of this solution.
[0110] This application example runs a unified secure MAC management system in the switch. The management system can form a configuration command framework based on the Klish command line architecture in the switch, so that administrators can build configuration commands for the switch based on the Klish command line architecture.
[0111] The Klish command line architecture is used here to build a command line interface or network management software to define the corresponding secure MAC configuration commands.
[0112] In the Klish command line architecture, the command configuration file uses the XML format, which makes the definition of the secure MAC configuration command clearer and easier to manage.
[0113] Through the XML configuration file, you can define the name, parameters, options and corresponding execution logic of the secure MAC configuration command. Such a structured definition makes it easier to expand and maintain the command.
[0114] Here, the Klish architecture provides a unified configuration command system for the switch. Administrators can use these commands to configure and manage the switch through the command line interface or network management software. The configuration commands include the configuration commands of the security MAC, which are used to set the operations such as adding, deleting, and modifying the security MAC. Figure 1 shown.
[0115] Through the above examples, it can be seen that the scheme of the present invention uses the Klish architecture to build a configuration command system, effectively realizes the uniformity and scalability of configuration commands, and greatly improves the work efficiency of administrators. At the same time, by introducing various forms of configuration of secure MAC, aging mechanism, automatic addition of flow triggers, and message filtering, the present invention effectively improves the security of the network, reduces security risks, and adapts to the dynamic changes of the network environment.
[0116] The above shows and describes the basic principles, main features and advantages of the present invention. It should be understood by those skilled in the art that the present invention is not limited to the above embodiments, and the above embodiments and descriptions are only for explaining the principles of the present invention. Without departing from the spirit and scope of the present invention, the present invention may have various changes and improvements, which fall within the scope of the present invention to be protected. The scope of protection of the present invention is defined by the attached claims and their equivalents.
Claims
1. A unified secure MAC management system in a switch, characterized in that: The management system is provided with a configuration command module, wherein the configuration command module is configured to build a secure MAC configuration command based on a Klish command line architecture, wherein the secure MAC configuration command can execute a secure MAC dynamic configuration mode, a secure MAC static configuration mode, and a secure MAC sticky configuration mode; When executing the secure MAC dynamic configuration mode, the switch is set to flow-triggered automatic addition, and the switch can automatically learn and add secure MAC addresses based on the received messages; When executing the secure MAC static configuration mode, the switch is set to the manual configuration mode, and the switch can configure specific secure MAC address entries through human-computer interaction; When executing the secure MAC sticky configuration mode, the switch is set to be able to manually configure specific entries or flow trigger automatic addition, and can be automatically added according to received messages.
2. The unified secure MAC management system in a switch according to claim 1, characterized in that: The secure MAC configuration command constructed by the configuration command module adopts the Klish command line architecture to form command line input, and supports three secure MAC mode commands and secure MAC configuration extensibility commands by editing the Klishxml script file.
3. The unified secure MAC management system in a switch according to claim 1, characterized in that: When executing the security MAC dynamic configuration mode, the switch's security MAC is triggered by the flow and automatically configured. After triggering, the source MAC of the received message is automatically added as the security MAC.
4. The unified secure MAC management system in a switch according to claim 3, characterized in that: During the execution of the secure MAC flow triggered automatic configuration process, the switch is configured to complete the addition of the secure MAC by initializing, allocating a fixed memory according to the length of the linked list, and creating the security_mac_add_main thread task, and performing cyclic writing and reading operations on the linked list content.
5. The unified secure MAC management system in a switch according to claim 1, characterized in that: When executing the secure MAC sticky configuration mode, the switch is configured to automatically convert the existing dynamic MAC on the current port into a static Sticky MAC and add it to the secure MAC address. Before the upper limit of the number of secure MACs is reached, the new MAC messages received on subsequent ports will be directly added as sticky MACs.
6. The unified secure MAC management system in a switch according to claim 1, characterized in that: The management system is also configured with a secure MAC aging module, which is configured to automatically clean up outdated or no longer used secure MAC addresses based on a set aging mechanism.
7. The unified secure MAC management system in a switch according to claim 1, characterized in that: The management system is also configured with a message filtering module, which is configured to screen the message in the software program according to set conditions or filter the message in combination with the security MAC list and ACL table items when the switch receives the message.
8. A method for managing a unified secure MAC in a switch, characterized in that: The management method builds a secure MAC configuration command based on the Klish command line architecture, and the secure MAC configuration command can execute a secure MAC dynamic configuration mode, a secure MAC static configuration mode, and a secure MAC sticky configuration mode; When executing the secure MAC dynamic configuration mode, the switch is set to flow-triggered automatic addition, and the switch can automatically learn and add secure MAC addresses based on the received messages; When executing the secure MAC static configuration mode, the switch is set to the manual configuration mode, and the switch can configure specific secure MAC address entries through human-computer interaction; When executing the secure MAC sticky configuration mode, the switch is set to be able to manually configure specific entries or flow trigger automatic addition, and can be automatically added according to received messages.
9. The method for managing a unified secure MAC in a switch according to claim 8, characterized in that: The secure MAC configuration command constructed by the management method adopts the Klish command line architecture to form command line input, and supports three secure MAC mode commands and secure MAC configuration extensibility commands by editing the Klish xml script file.
10. A switch, characterized in that: The switch performs unified management and secure MAC configuration based on the unified secure MAC management method in the switch according to claim 8 or 9.
