CN109039788B - Port configuration method and device of network equipment and storage medium - Google Patents

Port configuration method and device of network equipment and storage medium Download PDF

Info

Publication number
CN109039788B
CN109039788B CN201811161574.1A CN201811161574A CN109039788B CN 109039788 B CN109039788 B CN 109039788B CN 201811161574 A CN201811161574 A CN 201811161574A CN 109039788 B CN109039788 B CN 109039788B
Authority
CN
China
Prior art keywords
role
port
network
opposite
determining
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
CN201811161574.1A
Other languages
Chinese (zh)
Other versions
CN109039788A (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.)
Ruijie Networks Co Ltd
Original Assignee
Ruijie Networks 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 Ruijie Networks Co Ltd filed Critical Ruijie Networks Co Ltd
Priority to CN201811161574.1A priority Critical patent/CN109039788B/en
Publication of CN109039788A publication Critical patent/CN109039788A/en
Application granted granted Critical
Publication of CN109039788B publication Critical patent/CN109039788B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Classifications

    • 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/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • 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/08Configuration management of networks or network elements
    • H04L41/0803Configuration setting
    • H04L41/084Configuration by using pre-existing information, e.g. using templates or copying from other elements
    • H04L41/0843Configuration by using pre-existing information, e.g. using templates or copying from other elements based on generic templates
    • 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/08Configuration management of networks or network elements
    • H04L41/0889Techniques to speed-up the configuration process
    • YGENERAL TAGGING OF NEW TECHNOLOGICAL DEVELOPMENTS; GENERAL TAGGING OF CROSS-SECTIONAL TECHNOLOGIES SPANNING OVER SEVERAL SECTIONS OF THE IPC; TECHNICAL SUBJECTS COVERED BY FORMER USPC CROSS-REFERENCE ART COLLECTIONS [XRACs] AND DIGESTS
    • Y02TECHNOLOGIES OR APPLICATIONS FOR MITIGATION OR ADAPTATION AGAINST CLIMATE CHANGE
    • Y02DCLIMATE CHANGE MITIGATION TECHNOLOGIES IN INFORMATION AND COMMUNICATION TECHNOLOGIES [ICT], I.E. INFORMATION AND COMMUNICATION TECHNOLOGIES AIMING AT THE REDUCTION OF THEIR OWN ENERGY USE
    • Y02D30/00Reducing energy consumption in communication networks

Abstract

The application discloses a port configuration method, a port configuration device and a storage medium of network equipment, relates to the technical field of internet and is used for realizing automatic configuration of the network equipment. In the method, the port to be configured can determine which port is of which device through the device role of the device in which the port is located and the device role of the opposite device, namely, the confirmation of the network topology is realized. Then, the corresponding port configuration template can be obtained for configuration according to the port role of the network device. Since the device role can represent the actual topological connection relationship at the port to be configured, the configuration can be automatically performed according to the port configuration template according to the actual topological connection relationship in the embodiment of the application. Therefore, operation and maintenance personnel do not need to configure each port at the network end and manually ensure the relationship between the port configuration and the network topology.

Description

