CN110430265A - A kind of method and device obtaining server and inter-exchange corresponding relationship - Google Patents

A kind of method and device obtaining server and inter-exchange corresponding relationship Download PDF

Info

Publication number
CN110430265A
CN110430265A CN201910721208.5A CN201910721208A CN110430265A CN 110430265 A CN110430265 A CN 110430265A CN 201910721208 A CN201910721208 A CN 201910721208A CN 110430265 A CN110430265 A CN 110430265A
Authority
CN
China
Prior art keywords
interface
link information
server
information
interchanger
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.)
Pending
Application number
CN201910721208.5A
Other languages
Chinese (zh)
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.)
Beijing QIYI Century Science and Technology Co Ltd
Original Assignee
Beijing QIYI Century Science and 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 Beijing QIYI Century Science and Technology Co Ltd filed Critical Beijing QIYI Century Science and Technology Co Ltd
Priority to CN201910721208.5A priority Critical patent/CN110430265A/en
Publication of CN110430265A publication Critical patent/CN110430265A/en
Pending legal-status Critical Current

Links

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/12Discovery or management of network topologies
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L67/00Network arrangements or protocols for supporting network services or applications
    • H04L67/01Protocols
    • H04L67/10Protocols in which an application is distributed across nodes in the network
    • H04L67/104Peer-to-peer [P2P] networks
    • H04L67/1087Peer-to-peer [P2P] networks using cross-functional networking aspects
    • H04L67/1091Interfacing with client-server systems or between P2P systems
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L69/00Network arrangements, protocols or services independent of the application payload and not provided for in the other groups of this subclass
    • H04L69/30Definitions, standards or architectural aspects of layered protocol stacks
    • H04L69/32Architecture of open systems interconnection [OSI] 7-layer type protocol stacks, e.g. the interfaces between the data link level and the physical level
    • H04L69/322Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions
    • H04L69/324Intralayer communication protocols among peer entities or protocol data unit [PDU] definitions in the data link layer [OSI layer 2], e.g. HDLC

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Computer Security & Cryptography (AREA)
  • Computing Systems (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Abstract

The present invention provides a kind of method and device for obtaining server and inter-exchange corresponding relationship, after receiving the first link information of each first interface transmission and receiving the second link information of each second interface transmission, second link information of the first link information and the transmission of each second interface based on the transmission of each first interface, second link information of the first link information and the transmission of each second interface based on the transmission of each first interface, there are the first link information of same-interface information and the second link informations for acquisition, the server and interchanger of the first link information and the instruction of the second link information that same-interface information will be present are determined as the server with corresponding relationship and interchanger, realize the corresponding relationship for automatically obtaining server and inter-exchange.

Description

A kind of method and device obtaining server and inter-exchange corresponding relationship
Technical field
The invention belongs to technical field of data processing, more specifically more particularly to a kind of acquisition server and interchanger Between corresponding relationship method and device.
Background technique
Currently as the computer room of data processing centre, need to count server and interchanger in computer room in its building process Between corresponding relationship, the server and inter-exchange corresponding relationship be used to show: server and interchanger with corresponding relationship Interface and server and the respective address of interchanger etc. between title, server and interchanger for interaction, so-called tool The server and interchanger for having corresponding relationship refer to the server that information exchange is carried out by the communication link between respective interface And interchanger, it is referred to as being there is the server and interchanger of syntople, but server and inter-exchange are corresponded to and closed System is manually to be counted to obtain by engineering staff, when the connection between any server and interchanger is changed, needs engineering people Member re-starts statistics, to increase the workload of engineering staff.
Summary of the invention
In view of this, the purpose of the present invention is to provide it is a kind of acquisition server and inter-exchange corresponding relationship method and Device, for automatically determining server and interchanger with corresponding relationship, to reduce the workload of engineering staff.Technical solution It is as follows:
The present invention provides a kind of method for obtaining server and inter-exchange corresponding relationship, which comprises
The first link information of each first interface transmission is received, the first interface is located on server, and described first Link information is at least used to indicate the interface message that the server generates the interface interacted with interchanger;
The second link information of each second interface transmission is received, the second interface is located on interchanger, and described second Link information is at least used to indicate the interface message that switch-to-server generates the interface of interaction;
Second link information of the first link information and the transmission of each second interface based on the transmission of each first interface, is obtained Take that there are the first link information of same-interface information and the second link informations;
By the server indicated there are the first link information of same-interface information and the second link information and exchange Machine is determined as the server with corresponding relationship and interchanger.
Preferably, first link information for receiving each first interface transmission includes:
Receive the first link layer discovery protocol message of each first interface transmission, the first Link Layer Discovery Protocol report First link information is carried in text, and first link layer discovery protocol message is by being deployed in the server Link Layer Discovery Protocol module generates;
Or
It is logged on by the first interface in the server where the first interface, and passes through Link Layer Discovery Protocol and order First link information is read in order from the server.
Preferably, second link information for receiving each second interface transmission includes:
Receive the second link layer discovery protocol message of each second interface transmission, the second Link Layer Discovery Protocol report Second link information is carried in text, and second link layer discovery protocol message is to enable link in the interchanger It is generated after layer discovery protocol module by the Link Layer Discovery Protocol module;
Or
The second link letter is crawled from the interchanger by the second interface and using netconfig order Breath.
Preferably, the method also includes:
First link information for supporting the first process of Simple Network Management Protocol to report in the server is obtained, First process reports first link information when the server changes Interface status;
And/or
Second link information for supporting the second process of Simple Network Management Protocol to report in the interchanger is obtained, Second process reports second link information when the interchanger changes Interface status.
Preferably, the method also includes: based on corresponding relationship server and interchanger, first interface transmission Second link information of the first link information and the transmission of each second interface draws network topology, and the network topology is for opening up Show the corresponding relationship of multiple servers and inter-exchange.
Preferably, the first chain that the server and interchanger based on corresponding relationship, each first interface transmit Second link information of road information and the transmission of each second interface, drawing network topology includes: to have corresponding relationship to any Server and interchanger execute following steps:
First node that server in the corresponding relationship is determined as in network topology and will be in the corresponding relationship Interchanger is determined as the second node in network topology;
From the first interface of the server transmit the first link information in extract the server identification information and from The identification information of the interchanger is extracted in second link information of the second interface transmission of the interchanger, and will be somebody's turn to do in network topology First node is indicated with the identification information of the server, by the second node in network topology with the identification information table of the interchanger Show;
First node is connected with second node by a line, and the side and the first link information and the second link are believed Breath corresponds to.
Preferably, described to connect first node by a line with second node, and by the side and the first link information It is corresponding with the second link information to include:
To be connected between first node and second node first while and when second, first side is directed toward the by first node First node is directed toward by second node in two nodes, second side;
Based on first link information and second link information, obtains the server and interacted with interchanger generation Interface first interface information and the interchanger and the server generate the second interface information of the interface interacted, described the One interface message shows that the server sends the interface that data use to the interchanger, and the second interface information shows the exchange Machine sends the interface that data use to the server;
The first interface information is loaded in first side, and the second interface letter is loaded in second side Breath, to obtain the access for showing the corresponding relationship of the server and interchanger in network topology, described displayings server with The access of the corresponding relationship of interchanger includes the first node that the server is used as, the second node and institute which is used as State between first node and the second node first while and when second.
The present invention also provides a kind of device for obtaining server and inter-exchange corresponding relationship, described device includes:
Receiving unit is passed for receiving the first link information of each first interface transmission and receiving each second interface The second defeated link information, the first interface are located on server, and first link information is at least used to indicate the clothes Business device generates the interface message of the interface interacted with interchanger, and the second interface is located on interchanger, the second link letter Breath is at least used to indicate the interface message that switch-to-server generates the interface of interaction;
The of acquiring unit, the first link information for being transmitted based on each first interface and the transmission of each second interface Two link informations, there are the first link information of same-interface information and the second link informations for acquisition;
Determination unit, for indicating described there are the first link information of same-interface information and the second link information Server and interchanger are determined as the server with corresponding relationship and interchanger.
The present invention also provides a kind of equipment for obtaining server and inter-exchange corresponding relationship, the equipment includes: communication Interface, memory and processor;
The processor, for received by the communication interface transmission of each first interface the first link information and The second link information for receiving the transmission of each second interface, the first link information based on the transmission of each first interface and each the Second link information of two interfaces transmission, there are the first link information of same-interface information and the second link informations for acquisition;It will The server indicated there are the first link information of same-interface information and the second link information and interchanger are determined as having There are the server and interchanger of corresponding relationship, the first interface is located on server, and first link information is at least used for Indicate that the server generates the interface message of the interface interacted with interchanger, the second interface is located on interchanger, described Second link information is at least used to indicate the interface message that switch-to-server generates the interface of interaction;
The memory, for storing first link information and the second link information.
The present invention also provides a kind of storage medium, computer program code, the calculating are stored in the storage medium The method that machine program code realizes above-mentioned acquisition server and inter-exchange corresponding relationship when executing.
By above-mentioned technical proposal it is found that receiving the first link information of each first interface transmission and receiving every After second link information of a second interface transmission, the first link information and each second based on the transmission of each first interface is connect Second link information of port transmission, the of the first link information and the transmission of each second interface based on the transmission of each first interface Two link informations are obtained there are the first link information of same-interface information and the second link information, and same-interface letter will be present The server and interchanger of first link information of breath and the instruction of the second link information are determined as the server with corresponding relationship And interchanger, realize the corresponding relationship for automatically obtaining server and inter-exchange.If some server and/or some interchanger Link information change, the link information after still being able to receive the change of first interface and/or second interface transmission, into And corresponding relationship is redefined, therefore either obtain link information or link information change for the first time, it can automatically determine The corresponding relationship of server and inter-exchange counts manually without engineering staff, reduces the workload of engineering staff.
Detailed description of the invention
In order to more clearly explain the embodiment of the invention or the technical proposal in the existing technology, to embodiment or will show below There is attached drawing needed in technical description to be briefly described, it should be apparent that, the accompanying drawings in the following description is the present invention Some embodiments for those of ordinary skill in the art without creative efforts, can also basis These attached drawings obtain other attached drawings.
Fig. 1 is a kind of process of method for obtaining server and inter-exchange corresponding relationship provided in an embodiment of the present invention Figure;
Fig. 2 is the process of another method for obtaining server and inter-exchange corresponding relationship provided in an embodiment of the present invention Figure;
Fig. 3 is a kind of schematic diagram of network topology provided in an embodiment of the present invention;
Fig. 4 is a kind of schematic diagram of adjacency table provided in an embodiment of the present invention;
Fig. 5 is that a kind of structure of device for obtaining server and inter-exchange corresponding relationship provided in an embodiment of the present invention is shown It is intended to;
Fig. 6 is that a kind of structure of equipment for obtaining server and inter-exchange corresponding relationship provided in an embodiment of the present invention is shown It is intended to.
Specific embodiment
In order to make the object, technical scheme and advantages of the embodiment of the invention clearer, below in conjunction with the embodiment of the present invention In attached drawing, technical scheme in the embodiment of the invention is clearly and completely described, it is clear that described embodiment is A part of the embodiment of the present invention, instead of all the embodiments.Based on the embodiments of the present invention, those of ordinary skill in the art Every other embodiment obtained without making creative work, shall fall within the protection scope of the present invention.
Referring to Fig. 1, it illustrates a kind of acquisition server provided in an embodiment of the present invention and inter-exchange corresponding relationships Method may comprise steps of automatically determining server and interchanger with corresponding relationship:
S101: the first link information of each first interface transmission is received, wherein first interface is located on server, still It does not limit on a server and only has one for obtaining the first interface of the first link information, such as server can be with Multiple switch interacts, then can configure first interface for multiple interfaces in the server, by this multiple first Interface transmits first link information respectively, and the corresponding interchanger of the first link information of this multiple first interface transmission is not Together, to indicate that server can be interacted with multiple switch by this multiple first link information.Although in another example one A server can be interacted with multiple switch, but only configure first interface for an interface in the server The first link information is transmitted, the interface saved on server can be maximized in this way.
Furthermore the present embodiment can be handed over the interface interacted in multiplexed services device with interchanger with interchanger Mutual interface not only has the function that data interaction is carried out with interchanger, additionally it is possible to as first interface to have the first chain of transmission The function of road information thus transmits the first link information without occupying other interfaces in server.
In the present embodiment, the first link information, which is at least able to indicate that in server, generates the interface interacted with interchanger Interface message, the interface message record have server use first interface information and interchanger use second interface letter Breath, first interface information is for showing server is interacted using which interface, and same second interface information is for showing Interchanger is interacted using which interface, to indicate server and exchange by first interface information and second interface information The corresponding interface of communication link between machine.First link information is other than indicating interface message, and the first link information is also The essential information that can show which server, as the essential information of server includes but is not limited to: the identification information of server is (as taken Be engaged in the title of device), the media of the address and server Internet protocol (Internet Protocol Address, IP) of server Address access control (Media Access Control, MAC) etc., can be in network topology more intuitively by these information The correspondence of ground understanding server and inter-exchange.And the mode for receiving the first link information of first interface transmission includes but unlimited In such as under type:
A kind of mode: the first LLDP (Link Layer Discovery Protocol, the chain of first interface transmission are received Road floor finds agreement) message, wherein carrying the first link information in the first LLDP message, and the first LLDP message is by being deployed in LLDP module in server generates.
That is it in order to obtain the first link information, needs to dispose and enable LLDP module in the server (i.e. Need to increase LLDP module in the server), which can obtain server using the oid of LLDP-MIB after enabling Essential information, first interface information and second interface information, thus by these Information encapsulations at the first LLDP message, and by with The first interface of LLDP module configuration transmits the first LLDP message, and wherein LLDP-MIB is used to configure LLDP agreement, such as looks into Transmitting-receiving message statistical information is ask, inquiry is local can to pass through the oid of LLDP-MIB with functions, these information such as information of remote equipment It records, the present embodiment is no longer described in detail.
Another way: it is logged on by first interface in the server where the first interface, and passes through LLDP order The first link information is read from server.The mode of game server may is that pass through in server dispose and enable LLDP module is logged on server, thus be can use existing using Secure Shell (Secure Shell, SSH) agreement LLDP order read the first link information.
The LLDP module disposed in server in the present embodiment this can automate operation and maintenance tools using ansible, Such as LLDP module is written as by the playbook of ansible:
#Retrieve switch/port information
-name:Gather information from lldp
lldp:
-name:Print each switch/port
debug:
msg:"{{lldp[item]['chassis']['name']}}/{{lldp[item]['port'][' ifname']}}"
with_items:"{{lldp.keys()}}"
The form for the first link information that can be got using the LLDP module can be such that
#TASK:[Print each switch/port]
#ok:[10.13.0.22]=> (item=eth2)=> " item ": " eth2 ", " msg ": " switch1.example.com/Gi0/24"}
#ok:[10.13.0.22]=> (item=eth1)=> " item ": " eth1 ", " msg ": " switch2.example.com/Gi0/3"}
#ok:[10.13.0.22]=> (item=eth0)=> " item ": " eth0 ", " msg ": " switch3.example.com/Gi0/3"}
For one of them:
The IP address of [10.13.0.22] expression server;
Eth in item=eth2 indicates the interface used when server is interacted with interchanger;
Switch1.example.com indicates the title of interchanger, a kind of form of expression of the identification information of interchanger;
Gi0/24 indicates the interface used when server is interacted with interchanger.
It can also include other information, such as the MAC Address of server in the first link information in addition to these information And/or the title of the server of the identification information as server, naturally it is also possible to remove the title of interchanger etc., to this Embodiment does not limit the specifying information that the first link information includes.
S102: receiving the second link information of each second interface transmission, and wherein second interface is located on interchanger, for Second interface and the relationship of interchanger please refer to the relationship of first interface and server, no longer illustrate herein, but need to illustrate Something: if first interface and server are one-to-one relationships, second interface and interchanger are not necessarily one-to-one correspondence and close System, can be many-one relationship, equally can also interface to be interacted in multiplexing switches with server, i.e., and server into The interface of row interaction not only has the function that data interaction is carried out with server, additionally it is possible to as second interface to have transmission the The function of two link informations.
For the first link information, the second link information is also able to indicate that switch-to-server generates interaction Interface interface message, which equally records the first interface information for having server to use and interchanger uses the Two interface messages, first interface information is for showing server is interacted using which interface, same second interface information For showing interchanger is interacted using which interface, to indicate service by first interface information and second interface information The corresponding interface of communication link between device and interchanger, it can thus be appreciated that there are phases in the first link information and the second link information Same information, such as above-mentioned interface message.
Even if there are identical informations in two link informations, but the first link information and the second link information are also different, That is there are different information in the first link information and the second link information, such as this part difference information can be the first link letter Breath can show which the essential information of server, and the second link information can show which the essential information of interchanger.Such as the first link Information includes the essential information of server, and the second link information includes the essential information of interchanger, the essential information packet of interchanger It includes but is not limited to: the MAC Address of the identification information (title of such as interchanger) of interchanger, the IP address of interchanger and interchanger Deng the correspondence of server and inter-exchange can be more intuitively understood in network topology by these information.And receive the The mode of second link information of two interfaces transmission includes but is not limited to such as under type:
A kind of mode is: receiving the 2nd LLDP message of second interface transmission, carries the second chain in the 2nd LLDP message Road information, and the 2nd LLDP message is to be generated after interchanger enables LLDP module by LLDP module.
Wherein interchanger, which enables the mode of LLDP module, is: opening LLDP module, the configuration by a global configuration interface The LLDP module of all interchangers of disposable opening is capable of at interface, as in global configuration interface by all with LLDP module The LLDP module of interchanger is set as enabling, and LLDP module automatically turns on after interchanger enabling in this way, for not needing to open For interchanger with LLDP module, can be turned off manually by engineering staff, as by global configuration interface by the interchanger LLDP module is set off, and when the interchanger enables again, LLDP module will not enable automatically, to avoid by the second link Information is published in unreliable network.
Since interchanger itself has LLDP module, after its enabling interchanger can using the LLDP module from Essential information, first interface information and the second interface information that interchanger is obtained in the oid of LLDP-MIB, thus by these information It is packaged into the 2nd LLDP message, and is transmitted by second interface.
Another way is: passing through second interface and crawls the second link from interchanger using netconfig order and believes Breath, which is a kind of commonly used command, is no longer illustrated this present embodiment.
S103: the second link letter of the first link information and the transmission of each second interface based on the transmission of each first interface Breath, there are the first link information of same-interface information and the second link informations for acquisition.Such as first link information and the second chain The second interface information that the first interface information and interchanger that interface message record in the information of road has server to use use, that Two link informations of first interface information and second interface information having the same are then that there are the of same-interface information One link information and the second link information.
S104: the first link information of same-interface information and server and the exchange of the instruction of the second link information will be present Machine is determined as the server with corresponding relationship and interchanger.
Such as first link information with the same interface message and the second link information are obtained as there are same-interfaces The first link information and the second link information of information, then the server with first interface information in the interface message and the The interchanger of two interface messages is exactly the server and interchanger with corresponding relationship.
Herein it should be noted is that: there are multiple servers and multiple switch under the same network, and these The corresponding relationship of server and inter-exchange can also change, so if determining the server under the same network for the first time With the corresponding relationship of inter-exchange, need under the network Servers-all and interchanger traverse, obtain each service Corresponding first link information of device and corresponding second link information of respective switch, be then based on each first link information and Each second link information, determining has the server and interchanger of corresponding relationship.
And in order to traverse the server and interchanger under the network, can in advance by execute the equipment of the present embodiment from The IP address (can certainly be other information) that the server and interchanger under the network are obtained in the server of the network, by This IP address based on server and interchanger under the network is traversed.Service in the case where first time determines the same network After the corresponding relationship of device and inter-exchange, above-mentioned first link information and the second chain can be periodically or non-periodically obtained Road information, to ensure to execute the first link information and the second link information and physical link information that the equipment of the present embodiment obtains It is consistent, wherein obtaining periodically or aperiodically the mode of above-mentioned first link information and the second link information and can refer to and state It is bright.
If server and/or interchanger change Interface status, then need to change side's active reporting of Interface status, takes The mode of business device and interchanger active reporting is: obtaining in server and supports Simple Network Management Protocol (Simple Network Management Protocol, SNMP) the first link information for reporting of the first process, the first process is in server more reconfiguration The first link information is reported under mouth state status;Obtain the second link letter for supporting the second process of SNMP to report in interchanger Breath, the second process report the second link information when interchanger changes Interface status.Such as first process can use The first link information of SNMP TRAP mode active reporting, the second process equally can be using SNMP TRAP mode active reportings the Two link informations.
For interchanger, server can also be using in other modes active in the case where changing Interface status It passes, such as exploitation can monitor the monitoring packet of Interface status in the server, if the monitoring packet finds some Interface status more Change, then it can the first link information of active reporting.Such as it can be periodical by corntab command triggers monitoring packet in the server Ground monitors Interface status, and generates the first chain of JS object numbered musical notation (JavaScript Object Notation, JSON) format Road information.
Furthermore the equipment for executing the present embodiment can be coupled with a collector, to obtain above-mentioned first chain by the collector Road information and the second link information, and the first link information and the second link information are sent to by the collector and execute this implementation The equipment of example, the server and interchanger for by it determining that there is corresponding relationship.
By above-mentioned technical proposal it is found that receiving the first link information of each first interface transmission and receiving every It, can be based on the first link information that each first interface transmits and each the after second link information of a second interface transmission Second link information of two interfaces transmission is obtained there are the first link information of same-interface information and the second link information, will The server and interchanger indicated there are the first link information of same-interface information and the second link information is determined as having pair The server and interchanger that should be related to realize the corresponding relationship for automatically obtaining server and inter-exchange.If some server And/or the link information of some interchanger changes, and still is able to receive the change of first interface and/or second interface transmission Link information afterwards, and then corresponding relationship is redefined, therefore either obtain link information or link information change for the first time, The corresponding relationship that server and inter-exchange can be automatically determined counts manually without engineering staff, reduces engineering people The workload of member.
Referring to Fig. 2, it illustrates another acquisition servers provided in an embodiment of the present invention and the corresponding pass of inter-exchange The flow chart of the method for system, on the basis of Fig. 1 can with the following steps are included:
S105: the first link information based on server and interchanger, the transmission of each first interface with corresponding relationship With each second interface transmission the second link information, draw network topology, the network topology for show multiple servers and The corresponding relationship of inter-exchange such as shows the corresponding relationship of the multiple servers and inter-exchange under the same network.In this reality It applies in example, the process for drawing network topology is as follows:
Following steps are executed to any server with corresponding relationship and interchanger:
1) first node that the server in the corresponding relationship is determined as in network topology and will be in the corresponding relationship Interchanger be determined as the second node in network topology;
2) the mark letter of the server is extracted from the first link information that the first interface being located on the server transmits Breath and the identification information that the interchanger is extracted from the second link information that the second interface being located on the interchanger is transmitted, and The first node in network topology is indicated with the identification information of the server, by the second node in network topology with the exchange The identification information of machine indicates;
3) first node is connected with second node by a line, and by the side and the first link information and the second link Information is corresponding, so that the server as first node and the interchanger as second node are linked together by side, with It indicates to generate interaction between the server and interchanger, and passes through the interaction of both the first link information and the instruction of the second link information When interface message.Detailed process is as follows:
To be connected between first node and second node first while and when second, the second section is directed toward by first node in the first side First node is directed toward by second node in point, the second side;Based on the first link information and the second link information, obtain the server with The of the interface that the interchanger generates the first interface information of the interface of interaction and the generation of the interchanger and the server interacts Two interface messages, first interface information show that the server sends the interface that data use, second interface information to the interchanger Show that the interchanger sends the interface that data use to the server;Such as is obtained from the interface message of the first link information One interface message obtains in second interface information from the interface message of the second link information;Load first connects in the first side Message breath, loads second interface information, to obtain pair for showing the server and interchanger in network topology in the second side The access that should be related to, obtained after obtaining the access of corresponding relationship of each server and interchanger by place mix at network Topology.
The access for wherein showing the corresponding relationship of the server and interchanger includes the first node that the server is used as, should First between second node and first node and second node that interchanger is used as while and when second, corresponding network topology Schematic diagram as shown in figure 3, except the identification information that shows server and interchanger in network topology and corresponding connecing Except message breath, other information can also be shown in network topology together, the present embodiment is to this without limiting.
In addition, the present embodiment determine have corresponding relationship server and interchanger after, be also based on have pair First link information corresponding to the server and interchanger that should be related to and the second link information obtain a displaying server and friendship It changes planes the adjacency table of a corresponding relationship, the form of the adjacency table is as shown in figure 4, adjacency table shown in Fig. 4 In be the partial information in the first link information between first name to first mac, rport between lport for both Interface message, be the partial information in the second link information between second name to second mac, pass through the syntople Have between the server of entitled CQQY-OA-25F-1-254 and the interchanger of entitled CQQY-OA-23F-HJ-IRF known to table There is corresponding relationship, it is possible thereby to which the adjacency table based on the equipment for executing the present embodiment storage draws network topology.Execute sheet The equipment of embodiment can also will abut against the information in relation table and be stored in the form of tables of data in the database, so as to based on number It positions according to the first link information of server in library and the second link information of interchanger there are the interface of link, is achieved in base It is replaced in the quick locating interface of two link informations and cable.
It may make the corresponding relationship of multiple servers and inter-exchange to visualize by above-mentioned network topology mode, and lead to The first link information and the second link information can be obtained in time and accurately by crossing first interface and second interface, to realize to service The dynamic sensing of the link connection of device and inter-exchange.
Corresponding with above method embodiment, the embodiment of the present invention also provides a kind of acquisition server and inter-exchange is corresponding The device of relationship, structure is as shown in figure 5, may include: receiving unit 10, acquiring unit 20 and determination unit 30.
Receiving unit 10, for receiving the first link information of each first interface transmission and receiving each second interface Second link information of transmission, first interface is located on server, the first link information be at least used to indicate server with exchange Machine generates the interface message of the interface of interaction, and second interface is located on interchanger, and the second link information is at least used to indicate exchange Machine generates the interface message of the interface interacted with server.For first interface, second interface, the first link information and the second chain The detailed description of road information please refers to the related description in above method embodiment, no longer illustrates this present embodiment.
For receiving the first link information of first interface transmission and receiving the second link information that second interface is transmitted Mode also please refers to the related description in above method embodiment, no longer illustrates this present embodiment.
Acquiring unit 20, what the first link information and each second interface for being transmitted based on each first interface were transmitted Second link information, there are the first link information of same-interface information and the second link informations for acquisition.Such as first link letter The second of first interface information and interchanger use that interface message record in breath and the second link information has server to use Interface message, then two link informations of first interface information having the same and second interface information are connect there are identical The first link information and the second link information of message breath.
Determination unit 30, for the first link information of same-interface information and the clothes of the second link information instruction to will be present Business device and interchanger are determined as the server with corresponding relationship and interchanger.Such as it obtains and has the of the same interface message One link information and the second link information are that there are the first link information of same-interface information and the second link informations, then having Having the server of first interface information and the interchanger of second interface information in the interface message is exactly the clothes with corresponding relationship Business device and interchanger.
Realized by above-mentioned apparatus and automatically obtain the corresponding relationship of server and inter-exchange, if some server and/ Or the link information of some interchanger changes, after still being able to the change for receiving first interface and/or second interface transmission Link information, and then redefine corresponding relationship, therefore either obtain link information for the first time or link information is changed, all The corresponding relationship that server and inter-exchange can be automatically determined counts manually without engineering staff, reduces engineering staff Workload.
Furthermore the server and the device of inter-exchange corresponding relationship provided in this embodiment of obtaining can also include: to draw list Member, for based on server and interchanger, the first link information of each first interface transmission and each with corresponding relationship Second link information of second interface transmission draws network topology, and the network topology is for showing multiple servers and interchanger Between corresponding relationship, such as show the corresponding relationship of the multiple servers and inter-exchange under the same network.In the present embodiment, The process for drawing network topology please refers to the related description in above method embodiment, no longer illustrates this present embodiment.
It may make the corresponding relationship of multiple servers and inter-exchange to visualize by network topology mode, and pass through the One interface and second interface can obtain the first link information and the second link information in time and accurately, to realize to server and The dynamic sensing of the link connection of inter-exchange.
The embodiment of the present invention also provides a kind of equipment for obtaining server and inter-exchange corresponding relationship, structure such as Fig. 6 It is shown, it may include: communication interface 100, memory 200 and processor 300.
Processor 300, for receiving the first link information of each first interface transmission by communication interface 100 and connecing Receive the second link information of each second interface transmission, the first link information and each second based on the transmission of each first interface Second link information of interface transmission, there are the first link information of same-interface information and the second link informations for acquisition;It will deposit It is determined as having corresponding in the server and interchanger of the first link information of same-interface information and the instruction of the second link information The server and interchanger of relationship, first interface are located on server, and the first link information is at least used to indicate server and hands over It changes planes and generates the interface message of interactive interface, second interface is located on interchanger, and the second link information is at least used to indicate friendship It changes planes and generates the interface message of the interface interacted with server.
Memory 200, for storing the first link information and the second link information.
For processor 300, implementation process please refers to the related description in above method embodiment, to this present embodiment No longer illustrate.
A kind of storage medium of the embodiment of the present invention is stored with computer program code, computer program generation in storage medium The method that code realizes above-mentioned acquisition server and inter-exchange corresponding relationship when executing.
It should be noted that all the embodiments in this specification are described in a progressive manner, each embodiment weight Point explanation is the difference from other embodiments, and the same or similar parts between the embodiments can be referred to each other. For device class embodiment, since it is basically similar to the method embodiment, so being described relatively simple, related place ginseng See the part explanation of embodiment of the method.
Finally, it is to be noted that, herein, relational terms such as first and second and the like be used merely to by One entity or operation are distinguished with another entity or operation, without necessarily requiring or implying these entities or operation Between there are any actual relationship or orders.Moreover, the terms "include", "comprise" or its any other variant meaning Covering non-exclusive inclusion, so that the process, method, article or equipment for including a series of elements not only includes that A little elements, but also including other elements that are not explicitly listed, or further include for this process, method, article or The intrinsic element of equipment.In the absence of more restrictions, the element limited by sentence "including a ...", is not arranged Except there is also other identical elements in the process, method, article or apparatus that includes the element.
The foregoing description of the disclosed embodiments can be realized those skilled in the art or using the present invention.To this A variety of modifications of a little embodiments will be apparent for a person skilled in the art, and the general principles defined herein can Without departing from the spirit or scope of the present invention, to realize in other embodiments.Therefore, the present invention will not be limited It is formed on the embodiments shown herein, and is to fit to consistent with the principles and novel features disclosed in this article widest Range.
The above is only a preferred embodiment of the present invention, it is noted that for the ordinary skill people of the art For member, various improvements and modifications may be made without departing from the principle of the present invention, these improvements and modifications are also answered It is considered as protection scope of the present invention.

