CN106789146B - Topology obtaining method and device - Google Patents

Topology obtaining method and device Download PDF

Info

Publication number
CN106789146B
CN106789146B CN201610234824.4A CN201610234824A CN106789146B CN 106789146 B CN106789146 B CN 106789146B CN 201610234824 A CN201610234824 A CN 201610234824A CN 106789146 B CN106789146 B CN 106789146B
Authority
CN
China
Prior art keywords
network device
network
address
network equipment
mac address
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
CN201610234824.4A
Other languages
Chinese (zh)
Other versions
CN106789146A (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.)
Hangzhou H3C Technologies Co Ltd
Original Assignee
Hangzhou H3C Technologies 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 Hangzhou H3C Technologies Co Ltd filed Critical Hangzhou H3C Technologies Co Ltd
Priority to CN201610234824.4A priority Critical patent/CN106789146B/en
Publication of CN106789146A publication Critical patent/CN106789146A/en
Application granted granted Critical
Publication of CN106789146B publication Critical patent/CN106789146B/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/12Discovery or management of network topologies

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)
  • Small-Scale Networks (AREA)

Abstract

The embodiment of the application discloses a topology obtaining method and a topology obtaining device, which relate to the technical field of communication and are applied to first network equipment, wherein the method comprises the following steps: determining second network equipment corresponding to a first IP address of next-hop network equipment of a non-direct connection type example in an IP routing table of the first network equipment; acquiring a first MAC address of second network equipment from a network management system according to the first IP address; when a plurality of first MAC addresses are obtained, determining second network equipment corresponding to the first MAC address which has a corresponding relation with the first IP address in an ARP table of the first network equipment as the network equipment with a direct connection link with the first network equipment; according to the determined network device, the topology of the first network device is obtained. By applying the embodiment of the application to obtain the topology, the topology can still be correctly obtained under the condition of repeated IP addresses.

Description