Port configuration method and device of network equipment and storage medium
Technical Field
The present application relates to the field of internet technologies, and in particular, to a port configuration method and apparatus for a network device, and a storage medium.
Background
The port configuration of a network device may be divided into a basic configuration and a port configuration. For example, device management configuration, configuration of a Virtual Local Area Network (VLAN), configuration of a static route, and the like belong to basic configuration. The configuration of the port may include, for example, configuring port traffic, trunk mode, whether a port protection function is turned on, and the like.
The network device needs to be configured to work normally after being deployed. The port configuration of the prior network equipment needs manual operation, and the port configuration of the network equipment is complicated due to the need of field arrangement and complex network layout, and occupies more time and labor cost. Therefore, a scheme for automatically deploying configuration is provided.
In the prior art, automatic configuration is generally to configure complete configuration corresponding to each network device in advance at a network management end. Then, when the network device is on line, the network device requests to automatically allocate to an IP (Internet Protocol, a Protocol for interconnecting networks) address through a DHCP (Dynamic Host Configuration Protocol), acquires a server address and a Configuration file through a DHCP Option 66 and a DHCP Option 67, and then downloads the Configuration file from the server, thereby achieving the purpose of automatic Configuration delivery.
However, the existing method needs to perform pre-configuration on the network side, and the pre-configuration has a high operation and maintenance skill requirement on the operation and maintenance personnel.
Furthermore, a complete configuration of a piece of network equipment as described above includes the basic configuration and the port configuration of the equipment. Wherein, the basic configuration is generally easy to be realized by templet, and the port configuration needs to be determined by operation and maintenance personnel respectively. And the port configuration is to be based on the topological connection of the devices. If the port configuration is inconsistent with the actual topological connection of the device, the service on the port cannot be correctly issued, so that the network cannot expect to be on-line. At present, port configuration and topological connection need to be ensured manually, the process is relatively complicated, and once configuration is wrong, problems are inconvenient to troubleshoot.
Disclosure of Invention
The embodiment of the application provides a port configuration method and device of network equipment and a storage medium, which are used for solving the problems that port configuration has high requirements on operation and maintenance personnel, port configuration is easy to be inconsistent with network topology, port service cannot be normally performed and the like in the prior art.
In a first aspect, an embodiment of the present application provides a port configuration method for a network device, where the method includes:
acquiring the device role of opposite terminal equipment connected with a port to be configured in the network equipment;
determining the port role of the port to be configured according to the device role of the network device and the device role of the opposite terminal device;
acquiring a port configuration template corresponding to the port to be configured from a server according to a preset corresponding relation between port roles and the port configuration template;
and configuring the port to be configured according to the acquired port configuration module.
In a second aspect, an apparatus for configuring a port of a network device is provided, the apparatus including:
the device role obtaining module is used for obtaining the device role of the opposite terminal device connected with the port to be configured in the network device;
a port role determination module, configured to determine a port role of the port to be configured according to a device role of the network device and a device role of an opposite device;
the port configuration template acquisition module is used for acquiring a port configuration template corresponding to the port to be configured from the server according to the corresponding relation between the preset port role and the port configuration template;
and the configuration module is used for configuring the port to be configured according to the acquired port configuration module.
Another embodiment of the present application also provides a computing device comprising at least one processor; and a memory communicatively coupled to the at least one processor; the memory stores instructions executable by the at least one processor, and the instructions are executed by the at least one processor to enable the at least one processor to execute the port configuration method of any network device provided by the embodiment of the application.
Another embodiment of the present application further provides a computer storage medium, where the computer storage medium stores computer-executable instructions, and the computer-executable instructions are configured to cause a computer to execute a port configuration method of any network device in the embodiments of the present application.
In the embodiment of the present application, a port to be configured can determine which port is of which device through a device role of the device in which the port is located and a device role of an opposite device, that is, confirmation of a network topology is achieved. Then, the corresponding port configuration template can be obtained for configuration according to the port role of the network device. Since the device role can represent the actual topological connection relationship at the port to be configured, the configuration can be automatically performed according to the port configuration template according to the actual topological connection relationship in the embodiment of the application. Therefore, operation and maintenance personnel do not need to configure each port at the network end and manually ensure the relationship between the port configuration and the network topology. In addition, the operation and maintenance personnel only need to carry out corresponding configuration on each type of ports. Once configured, the configured template may be reused subsequently. Therefore, the operation of the port configuration of the network equipment is simplified, and the efficiency of the port configuration of the network equipment is improved.
Additional features and advantages of the application will be set forth in the description which follows, and in part will be obvious from the description, or may be learned by the practice of the application. The objectives and other advantages of the application may be realized and attained by the structure particularly pointed out in the written description and claims hereof as well as the appended drawings.
Drawings
The accompanying drawings, which are included to provide a further understanding of the application and are incorporated in and constitute a part of this application, illustrate embodiment(s) of the application and together with the description serve to explain the application and not to limit the application. In the drawings:
fig. 1 is a schematic flowchart of a port configuration method of a network device in an embodiment of the present application;
FIG. 2 is a diagram illustrating determining a role of a port in an embodiment of the present application;
fig. 3 is a schematic diagram of a port configuration apparatus of a network device in an embodiment of the present application;
fig. 4 is a schematic structural diagram of a computing device according to an embodiment of the present application.
Detailed Description
In order to facilitate port configuration, embodiments of the present application provide a method, an apparatus, and a storage medium for port configuration of a network device. In order to better understand the technical solution provided by the embodiments of the present application, the following brief description is made on the basic principle of the solution:
for the sake of understanding, the terms referred to in the embodiments of the present application are first described, and include:
the role of the device: the network is divided into different layers, the devices in different layers have different device roles, and the devices in different layers have different functions. Namely, in the network topology connection relationship, the roles are divided according to the functions of the network devices. For example, the device roles may be divided into core network devices, aggregation devices, and access devices.
Port role: the port roles are divided according to different roles of the devices. Such as the lower connection port and the upper connection port of the access device, the lower connection port and the upper connection port of the convergence device, etc.
Role upper limit: the upper limit of the role of the device that the network device can act in the network topology is defined, for example, the upper limit of the role of the aggregation device is the aggregation device and cannot be a core network device, and the upper limit of the role of the access device is the access device.
In order to accurately configure a port device when a network device is deployed, in the embodiment of the present application, different port configuration templates are configured for ports with different roles. Thus, for a port to be configured, after determining the port role, the corresponding port configuration template can be downloaded through the network for port configuration.
In specific implementation, the devices at the two ends of the port to be configured may communicate with each other in device roles. Therefore, the port to be configured can determine which port is the device of which device through the device role of the device where the port is located and the device role of the opposite-end device, and the confirmation of the network topology is realized. Then the corresponding port configuration template can be obtained for configuration according to the port role. Since the device role can represent the actual topological connection relationship at the port to be configured, the configuration can be automatically performed according to the port configuration template according to the actual topological connection relationship in the embodiment of the application. Therefore, operation and maintenance personnel do not need to configure each port at the network end and manually ensure the relationship between the port configuration and the network topology. In addition, the operation and maintenance personnel only need to carry out corresponding configuration on each type of ports. Once configured, the configured template may be reused subsequently. Therefore, the operation of the port configuration of the network equipment is simplified, and the efficiency of the port configuration of the network equipment is improved.
The port configuration method of the network device provided in the embodiment of the present application is further described below with reference to the accompanying drawings, as shown in fig. 1, which is a schematic flow chart of the port configuration method of the network device, and includes the following steps:
step 101: and acquiring the device role of the opposite terminal device connected with the port to be configured in the network device.
In specific implementation, a message requesting the device role may be initiated to the peer device through the port to be configured, and then the peer device informs the network device of the device role.
However, the above implementation method needs to separately develop the interaction function between the network devices. In order to be compatible with the prior art, the role of the device can be more easily known. The inventor researches and proposes to carry the device role information through an extension field of a network topology discovery protocol. In specific implementation, the link layer discovery protocol LLDP message sent by the opposite end device may be received; and analyzing the LLDP message, and reading the device role in the specified extension field. Because the LLDP is a common network discovery protocol, the device role information is added in the extension field, so that the device role of the opposite device can be known while the network topology relationship is specifically determined.
In particular, the basic configuration of the network device may be implemented according to the prior art. The device role information may be configured into a base configuration template. In this way, the peer device can obtain the device role of the network device from the configuration template of the network device and then add the device role to the specified extension field of the LLDP packet. Thus, the LLDP message sent by the opposite terminal equipment can be received during implementation; and then analyzing the LLDP message, and reading the device role in the specified extension field to acquire the device role of the opposite terminal device.
Step 102: and determining the port role of the port to be configured according to the device role of the network device and the device role of the opposite terminal device.
For the own device role, the basic configuration template can be obtained according to the configuration issued by the network manager in advance, and the own device role is read from the basic configuration template. Furthermore, the learning method can be obtained by learning, which will be described in detail later and will not be described for a while.
Step 103: and acquiring a port configuration template corresponding to the port to be configured from the server according to the preset corresponding relation between the port role and the port configuration template.
Step 104: and configuring the port to be configured according to the acquired port configuration module.
For example, the lower port of the access device is generally connected to a terminal served by the port, so that the port can be configured according to actual service requirements, so as to implement configuration of the port. Certainly, in the specific implementation, the service terminal services are different, and the port configuration templates of the lower port of the access device may also be different.
Further, as described above, the device role of the network device may be obtained through learning, and the device role of the network device may be determined according to the device role of the peer device and the preset device role correspondence between the interconnected devices. The correspondence may be set according to the actual network topology.
In order to determine the role of the device more accurately, each device type may have a role upper limit, for example, the role upper limit of the core device is DSW (core device), the role upper limit of the aggregation device is PSW (aggregation device), and the role upper limit of the access device is ASW (access device). The role upper limit can be configured in the basic configuration template in advance, and the role upper limit is read from the basic configuration template. One purpose of setting the role upper limit is to support that the access device is not mistakenly considered to be aggregated when being directly connected to the core device. The specific learning method comprises the following steps:
1) and when the own device role is an unknown role and the upper limit of the device role is the convergence device, if the device role of the opposite-end device is the core device, determining that the own device role is the convergence device.
2) And when the own device role is an unknown role and the upper limit of the device role is the access device, if the device role of the opposite-end device is the core device or the convergence device, determining that the own device role is the access device.
3) And when the own device role is the access device and the upper limit of the device role is the convergence device, if the device role of the opposite-end device is the core device, updating the own device role as the convergence device.
This may be due to a network topology interconnection error. For example, if the aggregation device is connected to the aggregation device in the previous network topology, the aggregation device is regarded as an access device, and the device role of the aggregation device is regarded as an access device. After the network topology is changed (that is, the aggregation device is connected to the core device), the role of the device can be corrected after relearning.
4) And when the role of the self device is unknown, if the device role of the opposite terminal device is the access device, determining that the device role of the network device is the access device.
Thus, by the learning method, as long as the device role of the opposite device is obtained, the device role of the device can be determined or updated.
As described above, since the network topology may change, if the role of the device itself is determined according to the device role of the peer device and the device role corresponding relationship between the preset interconnection devices, the device role may be relearned in the embodiment of the present application to adapt to the change in the network topology. Specifically, the method comprises the following steps: according to the device role of the opposite-end device and the preset device role corresponding relation between the interconnection devices, after the device role of the device is determined, recording that the device role of the device is learned; then monitoring the connection state of all ports of the device and opposite-end equipment; when all the ports owned by the self are disconnected with the opposite terminal equipment, the role of the self equipment is changed into an unknown role; and then when it is monitored that at least one port of the terminal is connected with the opposite terminal equipment, determining the port connected with the opposite terminal equipment as a port to be configured, and returning to the step of acquiring the equipment role of the opposite terminal equipment connected with the port to be configured.
It should be noted that, of course, the basic configuration template may also not have a role upper limit configured at the same time, and then the device role of itself may also be determined according to the device role of the opposite end, including (1) - (3):
(1) and if the own device role is an unknown role and the device role of the opposite-end device is the core device, determining that the own device role is the convergence device.
(2) And if the own device role is an unknown role and the device role of the opposite-end device is the core device or the convergence device, determining that the own device role is the access device.
(3) And if the own device role is an unknown role and the opposite device role is the access device, determining that the network device role is the access device.
Further, in a specific implementation, as shown in fig. 2, the port role of the mobile device itself may be determined according to the following method:
1) if the device role of the device is core device and the device role of the opposite device is convergence device, determining the port role of the port to be configured as a lower connection port of the core device;
2) if the device role of the device is the convergence device and the device role of the opposite-end device is the core device, determining the port role of the port to be configured as the uplink port of the convergence device;
3) if the device role of the self device is the convergence device and the device role of the opposite device is the access device, determining the port role of the port to be configured as a lower connection port of the convergence device;
4) if the device role of the device is an access device and the device role of the opposite-end device is a convergence device, determining the port role of the port to be configured as an uplink port of the access device;
5) if the own device role and the opposite device role are both access devices, determining the port role of the port to be configured as a cascade port of the access device;
6) if the device role of the device and the device role of the opposite-end device are both sink devices, determining the port role of the port to be configured as a lower connection port of the sink device;
7) and if the own device role is the access device and the opposite device role is the unknown role, determining that the port role of the port to be configured is the downlink port of the access device.
In summary, the device roles of the self device and the opposite device and the corresponding relationship can be used to conveniently determine the port role of the port to be configured, and then the correct port configuration template can be obtained to perform port configuration.
In the following, to facilitate understanding of the technical solutions provided in the embodiments of the present application, an access device is taken as an example to illustrate this.
First, a basic configuration template is configured for an access device, and information indicating a device role of the access device and a role upper limit are included in the basic configuration template. If the device role information is not configured, the role information is represented by unknown by default, the upper limit of the role is the access device, and the access device obtains a basic configuration template through the prior art and then knows that the role of the network device cannot be determined according to the unknown. When port 1 in the access device is configured, it is known through port 1 that the device role of the opposite device is the aggregation device, and the device role of the network device itself can be automatically determined as the access device according to the role upper limit. Then, the port role of the port 1 can be determined to be the uplink port of the access device, and then a port configuration template of the uplink port of the access device can be downloaded from the server for port configuration.
Based on the same inventive concept, the embodiment of the present application further provides a port configuration device of a network device. As shown in fig. 3, the apparatus includes:
a device role obtaining module 301, configured to obtain a device role of an opposite device to which a port to be configured in the network device is connected;
a port role determination module 302, configured to determine a port role of the port to be configured according to a device role of the network device and a device role of an opposite device;
a port configuration template obtaining module 303, configured to obtain, from the server, a port configuration template corresponding to the port to be configured according to a preset correspondence between a port role and the port configuration template;
a configuration module 304, configured to configure the port to be configured according to the obtained port configuration module.
Further, the device role obtaining module specifically includes:
a message receiving unit, configured to receive a link layer discovery protocol LLDP message sent by the peer device;
and the analyzing unit is used for analyzing the LLDP message and reading the device role in the specified extension field.
Further, the apparatus further comprises:
and the device role determining module of the network device is used for acquiring a basic configuration template according to configuration issued in advance by a network manager before the port role determining module determines the port role of the port to be configured according to the device role of the network device and the device role of the opposite terminal device, and reading the device role of the network device from the basic configuration template.
Further, the apparatus further comprises:
and the device role learning module of the network device is used for determining the device role of the network device according to the device role of the opposite terminal device and the preset device role corresponding relation between the interconnection devices before the port role determining module determines the port role of the port to be configured according to the device role of the network device and the device role of the opposite terminal device.
Further, the device role learning module of the network device specifically includes:
the first learning unit is used for determining that the device role of the network device is the sink device if the device role of the opposite-end device is the core device when the device role of the network device is the unknown role and the upper limit of the device role is the sink device;
a second learning unit, configured to determine that the role of the network device is an access device if the device role of the peer device is a core device or a convergence device when the role of the network device is an unknown role and the upper limit of the device role is the access device;
a third learning unit, configured to update that the device role of the network device is a sink device if the device role of the peer device is a core device when the device role of the network device is an access device and an upper limit of the device role is the sink device;
and the fourth learning unit is configured to determine that the device role of the network device is the access device if the device role of the peer device is the access device when the device role of the network device is the unknown role.
Further, the apparatus further comprises:
the recording module is used for recording that the device role of the network device is learned after the device role learning module of the network device determines the device role of the network device according to the device role of opposite-end devices and the preset device role corresponding relation between the interconnection devices;
the monitoring module is used for monitoring the connection state of all ports of the network equipment and opposite terminal equipment;
the updating module is used for changing the device role of the network device into an unknown role when all ports owned by the network device are disconnected with opposite-end devices;
and the return module is used for determining the port connected with the opposite terminal equipment as the port to be configured when the situation that the connection between at least one port of the network equipment and the opposite terminal equipment is established is monitored, and triggering the equipment role acquisition module to return to execute the step of acquiring the equipment role of the opposite terminal equipment connected with the port to be configured.
Further, the apparatus further comprises:
a determining module, configured to determine that an upper limit of a device role of the network device is a convergence device before determining that the device role of the network device is the convergence device if the device role of the peer device is the convergence device and the device role of the network device is the access device by the third learning unit.
Further, the port role determination module specifically includes:
a first determining unit, configured to determine, if a device role of the network device is a core device and a device role of an opposite device is a convergence device, that a port role of the port to be configured is a lower connection port of the core device;
a second determining unit, configured to determine, if the device role of the network device is a convergence device and the device role of the opposite-end device is a core device, that the port role of the port to be configured is an uplink port of the convergence device;
a third determining unit, configured to determine, if the device role of the network device is a convergence device and the device role of the opposite-end device is an access device, that the port role of the port to be configured is a lower connection port of the convergence device;
a fourth determining unit, configured to determine, if the device role of the network device is an access device and the device role of the peer device is a convergence device, that the port role of the port to be configured is a lower connection port of the access device;
a fifth determining unit, configured to determine, if both the device role of the network device and the device role of the peer device are access devices, that the port role of the port to be configured is a cascade port of the access device;
a sixth determining unit, configured to determine, if the device role of the network device and the device role of the peer device are both sink devices, that the port role of the port to be configured is a lower connection port of the sink device;
a seventh determining unit, configured to determine that the port role of the port to be configured is a downlink port of the access device if the device role of the network device is the access device and the device role of the peer device is an unknown role.
Having described the port configuration method and apparatus of a network device according to an exemplary embodiment of the present application, a computing apparatus according to another exemplary embodiment of the present application is described next.
As will be appreciated by one skilled in the art, aspects of the present application may be embodied as a system, method or program product. Accordingly, various aspects of the present application may be embodied in the form of: an entirely hardware embodiment, an entirely software embodiment (including firmware, microcode, etc.) or an embodiment combining hardware and software aspects that may all generally be referred to herein as a "circuit," module "or" system.
In some possible implementations, a computing device according to the present application may include at least one processor, and at least one memory. The memory stores program code, and the program code, when executed by the processor, causes the processor to execute the steps of the port configuration method of the network device according to various exemplary embodiments of the present application described above in the present specification. For example, the processor may perform steps 101-104 as shown in FIG. 1.
The computing device 130 according to this embodiment of the present application is described below with reference to fig. 4. The computing device 130 shown in fig. 4 is only an example and should not bring any limitations to the function and scope of use of the embodiments of the present application.
As shown in FIG. 4, computing device 130 is embodied in the form of a general purpose computing device. Components of computing device 130 may include, but are not limited to: the at least one processor 131, the at least one memory 132, and a bus 133 that connects the various system components (including the memory 132 and the processor 131).
Bus 133 represents one or more of any of several types of bus structures, including a memory bus or memory controller, a peripheral bus, a processor, or a local bus using any of a variety of bus architectures.
The memory 132 may include readable media in the form of volatile memory, such as Random Access Memory (RAM)1321 and/or cache memory 1322, and may further include Read Only Memory (ROM) 1323.
Memory 132 may also include a program/utility 1325 having a set (at least one) of program modules 1324, such program modules 1324 including, but not limited to: an operating system, one or more application programs, other program modules, and program data, each of which, or some combination thereof, may comprise an implementation of a network environment.
Computing device 130 may also communicate with one or more external devices 134 (e.g., keyboard, pointing device, etc.), with one or more devices that enable a user to interact with computing device 130, and/or with any devices (e.g., router, modem, etc.) that enable computing device 130 to communicate with one or more other computing devices. Such communication may occur via input/output (I/O) interfaces 135. Also, computing device 130 may communicate with one or more networks (e.g., a Local Area Network (LAN), a Wide Area Network (WAN), and/or a public network, such as the internet) via network adapter 136. As shown, network adapter 136 communicates with other modules for computing device 130 over bus 133. It should be understood that although not shown in the figures, other hardware and/or software modules may be used in conjunction with computing device 130, including but not limited to: microcode, device drivers, redundant processors, external disk drive arrays, RAID systems, tape drives, and data backup storage systems, among others.
In some possible embodiments, the various aspects of the port configuration method of the network device provided in the present application may also be implemented in the form of a program product including program code for causing a computer device to perform the steps in the port configuration method of the network device according to various exemplary embodiments of the present application described above in this specification when the program product is run on the computer device, for example, the computer device may perform steps 101 and 104 as shown in fig. 1.
The program product may employ any combination of one or more readable media. The readable medium may be a readable signal medium or a readable storage medium. A readable storage medium may be, for example, but not limited to, an electronic, magnetic, optical, electromagnetic, infrared, or semiconductor system, apparatus, or device, or any combination of the foregoing. More specific examples (a non-exhaustive list) of the readable storage medium include: an electrical connection having one or more wires, a portable disk, a hard disk, a Random Access Memory (RAM), a read-only memory (ROM), an erasable programmable read-only memory (EPROM or flash memory), an optical fiber, a portable compact disc read-only memory (CD-ROM), an optical storage device, a magnetic storage device, or any suitable combination of the foregoing.
The program product for port configuration of a network device of an embodiment of the present application may employ a portable compact disc read only memory (CD-ROM) and include program code, and may be run on a computing device. However, the program product of the present application is not limited thereto, and in this document, a readable storage medium may be any tangible medium that can contain, or store a program for use by or in connection with an instruction execution system, apparatus, or device.
A readable signal medium may include a propagated data signal with readable program code embodied therein, for example, in baseband or as part of a carrier wave. Such a propagated data signal may take any of a variety of forms, including, but not limited to, electro-magnetic, optical, or any suitable combination thereof. A readable signal medium may also be any readable medium that is not a readable storage medium and that can communicate, propagate, or transport a program for use by or in connection with an instruction execution system, apparatus, or device.
Program code embodied on a readable medium may be transmitted using any appropriate medium, including but not limited to wireless, wireline, optical fiber cable, RF, etc., or any suitable combination of the foregoing.
Program code for carrying out operations of the present application may be written in any combination of one or more programming languages, including an object oriented programming language such as Java, C + + or the like and conventional procedural programming languages, such as the "C" programming language or similar programming languages. The program code may execute entirely on the user computing device, partly on the user equipment, as a stand-alone software package, partly on the user computing device and partly on a remote computing device, or entirely on the remote computing device or server. In the case of remote computing devices, the remote computing device may be connected to the user computing device through any kind of network, including a Local Area Network (LAN) or a Wide Area Network (WAN), or may be connected to an external computing device (e.g., through the internet using an internet service provider).
It should be noted that although several units or sub-units of the apparatus are mentioned in the above detailed description, such division is merely exemplary and not mandatory. Indeed, the features and functions of two or more units described above may be embodied in one unit, according to embodiments of the application. Conversely, the features and functions of one unit described above may be further divided into embodiments by a plurality of units.
Further, while the operations of the methods of the present application are depicted in the drawings in a particular order, this does not require or imply that these operations must be performed in this particular order, or that all of the illustrated operations must be performed, to achieve desirable results. Additionally or alternatively, certain steps may be omitted, multiple steps combined into one step execution, and/or one step broken down into multiple step executions.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
While the preferred embodiments of the present application have been described, additional variations and modifications in those embodiments may occur to those skilled in the art once they learn of the basic inventive concepts. Therefore, it is intended that the appended claims be interpreted as including preferred embodiments and all alterations and modifications as fall within the scope of the application.
It will be apparent to those skilled in the art that various changes and modifications may be made in the present application without departing from the spirit and scope of the application. Thus, if such modifications and variations of the present application fall within the scope of the claims of the present application and their equivalents, the present application is intended to include such modifications and variations as well.