Claims (10)

1. a kind of method for obtaining server and inter-exchange corresponding relationship, which is characterized in that the described method includes:
The first link information of each first interface transmission is received, the first interface is located on server, first link Information is at least used to indicate the interface message that the server generates the interface interacted with interchanger;
The second link information of each second interface transmission is received, the second interface is located on interchanger, second link Information is at least used to indicate the interface message that switch-to-server generates the interface of interaction;
Second link information of the first link information and the transmission of each second interface based on the transmission of each first interface, acquisition are deposited In the first link information and the second link information of same-interface information;
The server and interchanger indicated there are the first link information of same-interface information and the second link information is true It is set to server and interchanger with corresponding relationship.
2. the method according to claim 1, wherein the first link letter for receiving each first interface transmission Breath includes:
The first link layer discovery protocol message of each first interface transmission is received, in first link layer discovery protocol message Carry first link information, and first link layer discovery protocol message is by the link that is deployed in the server Layer discovery protocol module generates;
Or
Logged on by the first interface in the server where the first interface, and by Link Layer Discovery Protocol order from First link information is read in the server.
3. the method according to claim 1, wherein the second link letter for receiving each second interface transmission Breath includes:
The second link layer discovery protocol message of each second interface transmission is received, in second link layer discovery protocol message Second link information is carried, and second link layer discovery protocol message is to enable link layer hair in the interchanger It is generated after existing protocol module by the Link Layer Discovery Protocol module;Or
Second link information is crawled from the interchanger by the second interface and using netconfig order.
4. the method according to claim 1, which is characterized in that the method also includes:
First link information for supporting the first process of Simple Network Management Protocol to report in the server is obtained, it is described First process reports first link information when the server changes Interface status;
And/or
Second link information for supporting the second process of Simple Network Management Protocol to report in the interchanger is obtained, it is described Second process reports second link information when the interchanger changes Interface status.
5. the method according to claim 1, wherein the method also includes: based on the clothes with corresponding relationship Second link information of business device and interchanger, the first link information of first interface transmission and the transmission of each second interface, draws Network topology, the network topology are used to show the corresponding relationship of multiple servers and inter-exchange.
6. according to the method described in claim 5, it is characterized in that, the server and exchange based on corresponding relationship Second link information of machine, the first link information of each first interface transmission and the transmission of each second interface is drawn network and is opened up Flutter includes: to execute following steps to any server with corresponding relationship and interchanger:
First node that server in the corresponding relationship is determined as in network topology and by the exchange in the corresponding relationship Machine is determined as the second node in network topology;
The identification information of the server is extracted from the first link information that the first interface of the server transmits and from the friendship Extract the identification information of the interchanger in second link information of the second interface transmission changed planes, and by this in network topology first Node is indicated with the identification information of the server, and the second node in network topology is indicated with the identification information of the interchanger;
First node is connected with second node by a line, and by the side and the first link information and the second link information pair It answers.
7. according to the method described in claim 6, it is characterized in that, described connect first node and second node by a line It connects, and by the side and the first link information and the second link information is corresponding includes:
To be connected between first node and second node first while and when second, the second section is directed toward by first node in first side First node is directed toward by second node in point, second side;
Based on first link information and second link information, obtains the server and connect with what interchanger generation interacted The first interface information of mouth and the interchanger generate the second interface information of the interface interacted with the server, and described first connects Message breath shows that the server sends the interface that uses of data to the interchanger, the second interface information show the interchanger to The server sends the interface that data use;
The first interface information is loaded in first side, and the second interface information is loaded in second side, from And the access that the corresponding relationship of the server and interchanger is shown in network topology is obtained, described displaying server and interchanger The access of corresponding relationship include first node that the server is used as, the second node and described first which is used as Between node and the second node first while and when second.
8. a kind of device for obtaining server and inter-exchange corresponding relationship, which is characterized in that described device includes:
Receiving unit, for receiving the first link information of each first interface transmission and receiving each second interface transmission Second link information, the first interface are located on server, and first link information is at least used to indicate the server The interface message of the interface interacted is generated with interchanger, the second interface is located on interchanger, and second link information is extremely It is used to indicate the interface message that switch-to-server generates the interface of interaction less;
Acquiring unit, the second chain of the first link information and the transmission of each second interface for being transmitted based on each first interface Road information, there are the first link information of same-interface information and the second link informations for acquisition;
Determination unit, for there are the services that the first link information of same-interface information and the second link information indicate by described Device and interchanger are determined as the server with corresponding relationship and interchanger.
9. a kind of equipment for obtaining server and inter-exchange corresponding relationship, which is characterized in that the equipment includes: that communication connects Mouth, memory and processor;
The processor, for receiving the first link information and the reception of each first interface transmission by the communication interface Second link information of each second interface transmission, the first link information and each second based on the transmission of each first interface connect Second link information of port transmission, there are the first link information of same-interface information and the second link informations for acquisition;It will be described The server and interchanger indicated there are the first link information of same-interface information and the second link information is determined as having pair The server and interchanger that should be related to, the first interface are located on server, and first link information is at least used to indicate The server generates the interface message of the interface interacted with interchanger, and the second interface is located on interchanger, and described second Link information is at least used to indicate the interface message that switch-to-server generates the interface of interaction;
The memory, for storing first link information and the second link information.
10. a kind of storage medium, which is characterized in that be stored with computer program code, the computer in the storage medium Program code realizes acquisition server and inter-exchange corresponding relationship as claimed in any one of claims 1 to 7 when executing Method.
CN201910721208.5A 2019-08-06 2019-08-06 A kind of method and device obtaining server and inter-exchange corresponding relationship Pending CN110430265A (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910721208.5A CN110430265A (en) 2019-08-06 2019-08-06 A kind of method and device obtaining server and inter-exchange corresponding relationship

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910721208.5A CN110430265A (en) 2019-08-06 2019-08-06 A kind of method and device obtaining server and inter-exchange corresponding relationship

Publications (1)

Publication Number Publication Date
CN110430265A true CN110430265A (en) 2019-11-08

Family

ID=68414388

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910721208.5A Pending CN110430265A (en) 2019-08-06 2019-08-06 A kind of method and device obtaining server and inter-exchange corresponding relationship

Country Status (1)

Country Link
CN (1) CN110430265A (en)

Cited By (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112615750A (en) * 2020-12-28 2021-04-06 广州西麦科技股份有限公司 Backbone network flow granularity adjusting system and method based on SDN
CN112953774A (en) * 2021-02-25 2021-06-11 山东英信计算机技术有限公司 Network topology generation method, system, equipment and computer storage medium
CN114006822A (en) * 2020-07-16 2022-02-01 中国移动通信有限公司研究院 Method and device for judging link between switch and server
CN115185759A (en) * 2022-09-05 2022-10-14 平安银行股份有限公司 LLDP-based server wiring verification method, device and system

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420343A (en) * 2008-11-28 2009-04-29 重庆邮电大学 Network topology discovery method for EPA network
CN103281206A (en) * 2013-05-29 2013-09-04 新浪网技术(中国)有限公司 System, method and device for determining connected relation
US20140280511A1 (en) * 2013-03-13 2014-09-18 Lockheed Martin Corporation Determining the topology of a network
CN104320345A (en) * 2014-10-30 2015-01-28 杭州华三通信技术有限公司 Method and device for collecting topological information in SDN network
CN108337111A (en) * 2018-01-05 2018-07-27 新华三技术有限公司 Obtain the method and device of network node topology

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101420343A (en) * 2008-11-28 2009-04-29 重庆邮电大学 Network topology discovery method for EPA network
US20140280511A1 (en) * 2013-03-13 2014-09-18 Lockheed Martin Corporation Determining the topology of a network
CN103281206A (en) * 2013-05-29 2013-09-04 新浪网技术(中国)有限公司 System, method and device for determining connected relation
CN104320345A (en) * 2014-10-30 2015-01-28 杭州华三通信技术有限公司 Method and device for collecting topological information in SDN network
CN108337111A (en) * 2018-01-05 2018-07-27 新华三技术有限公司 Obtain the method and device of network node topology

Cited By (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114006822A (en) * 2020-07-16 2022-02-01 中国移动通信有限公司研究院 Method and device for judging link between switch and server
CN114006822B (en) * 2020-07-16 2024-06-04 中国移动通信有限公司研究院 Method and device for judging link between switch and server
CN112615750A (en) * 2020-12-28 2021-04-06 广州西麦科技股份有限公司 Backbone network flow granularity adjusting system and method based on SDN
CN112953774A (en) * 2021-02-25 2021-06-11 山东英信计算机技术有限公司 Network topology generation method, system, equipment and computer storage medium
CN112953774B (en) * 2021-02-25 2023-05-16 山东英信计算机技术有限公司 Network topology generation method, system, equipment and computer storage medium
CN115185759A (en) * 2022-09-05 2022-10-14 平安银行股份有限公司 LLDP-based server wiring verification method, device and system

Similar Documents

Publication Publication Date Title
CN110430265A (en) A kind of method and device obtaining server and inter-exchange corresponding relationship
US20030225876A1 (en) Method and apparatus for graphically depicting network performance and connectivity
US7634671B2 (en) Determining power consumption in IT networks
CN102158360B (en) Network fault self-diagnosis method based on causal relationship positioning of time factors
CN103501249B (en) A kind of NM client topology management system and method
CN109544349A (en) One kind being based on networked asset information collecting method, device, equipment and storage medium
US20100110932A1 (en) Network optimisation systems
CN107958337A (en) A kind of information resources visualize mobile management system
CN103795575B (en) A kind of system monitoring method towards multiple data centers
CA2515052A1 (en) Relational model for management information in network devices
CN101667941A (en) Method for detecting link performance and device therefor
CN103166788B (en) A kind of collection control Control management system
CN109714206A (en) Electric power monitoring system Generating Network Topology Map, network bus topological diagram
CN105847023A (en) Service system network topology relationship obtaining method and device
CN109391516A (en) Realize the cloud third party NMS system of more producer UTN equipment centralized maintenance management
CN102752142A (en) Monitoring method and system based on multidimensional modeled information system
US20230198860A1 (en) Systems and methods for the temporal monitoring and visualization of network health of direct interconnect networks
CN104378233B (en) Equipment Explore of Unified Management Ideas, include method and related device
CN104637265A (en) Dispatch-automated multilevel integration intelligent watching alarming system
CN102833113A (en) Monitoring method and system of transformer substation Ethernet communication network
CN109147079A (en) Equipment routing inspection method and device
CN103532746A (en) Method and system for generating business topology of industrial system
CN104967529A (en) Business display layout method based on power secondary system intelligent supervision technology
US7733800B2 (en) Method and mechanism for identifying an unmanaged switch in a network
CN109245940A (en) A kind of method network equipment discovery and detected

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
RJ01 Rejection of invention patent application after publication

Application publication date: 20191108

RJ01 Rejection of invention patent application after publication