Topology obtaining method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a topology obtaining method and apparatus.
Background
Because the topology can present the network operation condition in real time, the user can intuitively capture the fault source, and further the convenience is provided for the user to manage the network, therefore, the topology becomes a necessary function of the network management system (called network management system for short).
For a three-layer network, since a network device at an IP (Internet Protocol) network layer is generally a router with a forwarding function, it does not belong to any subnet, and has a bridging relationship with the subnet, based on which, the three-layer topology represents the connection relationship between the router and the connection relationship between the router and the subnet.
In the prior art, the three-layer topology of the target network device may be obtained according to an IP routing table of the target network device, where the IP routing table is generally composed of one or more instances, and each instance includes information of a network device having a link relationship with the network device, link information, and the like.
Specifically, the IP routing table may include the following information: ipRouteDest (destination address to connect to), ipRouteIfIndex (routing interface index), iproutnexthop (IP address of next hop network device), iprouttype (routing type), ipRouteMask (routing mask), and the like.
Wherein, ipRouteType can be divided into direct connection type and non-direct connection type.
When the three-layer topology is obtained according to the IP routing table of the target network device, the IP address of the next-hop network device recorded in the case that the ipRouteType is a non-direct connection type may be obtained from the IP routing table, and then the topology of the target network device is obtained according to the network device corresponding to the obtained IP address.
Usually, the above method may be applied to accurately obtain the topology of the target network device, but in practical application, there may be a situation where IP addresses are duplicated, so that the network devices corresponding to the obtained IP addresses may not all be the network devices having direct links with the target network device, and further, there may be an error in the obtained topology of the target network device.
Disclosure of Invention
The embodiment of the application discloses a method and a device for obtaining topology, so that correct topology can be obtained under the condition of repeated IP addresses.
In order to achieve the above object, an embodiment of the present application discloses a topology obtaining method, which is applied to a first network device, and the method includes:
determining second network equipment corresponding to a first IP address of next-hop network equipment of a non-direct connection type example in an IP routing table of the first network equipment;
acquiring a first MAC address of second network equipment from a network management system according to the first IP address;
when a plurality of first MAC addresses are obtained, determining second network equipment corresponding to the first MAC address which has a corresponding relation with the first IP address in an ARP table of the first network equipment as the network equipment with a direct link with the first network equipment, wherein the ARP table is used for recording the corresponding relation between the IP address and the MAC address of the network equipment with the direct link with the first network equipment;
obtaining a topology of the first network device according to the determined network device.
In a specific implementation manner of the present application, the determining the second network device corresponding to the first IP address of the non-direct connection type next hop network device stored in the IP routing table of the first network device includes:
searching an instance with a non-direct connection type routing type from the IP routing table of the first network equipment;
filtering the searched examples, and filtering out the examples with the destination addresses as default gateways;
obtaining a first IP address of next-hop network equipment corresponding to the filtered instance from the IP routing table;
and determining second network equipment corresponding to the first IP address.
In a specific implementation manner of the present application, the determining the second network device corresponding to the first IP address includes:
determining a second network device corresponding to the first IP address according to network device registration information in the network management system, wherein the network device registration information is: and when each network device performs device registration in the network management system, reporting device information to the network management system.
In a specific implementation manner of the present application, the obtaining a first MAC address of a second network device from a network management system according to the first IP address includes:
according to the first IP address, obtaining a first MAC address of second network equipment from network equipment registration information in a network management system, wherein the network equipment registration information is as follows: and when each network device performs device registration in the network management system, reporting device information to the network management system.
In a specific implementation manner of the present application, determining, as a network device having a direct link with a first network device, a second network device corresponding to a first MAC address having a correspondence with a first IP address in an ARP table of the first network device includes:
obtaining a second MAC address corresponding to the first IP address from an ARP table of the first network equipment;
obtaining a third MAC address which is coincident with the second MAC address in the first MAC address;
and determining the second network equipment corresponding to the third MAC address as the network equipment with the direct link with the first network equipment.
In order to achieve the above object, an embodiment of the present application discloses a topology obtaining apparatus, applied to a first network device, the apparatus including:
the first network equipment determining module is used for determining second network equipment corresponding to a first IP address of next-hop network equipment of a non-direct connection type example in an IP routing table of the first network equipment;
the MAC address obtaining module is used for obtaining a first MAC address of second network equipment from a network management system according to the first IP address;
the second network device determining module is configured to determine, when multiple first MAC addresses are obtained, a second network device corresponding to a first MAC address having a correspondence with the first IP address in an ARP table of the first network device as a network device having a direct link with the first network device, where the ARP table is configured to record a correspondence between an IP address and an MAC address of a network device having a direct link with the first network device;
and the topology obtaining module is used for obtaining the topology of the first network equipment according to the determined network equipment.
In a specific implementation manner of the present application, the first network device determining module includes:
the instance searching submodule is used for searching an instance of which the routing type is a non-direct connection type from an IP routing table of the first network equipment;
the instance filtering submodule is used for filtering the searched instance and filtering the instance with the destination address as the default gateway;
the IP address obtaining submodule is used for obtaining a first IP address of next-hop network equipment corresponding to the filtered instance from the IP routing table;
and the first network equipment determining submodule is used for determining the second network equipment corresponding to the first IP address.
In a specific implementation manner of the present application, the first network device determining submodule is specifically configured to determine, according to network device registration information in the network management system, a second network device corresponding to the first IP address, where the network device registration information is: and when each network device performs device registration in the network management system, reporting device information to the network management system.
In a specific implementation manner of the present application, the MAC address obtaining module is specifically configured to obtain a first MAC address of a second network device from network device registration information in a network management system according to the first IP address, where the network device registration information is: and when each network device performs device registration in the network management system, reporting device information to the network management system.
In a specific implementation manner of the present application, the second network device determining module includes:
the first MAC address obtaining submodule is used for obtaining a second MAC address corresponding to the first IP address from an ARP table of the first network equipment when a plurality of first MAC addresses are obtained;
the second MAC address obtaining submodule is used for obtaining a third MAC address which is coincident with the second MAC address in the first MAC address;
and the second network equipment determining submodule is used for determining the second network equipment corresponding to the third MAC address as the network equipment with the direct link with the first network equipment.
As can be seen from the above, in the solution provided in the embodiment of the present application, when determining that the number of MAC addresses of the second network device corresponding to the IP address of the non-direct connection type next hop network device stored in the IP routing table is multiple, that is, when the number of the second network device is multiple, determining, by combining with the ARP table, the network device having a direct connection link with the first network device from the second network device, and then obtaining the topology of the target network device according to the determined network device. Because the information recorded in the ARP table is the corresponding relationship between the IP address and the MAC address of the network device having the direct link with the first network device, even if the second network device is a plurality of network devices, the network device having the direct link with the first network device can be found from the second network device, thereby ensuring the accuracy of the topology of the obtained first network device.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings used in the description of the embodiments or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments of the present application, and for those skilled in the art, other drawings can be obtained according to the drawings without creative efforts.
Fig. 1 is a schematic flowchart of a topology obtaining method according to an embodiment of the present application;
fig. 2a is an IP routing table of a first network device according to an embodiment of the present application;
fig. 2b is a schematic diagram of IP address information of a second network device according to an embodiment of the present application;
fig. 2c is a schematic diagram of another IP address information of a second network device according to an embodiment of the present application;
FIG. 2d is a schematic illustration of a topology obtained according to the prior art;
fig. 3a is an ARP table of a first network device according to an embodiment of the present application;
fig. 3b is MAC address information of a second network device according to an embodiment of the present disclosure;
fig. 3c is another MAC address information of a second network device according to an embodiment of the present disclosure;
FIG. 3d is a schematic view of a topology provided by an embodiment of the present application;
fig. 4 is a schematic structural diagram of a topology obtaining apparatus according to an embodiment of the present application.
Detailed Description
The technical solutions in the embodiments of the present application will be clearly and completely described below with reference to the drawings in the embodiments of the present application, and it is obvious that the described embodiments are only a part of the embodiments of the present application, and not all of the embodiments. All other embodiments, which can be derived by a person skilled in the art from the embodiments given herein without making any creative effort, shall fall within the protection scope of the present application.
Fig. 1 is a flowchart illustrating a topology obtaining method according to an embodiment of the present application, where the method is applied to a first network device,
specifically, the first network device may be a network device that has been added to the network management system.
The topology obtaining method comprises the following steps:
s101: and determining second network equipment corresponding to the first IP address of the next-hop network equipment of the non-direct connection type example in the IP routing table of the first network equipment.
In general, an IP routing table of a device is composed of one or more instances, and in each instance, information of a network device having a link relationship with the network device, link information, and the like are recorded. Specifically, referring to fig. 2a, the routing table includes 6 instances, and each instance includes information such as ipRouteDest (destination address to be connected), iproutelfindex (routing interface index), ipRouteNextHop (IP address of next hop network device), and ipRouteType (routing type).
For an example in the IP routing table, if the routing type of the example is a non-direct connection type, it is described that the destination address corresponding to the example is not a local address, but a remote routing address or a subnet address, that is, it is described that the next-hop network device belongs to a three-layer network device.
In a specific implementation manner of the present application, when determining a second network device corresponding to a first IP address of a next hop network device of a non-direct connection type instance in an IP routing table of a first network device, a non-direct connection type instance is searched for from the IP routing table of the first network device, then the searched instance is filtered, an instance with a destination address as a default gateway is filtered out, a first IP address of the next hop network device corresponding to the filtered instance is obtained from the IP routing table, and a second network device corresponding to the first IP address is determined.
The default gateway may be 0.0.0.0, etc., and this application does not limit this.
As can be known from the foregoing description, the first network device may be a network device that has been added to a network management system, and the network management system needs to add the network device to be managed to the system first, that is, it can be understood that: the network device registers in the network management system. When a network device registers in a network management system, it generally needs to report related information, such as an IP address, a Media Access Control (MAC) address, a device identifier, and the like of the network device.
In view of the above, when determining the second network device corresponding to the first IP address, the second network device corresponding to the first IP address may be determined according to the network device registration information in the network management system.
Wherein, the network device registration information is: when each network device registers in the network management system, the device information is reported to the network management system, where the device information may include an IP address, an MAC address, a device identifier, and the like, and this application does not limit this.
Specifically, when determining the second network device corresponding to the first IP address according to the network device registration information in the network management system, it may first determine whether the first IP address is stored in the network device registration information in the network management system, and if the first IP address is stored, further obtain the second network device from the information record corresponding to the first IP address, in this case, it indicates that the second network device has all been added to the network management system, and it is necessary to establish a link between the second network device and the first network device in the topology according to the specific situation; if the first IP address is not stored, it indicates that the network device corresponding to the first IP address is not added to the network management system, so that it is not necessary to establish a link between the network device corresponding to the first IP address and the first network device in the topology.
It should be noted that, since the IP routing table may include a plurality of instances, the first IP address may correspond to a plurality of IP addresses, and since an IP address may be duplicated in an actual application, that is, one IP address may correspond to a plurality of network devices, the second network device may also correspond to a plurality of network devices.
S102: and obtaining the first MAC address of the second network equipment from the network management system according to the first IP address.
In an optional implementation manner of the present application, when obtaining the first MAC address of the second network device, the first MAC address of the second network device may be obtained from network device registration information in a network management system according to the first IP address, where the network device registration information is: and when each network device performs device registration in the network management system, reporting the device information to the network management system.
S103: when a plurality of first MAC addresses are obtained, determining second network equipment corresponding to the first MAC address which has a corresponding relation with the first IP address in an ARP table of the first network equipment as the network equipment with a direct connection link with the first network equipment.
The ARP table is used for recording the corresponding relation between the IP address and the MAC address of the network equipment which has a direct link with the first network equipment.
Since one network device usually corresponds to one MAC address, when the first IP address corresponds to a plurality of network devices, the first MAC address obtained according to the first IP address is usually also a plurality of MAC addresses.
Specifically, when the second network device corresponding to the first MAC address having a corresponding relationship with the first IP address in the ARP table of the first network device is determined as a network device having a direct link with the first network device, the second MAC address corresponding to the first IP address may be obtained from the ARP table of the first network device, then the third MAC address coinciding with the second MAC address in the first MAC address is obtained, and then the second network device corresponding to the third MAC address is determined as a network device having a direct link with the first network device.
S104: according to the determined network device, the topology of the first network device is obtained.
As can be seen from the above, in the solutions provided in the foregoing embodiments, when the first network device determines that the MAC address of the second network device corresponding to the IP address of the non-direct connection type next hop network device stored in the IP routing table is multiple, that is, the second network device is multiple, the network device that has a direct connection link with the first network device is determined from the second network device by combining with the ARP table, and then the topology of the target network device is obtained according to the determined network device. Because the information recorded in the ARP table is the corresponding relationship between the IP address and the MAC address of the network device having the direct link with the first network device, even if the second network device is a plurality of network devices, the network device having the direct link with the first network device can be found from the second network device, thereby ensuring the accuracy of the topology of the obtained first network device.
The method for obtaining topology provided by the embodiments of the present application will be described in detail below with reference to specific examples from the perspective of comparison with the prior art.
Assume that a real environment networking includes: network equipment A, network equipment B and network equipment C, wherein, the IP address of network equipment A is: 10.153.89.103, the IP address of network device B is: 10.153.89.120, the IP address of network device C is: 10.153.88.120. the link conditions of the network device a, the network device B and the network device C in the actual environment networking are as follows: a direct link exists between the network device a and the network device B, and a direct link does not exist between the network device a and the network device C.
Referring to fig. 2a, the IP address of the next-hop network device of an example in the IP routing table of network device a is: 10.153.89.120, the topology of network device A is obtained next for the IP address.
Both the network device B and the network device C have been added to the network management system, and referring to fig. 2B and fig. 2C, IP address information of each interface of the network device B and the network device C is provided, and when the network device B and the network device C are registered in the network management system, the IP address information is reported.
When the topology of the network device a is obtained by applying the prior art, the IP address of the next hop network device obtained from the IP routing table of the network device a is: 10.153.89.120, it can be seen from the information shown in fig. 2B and 2C that the IP address of 16771 interface of network device B and the IP address of 468 interface of network device C are both: 10.153.89.120, it can be considered that both network device B and network device C have a direct link with network device a, and based on this, the obtained topology of network device a is as shown in fig. 2d, and compared with the actual situation, it can be seen that the topology shown in fig. 2d does not conform to the actual situation, and there is an error.
When the scheme provided by the embodiment of the application is applied to obtain the topology of the network device a, the IP address of the next hop network device obtained from the IP routing table of the network device a is: 10.153.89.120, it can be seen from the information shown in fig. 2B and 2C that the IP address of 16771 interface of network device B and the IP address of 468 interface of network device C are both: 10.153.89.120, it is possible that network device B and network device C are both network devices that have a direct link with network device a.
The ARP table of network device a shown in fig. 3a shows that the IP addresses are: 10.153.89.120, the MAC address corresponding to the network device is: 5C DD 70:18:1B AC.
Since both the network device B and the network device C have been added to the network management system, referring to fig. 3B and fig. 3C, MAC address information of the network device B and the network device C is provided, and the MAC address information of the network device B and the network device C is reported when the network device B and the network device C are registered in the network management system. Therefore, at this time, the MAC addresses of the network device B and the network device C can be obtained from the network management system, and it can be known that the MAC addresses of the network device B are as follows by combining fig. 3B and fig. 3C: 5C DD 70:18:1B AC, the MAC address of the network equipment C is: 00:00:12:34:12:01.
Comparing the MAC addresses obtained in the two cases, it can be seen that the MAC address of the network device C is not in the ARP table of the network device a, so only the network device B and the network device a have a direct link, and based on this, the topology of the network device a obtained is as shown in fig. 3d, and compared with the actual situation, it can be seen that the topology shown in fig. 3d matches the actual situation, and there is no error.
Corresponding to the topology obtaining method, the embodiment of the application also provides a topology obtaining device.
Fig. 4 is a schematic structural diagram of a topology obtaining apparatus provided in an embodiment of the present application, where the topology obtaining apparatus is applied to a first network device, and the topology obtaining apparatus includes:
a first network device determining module 401, configured to determine a second network device corresponding to a first IP address of a next-hop network device of a non-direct-connection type instance in an IP routing table of the first network device;
an MAC address obtaining module 402, configured to obtain a first MAC address of a second network device from a network management system according to the first IP address;
a second network device determining module 403, configured to determine, when multiple first MAC addresses are obtained, a second network device corresponding to a first MAC address having a corresponding relationship with the first IP address in an ARP table of the first network device, as a network device having a direct link with the first network device, where the ARP table is used to record a corresponding relationship between an IP address and an MAC address of a network device having a direct link with the first network device;
a topology obtaining module 404, configured to obtain a topology of the first network device according to the determined network device.
Specifically, the first network device determining module 401 may include:
the instance searching submodule is used for searching an instance of which the routing type is a non-direct connection type from an IP routing table of the first network equipment;
the instance filtering submodule is used for filtering the searched instance and filtering the instance with the destination address as the default gateway;
the IP address obtaining submodule is used for obtaining a first IP address of next-hop network equipment corresponding to the filtered instance from the IP routing table;
and the first network equipment determining submodule is used for determining the second network equipment corresponding to the first IP address.
Optionally, the first network device determining submodule is specifically configured to determine, according to network device registration information in the network management system, a second network device corresponding to the first IP address, where the network device registration information is: and when each network device performs device registration in the network management system, reporting device information to the network management system.
Optionally, the MAC address obtaining module is specifically configured to obtain a first MAC address of a second network device from network device registration information in a network management system according to the first IP address, where the network device registration information is: and when each network device performs device registration in the network management system, reporting device information to the network management system.
Specifically, the second network device determining module 403 may include:
the first MAC address obtaining submodule is used for obtaining a second MAC address corresponding to the first IP address from an ARP table of the first network equipment when a plurality of first MAC addresses are obtained;
the second MAC address obtaining submodule is used for obtaining a third MAC address which is coincident with the second MAC address in the first MAC address;
and the second network equipment determining submodule is used for determining the second network equipment corresponding to the third MAC address as the network equipment with the direct link with the first network equipment.
As can be seen from the above, in the solutions provided in the foregoing embodiments, when the first network device determines that the MAC address of the second network device corresponding to the IP address of the non-direct connection type next hop network device stored in the IP routing table is multiple, that is, the second network device is multiple, the network device that has a direct connection link with the first network device is determined from the second network device by combining with the ARP table, and then the topology of the target network device is obtained according to the determined network device. Because the information recorded in the ARP table is the corresponding relationship between the IP address and the MAC address of the network device having the direct link with the first network device, even if the second network device is a plurality of network devices, the network device having the direct link with the first network device can be found from the second network device, thereby ensuring the accuracy of the topology of the obtained first network device.
For the device embodiment, since it is basically similar to the method embodiment, the description is simple, and for the relevant points, refer to the partial description of the method embodiment.
It is noted that, herein, relational terms such as first and second, and the like may be used solely to distinguish one entity or action from another entity or action without necessarily requiring or implying any actual such relationship or order between such entities or actions. Also, the terms "comprises," "comprising," or any other variation thereof, are intended to cover a non-exclusive inclusion, such that a process, method, article, or apparatus that comprises a list of elements does not include only those elements but may include other elements not expressly listed or inherent to such process, method, article, or apparatus. Without further limitation, an element defined by the phrase "comprising an … …" does not exclude the presence of other identical elements in a process, method, article, or apparatus that comprises the element.
Those skilled in the art will appreciate that all or part of the steps in the above method embodiments may be implemented by a program to instruct relevant hardware to perform the steps, and the program may be stored in a computer-readable storage medium, which is referred to herein as a storage medium, such as: ROM/RAM, magnetic disk, optical disk, etc.
The above description is only for the preferred embodiment of the present application, and is not intended to limit the scope of the present application. Any modification, equivalent replacement, improvement and the like made within the spirit and principle of the present application are included in the protection scope of the present application.