Claims (14)

1. A port configuration method of a network device, comprising:
acquiring the device role of opposite terminal equipment connected with a port to be configured in the network equipment;
determining the port role of the port to be configured according to the device role of the network device and the device role of the opposite terminal device;
acquiring a port configuration template corresponding to the port to be configured from a server according to a preset corresponding relation between port roles and the port configuration template;
configuring the port to be configured according to the acquired port configuration template;
determining the port role of the port to be configured according to the device role of the network device and the device role of the opposite-end device, specifically comprising:
if the device role of the network device is a core device and the device role of the opposite-end device is a convergence device, determining the port role of the port to be configured as a lower connection port of the core device;
if the device role of the network device is a convergence device and the device role of the opposite-end device is a core device, determining the port role of the port to be configured as an uplink port of the convergence device;
if the device role of the network device is a convergence device and the device role of the opposite-end device is an access device, determining the port role of the port to be configured as a lower connection port of the convergence device;
if the device role of the network device is an access device and the device role of the opposite-end device is a convergence device, determining the port role of the port to be configured as an uplink port of the access device;
if the device role of the network device and the device role of the opposite terminal device are both access devices, determining that the port role of the port to be configured is a cascade port of the access device;
if the device role of the network device and the device role of the opposite terminal device are both sink devices, determining that the port role of the port to be configured is a lower connection port of the sink device;
and if the device role of the network device is the access device and the device role of the opposite-end device is the unknown role, determining that the port role of the port to be configured is the downlink port of the access device.
2. The method according to claim 1, wherein the obtaining of the device role of the peer device connected to the port to be configured in the network device specifically includes:
receiving a Link Layer Discovery Protocol (LLDP) message sent by the opposite terminal equipment;
and analyzing the LLDP message, and reading the device role in the specified extension field.
3. The method of claim 1, wherein before determining the port role of the port to be configured according to the device role of the network device and the device role of the peer device, the method further comprises:
and acquiring a basic configuration template according to the configuration issued by the network manager in advance, and reading the device role of the network device from the basic configuration template.
4. The method of claim 1, wherein before determining the port role of the port to be configured according to the device role of the network device and the device role of the peer device, the method further comprises:
and determining the device role of the network device according to the device role of the opposite-end device and the preset device role corresponding relation between the interconnection devices.
5. The method according to claim 4, wherein determining the device role of the network device according to the device role of the peer device and a preset device role correspondence between the interconnected devices specifically includes:
when the device role of the network device is an unknown role and the upper limit of the device role is the sink device, if the device role of the opposite-end device is the core device, determining that the device role of the network device is the sink device;
when the device role of the network device is an unknown role and the upper limit of the device role is an access device, if the device role of the opposite-end device is a core device or a convergence device, determining that the device role of the network device is the access device;
when the device role of the network device is an access device and the upper limit of the device role is a sink device, if the device role of the opposite-end device is a core device, updating that the device role of the network device is the sink device;
and when the device role of the network device is an unknown role, if the device role of the opposite-end device is the access device, determining that the device role of the network device is the access device.
6. The method of claim 5, wherein after determining the device role of the network device according to the device role of the peer device and a preset device role correspondence between the interconnected devices, the method further comprises:
recording that a device role of the network device is learned;
monitoring the connection state of all ports of the network equipment and opposite terminal equipment;
when all ports owned by the network equipment are disconnected with opposite terminal equipment, changing the equipment role of the network equipment into an unknown role;
and when it is monitored that at least one port of the network equipment is connected with opposite terminal equipment, determining the port connected with the opposite terminal equipment as a port to be configured, and returning to the step of acquiring the equipment role of the opposite terminal equipment connected with the port to be configured.
7. An apparatus for port configuration of a network device, the apparatus comprising:
the device role obtaining module is used for obtaining the device role of the opposite terminal device connected with the port to be configured in the network device;
a port role determination module, configured to determine a port role of the port to be configured according to a device role of the network device and a device role of an opposite device;
the port configuration template acquisition module is used for acquiring a port configuration template corresponding to the port to be configured from the server according to the corresponding relation between the preset port role and the port configuration template;
the configuration module is used for configuring the port to be configured according to the acquired port configuration template;
the port role determination module specifically includes:
a first determining unit, configured to determine, if a device role of the network device is a core device and a device role of an opposite device is a convergence device, that a port role of the port to be configured is a lower connection port of the core device;
a second determining unit, configured to determine, if the device role of the network device is a convergence device and the device role of the opposite-end device is a core device, that the port role of the port to be configured is an uplink port of the convergence device;
a third determining unit, configured to determine, if the device role of the network device is a convergence device and the device role of the opposite-end device is an access device, that the port role of the port to be configured is a lower connection port of the convergence device;
a fourth determining unit, configured to determine, if the device role of the network device is an access device and the device role of the peer device is a convergence device, that the port role of the port to be configured is an uplink port of the access device;
a fifth determining unit, configured to determine, if both the device role of the network device and the device role of the peer device are access devices, that the port role of the port to be configured is a cascade port of the access device;
a sixth determining unit, configured to determine, if the device role of the network device and the device role of the peer device are both sink devices, that the port role of the port to be configured is a lower connection port of the sink device;
a seventh determining unit, configured to determine that the port role of the port to be configured is a downlink port of the access device if the device role of the network device is the access device and the device role of the peer device is an unknown role.
8. The apparatus according to claim 7, wherein the device role acquiring module specifically includes:
a message receiving unit, configured to receive a link layer discovery protocol LLDP message sent by the peer device;
and the analyzing unit is used for analyzing the LLDP message and reading the device role in the specified extension field.
9. The apparatus of claim 7, further comprising:
and the device role determining module of the network device is used for acquiring a basic configuration template according to configuration issued in advance by a network manager before the port role determining module determines the port role of the port to be configured according to the device role of the network device and the device role of the opposite terminal device, and reading the device role of the network device from the basic configuration template.
10. The apparatus of claim 7, further comprising:
and the device role learning module of the network device is used for determining the device role of the network device according to the device role of the opposite terminal device and the preset device role corresponding relation between the interconnection devices before the port role determining module determines the port role of the port to be configured according to the device role of the network device and the device role of the opposite terminal device.
11. The apparatus of claim 10, wherein the device role learning module of the network device specifically includes:
a first learning unit, configured to determine that a device role of the network device is a sink device if a device role of an opposite device is a core device when the device role of the network device is an unknown role and an upper limit of the device role is the sink device;
a second learning unit, configured to determine that a device role of the network device is an access device if a device role of an opposite device is a core device or a sink device when the device role of the network device is an unknown role and an upper limit of the device role is the access device;
a third learning unit, configured to update that the device role of the network device is a convergence device if the device role of the peer device is a core device when the device role of the network device is an access device and the upper limit of the device role is the convergence device;
and the fourth learning unit is configured to determine that the device role of the network device is the access device if the device role of the peer device is the access device when the device role of the network device is the unknown role.
12. The apparatus of claim 11, further comprising:
the recording module is used for recording that the device role of the network device is learned after the device role learning module of the network device determines the device role of the network device according to the device role of opposite-end devices and the preset device role corresponding relation between the interconnection devices;
the monitoring module is used for monitoring the connection state of all ports of the network equipment and opposite terminal equipment;
the updating module is used for changing the device role of the network device into an unknown role when all ports owned by the network device are disconnected with the opposite device;
and the return module is used for determining the port connected with the opposite terminal equipment as the port to be configured when the situation that the connection between at least one port of the network equipment and the opposite terminal equipment is established is monitored, and triggering the equipment role acquisition module to return to execute the step of acquiring the equipment role of the opposite terminal equipment connected with the port to be configured.
13. A computer-readable medium having stored thereon computer-executable instructions for performing the method of any one of claims 1-6.
14. A computing device, comprising: at least one processor; and a memory communicatively coupled to the at least one processor; wherein the memory stores instructions executable by the at least one processor to enable the at least one processor to perform the method of any one of claims 1-6.
CN201811161574.1A 2018-09-30 2018-09-30 Port configuration method and device of network equipment and storage medium Active CN109039788B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201811161574.1A CN109039788B (en) 2018-09-30 2018-09-30 Port configuration method and device of network equipment and storage medium

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201811161574.1A CN109039788B (en) 2018-09-30 2018-09-30 Port configuration method and device of network equipment and storage medium

