WO2024207809A1 - 一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质 - Google Patents
一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质 Download PDFInfo
- Publication number
- WO2024207809A1 WO2024207809A1 PCT/CN2023/140400 CN2023140400W WO2024207809A1 WO 2024207809 A1 WO2024207809 A1 WO 2024207809A1 CN 2023140400 W CN2023140400 W CN 2023140400W WO 2024207809 A1 WO2024207809 A1 WO 2024207809A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- switch port
- module
- network
- state
- network module
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Ceased
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L49/00—Packet switching elements
- H04L49/30—Peripheral units, e.g. input or output ports
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L41/00—Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
- H04L41/08—Configuration management of networks or network elements
- H04L41/0803—Configuration setting
Definitions
- the present application relates to the field of port technology, and in particular to a switch port status configuration method, device, equipment and non-volatile readable storage medium.
- Ports can be set to achieve communication between different network devices in a LAN and to connect network traffic between different LANs.
- the port status indicates the current physical connection status of a port.
- the up state means that the port is open and working
- the down state means that the port is closed or not connected to any device.
- the network device can use the port for network communication, transmit data packets or receive data packets.
- the network device cannot use the port for network communication.
- the purpose of the present application is to provide a switch port status configuration method, device, equipment and non-volatile readable storage medium, which are used to avoid errors in the switch port status and improve the stability of network communications.
- a switch port status configuration method comprising:
- the preset switch port status determination rule is to determine the switch port status in the order of module priority from high to low, and in the same module priority in the order of switch port status priority from high to low.
- the switch port status includes a network communication state and a network communication non-state. The priority of the network communication non-state is higher than the priority of the network communication state.
- the switch port state also includes a blocking state, and the priority of the blocking state is higher than the priority of the network communication incapable state;
- the switch port can receive control messages sent by the network module.
- the method further includes:
- each network module for the switch port including:
- obtaining the module priority of each network module corresponding to the switch port includes:
- the module priority determined by each network module corresponding to the switch port using the association module corresponding to each network module is obtained.
- the method further includes:
- An update to a module priority of a second target network module among the network modules is received.
- receiving an update of a module priority of a second target network module in each network module includes:
- An update of the module priority of the second target network module sent by a user is received.
- determining and configuring the state of the switch port according to the module priority of each network module, the state configuration of the switch port by each network module, and a preset switch port state determination rule includes:
- the state of the switch port is determined and configured according to the state configuration of the switch port by each network module with the highest module priority and the rule of determining the switch port state in descending order of the priority of the switch port state in the same module priority.
- the method before obtaining the module priority of each network module corresponding to the switch port, the method further includes:
- the method further includes:
- the unregistered network module is removed.
- register the network module according to the registration command including:
- the network module is registered.
- the network module if it is not in the whitelist of allowed registrations, it also includes:
- receiving a registration command sent by a network module includes:
- the method further includes:
- issue abnormal alarms including:
- the alarm is issued by at least one of email alarm, SMS alarm, telephone alarm and alarm light alarm.
- the method further includes:
- the method further includes:
- a switch port status configuration device comprising:
- a first acquisition module is configured to acquire the module priority of each network module corresponding to the switch port and the state configuration of each network module to the switch port;
- a configuration module is configured to determine and configure the state of the switch port according to the module priority of each network module, the state configuration of the switch port by each network module, and a preset port switch port state determination rule;
- the preset switch port status determination rule is to determine the switch port status in the order of module priority from high to low, and in the same module priority in the order of switch port status priority from high to low.
- the switch port status includes a network communication state and a network communication non-state. The priority of the network communication non-state is higher than the priority of the network communication state.
- a switch port status configuration device comprising:
- a memory arranged to store a computer program
- the processor is configured to implement the steps of any of the above switch port status configuration methods when executing a computer program.
- a non-volatile readable storage medium in which a computer program is stored.
- the computer program is executed by a processor, the steps of any of the above switch port status configuration methods are implemented.
- the present application provides a switch port state configuration method, device, equipment and non-volatile readable storage medium, wherein the method includes: obtaining the module priority of each network module corresponding to the switch port and the state configuration of each network module to the switch port; determining and configuring the state of the switch port according to the module priority of each network module, the state configuration of each network module to the switch port and a preset switch port state determination rule; wherein the preset switch port state determination rule is to determine the switch port state in the order of module priority from high to low and in the order of switch port state priority from high to low in the same module priority, and the switch port state includes a network communication state and a non-network communication state, and the priority of the non-network communication state is higher than the priority of the network communication state.
- the above-mentioned technical scheme disclosed in the present application is to configure the priority of each network module connected to the switch port.
- the switch determines the rule of the switch port status according to the module priority of each network module corresponding to the switch port, the status configuration of each network module for the switch port and the preset order of module priority from high to low, and the order of the priority of the switch port status from high to low in the same module priority (the switch port status includes a network communication state and a non-network communication state, and the priority of the non-network communication state is higher than the priority of the network communication state) to finally determine and configure the status of the switch port, so as to avoid each network module from operating and changing the status of the switch port, thereby eliminating the risk of uncertain errors, avoiding errors in the switch port status, and improving the stability of network communication.
- FIG1 is a schematic diagram of an existing network module operating the status of a switch port
- FIG2 is a flow chart of a switch port status configuration method provided by an embodiment of the present application.
- FIG3 is a schematic diagram of a connection between a switch and a switch port provided in an embodiment of the present application
- FIG4 is an example diagram of MAC address drift provided in an embodiment of the present application.
- FIG5 is a schematic diagram of the composition of a Monitor Link port linkage module provided in an embodiment of the present application.
- FIG6 is a network architecture diagram of a switch port status configuration method provided in an embodiment of the present application.
- FIG7 is a schematic diagram of the connection between the association module and the switch provided in an embodiment of the present application.
- FIG8 is a schematic diagram of registration of each network module provided in an embodiment of the present application.
- FIG9 is a schematic diagram of the structure of a switch port status configuration device provided in an embodiment of the present application.
- FIG. 10 is a schematic diagram of the structure of a switch port status configuration device provided in an embodiment of the present application.
- FIG. 1 shows a schematic diagram of the existing network module operating the status of the switch port. Assuming that network module A and network module B both correspond to switch port 1, and the operation process of network module A and network module B on the status of switch port 1 is: 1. Network module A determines that an error has occurred in the corresponding network environment, and changes the status of switch port 1 to down state to prevent switch port 1 from participating in network communication; 2. Network module B determines that the status of switch port 1 is up state according to its corresponding network environment and changes the status of switch port 1 to up state.
- MAC Media Access Control Address
- switch port 1 After the status of switch port 1 is changed to up state, switch port 1 will re-participate in network communication, which will cause the error in the network to still exist, thereby affecting network communication.
- network module A may set the status of switch port 1 to down after a certain time interval, but the above process has made the status of switch port 1 wrong within a certain time interval, causing uncertain error risks and affecting network communication.
- the above process may be executed in a loop, resulting in frequent errors in the switch port status.
- the present application provides a switch port status configuration method, apparatus, device and non-volatile readable storage medium for avoiding errors in the switch port status to improve the stability of network communications.
- FIG. 2 shows a flow chart of a switch port status configuration method provided in an embodiment of the present application
- FIG. 3 shows a schematic diagram of a connection between a switch and a switch port provided in an embodiment of the present application.
- a switch port status configuration method provided in an embodiment of the present application may include:
- the switch port status configuration method provided in this application can be applied to switches, and can be applied to the switch software platform SONiC (Software for Open Networking in the Cloud, network switch operating system). Of course, it can also be applied to other devices, as long as it is possible to communicate with each network module corresponding to the switch port and obtain relevant information of each network module.
- This application is explained by taking the application to a switch as an example.
- each network module corresponding to a switch port refers to a module corresponding to the switch port and capable of operating and configuring the status of the switch port.
- a network module may include a MAC address drift module and a Monitor Link port linkage module.
- MAC address drift refers to the phenomenon that in the same VLAN (Virtual Local Area Network), a MAC address has two output ports, and the later learned output port covers the original output port. As shown in Figure 4, it shows an example diagram of MAC address drift.
- Device A-Device D are in the same VLAN. The message passing through device A will enter device B through port a and forwarded from port c to device D. The port learned by the MAC address table entry of device B is port a.
- the MAC address drift module will set the port status of the device where the MAC address drift occurs to down (i.e., a state in which network communication is not possible), that is, the MAC address drift module will operate the state of the corresponding switch port according to whether MAC address drift occurs.
- the Monitor Link port linkage module triggers the change of the "up/down" state of the downstream port by monitoring the upstream port of the device according to the change of its "up (i.e., network communication state)/down" state.
- Figure 5 shows a schematic diagram of the composition of a Monitor Link port linkage module.
- the ports of device B and device D respectively form a Monitor Link group, one of which is an upstream port and the other is a downstream port.
- the upstream port is the port monitored in the Monitor Link group.
- the Monitor Link group When there is no upstream port in the Monitor Link group or the status of all upstream ports is a state in which network communication is not possible, the Monitor Link group is in a state in which network communication is not possible, and as long as the status of one upstream port is a state in which network communication is possible, the Monitor Link group is in a state in which network communication is possible.
- the downstream port is the monitoring port in the Monitor Link group.
- each network module corresponding to the switch port is configured with a module priority.
- the module priority can be configured according to the importance of each network module, the current status of each network module, etc.
- at least two module priorities can be pre-defined.
- two module priorities can be pre-defined, namely level 0 and level 1, and the module priority of level 0 is higher than the module priority of level 1.
- more module priorities can also be defined according to actual needs.
- the module priority of each network module can be defined in the configuration file so that the switch can obtain the module priority of the network module from the configuration file. If the module priority of each network module is not defined, the switch can give a preset module priority, for example, the preset module priority can be level 0.
- the switch When the switch configures the status of the current switch port, it can obtain the module priority of each network module corresponding to the switch port, for example, the module priority of network module A is level 0, the module priority of network module B is level 0, the module priority of network module C is level 0, the module priority of network module D is level 0, the module priority of network module E is 1..., and level 0 is higher than level 1.
- the switch can also obtain the status configuration of each network module corresponding to the switch port for the switch port, so that the switch can make a decision and configure the status of the switch port by comprehensively considering the module priority of each network module corresponding to the switch port and the status configuration of the switch port.
- S12 Determine and configure the state of the switch port according to the module priority of each network module, the state configuration of the switch port by each network module, and the preset switch port state determination rule; wherein the preset switch port state determination rule is to determine the switch port state in the order of module priority from high to low and in the order of priority of the switch port state from high to low within the same module priority, and the switch port state includes a network communication state and a non-network communication state, and the non-network communication state has a higher priority than the network communication state.
- the switch can obtain the module priority of each network module, the network The module finally determines the state of the switch port by configuring the state of the switch port and the preset switch port state determination rule, and configures the state of the switch port according to the finally determined state of the switch port.
- the state of the switch port is finally determined to be a state in which network communication is not possible, the state of the switch port is finally configured to be a state in which network communication is not possible; if the state of the switch port is finally determined to be a state in which network communication is possible, the state of the switch port is finally configured to be a state in which network communication is not possible.
- the preset switch port state determination rule is to determine the switch port state in the order of module priority from high to low, and in the same module priority, in the order of switch port state priority from high to low, and the switch port state can include a network communication state and a non-network communication state, and the non-network communication state is higher than the network communication state. That is, the state configuration of the switch port by the network module with the highest module priority is given priority to avoid the network modules with the remaining module priorities affecting the state configuration of the switch port by the network module with the highest module priority, thereby avoiding errors in the switch port state.
- the switch port state corresponding to the module priority is determined to be a non-communication network state; in the same module priority, when all network modules configure the state of the switch port as a communication network state, the switch port state corresponding to the module priority is determined to be a communication network state.
- the switch port state will be the non-communicative network state, so as to avoid continuing to use the switch port for network communication to transmit or receive data packets, thereby avoiding errors in the switch port state.
- the present application no longer directly operates and configures the switch port by each network module corresponding to the switch port, but the switch comprehensively considers the priority of each network module corresponding to the switch port and the status configuration of each network module for the switch port to finally arbitrate and determine the status of the switch port, and configures the status of the switch port according to the status of the switch port finally determined by arbitration, so as to avoid the risk of probabilistic errors in the status of the switch port and improve the stability of network transmission.
- the switch port status configuration method of the present application does not require additional upgrades to the network infrastructure equipment and is not limited by the impact of equipment capabilities.
- a switch network is a computer network in which a switch is used as a transit station for data transmission between terminal devices in the network.
- computers, servers, routers and other network devices are connected to the switch so that they can communicate with each other.
- the data is transmitted from the sending device to the receiving device of the same switch without affecting other devices.
- the network topology scale is getting larger and larger, and many different network services are produced, which will inevitably lead to many problems.
- Figure 6 shows a network architecture diagram of the switch port state configuration method provided in an embodiment of the present application.
- the middle is interconnected as a switch, and there is a loop in the network architecture in Figure 6.
- the switch can solve the problem of port configuration error when the switch port configuration method provided in the present application is applied to the switch port configuration.
- the rules for determining the status of the switch port are used to finally determine and configure the status of the switch port to avoid each network module making operational changes to the status of the switch port, thereby eliminating the risk of uncertain errors, avoiding errors in the switch port status, and improving the stability of network communications.
- switch port state configuration method provided by an embodiment of the present application, wherein the switch port state may further include a blocking state, and the priority of the blocking state is higher than the priority of the non-network communication state;
- the switch port can receive control messages sent by the network module.
- the switch port state may also include a blocking state, and the priority of the blocking state is higher than the priority of the non-network communication state, that is, when any network module configures the switch port state to a blocking state under the same module priority, the state of the switch port is determined to be a blocking state.
- the switch port when the switch port is in a blocked state, the switch port can receive control messages sent by the network module.
- the control message can be a message sent to the switch port when a network module finds that the network anomaly has been resolved, that is, in this case, the sending of the control message can indicate that the network anomaly has been resolved. From the above content, it can be seen that when the switch port state is in a blocked state, the switch port will not be completely closed, but can receive control messages.
- the switch port state can be quickly restored to a communicative network state when network anomalies are eliminated or in some special circumstances.
- a switch port status configuration method provided by an embodiment of the present application may further include, after obtaining the status configuration of the switch port by each network module:
- each network module corresponding to the switch port can monitor in real time whether the corresponding network status is updated.
- the status configuration of the switch port can be updated, and the update of the status configuration of the switch port can be sent to the switch.
- the switch can obtain the update of the status configuration of the switch port by the first target network module in each network module corresponding to the switch port (the first target network module is the network module in each network module corresponding to the switch port where the status configuration of the switch port is updated).
- the state of the switch port is determined and configured according to the update of the state configuration of the switch port by the first target network module in each network module corresponding to the switch port, the state configuration of the switch port by the remaining network modules, the module priority of each network module and the preset switch port state rule, so that the update of the state configuration of the switch port by the first target network module can participate in the determination and configuration of the switch port state, thereby facilitating the improvement of the accuracy and timeliness of the switch port state configuration and avoiding errors in the switch port state.
- step S12 is to determine and configure the state of the switch port according to the update of the state configuration of the switch port by the first target network module in each network module corresponding to the switch port, the state configuration of the switch port by the remaining network modules, the module priority of each network module and the preset switch port state determination rule.
- step S12 when it occurs after step S12, after determining and configuring the state of the switch port according to the module priority of each network module, the state configuration of the switch port by each network module and the preset switch port state determination rule, it can also include: obtaining the update of the state configuration of the switch port by the first target network module in the network module; determining and configuring the state of the switch port according to the update of the state configuration of the switch port by the first target network module in each network module corresponding to the switch port, the state configuration of the switch port by the remaining network modules, the module priority of each network module and the preset switch port state determination rule, so as to re-determine and configure the state of the switch port, and timely and effectively avoid errors in the state of the switch port.
- a switch port status configuration method provided in an embodiment of the present application which obtains the status configuration of each network module for the switch port, may include:
- each network module corresponding to the switch port can periodically send the status configuration of the switch port, wherein the status configuration of the switch port sent by each network module last time may be the same as or different from the status configuration of the switch port sent this time, and the status configuration of the switch port can be determined according to the network status corresponding to the network module.
- the switch can obtain the status configuration of the switch port sent regularly by each network module, so as to participate in the final determination and configuration of the switch port status according to the status configuration of the switch port sent regularly by each network module, thereby facilitating improving the accuracy of the switch port status configuration.
- a switch port status configuration method provided by an embodiment of the present application which obtains the module priority of each network module corresponding to the switch port, may include:
- the module priority of each network module is determined according to the communication information of the associated module corresponding to each network module.
- the switch can communicate with the association module corresponding to each network module, and determine the module priority of each network module according to the communication information of the association module corresponding to each network module, that is, the module priority of each network module can be determined according to the association module corresponding to each network module.
- the association module is a module in the switch that affects and is associated with the network module, and each network module can correspond to its own association module, or multiple network modules can correspond to one association module.
- BGP Band Gateway Protocol
- Figure 7 shows a schematic diagram of the connection between the association module and the switch provided in the embodiment of the present application.
- BGP is a protocol used between Internet routers. It is used to exchange routing information. When the routing information exchanged between routers changes, it may cause instability between routers, causing the routers to constantly update routing information. The constant back and forth updates will lead to the so-called BGP oscillation phenomenon. When the BGP route changes, it may cause network traffic to switch from one network path to another, resulting in address drift. For example, when a router cannot access a certain network, it may send a BGP update to other routers.
- New information is sent to notify that the traffic needs to be forwarded through other paths.
- the traffic that originally passed through the router will have address drift because the network address of its destination has changed.
- the BGP module can communicate with the switch, and the BGP module can inform the switch that oscillation will occur within a certain period of time. Therefore, the switch can determine the priority of the module with MAC address drift as level 1, which actually means that MAC address drift will not affect the configuration of the switch port.
- the rationality of determining the module priority of each network module can be improved, so as to improve the rationality and accuracy of the switch port status configuration and avoid port status errors.
- a switch port status configuration method provided by an embodiment of the present application determines the module priority of each network module according to the communication information of the associated module corresponding to each network module, which may include:
- the module priority of each network module is dynamically updated according to the communication information of the associated module corresponding to each network module.
- the switch can communicate with the associated modules corresponding to each network module, and dynamically update the module priority of each network module according to the communication information of the associated modules corresponding to each network module. That is, the switch can dynamically update the priority of each network module through communication with the associated modules corresponding to the network module. For example, the switch can adjust the priority of a network module to level 1 within a period of time, and restore it to level 0 when the time is up.
- the BGP module can inform the switch that oscillation will occur within a certain period of time, that is, the BGP module can send the oscillation time period to the switch.
- the switch After the switch receives the oscillation time period sent by the BGP module, it will adjust the module priority of the MAC address drift to level 1 within the oscillation time period, which actually means that the MAC address drift will not affect the configuration of the switch port during this period of time, and the module priority of the MAC address drift is adjusted to level 0 outside the oscillation time period, so that the network module can participate in the configuration of the switch port.
- a switch port status configuration method provided by an embodiment of the present application may further include, after determining the module priority of each network module according to the communication information of the associated module corresponding to each network module:
- An instruction for updating the module priority of the second target network module is received from a user, and the module priority of the second target network module is updated according to the instruction.
- the module priority of each network module can be displayed so that the user can obtain the module priority of each network module, and the module priority of one or some network modules can be updated according to actual needs.
- an instruction to update the module priority of the second target network module (the second target network module is the network module to be updated with the module priority) can be sent to the switch.
- the switch can receive the instruction sent by the user to update the module priority of the second target network module, and update the module priority of the second target network module according to the instruction, for example, the module priority of a certain network module can be changed from level 0 to level 1, or the module priority of a certain network module can be changed from level 1 to level 0, so that the second target network module can participate in the switch port status configuration with the latest module priority, thereby improving the user experience.
- the present invention provides a method for configuring the state of a switch port, which determines and configures the state of the switch port according to the module priority of each network module, the state configuration of each network module for the switch port and the preset switch port state determination rule.
- the status of the switch port which can include:
- the state of the switch port is determined and configured according to the state configuration of the switch port by each network module with the highest module priority and the rule of determining the switch port state in descending order of the priority of the switch port state in the same module priority.
- the preset switch port state determination rules include rules for determining the switch port state in order of module priority from high to low, therefore, when determining and configuring the switch port state according to the module priority of each network module, the state configuration of each network module to the switch port and the preset switch port state determination rules, the state configuration of each network module with the highest module priority to the switch port can be directly obtained, and the state of the switch port can be finally determined and configured directly according to the state configuration of each network module with the highest module priority to the switch port and the rules for determining the switch port state in order of the priority of the switch port state from high to low in the same module priority contained in the preset switch port state determination rules, so as to reduce the complexity of determining the final state of the switch port and improve the efficiency of the switch port state configuration.
- each network module to the switch port corresponding to each module priority determines the switch port status corresponding to each module priority according to the status configuration of each network module to the switch port corresponding to each module priority and the rule of determining the switch port status in order from high to low priority of the switch port status in the same module priority, obtain the switch port status corresponding to the highest module priority from the switch port status corresponding to each module priority, and use the switch port status corresponding to the highest module priority to configure the switch port status.
- a switch port status configuration method provided in an embodiment of the present application may further include, before obtaining the module priority of each network module corresponding to the switch port:
- the method may further include:
- the unregistered network module is removed.
- each network module corresponding to the switch port can be pre-registered in the switch, so that when the switch port status is configured, only the registered network modules have the authority to participate in the configuration of the switch port status, thereby facilitating the improvement of the accuracy of the switch port status configuration and avoiding errors in the switch port status.
- the switch may also receive a registration command sent by the network module, wherein the registration command may include information about the network module, such as the name of the network module, the devices included in the network module, the function of the network module, etc. Then, the switch may register the network module according to the registration command. Furthermore, after obtaining the module priority of each network module corresponding to the switch port and the state configuration of each network module to the switch port, before determining and configuring the state of the switch port according to the module priority of each network module, the state configuration of each network module to the switch port and the preset switch port state determination rule, the switch may determine whether each network module is a registered network module.
- the unregistered network module If there is an unregistered network module among the network modules corresponding to the switch port, the unregistered network module is removed, and the state of the switch port is determined and configured according to the module priority of the registered network module, the registered state configuration of the switch port and the preset switch port state determination rule, so as to avoid the unregistered network module from participating in the switch port state configuration and causing an error in the switch port state.
- the embodiment of the present application provides a switch port status configuration method, according to the registration command, the network module is configured Registration may include:
- the network module is registered.
- the registration whitelist contains information of the network module that is allowed to be registered, and the registration whitelist can be set by the user.
- the network module can be registered to improve the rationality and accuracy of the network module registration, thereby facilitating the improvement of the accuracy of the switch port status configuration.
- a switch port status configuration method provided by an embodiment of the present application may further include: if the network module is not in the registration allowed whitelist:
- the network module based on the information of the network module contained in the registration command and the pre-stored whitelist of allowed registration, it is determined whether the network module is in the whitelist of allowed registration. If the network module is not in the whitelist of allowed registration, not only can the registration of the network module be rejected, but a prompt that the network module is not registered can also be issued, so that these network modules cannot participate in the configuration of the switch port status, and the user can query and take countermeasures according to the prompt, such as deleting these network modules or adding them to the whitelist of allowed registration according to the situation of these network modules.
- a whitelist of allowed registration and a blacklist of not allowed registration may also be pre-stored, wherein the blacklist of not allowed registration contains information about network modules that are not allowed to be registered. If the network module is not in the whitelist of allowed registration, the network module is refused to be registered, and a prompt is issued that the network module has no right to participate in the switch port configuration. It is also possible to determine whether the network module is in a pre-stored blacklist of not allowed registration. If the network module is not in the pre-stored blacklist of not allowed registration, the network module can be registered and added to the whitelist of allowed registration.
- a switch port status configuration method receives a registration command sent by a network module, which may include:
- the switch can receive registration commands sent by each network module through the software interface, which facilitates the reception of registration commands and the expansion of network modules through this software interface, so that the switch port status configuration provided by the present application can be applicable to more network scenarios.
- the new network module when a new network module wants to participate in the switch port status configuration, the new network module can send a registration command to the switch through a software interface. Accordingly, the switch can receive the registration command sent by the new network module through the software interface, and register the new network module according to the registration command of the new network module.
- the new network module can be registered according to the registration command of the new network module and the whitelist of allowed registrations.
- the software interface can improve the convenience of a new network module sending a registration command to a switch, so as to facilitate the expansion of the network module.
- the embodiment of the present application provides a switch port status configuration method, according to the module priority of each network module
- the state configuration of the switch port by each network module and the preset switch port state determination rule may also include:
- the switch After the switch determines and configures the state of the switch port according to the module priority of each network module, the state configuration of the switch port by each network module, and the preset switch port state determination rule, it can determine whether the state of the configured switch port is abnormal, and can determine whether the state of the switch port is abnormal according to the operation status of the switch port and/or the operation status and/or operation log of the related equipment.
- an abnormal alarm can be issued, wherein the abnormal alarm can include the reason why the state of the switch port is abnormal, so that the relevant personnel can be informed of the abnormal state of the switch port in time, thereby saving the time of the relevant personnel to check the error, and allowing the relevant personnel to check and eliminate the abnormal situation according to the abnormal reason included in the abnormal alarm, thereby shortening the time of the relevant personnel to find and eliminate the abnormal reason.
- a switch port status configuration method provided by an embodiment of the present application, issuing an abnormal alarm may include:
- the alarm is issued by at least one of email alarm, SMS alarm, telephone alarm and alarm light alarm.
- the switch When the switch issues an abnormal alarm, it can issue an alarm through at least one of email alarm, SMS alarm, telephone alarm, and alarm light alarm, so that relevant personnel can promptly and effectively learn about the abnormality of the switch port status.
- a switch port status configuration method provided by an embodiment of the present application may further include, after obtaining the module priority of each network module corresponding to the switch port and the status configuration of each network module for the switch port:
- the switch After obtaining the module priority of each network module corresponding to the switch port and the status configuration of each network module to the switch port, the switch can query the module priority of each network module corresponding to the switch port and the status configuration of each network module to the switch port, and can display the module priority of each network module corresponding to the switch port and the status configuration of each network module to the switch port (which can be displayed on the human-computer interaction interface), so that relevant personnel can understand the module priority of each network module and the status configuration of the switch port, and it is convenient for relevant personnel to adjust the module priority of one or some network modules and/or the status configuration of the switch port according to the displayed module priority.
- a switch port status configuration method provided in an embodiment of the present application may further include: after determining and configuring the status of the switch port according to the module priority of each network module, the status configuration of the switch port by each network module, and the preset switch port status determination rule;
- the switch After the switch determines and configures the status of the switch port according to the module priority of each network module, the status configuration of the switch port by each network module and the preset switch port status determination rules, the switch can display the status of the switch port (which can be displayed on the human-computer interaction interface) so that relevant personnel can understand the current status of the switch port.
- the embodiment of the present application further provides a switch port status configuration device.
- a switch port status configuration device Referring to FIG. 9 , a schematic diagram of the structure of a switch port status configuration device provided by the embodiment of the present application is shown, which may include:
- a first acquisition module 91 is configured to acquire the module priority of each network module corresponding to the switch port and the state configuration of each network module for the switch port;
- the configuration module 92 is configured to determine and configure the state of the switch port according to the module priority of each network module, the state configuration of each network module for the switch port and the preset switch port state determination rule;
- the preset switch port status determination rule is to follow the order of module priority from high to low, and the same module
- the switch port status is determined in descending order according to the priority of the switch port status.
- the switch port status includes a network communication state and a network communication inability state.
- the priority of the network communication inability state is higher than the priority of the network communication state.
- the embodiment of the present application provides a switch port state configuration device, wherein the switch port state may further include a blocking state, and the priority of the blocking state is higher than the priority of the non-network communication state;
- the switch port can receive control messages sent by the network module.
- the second acquisition module is configured to obtain the update of the state configuration of the switch port by the first target network module in the network module after obtaining the state configuration of the switch port by each network module; wherein the update of the state configuration of the switch port by the first target network module occurs when the first target network module discovers the corresponding network state update.
- a first acquisition module 91 may include:
- the first acquisition unit is configured to acquire the state configuration of the switch port sent periodically by each network module.
- a first acquisition module 91 may include:
- the determining unit is configured to determine the module priority of each network module according to the communication information of the associated module corresponding to each network module.
- An embodiment of the present application provides a switch port status configuration device, wherein the determination unit may include:
- the dynamic update subunit is configured to dynamically update the module priority of each network module according to the communication information of the associated module corresponding to each network module.
- the first acquisition module 91 may further include:
- the first receiving unit is configured to receive an instruction sent by a user to update the module priority of the second target network module, and update the module priority of the second target network module according to the instruction.
- An embodiment of the present application provides a switch port status configuration device, wherein the configuration module 92 may include:
- a second acquisition unit is configured to acquire the state configuration of each network module with the highest module priority for the switch port;
- the configuration unit is configured to determine and configure the state of the switch port according to the state configuration of the switch port by each network module with the highest module priority and the rule of determining the switch port state in descending order of the priority of the switch port state in the same module priority.
- the registration module is configured to receive a registration command sent by the network module before obtaining the module priority of each network module corresponding to the switch port, and register the network module according to the registration command;
- the first judgment module is configured to judge whether each network module is a registered network module before determining and configuring the state of the switch port according to the module priority of each network module, the state configuration of each network module for the switch port and the preset switch port state determination rule;
- the removal module is configured to remove the unregistered network module if there is any unregistered network module.
- An embodiment of the present application provides a switch port status configuration device, wherein the registration module may include:
- a judging unit configured to judge whether the network module is in the white list of allowed registration according to the information of the network module contained in the registration command and the pre-stored white list of allowed registration;
- the registration unit is configured to register the network module if the network module is in a white list of allowed registrations.
- the registration module may further include:
- An embodiment of the present application provides a switch port status configuration device, wherein the registration module may include:
- the second receiving unit is configured to receive a registration command sent by each network module through a software interface.
- the registration module may further include:
- the third receiving unit is configured to receive a registration command sent by the new network module through the software interface, and register the new network module according to the registration command of the new network module.
- the second judgment module is configured to judge whether the state of the switch port is abnormal after determining and configuring the state of the switch port according to the module priority of each network module, the state configuration of the switch port by each network module and the preset switch port state determination rule;
- the alarm module is configured to issue an abnormal alarm if the status of the switch port is abnormal.
- An embodiment of the present application provides a switch port status configuration device, wherein the alarm issuing module may include:
- the alarm unit is configured to issue an alarm via at least one of email, SMS, telephone, and alarm light.
- the first display module is configured to display the module priority of each network module and the status configuration of each network module to the switch port after obtaining the module priority of each network module corresponding to the switch port and the status configuration of each network module to the switch port.
- the second display module is configured to display the status of the switch port after determining and configuring the status of the switch port according to the module priority of each network module, the status configuration of the switch port by each network module and the preset switch port status determination rule.
- the embodiment of the present application further provides a switch port status configuration device.
- a switch port status configuration device Referring to FIG. 10 , a schematic diagram of the structure of a switch port status configuration device provided by the embodiment of the present application is shown, which may include:
- a memory 101 is configured to store a computer program
- the processor 102 when configured to execute the computer program stored in the memory 101, can implement the following steps:
- the switch port determines and configure the state of the switch port according to the module priority of each network module, the state configuration of each network module to the switch port and the preset switch port state determination rule; wherein the preset switch port state determination rule is to determine the switch port state in the order of module priority from high to low, and in the same module priority in the order of switch port state priority from high to low, and the switch port state includes a network communication state and a non-network communication state, and the non-network communication state has a higher priority than the network communication state.
- the embodiment of the present application further provides a non-volatile readable storage medium, in which a computer program is stored.
- a computer program is stored.
- the following steps can be implemented:
- the switch port determines and configure the state of the switch port according to the module priority of each network module, the state configuration of each network module to the switch port and the preset switch port state determination rule; wherein the preset switch port state determination rule is to determine the switch port state in the order of module priority from high to low, and in the same module priority in the order of switch port state priority from high to low, and the switch port state includes a network communication state and a non-network communication state, and the non-network communication state has a higher priority than the network communication state.
- the non-volatile readable storage medium may include: a USB flash drive, a mobile hard disk, a read-only memory (ROM), a random access memory (RAM), a magnetic disk or an optical disk, and other media that can store program codes.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Small-Scale Networks (AREA)
Abstract
本申请涉及端口技术领域,公开了一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质,方法包括:获取与交换机端口对应的各网络模块的模块优先级及对交换机端口的状态配置;根据各网络模块的模块优先级、对交换机端口的状态配置及预设交换机端口状态确定规则确定并配置交换机端口的状态;预设规则为按照模块优先级由高到低的顺序、同一模块优先级中按照端口状态的优先级由高到低的顺序确定交换机端口状态。本申请公开的技术方案,根据网络模块的模块优先级、网络模块对交换机端口的状态配置及预设交换机端口状态确定规则配置交换机端口状态,避免各网络模块均对交换机端口状态进行操作更改,从而避免交换机端口状态出现错误,提高网络通信稳定性。
Description
相关申请的交叉引用
本申请要求于2023年04月06日提交中国专利局,申请号为202310356398.1,申请名称为“一种交换机端口状态配置方法、装置、设备及存储介质”的中国专利申请的优先权,其全部内容通过引用结合在本申请中。
本申请涉及端口技术领域,特别涉及一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质。
端口可以被设置为实现局域网内不同网络设备之间的通信以及连接不同局域网之间的网络流量。其中,端口状态表示了某个端口当前的物理连接状态,目前,端口状态分为up(开启)状态和down(关闭)状态,up状态表示端口处于开启状态并且正在工作,down状态表示端口关闭或没有连接任何设备。当端口处于up状态时,网络设备可以使用该端口进行网络通信,传输数据报文或接收数据报文,当端口处于down状态时,网络设备不能使用该端口进行网络通信。
目前,在多个网络模块对应同一交换机端口的情况下,这些网络模块均会操作、改变交换机端口的状态,而这可能会导致交换机端口状态发生错误,从而影响网络通信。
针对相关技术中,如何避免交换机端口状态发生错误,以提高网络通信的稳定性等问题,尚未提出有效的解决方案。
发明内容
有鉴于此,本申请的目的是提供一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质,用于避免交换机端口状态发生错误,以提高网络通信的稳定性。
为了实现上述目的,本申请提供如下技术方案:
根据第一方面,提供了一种交换机端口状态配置方法,包括:
获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置;
根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态;
其中,预设交换机端口状态确定规则为按照模块优先级由高到低的顺序、同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先级。
可选的,交换机端口状态还包括阻塞状态,阻塞状态的优先级高于不可网络通信状态的优先级;
在阻塞状态下,交换机端口可接收网络模块发送的控制报文。
可选的,在获取各网络模块对交换机端口的状态配置之后,还包括:
获取网络模块中的第一目标网络模块对交换机端口的状态配置的更新;其中,第一目标网络模块对交换机端口的状态配置的更新发生在第一目标网络模块发现相应的网络
状态更新时。
可选的,获取各网络模块对交换机端口的状态配置,包括:
获取各网络模块定时发送的对交换机端口的状态配置。
可选的,获取与交换机端口对应的各网络模块的模块优先级,包括:
获取与交换机端口对应的各网络模块利用各网络模块对应的关联模块确定的模块优先级。
可选的,在获取与交换机端口对应的各网络模块利用预设的优先级确定算法确定的模块优先级之后,还包括:
接收对各网络模块中的第二目标网络模块的模块优先级的更新。
可选的,接收对各网络模块中的第二目标网络模块的模块优先级的更新,包括:
接收用户发送的对第二目标网络模块的模块优先级的更新。
可选的,根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态,包括:
获取最高模块优先级的各网络模块对交换机端口的状态配置;
根据最高模块优先级的各网络模块对交换机端口的状态配置及同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态的规则,确定并配置交换机端口的状态。
可选的,在获取与交换机端口对应的各网络模块的模块优先级之前,还包括:
接收网络模块发送的注册命令,根据注册命令对网络模块进行注册;
在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之前,还包括:
判断各网络模块是否均为已注册的网络模块;
若存在未注册的网络模块,则剔除未注册的网络模块。
可选的,根据注册命令对网络模块进行注册,包括:
根据注册命令中包含的网络模块的信息以及预先存储的允许注册白名单,判断网络模块是否位于允许注册白名单中;
若网络模块位于允许注册白名单中,则对网络模块进行注册。
可选的,若网络模块不位于允许注册白名单中,则还包括:
拒绝对网络模块进行注册,并发出网络模块无权参与交换机端口状态配置的提示。
可选的,接收网络模块发送的注册命令,包括:
接收各网络模块通过软件接口发送的注册命令。
可选的,还包括:
接收新网络模块通过软件接口发送的注册命令,根据新网络模块的注册命令对新网络模块进行注册。
可选的,在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,还包括:
判断交换机端口的状态是否存在异常;
若交换机端口的状态存在异常,则发出异常告警。
可选的,发出异常告警,包括:
通过邮件告警、短信告警、电话告警、报警灯告警中的至少一种方式进行告警。
可选的,在获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置之后,还包括:
显示各网络模块对交换机端口的状态配置。
可选的,在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,还包括:
对交换机端口的状态进行显示。
根据第二方面,提供了一种交换机端口状态配置装置,包括:
第一获取模块,被设置为获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置;
配置模块,被设置为根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设端口交换机端口状态确定规则,确定并配置交换机端口的状态;
其中,预设交换机端口状态确定规则为按照模块优先级由高到低的顺序、同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先级。
根据第三方面,提供了一种交换机端口状态配置设备,包括:
存储器,被设置为存储计算机程序;
处理器,被设置为执行计算机程序时实现如上述任一项的交换机端口状态配置方法的步骤。
根据第四方面,提供了一种非易失性可读存储介质,非易失性可读存储介质中存储有计算机程序,计算机程序被处理器执行时实现如上述任一项的交换机端口状态配置方法的步骤。
本申请提供了一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质,其中,该方法包括:获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置;根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态;其中,预设交换机端口状态确定规则为按照模块优先级由高到低的顺序、同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先级。
本申请公开的上述技术方案,为与交换机端口相连的各网络模块配置优先级,在进行交换机端口状态配置时交换机根据与交换机端口对应的各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设的按照模块优先级由高到低的顺序、同一模块优先级中按照交换机端口状态的优先级由高到低的顺序(交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先级)确定交换机端口状态的规则来最终确定并配置交换机端口的状态,以避免各网络模块均对交换机端口的状态进行操作更改,从而排除不确定性错误的风险,避免交换机端口状态出现错误,提高网络通信的稳定性。
为了更清楚地说明本申请实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作简单地介绍,显而易见地,下面描述中的附图仅仅是本申请的实施例,对于本领域普通技术人员来讲,在不付出创造性劳动的前提下,还可以根据提供的附图获得其他的附图。
图1为现有的网络模块对交换机端口的状态进行操作的示意图;
图2为本申请实施例提供的一种交换机端口状态配置方法的流程图;
图3为本申请实施例提供的交换机与交换机端口的连接示意图;
图4为本申请实施例提供的MAC地址漂移的示例图;
图5为本申请实施例提供的一种Monitor Link端口联动模块的组成示意图;
图6为本申请实施例提供的交换机端口状态配置方法的一种网络架构图;
图7为本申请实施例提供的关联模块与交换机连接示意图;
图8为本申请实施例提供的各网络模块进行注册的示意图;
图9为本申请实施例提供的一种交换机端口状态配置装置的结构示意图;
图10为本申请实施例提供的一种交换机端口状态配置设备的结构示意图。
目前,当MAC(Media Access Control Address,媒体访问控制地址)地址漂移、Monitor Link(监控链路)等多个网络模块对应同一交换机端口的情况下,这些网络模块均会操作、改变交换机端口的状态,而这可能会导致交换机端口状态发生错误。如图1所示,其示出了现有的网络模块对交换机端口的状态进行操作的示意图,假设网络模块A和网络模块B均对应交换机端口1,且网络模块A和网络模块B对交换机端口1状态的操作过程为:1、网络模块A判定其对应的网络环境出现错误,则将交换机端口1的状态更改为down状态,以避免交换机端口1参与网络通信;2、网络模块B根据其对应的网络环境判定交换机端口1状态为up状态并将交换机端口1的状态更改为up状态,而将交换机端口1的状态更改为up状态后交换机端口1会重新参与网络通信,而这即会使得网络出现的错误依旧存在,从而影响网络通信。在上述过程中,网络模块A可能会间隔一定时间区间后再把交换机端口1的状态设置成down状态,但上述过程已使得一定时间区间内交换机端口1的状态是错误的,造成不确定性的错误风险,影响网络通信,而且上述过程可能会一直循环执行,从而导致交换机端口状态频繁出错。
为此,本申请提供一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质,用于避免交换机端口状态发生错误,以提高网络通信的稳定性。
下面将结合本申请实施例中的附图,对本申请实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例仅仅是本申请一部分实施例,而不是全部的实施例。基于本申请中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本申请保护的范围。
参见图2和图3,其中,图2示出了本申请实施例提供的一种交换机端口状态配置方法的流程图,图3示出了本申请实施例提供的交换机与交换机端口的连接示意图,本申请实施例提供的一种交换机端口状态配置方法,可以包括:
S11:获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置。
本申请所提供的交换机端口状态配置方法可以应用于交换机,可以应用于交换机软件平台SONiC(Software for Open Networking in the Cloud,网络交换机作业系统),当然,也可以应用于其他设备中,只要可以获取与交换机端口对应的各网络模块进行通信而获取各网络模块的相关信息即可,本申请以应用于交换机为例进行说明。
其中,交换机中可设置有仲裁机制,可由仲裁机制实现本申请所提供的交换机端口配置方法。交换机可以对应有多个交换机端口,每个交换机端口可以对应的有多个网络
模块,各交换机端口均按照本申请所提供的交换机端口状态配置方法进行交换机端口状态配置。
在本申请中,与交换机端口对应的各网络模块指的是与该交换机端口对应且能够对该交换机端口的状态进行操作配置的模块,例如:网络模块可以包括MAC地址漂移模块、Monitor Link端口联动模块。MAC地址漂移指的是在同一个VLAN(Virtual Local Area Network,虚拟局域网)内,一个MAC地址有两个出端口,并且后学习到的出端口覆盖原出端口的现象。如图4所示,其示出了MAC地址漂移的示例图,设备A-设备D在同一个VLAN中,经过设备A的报文会通过端口a进入设备B,从端口c转发至设备D,设备B的MAC地址表项学习到的端口是端口a。但当设备B、设备C和设备D之间存在环路的时候,报文通过设备D至设备C后,又会透过端口b进入设备B,此时会导致设备B中的MAC地址表项更新成端口b,此现象称之为MAC地址漂移。为了避免MAC地址漂移,MAC地址漂移模块会将设备上发生MAC地址漂移的端口状态设置成down(即不可网络通信状态),也即MAC地址漂移模块会根据是否发生MAC地址漂移而对相应交换机端口的状态进行操作。Monitor Link端口联动模块是通过监控设备的上行端口,根据其“up(即可网络通信状态)/down”状态的变化来触发下行端口“up/down”状态的变化。如图5所示,其示出了一种Monitor Link端口联动模块的组成示意图,设备B和设备D各自的端口分别组成了一个Monitor Link组,其中一个为上行端口,一个为下行端口。上行端口是Monitor Link组中被监控的端口。当Monitor Link组中没有上行端口或者所有上行端口的状态都是不可网络通信状态时,Monitor Link组就处于不可网络通信状态,而只要有一个上行端口的状态是可网络通信状态,Monitor Link组就处于可网络通信状态。下行端口是Monitor Link组中的监控端口。当Monitor Link组可网络通信状态/不可网络通信状态发生改变时,下行端口的状态就会发生相应的改变。
在本申请中,与交换机端口对应的各网络模块均配置有模块优先级。例如:可以根据各网络模块的重要程度等、各网络模块的当前状态等进行模块优先级的配置。其中,可以预先定义至少两种模块优先级,可选的,可以预先定义两种模块优先级,即等级0和等级1,且等级0的模块优先级高于等级1的模块优先级。当然,也可以根据实际需要而定义更多的模块优先级。另外,各网络模块的模块优先级可以定义在配置档案中,以使得交换机可以从配置档案中获取网络模块的模块优先级,若各网络模块的模块优先级无定义,则交换机可以给予一个预设模块优先级,例如预设模块优先级可以为等级0。
交换机在对当前的交换机端口进行状态配置时,可以获取与该交换机端口对应的各网络模块的模块优先级,例如网络模块A的模块优先级为等级0、网络模块B的模块优先级为等级0、网络模块C的模块优先级为0、网络模块D的模块优先级为等级0、网络模块E的模块优先级为1……,等级0高于等级1。另外,交换机还可以获取与该交换机端口对应的各网络模块对该交换机端口的状态配置,以便于交换机综合与该交换机端口对应的各网络模块的模块优先级和对该交换机端口的状态配置而决策并配置该交换机端口的状态。
S12:根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态;其中,预设交换机端口状态确定规则为按照模块优先级由高到低的顺序、同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先级。
在步骤S11的基础上,交换机可以根据获取到的各网络模块的模块优先级、各网络
模块对交换机端口的状态配置及预设交换机端口状态确定规则最终确定交换机端口的状态,并根据最终确定的交换机端口的状态配置交换机端口的状态。可选的,若最终确定交换机端口的状态为不可网络通信状态,则将交换机端口的状态最终配置为不可网络通信状态;若最终确定交换机端口的状态为可网络通信状态,则将交换机端口的状态最终配置为不可网络通信状态。
其中,预设交换机端口状态确定规则为按照模块优先级由高到低的顺序、在同一模块优先级下按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,且交换机端口状态可以包括可网络通信状态及不可网络通信状态,不可网络通信状态高于可网络通信状态。也即,优先考虑最高模块优先级的网络模块对交换机端口的状态配置,以避免其余模块优先级的网络模块影响最高模块优先级的网络模块对交换机端口的状态配置,从而避免交换机端口状态出现错误。并且,根据预设交换机端口状态确定规则可知,在同一模块优先级中,任一个网络模块对交换机端口的状态配置为不可通信网络状态时,则确定该模块优先级对应的交换机端口状态为不可通信网络状态;在同一模块优先级中,所有网络模块对交换机端口的状态配置均为可通信网络状态时,则确定该模块优先级对应的交换机端口状态为可通信通络状态。通过使不可通信网络状态的优先级高于可通信网络状态的优先级可以实现在同一模块优先级下只要有一个网络模块将交换机端口的状态配置为不可通信网络状态,则交换机端口状态即为不可通信网络状态,以避免继续利用该交换机端口进行网络通信而传输或接收数据报文,从而避免交换机端口状态出现错误。
通过上述可知,本申请不再是由与交换机端口对应的各个网络模块直接对交换机端口进行操作配置,而是交换机综合与交换机端口对应的各网络模块的优先级以及各网络模块对交换机端口的状态配置而最终仲裁确定出交换机端口的状态,并根据最终仲裁确定出的交换机端口的状态配置交换机端口的状态,以避免交换机端口状态会有概率性发生错误的风险,提高网络传输的稳定性。并且,通过上述可知,本申请的交换机端口状态配置方法并不需要额外升级网络基础设备,不用受限于设备能力的影响。
需要说明的是,本申请所提供的交换机端口状态配置方法在应用于交换机中时,可以应用于每台交换机中,也即每台交换机均可以按照本申请所提供的方法进行交换机端口状态配置。交换机网络是一种计算机网络,其中交换机被用作网络中终端设备之间数据传输的中转站。在这种网络中,计算机、服务器、路由器和其他网络设备都被连接到交换机上,以便它们可以互相通信。当一个设备需要向另一个设备发送数据时,数据会从发送设备传输到同一个交换机的接收设备,而不会影响到其他设备。但是,随着追求更快以及更大容量的网络服务,网络拓扑规模越来越大,产出许多不同的网络服务,必然会衍生出许多问题。例如如图6所示,其示出了本申请实施例提供的交换机端口状态配置方法的一种网络架构图,图6中中间相互连接为交换机,图6中的网络架构中有环路的发生,此时,若配置人员通过命令行将端口配置改变,这时端口的状态就会发生错误,而交换机应用本申请所提供的交换机端口状态配置方法进行交换机端口配置时可解决端口配置错误的问题。
本申请公开的上述技术方案,为与交换机端口相连的各网络模块配置优先级,在进行交换机端口状态配置时交换机根据与交换机端口对应的各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设的按照模块优先级由高到低的顺序、同一模块优先级中按照交换机端口状态的优先级由高到低的顺序(交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先
级)确定交换机端口状态的规则来最终确定并配置交换机端口的状态,以避免各网络模块均对交换机端口的状态进行操作更改,从而排除不确定性错误的风险,避免交换机端口状态出现错误,提高网络通信的稳定性。
本申请实施例提供的一种交换机端口状态配置方法,交换机端口状态还可以包括阻塞状态,阻塞状态的优先级高于不可网络通信状态的优先级;
在阻塞状态下,交换机端口可接收网络模块发送的控制报文。
在本申请中,交换机端口状态还可以包括阻塞状态(blocking),阻塞状态的优先级高于不可网络通信状态的优先级,即在同一模块优先级下任一网络模块将交换机端口状态配置成阻塞状态时,则确定该交换机端口的状态即为阻塞状态。也即是说,在同一模块优先级下,所有网络模块配置此交换机端口状态为可通信网络状态时,此交换机端口的状态为可通信网络状态;在同一模块优先级下,任一网络模块配置此交换机端口状态为不可通信网络状态且无网络模块配置此交换机端口状态为阻塞状态时,此交换机端口的状态为不可通信网络状态;在同一模块优先级下,任一网络模块配置此交换机端口状态为阻塞状态时,此交换机端口的状态为阻塞状态。可以参见表1,其示出了同一模块优先级下确定交换机端口状态的规则表,其中,表1以同一模块优先级下包含有网络模块A-D为例进行说明。
表1同一模块优先级下确定交换机端口状态的规则表
并且,当交换机端口在阻塞状态下时交换机端口可以接收网络模块发送的控制报文。控制报文可以为当某一网络模块发现网络异常解除时给交换机端口发送的报文,即在此情况下控制报文的发送可表明网络异常已解除。通过前述内容可知,当交换机端口状态是阻塞状态时,交换机端口不会完全关闭,而是可以接收控制报文。
通过为交换机端口设置阻塞状态且让阻塞状态的优先级高于不可通信网络状态的优先级可以在网络异常排除时或者某些特殊情形时快速地将交换机端口状态恢复成可通信网络状态。
本申请实施例提供的一种交换机端口状态配置方法,在获取各网络模块对交换机端口的状态配置之后,还可以包括:
获取网络模块中的第一目标网络模块对交换机端口的状态配置的更新;其中,第一目标网络模块对交换机端口的状态配置的更新发生在第一目标网络模块发现相应的网络状态更新时。
在本申请中,与交换机端口对应的各网络模块可以实时监测对应的网络状态是否发生更新,当监测到网络状态发生更新时可以对交换机端口的状态配置进行更新,并可以将对交换机端口的状态配置的更新发送至交换机,例如MAC地址漂移模块若检测到其对应的网络状态从存在环路变为不存在环路,则可以将对应的交换机端口状态从不可网络通信状态变为可网络通信状态。相应地,交换机可以获取与交换机端口对应的各网络模块中的第一目标网络模块(第一目标网络模块即为与交换机端口对应的各网络模块中交换机端口的状态配置发生更新的网络模块)对交换机端口的状态配置的更新。然后,可
以根据与交换机端口对应的各网络模块中的第一目标网络模块对交换机端口的状态配置的更新、其余各网络模块对交换机端口的状态配置、各网络模块的模块优先级及预设交换机端口状态规则,确定并配置交换机端口的状态,以使得第一目标网络模块对交换机端口的状态配置的更新可以参与到交换机端口状态的确定和配置中,从而便于提高交换机端口状态配置的准确性和及时性,避免交换机端口状态出现错误。
需要说明的是,获取网络模块中的第一目标网络模块对交换机端口的状态配置的更新可以发生在步骤S12之前,也可以发生在步骤S12之后。当发生在步骤S12之前时,则步骤S12即为根据与交换机端口对应的各网络模块中的第一目标网络模块对交换机端口的状态配置的更新、其余各网络模块对交换机端口的状态配置、各网络模块的模块优先级及预设交换机端口状态确定规则,确定并配置交换机端口的状态。当发生在步骤S12之后,则在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,还可以包括:获取网络模块中的第一目标网络模块对交换机端口的状态配置的更新;根据与交换机端口对应的各网络模块中的第一目标网络模块对交换机端口的状态配置的更新、其余各网络模块对交换机端口的状态配置、各网络模块的模块优先级及预设交换机端口状态确定规则,确定并配置交换机端口的状态,以重新确定并配置交换机端口的状态,及时且有效地避免交换机端口状态出现错误。
本申请实施例提供的一种交换机端口状态配置方法,获取各网络模块对交换机端口的状态配置,可以包括:
获取各网络模块定时发送的对交换机端口的状态配置。
在本申请中,与交换机端口对应的各网络模块可以定时地发送对交换机端口的状态配置,其中,各网络模块上一次发送的对交换机端口的状态配置可以与此次发送的对交换机端口的状态配置相同或不同,可以根据网络模块对应的网络状态确定对交换机端口的状态配置。
相应的,交换机可以获取各网络模块定时发送的对交换机端口的状态配置,以便于根据各网络模块定时发送的对交换机端口的状态配置来参与交换机端口状态的最终确定和配置,从而便于提高交换机端口状态配置的准确性。
本申请实施例提供的一种交换机端口状态配置方法,获取与交换机端口对应的各网络模块的模块优先级,可以包括:
根据与各网络模块对应的关联模块的通信信息确定各网络模块的模块优先级。
在本申请中,交换机可以和各网络模块对应的关联模块进行通信,根据与各网络模块对应的关联模块的通信信息确定各网络模块的模块优先级,也即可以根据各网络模块对应的关联模块确定各网络模块的模块优先级。其中,关联模块为交换机中与网络模块彼此相互影响、有关联性的模块,各网络模块可以分别对应自己的关联模块,或者多个网络模块可以对应一个关联模块。
以MAC地址漂移模块对应的关联模块为BGP(Border Gateway Protocol,边界网关协议)模块为例,可以参见图7,示出了本申请实施例提供的关联模块与交换机连接示意图,BGP是一种用于互联网路由器之间的协议,它用于交换路由信息,当路由器之间交换的路由信息发生变化时,可能会导致路由器之间出现不稳定的情况,导致路由器不断地更新路由信息,不断来回的更新,会导致俗称的BGP震荡现象。而当BGP路由发生变化时,可能会导致网络流量从一个网络路径切换到另一个网络路径,从而导致地址漂移的现象。例如,当一个路由器无法访问到某个网络时,它可能会向其他路由器发生BGP更
新信息,通知其流量需要通过其它路径进行转发。这样,从原本经过该路由器的流量就会发生地址漂移,因为其目的地的网络地址发生了改变。本申请中,BGP模块可与交换机进行沟通,BGP模块可以告知交换机在一定的时间内会发生震荡,因此,交换机可以将MAC地址漂移的模块优先级确定为等级1,实际上代表着MAC地址漂移不会影响交换机端口的配置。
通过与网络模块对应的关联模块进行通信而根据通信信息确定各网络模块的模块优先级可以便于提高各网络模块的模块优先级确定的合理性,以便提高交换机端口状态配置的合理性和准确性,避免端口状态发生错误。
本申请实施例提供的一种交换机端口状态配置方法,根据与各网络模块对应的关联模块的通信信息确定各网络模块的模块优先级,可以包括:
根据与各网络模块对应的关联模块的通信信息对各网络模块的模块优先级进行动态更新。
在本申请中,交换机可以和各网络模块对应的关联模块进行通信,根据与各网络模块对应的关联模块的通信信息而对各网络模块的模块优先级进行动态更新,也即交换机可通过与网络模块对应的关联模块的通信而动态地更新各个网络模块的优先级,例如,交换机可在一段时间内将某个网络模块的优先级调整至等级1,当时间到时候后将其恢复成等级0。
以上述提及的MAC地址漂移和其对应的关联模块为BGP模块为例,也即当网络模块中包括MAC地址模块,MAC地址模块对应的关联模块为BGP模块时,当BGP模块确定会在一定时间内发生震荡时,则BGP模块可以告知交换机在一定时间内会发生震荡,也即BGP模块可以将震荡时间段发送至交换机,交换机接收到BGP模块发送的震荡时间段后,会在震荡时间段内将MAC地址漂移的模块优先级调整至等级1,实际上代表着MAC地址漂移在这段时间中将不会影响交换机端口的配置,在震荡时间段外将MAC地址漂移的模块优先级调整至等级0,以使得该网络模块可以参与交换机端口的配置。
通过上述对网络模块的模块优先级的动态更新可避免交换机针对交换机端口状态不必要的配置,不仅可避免交换机端口状态发生错误,还可以降低交换机的运算成本。
本申请实施例提供的一种交换机端口状态配置方法,在根据与各网络模块对应的关联模块的通信信息确定各网络模块的模块优先级之后,还可以包括:
接收用户发送的对第二目标网络模块的模块优先级进行更新的指令,根据指令对第二目标网络模块的模块优先级进行更新。
在本申请中,交换机在根据与各网络模块对应的关联模块的通信信息确定各网络模块的模块优先级之后,可以对各网络模块的模块优先级进行显示,以使得用户可以获取各网络模块的模块优先级,并可以根据实际需求而对某个或某些网络模块的模块优先级进行更新。当用户要对网络模块的模块优先级进行更新时,则可以向交换机发送对第二目标网络模块(第二目标网络模块即为要进行模块优先级更新的网络模块)的模块优先级进行更新的指令。相应地,交换机可以接收用户发送的对第二目标网络模块的模块优先级进行更新的指令,并根据指令对第二目标网络模块的模块优先级进行更新,例如可以将某网络模块的模块优先级从等级0更改为等级1,或者将某网络模块的模块优先级从等级1更改为等级0,以使得第二目标网络模块可以以最新的模块优先级参与交换机端口状态配置,从而提高用户体验度。
本申请实施例提供的一种交换机端口状态配置方法,根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置
交换机端口的状态,可以包括:
获取最高模块优先级的各网络模块对交换机端口的状态配置;
根据最高模块优先级的各网络模块对交换机端口的状态配置及同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态的规则,确定并配置交换机端口的状态。
在本申请中,考虑到预设交换机端口状态确定规则中包含有按照模块优先级由高到低的顺序确定交换机端口状态的规则,因此,在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态时,可以直接获取最高模块优先级的各网络模块对交换机端口的状态配置,并直接根据最高模块优先级的各网络模块对交换机端口的状态配置以及预设交换机端口状态确定规则中所包含的同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态的规则来最终确定并配置交换机端口的状态,以降低交换机端口最终状态确定的复杂性,并提高交换机端口状态配置效率。
当然,也可以获取各模块优先级对应的各网络模块对交换机端口的状态配置,根据每个模块优先级对应的各网络模块对交换机端口的状态配置及同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态的规则确定各模块优先级对应的交换机端口状态,从各模块优先级对应的交换机端口状态中获取最高模块优先级对应的交换机端口状态,并利用最高模块优先级对应的交换机端口状态配置交换机端口的状态。
参见图8,其示出了本申请实施例提供的各网络模块进行注册的示意图,本申请实施例提供的一种交换机端口状态配置方法,在获取与交换机端口对应的各网络模块的模块优先级之前,还可以包括:
接收网络模块发送的注册命令,根据注册命令对网络模块进行注册;
在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之前,还可以包括:
判断各网络模块是否均为已注册的网络模块;
若存在未注册的网络模块,则剔除未注册的网络模块。
在本申请中,与交换机端口对应的各网络模块可以预先注册在交换机中,以使得在交换机端口状态配置时只有已注册的网络模块才有权限参与交换机端口状态的配置,从而便于提高交换机端口状态配置的准确性,避免交换机端口状态发生错误。
可选的,交换机在获取与交换机端口对应的各网络模块的模块优先级之前,还可以接收网络模块发送的注册命令,其中,注册命令中可以包含有网络模块的信息,如网络模块的名称、网络模块所包含的设备、网络模块的功能等。然后,交换机可以根据注册命令对网络模块进行注册。并且,交换机在获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置之后,在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之前,可以判断各网络模块是否均为已注册的网络模块,若与交换机端口对应的各网络模块中存在未注册的网络模块,则剔除未注册的网络模块,根据已注册的网络模块的模块优先级、已注册的对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态,以避免未注册的网络模块参与交换机端口状态配置而使得交换机端口状态出现错误。
本申请实施例提供的一种交换机端口状态配置方法,根据注册命令对网络模块进行
注册,可以包括:
根据注册命令中包含的网络模块的信息以及预先存储的允许注册白名单,判断网络模块是否位于允许注册白名单中;
若网络模块位于允许注册白名单中,则对网络模块进行注册。
在本申请中,在根据注册命令对网络模块进行注册时,可以根据注册命令中包含的网络模块的信息以及预先存储的允许注册白名单,判断网络模块是否位于允许注册白名单中。其中,允许注册白名单中包含有允许注册的网络模块的信息,且允许注册白名单可以由用户进行设置等。
若网络模块位于允许注册白名单中,则可以对网络模块进行注册,以提高网络模块注册的合理性和准确性,从而便于提高交换机端口状态配置的准确性。
本申请实施例提供的一种交换机端口状态配置方法,若网络模块不位于允许注册白名单中,则还可以包括:
拒绝对网络模块进行注册,并发出网络模块无权参与交换机端口配置的提示。
在本申请中,在根据注册命令中包含的网络模块的信息以及预先存储的允许注册白名单,判断网络模块是否位于允许注册白名单中,若网络模块不位于允许注册白名单中,则不仅可以拒绝对网络模块的注册,而且可以发出网络模块未注册的提示,以使得这些网络模块无法参与交换机端口状态的配置,并使得用户可以根据提示进行查询和采取应对措施,如删除这些网络模块或根据这些网络模块的情况而将其加入到允许注册白名单中等。
当然,也可以预先存储允许注册白名单和不允许注册黑名单,其中,不允许注册黑名单中包含有不允许注册的网络模块的信息,若网络模块不位于允许注册白名单中,拒绝对网络模块进行注册,并发出网络模块无权参与交换机端口配置的提示后,还可以判断网络模块是否位于预先存储的不允许注册黑名单中,若网络模块不位于预先存储的不允许注册黑名单中,则可以对网络模块进行注册,并将该网络模块添加到允许注册白名单中,若网络模块位于预先存储的不允许注册黑名单中,则继续拒绝对网络模块进行注册,并发出网络模块位于不允许注册黑名单中,无权参与交换机端口状态配置的提示。本申请实施例提供的一种交换机端口状态配置方法,接收网络模块发送的注册命令,可以包括:
接收各网络模块通过软件接口发送的注册命令。
在本申请中,交换机可以接收各网络模块通过软件接口发送的注册命令,通过软件接口便于进行注册命令的接收,且便于透过此软件接口进行网络模块的扩充等,从而使得本申请所提供的交换机端口状态配置可以适用于更多的网络场景。
本申请实施例提供的一种交换机端口状态配置方法,还可以包括:
接收新网络模块通过软件接口发送的注册命令,根据新网络模块的注册命令对新网络模块进行注册。
在本申请中,当有新网络模块想要参与交换机端口状态配置时,则新网络模块可以通过软件接口向交换机发送注册命令。相应地,交换机可以接收新网络模块通过软件接口发送的注册命令,并根据新网络模块的注册命令对新网络模块进行注册。可选的,可以根据新网络模块的注册命令以及允许注册白名单来对新网络模块进行注册。
通过软件接口可以提高新网络模块向交换机发送注册命令的便利性,以便于进行网络模块的扩充。
本申请实施例提供的一种交换机端口状态配置方法,在根据各网络模块的模块优先
级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,还可以包括:
判断交换机端口的状态是否存在异常;
若交换机端口的状态存在异常,则发出异常告警。
交换机在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,可以判断所配置的交换机端口的状态是否异常,可以根据交换机端口运行情况和/或相关设备的运行情况和/或运行日志判断交换机端口的状态是否异常等。如果确定交换机端口的状态存在异常,则可以发出异常告警,其中,异常告警中可以包含有交换机端口状态存在异常的原因,以使得相关人员可以及时获知交换机端口的状态存在异常,从而节省相关人员检查错误的时间,并使得相关人员可以根据异常告警中所包含的异常原因进行异常情况的检查和排除,从而缩短相关人员查找和排除异常原因的时间。
本申请实施例提供的一种交换机端口状态配置方法,发出异常告警,可以包括:
通过邮件告警、短信告警、电话告警、报警灯告警中的至少一种方式进行告警。
交换机在发出异常告警时,可以通过邮件告警、短信告警、电话告警、报警灯告警中的至少一种方式进行告警,以使得相关人员可以及时、有效地获知交换机端口状态存在异常的消息。
本申请实施例提供的一种交换机端口状态配置方法,在获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置之后,还可以包括:
显示各网络模块的模块优先级及各网络模块对交换机端口的状态配置。
交换机在获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置之后,可以查询与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置,并可以显示与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置(可以在人机交互界面上进行显示),以使得相关人员可以了解获取各网络模块的模块优先级及对交换机端口的状态配置情况,并便于相关人员根据所显示的模块优先级来对某个或某些网络模块的模块优先级和/或对交换机端口的状态配置进行调整等。
本申请实施例提供的一种交换机端口状态配置方法,在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,还可以包括:
对交换机端口的状态进行显示。
交换机在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,可以对交换机端口的状态进行显示(可以在人机交互界面上进行显示),以使得相关人员可以了解获取交换机端口的当前状态。
本申请实施例还提供了一种交换机端口状态配置装置,参见图9,其示出了本申请实施例提供的一种交换机端口状态配置装置的结构示意图,可以包括:
第一获取模块91,被设置为获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置;
配置模块92,被设置为根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态;
其中,预设交换机端口状态确定规则为按照模块优先级由高到低的顺序、同一模块
优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先级。
本申请实施例提供的一种交换机端口状态配置装置,交换机端口状态还可以包括阻塞状态,阻塞状态的优先级高于不可网络通信状态的优先级;
在阻塞状态下,交换机端口可接收网络模块发送的控制报文。
本申请实施例提供的一种交换机端口状态配置装置,还可以包括:
第二获取模块,被设置为在获取各网络模块对交换机端口的状态配置之后,获取网络模块中的第一目标网络模块对交换机端口的状态配置的更新;其中,第一目标网络模块对交换机端口的状态配置的更新发生在第一目标网络模块发现相应的网络状态更新时。
本申请实施例提供的一种交换机端口状态配置装置,第一获取模块91可以包括:
第一获取单元,被设置为获取各网络模块定时发送的对交换机端口的状态配置。
本申请实施例提供的一种交换机端口状态配置装置,第一获取模块91可以包括:
确定单元,被设置为根据与各网络模块对应的关联模块的通信信息确定各网络模块的模块优先级。
本申请实施例提供的一种交换机端口状态配置装置,确定单元可以包括:
动态更新子单元,被设置为根据与各网络模块对应的关联模块的通信信息对各网络模块的模块优先级进行动态更新。
本申请实施例提供的一种交换机端口状态配置装置,第一获取模块91还可以包括:
第一接收单元,被设置为接收用户发送的对第二目标网络模块的模块优先级进行更新的指令,根据指令对第二目标网络模块的模块优先级进行更新。
本申请实施例提供的一种交换机端口状态配置装置,配置模块92可以包括:
第二获取单元,被设置为获取最高模块优先级的各网络模块对交换机端口的状态配置;
配置单元,被设置为根据最高模块优先级的各网络模块对交换机端口的状态配置及同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态的规则,确定并配置交换机端口的状态。
本申请实施例提供的一种交换机端口状态配置装置,还可以包括:
注册模块,被设置为在获取与交换机端口对应的各网络模块的模块优先级之前,接收网络模块发送的注册命令,根据注册命令对网络模块进行注册;
第一判断模块,被设置为在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之前,判断各网络模块是否均为已注册的网络模块;
剔除模块,被设置为若存在未注册的网络模块,则剔除未注册的网络模块。
本申请实施例提供的一种交换机端口状态配置装置,注册模块可以包括:
判断单元,被设置为根据注册命令中包含的网络模块的信息以及预先存储的允许注册白名单,判断网络模块是否位于允许注册白名单中;
注册单元,被设置为若网络模块位于允许注册白名单中,则对网络模块进行注册。
本申请实施例提供的一种交换机端口状态配置装置,注册模块还可以包括:
拒绝注册单元,被设置为若网络模块不位于允许注册白名单中,则拒绝对网络模块进行注册,并发出网络模块无权参与交换机端口配置的提示。
本申请实施例提供的一种交换机端口状态配置装置,注册模块可以包括:
第二接收单元,被设置为接收各网络模块通过软件接口发送的注册命令。
本申请实施例提供的一种交换机端口状态配置装置,注册模块还可以包括:
第三接收单元,被设置为接收新网络模块通过软件接口发送的注册命令,根据新网络模块的注册命令对新网络模块进行注册。
本申请实施例提供的一种交换机端口状态配置装置,还可以包括:
第二判断模块,被设置为在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,判断交换机端口的状态是否存在异常;
发出告警模块,被设置为若交换机端口的状态存在异常,则发出异常告警。
本申请实施例提供的一种交换机端口状态配置装置,发出告警模块可以包括:
发出告警单元,被设置为通过邮件告警、短信告警、电话告警、报警灯告警中的至少一种方式进行告警。
本申请实施例提供的一种交换机端口状态配置装置,还可以包括:
第一显示模块,被设置为在获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置之后,显示各网络模块的模块优先级及各网络模块对交换机端口的状态配置。
本申请实施例提供的一种交换机端口状态配置装置,还可以包括:
第二显示模块,被设置为在根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态之后,对交换机端口的状态进行显示。
本申请实施例还提供了一种交换机端口状态配置设备,参见图10,其示出了本申请实施例提供的一种交换机端口状态配置设备的结构示意图,可以包括:
存储器101,被设置为存储计算机程序;
处理器102,被设置为执行存储器101存储的计算机程序时可实现如下步骤:
获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置;根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态;其中,预设交换机端口状态确定规则为按照模块优先级由高到低的顺序、同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先级。。
本申请实施例还提供了一种非易失性可读存储介质,非易失性可读存储介质中存储有计算机程序,计算机程序被处理器执行时可实现如下步骤:
获取与交换机端口对应的各网络模块的模块优先级及各网络模块对交换机端口的状态配置;根据各网络模块的模块优先级、各网络模块对交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置交换机端口的状态;其中,预设交换机端口状态确定规则为按照模块优先级由高到低的顺序、同一模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,交换机端口状态包括可网络通信状态及不可网络通信状态,不可网络通信状态的优先级高于可网络通信状态的优先级。。
该非易失性可读存储介质可以包括:U盘、移动硬盘、只读存储器(Read-Only Memory,ROM)、随机存取存储器(Random Access Memory,RAM)、磁碟或者光盘等各种可以存储程序代码的介质。
本申请提供的一种交换机端口状态配置装置、设备及非易失性可读存储介质中相关部分的说明可以参见本申请实施例提供的一种交换机端口状态配置方法中对应部分的详细说明,在此不再赘述。
需要说明的是,在本文中,诸如第一和第二等之类的关系术语仅仅用来将一个实体或者操作与另一个实体或操作区分开来,而不一定要求或者暗示这些实体或操作之间存在任何这种实际的关系或者顺序。而且,术语“包括”、“包含”或者其任何其他变体意在涵盖非排他性的包含,从而使得包括一系列要素的过程、方法、物品或者设备所固有的要素。在没有更多限制的情况下,由语句“包括一个……”限定的要素,并不排除在包括要素的过程、方法、物品或者设备中还存在另外的相同要素。另外,本申请实施例提供的上述技术方案中与现有技术中对应技术方案实现原理一致的部分并未详细说明,以免过多赘述。
对所公开的实施例的上述说明,使本领域技术人员能够实现或使用本申请。对这些实施例的多种修改对本领域技术人员来说将是显而易见的,本文中所定义的一般原理可以在不脱离本申请的精神或范围的情况下,在其它实施例中实现。因此,本申请将不会被限制于本文所示的这些实施例,而是要符合与本文所公开的原理和新颖特点相一致的最宽的范围。
Claims (20)
- 一种交换机端口状态配置方法,其特征在于,包括:获取与交换机端口对应的各网络模块的模块优先级及各所述网络模块对所述交换机端口的状态配置;根据各所述网络模块的模块优先级、各所述网络模块对所述交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置所述交换机端口的状态;其中,所述预设交换机端口状态确定规则为按照所述模块优先级由高到低的顺序、同一所述模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,所述交换机端口状态包括可网络通信状态及不可网络通信状态,所述不可网络通信状态的优先级高于所述可网络通信状态的优先级。
- 根据权利要求1所述的交换机端口状态配置方法,其特征在于,所述交换机端口状态还包括阻塞状态,所述阻塞状态的优先级高于所述不可网络通信状态的优先级;在所述阻塞状态下,所述交换机端口可接收所述网络模块发送的控制报文。
- 根据权利要求2所述的交换机端口状态配置方法,其特征在于,在获取各所述网络模块对所述交换机端口的状态配置之后,还包括:获取所述网络模块中的第一目标网络模块对所述交换机端口的状态配置的更新;其中,所述第一目标网络模块对所述交换机端口的状态配置的更新发生在所述第一目标网络模块发现相应的网络状态更新时。
- 根据权利要求2所述的交换机端口状态配置方法,其特征在于,获取各所述网络模块对所述交换机端口的状态配置,包括:获取各所述网络模块定时发送的对所述交换机端口的状态配置。
- 根据权利要求1所述的交换机端口状态配置方法,其特征在于,获取与交换机端口对应的各网络模块的模块优先级,包括:根据与各所述网络模块对应的关联模块的通信信息确定各所述网络模块的模块优先级。
- 根据权利要求5所述的交换机端口状态配置方法,其特征在于,根据与各所述网络模块对应的关联模块的通信信息确定各所述网络模块的模块优先级,包括:根据与各所述网络模块对应的关联模块的通信信息对各所述网络模块的模块优先级进行动态更新。
- 根据权利要求5所述的交换机端口状态配置方法,其特征在于,在根据与各所述网络模块对应的关联模块的通信信息确定各所述网络模块的模块优先级之后,还包括:接收用户发送的对第二目标网络模块的模块优先级进行更新的指令,根据所述指令对所述第二目标网络模块的模块优先级进行更新。
- 根据权利要求1至7任一项所述的交换机端口状态配置方法,其特征在于,根据各所述网络模块的模块优先级、各所述网络模块对所述交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置所述交换机端口的状态,包括:获取最高模块优先级的各所述网络模块对所述交换机端口的状态配置;根据最高模块优先级的各所述网络模块对所述交换机端口的状态配置及同一所述模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态的规则,确定并配置所述交换机端口的状态。
- 根据权利要求1所述的交换机端口状态配置方法,其特征在于,在获取与交换机端口对应的各网络模块的模块优先级之前,还包括:接收所述网络模块发送的注册命令,根据所述注册命令对所述网络模块进行注册;在根据各所述网络模块的模块优先级、各所述网络模块对所述交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置所述交换机端口的状态之前,还包括:判断各所述网络模块是否均为已注册的网络模块;若存在未注册的网络模块,则剔除所述未注册的网络模块。
- 根据权利要求9所述的交换机端口状态配置方法,其特征在于,根据所述注册命令对所述网络模块进行注册,包括:根据所述注册命令中包含的所述网络模块的信息以及预先存储的允许注册白名单,判断所述网络模块是否位于所述允许注册白名单中;若所述网络模块位于所述允许注册白名单中,则对所述网络模块进行注册。
- 根据权利要求10所述的交换机端口状态配置方法,其特征在于,若所述网络模块不位于所述允许注册白名单中,则还包括:拒绝对所述网络模块进行注册,并发出所述网络模块未注册的提示。
- 根据权利要求9所述的交换机端口状态配置方法,其特征在于,接收所述网络模块发送的注册命令,包括:接收各所述网络模块通过软件接口发送的注册命令。
- 根据权利要求12所述的交换机端口状态配置方法,其特征在于,还包括:接收新网络模块通过所述软件接口发送的注册命令,根据所述新网络模块的注册命令对所述新网络模块进行注册。
- 根据权利要求1所述的交换机端口状态配置方法,其特征在于,在根据各所述网络模块的模块优先级、各所述网络模块对所述交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置所述交换机端口的状态之后,还包括:判断所述交换机端口的状态是否存在异常;若所述交换机端口的状态存在异常,则发出异常告警。
- 根据权利要求14所述的交换机端口状态配置方法,其特征在于,发出异常告警,包括:通过邮件告警、短信告警、电话告警、报警灯告警中的至少一种方式进行告警。
- 根据权利要求1所述的交换机端口状态配置方法,其特征在于,在获取与交换机端口对应的各网络模块的模块优先级及各所述网络模块对所述交换机端口的状态配置之后,还包括:显示各所述网络模块对所述交换机端口的状态配置。
- 根据权利要求1所述的交换机端口状态配置方法,其特征在于,在根据各所述网络模块的模块优先级、各所述网络模块对所述交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置所述交换机端口的状态之后,还包括:对所述交换机端口的状态进行显示。
- 一种交换机端口状态配置装置,其特征在于,包括:第一获取模块,被设置为获取与交换机端口对应的各网络模块的模块优先级及各所述网络模块对所述交换机端口的状态配置;配置模块,被设置为根据各所述网络模块的模块优先级、各所述网络模块对所述交换机端口的状态配置及预设交换机端口状态确定规则,确定并配置所述交换机端口的状态;其中,所述预设交换机端口状态确定规则为按照所述模块优先级由高到低的顺序、 同一所述模块优先级中按照交换机端口状态的优先级由高到低的顺序确定交换机端口状态,所述交换机端口状态包括可网络通信状态及不可网络通信状态,所述不可网络通信状态的优先级高于所述可网络通信状态的优先级。
- 一种交换机端口状态配置设备,其特征在于,包括:存储器,被设置为存储计算机程序;处理器,被设置为执行所述计算机程序时实现如权利要求1至17任一项所述的交换机端口状态配置方法的步骤。
- 一种非易失性可读存储介质,其特征在于,所述非易失性可读存储介质中存储有计算机程序,所述计算机程序被处理器执行时实现如权利要求1至17任一项所述的交换机端口状态配置方法的步骤。
Applications Claiming Priority (2)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN202310356398.1 | 2023-04-06 | ||
| CN202310356398.1A CN116074265B (zh) | 2023-04-06 | 2023-04-06 | 一种交换机端口状态配置方法、装置、设备及存储介质 |
Publications (1)
| Publication Number | Publication Date |
|---|---|
| WO2024207809A1 true WO2024207809A1 (zh) | 2024-10-10 |
Family
ID=86171784
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| PCT/CN2023/140400 Ceased WO2024207809A1 (zh) | 2023-04-06 | 2023-12-20 | 一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质 |
Country Status (2)
| Country | Link |
|---|---|
| CN (1) | CN116074265B (zh) |
| WO (1) | WO2024207809A1 (zh) |
Families Citing this family (2)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN116074265B (zh) * | 2023-04-06 | 2023-07-14 | 苏州浪潮智能科技有限公司 | 一种交换机端口状态配置方法、装置、设备及存储介质 |
| CN118714041A (zh) * | 2024-08-15 | 2024-09-27 | 深圳市丰润达科技有限公司 | 网络地址漂移控制方法、装置、设备及存储介质 |
Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180077021A1 (en) * | 2016-09-14 | 2018-03-15 | Apple Inc. | Selective Network Sleep and Wake |
| CN111786912A (zh) * | 2020-05-18 | 2020-10-16 | 深圳震有科技股份有限公司 | 一种交换机端口模式切换方法、交换机及存储介质 |
| CN113890823A (zh) * | 2021-08-20 | 2022-01-04 | 长沙湘计海盾科技有限公司 | 一种用于层次拓扑的交换机自动配置方法及介质 |
| CN114363228A (zh) * | 2021-12-31 | 2022-04-15 | 迈普通信技术股份有限公司 | MLAG-Lite测试系统及方法 |
| CN116074265A (zh) * | 2023-04-06 | 2023-05-05 | 苏州浪潮智能科技有限公司 | 一种交换机端口状态配置方法、装置、设备及存储介质 |
Family Cites Families (1)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN112311702B (zh) * | 2020-12-30 | 2021-04-06 | 北京国科天迅科技有限公司 | Fc交换机调度方法、装置、电子设备及存储介质 |
-
2023
- 2023-04-06 CN CN202310356398.1A patent/CN116074265B/zh active Active
- 2023-12-20 WO PCT/CN2023/140400 patent/WO2024207809A1/zh not_active Ceased
Patent Citations (5)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| US20180077021A1 (en) * | 2016-09-14 | 2018-03-15 | Apple Inc. | Selective Network Sleep and Wake |
| CN111786912A (zh) * | 2020-05-18 | 2020-10-16 | 深圳震有科技股份有限公司 | 一种交换机端口模式切换方法、交换机及存储介质 |
| CN113890823A (zh) * | 2021-08-20 | 2022-01-04 | 长沙湘计海盾科技有限公司 | 一种用于层次拓扑的交换机自动配置方法及介质 |
| CN114363228A (zh) * | 2021-12-31 | 2022-04-15 | 迈普通信技术股份有限公司 | MLAG-Lite测试系统及方法 |
| CN116074265A (zh) * | 2023-04-06 | 2023-05-05 | 苏州浪潮智能科技有限公司 | 一种交换机端口状态配置方法、装置、设备及存储介质 |
Also Published As
| Publication number | Publication date |
|---|---|
| CN116074265B (zh) | 2023-07-14 |
| CN116074265A (zh) | 2023-05-05 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| JP6146451B2 (ja) | 通信システム、通信装置、制御装置、パケットフローの転送経路の制御方法及びプログラム | |
| WO2024207809A1 (zh) | 一种交换机端口状态配置方法、装置、设备及非易失性可读存储介质 | |
| EP2586163B1 (en) | Notifying a controller of a change to a packet forwarding configuration of a network element over a communication channel | |
| JP5987902B2 (ja) | ネットワークシステム、コントローラ、及びパケット認証方法 | |
| CN104081731A (zh) | 网络系统以及管理拓扑的方法 | |
| CN108965137B (zh) | 一种报文处理方法和装置 | |
| US9219646B2 (en) | Managing actions of a network device | |
| CN116260618A (zh) | Ip地址的封堵处理方法、装置、电子设备及存储介质 | |
| EP2728797B1 (en) | Message processing method, device and system | |
| KR101658824B1 (ko) | 소프트웨어 정의 네트워크에서 플로우 룰을 변경하는 방법, 장치 및 컴퓨터 프로그램 | |
| US20140047260A1 (en) | Network management system, network management computer and network management method | |
| CN114338193A (zh) | 一种流量编排方法、装置及ovn流量编排系统 | |
| CN113141265B (zh) | 跨设备链路聚合方法及设备 | |
| US20180131566A9 (en) | Managing actions of a network device based on policy settings corresponding to a removable wireless communication device | |
| CN114978563B (zh) | 一种封堵ip地址的方法及装置 | |
| CN112968879B (zh) | 一种实现防火墙管理的方法及设备 | |
| CN112751701A (zh) | 批量发现网络地址转换装置后面的装置 | |
| CN111884863A (zh) | 一种用于云计算环境的vpc服务链实现方法及系统 | |
| CN114629845B (zh) | 一种基于容器的路由型数据中心网络管理方法及系统 | |
| CN120639495B (zh) | Acl自动创建方法、装置、电子设备及存储介质 | |
| CN112866031A (zh) | 路由配置方法、装置、设备及计算机可读存储介质 | |
| WO2017073033A1 (ja) | フロー処理装置、通信システム及びフロー処理方法 | |
| US7912980B1 (en) | Setting a maximum prefix exportation limit within a network device | |
| CN119766647B (zh) | 一种租户网关迁移的方法及装置、电子设备、存储介质 | |
| CN116016034B (zh) | 一种基于sdn的业务路径调度方法及装置 |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| 121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 23931854 Country of ref document: EP Kind code of ref document: A1 |
|
| NENP | Non-entry into the national phase |
Ref country code: DE |