CN108259340B - Topology information transmission method and device - Google Patents

Topology information transmission method and device Download PDF

Info

Publication number
CN108259340B
CN108259340B CN201710875157.2A CN201710875157A CN108259340B CN 108259340 B CN108259340 B CN 108259340B CN 201710875157 A CN201710875157 A CN 201710875157A CN 108259340 B CN108259340 B CN 108259340B
Authority
CN
China
Prior art keywords
network
network device
interface
interface address
segment set
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
CN201710875157.2A
Other languages
Chinese (zh)
Other versions
CN108259340A (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 CN201710875157.2A priority Critical patent/CN108259340B/en
Publication of CN108259340A publication Critical patent/CN108259340A/en
Application granted granted Critical
Publication of CN108259340B publication Critical patent/CN108259340B/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
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/50Routing or path finding of packets in data switching networks using label swapping, e.g. multi-protocol label switch [MPLS]
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/52Multiprotocol routers
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/74Address processing for routing

Abstract

The application provides a topological information transmission method and a device, wherein the method comprises the following steps: determining a first network device and a second network device having a neighbor relation; acquiring network segments supported by both first network equipment and second network equipment; selecting a first interface address belonging to the network segment from all interface addresses of the first network equipment, and selecting a second interface address belonging to the network segment from all interface addresses of the second network equipment; and sending topology information to a controller, wherein the topology information comprises neighbor information of the first network device and the second network device, and link information of the first interface address and the second interface address. According to the technical scheme, the controller can acquire detailed topology information, acquire which interface of the first network equipment is connected with which interface of the second network equipment through which interface, and acquire interface addresses of the connected interfaces.

Description

Topology information transmission method and device
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method and an apparatus for transmitting topology information.
Background
The network device may collect neighbor Link information in an AS (Autonomous System), and send the neighbor Link information to the controller through a BGP LS (Border Gateway Protocol Link State) message, and the controller controls the message according to the neighbor Link information.
For example, when a neighbor is established between the network device 1 and the network device 2, and a neighbor is established between the network device 2 and the network device 3, the neighbor link information acquired by the controller includes: network device 1 has a neighbor relationship with network device 2, and network device 2 has a neighbor relationship with network device 3. Based on this, if the message needs to be transmitted from the network device 1 to the network device 3, the controller may control a transmission path of the message according to the neighbor link information, where the transmission path is from the network device 1 to the network device 2 to the network device 3.
In the above manner, the controller can only know the neighbor relation between the network devices according to the neighbor link information, but cannot know detailed topology information, for example, the controller cannot know which interface of the network device 2 is connected to which interface of the network device 1 through which interface, that is, cannot know the IP addresses of the connected interfaces.
Disclosure of Invention
The application provides a topological information transmission method, which is applied to information collection equipment and comprises the following steps:
determining a first network device and a second network device having a neighbor relation;
acquiring network segments supported by the first network equipment and the second network equipment;
selecting a first interface address belonging to the network segment from all interface addresses of the first network equipment, and selecting a second interface address belonging to the network segment from all interface addresses of the second network equipment;
and sending topology information to a controller, wherein the topology information comprises neighbor information of the first network device and the second network device, and link information of the first interface address and the second interface address.
The application provides a topological information transmission device, is applied to information collecting equipment, includes:
a determining module, configured to determine a first network device and a second network device that have a neighbor relation;
an obtaining module, configured to obtain a network segment supported by both the first network device and the second network device; selecting a first interface address belonging to the network segment from all interface addresses of the first network equipment, and selecting a second interface address belonging to the network segment from all interface addresses of the second network equipment;
the sending module is used for sending topology information to the controller, wherein the topology information comprises neighbor information of the first network device and the second network device, and link information of the first interface address and the second interface address.
Based on the foregoing technical solution, in this embodiment of the application, the topology information sent by the information collection device to the controller may include neighbor information of the first network device and the second network device, and link information of the first interface address and the second interface address, based on the topology information, the controller learns that the first network device and the second network device have a neighbor relationship, and an interface connected to the second network device on the first network device is the first interface address, and an interface connected to the first network device on the second network device is the second interface address. That is, the controller may know detailed topology information, that is, which interface the first network device is connected to which interface of the second network device through, that is, the controller may know interface addresses of the connected interfaces.
Moreover, the first network device only needs to send the first interface address to the information collecting device, and the second network device only needs to send the second interface address to the information collecting device, so that the information collecting device can determine that the first interface address and the second interface address have a connection relation based on the network segments supported by both the first network device and the second network device. The first network device does not need to collect information of the second interface address, and does not need to send the first interface address and the second interface address to the information collection device at the same time.
Drawings
In order to more clearly illustrate the embodiments of the present application or the technical solutions in the prior art, the drawings needed to be used in the description of the embodiments of the present application or the prior art will be briefly described below, it is obvious that the drawings in the following description are only some embodiments described in the present application, and other drawings can be obtained by those skilled in the art according to the drawings of the embodiments of the present application.
FIG. 1 is a schematic diagram of an application scenario in an embodiment of the present application;
fig. 2 is a flowchart of a topology information transmission method according to an embodiment of the present application;
fig. 3 is a block diagram of a topology information transmission apparatus according to an embodiment of the present application;
fig. 4 is a hardware configuration diagram of an information collection device according to an embodiment of the present application.
Detailed Description
The terminology used herein is for the purpose of describing particular embodiments only and is not intended to be limiting of the application. As used in this application and the claims, the singular forms "a", "an", and "the" are intended to include the plural forms as well, unless the context clearly indicates otherwise. It should also be understood that the term "and/or" as used herein is meant to encompass any and all possible combinations of one or more of the associated listed items.
It is to be understood that although the terms first, second, third, etc. may be used herein to describe various information, such information should not be limited to these terms. These terms are only used to distinguish one type of information from another. For example, first information may also be referred to as second information, and similarly, second information may also be referred to as first information, without departing from the scope of the present application. Depending on the context, moreover, the word "if" as used may be interpreted as "at … …" or "when … …" or "in response to a determination".
In the embodiment of the present application, a topology information transmission method is provided, where the method may be applied to a system including a controller and a plurality of network devices (e.g., routers, switches, etc.), and as shown in fig. 1, for an application scenario diagram of the embodiment of the present application, a neighbor (e.g., a BGP neighbor, etc.) is established between network device 1 and network device 2, a neighbor is established between network device 1 and network device 4, a neighbor is established between network device 2 and network device 3, a neighbor is established between network device 3 and network device 5, and a neighbor is established between network device 4 and network device 5.
In one example, when a network device includes multiple interfaces, the segments of the different interfaces may be different for one network device. Furthermore, the segments of the two interfaces that are interconnected may be the same for both network devices that are interconnected.
Referring to fig. 1, the device id (also called system id) of network device 1 is 0001, the interface address of interface 11 is 8.1.1.1, the network segment of interface 11 is 8.1.1.0/24, the interface address of interface 12 is 9.1.1.1, and the network segment of interface 11 is 9.1.1.0/24. The device identification of network device 2 is 0002, the interface address of interface 21 is 8.1.1.2, the network segment of interface 21 is 8.1.1.0/24, the interface address of interface 22 is 10.1.1.1, and the network segment of interface 22 is 10.1.1.0/24. The device identification of the network device 3 is 0003, the interface address of the interface 31 is 10.1.1.2, the network segment of the interface 31 is 10.1.1.0/24, the interface address of the interface 32 is 30.1.1.1, and the network segment of the interface 32 is 30.1.1.0/24. The device identification of network device 4 is 0004, the interface address of interface 41 is 9.1.1.2, the network segment of interface 41 is 9.1.1.0/24, the interface address of interface 42 is 20.1.1.1, and the network segment of interface 42 is 20.1.1.0/24. The device ID of network device 5 is 0005, the interface address of interface 51 is 20.1.1.2, the network segment of interface 51 is 20.1.1.0/24, the interface address of interface 52 is 30.1.1.2, and the network segment of interface 52 is 30.1.1.0/24. Of course, the above is merely an example, and no limitation is made thereto.
Each network device may send an LSP (Link State Protocol Data Unit, LSP for short) message in a broadcast manner, where the LSP message not only carries the device identifier of the network device and the neighbor Link information of the network device, but also carries all network segments supported by the network device and all interface addresses of the network device. For example, the LSP packet may include a device identifier, a neighbor TLV (Type Length Value), a network segment TLV and an interface TLV of the network device, where the neighbor TLV may carry neighbor link information of the network device, the network segment TLV may carry all network segments supported by the network device, and the interface TLV may carry all interface addresses of the network device.
For example, in the LSP message sent by network device 2, the neighbor link information carried by the neighbor TLV includes that 0002 and 0001 have a neighbor relation, 0002 and 0003 have a neighbor relation, the content carried by the network segment TLV includes 8.1.1.0/24 and 10.1.1.0/24, and the content carried by the interface TLV includes 8.1.1.2 and 10.1.1.1. In the LSP message sent by network device 3, the neighbor link information carried by the neighbor TLV includes that 0003 and 0002 have a neighbor relationship, 0003 and 0005 have a neighbor relationship, the content carried by the network segment TLV includes 10.1.1.0/24 and 30.1.1.0/24, and the content carried by the interface TLV includes 10.1.1.2 and 30.1.1.1. For LSP messages sent by other network devices, details of the contents carried by the LSP messages are not repeated.
In one example, an information collecting device may be specified among all network devices, the information collecting device being a network device connected to the controller, and the information collecting device may collect the topology information and send the topology information to the controller, such as sending the topology information to the controller via BGP LS messages. The information collecting device is not limited as long as the information collecting device is connected to the controller, and the number of the information collecting devices may be one or more. For convenience of description, the information collection device is hereinafter exemplified as the network device 1.
In one example, the information collecting device may maintain a mapping table for recording the correspondence of the device identification of the network device, the network segment set (the network segment set is used for recording all network segments supported by the network device), and the interface address (i.e. all interface addresses of the network device). In an initial state, the mapping table is empty, and the information collection device may record the device identifier of the device (i.e., the network device 1), all network segments supported by the network device 1, and all interface addresses of the network device 1 in the mapping table, as shown in table 1. After receiving the LSP packet sent by the network device 2, the information collection device may record the device identifier of the network device 2, all network segments supported by the network device 2, and all interface addresses of the network device 2 into a mapping table, as shown in table 2. After receiving the LSP packet sent by the network device 3, the information collection device may record the device identifier of the network device 3, all network segments supported by the network device 3, and all interface addresses of the network device 3 into a mapping table, as shown in table 2. By analogy, the processing of other network devices is not described in detail.
TABLE 1
Figure BDA0001417961590000051
TABLE 2
Figure BDA0001417961590000052
In tables 1 and 2, the correspondence between the network segment and the interface address, such as the correspondence between 8.1.1.0/24 and 8.1.1.1, the correspondence between 9.1.1.0/24 and 9.1.1.1, etc., is recorded, and in order to determine the correspondence between the network segment and the interface address, the information collection device can find the correspondence between the network segment and the interface address after acquiring all the network segments supported by the network device and all the interface addresses of the network device, which is not limited in this process.
In the application scenario, referring to fig. 2, a flowchart of a topology information transmission method provided in the embodiment of the present application is shown, where the method may be applied to an information collection device, and the method may include:
step 201, a first network device and a second network device having a neighbor relation are determined.
In one example, the process for determining a first network device and a second network device having a neighbor relation may include: receiving an LSP message which is sent by a first network device or a second network device and carries neighbor link information, wherein the neighbor link information comprises a device identifier of the first network device and a device identifier of the second network device; and determining the first network device and the second network device which have the neighbor relation according to the neighbor link information, namely that the two network devices corresponding to the two device identifications of the neighbor link information have the neighbor relation.
For example, after receiving the LSP packet sent by the network device 2, the information collection device may determine, based on the neighbor link information carried in the neighbor TLV, two network devices corresponding to the device identifier 0002 and the device identifier 0001 as a first network device and a second network device having a neighbor relationship, where the first network device is the network device 1 corresponding to the device identifier 0001, and the second network device is the network device 2 corresponding to the device identifier 0002. In addition, two network devices corresponding to the device identifier 0002 and the device identifier 0003 may be determined as a first network device and a second network device having a neighbor relationship, for example, the first network device is the network device 2 corresponding to the device identifier 0002, and the second network device is the network device 3 corresponding to the device identifier 0003.
Step 202, obtaining network segments supported by both the first network device and the second network device.
In one example, the process for "acquiring a network segment supported by both the first network device and the second network device" may include, but is not limited to, the following: acquiring a first network segment set corresponding to the first network equipment and a second network segment set corresponding to the second network equipment; the first network segment set comprises all network segments supported by the first network equipment, and the second network segment set comprises all network segments supported by the second network equipment; then, acquiring network segments supported by the first network device and the second network device according to the first network segment set and the second network segment set; the network segments supported by both the first network device and the second network device may be network segments existing in the first network segment set and existing in the second network segment set.
In order to obtain the network segments supported by both the first network device and the second network device, the following situations may be included:
in case one, if neither the first network device nor the second network device is an information collection device, when receiving an LSP packet sent by the first network device, the information collection device may carry all network segments supported by the first network device, and based on this, the information collection device may add all network segments supported by the first network device to the first network segment set, and may record a correspondence between a device identifier of the first network device and the first network segment set. In addition, when receiving the LSP packet sent by the second network device, the information collection device may carry all network segments supported by the second network device, and based on this, the information collection device may add all network segments supported by the second network device to the second network segment set, and may record the correspondence between the device identifier of the second network device and the second network segment set.
The information collecting device adds all network segments supported by the network device to a network segment set (such as a first network segment set and a second network segment set, where the network segment set of the first network device is referred to as a first network segment set and the network segment set of the second network device is referred to as a second network segment set for convenience of differentiation), and records a process of a corresponding relationship between a device identifier and the network segment set, that is, a process of updating a mapping table shown in table 2.
For example, when the first network device is the network device 2 and the second network device is the network device 3, and the information collection device receives the LSP message sent by the network device 2, all network segments supported by the network device 2, such as 8.1.1.0/24 and 10.1.1.0/24, are analyzed from the LSP message, 8.1.1.0/24 and 10.1.1.0/24 are added to the first network segment set, and a correspondence between the device identifier 0002 and the first network segment set is recorded, as shown in table 2. When receiving the LSP message sent by the network device 3, all network segments supported by the network device 3, such as 30.1.1.0/24 and 10.1.1.0/24, are analyzed from the LSP message, 30.1.1.0/24 and 10.1.1.0/24 are added to the second network segment set, and the correspondence between the device identifier 0003 and the second network segment set is recorded, as shown in table 2.
In summary, in step 202, as shown in table 2, the information collecting device may query the first network segment set (8.1.1.0/24 and 10.1.1.0/24) through the device identifier 0002 of the network device 2, and query the second network segment set (30.1.1.0/24 and 10.1.1.0/24) through the device identifier 0003 of the network device 3, and since the network segments existing in both the first network segment set and the second network segment set are 10.1.1.0/24, the network segment supported by both the first network device and the second network device acquired by the information collecting device may be 10.1.1.0/24.
And in the second case, if the first network device is an information collection device, the information collection device may acquire all network segments supported by the device, add all network segments supported by the device to the first network segment set, and record the corresponding relationship between the device identifier of the device and the first network segment set. When the information collection device receives the LSP message sent by the second network device, the LSP message may carry all network segments supported by the second network device, based on which, the information collection device may add all network segments supported by the second network device to the second network segment set, and may record the corresponding relationship between the device identifier of the second network device and the second network segment set.
The information collection device adds all network segments supported by the network device to the network segment set, and records a process of a corresponding relationship between the device identifier and the network segment set, that is, a process of updating the mapping table shown in table 2.
For example, when the first network device is network device 1 and the second network device is network device 2, the information collecting device adds all network segments supported by the device (e.g., 8.1.1.0/24 and 9.1.1.0/24) to the first network segment set, and records the correspondence between the device identifier 0001 and the first network segment set, as shown in table 2. When the information collection device receives the LSP packet sent by the network device 2, all network segments supported by the network device 2, such as 8.1.1.0/24 and 10.1.1.0/24, are analyzed from the LSP packet, 8.1.1.0/24 and 10.1.1.0/24 are added to the second network segment set, and the correspondence between the device identifier 0002 and the second network segment set is recorded, as shown in table 2.
In summary, in step 202, as shown in table 2, the information collecting device may query the first network segment set (8.1.1.0/24 and 9.1.1.0/24) through the device identifier 0001 of the network device 1, and query the second network segment set (8.1.1.0/24 and 10.1.1.0/24) through the device identifier 0002 of the network device 2, and since the network segments existing in both the first network segment set and the second network segment set are 8.1.1.0/24, the network segment supported by both the first network device and the second network device acquired by the information collecting device may be 8.1.1.0/24.
Step 203, selecting a first interface address belonging to the network segment from all interface addresses of the first network device, and selecting a second interface address belonging to the network segment from all interface addresses of the second network device.
The network segment is a network segment supported by both the first network device and the second network device.
To obtain the first interface address and the second interface address, the following may be included:
in the first case, if the first network device and the second network device are not information collection devices, when receiving an LSP packet sent by the first network device, the information collection device may carry all interface addresses supported by the first network device, and therefore, a network segment corresponding to each interface address may be determined from all network segments supported by the first network device, and a correspondence between the interface address and the network segment is recorded. When receiving the LSP message sent by the second network device, the information collection device may carry all the interface addresses supported by the second network device, and thus, may determine the network segment corresponding to each interface address from all the network segments supported by the second network device, and record the correspondence between the interface address and the network segment.
The information collecting device determines the network segment corresponding to the interface address from all network segments supported by the network device, and records the corresponding relationship between the interface address and the network segment, that is, the process of updating the mapping table shown in table 2, that is, the corresponding relationship between the interface address and the network segment is recorded in the mapping table shown in table 2.
For example, when the first network device is the network device 2 and the second network device is the network device 3, and the information collection device receives the LSP message sent by the network device 2, all interface addresses supported by the network device 2, such as 8.1.1.2 and 10.1.1.1, can be analyzed from the LSP message, and the information collection device knows all network segments supported by the network device 2, such as 8.1.1.0/24 and 10.1.1.0/24. Thus, it may be determined that interface address 8.1.1.2 corresponds to network segment 8.1.1.0/24 and interface address 10.1.1.1 corresponds to network segment 10.1.1.0/24. Then, the correspondence between the interface address 8.1.1.2 and the network segment 8.1.1.0/24 is recorded, and the correspondence between the interface address 10.1.1.1 and the network segment 10.1.1.0/24 is recorded, as shown in table 2. When receiving the LSP packet sent by the network device 3, the information collection device may parse all interface addresses supported by the network device 3 from the LSP packet, such as 10.1.1.2 and 30.1.1.1, and the information collection device may learn all network segments supported by the network device 3, such as 30.1.1.0/24 and 10.1.1.0/24. Thus, it may be determined that interface address 10.1.1.2 corresponds to network segment 10.1.1.0/24 and interface address 30.1.1.1 corresponds to network segment 30.1.1.0/24. Then, the correspondence of the interface address 10.1.1.2 to the network segment 10.1.1.0/24 and the correspondence of the interface address 30.1.1.1 to the network segment 30.1.1.0/24 may be recorded, as shown in table 2.
In summary, after acquiring the network segments 10.1.1.0/24 supported by both the first network device and the second network device, in step 203, as shown in table 2, the information collecting device may select the first interface address 10.1.1.1 belonging to the network segment from all interface addresses of the first network device, and select the second interface address 10.1.1.2 belonging to the network segment from all interface addresses of the second network device.
And if the first network equipment is information collection equipment, the information collection equipment determines the network segment corresponding to each interface address of the equipment from all network segments supported by the equipment, and records the corresponding relation between the interface address and the network segment. When the information collection device receives an LSP message sent by the second network device, the LSP message carries all interface addresses supported by the second network device, a network segment corresponding to each interface address is determined from all network segments supported by the second network device, and the corresponding relation between the interface address and the network segment is recorded.
The information collecting device determines the network segment corresponding to the interface address from all network segments, and records the process of the corresponding relationship between the interface address and the network segment, that is, the process of updating the mapping table shown in table 2.
For example, when the first network device is the network device 1 and the second network device is the network device 2, the information collecting device learns all interface addresses supported by the information collecting device, such as 8.1.1.1 and 9.1.1.1, and all network segments supported by the information collecting device, such as 8.1.1.0/24 and 9.1.1.0/24, so that it is determined that the interface address 8.1.1.1 corresponds to the network segment 8.1.1.0/24 and the interface address 9.1.1.1 corresponds to the network segment 9.1.1.0/24, and the corresponding relationship between the interface address and the network segment is recorded, as shown in table 2. When the information collection device receives the LSP packet sent by the network device 2, it obtains all interface addresses supported by the network device 2, such as 8.1.1.2 and 10.1.1.1, and because the network segments supported by the network device 2 are 8.1.1.0/24 and 10.1.1.0/24, it determines that the interface address 8.1.1.2 corresponds to the network segment 8.1.1.0/24 and the interface address 10.1.1.1 corresponds to the network segment 10.1.1.0/24, and records the correspondence between the interface addresses and the network segments, as shown in table 2.
In summary, after acquiring the network segments 8.1.1.0/24 supported by both the first network device and the second network device, in step 203, as shown in table 2, the information collecting device may select the first interface address 8.1.1.1 belonging to the network segment from all interface addresses of the first network device, and select the second interface address 8.1.1.2 belonging to the network segment from all interface addresses of the second network device.
Step 204, sending topology information to a controller, where the topology information includes neighbor information of the first network device and the second network device, and link information of the first interface address and the second interface address.
For example, when the first network device is the network device 2 and the second network device is the network device 3, the topology information includes the device identifier 0002 of the network device 2 and the device identifier 0003 of the network device 3, and includes the first interface address 10.1.1.1 and the second interface address 10.1.1.2, and the first interface address 10.1.1.1 corresponds to the device identifier 0002 and the second interface address 10.1.1.2 corresponds to the device identifier 0003. After receiving the topology information, the controller learns that the network device 2 corresponding to the device identifier 0002 and the network device 3 corresponding to the device identifier 0003 have a neighbor relationship, and an interface on the network device 2 connected to the network device 3 is a first interface address 10.1.1.1, and an interface on the network device 3 connected to the network device 2 is a second interface address 10.1.1.2.
For another example, when the first network device is network device 1 and the second network device is network device 2, the topology information includes device identifier 0001 of network device 1 and device identifier 0002 of network device 2, and includes first interface address 8.1.1.1 and second interface address 8.1.1.2, and first interface address 8.1.1.1 corresponds to device identifier 0001 and second interface address 8.1.1.2 corresponds to device identifier 0002. After receiving the topology information, the controller learns that the network device 1 corresponding to the device identifier 0001 and the network device 2 corresponding to the device identifier 0002 have a neighbor relationship, and an interface on the network device 1 connected to the network device 2 is a first interface address 8.1.1.1, and an interface on the network device 2 connected to the network device 1 is a second interface address 8.1.1.2.
To sum up, if the packet needs to be transmitted from the network device 1 to the network device 3, the controller may control a transmission path of the packet according to the topology information, where the transmission path may be: interface address 8.1.1.1 of network device 1, interface address 8.1.1.2 of network device 2, interface address 10.1.1.1 of network device 2, interface address 10.1.1.2 of network device 3. Obviously, the above method can control the outgoing interface of the message.
In addition, the topology information of the network devices 1 and 4, the topology information of the network devices 4 and 5, and the topology information of the network devices 3 and 5 are similar to the above process and are not described again.
Based on the foregoing technical solution, in this embodiment of the application, the topology information sent by the information collection device to the controller may include neighbor information of the first network device and the second network device, and link information of the first interface address and the second interface address, based on the topology information, the controller learns that the first network device and the second network device have a neighbor relationship, and an interface connected to the second network device on the first network device is the first interface address, and an interface connected to the first network device on the second network device is the second interface address. That is, the controller may know detailed topology information, that is, which interface the first network device is connected to which interface of the second network device through, that is, the controller may know interface addresses of the connected interfaces.
Moreover, the first network device only needs to send the first interface address to the information collecting device, and the second network device only needs to send the second interface address to the information collecting device, so that the information collecting device can determine that the first interface address and the second interface address have a connection relation based on the network segments supported by both the first network device and the second network device. The first network device does not need to collect information of the second interface address, and does not need to send the first interface address and the second interface address to the information collection device at the same time.
In the above embodiment, after receiving the LSP packet, the information collection device may first analyze the segment TLV of the LSP packet to obtain each segment in the segment TLV, and then analyze the interface TLV of the LSP packet to obtain each interface address in the interface TLV. Based on this, the information collecting device may record each network segment in the network segment TLV into the mapping table shown in table 2, then, after obtaining the interface address, query the network segment corresponding to the interface address from the mapping table, and record the interface address to the position corresponding to the network segment.
In another example, after receiving the LSP packet, the information collecting device may first analyze the interface TLV of the LSP packet to obtain each interface address in the interface TLV, and then analyze the network segment TLV of the LSP packet to obtain each network segment in the network segment TLV. Based on this, the information collecting device may record each interface address in the interface TLV into the mapping table shown in table 2, then, after obtaining the network segment, query the interface address corresponding to the network segment from the mapping table, and record the network segment to the position corresponding to the interface address.
In the above embodiment, the topology information transmitted by the information collecting apparatus to the controller may include two link information. For example, when the first network device is the network device 2 and the second network device is the network device 3, the topology information includes neighbor information, link information 1 and link information 2, where the link information 1 includes a first interface address 10.1.1.1 and a second interface address 10.1.1.2, and represents a link from the first interface address 10.1.1.1 to the second interface address 10.1.1.2. Link information 2 includes second interface address 10.1.1.2 and first interface address 10.1.1.1, representing a link from second interface address 10.1.1.2 to first interface address 10.1.1.1. Based on the link information 1 and the link information 2, the controller learns that a link exists between the first interface address 10.1.1.1 and the second interface address 10.1.1.2, and a link also exists between the second interface address 10.1.1.2 and the first interface address 10.1.1.1.
Based on the same application concept as the method, an embodiment of the present application further provides a topology information transmission apparatus applied to an information collection device, as shown in fig. 3, which is a structural diagram of the apparatus, and the apparatus includes:
a determining module 301, configured to determine a first network device and a second network device that have a neighbor relation;
an obtaining module 302, configured to obtain a network segment supported by both the first network device and the second network device; selecting a first interface address belonging to the network segment from all interface addresses of the first network equipment, and selecting a second interface address belonging to the network segment from all interface addresses of the second network equipment;
a sending module 303, configured to send topology information to the controller, where the topology information includes neighbor information of the first network device and the second network device, and link information of the first interface address and the second interface address.
The obtaining module 302 is specifically configured to obtain a first network segment set corresponding to the first network device and a second network segment set corresponding to the second network device in a process of obtaining network segments supported by both the first network device and the second network device; the first network segment set comprises all network segments supported by the first network equipment, and the second network segment set comprises all network segments supported by the second network equipment; acquiring network segments supported by the first network equipment and the second network equipment according to the first network segment set and the second network segment set; the network segments supported by the first network device and the second network device are the network segments existing in the first network segment set and the second network segment set.
In one example, the topology information transmission apparatus may further include (not shown in the figure):
a processing module, configured to receive an LSP packet sent by a first network device, where the LSP packet carries all network segments supported by the first network device, add all network segments supported by the first network device to a first network segment set, and record a correspondence between a device identifier of the first network device and the first network segment set; receiving an LSP message sent by a second network device, wherein the LSP message carries all network segments supported by the second network device, adding all network segments supported by the second network device to a second network segment set, and recording a corresponding relation between a device identifier of the second network device and the second network segment set.
The processing module is configured to receive an LSP message sent by a first network device, where the LSP message carries all interface addresses supported by the first network device, determine a network segment corresponding to each interface address from all network segments supported by the first network device, and record a correspondence between the interface address and the network segment;
the processing module is further configured to receive an LSP packet sent by a second network device, where the LSP packet carries all interface addresses supported by the second network device, determine a network segment corresponding to each interface address from all network segments supported by the second network device, and record a corresponding relationship between the interface address and the network segment.
In an example, the determining module 301 is specifically configured to receive an LSP packet that carries neighbor link information and is sent by a first network device or a second network device, where the neighbor link information includes a device identifier of the first network device and a device identifier of the second network device; and determining the first network equipment and the second network equipment which have the neighbor relation according to the neighbor link information.
As for the information collecting device provided in the embodiment of the present application, from a hardware level, a schematic diagram of a hardware architecture of the information collecting device may specifically refer to fig. 4. The method comprises the following steps: a machine-readable storage medium and a processor, wherein:
a machine-readable storage medium: the instruction code is stored.
A processor: the method comprises the steps of communicating with a machine-readable storage medium, reading and executing instruction codes stored in the machine-readable storage medium, and realizing the topology information transmission operation disclosed in the above example of the application.
Here, a machine-readable storage medium may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and so forth. For example, the machine-readable storage medium may be: a RAM (random Access Memory), a volatile Memory, a non-volatile Memory, a flash Memory, a storage drive (e.g., a hard drive), a solid state drive, any type of storage disk (e.g., an optical disk, a dvd, etc.), or similar storage medium, or a combination thereof.
The systems, devices, modules or units illustrated in the above embodiments may be implemented by a computer chip or an entity, or by a product with certain functions. A typical implementation device is a computer, which may take the form of a personal computer, laptop computer, cellular telephone, camera phone, smart phone, personal digital assistant, media player, navigation device, email messaging device, game console, tablet computer, wearable device, or a combination of any of these devices.
For convenience of description, the above devices are described as being divided into various units by function, and are described separately. Of course, the functionality of the units may be implemented in one or more software and/or hardware when implementing the present application.
As will be appreciated by one skilled in the art, embodiments of the present application may be provided as a method, system, or computer program product. Accordingly, the present application may take the form of an entirely hardware embodiment, an entirely software embodiment or an embodiment combining software and hardware aspects. Furthermore, embodiments of the present application may take the form of a computer program product embodied on one or more computer-usable storage media (including, but not limited to, disk storage, CD-ROM, optical storage, and the like) having computer-usable program code embodied therein.
The present application is described with reference to flowchart illustrations and/or block diagrams of methods, apparatus (systems), and computer program products according to embodiments of the application. It will be understood that each flow and/or block of the flow diagrams and/or block diagrams, and combinations of flows and/or blocks in the flow diagrams and/or block diagrams, can be implemented by computer program instructions. These computer program instructions may be provided to a processor of a general purpose computer, special purpose computer, embedded processor, or other programmable data processing apparatus to produce a machine, such that the instructions, which execute via the processor of the computer or other programmable data processing apparatus, create means for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
Furthermore, these computer program instructions may also be stored in a computer-readable memory that can direct a computer or other programmable data processing apparatus to function in a particular manner, such that the instructions stored in the computer-readable memory produce an article of manufacture including instruction means which implement the function specified in the flowchart flow or flows and/or block diagram block or blocks.
These computer program instructions may also be loaded onto a computer or other programmable data processing apparatus to cause a series of operational steps to be performed on the computer or other programmable apparatus to produce a computer implemented process such that the instructions which execute on the computer or other programmable apparatus provide steps for implementing the functions specified in the flowchart flow or flows and/or block diagram block or blocks.
The above description is only an example of the present application and is not intended to limit the present application. Various modifications and changes may occur to those skilled in the art. Any modification, equivalent replacement, improvement, etc. made within the spirit and principle of the present application should be included in the scope of the claims of the present application.

Claims (10)

1. A topology information transmission method is applied to information collection equipment and comprises the following steps:
determining a first network device and a second network device having a neighbor relation;
acquiring network segments supported by the first network equipment and the second network equipment;
selecting a first interface address belonging to the network segment from all interface addresses of the first network equipment, and selecting a second interface address belonging to the network segment from all interface addresses of the second network equipment;
sending topology information to a controller, wherein the topology information includes neighbor information of the first network device and the second network device, and link information of the first interface address and the second interface address, so that the controller determines that the first interface address is connected with the second network device on the first network device according to the topology information, and determines that the second interface address is connected with the first network device on the second network device according to the topology information;
the first network equipment comprises a plurality of interfaces, the network segments of different interfaces are different, the second network equipment comprises a plurality of interfaces, and the network segments of different interfaces are different; and for the first network equipment and the second network equipment which are connected with each other, the network segments of the two interfaces which are connected with each other are the same.
2. The method according to claim 1, wherein the process of acquiring the network segments supported by both the first network device and the second network device specifically includes:
acquiring a first network segment set corresponding to the first network equipment and a second network segment set corresponding to the second network equipment; the first network segment set comprises all network segments supported by the first network equipment, and the second network segment set comprises all network segments supported by the second network equipment;
acquiring network segments supported by the first network equipment and the second network equipment according to the first network segment set and the second network segment set; the network segments supported by the first network device and the second network device are the network segments existing in the first network segment set and the second network segment set.
3. The method of claim 2, wherein before the obtaining the first network segment set corresponding to the first network device and the second network segment set corresponding to the second network device, the method further comprises:
receiving an LSP message sent by a first network device, wherein the LSP message carries all network segments supported by the first network device, adding all network segments supported by the first network device to a first network segment set, and recording a corresponding relation between a device identifier of the first network device and the first network segment set;
receiving an LSP message sent by a second network device, wherein the LSP message carries all network segments supported by the second network device, adding all network segments supported by the second network device to a second network segment set, and recording a corresponding relation between a device identifier of the second network device and the second network segment set.
4. The method of claim 1,
before selecting the first interface address belonging to the network segment from all the interface addresses of the first network device, the method further includes: receiving an LSP message sent by a first network device, wherein the LSP message carries all interface addresses supported by the first network device, determining a network segment corresponding to each interface address from all network segments supported by the first network device, and recording the corresponding relation between the interface address and the network segment;
before selecting the second interface address belonging to the network segment from all the interface addresses of the second network device, the method further includes: receiving an LSP message sent by a second network device, wherein the LSP message carries all interface addresses supported by the second network device, determining a network segment corresponding to each interface address from all network segments supported by the second network device, and recording the corresponding relation between the interface address and the network segment.
5. The method of claim 1,
the process of determining the first network device and the second network device having the neighbor relation specifically includes:
receiving an LSP message which is sent by a first network device or a second network device and carries neighbor link information, wherein the neighbor link information comprises a device identifier of the first network device and a device identifier of the second network device; and determining the first network equipment and the second network equipment which have the neighbor relation according to the neighbor link information.
6. A topology information transmission device, applied to an information collection apparatus, includes:
a determining module, configured to determine a first network device and a second network device that have a neighbor relation;
an obtaining module, configured to obtain a network segment supported by both the first network device and the second network device; selecting a first interface address belonging to the network segment from all interface addresses of the first network equipment, and selecting a second interface address belonging to the network segment from all interface addresses of the second network equipment;
a sending module, configured to send topology information to a controller, where the topology information includes neighbor information of a first network device and a second network device, and link information of a first interface address and a second interface address, so that the controller determines, according to the topology information, that a connection between the first network device and the second network device is the first interface address, and determines, according to the topology information, that a connection between the second network device and the first network device is the second interface address;
the first network equipment comprises a plurality of interfaces, the network segments of different interfaces are different, the second network equipment comprises a plurality of interfaces, and the network segments of different interfaces are different; and for the first network equipment and the second network equipment which are connected with each other, the network segments of the two interfaces which are connected with each other are the same.
7. The apparatus of claim 6,
the acquiring module is specifically configured to acquire a first network segment set corresponding to the first network device and a second network segment set corresponding to the second network device in a process of acquiring network segments supported by both the first network device and the second network device; the first network segment set comprises all network segments supported by the first network equipment, and the second network segment set comprises all network segments supported by the second network equipment;
acquiring network segments supported by the first network equipment and the second network equipment according to the first network segment set and the second network segment set; the network segments supported by the first network device and the second network device are the network segments existing in the first network segment set and the second network segment set.
8. The apparatus of claim 7, further comprising:
a processing module, configured to receive an LSP packet sent by a first network device, where the LSP packet carries all network segments supported by the first network device, add all network segments supported by the first network device to a first network segment set, and record a correspondence between a device identifier of the first network device and the first network segment set; receiving an LSP message sent by a second network device, wherein the LSP message carries all network segments supported by the second network device, adding all network segments supported by the second network device to a second network segment set, and recording a corresponding relation between a device identifier of the second network device and the second network segment set.
9. The apparatus of claim 6, further comprising:
a processing module, configured to receive an LSP packet sent by a first network device, where the LSP packet carries all interface addresses supported by the first network device, determine a network segment corresponding to each interface address from all network segments supported by the first network device, and record a correspondence between the interface address and the network segment;
the processing module is further configured to receive an LSP packet sent by a second network device, where the LSP packet carries all interface addresses supported by the second network device, determine a network segment corresponding to each interface address from all network segments supported by the second network device, and record a corresponding relationship between the interface address and the network segment.
10. The apparatus according to claim 6, wherein the determining module is specifically configured to receive an LSP packet that carries neighbor link information and is sent by a first network device or a second network device, where the neighbor link information includes a device identifier of the first network device and a device identifier of the second network device; and determining the first network equipment and the second network equipment which have the neighbor relation according to the neighbor link information.
CN201710875157.2A 2017-09-25 2017-09-25 Topology information transmission method and device Active CN108259340B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201710875157.2A CN108259340B (en) 2017-09-25 2017-09-25 Topology information transmission method and device

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201710875157.2A CN108259340B (en) 2017-09-25 2017-09-25 Topology information transmission method and device

Publications (2)

Publication Number Publication Date
CN108259340A CN108259340A (en) 2018-07-06
CN108259340B true CN108259340B (en) 2021-06-29

Family

ID=62722309

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201710875157.2A Active CN108259340B (en) 2017-09-25 2017-09-25 Topology information transmission method and device

Country Status (1)

Country Link
CN (1) CN108259340B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN114567580B (en) * 2020-11-27 2023-10-20 华为技术有限公司 Message sending method, message processing method, device and system
CN115701044A (en) * 2021-07-21 2023-02-07 华为技术有限公司 Method and device for acquiring network topology

Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1747466A (en) * 2004-09-10 2006-03-15 华为技术有限公司 Method for acquiring detail information about link symmetric interface
US20150271066A1 (en) * 2012-10-05 2015-09-24 Cisco Technology, Inc. Mpls segment-routing
CN105024866A (en) * 2015-08-17 2015-11-04 中国科学院计算技术研究所 Detection system and method for routing configuration abnormity of IS-ISv6 network
CN105591937A (en) * 2015-09-30 2016-05-18 杭州华三通信技术有限公司 Network topology information acquisition method and device
US20170195222A1 (en) * 2015-12-30 2017-07-06 Qualcomm Incorporated Routing frames in shared medium networks

Patent Citations (5)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1747466A (en) * 2004-09-10 2006-03-15 华为技术有限公司 Method for acquiring detail information about link symmetric interface
US20150271066A1 (en) * 2012-10-05 2015-09-24 Cisco Technology, Inc. Mpls segment-routing
CN105024866A (en) * 2015-08-17 2015-11-04 中国科学院计算技术研究所 Detection system and method for routing configuration abnormity of IS-ISv6 network
CN105591937A (en) * 2015-09-30 2016-05-18 杭州华三通信技术有限公司 Network topology information acquisition method and device
US20170195222A1 (en) * 2015-12-30 2017-07-06 Qualcomm Incorporated Routing frames in shared medium networks

Non-Patent Citations (1)

* Cited by examiner, † Cited by third party
Title
"Physical topology discovery for large multisubnet networks";Y. Bejerano,等;《IEEE INFOCOM 2003. Twenty-second Annual Joint Conference of the IEEE Computer and Communications Societies》;20030709;全文 *

Also Published As

Publication number Publication date
CN108259340A (en) 2018-07-06

Similar Documents

Publication Publication Date Title
CN108259347B (en) Message transmission method and device
CN107547391B (en) Message transmission method and device
CN106878194B (en) Message processing method and device
CN108848034B (en) Network equipment and table entry learning method
US8903972B2 (en) Method and apparatus for sharing contents using information of group change in content oriented network environment
CN108259218B (en) IP address allocation method and device
CN109495320B (en) Data message transmission method and device
CN108390954B (en) Message transmission method and device
CN107547400B (en) Virtual machine migration method and device
CN108259348B (en) Message transmission method and device
CN111083179A (en) Internet of things cloud platform, and equipment interaction method and device based on same
CN110784345A (en) Network traffic processing method and device, electronic equipment and machine-readable storage medium
CN109167700B (en) Detection method and device for Segment Routing (SR) tunnel
CN108259340B (en) Topology information transmission method and device
CN110784339B (en) LACP message overtime fault detection method and device, and electronic equipment
CN109728972B (en) Network connection detection method and device
CN108418752A (en) A kind of creation method and device of aggregation group
CN110581784B (en) Node health check method, device and equipment
CN104363171A (en) Forwarding control method and processing node for user messages
CN107547378B (en) VPN route learning method and device
CN109714398B (en) Data storage method and device
CN107547382B (en) Neighbor relation discovery method and device
CN109413225B (en) MAC table item processing method and equipment
CN110086727B (en) Load sharing method and device between CGN boards
CN108632125B (en) Multicast table item management method, device, equipment and machine readable storage medium

Legal Events

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