Publications (2)

Publication Number Publication Date
CN109039788A CN109039788A (en) 2018-12-18
CN109039788B true CN109039788B (en) 2022-02-25

Family

ID=64615597

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201811161574.1A Active CN109039788B (en) 2018-09-30 2018-09-30 Port configuration method and device of network equipment and storage medium

Country Status (1)

Country Link
CN (1) CN109039788B (en)

Families Citing this family (7)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112019365A (en) * 2019-05-31 2020-12-01 华为技术有限公司 Method and device for determining port attribute
CN113691386A (en) * 2020-05-19 2021-11-23 中兴通讯股份有限公司 Resource configuration method, network device, electronic device and computer readable medium
CN113055232B (en) * 2021-03-11 2022-07-12 浪潮思科网络科技有限公司 Network configuration deployment method, device and equipment
CN114338413B (en) * 2021-12-30 2024-01-26 中国工商银行股份有限公司 Method, device and storage medium for determining topological relation of equipment in network
CN114520765A (en) * 2022-01-13 2022-05-20 锐捷网络股份有限公司 Automatic configuration method and device of equipment
CN114697774B (en) * 2022-04-11 2023-10-03 中国电信股份有限公司 Port management method and device, computer readable storage medium and electronic equipment
CN115562738B (en) * 2022-11-14 2023-03-10 苏州浪潮智能科技有限公司 Port configuration method, component and hard disk expansion device

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7380025B1 (en) * 2003-10-07 2008-05-27 Cisco Technology, Inc. Method and apparatus providing role-based configuration of a port of a network element
CN102123104A (en) * 2011-04-14 2011-07-13 福建星网锐捷网络有限公司 Network device configuration correcting method and network device
CN108234183A (en) * 2016-12-22 2018-06-29 中国电信股份有限公司 The configuration system and method for distal end business
CN108259391A (en) * 2017-06-29 2018-07-06 新华三技术有限公司 A kind of port configuration method and device
CN108566296A (en) * 2018-03-26 2018-09-21 新华三技术有限公司 Network equipment layered approach, network management device and computer readable storage medium

