CN117376282B - Switch view display method, device and computer readable storage medium - Google Patents

Switch view display method, device and computer readable storage medium Download PDF

Info

Publication number
CN117376282B
CN117376282B CN202311651213.6A CN202311651213A CN117376282B CN 117376282 B CN117376282 B CN 117376282B CN 202311651213 A CN202311651213 A CN 202311651213A CN 117376282 B CN117376282 B CN 117376282B
Authority
CN
China
Prior art keywords
switch
port
address
determining
data
Prior art date
Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
Active
Application number
CN202311651213.6A
Other languages
Chinese (zh)
Other versions
CN117376282A (en
Inventor
陈康健
钟国辉
周悦
Current Assignee (The listed assignees may be inaccurate. Google has not performed a legal analysis and makes no representation or warranty as to the accuracy of the list.)
Shenzhen Everything Safety Technology Co ltd
Original Assignee
Shenzhen Everything Safety Technology Co ltd
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by Shenzhen Everything Safety Technology Co ltd filed Critical Shenzhen Everything Safety Technology Co ltd
Priority to CN202311651213.6A priority Critical patent/CN117376282B/en
Publication of CN117376282A publication Critical patent/CN117376282A/en
Application granted granted Critical
Publication of CN117376282B publication Critical patent/CN117376282B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L49/00Packet switching elements
    • H04L49/10Packet switching elements characterised by the switching fabric construction
    • H04L49/111Switch interfaces, e.g. port details
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L41/00Arrangements for maintenance, administration or management of data switching networks, e.g. of packet switching networks
    • H04L41/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L61/00Network arrangements, protocols or services for addressing or naming
    • H04L61/50Address allocation
    • H04L61/5046Resolving address allocation conflicts; Testing of addresses
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L2101/00Indexing scheme associated with group H04L61/00
    • H04L2101/60Types of network addresses
    • H04L2101/618Details of network addresses
    • H04L2101/622Layer-2 addresses, e.g. medium access control [MAC] addresses

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Small-Scale Networks (AREA)

Abstract

The invention discloses a method and equipment for displaying a view of a switch and a computer-readable storage medium, and belongs to the technical field of network engineering. The switch view display method comprises the following steps: acquiring the number of MAC addresses and address information corresponding to each switch port; determining a switch port to be managed containing the same MAC address based on the address information; determining the switch ports actually mounted with the MAC addresses according to the number of the MAC addresses of the switch ports to be managed, and taking the MAC addresses as actual address mounting data of the switch ports; and determining a corresponding switch view based on the actual address mounting data of each switch port. Through the steps, the actual mounting condition of the MAC address of each port can be clearly displayed in the switch view, and the convenience of operation and maintenance management is improved.

Description

Switch view display method, device and computer readable storage medium
Technical Field
The present invention relates to the field of network engineering, and in particular, to a method, an apparatus, and a computer readable storage medium for displaying a switch view.
Background
During network operation, a switch port to which a certain MAC (Media Access Control Address ) address is accessed needs to be looked up by means of a switch view. However, cascading between switches, computer replacement ports, etc. may cause one MAC address to appear at multiple switch ports. Therefore, the switch view cannot clearly display the MAC address data actually mounted on the switch port, and the operation and maintenance difficulty of network operation and maintenance personnel is increased.
The foregoing is provided merely for the purpose of facilitating understanding of the technical solutions of the present invention and is not intended to represent an admission that the foregoing is prior art.
Disclosure of Invention
The invention mainly aims to provide a display method, equipment and a computer-readable storage medium for a switch view, and aims to solve the technical problem that the switch view cannot clearly display MAC address data actually mounted on a switch port and the operation and maintenance difficulty of network operation and maintenance personnel is increased.
In order to achieve the above object, the present invention provides a switch view display method, including:
acquiring the number of MAC addresses and address information corresponding to each switch port;
determining a switch port to be managed containing the same MAC address based on the address information;
determining the switch ports actually mounted with the MAC addresses according to the number of the MAC addresses of the switch ports to be managed, and taking the MAC addresses as actual address mounting data of the switch ports;
and determining a corresponding switch view based on the actual address mounting data of each switch port.
Optionally, the step of determining, according to the number of MAC addresses of each of the switch ports to be managed, a switch port on which the MAC address is actually mounted, and taking the MAC address as actual address mounting data of the switch port includes:
selecting the switch port to be managed with the minimum number of the MAC addresses as the switch port for the actual mounting of the MAC addresses;
and storing the MAC address and the switch port in an associated mode, and taking the MAC address and the switch port as actual address mounting data of the switch port.
Optionally, the step of storing the MAC address in association with the switch as actual address mount data of the switch port includes:
constructing an MAC address table corresponding to the switch port;
taking the MAC address as a main key of the MAC address table, and filling the MAC address table;
determining an identifier of the switch port and a number of real addresses of the switch port;
and storing the identifier and the actual address quantity in association with the MAC address table as actual address mounting data of the switch port.
Optionally, after the step of determining the switch port on which the MAC address is actually mounted according to the number of MAC addresses of each switch port to be managed and taking the MAC address as the actual address of the switch port to mount data, the method further includes:
when each switch port stores historical actual address mounting data, acquiring the number of historical MAC addresses corresponding to the historical actual address mounting data;
comparing the number of the MAC addresses corresponding to the actual address mounting data with the number of the historical MAC addresses;
and when the number of the MAC addresses is smaller than or equal to the number of the historical MAC addresses, updating and storing the actual address mounting data of the switch port.
Optionally, the step of determining the corresponding switch view based on the real address mounting data of each switch port includes:
determining the port name of each switch port and a corresponding port mapping index value;
based on the port mapping index value, associating actual address mounting data corresponding to the switch port;
and establishing a corresponding topological relation based on the port name, the port mapping index value and the actual address mounting data, and generating the switch view.
Optionally, the step of determining a port name and a corresponding port mapping index value of each switch port includes:
acquiring the port type of the switch port;
determining an interface identifier of the switch port according to the port type;
determining a port name of the switch port based on the interface identifier;
and determining the port mapping index value according to the port name.
Optionally, after the step of determining the corresponding switch view based on the actual address mounting data of each switch port, the method further includes:
when a query instruction input by an administrator is received, entering a management interface of the switch view;
determining a target port and a query requirement corresponding to the query instruction;
and calling port information corresponding to the query requirement based on the query requirement, and displaying the port information on a management interface of the switch view.
Optionally, after the step of determining the corresponding switch view based on the actual address mounting data of each switch port, the method further includes:
monitoring traffic data of the switch port based on the switch view;
determining traffic load data of the switch port based on the actual address mounting data and the traffic load condition;
and when the flow load data of the switch port is larger than a preset threshold value, executing a corresponding flow control strategy.
In addition, to achieve the above object, the present invention also provides a switch view display apparatus including: a memory, a processor, and a switch view display program stored on the memory and executable on the processor, the switch view display program configured to implement the steps of the switch view display method as described above.
In addition, in order to achieve the above object, the present invention also provides a computer-readable storage medium having stored thereon a switch view display program which, when executed by a processor, implements the steps of the switch view display method as described above.
The embodiment of the invention provides a switch view display method, which comprises the steps of determining switch ports to be managed containing the same MAC address based on address information of all switch ports by acquiring the number of the MAC addresses and the address information corresponding to all switch ports, determining the switch port actually mounted by the MAC address according to the number of the MAC addresses of all switch ports to be managed, repeatedly executing the steps until the actual address mounting data of each switch port are confirmed, and finally determining the topological relation between all ports of the switch and network equipment through the actual address mounting data and establishing a corresponding switch view. Through the steps, the actual mounting condition of the MAC address of each port can be clearly displayed in the switch view, and the convenience of operation and maintenance management is improved.
Drawings
FIG. 1 is a flow chart of a first embodiment of a switch view display method of the present invention;
FIG. 2 is a flow chart of a second embodiment of a switch view display method of the present invention;
FIG. 3 is a flowchart of a third embodiment of a switch view display method according to the present invention;
FIG. 4 is a flowchart of a switch view display method according to a fourth embodiment of the present invention;
fig. 5 is a schematic diagram of a terminal structure of a hardware running environment according to an embodiment of the present invention.
The achievement of the objects, functional features and advantages of the present invention will be further described with reference to the accompanying drawings, in conjunction with the embodiments.
Detailed Description
It should be understood that the specific embodiments described herein are for purposes of illustration only and are not intended to limit the scope of the invention.
An embodiment of the present invention provides a switch view display method, and referring to fig. 1, fig. 1 is a schematic flow chart of a first embodiment of a switch view display method of the present invention.
In this embodiment, the switch view display method includes:
step S10, the number of MAC addresses and address information corresponding to each switch port are obtained.
In this embodiment, the switch port refers to a physical interface for connecting network devices (such as a computer, a server, a printer, etc.). A switch typically has multiple ports that can connect multiple devices simultaneously to enable data transfer and communication between the devices. Ports of the switch are typically identified by numbers or letters, such as port 1, port 2, port a, port B, etc. By connecting the network cable to the ports of the switch and connecting each device to a different port of the switch, communication and data transmission between the devices can be realized, and an efficient local area network can be constructed. The improper layout of the cascade structure of the switch, or the reason that the ports are replaced by the network equipment, etc., often causes repeated MAC addresses between the ports of the switch.
Further, in order to facilitate determining the MAC address data actually mounted on the switch port, when the switch port is managed, all the switch port data to be managed is acquired, including the number of MAC addresses and address information corresponding to each switch port. The number of the MAC addresses refers to the number of the MAC addresses downloaded by the ports of the switch, and the address information refers to the MAC address data downloaded by the ports. The switch port can be a port on the same switch or ports on a plurality of switches for constructing a local area network.
Alternatively, in one possible embodiment, the MAC table of each switch is obtained from multiple switches and aggregated. The current MAC address table may be obtained from the switch by each station by using a network management software, CLI (Command line interface) Command or SNMP (simple network management) protocol, where the address table includes a MAC address, a corresponding port number, and related VLAN (Virtual Local Area Network, local area network) information. The MAC address tables collected from the switches are summarized to create a total MAC address table. According to the total MAC address table, the port and the switch where the associated MAC address is located can be known to determine the switch and the port where the equipment corresponding to the specific MAC address is located, so that the mounting position of the specific equipment can be tracked. According to the information of the MAC address mounting position, analysis and management can be further carried out. For example, checking whether the device is properly connected to the intended switch and port, whether there is a potential configuration problem, etc.
In this embodiment, the number of MAC addresses and the number of address information of each switch port are used to facilitate the subsequent determination of the switch port on which the duplicate MAC address is actually mounted by using the number of address information and the number of MAC addresses.
And step S20, determining the ports of the switch to be managed containing the same MAC address based on the address information.
In the present embodiment, based on the respective switch port address information, the switch ports to be managed containing the same MAC address can be further determined. When determining the ports of the switch to be managed containing the same MAC address, a MAC address table obtained by means of the statistics of the previous step is needed, in which each row corresponds to one MAC address and a corresponding interface index. Further, the MAC address table is parsed, each MAC address and the corresponding interface index are extracted, records having the same MAC address are grouped, and for each MAC address, a port containing the MAC address is determined. If only one interface index is associated with the MAC address, the port is the port containing the MAC address. If there are multiple interface indexes associated with the MAC address, the port information of each interface needs to be confirmed later, i.e. the port information of each interface, such as a port name, description or status, is obtained according to the interface index. The actual mounted port of the repeatedly mounted MAC address is further confirmed.
In this embodiment, the switch port information corresponding to each MAC address is obtained, and the switch port to be managed including the same MAC address is determined. And the switch ports on which the MAC addresses are actually mounted are conveniently distinguished subsequently.
And step S30, determining the switch ports on which the MAC addresses are actually mounted according to the number of the MAC addresses of the switch ports to be managed, and taking the MAC addresses as the actual address mounting data of the switch ports.
In this embodiment, based on the determined switch ports to be managed having the same MAC address, according to the number of MAC addresses of each switch port, the port on which the duplicate MAC address is actually mounted may be determined, and each duplicate MAC address is determined by comparing the number of MAC addresses of the switch ports, and is used as the actual address mounting data of the switch port. The MAC addresses of each repeated occurrence in the multiple ports are compared according to the step, so that it can be determined which MAC addresses are mounted under each switch port, that is, the actual address of the switch port mounts data. When determining the switch port with the actual mounted MAC address according to the MAC address data quantity of the switch port to be managed, the switch port to be managed with the minimum MAC address quantity is selected as the switch port with the actual mounted repeatedly mounted MAC address mainly by comparing the MAC address quantity of the switch port to be managed.
Further, in a possible implementation manner, after acquiring the MAC address information of all the switch ports to be managed and downloading the MAC address information, counting the number of MACs under each port according to the dimension of the switch port under the switch, the MAC address number label is denoted as macNum. And comparing the MAC addresses of all the switch ports, and taking the smallest macNum value as the port on which the current MAC address is actually mounted when the same MAC address appears in a plurality of switch ports. This step corresponds to performing a corresponding "purge" operation on the switch port having the duplicate MAC address, i.e., filtering the invalid, duplicate MAC addresses in the switch port, and confirming the port on which the duplicate MAC address data is actually mounted.
When the switch port is managed for the first time, only after all repeated MAC addresses are compared, the MAC address actually mounted on the switch port after the cleaning is finished and the macNum data actually corresponding to the MAC address are stored according to the dimension of the MAC address, and the cleaned MAC address and macNum are stored in association with the switch port. And then, when the switch port is required to be managed again to acquire the MAC address data actually mounted on the switch port, after the actual address mounting data of the current switch port is counted, the MAC address data of the switch port after cleaning is finished is compared with the history actual address mounting data stored before, if the macum is smaller than or equal to the history macNum corresponding to the history actual address mounting data, the storage data of the switch port is updated, and the actual address data obtained by cleaning is stored. Through the steps, the fact that the MAC address data is mounted on the designated port of the switch can be determined.
For example, assuming that the ports a, B and C are currently installed, the MAC address of a computer device is installed in the three ports at the same time, in order to determine the port actually installed by the computer device, the number of MAC addresses of the port a is 1, the number of MAC addresses of the port B is 10, and the number of MAC addresses of the port C is 20, at this time, it is determined that the port actually installed by the computer device is the port a, and other repeated MAC addresses are also confirmed according to the above determination steps, so that it is possible to distinguish the actual address installation data under the three ports, that is, which MAC addresses are respectively installed.
In addition, because some MAC addresses may be invalid addresses caused by errors or fraud or false MAC addresses, the accuracy of subsequent analysis and judgment may be affected by the MAC address data, in order to ensure the accuracy of the actual address mounting data of the switch port, the MAC addresses may be filtered in advance, so that the invalid data therein may be screened out. Here, a MAC address filtering table may be used, by maintaining the MAC address filtering table, only allowing a known MAC address to access the network, denying access by an illegal device or an unauthorized device, by periodically updating the MAC address filtering table, while monitoring and recording an unrecognized MAC address. In another possible implementation, DHCP Snooping (security feature of dynamic host configuration protocol) may also be configured to filter unauthorized DHCP servers and clients, allowing only legitimate DHCP traffic to pass through, thereby helping to filter false MAC addresses.
In this embodiment, by comparing the number of MAC addresses of the switch ports having the duplicate MAC addresses, the port on which the MAC address is actually mounted can be determined. And the actual address mounting data corresponding to each switch port is determined, so that the corresponding switch view can be generated conveniently.
And step S40, determining a corresponding switch view based on the actual address mounting data of each switch port.
In this embodiment, through the previous cleaning step, the actual address mounting data of each switch port may be determined, and further, according to the actual address mounting data of each switch port, the corresponding switch view, that is, the topological relationship between the switch port and the network device, may be determined. The switch view graphically displays the switch devices and the connection relations thereof, so that the network topology structure is clear at a glance. This helps to better understand the physical layout of the network and the association between devices, and in the event of a network failure, the problem point can be located quickly through the switch view and the corresponding troubleshooting can be performed. When determining and constructing the corresponding switch view, first, information of each switch port needs to be collected, including a port number, a connected device name or a MAC address, etc., which can be obtained through a management interface, a command line interface or an SNMP protocol of the switch, etc. After the port information is acquired, a topology view can be created based on a drawing tool (such as Visio, draw. Io and the like) or an online topology drawing tool, and according to practical situations, a tree diagram, a logic diagram, a physical diagram or the like can be selected to be used for presentation, switch equipment is taken as a root node, equipment nodes connected with the switch equipment are drawn according to the port information, and the connected port information is marked. The switch view should be updated in time to reflect the change of the network, and when the actual address mounting data of the switch port needs to be counted again, the corresponding node information in the switch view needs to be updated according to the change condition of the switch port. In the event of large changes between switches and network devices or frequent updates of topology views are required, automated tools can be used to help generate and maintain topology views.
In this embodiment, the switch view generated by determining the actual address mounting condition of the switch port is convenient for monitoring and managing the network state in real time, and can improve the convenience and efficiency when the network operation and maintenance are performed.
Further, referring to fig. 2, a second embodiment of the switch view display method of the present invention further includes the following steps:
s50, constructing an MAC address table corresponding to the switch port;
step S60, taking the MAC address as a main key of the MAC address table, and filling the MAC address table;
step S70, determining the identifier of the switch port and the actual address quantity of the switch port;
and step S80, storing the identifier and the actual address quantity in association with the MAC address table as actual address mounting data of the switch port.
In this embodiment, the actual address of the confirmed switch port mounts data, and the actual mount data may be stored based on the dimension of the MAC address. Specifically, each unique MAC address and its corresponding macNum value may be recorded using a data structure (e.g., a database table or file), and queries and operations may be conveniently performed on a particular MAC address by storing data in accordance with the dimensions of the MAC address. In this way, information related to a particular mac address can be quickly retrieved and obtained without traversing the entire dataset. Further, after determining the actual address mounting data of the switch port, the obtained MAC address and macNum data include a plurality of non-duplicate MAC addresses and their corresponding numbers. When storing it, a table, that is, a MAC address table, may be re-established, with the MAC address as the primary key of the table, and each MAC address and its corresponding related data may be stored in the address table. Thus, when the macNum value of a specific MAC address or port below a switch port needs to be queried, the MAC address can be directly searched in the address table without traversing the entire data set.
Most of the switches have built-in MAC address tables, so that the corresponding relation between the MAC address and the port of the equipment is recorded. When the switch receives the data packet, the MAC table is searched to determine the port corresponding to the destination MAC address. And an administrator may view and configure the MAC table through a management interface or command line. Therefore, the actual address mount data of each switch port also needs to be stored in association with the port. Alternatively, in a possible implementation, the network management software, such as SNMP management system, may be used to monitor and manage devices and ports in the network, and an identifier capable of uniquely identifying a switch port may be added to the MAC address table, where the identifier may be a number or a letter. By using network management software, the corresponding relation between the MAC address and the port can be conveniently stored and inquired. Further, the record may be created manually by an administrator, and the correspondence between the MAC address and the port may be stored in a document or a spreadsheet. It should be noted that, when the MAC address and the address number value are stored in association with the corresponding switch port, update timeliness needs to be ensured, and in addition, security of the modification authority layer needs to be ensured, so that only authorized personnel can access and modify the association information of the MAC address and the port, so as to maintain security and stability of the network. And periodically verifying whether the corresponding relation between the MAC address and the port is consistent with the actual network topology, and repairing the inconsistent place in time to avoid the occurrence of problems.
In this embodiment, the actual address mounting data of the port is stored in association with the port according to the dimension of the MAC address, so that the subsequently generated switch view includes the actual address mounting situation of each switch port. The query efficiency of the MAC address data is improved, the operation and management of the MAC address are facilitated, and the method is suitable for scenes in which the related information of the MAC address needs to be frequently queried and processed.
Referring to fig. 3, the switch view of the present invention shows a third embodiment, and based on the embodiment shown in fig. 3, after the step S40, the method further includes the following steps:
step S90, entering a management interface of the switch view when a query instruction input by an administrator is received.
Step S100, determining a target port and a query requirement corresponding to the query instruction.
Step S110, based on the query requirement, the port information corresponding to the query requirement is called and displayed on the management interface of the switch view.
In this embodiment, after the actual address mounting data of each switch port is determined, the switch view may also be displayed through the positions of the ports and the boards mounted by the MAC address, so that the manager clearly knows the positions and connection modes of each device in the switch, and determines the positions and connection modes of each device (such as a server, a router, or a computer) according to the physical structure and the port connection condition of the switch, for example, whether the device is mounted on a specific board or directly connected to a certain port of the switch. The switch view management tool has been used before, the MAC address of the device is associated with the port position where the device is located, and in addition, the position information of the port needs to be associated with a specific board card position, so that a switch view is formed, in which not only the positions and connection modes of all devices in the switch are identified, but also the address mounting condition under each switch port is recorded, and when a manager inputs a query instruction, the switch view management interface can display corresponding switch port data. The inquiry instruction needs to include a port identifier, and illustratively, when a manager inputs a 'show interfaces gi 0/1' instruction, state information of an interface gi0/1, including speed, duplex mode, error count and the like, can be displayed in a switch view at the moment, and the MAC address and the address number of the equipment connected under the port are listed; when the administrator enters the "show MAC address-table interface gi0/1" instruction, then the MAC address entries bound to interface gi0/1 are displayed, which bind the MAC address to a particular physical port. When the manager inputs "show CDP neighbors gi0/1", detailed information of devices found by Cisco Discovery Protocol (CDP, cisco discovery protocol) protocol, including names of devices, IP addresses, device types, hardware versions, etc., which are directly adjacent to the interface gi0/1, is displayed. Through the command, an administrator can query the connection condition of the equipment under the switch port by utilizing the switch view, including the connected equipment MAC address, neighbor equipment information and the like, so that the administrator can better manage and maintain the network equipment and perform network fault removal.
It should be noted that a board card is often inserted into the switch to provide additional functions, ports or interfaces. A switch may be comprised of one or more boards, each with its own physical interface and processing capabilities. Therefore, in the view through the switch, the view through the switch further includes information such as a port identifier and a board card position in the switch, and the following description is made through an application scenario: and acquiring port data of each switch to be managed in the current local area network, wherein the port data comprises port physical port names, namely 0/0/1 gigabit Ethernet, 1/0/1 Ten-gigabit Ethernet (10G Ethernet) and 1/0/1 Ethernet. Taking gigabit ethernet0/0/1 as an example, the type of physical port, "gigabit ethernet" is the type of the physical port, and "0/0/1" is the identifier of the interface, where in this identifier, the first "0" indicates a slot or a board card number, the second "0" indicates a card slot or a port group number, and "1" indicates a specific physical interface in the port group, and using the first bit of the interface identifier, that is, the board card number, it is possible to determine which board card of the switch the currently acquired port is located on. For multiple boards (cabinet, frame, stack) the port data may then be as follows:
physical port name port mapping index
GigabitEthernet1/0/11
GigabitEthernet2/0/153
GigabitEthernet3/0/1105
GigabitEthernet4/0/1157
GigabitEthernet5/0/1208
The port mapping index is a number for identifying the port in the switch, each port in the switch has a unique port mapping index, and each port of the switch is identified and displayed in the switch view. When the administrator needs to know the position and the state of each port on the switch, through the port mapping index, each port on the switch can be identified and displayed in the switch view, and through steps S10-S40, when a query instruction is input, the number of the ports mounted on each block can be judged, so that the correct display view of each switch port can be displayed.
In this embodiment, the switch diagram shows the actual address mounting data of each port, and the manager can query the switch diagram according to the actual requirement. The convenience of operation and maintenance management is improved.
Referring to fig. 4, the switch view of the present invention shows a fourth embodiment, based on the embodiment shown in fig. 4, after step S40, further comprising the following steps:
and step S120, monitoring traffic data of the switch port based on the switch view.
And step S130, determining the traffic load data of the switch port based on the actual address mounting data and the traffic load condition.
And step 140, executing a corresponding flow control strategy when the flow load data of the switch port is greater than a preset threshold value.
In this embodiment, the switch view based on the acquired real address mount data may be used to perform corresponding network operation management activities. In an application scenario, the switch view may be used to monitor traffic load conditions of each port. And when receiving a command provided by network management software or a switch, acquiring a MAC address list stored under each port and the number of the MAC addresses downloaded by the MAC address list. Comparing the number of MAC addresses for each port, if the number of MAC addresses under a certain port is much higher than the other ports, it means that the devices to which the ports are connected generate larger network traffic. In this regard, a corresponding flow control policy may be implemented according to the analysis result, where the flow control policy is used as a set of rules and measures for managing data traffic in the network, so as to optimize network performance, ensure quality of service, and prevent network congestion.
Further, a traffic load data threshold (i.e., a preset threshold) of the switch port may be preset, where the traffic load threshold refers to a maximum load or load level that can be borne by the network device or system when processing network traffic. When the traffic data load threshold is set, the network traffic requirements, such as bandwidth, time delay, packet loss rate and the like, can be met through the bandwidth capacity, packet forwarding rate, processing capacity and different services of the switch, and meanwhile, the peak value condition and reserved bandwidth of the network traffic are combined to carry out dynamic adjustment setting, so that congestion or performance degradation under critical conditions is avoided.
When the traffic load data of a certain switch port exceeds a preset threshold, a corresponding traffic control strategy may be executed, and in a possible implementation, a queue management algorithm may be used to queue and schedule the data packets to ensure that different types of data flows obtain appropriate priorities and delays. For example, real-time streaming media data is preferentially processed and fast response is performed on delay-sensitive applications. In addition, priority flags may be set for different types of data flows, and the switch performs priority processing based on these flags. For example, video calls may be assigned a higher priority to ensure that they are still of good quality when the network is congested. In another possible implementation, the switch may also shape the data flow, i.e. adjust the sending rate of the data packet to match the current network bandwidth, avoiding network congestion and packet loss.
In this embodiment, since the actual address mounting condition of each switch port can be displayed in the switch view, the performance and the utilization rate of each port of the switch can be monitored through the switch view, and the network load and the traffic can be visually analyzed. The congestion degree is reduced by monitoring the network congestion condition and taking corresponding measures, so that the measures can be taken in time when the network load flow is abnormal, and the network performance and operation are optimized.
Referring to fig. 5, fig. 5 is a schematic diagram of a switch view display device of a hardware running environment according to an embodiment of the present invention.
As shown in fig. 5, the switch view display device may include: a processor 1001, such as a central processing unit (Central Processing Unit, CPU), a communication bus 1002, a user interface 1003, a network interface 1004, a memory 1005. Wherein the communication bus 1002 is used to enable connected communication between these components. The user interface 1003 may include a Display, an input unit such as a Keyboard (Keyboard), and the optional user interface 1003 may further include a standard wired interface, a wireless interface. The network interface 1004 may optionally include a standard wired interface, a WIreless interface (e.g., a WIreless-FIdelity (WI-FI) interface). The Memory 1005 may be a high-speed random access Memory (Random Access Memory, RAM) Memory or a stable nonvolatile Memory (NVM), such as a disk Memory. The memory 1005 may also optionally be a storage device separate from the processor 1001 described above.
Those skilled in the art will appreciate that the structure shown in fig. 5 is not limiting of the switch view display device and may include more or fewer components than shown, or may combine certain components, or may be a different arrangement of components.
As shown in fig. 5, an operating system, a data storage module, a network communication module, a user interface module, and a switch view display program may be included in the memory 1005 as one type of storage medium.
In the switch view display device shown in fig. 5, the network interface 1004 is mainly used for data communication with other devices; the user interface 1003 is mainly used for data interaction with a user; the processor 1001, the memory 1005 in the switch view display device of the present invention may be provided in the switch view display device, which calls the switch view display program stored in the memory 1005 through the processor 1001, and performs the steps of:
acquiring the number of MAC addresses and address information corresponding to each switch port;
determining a switch port to be managed containing the same MAC address based on the address information;
determining the switch ports actually mounted with the MAC addresses according to the number of the MAC addresses of the switch ports to be managed, and taking the MAC addresses as actual address mounting data of the switch ports;
and determining a corresponding switch view based on the actual address mounting data of each switch port.
Further, the switch view display device calls the switch view display program stored in the memory 1005 through the processor 1001, and further performs the following steps:
acquiring the number of MAC addresses and address information corresponding to each switch port;
determining a switch port to be managed containing the same MAC address based on the address information;
determining the switch ports actually mounted with the MAC addresses according to the number of the MAC addresses of each switch port to be managed, and taking the MAC addresses as actual address mounting data of the switch ports;
and determining a corresponding switch view based on the actual address mounting data of each switch port.
Further, the switch view display device calls the switch view display program stored in the memory 1005 through the processor 1001, and further performs the following steps:
selecting the switch port to be managed with the minimum number of the MAC addresses as the switch port for the actual mounting of the MAC addresses;
and storing the MAC address and the switch port in an associated mode, and taking the MAC address and the switch port as actual address mounting data of the switch port.
Further, the switch view display device calls the switch view display program stored in the memory 1005 through the processor 1001, and further performs the following steps:
constructing an MAC address table corresponding to the switch port;
taking the MAC address as a main key of the MAC address table, and filling the MAC address table;
determining an identifier of the switch port and a number of real addresses of the switch port;
and storing the identifier and the actual address quantity in association with the MAC address table as actual address mounting data of the switch port.
Further, the switch view display device calls the switch view display program stored in the memory 1005 through the processor 1001, and further performs the following steps:
when each switch port stores historical actual address mounting data, acquiring the number of historical MAC addresses corresponding to the historical actual address mounting data;
comparing the number of the MAC addresses corresponding to the actual address mounting data with the number of the historical MAC addresses;
and when the number of the MAC addresses is smaller than or equal to the number of the historical MAC addresses, updating and storing the actual address mounting data of the switch port.
Further, the switch view display device calls the switch view display program stored in the memory 1005 through the processor 1001, and further performs the following steps:
determining the port name of each switch port and a corresponding port mapping index value;
based on the port mapping index value, associating actual address mounting data corresponding to the switch port;
and establishing a corresponding topological relation based on the port name, the port mapping index value and the actual address mounting data, and generating the switch view.
Further, the switch view display device calls the switch view display program stored in the memory 1005 through the processor 1001, and further performs the following steps:
acquiring the port type of the switch port;
determining an interface identifier of the switch port according to the port type;
determining a port name of the switch port based on the interface identifier;
and determining the port mapping index value according to the port name.
Further, the switch view display device calls the switch view display program stored in the memory 1005 through the processor 1001, and further performs the following steps:
when a query instruction input by an administrator is received, entering a management interface of the switch view;
determining a target port and a query requirement corresponding to the query instruction;
and calling port information corresponding to the query requirement based on the query requirement, and displaying the port information on a management interface of the switch view.
Further, the switch view display device calls the switch view display program stored in the memory 1005 through the processor 1001, and further performs the following steps:
monitoring traffic data of the switch port based on the switch view;
determining traffic load data of the switch port based on the actual address mounting data and the traffic load condition;
and when the flow load data of the switch port is larger than a preset threshold value, executing a corresponding flow control strategy.
It should be noted that, in this document, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or system that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or system. Without further limitation, an element defined by the phrase "comprising one … …" does not exclude the presence of other like elements in a process, method, article, or system that comprises the element.
The foregoing embodiment numbers of the present invention are merely for the purpose of description, and do not represent the advantages or disadvantages of the embodiments.
From the above description of embodiments, it will be clear to a person skilled in the art that the above embodiment method may be implemented by means of software plus a necessary general hardware platform, but may of course also be implemented by means of hardware, but in many cases the former is a preferred embodiment. Based on this understanding, the technical solution of the present invention may be embodied essentially or in a part contributing to the prior art in the form of a software product stored in a storage medium (e.g. ROM/RAM, magnetic disk, optical disk) as described above, comprising instructions for causing a terminal device (which may be a mobile phone, a computer, a server, or a network device, etc.) to perform the method according to the embodiments of the present invention.
The foregoing description is only of the preferred embodiments of the present invention, and is not intended to limit the scope of the invention, but rather is intended to cover any equivalents of the structures or equivalent processes disclosed herein or in the alternative, which may be employed directly or indirectly in other related arts.

Claims (8)

1. A switch view display method, characterized in that the switch view display method comprises the steps of:
filtering unauthorized servers and clients based on configured dynamic host configuration protocols to filter false MAC addresses of switch ports;
acquiring the number of MAC addresses and address information corresponding to the switch ports;
determining a switch port to be managed containing the same MAC address based on the address information;
selecting the switch port to be managed with the minimum number of the MAC addresses as the switch port of the actual mounting of the same MAC address;
the same MAC address and the actually mounted switch port are stored in an associated mode to be used as actual address mounting data of the switch port, wherein when each switch port stores historical actual address mounting data, the number of the historical MAC addresses corresponding to the historical actual address mounting data is obtained, the number of the MAC addresses corresponding to the actual address mounting data is compared with the number of the historical MAC addresses, and when the number of the MAC addresses corresponding to the actual address mounting data is smaller than or equal to the number of the historical MAC addresses, the actual address mounting data of the switch port is updated and stored;
and determining a corresponding switch view based on the actual address mounting data of each switch port.
2. The switch view display method as claimed in claim 1, wherein the step of storing the same MAC address in association with the actually mounted switch port as actual address mounting data of the switch port comprises:
constructing an MAC address table corresponding to the switch port;
taking the same MAC address as a main key of the MAC address table, and filling the MAC address table;
determining an identifier of a switch port and a real address number of the switch port;
and storing the identifier and the actual address quantity in association with the MAC address table as actual address mounting data of the switch port.
3. The switch view display method of claim 1, wherein the step of determining the corresponding switch view based on the real address mount data of each of the switch ports comprises:
determining the port name of each switch port and a corresponding port mapping index value;
based on the port mapping index value, associating actual address mounting data corresponding to the switch port;
and establishing a corresponding topological relation based on the port name, the port mapping index value and the actual address mounting data, and generating the switch view.
4. The switch view display method of claim 3, wherein the step of determining a port name and a corresponding port mapping index value for each of the switch ports comprises:
acquiring the port type of the switch port;
determining an interface identifier of the switch port according to the port type;
determining a port name of the switch port based on the interface identifier;
and determining the port mapping index value according to the port name.
5. The switch view display method of claim 1, wherein after the step of determining the corresponding switch view based on the real address mount data of each of the switch ports, further comprising:
when a query instruction input by an administrator is received, entering a management interface of the switch view;
determining a target port and a query requirement corresponding to the query instruction;
and calling port information corresponding to the query requirement based on the query requirement, and displaying the port information on a management interface of the switch view.
6. The switch view display method of claim 1, wherein after the step of determining the corresponding switch view based on the real address mount data of each of the switch ports, further comprising:
monitoring traffic data of the switch port based on the switch view;
determining traffic load data of the switch port based on the actual address mounting data and traffic load conditions;
and when the flow load data of the switch port is larger than a preset threshold value, executing a corresponding flow control strategy.
7. A switch view display device, the switch view display device comprising: a memory, a processor, and a switch view display program stored on the memory and executable on the processor, the switch view display program configured to implement the steps of the switch view display method of any of claims 1 to 6.
8. A computer-readable storage medium, on which a switch view display program is stored, which when executed by a processor implements the steps of the switch view display method according to any of claims 1 to 6.
CN202311651213.6A 2023-12-05 2023-12-05 Switch view display method, device and computer readable storage medium Active CN117376282B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN202311651213.6A CN117376282B (en) 2023-12-05 2023-12-05 Switch view display method, device and computer readable storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN202311651213.6A CN117376282B (en) 2023-12-05 2023-12-05 Switch view display method, device and computer readable storage medium

Publications (2)

Publication Number Publication Date
CN117376282A CN117376282A (en) 2024-01-09
CN117376282B true CN117376282B (en) 2024-03-26

Family

ID=89404481

Family Applications (1)

Application Number Title Priority Date Filing Date
CN202311651213.6A Active CN117376282B (en) 2023-12-05 2023-12-05 Switch view display method, device and computer readable storage medium

Country Status (1)

Country Link
CN (1) CN117376282B (en)

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567870A (en) * 2003-06-24 2005-01-19 华为技术有限公司 Port based MAC address quantity statistical method and apparatus thereof
CN105245386A (en) * 2015-10-26 2016-01-13 上海华讯网络系统有限公司 Method and system for automatic positioning of server connection relation
CN107094187A (en) * 2017-04-01 2017-08-25 汕头大学 A kind of method of the access switch port of automatic lookup MAC Address
CN108206792A (en) * 2016-12-16 2018-06-26 北京神州泰岳软件股份有限公司 The topology discovery method and device of interchanger
CN112491722A (en) * 2020-12-04 2021-03-12 锐捷网络股份有限公司 Address table maintenance method, device and equipment

Family Cites Families (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
JP5928197B2 (en) * 2012-06-29 2016-06-01 富士通株式会社 Storage system management program and storage system management apparatus
WO2021243524A1 (en) * 2020-06-01 2021-12-09 西门子股份公司 Network topology construction method and apparatus, and computer readable medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1567870A (en) * 2003-06-24 2005-01-19 华为技术有限公司 Port based MAC address quantity statistical method and apparatus thereof
CN105245386A (en) * 2015-10-26 2016-01-13 上海华讯网络系统有限公司 Method and system for automatic positioning of server connection relation
CN108206792A (en) * 2016-12-16 2018-06-26 北京神州泰岳软件股份有限公司 The topology discovery method and device of interchanger
CN107094187A (en) * 2017-04-01 2017-08-25 汕头大学 A kind of method of the access switch port of automatic lookup MAC Address
CN112491722A (en) * 2020-12-04 2021-03-12 锐捷网络股份有限公司 Address table maintenance method, device and equipment

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
交换机MAC地址表的产生与管理;马伟强;;计算机与网络(09);全文 *
数据链路层网络拓扑发现算法研究;孔令文;谭景信;;计算机工程与设计;20081016(19);全文 *

Also Published As

Publication number Publication date
CN117376282A (en) 2024-01-09

Similar Documents

Publication Publication Date Title
CA2457718C (en) Using link state information to discover ip network topology
US7292541B1 (en) Methods and systems for unnumbered network link discovery
US6744739B2 (en) Method and system for determining network characteristics using routing protocols
EP1999890B1 (en) Automated network congestion and trouble locator and corrector
US6978302B1 (en) Network management apparatus and method for identifying causal events on a network
US7069343B2 (en) Topology discovery by partitioning multiple discovery techniques
EP1703671B1 (en) Device and method for network monitoring
JP6193473B2 (en) Computer-implemented method, computer program product and computer
US8203962B2 (en) Network monitoring device, network monitoring method, and network monitoring program
JPH09186688A (en) Improved node discovery and network control system with monitoring
US9531598B2 (en) Querying a traffic forwarding table
GB2513188A (en) Identification of the paths taken through a network of interconnected devices
CN112073256B (en) Packet loss processing method, device, equipment and machine readable storage medium
US20060126534A1 (en) Method and mechanism for identifying an unmanaged switch in a network
CN117376282B (en) Switch view display method, device and computer readable storage medium
EP1479192B1 (en) Method and apparatus for managing configuration of a network
US10102286B2 (en) Local object instance discovery for metric collection on network elements
US6883024B2 (en) Method and apparatus for defining application scope and for ensuring finite growth of scaled distributed applications
US7412512B2 (en) Indirect addressing method and system for locating a target element in a communication network
KR100608917B1 (en) Method for managing fault information of distributed forwarding architecture router
Torkman et al. On Semantic and Compliance of SNMP MIBs in IP/MPLS routers
CN105515881A (en) Routing analysis method

Legal Events

Date Code Title Description
PB01 Publication
PB01 Publication
SE01 Entry into force of request for substantive examination
SE01 Entry into force of request for substantive examination
GR01 Patent grant
GR01 Patent grant