Neighbor relation optimization method and device, equipment and medium
By detecting and optimizing the interface MTU and protocol packets of the target network device, the problems of inconsistent interface MTU configuration between network devices and out-synchronization of routing information are solved, and effective communication between network devices is achieved.
Patent Information
- Application Number
- CN202411774232.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Applications(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-04-25
- Estimated Expiration
- 2044-12-04
AI Technical Summary
In the prior art, inconsistent interface MTU configurations between network devices lead to failure to establish a neighbor relationship, or the routing information is out of synchronization, seriously affecting effective communication between network devices.
By detecting whether there are preset fields that identify neighbor relationship optimization methods in the target protocol message received by the target network device, if not, obtain the target interface MTU of the target network device, and parse the target protocol message to obtain the key fields. Based on this information, the target protocol message is optimized and then sent to other network devices to achieve optimization of neighbor relationships.
It solves the problem of inconsistent interface MTU configuration and out-synchronization of routing information, optimizes the establishment of neighbor relationships, and ensures effective communication between different network devices.
Smart Images

Figure CN119892708A_ABST
Abstract
Description
Technical Field
[0001] The present invention relates to the field of communication technology, and in particular to a neighbor relationship optimization method, device, equipment and medium. Background Art
[0002] Currently, different network devices (such as routers) achieve effective communication between devices by establishing neighbor relationships and synchronizing routing information. The establishment of neighbor relationships is adaptively adjusted according to different protocol types.
[0003] For example, Open Shortest Path First (OSPF) is a widely used dynamic routing protocol with many advantages such as no self-loop and support for regional division. The OSPF protocol needs to go through 6 state transitions in the process of establishing neighbor relationships to achieve the establishment of adjacent relationships. Specifically, after the two-way communication phase is established, the Link State Database (LSDB) synchronization phase will be entered; in this phase, both the local router and the neighbor router unicast a negotiation message with MS position 1 to declare themselves as the "MASTER", and the neighbor relationship will transition to the negotiation state. However, in actual networking, due to different default implementations of various manufacturers or due to negligence in complex network configuration, it is easy to cause the maximum transmission unit (MTU) of each interface on the link path to be different, which will cause the protocol to fail to successfully negotiate the synchronization state, the state machine is stuck in the middle state, and the neighbor relationship cannot be successfully established.
[0004] In addition, the Intermediate System to Intermediate System (ISIS) protocol is a commonly used link state routing protocol, which belongs to IGP (Interior Gateway Protocol) and is used inside an autonomous system. It performs neighbor negotiation through Hello messages and further establishes neighbor relationships. In practical applications, each intermediate system that establishes a neighbor relationship can send LSP (Link State PDU, Link State Protocol Data Unit, including link state information) to each other to achieve LSDB synchronization stored in each intermediate system. However, due to some special circumstances, the LSP message may be larger than the interface MTU of the intermediate system, causing the intermediate system to fail to receive the LSP message, further resulting in the failure of LSDB synchronization of each intermediate system.
[0005] In summary, inconsistent MTU configuration of network device interfaces can easily lead to failure in establishing neighbors between network devices, or after the neighbor relationship is established, the routing information is not synchronized because the LSP generated locally by the protocol is larger than the interface MTU, which seriously affects the establishment of neighbor relationships. As a result, the optimal path cannot be calculated, making it difficult to achieve effective communication between network devices. Summary of the invention
[0006] In view of this, the present invention provides a neighbor relationship optimization method, device, equipment and medium to solve the problems of inconsistent interface MTU configuration and asynchronous routing information in the existing neighbor relationship establishment process.
[0007] In a first aspect, the present invention provides a neighbor relationship optimization method, which is applied to a network device, and the method includes:
[0008] Receive a target protocol message, where the target protocol message is a corresponding message sent by other network devices that perform protocol interaction with the target network device;
[0009] Determine whether a preset field exists in the target protocol message, where the preset field is used to identify different optimization modes of neighbor relationship;
[0010] When the target protocol message does not have a preset field, the target interface MTU of the target network device is obtained, the target protocol message is parsed to obtain the corresponding key fields, and the target protocol message is optimized based on the target interface MTU and the key fields and then sent to the corresponding other network devices, so as to optimize the neighbor relationship between the target network device and other network devices.
[0011] The present invention detects whether there is a preset field for identifying different optimization modes of neighbor relations in a target protocol message received by a target network device, and when the preset field does not exist, obtains the target interface MTU of the target network device and parses the target protocol message to obtain the corresponding key field, optimizes the target protocol message based on the target interface MTU and the key field, and then sends it to the corresponding other network devices, so as to optimize the neighbor relations between the target network device and the other network devices, solve the problems of inconsistent interface MTU configuration and asynchronous routing information in the process of establishing neighbor relations, help optimize the establishment of neighbor relations, and further realize effective communication between different network devices.
[0012] In an optional implementation, the optimization method includes a neighbor establishment optimization method and an information synchronization optimization method; wherein the specific type of the optimization method is determined according to whether a neighbor relationship is established between the target network device and other network devices; if the target network device and other network devices do not have a neighbor relationship, the preset field is used to identify the neighbor establishment optimization method; if the target network device and other network devices have established a neighbor relationship, the preset field is used to identify the information synchronization optimization method.
[0013] The present invention identifies two optimization modes of neighbor relations based on preset fields, namely, a neighbor establishment optimization mode and an information synchronization optimization mode, which can optimize the neighbor relationship establishment process to a certain extent and help ensure the successful establishment of the neighbor relationship.
[0014] In an optional implementation, when the preset field is used to identify the neighbor establishment optimization mode, the key field is the MTU of the opposite interface; parsing the target protocol message to obtain the corresponding key field, and optimizing the target protocol message based on the target interface MTU and the key field and sending it to the corresponding other network device, so as to optimize the neighbor relationship between the target network device and the other network device, including:
[0015] Perform interface MTU analysis on the target protocol message to obtain the peer interface MTU;
[0016] Determine whether the target interface MTU is smaller than the peer interface MTU;
[0017] If the target interface MTU is not less than the peer interface MTU, the target interface MTU is updated based on the peer interface MTU, and the updated target interface MTU is saved to the preset storage location of the target network device and filled into the corresponding field position in the target protocol message; and the target protocol message is field-marked and sent to the corresponding other network devices to establish a neighbor relationship between the target network device and the other network devices.
[0018] The present invention determines the numerical size of the target interface MTU and the opposite interface MTU, and selects the MTU with a smaller numerical value for local storage and subsequent filling into the relevant fields of the protocol message. This can ensure that the message length does not exceed the maximum message length of the current interface during data transmission, helps to ensure that other network devices successfully receive the message, and further ensures the successful establishment of the neighbor relationship.
[0019] In an optional embodiment, the method further includes:
[0020] If the target interface MTU is smaller than the peer interface MTU, the target protocol message is sent to the corresponding other network device to establish a neighbor relationship between the target network device and the other network devices.
[0021] When the target interface MTU of the target network device is small, the present invention keeps using the target interface MTU for subsequent protocol message interaction, thereby accelerating the successful establishment of the neighbor relationship to a certain extent.
[0022] In an optional implementation, when the preset field is used to identify the information synchronization optimization mode, the key field is the target LSP configuration value of the target network device; parsing the target protocol message to obtain the corresponding key field, and optimizing the target protocol message based on the target interface MTU and the key field and sending it to the corresponding other network device, so as to optimize the neighbor relationship between the target network device and the other network devices, including:
[0023] Obtaining a target LSP configuration value from a preset storage location of a target network device based on a target protocol message;
[0024] Determine whether the target interface MTU is smaller than the target LSP configuration value;
[0025] If the target interface MTU is smaller than the target LSP configuration value, the target LSP configuration value is optimized based on the target interface MTU to obtain the LSP optimization value; the message length of the target protocol message is optimized based on the LSP optimization value, and the optimized target protocol message is sent to the corresponding other network devices to synchronize the link status information.
[0026] The present invention optimizes the message length of the target protocol message by judging the size relationship between the target interface MTU and the target LSP configuration value, and selecting a smaller value therefrom to achieve information synchronization. The present invention can synchronize the link information between network devices that have established neighbor relationships, further limit the maximum length of the LSP generated by the target network device, help ensure that the size of the locally generated LSP can be smoothly diffused, and thus achieve effective communication between different network devices.
[0027] In an optional embodiment, the method further includes:
[0028] If the target interface MTU is not less than the target LSP configuration value, the target protocol message is sent to the corresponding other network devices to synchronize the link status information of the target network device and other network devices.
[0029] When the target interface MTU of the target network device is small, the present invention keeps using the target interface MTU for subsequent protocol message interaction, thereby ensuring information synchronization between network devices that have established neighbor relationships to a certain extent.
[0030] In an optional embodiment, the method further includes:
[0031] When the target protocol message has a preset field, a neighbor relationship between the target network device and other network devices is established based on the target protocol message, or link status information of the target network device and other network devices is synchronized.
[0032] When a preset field exists in the target protocol message, the present invention can directly establish a neighbor relationship between the target network device and other network devices or synchronize link status information of different network devices according to the target protocol message, which can greatly ensure the successful establishment of the neighbor relationship or the synchronization of link information between network devices.
[0033] In a second aspect, the present invention provides a neighbor relationship optimization device, which is applied to a network device, and the device includes: an acquisition module, which is used to receive a target protocol message, where the target protocol message is a corresponding message sent by other network devices that perform protocol interaction with the target network device;
[0034] A judgment module, used for judging whether a target protocol message has a preset field, where the preset field is used for identifying different optimization modes of neighbor relations;
[0035] The optimization module is used to obtain the target interface MTU of the target network device when the target protocol message does not have a preset field, parse the target protocol message to obtain the corresponding key field, and optimize the target protocol message based on the target interface MTU and the key field and send it to the corresponding other network devices, so as to optimize the neighbor relationship between the target network device and other network devices.
[0036] The neighbor relationship optimization device of the present invention obtains the target interface MTU of the device and parses the target protocol message to obtain the corresponding key field when the target network device receives a target protocol message in which no preset field exists. The message is optimized based on the target interface MTU and the key field and then sent to other network devices to achieve neighbor relationship optimization between different network devices. This can effectively avoid the problems of inconsistent interface MTU configuration and asynchronous routing information in the process of establishing neighbor relationships, help optimize the establishment of neighbor relationships, and achieve effective communication between different network devices.
[0037] In a third aspect, the present invention provides a neighbor relationship optimization device, comprising: a memory and a processor, the memory and the processor are communicatively connected to each other, computer instructions are stored in the memory, and the processor executes a neighbor relationship optimization method of the first aspect or any corresponding embodiment thereof by executing the computer instructions.
[0038] In a fourth aspect, the present invention provides a computer-readable storage medium having computer instructions stored thereon, the computer instructions being used to enable a computer to execute a neighbor relationship optimization method according to the first aspect or any corresponding embodiment thereof. BRIEF DESCRIPTION OF THE DRAWINGS
[0039] In order to more clearly illustrate the specific implementation methods of the present invention or the technical solutions in the prior art, the drawings required for use in the specific implementation methods or the description of the prior art will be briefly introduced below. Obviously, the drawings described below are some implementation methods of the present invention. For ordinary technicians in this field, other drawings can be obtained based on these drawings without paying creative work.
[0040] Figure 1 is a schematic diagram of a process of optimizing a neighbor relationship according to an embodiment of the present invention;
[0041] Figure 2 is a flow chart of another neighbor relationship optimization method according to an embodiment of the present invention;
[0042] Figure 3 It is a schematic diagram of neighbor relationship optimization;
[0043] Figure 4 is another neighbor relationship optimization diagram;
[0044] Figure 5 It is a schematic diagram of establishing neighbor relations;
[0045] Figure 6 It is a schematic diagram of routing information synchronization;
[0046] Figure 7 It is a structural diagram of the neighbor relationship optimization system;
[0047] Figure 8 is a structural block diagram of a neighbor relationship optimization device according to an embodiment of the present invention;
[0048] Fig. 9 It is a schematic diagram of the hardware structure of a neighbor relationship optimization device according to an embodiment of the present invention. DETAILED DESCRIPTION
[0049] In order to make the purpose, technical solution and advantages of the embodiments of the present invention clearer, the technical solution in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments are part of the embodiments of the present invention, not all of the embodiments. Based on the embodiments of the present invention, all other embodiments obtained by those skilled in the art without creative work are within the scope of protection of the present invention.
[0050] An embodiment of the present invention provides an embodiment of a neighbor relationship optimization method. It should be noted that the steps shown in the flowchart of the accompanying drawings can be executed in a computer device such as a set of computer executable instructions, and although a logical order is shown in the flowchart, in some cases, the steps shown or described can be executed in an order different from that shown here.
[0051] In this embodiment, a method for optimizing neighbor relations is provided. Figure 1 FIG. 1 is a flow chart of a neighbor relationship optimization method according to an embodiment of the present invention. Figure 1 As shown, the process includes the following steps:
[0052] Step S101, receiving a target protocol message, where the target protocol message is a corresponding message sent by other network devices that perform protocol interaction with a target network device.
[0053] It should be noted that the specific type of the target protocol message in this embodiment is not limited here, and is adaptively adjusted according to actual needs, such as the Hello message and the negotiation message DD (Database Description) of the OSPF protocol, which are only used as examples. It should be explained that the Hello message is used to discover and maintain neighbor relationships and establish and maintain adjacency relationships. The Hello message is sent periodically, including the value of the timer, DR (Designated Router, responsible for establishing OSPF adjacency with other routers in the network, and responsible for forwarding the link state advertisement (Link-State Advertisement, LSA) and BDR (Backup Designated Router, backup designated router, used to monitor the status of DR and take over its role when DR fails) information and known neighbor information. The DD message is used to describe the summary information of each LSA in the local LSDB (i.e., link state database) to synchronize the databases of two routers; the DD message includes the header information of the LSA in the LSDB, which is used to elect the master and slave devices.
[0054] Step S102: determine whether the target protocol message has a preset field, where the preset field is used to identify different optimization methods for neighbor relations.
[0055] In this embodiment, the specific content of the preset field is not limited here, and is adaptively set according to actual needs. For example, the preset field is a setting field for identifying the optimization process of establishing a neighbor relationship.
[0056] Step S103, when the target protocol message does not have a preset field, obtain the target interface MTU of the target network device, parse the target protocol message to obtain the corresponding key field, and optimize the target protocol message based on the target interface MTU and the key field and send it to the corresponding other network devices to optimize the neighbor relationship between the target network device and other network devices.
[0057] In the embodiment of the present invention, when a target network device receives a target protocol message in which no preset field exists, the target interface MTU of the target network device is obtained and the target protocol message is parsed to obtain the corresponding key field, and the target protocol message is optimized based on the target interface MTU and the key field and then sent to the corresponding other network devices. This can solve the problems of inconsistent interface MTU configuration and asynchronous routing information in the process of establishing neighbor relationships, greatly optimize the establishment of neighbor relationships or the synchronization of link information between different network devices, and help to ensure effective communication between different network devices.
[0058] In this embodiment, a method for optimizing neighbor relations is provided. Figure 2 FIG. 1 is a flow chart of another neighbor relationship optimization method according to an embodiment of the present invention. Figure 2 As shown, the process includes the following steps:
[0059] Step S201: Receive a target protocol message, which is a corresponding message sent by other network devices that interact with the target network device. Figure 1 Step S101 of the illustrated embodiment will not be described in detail here.
[0060] Step S202: determine whether the target protocol message has a preset field, where the preset field is used to identify different optimization methods for neighbor relations.
[0061] It should be noted that the preset fields in this embodiment are used to identify different optimization methods for neighbor relations, and the optimization methods include neighbor establishment optimization methods and information synchronization optimization methods; wherein the specific type of optimization method is determined according to whether the target network device and other network devices have established neighbor relations; if the target network device and other network devices have not established neighbor relations, the preset field is used to identify the neighbor establishment optimization method; if the target network device and other network devices have established neighbor relations, the preset field is used to identify the information synchronization optimization method. Specifically, two optimization methods for neighbor relations are identified based on the preset fields, namely, the neighbor establishment optimization method and the information synchronization optimization method, which can optimize the process of establishing neighbor relations to a certain extent and help ensure the successful establishment of neighbor relations.
[0062] Step S203, when the target protocol message does not have a preset field, obtain the target interface MTU of the target network device, parse the target protocol message to obtain the corresponding key field, and optimize the target protocol message based on the target interface MTU and the key field and send it to the corresponding other network devices to optimize the neighbor relationship between the target network device and other network devices.
[0063] It should be noted that, in this embodiment, the preset field identifies two neighbor relationship optimization methods, namely, the neighbor establishment optimization method and the information synchronization optimization method, so the optimization processing flow of different neighbor relationships is set accordingly. In this embodiment, when the preset field is used to identify the neighbor establishment optimization method, the key field is the opposite end interface MTU. Specifically, in the above step S203, the target protocol message is parsed to obtain the corresponding key field, and the target protocol message is optimized based on the target interface MTU and the key field and then sent to the corresponding other network devices, so as to optimize the neighbor relationship between the target network device and other network devices, including:
[0064] Step A1, performing interface MTU analysis on the target protocol message to obtain the peer interface MTU.
[0065] Step A2, determine whether the target interface MTU is smaller than the peer interface MTU.
[0066] Step A3, if the target interface MTU is not less than the peer interface MTU, the target interface MTU is updated based on the peer interface MTU, and the updated target interface MTU is saved to the preset storage location of the target network device and filled into the corresponding field position in the target protocol message; and the target protocol message is field-marked and sent to the corresponding other network devices to establish a neighbor relationship between the target network device and the other network devices.
[0067] In this embodiment, the specific content of the preset storage location is not limited here, and is adaptively adjusted according to actual needs, such as the preset storage location is a local storage unit of the network device.
[0068] In the embodiment of the present invention, by judging the numerical size of the target interface MTU and the opposite interface MTU, and selecting the MTU with a smaller numerical value for local storage and subsequent filling into the relevant fields of the protocol message, it can ensure that the message length does not exceed the maximum message length of the current interface during data transmission, which helps to ensure that other network devices successfully receive the message, thereby ensuring the successful establishment of the neighbor relationship.
[0069] Step A4: If the target interface MTU is smaller than the peer interface MTU, the target protocol message is sent to the corresponding other network device to establish a neighbor relationship between the target network device and the other network device.
[0070] In the embodiment of the present invention, when the target interface MTU of the target network device is small, the target interface MTU is kept used for subsequent protocol message interaction, which accelerates the successful establishment of the neighbor relationship to a certain extent.
[0071] In this embodiment, when the preset field is used to identify the information synchronization optimization mode, the key field is the target LSP configuration value of the target network device. Specifically, in the above step S203, the target protocol message is parsed to obtain the corresponding key field, and the target protocol message is optimized based on the target interface MTU and the key field and then sent to the corresponding other network devices to optimize the neighbor relationship between the target network device and the other network devices, including:
[0072] Step B1, obtaining a target LSP configuration value from a preset storage location of a target network device based on a target protocol message.
[0073] It should be noted that LSP messages are used to exchange link status information. By configuring the basic attributes of LSP, you can control the size and maximum validity period of LSP messages. You can also speed up the diffusion of LSP messages by enabling LSP rapid diffusion and reducing the minimum time interval for interfaces to send LSP messages and the LSP refresh cycle, thereby making the network converge quickly.
[0074] In actual applications, the size of the LSP generated by the IS-IS protocol is configurable, but when the configured LSP size is larger than the value of the interface MTU of the network device to be sent, the peer device may not be able to receive the message, resulting in incorrect routing calculation. In this embodiment, the target LSP configuration value is the configuration value of the protocol to generate and receive LSP, and the current network device configures it and saves it in the corresponding local storage unit. It should be noted that if the LSP is not configured, the default value of the corresponding protocol is taken.
[0075] Step B2, determine whether the target interface MTU is smaller than the target LSP configuration value.
[0076] Step B3, if the target interface MTU is smaller than the target LSP configuration value, the target LSP configuration value is optimized based on the target interface MTU to obtain the LSP optimization value; the message length of the target protocol message is optimized based on the LSP optimization value, and the optimized target protocol message is sent to the corresponding other network devices to synchronize the link status information.
[0077] In the embodiment of the present invention, by judging the size relationship between the target interface MTU and the target LSP configuration value, and selecting a smaller value therefrom to optimize the message length of the target protocol message to achieve information synchronization, the link information between network devices that have established neighbor relationships can be synchronized, and the maximum length of the LSP generated by the target network device is further limited, which helps to ensure that the size of the locally generated LSP can be smoothly spread out, thereby achieving effective communication between different network devices.
[0078] Step B4: If the target interface MTU is not less than the target LSP configuration value, the target protocol message is sent to the corresponding other network devices to synchronize the link status information of the target network device and other network devices.
[0079] When the target interface MTU of the target network device is small, the embodiment of the present invention keeps using the target interface MTU for subsequent protocol message interaction, thereby ensuring information synchronization between network devices that have established neighbor relationships to a certain extent.
[0080] Step S204: when the target protocol message has a preset field, a neighbor relationship between the target network device and other network devices is established based on the target protocol message, or link status information of the target network device and other network devices is synchronized.
[0081] The neighbor relationship optimization method of the embodiment of the present invention can solve the problems of inconsistent interface MTU configuration and asynchronous routing information in the process of establishing neighbor relationships, greatly optimizes the establishment of neighbor relationships or the synchronization of link information between different network devices, and helps to ensure effective communication between different network devices.
[0082] In a specific embodiment, the network device is a router. Due to many problems often encountered in actual networking, such as failure to establish neighbor relationships due to inconsistent interface MTUs, or asynchronization of LSPs carrying routing information between neighbor routers, which leads to the inability to calculate the optimal routing path, the configuration of network devices in telecommunication-grade data communication networks is more complicated, and once a failure occurs, it is difficult to troubleshoot the problem. Based on this, this embodiment proposes an optimization solution for neighbor adjustment establishment and routing information synchronization. Figure 3 is a schematic diagram of neighbor relationship optimization. Figure 3It can be seen that the specific optimization process of the scheme is: receiving the protocol message, searching for the identification field; judging whether it is necessary to enter the storage unit according to the identification field; reading and storing the key field value, and comparing it with the received / sent local port MTU; updating the storage unit variable with the comparison result, filling the protocol message with the value and marking it with the identification; sending the protocol message processed above to the peer network device for subsequent neighbor state transition / routing information synchronization. Specifically, for the scenario where the neighbor relationship cannot be established due to inconsistent interface MTU, the received protocol message is read and stored with the relevant fields, compared with the receiving port MTU and saved in the storage unit, and the corresponding fields of the protocol message are filled with the processed MTU value and marked with an identifiable mark before sending to the peer device. For another scenario where the routing information is not synchronized, the size of the LSP generated is recorded, and after comparing it with the value of the MTU of the interface to be sent, the maximum length of the generated LSP is limited according to the processed value, which can ensure smooth interaction of the protocol message.
[0083] In this embodiment, see Figure 4 , by identifying whether the received protocol message has been processed (i.e., whether the set identification field exists), if it is an original protocol message (i.e., the identification field does not exist or the identification field is not set), then read the key fields such as interface MTU (i.e., interface MTU or LSP generation configuration value) and store them in the variable unit for processing, fill the corresponding fields of the protocol message with the compared value and add an identifiable mark before sending it to the peer device; if the identification field exists, i.e., the identification field is set, then the subsequent neighbor negotiation / LSP PDU interaction synchronization phase is carried out according to the original protocol implementation. Through the above neighbor relationship optimization process, it is possible to avoid the failure of neighbor relationship establishment in a complex telecommunication-level network due to differences in the default implementation of multi-vendor equipment, or due to inconsistency in the MTU configuration value on the link due to negligence, or the situation where the calculated path is not optimal or a routing black hole due to the asynchronous link database of the network device, which helps to reduce the adverse effects caused by time-consuming personnel investigation and network oscillation.
[0084] In a specific embodiment, an optimization scheme for establishing neighbor relationships is proposed for the OSPF protocol. Figure 5 , the specific optimization process includes:
[0085] 1. The local router and the peer router send and receive Hello messages according to the current protocol implementation, and the handshake is successful. Specifically, the local router (RT1 in the figure) receives the original negotiation message sent by the peer (RT2 in the figure), reads and stores the interface MTU field parameter value of the message. It should be noted that RT2 cannot receive the negotiation message DD from RT1 (that is, because the interface MTU value of RT2 is 2000, which is greater than the interface MTU value of RT1 is 1500), and maintains the current state.
[0086] 2. Obtain the MTU of the interface on which the local end receives the negotiation message, determine the size of the interface MTU value between the value and the stored interface MTU value of the peer router, and obtain the smaller value for the neighbor negotiation stage.
[0087] In actual applications, the neighbor negotiation phase needs to determine the master-slave relationship between the two routers during the DD negotiation message sending process, that is, the master defines a sequence number seq, and increases seq by one each time a new DD message is sent; the slave uses the seq in the last DD message received from the master each time it sends a DD message. In fact, the sequence number mechanism is an implicit confirmation method. If each message is retransmitted after a timeout, the reliability of the transmission can be guaranteed.
[0088] 3. The compared value is stored in the storage unit again, and the value of the field is used to fill the relevant fields of the new negotiation message. The message is marked and sent to the peer network device.
[0089] 4. After receiving the negotiation message, the other end searches the identification field to see if it is a negotiation message that has been refilled after comparison. If so, the M / S position is selected according to the size of the Routerid according to the original protocol. If not, the interface MTU value is extracted and stored in the same way, and compared with the MTU value of the port receiving the protocol message to determine the appropriate value to update the storage unit variable value.
[0090] In this embodiment, see Figure 5, the process includes: RT1 first sends a DD message, claiming that it is the master (MS=1), and specifies the sequence number seq as x. The field I=1 in the message indicates that this is the first DD message. The message does not contain the summary of LSA, but is only for negotiating the master-slave relationship; M=1 indicates that this is not the last message. After receiving the DD message from RT1, RT2 changes the neighbor state machine of RT1 to Exstart and responds with a DD message (the message also does not contain the summary information of LSA). Since RT2's Routerid is larger, RT2 considers itself the master in the message and redefines the sequence number to y+1. After receiving the message, RT1 agrees that RT2 is the master and changes the neighbor state machine of RT2 to exchange. RT1 uses RT2's sequence number y to send a new DD message, which begins to formally transmit the summary of LSA. In the message, RT1 sets MS=0 to indicate that it is a slave. The above process continues. RT1 confirms that it has received RT2's message by repeating RT2's sequence number (that is, RT1 changes the sequence number of the message to y+1). RT2 confirms that it has received RT1's message by adding 1 to the sequence number. When RT2 sends the last DD message, it sets M=0 in the message, indicating that this is the last DD message. At this time, after RT1 receives the last DD message, it finds that there are many LSAs in RT2's database that it does not have, and changes the neighbor state machine to the Loading state. At this time, RT2 also receives RT1's last DD message, but RT2 already has RT1's LSA, so there is no need to request it again, so it directly changes RT1's neighbor state machine to the Full state. RT1 sends an LS Request message to request the required LSA from RT2. RT2 responds to RT1's request with an LS Update message. After receiving it, RT1 needs to send an LSAck message to confirm. The above process continues until the LSA in RT1 is completely synchronized with the LSA in RT2. At this time, RT1 changes RT2's neighbor state machine to the Full state. It should be noted that the above process is the process of two routers not discovering each other's existence and establishing an adjacency relationship; or it can be understood as the process of adding a new router to the network. When the state machines between the two routers have reached the Full state, if there are routing changes in the network at this time, there is no need to repeat all the above steps. Only one party sends an LS Update message to notify the content that needs to be updated, and the other party sends an LSAck message in response. The neighbor state machines of both parties will no longer change during this process.
[0091] In a specific embodiment, after the neighbor relationship of the IS-IS routing protocol is established, the link information between the network devices that have established the neighbor relationship will be synchronized through the LSP message and then the shortest path priority calculation will be performed. The size of the generated LSP of the IS-IS protocol is configurable. If the value is larger than the interface MTU value of the network device to be sent, the peer device cannot receive the message, resulting in incorrect routing calculation. Based on this, an optimization scheme for routing information synchronization is proposed, see Figure 6 , the specific optimization process includes:
[0092] 1. The local router and the peer router send and receive Hello messages according to the current protocol implementation, and the handshake is successful (as shown in the handshake message between RT1 and RT2: isis hello IIH).
[0093] 2. Obtain the configuration value of the protocol to generate LSP (if no configuration is performed, use the default value of the protocol) and save it in the storage unit.
[0094] 3. Determine the MTU value of the interface that has established the IS-IS protocol neighbor relationship and the stored LSP message value that can be generated and received by the local end, determine the appropriate value (ie, the minimum value) and refill the corresponding variable of the storage unit.
[0095] 4. Read the corresponding variable of the storage unit to smoothly diffuse the locally generated LSP.
[0096] In a specific embodiment, Figure 7 It is a schematic diagram of the structure of the neighbor relationship optimization system. Figure 7 It can be seen that the system includes:
[0097] 1. Storage module: The local router receives the original negotiation message sent by the other end, reads and stores the interface MTU field parameter value of the message; the compared value is stored again in the storage unit, the value of the field is used to fill the relevant fields of the new negotiation message, the message is marked and sent to the other end network device.
[0098] 2. Processing module: Determine the MTU of the interface receiving the negotiation message and the interface MTU value of the stored peer router, and determine the appropriate value.
[0099] 3. Marking module: The compared value is stored in the storage unit again, the value of the field is used to fill the relevant fields of the new negotiation message, the message is marked and sent to the peer router.
[0100] 4. Sending / receiving module: After receiving the negotiation message, the opposite router searches the identification field to see whether it is a negotiation message that has been compared and refilled; if so, the M / S status is elected according to the size of the Routerid in accordance with the original protocol; if not, the interface MTU value is extracted and stored according to the neighbor relationship optimization method of the present embodiment, and the interface MTU value is compared with the MTU value of the port receiving the protocol message, so as to determine a suitable value to update the corresponding variable value of the storage unit.
[0101] In summary, the neighbor relationship optimization system of this embodiment can be applied to related scenarios of different routing protocols, such as telecommunications-class access networks, to solve the problem of establishing neighbor relationships and the problem of asynchronization of routing information caused by inconsistent interface MTU values on the path in multi-vendor equipment docking scenarios, so that in the case of inconsistent interface MTU values, smooth interaction can be achieved with routers carrying the MTU protocol, which can effectively reduce the troubleshooting pressure of operation and maintenance personnel, reduce adverse situations such as abnormal neighbor status and asynchronization of routing, routing calculation errors or black holes caused by MTU value mismatch, and enable each network device to smoothly interact with related protocol messages, greatly optimize the establishment of neighbor relationships or synchronization of link information between different network devices, and ensure effective communication between different network devices.
[0102] In the present embodiment, a neighbor relationship optimization device is also provided, which is used to implement the above-mentioned embodiments and preferred implementation modes, and the descriptions that have been made will not be repeated. As used below, the term "module" refers to a combination of software and / or hardware that can implement a predetermined function. Although the device described in the following embodiments is preferably implemented in software, the implementation of hardware, or a combination of software and hardware, is also possible and conceived.
[0103] The present invention provides a neighbor relationship optimization device, which is applied to network equipment, such as Figure 8 As shown, the device comprises:
[0104] The acquisition module 801 is used to receive a target protocol message, where the target protocol message is a corresponding message sent by other network devices that perform protocol interaction with the target network device.
[0105] The judgment module 802 is used to judge whether the target protocol message has a preset field, and the preset field is used to identify different optimization methods of the neighbor relationship.
[0106] The optimization module 803 is used to obtain the target interface MTU of the target network device when the preset field does not exist in the target protocol message, parse the target protocol message to obtain the corresponding key field, and optimize the target protocol message based on the target interface MTU and the key field and send it to the corresponding other network devices, so as to optimize the neighbor relationship between the target network device and other network devices.
[0107] In some optional embodiments, the judgment module 802 includes: a judgment sub-module, which is used for optimization methods including a neighbor establishment optimization method and an information synchronization optimization method; wherein the specific type of optimization method is determined according to whether a neighbor relationship is established between the target network device and the other network devices; if the target network device and the other network devices do not have a neighbor relationship, the preset field is used to identify the neighbor establishment optimization method; if the target network device and the other network devices have established a neighbor relationship, the preset field is used to identify the information synchronization optimization method.
[0108] In some optional embodiments, the optimization module 803 includes: a first optimization submodule, a second optimization submodule, a third optimization submodule and a fourth optimization submodule; wherein the first optimization submodule is used to perform interface MTU analysis on the target protocol message to obtain the opposite interface MTU; the second optimization module is used to determine whether the target interface MTU is smaller than the opposite interface MTU; the third optimization submodule is used to update the target interface MTU based on the opposite interface MTU if the target interface MTU is not smaller than the opposite interface MTU, save the updated target interface MTU to the preset storage location of the target network device and fill it into the corresponding field position in the target protocol message; and send the target protocol message to the corresponding other network device after field marking to establish a neighbor relationship between the target network device and the other network devices; the fourth optimization module is used to send the target protocol message to the corresponding other network device if the target interface MTU is smaller than the opposite interface MTU to establish a neighbor relationship between the target network device and the other network devices.
[0109] In some optional embodiments, the optimization module 803 also includes: a first synchronization optimization submodule, a second synchronization optimization submodule, a third synchronization optimization submodule and a fourth synchronization optimization submodule; wherein the first synchronization optimization submodule is used to obtain the target LSP configuration value from the preset storage location of the target network device based on the target protocol message; the second synchronization optimization module is used to determine whether the target interface MTU is less than the target LSP configuration value; the third synchronization optimization submodule is used to optimize the target LSP configuration value based on the target interface MTU to obtain the LSP optimization value if the target interface MTU is less than the target LSP configuration value; optimize the message length of the target protocol message based on the LSP optimization value, and send the optimized target protocol message to the corresponding other network devices to synchronize the link status information; the fourth synchronization optimization module is used to send the target protocol message to the corresponding other network devices if the target interface MTU is not less than the target LSP configuration value to synchronize the link status information between the target network device and the other network devices.
[0110] In some optional embodiments, the device also includes: a using module, which is used to establish a neighbor relationship between the target network device and other network devices or synchronize link status information between the target network device and other network devices based on the target protocol message when there is a preset field in the target protocol message.
[0111] The further functional description of each of the above modules is the same as that of the above corresponding embodiments and will not be repeated here.
[0112] The present invention is based on a neighbor relationship optimization device, can effectively avoid the problems of inconsistent interface MTU configuration and asynchronous routing information in the process of establishing neighbor relationships, helps to optimize the establishment of neighbor relationships, and realizes effective communication between different network devices.
[0113] The present invention also provides a neighbor relationship optimization device, see Fig. 9 , Fig. 9 is a schematic diagram of the structure of the controller provided in an optional embodiment of the present invention, such as Fig. 9 As shown, the controller includes: one or more processors 10, a memory 20, and interfaces for connecting various components, including high-speed interfaces and low-speed interfaces. The various components are connected to each other using different buses for communication, and can be installed on a common mainboard or installed in other ways as needed. The processor can process instructions executed in the neighbor relationship optimization device, including instructions stored in or on the memory to display graphical information of the GUI on an external input / output device (such as a display device coupled to the interface). In some optional embodiments, if necessary, multiple processors and / or multiple buses can be used together with multiple memories and multiple memories. Similarly, multiple neighbor relationship optimization devices can be connected, and each device provides some necessary operations (for example, as a server array, a group of blade servers, or a multi-processor system). Fig. 9 A processor 10 is taken as an example.
[0114] The processor 10 may be a central processing unit, a network processor or a combination thereof. The processor 10 may further include a hardware chip. The hardware chip may be a dedicated integrated circuit, a programmable logic device or a combination thereof. The programmable logic device may be a complex programmable logic device, a field programmable gate array, a general purpose array logic or any combination thereof.
[0115] The memory 20 stores instructions executable by at least one processor 10, so that at least one processor 10 executes the method shown in the above embodiment.
[0116] The memory 20 may include a program storage area and a data storage area, wherein the program storage area may store an operating system, an application required by at least one function; the data storage area may store data created according to the use of the neighbor relationship optimization device, etc. In addition, the memory 20 may include a high-speed random access memory, and may also include a non-transient memory, such as at least one disk storage device, a flash memory device, or other non-transient solid-state storage device. In some optional embodiments, the memory 20 may optionally include a memory remotely arranged relative to the processor 10, and these remote memories may be connected to the neighbor relationship optimization device via a network. Examples of the above-mentioned network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and combinations thereof.
[0117] The memory 20 may include a volatile memory, such as a random access memory; the memory may also include a non-volatile memory, such as a flash memory, a hard disk or a solid state drive; the memory 20 may also include a combination of the above types of memory.
[0118] The controller also includes a communication interface 30 for the main control chip to communicate with other devices or a communication network.
[0119] A computer-readable storage medium is also provided in an embodiment of the present invention. The method according to the embodiment of the present invention can be implemented in hardware, firmware, or can be implemented as a computer code that can be recorded in a storage medium, or can be implemented as a computer code that is originally stored in a remote storage medium or a non-temporary machine-readable storage medium and will be stored in a local storage medium and downloaded through a network, so that the method described herein can be stored in such software processing on a storage medium using a general-purpose computer, a dedicated processor, or programmable or dedicated hardware. Among them, the storage medium can be a magnetic disk, an optical disk, a read-only storage memory, a random access memory, a flash memory, a hard disk or a solid-state hard disk, etc.; further, the storage medium can also include a combination of the above types of memories. It can be understood that a computer, a processor, a microprocessor main control chip or programmable hardware includes a storage component that can store or receive software or computer code. When the software or computer code is accessed and executed by a computer, a processor or hardware, the method shown in the above embodiment is implemented.
[0120] Although the embodiments of the present invention have been described in conjunction with the accompanying drawings, those skilled in the art may make various modifications and variations without departing from the spirit and scope of the present invention, and such modifications and variations are all within the scope defined by the appended claims.
Claims
1. A neighbor relationship optimization method, applied to a network device, characterized in that: The method comprises: Receiving a target protocol message, wherein the target protocol message is a corresponding message sent by other network devices that perform protocol interaction with the target network device; Determine whether the target protocol message has a preset field, where the preset field is used to identify different optimization methods of neighbor relations; When the target protocol message does not have a preset field, the target interface MTU of the target network device is obtained, the target protocol message is parsed to obtain the corresponding key field, and the target protocol message is optimized based on the target interface MTU and the key field and then sent to the corresponding other network devices, so as to optimize the neighbor relationship between the target network device and the other network devices.
2. The neighbor relationship optimization method according to claim 1, characterized in that: The optimization method includes a neighbor establishment optimization method and an information synchronization optimization method; wherein the specific type of the optimization method is determined according to whether a neighbor relationship is established between the target network device and other network devices; if the target network device and other network devices do not have a neighbor relationship, the preset field is used to identify the neighbor establishment optimization method; if the target network device and other network devices have established a neighbor relationship, the preset field is used to identify the information synchronization optimization method.
3. The neighbor relationship optimization method according to claim 2, characterized in that: When the preset field is used to identify the neighbor establishment optimization mode, the key field is the opposite interface MTU; the parsing of the target protocol message to obtain the corresponding key field, and optimizing the target protocol message based on the target interface MTU and the key field and then sending it to the corresponding other network device, so as to optimize the neighbor relationship between the target network device and the other network device, includes: Performing interface MTU analysis on the target protocol message to obtain the peer interface MTU; Determine whether the target interface MTU is smaller than the peer interface MTU; If the target interface MTU is not less than the peer interface MTU, the target interface MTU is updated based on the peer interface MTU, and the updated target interface MTU is saved to a preset storage location of the target network device and filled into a corresponding field position in the target protocol message; and the target protocol message is field-marked and sent to the corresponding other network devices to establish a neighbor relationship between the target network device and the other network devices.
4. The neighbor relationship optimization method according to claim 3, characterized in that: The method further comprises: If the target interface MTU is smaller than the peer interface MTU, the target protocol message is sent to the corresponding other network device to establish a neighbor relationship between the target network device and the other network device.
5. The neighbor relationship optimization method according to claim 2, characterized in that: When the preset field is used to identify the information synchronization optimization mode, the key field is the target LSP configuration value of the target network device; the parsing of the target protocol message to obtain the corresponding key field, and optimizing the target protocol message based on the target interface MTU and the key field and then sending it to the corresponding other network device, so as to optimize the neighbor relationship between the target network device and the other network device, including: Obtaining a target LSP configuration value from a preset storage location of a target network device based on the target protocol message; Determine whether the target interface MTU is less than the target LSP configuration value; If the target interface MTU is smaller than the target LSP configuration value, the target LSP configuration value is optimized based on the target interface MTU to obtain an optimized LSP value; the message length of the target protocol message is optimized based on the LSP optimization value, and the optimized target protocol message is sent to the corresponding other network devices to synchronize link status information.
6. The method for optimizing neighbor relations according to claim 5, characterized in that: The method further comprises: If the target interface MTU is not less than the target LSP configuration value, the target protocol message is sent to the corresponding other network devices to synchronize the link status information of the target network device and the other network devices.
7. The neighbor relationship optimization method according to claim 1, characterized in that: The method further comprises: When the target protocol message has a preset field, a neighbor relationship between the target network device and other network devices is established based on the target protocol message, or link status information between the target network device and other network devices is synchronized.
8. A neighbor relationship optimization device, applied to a network device, characterized in that: The device comprises: An acquisition module is used to receive a target protocol message, where the target protocol message is a corresponding message sent by other network devices that perform protocol interaction with the target network device; A judging module, used for judging whether the target protocol message has a preset field, wherein the preset field is used for identifying different optimization modes of neighbor relationship; The optimization module is used to obtain the target interface MTU of the target network device when the preset field does not exist in the target protocol message, parse the target protocol message to obtain the corresponding key field, and optimize the target protocol message based on the target interface MTU and the key field and then send it to the corresponding other network devices, so as to optimize the neighbor relationship between the target network device and the other network devices.
9. A neighbor relationship optimization device, characterized in that: The device comprises: a memory and a processor, the memory and the processor are communicatively connected to each other, the memory stores computer instructions, and the processor executes the neighbor relationship optimization method according to any one of claims 1 to 7 by executing the computer instructions.
10. A computer-readable storage medium, characterized in that: The computer-readable storage medium stores computer instructions, and the computer instructions are used to enable a computer to execute the neighbor relationship optimization method according to any one of claims 1 to 7.
Citation Information
Patent Citations
Method and equipment for obtaining global minimum and maximum transmission unit values
CN103023777A
LSP (Link State PDU) message length updating method and neighbor negotiation method and device
CN106789715A
Neighborhood relationship establishing method and apparatus
CN106941452A
Routing generation for implementation of fiber channel over ethernet
US20140376562A1
Method and apparatus for establishing adjacency for a restarting router during convergence
US7466661B1