Claims (4)

1. A topology obtaining method applied to a first network device is characterized by comprising the following steps:
determining second network equipment corresponding to a first IP address of next-hop network equipment of a non-direct connection type example in an IP routing table of the first network equipment;
acquiring a first MAC address of second network equipment from a network management system according to the first IP address;
when a plurality of first MAC addresses are obtained, determining second network equipment corresponding to the first MAC address which has a corresponding relation with the first IP address in an ARP table of the first network equipment as the network equipment with a direct link with the first network equipment, wherein the ARP table is used for recording the corresponding relation between the IP address and the MAC address of the network equipment with the direct link with the first network equipment;
obtaining the topology of the first network device according to the determined network device;
the determining of the second network device corresponding to the first IP address of the non-direct connection type next hop network device stored in the IP routing table of the first network device includes:
searching an instance with a non-direct connection type routing type from the IP routing table of the first network equipment;
filtering the searched examples, and filtering out the examples with the destination addresses as default gateways;
obtaining a first IP address of next-hop network equipment corresponding to the filtered instance from the IP routing table;
determining second network equipment corresponding to the first IP address;
the determining of the second network device corresponding to the first IP address includes:
determining a second network device corresponding to the first IP address according to network device registration information in the network management system, wherein the network device registration information is: when each network device registers in the network management system, the device information is reported to the network management system;
the determining, as a network device having a direct link with the first network device, a second network device corresponding to a first MAC address having a correspondence with the first IP address in an ARP table of the first network device includes:
obtaining a second MAC address corresponding to the first IP address from an ARP table of the first network equipment;
obtaining a third MAC address which is coincident with the second MAC address in the first MAC address;
and determining the second network equipment corresponding to the third MAC address as the network equipment with the direct link with the first network equipment.
2. The method of claim 1, wherein obtaining the first MAC address of the second network device from the network management system according to the first IP address comprises:
according to the first IP address, obtaining a first MAC address of second network equipment from network equipment registration information in a network management system, wherein the network equipment registration information is as follows: and when each network device performs device registration in the network management system, reporting device information to the network management system.
3. A topology obtaining apparatus applied to a first network device, the apparatus comprising:
the first network equipment determining module is used for determining second network equipment corresponding to a first IP address of next-hop network equipment of a non-direct connection type example in an IP routing table of the first network equipment;
the MAC address obtaining module is used for obtaining a first MAC address of second network equipment from a network management system according to the first IP address;
the second network device determining module is configured to determine, when multiple first MAC addresses are obtained, a second network device corresponding to a first MAC address having a correspondence with the first IP address in an ARP table of the first network device as a network device having a direct link with the first network device, where the ARP table is configured to record a correspondence between an IP address and an MAC address of a network device having a direct link with the first network device;
a topology obtaining module, configured to obtain a topology of the first network device according to the determined network device;
the first network device determination module includes:
the instance searching submodule is used for searching an instance of which the routing type is a non-direct connection type from an IP routing table of the first network equipment;
the instance filtering submodule is used for filtering the searched instance and filtering the instance with the destination address as the default gateway;
the IP address obtaining submodule is used for obtaining a first IP address of next-hop network equipment corresponding to the filtered instance from the IP routing table;
the first network equipment determining submodule is used for determining second network equipment corresponding to the first IP address;
the first network device determining submodule is specifically configured to determine, according to network device registration information in the network management system, a second network device corresponding to the first IP address, where the network device registration information is: when each network device registers in the network management system, the device information is reported to the network management system;
the second network device determination module includes:
the first MAC address obtaining submodule is used for obtaining a second MAC address corresponding to the first IP address from an ARP table of the first network equipment when a plurality of first MAC addresses are obtained;
the second MAC address obtaining submodule is used for obtaining a third MAC address which is coincident with the second MAC address in the first MAC address;
and the second network equipment determining submodule is used for determining the second network equipment corresponding to the third MAC address as the network equipment with the direct link with the first network equipment.
4. The apparatus of claim 3,
the MAC address obtaining module is specifically configured to obtain a first MAC address of a second network device from network device registration information in a network management system according to the first IP address, where the network device registration information is: and when each network device performs device registration in the network management system, reporting device information to the network management system.
CN201610234824.4A 2016-04-15 2016-04-15 Topology obtaining method and device Active CN106789146B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201610234824.4A CN106789146B (en) 2016-04-15 2016-04-15 Topology obtaining method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201610234824.4A CN106789146B (en) 2016-04-15 2016-04-15 Topology obtaining method and device