Family Cites Families (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN106302071B (en) * 2015-05-29 2020-02-14 华为技术有限公司 Adapter, network equipment and port configuration method
CN107911251B (en) * 2017-12-08 2021-04-20 锐捷网络股份有限公司 Network equipment configuration method, device and medium
CN108334465B (en) * 2018-02-06 2020-05-22 深圳壹账通智能科技有限公司 Configuration method, device and equipment of communication interface and computer readable storage medium

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US7380025B1 (en) * 2003-10-07 2008-05-27 Cisco Technology, Inc. Method and apparatus providing role-based configuration of a port of a network element
CN102123104A (en) * 2011-04-14 2011-07-13 福建星网锐捷网络有限公司 Network device configuration correcting method and network device
CN108234183A (en) * 2016-12-22 2018-06-29 中国电信股份有限公司 The configuration system and method for distal end business
CN108259391A (en) * 2017-06-29 2018-07-06 新华三技术有限公司 A kind of port configuration method and device
CN108566296A (en) * 2018-03-26 2018-09-21 新华三技术有限公司 Network equipment layered approach, network management device and computer readable storage medium

Also Published As

Publication number Publication date
CN109039788A (en) 2018-12-18

Similar Documents

Publication Publication Date Title
CN109039788B (en) Port configuration method and device of network equipment and storage medium
US11611487B2 (en) Model driven process for automated deployment of domain 2.0 virtualized services and applications on cloud infrastructure
US10545750B2 (en) Distributed upgrade in virtualized computing environments
US11336567B2 (en) Service aware virtual private network for optimized forwarding in cloud native environment
CN106716926B (en) Automated stand-alone boot circuit for hardware inventory
EP3382942A1 (en) Network service configuration method and network management device
CN111181758B (en) Configuration file generation method and device
US11636016B2 (en) Cloud simulation and validation system
WO2017121153A1 (en) Software upgrading method and device
CN109120444B (en) Cloud resource management method, processor and storage medium
WO2018137520A1 (en) Service recovery method and apparatus
WO2020010906A1 (en) Method and device for operating system (os) batch installation, and network device
CN107733717B (en) Network configuration method for mobile operation and maintenance of cloud platform
CN113938378A (en) Method, device and medium for verifying network device configuration in cloud network environment
CN112291081B (en) Method, system and storage medium for auditing controller cluster data by cloud management platform
US20150127788A1 (en) Centralized enterprise image upgrades for distributed campus networks
CN112099902A (en) Network adapter configuration method and device of virtual machine, electronic device and storage medium
US11863378B2 (en) Automated provisioning of endpoint devices with management connectivity
CN112994915A (en) SD-WAN service arranging method, system, equipment and storage medium
WO2023003812A1 (en) Automated provisioning of endpoint devices with management connectivity
CN110955537B (en) Method and device for containing pipes by physical machine
KR20150088462A (en) Method for linking network device in cloud environment and apparatus therefor
CN110891239B (en) PNF configuration and PNFD TOSCA implementation method and device
CN114297083A (en) Agent test method, device, electronic equipment and readable medium
CN113923149A (en) Network access method, device, network system, electronic equipment and storage medium

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