A neighbor relation optimization method, apparatus, device and medium
By receiving and optimizing the interface MTU and key field processing of target protocol messages, the problems of failure to establish neighbor relationships and asynchronous routing information between network devices are solved, achieving effective neighbor relationship optimization and information synchronization.
Patent Information
- Application Number
- CN202411774232.2
- Authority / Receiving Office
- CN · China
- Patent Type
- Patents(China)
- Current Assignee / Owner
- Filing Date
- 2024-12-04
- Publication Date
- 2025-11-04
- Estimated Expiration
- 2044-12-04
AI Technical Summary
The failure to establish neighbor relationships or the problem of routing information being out of sync between network devices are mainly due to inconsistent interface MTU configurations and the inability of protocols to successfully negotiate and synchronize their states because the protocol message size is larger than the interface MTU.
By receiving the target protocol message, it determines whether a preset field exists. If not, it obtains the interface MTU of the target network device and parses the key fields, performs optimization processing, and then sends it to the corresponding device to achieve neighbor relationship optimization.
It solves the problems of inconsistent interface MTU configuration and asynchronous routing information during the establishment of neighbor relationships, optimizes the establishment of neighbor relationships and information synchronization, and ensures effective communication between different network devices.
Smart Images

Figure CN119892708B_ABST
Abstract
Description
TECHNICAL FIELD
[0001] The present application relates to the field of communication technology, in particular to a neighbor relationship optimization method, device, equipment and medium. BACKGROUND
[0002] Currently, for different network devices (such as routers), effective communication between devices is achieved by establishing neighbor relationships and synchronizing routing information, etc.; wherein 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, which has multiple advantages such as no loop, support for area division, etc. In the process of establishing neighbor relationship, the OSPF protocol needs to go through 6 state transitions to achieve the establishment of neighbor relationship. Specifically, after the completion of the two-way communication stage, it enters the Link State DataBase (LSDB) synchronization stage; in this stage, the local router and the neighbor router both unicast MS position 1 negotiation messages to claim their "MASTER" status, at this time the neighbor relationship jumps 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, at this time it 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, as a commonly used link state routing protocol, belongs to IGP (Interior Gateway Protocol), which is used in autonomous systems. It negotiates neighbors through Hello messages and further establishes neighbor relationships. In actual application, each intermediate system that establishes neighbor relationships can send LSP (Link State PDU, link state protocol data unit, containing link state information) to each other to realize the synchronization of LSDB saved 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 causing the LSDB synchronization of each intermediate system to fail.
[0005] In summary, inconsistent MTU configurations on network device interfaces can easily lead to unsuccessful neighbor establishment between network devices, or, after neighbor relationships are established, the local LSP generated by the protocol is larger than the interface MTU, resulting in asynchronous routing information. This severely affects the establishment of neighbor relationships, making it impossible to calculate the optimal path and hindering effective communication between network devices. Summary of the Invention
[0006] In view of this, the present invention provides a method, apparatus, device and medium for optimizing neighbor relationships, in order 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, applied to network devices, the method comprising:
[0008] Receive target protocol messages, which are corresponding messages sent by other network devices that interact with the target network device using protocols;
[0009] Determine whether the target protocol message contains a preset field, which is used to identify different optimization methods for neighbor relationships;
[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 key fields before being sent to the corresponding other network devices, so as to optimize the neighbor relationship between the target network device and other network devices.
[0011] This invention optimizes the neighbor relationships between the target network device and other network devices by detecting whether a preset field exists in the target protocol message received by the target network device to identify different optimization methods for neighbor relationships. When the preset field does not exist, the target interface MTU of the target network device is obtained, and the target protocol message is parsed to obtain the corresponding key fields. Based on the target interface MTU and key fields, the target protocol message is optimized and then sent to the corresponding other network devices. This solves 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 thus realizes effective communication between different network devices.
[0012] In an alternative implementation, the optimization mode comprises a neighbor establishment optimization mode and an information synchronization optimization mode; wherein the specific type of the optimization mode is determined according to whether the target network device has established a neighbor relationship with other network devices; if the target network device has not established a neighbor relationship with other network devices, the preset field is used to identify the neighbor establishment optimization mode; if the target network device has established a neighbor relationship with other network devices, the preset field is used to identify the information synchronization optimization mode.
[0013] The present application identifies two optimization modes of the neighbor relationship based on the preset field, i.e. the neighbor establishment optimization mode and the information synchronization optimization mode, which can optimize the establishment process of the neighbor relationship to some extent and help to ensure the successful establishment of the neighbor relationship.
[0014] In an alternative implementation, when the preset field is used to identify the neighbor establishment optimization mode, the key field is the opposite end interface MTU; the corresponding key field is obtained by analyzing the target protocol packet, and the target protocol packet is sent to the corresponding other network device after being optimized based on the target interface MTU and the key field, so as to optimize the neighbor relationship between the target network device and other network devices, comprising:
[0015] performing interface MTU analysis on the target protocol packet to obtain the opposite end interface MTU;
[0016] determining whether the target interface MTU is smaller than the opposite end interface MTU;
[0017] if the target interface MTU is not smaller than the opposite end interface MTU, updating the target interface MTU based on the opposite end interface MTU, saving the updated target interface MTU to a preset storage location of the target network device and filling it into the corresponding field position in the target protocol packet; and sending the target protocol packet to the corresponding other network device after field identification, so as to establish the neighbor relationship between the target network device and other network devices.
[0018] The present application can ensure that the message length does not exceed the maximum message length of the current interface during data transmission by judging the numerical value of the target interface MTU and the opposite end interface MTU and selecting the smaller MTU for local saving and subsequent filling into the related field of the protocol packet, which helps to ensure that other network devices successfully receive the message, and thus ensures the successful establishment of the neighbor relationship.
[0019] In an alternative implementation, the method further comprises:
[0020] if the target interface MTU is smaller than the opposite end interface MTU, sending the target protocol packet to the corresponding other network device to establish the neighbor relationship between the target network device and other network devices.
[0021] The application keeps using the target interface MTU for subsequent protocol message interaction when the target interface MTU of the target network device is small, and accelerates 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 configured with a value of the target LSP of the target network device; the corresponding key field is obtained by analyzing the target protocol message, and the target protocol message is sent to the corresponding other network device after being optimized based on the target interface MTU and the key field, so as to optimize the neighbor relationship between the target network device and the other network device, including:
[0023] The target LSP configuration value is obtained from the preset storage position of the target network device based on the target protocol message;
[0024] It is judged 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 an LSP optimization value; the target protocol message is optimized in message length based on the LSP optimization value, and the optimized target protocol message is sent to the corresponding other network device, so as to synchronize the link state information.
[0026] The application can synchronize the link information between the network devices with established neighbor relationship by judging the size relationship between the target interface MTU and the target LSP configuration value and selecting the smaller value to optimize the message length of the target protocol message for information synchronization, further limits the maximum length of the LSP generated by the target network device, helps to ensure that the locally generated LSP size can be successfully diffused, and further realizes the effective communication between different network devices.
[0027] In an optional implementation, the method further includes:
[0028] If the target interface MTU is not smaller than the target LSP configuration value, the target protocol message is sent to the corresponding other network device, so as to synchronize the link state information of the target network device and the other network device.
[0029] The application keeps using the target interface MTU for subsequent protocol message interaction when the target interface MTU of the target network device is small, and guarantees the information synchronization between the network devices with established neighbor relationship to a certain extent.
[0030] In an optional implementation, the method further includes:
[0031] When the target protocol packet has the preset field, the target network device and other network devices establish a neighbor relationship or synchronize link state information of the target network device and the other network devices based on the target protocol packet.
[0032] When the target protocol packet has the preset field, the target network device and other network devices establish a neighbor relationship or synchronize link state information of the target network device and the other network devices based on the target protocol packet.
[0033] In a second aspect, the present application provides a neighbor relationship optimization device applied to a network device, and the device comprises: an acquisition module, configured to receive a target protocol packet, the target protocol packet being a corresponding packet sent by other network devices performing protocol interaction with a target network device;
[0034] A judgment module is configured to judge whether the target protocol packet has a preset field, and the preset field is used to identify different optimization modes of a neighbor relationship.
[0035] An optimization module is configured to, when the target protocol packet does not have the preset field, acquire a target interface MTU of the target network device, parse the target protocol packet to obtain a corresponding key field, and send the target protocol packet to corresponding other network devices after performing optimization processing based on the target interface MTU and the key field, so as to realize optimization of the neighbor relationship of the target network device and the other network devices.
[0036] The neighbor relationship optimization device of the present application, when the target network device receives a target protocol packet that does not have a preset field, acquires a target interface MTU of the device and parses the target protocol packet to obtain a corresponding key field, and sends the target protocol packet to other network devices after performing optimization processing based on the target interface MTU and the key field, so as to realize optimization of the neighbor relationship between different network devices, effectively avoid the problems of inconsistent interface MTU configuration and asynchronous routing information in the process of establishing a neighbor relationship, and help optimize the establishment of a neighbor relationship, thereby realizing effective communication between different network devices.
[0037] In a third aspect, the present application provides a neighbor relationship optimization device, comprising a memory and a processor, the memory and the processor are in communication connection with each other, the memory stores computer instructions, and the processor executes the computer instructions, thereby executing the neighbor relationship optimization method of the first aspect or any of the corresponding embodiments thereof.
[0038] In a fourth aspect, the present application provides a computer readable storage medium, and the computer readable storage medium stores computer instructions, and the computer instructions are used to make a computer execute the neighbor relationship optimization method of the first aspect or any of the corresponding embodiments thereof. BRIEF DESCRIPTION OF DRAWINGS
[0039] In order to more clearly illustrate the technical solutions in the specific embodiments of the present application or the prior art, the drawings needed to be used in the specific embodiments or prior art description will be briefly introduced. Obviously, the drawings in the following description are some embodiments of the present application, and other drawings can be obtained by those skilled in the art without creative labor on the basis of these drawings.
[0040] Figure 1 is a flowchart of a neighbor relationship optimization method according to an embodiment of the present application;
[0041] Figure 2 is a flowchart of another neighbor relationship optimization method according to an embodiment of the present application;
[0042] Figure 3 is a neighbor relationship optimization schematic diagram;
[0043] Figure 4 is another neighbor relationship optimization schematic diagram;
[0044] Figure 5 is a neighbor relationship establishment schematic diagram;
[0045] Figure 6 is a routing information synchronization schematic diagram;
[0046] Figure 7 is a structural schematic diagram of a neighbor relationship optimization system according to an embodiment of the present application;
[0047] Figure 8 is a structural block diagram of a neighbor relationship optimization device according to an embodiment of the present application;
[0048] Figure 9 is a hardware structural schematic diagram of a neighbor relationship optimization device according to an embodiment of the present application. DETAILED DESCRIPTION
[0049] In order to make the objects, technical solutions and advantages of the embodiments of the present application clearer, the technical solutions in the embodiments of the present application will be described clearly and completely below with reference to the drawings in the embodiments of the present application. Obviously, the described embodiments are some embodiments of the present application, rather than all the embodiments. Based on the embodiments in the present application, all other embodiments obtained by those skilled in the art without creative labor fall within the protection scope of the present application.
[0050] The embodiment of the present application provides a neighbor relationship optimization method, and it should be noted that the steps shown in the flowchart of the 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 herein.
[0051] In the embodiment, a neighbor relationship optimization method is provided, Figure 1 is a flowchart of the neighbor relationship optimization method according to the embodiment of the present application, as shown in the figure, the flowchart comprises the following steps: Figure 1
[0052] Step S101, receiving a target protocol message, the target protocol message is a corresponding message sent by other network devices for protocol interaction with a target network device.
[0053] It should be noted that the specific type of the target protocol message in the embodiment is not limited herein, and is adaptively adjusted according to actual requirements, such as an OSPF protocol Hello message, a negotiation message DD (Database Description, database description), which is only used as an example for illustration. It should be explained that the Hello message is used to discover and maintain the neighbor relationship, and to establish and maintain the adjacency relationship. The Hello message is periodically sent, and contains the value of the timer, the DR (Designated Router, designated router, responsible for establishing the OSPF adjacency relationship with other routers in the network, and responsible for forwarding all other router link state advertisements (LSA) and BDR (Backup Designated Router, backup designated router, used to monitor the state of the DR, and to take over its role when the 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), and 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 master and slave devices.
[0054] Step S102, judging whether the target protocol message exists a preset field, the preset field is used to identify different optimization modes of the neighbor relationship.
[0055] In the embodiment, the specific content of the preset field is not limited herein, and is adaptively set according to actual requirements, such as a preset field being a set field for identifying neighbor relationship establishment optimization processing.
[0056] Step S103, when the target protocol message does not exist the preset field, obtaining the target interface MTU of the target network device, parsing the target protocol message to obtain the corresponding key field, and sending the target protocol message to the corresponding other network device after the target protocol message is processed based on the target interface MTU and the key field, so as to realize the optimization of the neighbor relationship of the target network device and the other network device.
[0057] When the target network device receives the target protocol message, the target interface MTU of the target network device is obtained, and the corresponding key field is parsed from the target protocol message, and the target protocol message is sent to the corresponding other network device after the target protocol message is processed based on the target interface MTU and the key field, which can solve the problem of inconsistent interface MTU configuration and asynchronous routing information in the neighbor relationship establishment process, greatly optimize the establishment of the neighbor relationship or the link information synchronization between different network devices, and help to ensure the effective communication between different network devices.
[0058] In the embodiment, a neighbor relationship optimization method is provided, Figure 2 is a flowchart of another neighbor relationship optimization method according to the embodiment of the application, as shown in Figure 2 The flowchart includes the following steps:
[0059] Step S201, receiving a target protocol message, the target protocol message is a corresponding message sent by other network devices for protocol interaction with the target network device. For details, please refer to step S101 of the embodiment shown in Figure 1 Here, no longer be repeated.
[0060] Step S202, judging whether the target protocol message exists the preset field, the preset field is used to identify different optimization modes of the neighbor relationship.
[0061] It should be noted that the preset field in the embodiment is used to identify different optimization modes of the neighbor relationship, and the optimization mode includes a neighbor establishment optimization mode and an information synchronization optimization mode; wherein the specific type of the optimization mode is determined according to whether the target network device and the other network device establish the neighbor relationship; if the target network device and the other network device do not establish the neighbor relationship, the preset field is used to identify the neighbor establishment optimization mode; if the target network device and the other network device have established the neighbor relationship, the preset field is used to identify the information synchronization optimization mode. Specifically, the two optimization modes of the neighbor relationship, i.e. the neighbor establishment optimization mode and the information synchronization optimization mode, are identified based on the preset field, which can optimize the establishment process of the neighbor relationship to some extent, and help to ensure the successful establishment of the neighbor relationship.
[0062] Step S203, when the target protocol message does not exist the preset field, obtaining the target interface MTU of the target network device, parsing the target protocol message to obtain the corresponding key field, and sending the target protocol message to the corresponding other network device after optimization processing based on the target interface MTU and the key field, to realize the optimization of the neighbor relationship of the target network device and the other network device.
[0063] It should be noted that the preset field in the embodiment identifies two neighbor relationship optimization modes, i.e. the neighbor establishment optimization mode and the information synchronization optimization mode, and therefore different neighbor relationship optimization processing procedures are set. In the embodiment, when the preset field is used to identify the neighbor establishment optimization mode, the key field is the opposite end interface MTU. Specifically, in the step S203, the target protocol message is parsed to obtain the corresponding key field, and the target protocol message is sent to the corresponding other network device after optimization processing based on the target interface MTU and the key field, to realize the optimization of the neighbor relationship of the target network device and the other network device, including:
[0064] Step A1, performing interface MTU analysis on the target protocol message to obtain the opposite end interface MTU.
[0065] Step A2, judging whether the target interface MTU is smaller than the opposite end interface MTU.
[0066] Step A3, if the target interface MTU is not smaller than the opposite end interface MTU, updating the target interface MTU based on the opposite end interface MTU, saving the updated target interface MTU to a preset storage location of the target network device and filling it into the corresponding field position in the target protocol message; and sending the target protocol message to the corresponding other network device after field identification, to establish the neighbor relationship of the target network device and the other network device.
[0067] In the 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 being a local storage unit of the network device.
[0068] In the embodiment, by judging the numerical value of the target interface MTU and the opposite end interface MTU, and selecting the smaller MTU for local saving and subsequent filling into the related field of the protocol message, the length of the message in the data transmission process can be ensured to be not more than the maximum length of the current interface, which helps to ensure that the other network device successfully receives the message, and further ensures the successful establishment of the neighbor relationship.
[0069] Step A4, if the target interface MTU is smaller than the opposite end interface MTU, sending the target protocol message to the corresponding other network device, to establish the neighbor relationship of the target network device and the other network device.
[0070] The embodiment of the present application keeps using the target interface MTU for subsequent protocol message interaction when the target interface MTU of the target network device is small, and accelerates the successful establishment of the neighbor relationship to a certain extent.
[0071] In the embodiment, when the preset field is used to identify the information synchronization optimization mode, the key field is configured with a value of the target LSP of the target network device. Specifically, the corresponding key field is obtained by parsing the target protocol message in the step S203, and the target protocol message is sent to the corresponding other network device after being optimized based on the target interface MTU and the key field, so as to optimize the neighbor relationship between the target network device and the other network device, including:
[0072] In step B1, the target LSP configuration value is obtained from the preset storage location of the target network device based on the target protocol message.
[0073] It should be noted that the LSP message is used to exchange link state information, and by configuring the basic attributes of the LSP, the size and maximum effective time of the LSP message can be controlled; in addition, the diffusion speed of the LSP message can be accelerated by enabling the fast diffusion of the LSP, reducing the minimum time interval of the interface sending the LSP message and the refresh period of the LSP, so that the network can converge quickly.
[0074] In actual application, the size of the generated LSP of the IS-IS protocol is configurable, but when the configured LSP size is greater than the value of the interface MTU of the network device to be sent, the opposite end device may not be able to receive the message, thereby causing the routing calculation to be incorrect. In the embodiment, the target LSP configuration value is the configuration value of the protocol generated and received LSP, which is configured by the current network device and saved 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] In step B2, it is judged whether the target interface MTU is less than the target LSP configuration value.
[0076] In step B3, if the target interface MTU is less than the target LSP configuration value, the target LSP configuration value is optimized based on the target interface MTU to obtain an LSP optimization value; the target protocol message is optimized in terms of message length based on the LSP optimization value, and the optimized target protocol message is sent to the corresponding other network device to synchronize the link state information.
[0077] The embodiment of the present application can realize information synchronization by judging the size relationship between the target interface MTU and the target LSP configuration value, and selecting the smaller value to optimize the length of the target protocol packet, can synchronize the link information between the network devices with established neighbor relationship, further limits the maximum length of LSP generated by the target network device, helps to ensure that the size of the locally generated LSP can be successfully diffused, and further realizes effective communication between different network devices.
[0078] In step B4, if the target interface MTU is not smaller than the target LSP configuration value, the target protocol packet is sent to the corresponding other network device, so as to synchronize the link state information of the target network device and the other network device.
[0079] The embodiment of the present application keeps using the target interface MTU for subsequent protocol packet interaction when the target interface MTU of the target network device is small, which guarantees the information synchronization between the network devices with established neighbor relationship to a certain extent.
[0080] In step S204, when the target protocol packet has the preset field, the neighbor relationship between the target network device and the other network device is established or the link state information of the target network device and the other network device is synchronized based on the target protocol packet.
[0081] The neighbor relationship optimization method of the embodiment of the present application can solve the problems of inconsistent interface MTU configuration and asynchronous routing information in the neighbor relationship establishment process, greatly optimizes the establishment of neighbor relationship or the synchronization of link information between different network devices, and helps to guarantee effective communication between different network devices.
[0082] In a specific embodiment, the network device is a router. Since many problems are often encountered in actual networking, i.e., the neighbor relationship establishment is unsuccessful due to inconsistent interface MTU, or the LSP carrying routing information between neighbor routers is asynchronous, etc., which further leads to the problem that the optimal routing path cannot be calculated, the network device configuration in the telecommunication level data communication network is more complex, and once a fault occurs, it is difficult to troubleshoot. Based on this, the embodiment proposes an optimization scheme for neighbor relationship adjustment and establishment and routing information synchronization, Figure 3 is a neighbor relationship optimization schematic diagram. By Figure 3It can be seen that the specific optimization process of the scheme is: receiving a protocol packet, searching for an identification field; judging whether to enter the storage unit according to the identification field; reading and storing the key field value, comparing it with the local port MTU of the receiving / sending, and processing; updating the storage unit variable after the comparison result, filling the protocol packet with the value and marking it; sending the protocol packet processed above to the opposite network device, and performing subsequent neighbor state transition / route information synchronization. Specifically, for the scenario that the interface MTU inconsistency leads to the failure to establish a neighbor relationship, the relevant fields of the received protocol packet are read and stored, and after the comparison processing, they are saved in the storage unit, and the protocol packet is sent to the opposite device after the corresponding field is filled with the processed MTU value and marked with an identifiable mark. For another scenario of route information out of synchronization, the size of the LSP generated is recorded, and the value of the interface MTU to be sent is compared and processed, and the maximum length of the generated LSP is limited according to the processed value, which can ensure the smooth interaction of protocol packets.
[0083] In the embodiment, referring to Figure 4 , by identifying whether the received protocol packet is already processed (i.e. whether the set identification field exists), if it is the original protocol packet (i.e. the identification field does not exist or the identification field is not set), the key field such as interface MTU (i.e. interface MTU or LSP generation configuration value) is read and stored in the variable unit for processing, and the protocol packet is sent to the opposite device after the corresponding field is filled with the compared value and marked with an identifiable mark; if the identification field exists, i.e. the identification field is set, the subsequent neighbor negotiation / LSP PDU interaction synchronization stage is performed according to the original protocol implementation. Through the above neighbor relationship optimization process, the failure to establish a neighbor relationship due to the differences in the default implementation of multi-vendor devices in complex telecom-level networks, or the inconsistency of MTU configuration values on the link due to negligence, or the out-of-synchronization of network device link databases causing the calculated path to be non-optimal or a routing black hole can be avoided, which helps to reduce the time-consuming of personnel investigation, network shock and other adverse effects.
[0084] In a specific embodiment, for the OSPF protocol, an optimization scheme for neighbor relationship establishment is proposed, referring to Figure 5 , the specific optimization process includes:
[0085] 1, The end router and the opposite end router send and receive Hello message according to the current protocol implementation, and the handshaking is successful. Specifically, the end router (i.e. RT1 in the figure) receives the original negotiation message sent by the opposite end (i.e. RT2 in the figure), reads and stores the interface MTU field parameter value of the message. It should be noted that RT2 does not receive the negotiation message DD of RT1 (i.e. because the value of the interface MTU of RT2 is 2000, which is greater than the value of the interface MTU of RT1, which is 1500), and the current state is maintained.
[0086] 2, Get the interface MTU of the end received in the negotiation message, judge the size of the value and the stored interface MTU value of the opposite end router, get the smaller value in the two values for the neighbor negotiation stage.
[0087] In practical application, the neighbor negotiation stage needs to determine the master-slave relationship between the two routers in the process of sending DD negotiation message, that is, the party as master defines a sequence number seq, and adds 1 to seq every time a new DD message is sent; the party as slave uses the seq in the last master's DD message received every time a DD message is sent. In fact, the sequence number mechanism is an implicit confirmation method, and if the timeout retransmission is added to each message, the reliability of transmission can be guaranteed.
[0088] 3, The compared value is stored in the storage unit again, the value of the field is used to fill the related field of the new negotiation message, the message is marked and sent to the opposite end network device.
[0089] 4, After the opposite end receives the negotiation message, it checks the identification field, whether it is the negotiation message refilled after comparison, if yes, it elects the M / S status according to the size of Routerid according to the original protocol implementation; if not, it extracts and stores the interface MTU value according to the same way, compares it with the MTU value of the receiving protocol message port, and determines the appropriate value to update the variable value of the storage unit.
[0090] In this embodiment, refer to Figure 5The process includes that RT1 first sends a DD message, claims itself as master (MS=1), and defines the sequence number seq as x. The field I=1 in the message indicates that this is the first DD message, and the message does not contain the digest of LSA, but is only used to negotiate the master-slave relationship. M=1 indicates that this is not the last message. After receiving the DD message of RT1, RT2 changes the neighbor state machine of RT1 to Exstart, and responds with a DD message (which also does not contain the digest information of LSA). Since the Routerid of RT2 is larger, RT2 considers itself as master in the message, and redefines the sequence number as y+1. After receiving the message, RT1 agrees that RT2 is master, and changes the neighbor state machine of RT2 to exchange. RT1 uses the sequence number y of RT2 to send a new DD message, which starts to formally transmit the digest of LSA. In the message, RT1 sets MS=0, indicating that it is a slave. The above process continues, and RT1 confirms that it has received the message of RT2 by repeating the sequence number of RT2 (i.e. RT1 changes the sequence number of the message to y+1). RT2 confirms that it has received the message of RT1 by changing the sequence number by +1. 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, RT1 receives the last DD message, finds that there are many LSAs in the database of RT2 that it does not have, and changes the neighbor state machine to Loading. At this time, RT2 also receives the last DD message of RT1, but the LSA of RT1 is already in RT2, and there is no need to request, so RT2 directly changes the neighbor state machine of RT1 to Full. RT1 sends LS Request message to RT2 to request the required LSA. RT2 responds to the request of RT1 with LS Update message. After receiving it, RT1 needs to send LS Ack message to confirm. The above process continues until the LSAs in RT1 and RT2 are completely synchronized. At this time, RT1 changes the neighbor state machine of RT2 to Full. It should be noted that the above process is the process from the state that two routers do not discover each other to the state that they establish adjacency relationship. Or it can be understood as the processing situation when a new router is added to the network. After the state machines of the two routers have reached the Full state, if there is a change in the network at this time, there is no need to repeat all the above steps. Only one party sends LS Update message to notify the content that needs to be updated, and the other party sends LS Ack message to respond. The neighbor state machines of the two parties do not change in this process.
[0091] In a specific embodiment, after the establishment of the neighbor relationship of the IS-IS routing protocol, the link information between the network devices with the established neighbor relationship is synchronized through the LSP message, and then the shortest path first calculation is performed. The generated LSP size of the IS-IS protocol is configurable. If the value is greater than the interface MTU value of the network device to be sent, the opposite end device cannot receive the message, thereby causing the routing calculation error. Based on this, an optimization scheme for the synchronization of routing information is proposed, refer to Figure 6 , and the specific optimization process includes:
[0092] 1. The local router and the opposite end router perform the Hello message sending and receiving according to the current protocol implementation, and the handshake is successful (such as the handshake message of RT1 and RT2 in the figure: isis hello IIH).
[0093] 2. The configuration value of the generated LSP of the protocol is obtained (if no configuration is performed, the default value of the protocol is taken) and is saved in the storage unit.
[0094] 3. The MTU value of the interface with the established IS-IS protocol neighbor relationship is determined with the stored LSP message value that can be generated and received by the local end, and the appropriate value (that is, the minimum value) is determined to refill the corresponding variable of the storage unit.
[0095] 4. The corresponding variable of the storage unit is read to successfully diffuse the locally generated LSP.
[0096] In a specific embodiment, Figure 7 is a structural schematic diagram of the neighbor relationship optimization system. As shown in Figure 7 , the system includes:
[0097] 1. The storage module: the local router receives the original negotiation message sent by the opposite end, reads and stores the interface MTU field parameter value of the message; the compared value is stored in the storage unit again, the related field of the new negotiation message is filled with the value of the field, the message is marked and sent to the opposite end network device.
[0098] 2. The processing module: the interface MTU of the received negotiation message is determined with the stored interface MTU value of the opposite end router, and the appropriate value is determined.
[0099] 3. The marking module: the compared value is stored in the storage unit again, the related field of the new negotiation message is filled with the value of the field, the message is marked and sent to the opposite end router.
[0100] 4. The sending / receiving module: after the opposite router receives the negotiation message, it checks the identification field to determine whether it is the negotiation message that has been compared and refilled again. If so, it elects the M / S status according to the size of the Routerid according to the original protocol. If not, it extracts and stores the interface MTU value according to the neighbor relationship optimization method of the embodiment, compares the size of the interface MTU value with the MTU value of the receiving protocol port, and determines the appropriate value to update the corresponding variable value of the storage unit.
[0101] In summary, the neighbor relationship optimization system of the embodiment can be applied to related scenarios of different routing protocols, such as a telecom-level access network, to solve the problems of neighbor relationship establishment and asynchronous routing information caused by the inconsistency of interface MTU values on the path in the multi-vendor device connection scenario, so that the routers carrying the MTU protocol can interact smoothly in the case of inconsistent interface MTU values, effectively reducing the troubleshooting pressure of the operation and maintenance personnel, reducing the abnormal neighbor state and asynchronous routing caused by the mismatch of MTU values, routing calculation errors or black holes, and other adverse situations, so that the network devices can smoothly interact with the related protocol messages, greatly optimizing the establishment of neighbor relationships or the synchronization of link information between different network devices, and ensuring effective communication between different network devices.
[0102] In the embodiment, a neighbor relationship optimization device is also provided, which is used to implement the above embodiments and preferred embodiments, and will not be described again. As used below, the term "module" can be a combination of software and / or hardware that implements a predetermined function. Although the device described in the following embodiments is preferably implemented in software, hardware or a combination of software and hardware is also possible and contemplated.
[0103] The application provides a neighbor relationship optimization device, which is applied to a network device, such as Figure 8 As shown in the figure, the device comprises:
[0104] The acquisition module 801 is configured to receive a target protocol message, which is a corresponding message sent by another network device for protocol interaction with a target network device.
[0105] The judgment module 802 is configured to determine whether the target protocol message has a preset field, which is used to identify different optimization methods of neighbor relationships.
[0106] The optimization module 803 is configured to, when the target protocol message does not have the preset field, acquire a target interface MTU of the target network device, parse the target protocol message to obtain a corresponding key field, and send the target protocol message to the corresponding other network device after optimization processing based on the target interface MTU and the key field, so as to optimize the neighbor relationship between the target network device and the other network device.
[0107] In some optional embodiments, the judging module 802 comprises a judging submodule, and the optimization mode comprises a neighbor establishing optimization mode and an information synchronization optimization mode; wherein the specific type of the optimization mode is determined according to whether the target network device establishes a neighbor relationship with other network devices; if the target network device does not establish a neighbor relationship with other network devices, the preset field is used to identify the neighbor establishing optimization mode; if the target network device has established a neighbor relationship with other network devices, the preset field is used to identify the information synchronization optimization mode.
[0108] In some optional embodiments, the optimization module 803 comprises a first establishing optimization submodule, a second establishing optimization submodule, a third establishing optimization submodule and a fourth establishing optimization submodule; wherein the first establishing optimization submodule is used to perform interface MTU analysis on the target protocol message to obtain a peer interface MTU; the second establishing optimization submodule is used to judge whether the target interface MTU is smaller than the peer interface MTU; the third establishing optimization submodule is used to update the target interface MTU based on the peer interface MTU if the target interface MTU is not smaller than the peer interface MTU, save the updated target interface MTU to a preset storage location of the target network device and fill it into a corresponding field position in the target protocol message; and after field identification is performed on the target protocol message, 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; and the fourth establishing optimization submodule is used to send the target protocol message to the corresponding other network device to establish a neighbor relationship between the target network device and the other network device if the target interface MTU is smaller than the peer interface MTU.
[0109] In some optional embodiments, the optimization module 803 further comprises 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 a target LSP configuration value from the preset storage location of the target network device based on the target protocol message; the second synchronization optimization submodule is used to judge whether the target interface MTU is smaller 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 an LSP optimization value if the target interface MTU is smaller than the target LSP configuration value; the target protocol message is optimized in terms of message length based on the LSP optimization value, and the optimized target protocol message is sent to the corresponding other network device to synchronize link state information; and the fourth synchronization optimization submodule is used to send the target protocol message to the corresponding other network device to synchronize the link state information between the target network device and the other network device if the target interface MTU is not smaller than the target LSP configuration value.
[0110] In some optional implementations, the apparatus further includes: a usage module, used to establish a neighbor relationship between the target network device and other network devices or synchronize the link state information of the target network device and other network devices based on the target protocol message when a preset field exists in the target protocol message.
[0111] Further functional descriptions of the above modules are the same as those in the corresponding embodiments described above, and will not be repeated here.
[0112] This invention, based on a neighbor relationship optimization device, can effectively avoid the problems of inconsistent interface MTU configuration and asynchronous routing information during the establishment of neighbor relationships, which helps to optimize the establishment of neighbor relationships and realizes effective communication between different network devices.
[0113] This invention also provides a neighbor relationship optimization device; please refer to [link / reference]. Figure 9 , Figure 9 This is a schematic diagram of the structure of the controller provided in an optional embodiment of the present invention, as shown below. Figure 9 As shown, the controller includes one or more processors 10, memory 20, and interfaces for connecting the components, including high-speed interfaces and low-speed interfaces. The components communicate with each other via different buses and can be mounted on a common motherboard or otherwise as required. The processors can process instructions executed within the neighbor optimization device, including instructions stored in or on memory to display graphical information of a GUI on external input / output devices (such as display devices coupled to the interface). In some alternative implementations, multiple processors and / or multiple buses can be used with multiple memories and multiple memory modules, if desired. Similarly, multiple neighbor optimization devices can be connected, each providing some of the necessary operations (e.g., as a server array, a group of blade servers, or a multiprocessor system). Figure 9 Take a processor 10 as an example.
[0114] Processor 10 may be a central processing unit, a network processor, or a combination thereof. Processor 10 may further include a hardware chip. The hardware chip may be an application-specific integrated circuit (ASIC), a programmable logic device (PLD), or a combination thereof. The programmable logic device may be a complex programmable logic device (CAMP), a field-programmable gate array (FPGA), a general-purpose array logic (GDA), or any combination thereof.
[0115] The memory 20 stores instructions executable by at least one processor 10 to cause at least one processor 10 to perform the method shown in the above embodiments.
[0116] The memory 20 can include a program storage area and a data storage area. The program storage area can store an operating system and application programs required by at least one function. The data storage area can store data created according to the use of the neighbor relationship optimization device, etc. In addition, the memory 20 can include a high-speed random access memory and can also include a non-transitory memory such as at least one magnetic disk storage device, a flash memory device, or other non-transitory solid-state memory device. In some alternative embodiments, the memory 20 can optionally include a memory disposed remotely with respect to the processor 10, which can be connected to the neighbor relationship optimization device through a network. Examples of the network include, but are not limited to, the Internet, an intranet, a local area network, a mobile communication network, and a combination thereof.
[0117] The memory 20 can include a volatile memory such as a random access memory, and can also include a non-volatile memory such as a flash memory, a hard disk, or a solid-state disk. The memory 20 can also include a combination of the above-mentioned types of memories.
[0118] The controller further includes a communication interface 30 for communication of the master chip with other devices or communication networks.
[0119] The embodiments of the present application also provide a computer readable storage medium. The above-mentioned method according to the embodiments of the present application can be implemented in hardware, firmware, or recorded in a storage medium, or implemented as computer code stored in a remote storage medium or a non-transitory machine readable storage medium and stored in a local storage medium to be downloaded through a network, so that the method described herein can be processed by such software on a storage medium using a general-purpose computer, a special-purpose processor, or programmable or special-purpose hardware. The storage medium can be a magnetic disk, an optical disk, a read-only memory, a random access memory, a flash memory, a hard disk, or a solid-state disk, etc. Further, the storage medium can also include a combination of the above-mentioned types of memories. It can be understood that the computer, the processor, the microprocessor master chip, or the programmable hardware includes a storage component that can store or receive software or computer code, which, when accessed and executed by the computer, the processor, or the hardware, implements the method shown in the above-mentioned embodiments.
[0120] Although the embodiments of the present application are described in conjunction with the accompanying drawings, various modifications and changes can be suggested by those skilled in the art without departing from the spirit and scope of the present application, and such modifications and changes are intended to fall within the scope of the appended claims.
Claims
1. A neighbor relation optimization method, applied to a network device, characterized in that, The method comprises: receiving a target protocol packet, the target protocol packet being a corresponding packet sent by other network devices in protocol interaction with a target network device; determining whether the target protocol packet has a preset field, the preset field being used to identify different optimization modes of a neighbor relationship; when the target protocol packet does not have the preset field, obtaining a target interface MTU of the target network device, parsing the target protocol packet to obtain a corresponding key field, and sending the target protocol packet to corresponding other network devices after optimization processing based on the target interface MTU and the key field, so as to optimize the neighbor relationship between the target network device and the other network devices; wherein the optimization mode includes a neighbor establishment optimization mode and an information synchronization optimization mode; wherein the specific type of the optimization mode is determined according to whether the target network device and the other network devices have established a neighbor relationship; if the target network device and the other network devices have not established a neighbor relationship, the preset field is used to identify the neighbor establishment optimization mode; 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 mode; when the preset field is used to identify the neighbor establishment optimization mode, the key field is a peer interface MTU; the parsing of the target protocol packet to obtain a corresponding key field and the optimization processing of the target protocol packet based on the target interface MTU and the key field and the sending of the target protocol packet to corresponding other network devices after optimization processing, so as to optimize the neighbor relationship between the target network device and the other network devices, comprise: performing interface MTU parsing on the target protocol packet to obtain a peer interface MTU; determining whether the target interface MTU is smaller than the peer interface MTU; if the target interface MTU is not smaller than the peer interface MTU, updating the target interface MTU based on the peer interface MTU, saving the updated target interface MTU to a preset storage location of the target network device, and filling the updated target interface MTU into a corresponding field position in the target protocol packet; and sending the target protocol packet to corresponding other network devices after field identification, so as to establish a neighbor relationship between the target network device and the other network devices; When the preset field is used to identify the information synchronization optimization mode, the key field is a target LSP configuration value of the target network device; the target protocol packet is parsed to obtain a corresponding key field, and after the target protocol packet is processed based on the target interface MTU and the key field, the target protocol packet is sent to a corresponding other network device, so as to realize optimization of a neighbor relationship of the target network device and the other network device, including: obtaining a target LSP configuration value from a preset storage location of the target network device based on the target protocol packet; determining whether the target interface MTU is less than the target LSP configuration value; if the target interface MTU is less than the target LSP configuration value, then the target LSP configuration value is optimized based on the target interface MTU to obtain an LSP optimization value; the target protocol packet is processed based on the LSP optimization value to optimize the length of the target protocol packet, and the optimized target protocol packet is sent to the corresponding other network device, so as to synchronize link state information.
2. The method of claim 1, wherein, The method further includes: If the target interface MTU is less than the peer interface MTU, then the target protocol packet is sent to the corresponding other network device, so as to establish a neighbor relationship of the target network device and the other network device.
3. The method of claim 1, wherein, The method further includes: If the target interface MTU is not less than the target LSP configuration value, then the target protocol packet is sent to the corresponding other network device, so as to synchronize link state information of the target network device and the other network device.
4. The method of claim 1, wherein, The method further includes: When the target protocol packet has a preset field, a neighbor relationship of the target network device and the other network device is established based on the target protocol packet, or link state information of the target network device and the other network device is synchronized.
5. A neighbor relation optimization apparatus applied to a network device, characterized in that, The device includes: An obtaining module is configured to receive a target protocol packet, the target protocol packet being a corresponding packet sent by an other network device performing protocol interaction with a target network device; A determining module is configured to determine whether the target protocol packet has a preset field, the preset field being used to identify different optimization modes of a neighbor relationship; An optimization module is configured to, when the target protocol packet does not have a preset field, obtain a target interface MTU of the target network device, parse the target protocol packet to obtain a corresponding key field, and after the target protocol packet is processed based on the target interface MTU and the key field, send the target protocol packet to a corresponding other network device, so as to optimize a neighbor relationship of the target network device and the other network device; Wherein, the optimization modes include a neighbor establishment optimization mode and an information synchronization optimization mode; wherein, a specific type of the optimization mode is determined according to whether the target network device and the other network device have established a neighbor relationship; if the target network device and the other network device have not established a neighbor relationship, then the preset field is used to identify the neighbor establishment optimization mode; if the target network device and the other network device have established a neighbor relationship, then the preset field is used to identify the information synchronization optimization mode; When the preset field is used to identify a neighbor relationship optimization mode, the key field is a peer interface MTU; the target protocol message is parsed to obtain a corresponding key field, and the target protocol message is sent to a corresponding other network device after being optimized based on the target interface MTU and the key field, so as to optimize the neighbor relationship between the target network device and the other network device, including: performing interface MTU parsing on the target protocol message to obtain a peer interface MTU; determining whether the target interface MTU is smaller than the peer interface MTU; if the target interface MTU is not smaller than the peer interface MTU, updating the target interface MTU based on the peer interface MTU, saving the updated target interface MTU to a preset storage position of the target network device, and filling the updated target interface MTU into a corresponding field position in the target protocol message; and sending the target protocol message to the corresponding other network device after field identification, so as to establish the neighbor relationship between the target network device and the other network device. When the preset field is used to identify an information synchronization optimization mode, the key field is a target LSP configuration value of the target network device; the target protocol message is parsed to obtain a corresponding key field, and the target protocol message is sent to a corresponding other network device after being optimized based on the target interface MTU and the key field, so as to optimize the neighbor relationship between the target network device and the other network device, including: obtaining the target LSP configuration value from a preset storage position of the target network device based on the target protocol message; determining whether the target interface MTU is smaller than the target LSP configuration value; if the target interface MTU is smaller than the target LSP configuration value, optimizing the target LSP configuration value based on the target interface MTU to obtain an LSP optimization value; performing message length optimization on the target protocol message based on the LSP optimization value, and sending the optimized target protocol message to the corresponding other network device, so as to synchronize link state information.
6. A neighbor relation optimization device, characterized by, The device comprises a memory and a processor, which are communicatively connected to each other, the memory stores computer instructions, and the processor executes the computer instructions to perform the neighbor relationship optimization method in any one of claims 1 to 4.
7. A computer readable storage medium characterized in that, The computer readable storage medium stores computer instructions, and the computer instructions are used to make a computer execute the neighbor relationship optimization method in any one of claims 1 to 4.
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