CN109873764B - Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation - Google Patents

Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation Download PDF

Info

Publication number
CN109873764B
CN109873764B CN201910130626.7A CN201910130626A CN109873764B CN 109873764 B CN109873764 B CN 109873764B CN 201910130626 A CN201910130626 A CN 201910130626A CN 109873764 B CN109873764 B CN 109873764B
Authority
CN
China
Prior art keywords
message
ospf
standby
routing
link layer
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
CN201910130626.7A
Other languages
Chinese (zh)
Other versions
CN109873764A (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 DPTech Technologies Co Ltd
Original Assignee
Hangzhou DPTech 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 DPTech Technologies Co Ltd filed Critical Hangzhou DPTech Technologies Co Ltd
Priority to CN201910130626.7A priority Critical patent/CN109873764B/en
Publication of CN109873764A publication Critical patent/CN109873764A/en
Application granted granted Critical
Publication of CN109873764B publication Critical patent/CN109873764B/en
Active legal-status Critical Current
Anticipated expiration legal-status Critical

Links

Images

Abstract

The application provides a method, a device, an electronic device and a machine-readable storage medium for establishing a directed OSPF neighbor relation. In the application, a first message is sent in the broadcast network based on multicast, wherein the first message at least includes related information for establishing an OSPF (open shortest path first) neighbor relationship between the master device and the standby device; acquiring a second message, and acquiring a network address and a link layer address of the standby equipment based on the second message, wherein the second message is a response of the standby equipment to the first message; and creating a directional OSPF neighbor table based on the network address and the link layer address of the standby equipment, wherein the directional OSPF neighbor table is used for an OSPF protocol interaction phase after the master equipment and the standby equipment reach the two-way state.

Description

Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation
Technical Field
The present application relates to the field of communications technologies, and in particular, to a method, an apparatus, an electronic device, and a machine-readable storage medium for establishing a directional OSPF neighbor relation.
Background
An Open Shortest Path First (OSPF) Protocol is an Interior Gateway Protocol (IGP) Protocol based on a link state developed by an IETF (The Internet Engineering Task Force) organization. RIP (Routing Information Protocol) was widely used on networks as an IGP Protocol before the advent of OSPF. Because the RIP is a routing protocol based on a distance vector algorithm, there are problems of slow convergence, routing loops, poor expandability, etc., and meanwhile, as the IP network is getting larger and larger, in order to meet the needs of large and heterogeneous IP networks, the RIP protocol is gradually replaced by the OSPF protocol, which is widely used in various networks as a common IGP routing protocol.
Disclosure of Invention
The application provides a method for establishing a directed OSPF neighbor relation, which is applied to a routing device supporting an OSPF protocol, wherein the routing device is located in a broadcast network, the broadcast network includes a plurality of routing devices, and the routing device can be configured as a master device or a standby device, wherein the master device is a network device having a relatively large routing identifier value on one side in the OSPF neighbor relation to be established, and the standby device is a network device having a relatively small routing identifier value on the other side in the OSPF neighbor relation corresponding to the master device, and when the routing device is the master device, the method includes:
based on multicast, sending a first message in the broadcast network, wherein the first message at least comprises relevant information of OSPF (open shortest path first) neighbor relation established between the main equipment and the standby equipment;
acquiring a second message, and acquiring a network address and a link layer address of the standby equipment based on the second message, wherein the second message is a response of the standby equipment to the first message;
and creating a directional OSPF neighbor table based on the network address and the link layer address of the standby equipment, wherein the directional OSPF neighbor table is used for an OSPF protocol interaction phase after the master equipment and the standby equipment reach the two-way state.
Optionally, the routing device supports an IPv6 protocol, and the version of the OSPF protocol supported by the routing device is V3.
Optionally, the first packet at least further includes a requested node multicast address corresponding to the standby device, a network address and a link layer address of the main device, a packet type, and a link layer address query corresponding to the standby device.
Optionally, the method further includes:
if a third message of the standby equipment is received, acquiring a link layer address of the third message, wherein the third message is a notification message of the change of the link layer address of the standby equipment;
and updating the link layer address corresponding to the oriented OSPF neighbor table of the standby equipment as the link layer address of the third message.
The present application further provides an apparatus for establishing a directed OSPF neighbor relation, where the apparatus is applied to a routing device supporting an OSPF protocol, the routing device is located in a broadcast network, the broadcast network includes a plurality of routing devices, and the routing device may be configured as a master device or a standby device, where the master device is a network device to be established with a relatively large routing identifier value on one side of the OSPF neighbor relation, and the standby device is a network device corresponding to the master device and having a relatively small routing identifier value on the other side of the OSPF neighbor relation, and when the routing device is the master device, the apparatus includes:
a transceiver module, configured to send a first packet in the broadcast network based on multicast, where the first packet at least includes information related to an OSPF neighbor relationship established between the master device and the standby device;
the transceiver module further acquires a second message, and acquires a network address and a link layer address of the standby device based on the second message, wherein the second message is a response of the standby device to the first message;
and the creating module is used for creating a directional OSPF neighbor table based on the network address and the link layer address of the standby equipment, wherein the directional OSPF neighbor table is used for the OSPF protocol interaction phase after the main equipment and the standby equipment reach the two-way state.
Optionally, the routing device supports an IPv6 protocol, and the version of the OSPF protocol supported by the routing device is V3.
Optionally, the first packet at least further includes a requested node multicast address corresponding to the standby device, a network address and a link layer address of the main device, a packet type, and a link layer address query corresponding to the standby device.
Optionally, the method further includes:
the transceiver module further acquires a link layer address of a third message if the third message of the standby device is received, wherein the third message is a notification message of the change of the link layer address of the standby device;
the creating module further updates the link layer address of the standby device corresponding to the oriented OSPF neighbor table to the link layer address of the third packet.
The application also provides an electronic device, which comprises a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are mutually connected through the bus;
the memory stores machine-readable instructions, and the processor executes the method by calling the machine-readable instructions.
The present application also provides a machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, implement the above-described method.
Through the embodiment, based on multicast, sending a first message in the broadcast network, where the first message at least includes information related to the OSPF neighbor relationship established between the master device and the standby device; acquiring a second message, and acquiring a network address and a link layer address of the standby equipment based on the second message, wherein the second message is a response of the standby equipment to the first message; and establishing a directional OSPF neighbor table based on the network address and the link layer address of the standby equipment, wherein the directional OSPF neighbor table is used for realizing the establishment of the directional OSPF neighbor table between two routing equipment by customizing OSPF 3 extension messages in a broadcast network comprising a plurality of routing equipment supporting OSPF 3 and IPv6 protocols in an OSPF protocol interaction stage after the main equipment and the standby equipment reach a two-way state without starting NDP by the routing equipment, thereby reducing the power consumption of the routing equipment, greatly improving the performance of the routing equipment and avoiding the interference on the routing equipment without establishing an OSPF neighbor relation.
Drawings
Fig. 1 is a flowchart of a method for establishing a directed OSPF neighbor relation according to an exemplary embodiment.
Figure 2 is a flow diagram of a one time update directed OSPF neighbor table provided by an exemplary embodiment.
Fig. 3 is a block diagram of an apparatus for establishing a directed OSPF neighbor relation according to an exemplary embodiment.
Fig. 4 is a hardware block diagram of an electronic device according to an exemplary embodiment.
Detailed Description
Reference will now be made in detail to the exemplary embodiments, examples of which are illustrated in the accompanying drawings. When the following description refers to the accompanying drawings, like numbers in different drawings represent the same or similar elements unless otherwise indicated. The embodiments described in the following exemplary embodiments do not represent all embodiments consistent with the present application. Rather, they are merely examples of apparatus and methods consistent with certain aspects of the present application, as detailed in the appended claims.
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 appended 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 refers to and encompasses 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. The word "if" as used herein may be interpreted as "at … …" or "when … …" or "in response to a determination", depending on the context.
In order to make those skilled in the art better understand the technical solution in the embodiment of the present application, a brief description will be given below of the related technology for establishing a directional OSPF neighbor relation according to the embodiment of the present application.
The abbreviation of IPv6(Internet Protocol Version 6, Version 6 of the Internet Protocol) is the next-generation IP Protocol designed by the Internet Engineering Task Force (IETF) to replace IPv4(Internet Protocol Version 4, Version 4 of the Internet Protocol), and the number of addresses can be called to address each sand worldwide. Since the biggest problem of the IPv4 is that network address resources are limited, the application and development of the internet are severely restricted. The use of the IPv6 not only solves the problem of the number of network address resources, but also solves the obstacle of connecting various access devices to the Internet.
In the network based on IPv6, NDP (Neighbor Discovery Protocol) is one of the key protocols, and combines and improves the protocols such as ARP (Address Resolution Protocol), ICMP (Internet Control Message Protocol), routing device Discovery, ICMP redirection, and the like in IPv 4. As a basic protocol of IPv6, NDP also provides functions such as prefix discovery, neighbor unreachable detection, duplicate address monitoring, address auto-configuration, etc., where the address auto-configuration mechanism includes a series of important functions, such as: and discovering the routing equipment.
Under a networking including a plurality of routing devices supporting IPv6, the plurality of routing devices supporting IPv6 are all configured to start NDP for implementing mutual discovery of the routing devices, and at the same time, the plurality of routing devices supporting IPv6 are all enabled with OSPF protocol, and establish an OSPF neighbor relationship between the routing devices based on the OSPF protocol, specifically, for example: the networking includes a routing device A, B, C, and when the routing device A, B, C configures and starts the NDP, the routing devices are between each other, for example: a < - - > B, A < - - > C, B < - - > C establishes an OSPF neighbor relation based on an OSPF protocol, that is, the routing devices establish a plurality of unicast connections, and in some scenarios, a user only needs to establish the OSPF neighbor relation between the routing devices A, B, but does not need to establish the OSPF neighbor relation between the routing devices A, C and B, C. However, the existing implementation cannot be flexibly controlled, so that unicast message interaction is still established between the routing devices A, C and between the routing devices B, C due to the ND protocol being started, and a large amount of device performance is consumed.
Based on this, the present application provides a scheme for establishing a directional OSPF neighbor relation, which is applied to a routing device supporting an OSPF protocol, where the routing device is located in a broadcast network, the broadcast network includes a plurality of routing devices, and the routing device may be configured as a master device or a slave device, where the master device is a network device having a relatively large routing identifier value on one side of the OSPF neighbor relation to be established, and the slave device is a network device having a relatively small routing identifier value on the other side of the OSPF neighbor relation corresponding to the master device, and when the routing device is the master device, a first packet is sent in the broadcast network based on multicast, where the first packet at least includes information related to the OSPF neighbor relation established between the master device and the slave device; acquiring a second message, and acquiring a network address and a link layer address of the standby equipment based on the second message, wherein the second message is a response of the standby equipment to the first message; and creating a directional OSPF neighbor table based on the network address and the link layer address of the standby equipment, wherein the directional OSPF neighbor table is used for an OSPF protocol interaction phase after the master equipment and the standby equipment reach the two-way state.
The present application is described below with reference to specific embodiments and specific application scenarios.
Referring to fig. 1, fig. 1 is a method for establishing a directed OSPF neighbor relationship according to an embodiment of the present application, where the method is applied to a routing device supporting an OSPF protocol, the routing device is located in a broadcast network, the broadcast network includes a plurality of routing devices, and the routing device may be configured as a primary device or a standby device, where the primary device is a network device to be established with a relatively large route identifier value on one side of the OSPF neighbor relationship, and the standby device is a network device corresponding to the primary device and having a relatively small route identifier value on the other side of the OSPF neighbor relationship, and when the routing device is the primary device, the method performs the following steps:
step 102, sending a first message in the broadcast network based on multicast, wherein the first message at least includes related information for establishing an OSPF neighbor relationship between the master device and the standby device.
The routing device supports an IPv6 protocol and an OSPF protocol, wherein the OSPF protocol uses OSPF V2 for the IPv4 protocol and uses OSPF V3 for the IPv6 version, so that the OSPF protocol version supported by the routing device is V3. The broadcast network refers to an IPv6 network including a plurality of routing devices supporting OSPF V3, such as: the broadcast network includes a routing device A, B, C, where the routing devices all preset a routing ID, which is also referred to as a routing identifier value, referred to as RouterID for short in this application, and the routing identifier value is used to uniquely indicate one routing device in an OSPF protocol suite, and the routing identifier value of each routing device cannot be the same, for example: the RouterID of routing device A is 3.3.3.3, the RouterID of routing device B is 2.2.2.2, and the RouterID of routing device C is 1.1.1.1.
In some scenarios, the user only needs to establish the OSPF neighbor relationship between the routing devices A, B, and does not need to establish the OSPF between the routing devices A, C and between the routing devices B, C. Specifically, the routing device a sends a first packet in the broadcast network, where the first packet refers to a HELLO packet of an OSPF protocol, and the HELLO packet, that is, the first packet at least includes information related to the OSPF neighbor relationship established between the routing device a and the standby device.
Specifically, for ease of understanding, the following process of establishing OSPF neighbor relations by the OSPF protocol is briefly described: in an initial situation, after the routing device A, B enables the OSPF protocol on the corresponding interfaces of the respective devices, the routing device a starts to send multicast HELLO packets on the corresponding OSPF interfaces, so as to discover OSPF neighbors. In the HELLO packet, there is an active neighbor field for storing the neighbor found by the routing device a on the OSPF interface, and certainly, in the initial case, this HELLO packet does not include any active neighbor, and there is no active neighbor field, because the routing device a does not find any neighbor.
When the routing device B receives the HELLO packet sent by the neighboring routing device a on a certain OSPF interface, the HELLO message does not carry active neighbor, the routing device B records the RouterID of the routing device a in the OSPF interface data structure of the routing device B, and regards the neighbor state of the routing device a as the init initial state, then the RouterID of the routing device A is stored in the active neighbor field of the HELLO message to be sent, and is sent out, thus, the routing device A will receive the HELLO message of the routing device B, and find out its own RouterID in the HELLO message, namely 3.3.3.3, and meanwhile, the routing device a obtains the RouterID of the routing device B from the HELLO message, i.e., 2.2.2.2, then routing device a may assume that bilateral relationship establishment has been completed with routing device B, therefore, the routing device a sets the neighbor state of the routing device B to be two-way on its own device. Meanwhile, the routing device a will continue to send HELLO packets, and place the RouterID of the routing device B in the HELLO packet, and the routing device B receives the HELLO packet and sees its RouterID, that is, 2.2.2.2, the routing device B will also be on its own device, and set the state of the routing device a to be tw-way.
OSPF reaches the first steady state based on the above process, i.e., the routing devices A, B all stand at their respective angles and assume that the other has reached the two-way state. The HELLO packets are all sent based on multicast, and the format and the detailed interaction process of the HELLO packets refer to the implementation of the OSPF neighbor discovery phase, which is not described in detail herein.
After the OSPF neighbor discovery phase, that is, after the routing device A, B establishes the OSPF neighbor relationship, the routing device a and the routing device B compare based on the sizes of their routerids, and are configured to determine a master initiator of a DBD (Link State Database Description Packet) Packet in a subsequent OSPF protocol phase, where the master initiator is configured to determine a sequence number of the DBD Packet, the master initiator is also a master device, and an opposite end device corresponding to the routing device a and the master initiator is a slave initiator, that is, the slave initiator is a slave device. Such as: and the Router ID of the routing device B is 2.2.2.2 and is smaller than the Router ID of the routing device A, namely 3.3.3.3, of the routing device B, and the routing device A is a main device and the routing device B is a standby device. In another optional implementation, the primary-standby relationship between the routing device a and the routing device B may also be specified by user setting.
The first packet at least includes a requested node multicast address corresponding to the standby device, a network address and a link layer address of the main device, a packet type, and a link layer address query corresponding to the standby device, in addition to the relevant information for establishing the OSPF neighbor relationship between the main device (routing device a) and the standby device (routing device B). Specifically, for example: the network address of the master device refers to the IPv6 address of the routing device a; the link layer address of the master device refers to a link layer address of a routing device a, the link layer address is automatically configured by a system, that is, after the routing device starts an IPv6 protocol, the routing device automatically configures one link layer address for each interface of the routing device; the requested node multicast address corresponding to the standby device refers to the requested IPv6 node, that is, the multicast address corresponding to the routing device B, and the IPv6 multicast packet with the multicast address as the destination address is sent to the routing device B. Please note that the multicast and multicast are the same concept, only because there are different forms of expression for translation and english; the message type is used to define the first message as a request message, for example: the message type can be set to 135; the standby device is used for inquiring the link layer address, and is used for indicating the routing device B to be inquired by the routing device A to inquire the link layer address.
And 104, acquiring a second message, and acquiring a network address and a link layer address of the standby device based on the second message, wherein the second message is a response of the standby device to the first message.
Specifically, as an example, continuing the process of the above step example, after receiving the first packet of the routing device a, the routing device B sends a response to the routing device a, where the response is the second packet, and a specific format of the second packet is similar to a format of the first packet, except that the specific information that the standby device (routing device B) and the main device (routing device a) establish the OSPF neighbor relationship includes at least a network address and a link layer address of the standby device, such as: the message type of the second message may be set to 136, which is used to distinguish from the first message, and the second message further includes an IPv6 network address and a link layer address of the routing device B, for example: and the routing equipment A acquires the second message and acquires the network address and the link layer address of the routing equipment B based on the second message.
Step 106, based on the network address and the link layer address of the standby device, creating a directional OSPF neighbor table, wherein the directional OSPF neighbor table is used in an OSPF protocol interaction phase after the master device and the standby device reach the two-way state.
Specifically, continuing the example with the process illustrated in the above steps, routing device a creates a directed OSPF neighbor table based on IPv6 network address and link layer address of routing device B, such as: the OSPF neighbor table described above, please refer to the example in table 1:
Figure GDA0003156139570000091
TABLE 1
As shown in table 1, IPv6_ B is an IPv6 network address of device B, LINK _ B is a LINK layer address of device B, and interface1 is an interface on routing device a for performing OSPF protocol interaction with routing device B. The backup device may similarly create a directed OSPF neighbor table from the backup device to the primary device based on the above process, see the example in table 2:
Figure GDA0003156139570000101
TABLE 2
As shown in table 2, IPv6_ a is an IPv6 network address of device a, LINK _ a is a LINK layer address of device a, and interface2 is an interface on routing device B for performing OSPF protocol interaction with routing device a.
Based on the above process, after routing devices A, B all create the directed OSPF neighbor table, it is identified that routing device a and routing device B are in the two-way state of the OSPF protocol, which is the stable state before the next stage of OSPF protocol interaction. By sending a HELLO packet, that is, a first packet, in a multicast manner and carrying an NDP interaction packet on the first packet, it is possible to implement directional establishment of a neighbor relationship of the routing device A, B in a broadcast network included in the routing device A, B, C, so that it is not necessary to establish an OSPF neighbor relationship between the routing devices A, C and between the routing devices B, C, it is not necessary to start an NDP protocol by the routing device A, B, C, power consumption of the routing device is reduced, performance of the routing device is greatly improved, and interference with the routing device which does not need to establish the OSPF neighbor relationship is avoided.
In an OSPF protocol interaction phase after the master device and the standby device reach the two-way state, the master device, that is, the routing device a with a larger RouterID, serves as a master initiator to determine a DBD packet sequence number in a subsequent OSPF protocol phase, and initiate the subsequent OSPF protocol phase.
Optionally, in an illustrated embodiment, after the step, if the link layer address of the standby device is changed, the primary device performs a process of updating the directional OSPF neighbor table once, as illustrated in fig. 2, and executes the following steps:
step 202, if a third message of the standby device is received, acquiring a link layer address of the third message, where the third message is a notification message of a change of the link layer address of the standby device itself.
Specifically, as an example, continuing with the process of the above step example, if the routing device a receives a third message of the routing device B, where the third message is a notification message of a change of the LINK layer address of the standby device itself, for example, the LINK layer address of the routing device B is changed from LINK _ B to LINK _ B1 as shown in fig. 1, the routing device B sends the third message, where the third message may be in agreement with the network address IPv6_ B and the changed LINK layer address LINK _ B1 of the routing device B.
Step 204, updating the link layer address of the standby device corresponding to the oriented OSPF neighbor table as the link layer address of the third packet.
Specifically, as an example, continuing with the process illustrated in the above step, the routing device a updates the directional OSPF neighbor table, corresponding to the routing device B, on the routing device a, and updates the LINK-layer address, corresponding to the network address IPv6_ B, from LINK _ B to LINK-layer address LINK _ B1 of the third packet, where, for the OSPF neighbor table, please refer to the example in table 3:
IPv6 address Link layer addresses OSPF interface
IPv6_B LINK_B1 interface1
TABLE 3
To this end, the process shown in fig. 1 is completed, and as can be seen from the process shown in fig. 1, the method is applied to a routing device supporting an OSPF protocol, where the routing device is located in a broadcast network, the broadcast network includes a plurality of routing devices, and the routing device may be configured as a main device or a standby device, where the main device is a network device with a relatively large route identifier value on one side in an OSPF neighbor relation to be established, and the standby device is a network device with a relatively small route identifier value on the other side in the OSPF neighbor relation to the main device, and when the routing device is the main device, a first packet is sent in the broadcast network based on multicast, where the first packet at least includes information related to the OSPF neighbor relation established between the main device and the standby device; acquiring a second message, and acquiring a network address and a link layer address of the standby equipment based on the second message, wherein the second message is a response of the standby equipment to the first message; and creating a directional OSPF neighbor table based on the network address and the link layer address of the standby equipment, wherein the directional OSPF neighbor table is used for an OSPF protocol interaction phase after the master equipment and the standby equipment reach the two-way state.
By applying the embodiment of the application, the message is expanded through self-defining the OSPFv3 in the broadcast network containing a plurality of routing devices supporting OSPFv3 and IPv6 protocols, NDP does not need to be started by the routing devices, and neighbor discovery can be realized, so that a directional OSPF neighbor table is established between the two routing devices, the power consumption of the routing devices is reduced, the performance of the routing devices is greatly improved, and meanwhile, the interference on the routing devices which do not need to establish OSPF neighbor relations is avoided.
Fig. 3 is a block diagram of an apparatus for establishing a directed OSPF neighbor relation according to an exemplary embodiment of the present application. Corresponding to the foregoing method embodiment, the present application further provides an embodiment of an apparatus for establishing a directed OSPF neighbor relationship, where the apparatus is applied to a routing device supporting an OSPF protocol, the routing device is located in a broadcast network, the broadcast network includes a plurality of routing devices, and the routing device may be configured as a primary device or a standby device, where the primary device is a network device to be established with a relatively large route identifier value on one side of the OSPF neighbor relationship, and the standby device is a network device corresponding to the primary device and having a relatively small route identifier value on the other side of the OSPF neighbor relationship, and when the routing device is the primary device, please refer to an apparatus 30 for establishing a directed OSPF neighbor relationship illustrated in fig. 3, where the apparatus includes:
a transceiving module 301, configured to send a first packet in the broadcast network based on multicast, where the first packet at least includes information related to an OSPF neighbor relationship established between the master device and the standby device;
the transceiver module 301 further obtains a second message, and obtains a network address and a link layer address of the standby device based on the second message, where the second message is a response of the standby device to the first message;
a creating module 302, configured to create a directed OSPF neighbor table based on a network address and a link layer address of the standby device, where the directed OSPF neighbor table is used in an OSPF protocol interaction phase after the master device and the standby device reach a two-way state.
In this embodiment, the routing device supports an IPv6 protocol, and the version of the OSPF protocol supported by the routing device is V3.
In this embodiment, the first packet at least further includes a requested node multicast address corresponding to the standby device, a network address and a link layer address of the main device, a packet type, and a link layer address query corresponding to the standby device.
In this embodiment, the method further includes:
the transceiver module 301 further obtains a link layer address of a third packet if the third packet of the standby device is received, where the third packet is a notification packet of a change of a link layer address of the standby device;
the creating module 302 further updates the link layer address of the standby device corresponding to the oriented OSPF neighbor table to the link layer address of the third packet.
For the device embodiments, since they substantially correspond to the method embodiments, reference may be made to the partial description of the method embodiments for relevant points. The above-described embodiments of the apparatus are merely illustrative, wherein the modules described as separate parts may or may not be physically separate, and the parts displayed as modules may or may not be physical modules, may be located in one place, or may be distributed on a plurality of network modules. Some or all of the modules can be selected according to actual needs to achieve the purpose of the scheme of the application. One of ordinary skill in the art can understand and implement it without inventive effort.
The systems, devices, modules or modules illustrated in the above embodiments may be implemented by a computer chip or an entity, or by an article of manufacture with certain functionality. 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.
The embodiment of the apparatus for establishing a directed OSPF neighbor relation according to the present application can be applied to the electronic device shown in fig. 4. The device embodiments may be implemented by software, or by hardware, or by a combination of hardware and software. Taking a software implementation as an example, as a logical device, the device is a machine executable instruction formed by reading a corresponding computer program instruction in a machine readable storage medium through a processor of the electronic device where the device is located and then running the computer program instruction. From a hardware aspect, as shown in fig. 4, a hardware structure diagram of an electronic device where a device for establishing a directed OSPF neighbor relation according to the present application is located is shown, except for the processor, the communication interface, the bus and the machine-readable storage medium shown in fig. 4, the electronic device where the device is located in the embodiment may further include other hardware according to an actual function of the electronic device, which is not described again.
Correspondingly, an embodiment of the present application further provides a hardware structure of an electronic device of the apparatus shown in fig. 3, please refer to fig. 4, and fig. 4 is a schematic diagram of the hardware structure of the electronic device provided in the embodiment of the present application. The apparatus comprises: a communication interface 401, a processor 402, a machine-readable storage medium 403, and a bus 404; the communication interface 401, the processor 402 and the machine-readable storage medium 403 are configured to communicate with each other via a bus 404. The communication interface 401 is used for performing network communication. The processor 402 may be a Central Processing Unit (CPU), and the processor 402 may execute machine-readable instructions stored in a machine-readable storage medium 403 to implement the methods described above.
The machine-readable storage medium 403 referred to herein may be any electronic, magnetic, optical, or other physical storage device that can contain or store information such as executable instructions, data, and the like. For example, the machine-readable storage medium may be: volatile memory, non-volatile memory, or similar storage media. In particular, the machine-readable storage medium 403 may be a RAM (random Access Memory), a flash Memory, a storage drive (e.g., a hard disk drive), a solid state disk, any type of storage disk (e.g., a compact disk, a DVD, etc.), or similar storage medium, or a combination thereof.
Up to this point, the description of the hardware configuration shown in fig. 4 is completed.
Further, the present application provides a machine-readable storage medium, such as machine-readable storage medium 403 in fig. 4, including machine-executable instructions, which can be executed by processor 402 in the data processing apparatus to implement the data processing method described above.
The implementation process of the functions and actions of each unit in the above device is specifically described in the implementation process of the corresponding step in the above method, and is not described herein again.
Other embodiments of the present application will be apparent to those skilled in the art from consideration of the specification and practice of the invention disclosed herein. This application is intended to cover any variations, uses, or adaptations of the invention following, in general, the principles of the application and including such departures from the present disclosure as come within known or customary practice within the art to which the invention pertains. It is intended that the specification and examples be considered as exemplary only, with a true scope and spirit of the application being indicated by the following claims.
It will be understood that the present application is not limited to the precise arrangements described above and shown in the drawings and that various modifications and changes may be made without departing from the scope thereof. The scope of the application is limited only by the appended claims.
The above description is only exemplary of the present application and should not be taken as limiting the present application, as any modification, equivalent replacement, or improvement made within the spirit and principle of the present application should be included in the scope of protection of the present application.

Claims (10)

1. A method for establishing a directional OSPF neighbor relation is characterized in that the method is applied to a broadcast network, a plurality of routing devices supporting an OSPF protocol and closing a neighbor discovery protocol NDP are packaged in the broadcast network, in any two routing devices to be established with the OSPF neighbor relation, a main device is a network device with a relatively large routing identification value, and a standby device is a network device with a relatively small routing identification value, the method comprises the following steps:
the method comprises the steps that a main device sends a first message in a broadcast network based on multicast, wherein the first message at least comprises relevant information of OSPF (open shortest path first) neighbor relation established between the main device and a standby device, and a network address and a link layer address of the main device, so that an NDP (network data protocol) interactive message is borne on the first message; the first message is a multicast message;
acquiring a second message, and acquiring a network address and a link layer address of the standby equipment based on the second message, wherein the second message is a response of the standby equipment to the first message;
and creating a directional OSPF neighbor table based on the network address and the link layer address of the standby equipment, wherein the directional OSPF neighbor table is used for an OSPF protocol interaction phase after the master equipment and the standby equipment reach the two-way state.
2. The method of claim 1 wherein the routing device supports IPv6 protocol and the routing device supports OSPF protocol version V3.
3. The method according to claim 2, wherein the first packet further includes at least a requested node multicast address corresponding to the standby device, a packet type, and a link layer address query corresponding to the standby device.
4. The method of claim 3, further comprising:
if a third message of the standby equipment is received, acquiring a link layer address of the third message, wherein the third message is a notification message of the change of the link layer address of the standby equipment;
and updating the link layer address corresponding to the oriented OSPF neighbor table of the standby equipment as the link layer address of the third message.
5. An apparatus for establishing a directional OSPF neighbor relation is applied in a broadcast network, wherein the broadcast network includes a plurality of routing devices supporting an OSPF protocol and closing an NDP, and in any two routing devices to be established with the OSPF neighbor relation, a primary device is a network device with a relatively large routing identifier value, and a secondary device is a network device with a relatively small routing identifier value, the apparatus comprising:
a transceiver module, configured to send, by a primary device, a first packet in the broadcast network based on multicast, where the first packet at least includes information related to an OSPF neighbor relationship established between the primary device and a secondary device, and a network address and a link layer address of the primary device, so as to carry an NDP interaction packet on the first packet; the first message is a multicast message;
the transceiver module further acquires a second message, and acquires a network address and a link layer address of the standby device based on the second message, wherein the second message is a response of the standby device to the first message;
and the creating module is used for creating a directional OSPF neighbor table based on the network address and the link layer address of the standby equipment, wherein the directional OSPF neighbor table is used for the OSPF protocol interaction phase after the main equipment and the standby equipment reach the two-way state.
6. The apparatus of claim 5, wherein the routing device supports IPv6 protocol and the OSPF protocol version supported by the routing device is V3.
7. The apparatus according to claim 6, wherein the first packet further includes at least a requested node multicast address corresponding to the standby device, a packet type, and a link layer address query corresponding to the standby device.
8. The apparatus of claim 7, further comprising:
the transceiver module further acquires a link layer address of a third message if the third message of the standby device is received, wherein the third message is a notification message of the change of the link layer address of the standby device;
the creating module further updates the link layer address of the standby device corresponding to the oriented OSPF neighbor table to the link layer address of the third packet.
9. An electronic device is characterized by comprising a communication interface, a processor, a memory and a bus, wherein the communication interface, the processor and the memory are connected with each other through the bus;
the memory has stored therein machine-readable instructions, the processor executing the method of any of claims 1 to 4 by calling the machine-readable instructions.
10. A machine-readable storage medium having stored thereon machine-readable instructions which, when invoked and executed by a processor, carry out the method of any of claims 1 to 4.
CN201910130626.7A 2019-02-21 2019-02-21 Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation Active CN109873764B (en)

Priority Applications (1)

Application Number Priority Date Filing Date Title
CN201910130626.7A CN109873764B (en) 2019-02-21 2019-02-21 Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
CN201910130626.7A CN109873764B (en) 2019-02-21 2019-02-21 Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation

Publications (2)

Publication Number Publication Date
CN109873764A CN109873764A (en) 2019-06-11
CN109873764B true CN109873764B (en) 2021-12-24

Family

ID=66919072

Family Applications (1)

Application Number Title Priority Date Filing Date
CN201910130626.7A Active CN109873764B (en) 2019-02-21 2019-02-21 Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation

Country Status (1)

Country Link
CN (1) CN109873764B (en)

Families Citing this family (2)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN110233713B (en) * 2019-06-26 2022-08-09 广东九博科技股份有限公司 Multi-link communication method and system based on LLDP message
CN114465935A (en) * 2022-01-11 2022-05-10 深圳绿米联创科技有限公司 Method for generating network topological graph for network system and related equipment

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103004150A (en) * 2012-06-27 2013-03-27 华为技术有限公司 Shortest path first neighbor establishing method, node and system thereof
CN103825760A (en) * 2014-02-25 2014-05-28 杭州华三通信技术有限公司 Method and device for setting up neighborhood on basis of OSPF protocol
CN108737273A (en) * 2018-05-10 2018-11-02 新华三技术有限公司 A kind of message processing method and device

Family Cites Families (8)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100579076C (en) * 2007-08-24 2010-01-06 华为技术有限公司 Neighbourhood establishing method and router
CN101170483B (en) * 2007-11-13 2010-09-29 中兴通讯股份有限公司 A method for stacking route switching device
CN101771615B (en) * 2010-01-26 2012-01-25 华为技术有限公司 Neighborhood relationship building method, communication equipment and system thereof
CN102318287B (en) * 2011-06-30 2014-09-17 华为技术有限公司 Methods and device to establish router neighbors
US8913485B2 (en) * 2011-09-16 2014-12-16 Telefonaktiebolaget L M Ericsson (Publ) Open shortest path first (OSPF) nonstop routing (NSR) with link derivation
CN103441983A (en) * 2013-07-11 2013-12-11 盛科网络(苏州)有限公司 Information protection method and device based on link layer discovery protocol
CN105306362B (en) * 2015-09-18 2018-08-10 中国科学院计算技术研究所 The passive acquisition method and system of ospf network routing iinformation based on IPv6
US10116524B2 (en) * 2016-02-29 2018-10-30 Wesley Howard Jensen Machine-learning optimization for computing networks

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN103004150A (en) * 2012-06-27 2013-03-27 华为技术有限公司 Shortest path first neighbor establishing method, node and system thereof
CN103825760A (en) * 2014-02-25 2014-05-28 杭州华三通信技术有限公司 Method and device for setting up neighborhood on basis of OSPF protocol
CN108737273A (en) * 2018-05-10 2018-11-02 新华三技术有限公司 A kind of message processing method and device

Also Published As

Publication number Publication date
CN109873764A (en) 2019-06-11

Similar Documents

Publication Publication Date Title
EP2939399B1 (en) Methods and system for seamless network communications between ipv4 and ipv6 devices
CN108718278B (en) Message transmission method and device
CN108600074B (en) Method and device for forwarding multicast data message
KR20150129308A (en) Internet routing over a service-oriented architecture bus
US10574570B2 (en) Communication processing method and apparatus
US10447593B2 (en) Method and gateway for obtaining route according to requirement
JP2003283578A (en) Protocol converting method and apparatus
CN109728962B (en) Method and equipment for sending message
EP3179679B1 (en) Method and device for link state information announcement
JP2008172678A (en) Redundant switching method
JP5820106B2 (en) Communication apparatus and control method thereof
CN109873764B (en) Method, device and electronic equipment for establishing oriented OSPF (open shortest Path first) neighbor relation
CN114465776A (en) Flooding attack defense method and related device
CN112583880B (en) Server discovery method and related equipment
CN112867086A (en) Message processing method and device
CN113794618B (en) Redundant network communication method and device based on virtual network card and terminal equipment
US11343153B2 (en) BGP logical topology generation method, and device
CN110071872B (en) Service message forwarding method and device, and electronic device
CN105122776B (en) Address acquiring method and network virtualization edge device
CN112737946B (en) Route advertising method, device, storage medium and system for IPv6 network
JP6470640B2 (en) COMMUNICATION DEVICE, ITS CONTROL METHOD, COMPUTER PROGRAM
JP2017098738A (en) Control device, communication system, control method, and program
CN110740198B (en) Neighbor table item management method and device, electronic equipment and machine-readable storage medium
CN114095420B (en) Link aggregation method and device, electronic equipment and storage medium
WO2023169364A1 (en) Routing generation method and apparatus, and data message forwarding method and apparatus

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