Publications (2)

Publication Number Publication Date
CN106789146A CN106789146A (en) 2017-05-31
CN106789146B true CN106789146B (en) 2021-04-02

Family

ID=58972206

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201610234824.4A Active CN106789146B (en) 2016-04-15 2016-04-15 Topology obtaining method and device

Country Status (1)

Country Link
CN (1) CN106789146B (en)

Families Citing this family (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN111143319A (en) * 2018-11-06 2020-05-12 顺丰科技有限公司 Method and device for detecting instance topology
CN111245662B (en) * 2020-03-09 2023-01-24 杭州迪普科技股份有限公司 Method and device for displaying network topology
CN115297027B (en) * 2022-08-02 2023-08-25 上海海得控制系统股份有限公司 Method, system, storage medium and network management server for identifying links between island network devices

Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616015A (en) * 2009-07-24 2009-12-30 中兴通讯股份有限公司 A kind of method and apparatus that obtains multicast topology information in the IP network
CN102158407A (en) * 2011-03-31 2011-08-17 华为技术有限公司 Address resolution protocol (ARP) table entry configuration method and device
CN102739433A (en) * 2011-03-30 2012-10-17 大势至(北京)软件工程有限公司 Control method of local area network computer through network management software allocation based on multi-net environment of three-layer switch
CN103139071A (en) * 2011-11-29 2013-06-05 华为技术有限公司 Method, device and system of message transmitting
CN104092576A (en) * 2014-07-30 2014-10-08 浙江宇视科技有限公司 Network topology calculation method and device
CN105376163A (en) * 2015-10-14 2016-03-02 山东超越数控电子有限公司 Discovery method and device of network topological structure

Family Cites Families (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
TW201421232A (en) * 2012-11-19 2014-06-01 Ibm Method, apparatus and computer program product for performing failover in a redundancy group

Patent Citations (6)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101616015A (en) * 2009-07-24 2009-12-30 中兴通讯股份有限公司 A kind of method and apparatus that obtains multicast topology information in the IP network
CN102739433A (en) * 2011-03-30 2012-10-17 大势至(北京)软件工程有限公司 Control method of local area network computer through network management software allocation based on multi-net environment of three-layer switch
CN102158407A (en) * 2011-03-31 2011-08-17 华为技术有限公司 Address resolution protocol (ARP) table entry configuration method and device
CN103139071A (en) * 2011-11-29 2013-06-05 华为技术有限公司 Method, device and system of message transmitting
CN104092576A (en) * 2014-07-30 2014-10-08 浙江宇视科技有限公司 Network topology calculation method and device
CN105376163A (en) * 2015-10-14 2016-03-02 山东超越数控电子有限公司 Discovery method and device of network topological structure

Also Published As

Publication number Publication date
CN106789146A (en) 2017-05-31

Similar Documents

Publication Publication Date Title
US11329881B2 (en) Method and system for network topology enforcement
CN107733670B (en) Forwarding strategy configuration method and device
CN102754409B (en) For the method for Diameter protocol harmonization, system and computer-readable medium
CN110769412B (en) Session binding method, network discovery function, application function and network unit
US10355962B2 (en) Network topology generation using traceroute data
EP2451125B1 (en) Method and system for realizing network topology discovery
CN106789146B (en) Topology obtaining method and device
US8914503B2 (en) Detected IP link and connectivity inference
CN105634829A (en) Network device management method
CN113055297B (en) Network topology discovery method and device
CN104333610A (en) IPv6 address allocation method and device
CN104092576A (en) Network topology calculation method and device
CN101904150A (en) Ethernet connectivity fault management with user verification option
CN110650092B (en) Data processing method and device
CN106789664B (en) Route aggregation method and device
CN104579979A (en) Network topology discovery method based on MAC information
US9473384B2 (en) Validating reachability of nodes of a network of an industrial automation and control system
CN111953748B (en) Session record generation method, device and storage medium
US11134099B2 (en) Threat response in a multi-router environment
US10142177B2 (en) Mechanisms to identify mismatches in layer 3 configuration in a network
CN104113475B (en) The network route implementation method and system of home gateway based on Linux
WO2018161827A1 (en) Address self-learning method and device, and switch
CN102075364B (en) Method and equipment for determining direct link
KR102092015B1 (en) Method, apparatus and computer program for recognizing network equipment in a software defined network
CN105337939A (en) BGP logical topology generation method and device

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