Message sending method, receiving method, electronic device, system and storage medium

By introducing link state messages with transitional sequence numbers into the link state routing algorithm, the problem of route flapping caused by message aging and refresh during sequence number flipping processing is solved, and a smooth transition of sequence numbers is achieved.

CN113824636BActive Publication Date: 2024-10-15ZTE CORP
View PDF 0 Cites 0 Cited by

Patent Information

Application Number
CN202010559331.4
Authority / Receiving Office
CN · China
Patent Type
Patents(China)
Current Assignee / Owner
Filing Date
2020-06-18
Publication Date
2024-10-15
Estimated Expiration
2040-06-18

AI Technical Summary

Technical Problem

In the link state routing algorithm, the sequence number reversal process may cause packets to continuously age and refresh, causing route flapping.

Method used

By generating a link status message with a transition sequence number, the transition sequence number is newer than the maximum sequence number and older than the initial sequence number, which is used to smooth sequence number transition and avoid route flapping.

Benefits of technology

It effectively solves the routing flapping problem caused by the continuous aging and refreshing of packets during the sequence number reversal process, and ensures smooth transition of link status packet sequence numbers.

✦ Generated by Eureka AI based on patent content.

Smart Images

  • Figure CN113824636B_ABST
    Figure CN113824636B_ABST
Patent Text Reader

Abstract

The present invention discloses a message sending method, receiving method, electronic device, system and storage medium, belonging to the field of communication technology. The method comprises: obtaining the current sequence number of the current link state message; generating a link state message with a transition sequence number according to the current sequence number; the link state message with the transition sequence number is updated than the link state message with the maximum sequence number and older than the link state message with the initial sequence number; and sending out the link state message with the transition sequence number. The technical scheme of the present invention can realize that when the sequence number of the link state message reaches the maximum and the sequence number needs to be flipped, the sequence number can be smoothly transitioned, which can effectively solve the problem that the link state message may be continuously aged and refreshed during the current sequence number flipping process, causing routing oscillation.
Need to check novelty before this filing date? Find Prior Art

Description

Technical Field

[0001] The present invention relates to the field of communication technology, and in particular to a message sending method, a receiving method, an electronic device, a system and a storage medium. Background Art

[0002] In the link state routing algorithm, the local router uses the link state message in the database to construct the SPF (Shortest Path First) tree, and finally calculates the best path to each destination address. The sequence number field is generally used to distinguish between new and old instances of the link state message. The sequence number of the link state message generated for the first time is the initial sequence number. The larger the sequence number, the newer the link state message. In order to ensure robustness, the link state routing algorithm protocol will refresh the link state message regularly. The sequence number of the newly generated link state message will increase by one based on the previous link state message sequence number. When the sequence number reaches the maximum sequence number and an update instance needs to be generated, the next sequence number is the initial sequence number, which is older than the maximum sequence number. Ideally, it is necessary to wait for all the link state messages with the maximum sequence number in the network to age and be deleted before a new link state message with the initial sequence number can be generated.

[0003] In the related art, during the link state message sequence number rollover process, the following two methods are generally used: the first method is to suspend the routing service and wait for a preset time (generally corresponding to the maximum lifetime of the link state message) before generating a new initialization sequence number link state message, but this method has the problem of unavailable routing service during the waiting time; the second method is to age the link state message with the maximum sequence number in advance, but this method may cause routing oscillation problems. Summary of the invention

[0004] The main purpose of the embodiments of the present invention is to propose a message sending method, a receiving method, an electronic device, a system and a storage medium, aiming to achieve a smooth transition of the sequence number when the message sequence number is flipped, and to effectively solve the problem of routing oscillation caused by continuous aging and refreshing of messages in the current sequence number flipping process.

[0005] In the first aspect, to achieve the above-mentioned purpose, an embodiment of the present invention provides a message sending method, which includes the following steps: obtaining a current sequence number of a current link status message; generating a link status message with a transition sequence number based on the current sequence number; the link status message with the transition sequence number is newer than the link status message with the maximum sequence number and older than the link status message with the initial sequence number; and sending the link status message with the transition sequence number.

[0006] In a second aspect, to achieve the above-mentioned purpose, an embodiment of the present invention further proposes a message receiving method, the method comprising the following steps: receiving a link state message with a transition sequence number sent from an external router; the link state message with the transition sequence number is newer than the link state message with the maximum sequence number and older than the link state message with the initial sequence number; and processing the link state message as a link state message that is newer than the link state message with a sequence number within a second preset range.

[0007] In a third aspect, to achieve the above-mentioned purpose, the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following is achieved:

[0008] The message sending method as described in the first aspect;

[0009] or,

[0010] A message receiving method as described in the second aspect.

[0011] In a fourth aspect, to achieve the above-mentioned purpose, an embodiment of the present invention further provides a message sending and receiving system, comprising at least one first electronic device and at least one second electronic device;

[0012] The first electronic device comprises: a first memory, a first processor, and a computer program stored in the first memory and executable on the first processor, wherein the first processor implements the message sending method as described in the first aspect when executing the program;

[0013] Correspondingly, the second electronic device includes: a second memory, a second processor, and a computer program stored in the second memory and executable on the second processor. When the second processor executes the program, the message receiving method described in the second aspect is implemented.

[0014] In a fifth aspect, to achieve the above-mentioned purpose, an embodiment of the present invention further provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to:

[0015] Execute the message sending method described in the first aspect;

[0016] or,

[0017] Execute the message receiving method described in the second aspect.

[0018] The message sending method, receiving method, electronic device, system and storage medium proposed in the present invention obtain the current sequence number of the current link state message, and generate a link state message with a transition sequence number according to the current sequence number, and the link state message with the transition sequence number is updated than the link state message with the maximum sequence number and older than the link state message with the initial sequence number, and then the link state message with the transition sequence number is sent out. The message is updated by setting the transition sequence number when the sequence number reaches the maximum value. In this way, it is possible to determine whether the message sequence number is a transition sequence number message when receiving the message, so as to update the message and flip the message sequence number. It can be seen that the technical solution can realize that when the message sequence number needs to be flipped, the message sequence number can be smoothly transitioned through the transition sequence number message, which can effectively solve the problem of routing oscillation caused by the continuous aging and refreshing of the message during the current sequence number flipping process.

[0019] Other features and advantages of the present application will be described in the following description, and partly become apparent from the description, or understood by practicing the present application. The purpose and other advantages of the present application can be realized and obtained by the structures specifically pointed out in the description, claims and drawings. BRIEF DESCRIPTION OF THE DRAWINGS

[0020] Figure 1 This is a schematic diagram of communication connection of multiple devices according to an embodiment of the present invention;

[0021] Figure 2 It is a flow chart of a message sending method according to an embodiment of the present invention;

[0022] Figure 3 is a schematic diagram of communication connection of multiple devices in another embodiment of the present invention;

[0023] Figure 4 It is a flowchart of a message sending method according to another embodiment of the present invention;

[0024] Figure 5 It is a flowchart of a message sending method according to another embodiment of the present invention;

[0025] Figure 6 A schematic diagram of a message sending method according to another embodiment of the present invention

[0026] Figure 7 It is a flow chart of a message receiving method according to an embodiment of the present invention;

[0027] Figure 8 is a flow chart of a message receiving method according to another embodiment of the present invention;

[0028] Fig. 9It is a flowchart of a message receiving method according to another embodiment of the present invention. DETAILED DESCRIPTION

[0029] It should be understood that the specific embodiments described herein are only used to explain the present invention, and are not used to limit the present invention.

[0030] In the subsequent description, the suffixes such as "module", "component" or "unit" used to represent elements are only used to facilitate the description of the present invention, and have no special meanings. Therefore, "module", "component" or "unit" can be used in a mixed manner.

[0031] The link state routing algorithm is a type of dynamic routing protocol, including but not limited to: OSPF (Open Shortest Path First), ISIS (Intermediate System-to-Intermediate System). In the link state routing algorithm, neighbor devices are discovered by sending and receiving HELLO messages, and then the LSDB (Link State Database) is synchronized between neighbors. After the LSDB synchronization is completed, the local router uses the link state message in the database to construct the SPF (Shortest Path First) tree, and finally calculates the best path to each destination address. The sequence number field is generally used to distinguish between new and old instances of the link state message. The first generated link state message sequence number is the initial sequence number. The larger the sequence number, the newer the link state message. To ensure robustness, the link state routing algorithm protocol will periodically refresh the link state message. The sequence number of the newly generated link state message will be incremented based on the previous link state message sequence number. When the sequence number reaches the maximum sequence number and an updated message needs to be generated, since the next sequence number is the initial sequence number, which is older than the maximum sequence number, ideally, it is necessary to wait for all link state messages with the maximum sequence number in the network to age (that is, the link state message reaches the maximum lifetime) and be deleted before a new link state message with an initial sequence number can be generated.

[0032] In this scenario, the ISIS protocol uses the method of suspending the effectiveness of the work to complete the rollover of the message sequence number, where the suspension duration is the maximum lifetime of the link state message. When the maximum lifetime is reached, the ISIS instance starts to take effect again and generates a new initial sequence number link state message. Obviously, the biggest problem with this method is that the ISIS service is unavailable during the suspension period, which has a huge impact; while the OSPF protocol uses the method of aging the maximum sequence number link state message in advance. When all neighbors receive the aged maximum sequence number link state message and reply to the confirmation message, the initial sequence number link state message begins to be generated. However, because only the confirmation message of the maximum sequence number link state aging message is received from the neighbor, when the initial sequence number link state message is generated and propagated, the maximum sequence number link state message may still exist in the network. According to the existing sequence number comparison rules, the old maximum sequence number link state message is newer than the newly generated initial sequence number link state message, so that the link state message will continue to age and refresh, thereby causing routing oscillation problems.

[0033] like Figure 1As shown, when the link state message sequence number of the OSPF protocol flips, the link state message may be constantly aged and refreshed, causing routing oscillation. The link state message sequence number generated by the current first router R1 is the maximum sequence number. When the first router R1 needs to refresh the link state message, it will age the link state message with the maximum sequence number, and set the age to 3600, that is, set the current lifetime of the link state message to the maximum lifetime, and send it to the second router R2 and the third router R3. The second router R2 and the third router R3 receive the link state message with the maximum sequence number of 3600, and reply a confirmation message to the first router R1. When the first router R1 receives the confirmation messages from the second router R2 and the third router R3, it will delete the link state message with the maximum sequence number of 3600, regenerate the link state message with the initial sequence number and send it to the second router R2 and the third router R3. If the fourth router R4 and the fifth router R5 have not yet sent the confirmation message to the second router R2 and the third router R3, then at this time, the database of the second router R2 and the third router R3 has the link state message with the maximum sequence number of 3600. The second router R2 and the third router R3 receive the link state message with the initial sequence number newly generated by the first router R1. According to the existing rules, the link state message with the maximum sequence number of 3600 is considered to be newer than the link state message with the initial sequence number just generated by the first router R1, and the maximum sequence number message is sent to the first router R1. After the first router R1 deletes the link state message with the maximum sequence number of 3600, it generates the link state message with the initial sequence number again. As long as the maximum serial number link state message of age 3600 has not been aged and deleted from the network, this process will be repeated continuously, and the routers along the way will experience an oscillation process of receiving valid information and then deleting the validity information, that is, the route will continue to oscillate.

[0034] Based on this, the embodiments of the present invention propose a message sending method, a receiving method, an electronic device, a system and a storage medium, which aim to achieve a smooth transition of the sequence number when the message sequence number is flipped, and can effectively solve the problem of routing oscillation caused by continuous aging and refreshing of messages in the current sequence number flipping process.

[0035] It should be noted that in the following various embodiments, the electronic device may be a router, or may be other electronic devices with routing functions. The following description will only be given by taking the electronic device as a router as an example.

[0036] First, as Figure 2 As shown, an embodiment of the present invention provides a message sending method, which is applied to an electronic device with a routing function. The method includes the following steps:

[0037] S1100: Obtain the current sequence number of the current link state message.

[0038] S1200: Generate a link state message with a transition sequence number according to the current sequence number; the link state message with the transition sequence number is newer than the link state message with the maximum sequence number and older than the link state message with the initial sequence number.

[0039] In some embodiments, based on the current sequence number, that is, the current link state message sequence number, it is determined whether the current link state message sequence number is the maximum sequence number; if the current link state message sequence number is the maximum sequence number, a link state message with a transition sequence number is generated. At this time, the link state message with the transition sequence number will be used as a normal link state message for message propagation or update; if the current link state message sequence number is not the maximum sequence number, there is no need to generate a link state message with a transition sequence number, and there is no need to perform sequence number flipping processing. The normal link state message update process is followed, that is, the link state routing algorithm protocol periodically refreshes the link state message, and the newly generated link state message sequence number will be incremented based on the previous link state message sequence number.

[0040] Among them, the transition sequence number is set so that the maximum sequence number and the minimum sequence number of the message can be connected. Specifically, the link state message of the transition sequence number is a link state message that is newer than the link state message of the maximum sequence number and older than the link state message of the initial sequence number, that is, when the link state routing algorithm protocol periodically refreshes the link state message, the newly generated link state message sequence number will increase based on the previous link state message sequence number. For example, when the message sequence number is 3500, it reaches the maximum, and it is necessary to generate a new sequence number message starting from the initial sequence number 1. By setting the transition sequence number in advance, it is defined that the transition sequence number is newer than the maximum sequence number 3500 and older than the minimum sequence number. When the message is updated, the next update of the maximum sequence number 3500 is a transition sequence number message instance, and when it is updated again, an initial sequence number with a sequence number of 1 will be generated. For example, the corresponding transition sequence numbers in the OSPF protocol and the ISIS protocol can be set to 0X80000000 and 0 respectively.

[0041] S1300: Send out the link state message of the transition sequence number.

[0042] In some embodiments, if the current link state message sequence number is the maximum sequence number, a link state message with a transition sequence number is generated, stored in a database, and flooded.

[0043] The following takes the case where a link state message sequence number reaches the maximum sequence number and needs to be flipped as an example to specifically illustrate the practical application of the message sending method according to the embodiment of the present invention.

[0044] like Figure 3 As shown, the four devices in the network are the first router R1, the second router R2, the fourth router R4, and the sixth router R6. The devices can be router devices. Taking the link state message as an OSPF message as an example, OSPF uses LSA (Link-State Advertisement) to describe the network topology. In OSPF, the router stores all received LSAs in a database, which is called LSDB (Link State Database). Each link state message contains: router ID, the OSPF router ID that generates the message; sequence number, the sequence number field is used to distinguish the old and new instances of the link state message, that is, multiple link state messages of the same router device. The first generated link state message sequence number is the initial sequence number. The larger the sequence number, the newer the link state message. When a new instance is generated, the message sequence number will increase. When the router receives multiple instances of the same LSA, the sequence number is used to help the router identify the latest instance; the survival time, which indicates the time from the generation of the LSA to the present in seconds. The maximum lifetime of an LSA is 3600 seconds; the refresh time is 1800 seconds. If an LSA reaches 3600 seconds, it must be cleared from the LSDB. Generally, an LSA that remains in the LSDB for more than 1800 seconds is considered abnormal.

[0045] First, the link state message sequence number of the first router R1 is obtained. When the link state message sequence number of the first router R1 reaches the maximum value and a new flip link state message needs to be generated, due to network reasons, the situations in which the link state message instances of the first router R1 exist in various devices in the current network are as follows: the second router R2 replies to the first router R1 with a link state message confirmation message with a maximum sequence number of 3600, and the second router R2 successfully sends the link state message with a maximum sequence number of 3600 to the fourth router R4, but the second router R2 has not received the confirmation message from the fourth router R4, and the fourth router R4 has not sent the link state message with a maximum sequence number of 3600 to the sixth router R6.

[0046] The first router R1 then generates a link state message with a sequence number of the transition sequence number. The second router R2 receives the link state message with the transition sequence number, stores it in the database, and sends the message to the fourth router R4. The fourth router R4 receives the link state message with the transition sequence number, and determines that the instance sequence number of the link state message of the local first router R1 is less than the transition sequence number, so it considers that the link state message with the transition sequence number is updated, stores it in the local database, and sends the link state message with the transition sequence number to the sixth router R6.

[0047] Similarly, the sixth router R6 determines that the link state message instance sequence number of the local first router R1 is less than the transition sequence number, so it considers that the link state message with the transition sequence number is updated and stores it in the local database. So far, the databases of all routers have stored the link state message instance with the transition sequence number of the first router R1, and the link state message interaction process does not cause the link state message to continuously age and thus cause routing oscillation.

[0048] It can be seen that the embodiment of the present invention allows the message sequence number to smoothly transition by sending the transition sequence number message, which can effectively solve the problem of routing oscillation caused by continuous aging and refreshing of messages in the current sequence number rollover processing process.

[0049] Since it takes a long time for a dynamic link state message to reach the maximum sequence number, when the sequence number reaches the maximum sequence number and a new link state message needs to be generated from the initial sequence number, the router does not need the transition sequence number capability, that is, it only needs to follow the normal sequence number update process before the sequence number is flipped. Therefore, the transition sequence number capability of the router can be turned on or off by setting the transition sequence number capability switch.

[0050] In some embodiments, the message sending method of the embodiment of the present invention further includes the following steps:

[0051] S1400: Obtain the status of the transition sequence number capability switch;

[0052] In some embodiments, the state of the transition sequence number capability switch includes on and off. When the transition sequence number capability switch is on, it means that the device starts to support the generation and processing of transition sequence number link state messages. The transition sequence number capability switch can be set on a router device. When the state of the transition sequence number capability switch is set to on, it means that the router device starts to support the generation and processing of transition sequence number link state messages. When the transition sequence number capability switch is not turned on, the transition sequence number is a reserved sequence number and cannot be used as a normal sequence number. When a transition sequence number link state message is received, it is generally discarded.

[0053] S1410: If the state of the transition sequence number capability switch is off, turn on the transition sequence number capability switch;

[0054] In some embodiments, after turning on the transition sequence number capability switch, the current sequence number of the current link state message is obtained; based on the current sequence number and the state of the transition sequence number capability switch, a link state message with a transition sequence number is generated, and then the link state message with the transition sequence number is sent out.

[0055] During the period from the initial sequence number to the maximum sequence number, that is, before the sequence number is rolled over, the router device only needs to follow the normal sequence number update process and does not need the transition sequence number capability. By setting the transition sequence number capability switch, program computing resources can be saved.

[0056] The transition sequence number capability switch can be turned on by manually setting the transition sequence number switch parameters, or can be turned on automatically through program settings. In some embodiments, by obtaining the current sequence number of the current link state message, if the current sequence number is within a first preset range, the transition sequence number capability switch is turned on, that is, after the link state message sequence number of the current router device reaches the first preset range, the transition sequence number capability switch is turned on, and the router device begins to support processing the transition sequence number link state message.

[0057] In some embodiments, it is necessary to consider the processing of the self-generated transition sequence number link state message by the current router device, and it is also necessary to consider the processing of the received transition sequence number link state message by the current router device. For example, the current link state message sequence number of a router device in the network reaches the first preset range first, and the transition sequence number capability switch is turned on first, but the message sequence numbers of other router devices in the network have not reached the first preset range, and the transition sequence number capability is not turned on. At this time, other router devices cannot process the received transition sequence number link state message, so it is necessary to judge that the current sequence number of the link state message with the largest sequence number in the local database reaches the first preset range, and turn on the transition sequence number capability switch; so that all devices in the network can simultaneously support the processing of the transition sequence number link state message, and complete the link state message flip processing flow.

[0058] In some embodiments, turning on the transition sequence number capability switch by determining the current sequence number of the link state message with the largest sequence number in the local database includes the following steps:

[0059] The current sequence number of the link state message with the largest sequence number in the local database is obtained, and if the current sequence number is within the first preset range, the transition sequence number capability switch is turned on. In some embodiments, by obtaining the current sequence number of the link state message with the largest sequence number in the current database, and if the current sequence number is within the first preset range, the transition sequence number capability switch is turned on, and the transition sequence number capability switch can be turned on by judging that the maximum sequence number of the link state message in the local database reaches the first preset range, so that the router device starts to support processing the received transition sequence number link state message.

[0060] In some embodiments, the first preset range is a value between a preset intermediate sequence number and a maximum sequence number. The preset intermediate sequence number can be a first preset ratio*maximum sequence number, for example, when the first preset ratio is 90%, the first preset range is: [maximum sequence number*90%, maximum sequence number], that is, when the current message sequence number is within the range of [maximum sequence number*90%, maximum sequence number], the transition sequence number capability switch is turned on.

[0061] The preset intermediate sequence number can also be set to a fixed value according to the empirical value. For example, the preset intermediate sequence number is set to a value 1000 less than the maximum sequence number, that is, when the current message sequence number is within the range of [maximum sequence number - 1000, maximum sequence number], the transition sequence number capability switch can be turned on to perform sequence number flipping processing. By judging whether the current sequence number is within the first preset range to set the state of the transition sequence number capability switch, the work of manually monitoring sequence number changes is eliminated, which is more efficient. By setting the transition sequence number capability switch to open automatically, it is avoided that when the transition sequence number capability switch is always in the open state, the transition sequence number judgment processing needs to be performed on all link state messages, thereby saving device program computing resources. .

[0062] In some embodiments, if the transition sequence number capability switches of all network devices are not turned on at the same time, errors in the generation and processing of transition sequence number capabilities may occur. For example, if the transition sequence number capability switch is set manually, there will be a delay in turning on the transition sequence number capability switch of each router in the network, or when the transition sequence number capability switch is automatically turned on, the delay or failure in turning on the transition sequence number capability due to network reasons may cause that the transition sequence number capability switches of all network devices are not turned on at the same time, which may cause errors in the generation and processing of transition sequence number capabilities. Therefore, in some embodiments, the message sending method proposed in the embodiments of the present invention, such as Figure 4 As shown, it also includes:

[0063] S1400: Obtain the status of the transition sequence number capability switch;

[0064] S1410: Turn on the transition sequence number capability switch;

[0065] S1411: Update the local information of devices in the entire network that do not support the transitional sequence number capability according to the status of the transitional sequence number capability switch;

[0066] In some embodiments, updating local network-wide information of devices that do not support transitional sequence number capabilities according to the state of the transitional sequence number capability switch includes: determining whether the device is in the network-wide information of devices that do not support transitional sequence number capabilities;

[0067] If the device is in the list of devices that do not support the transitional serial number capability in the entire network, the record of this device will be deleted from the information of devices that do not support the transitional serial number capability in the entire network, and a notification message of supporting the transitional serial number capability will be sent out; if the device is not in the information of devices that do not support the transitional serial number capability in the entire network, a notification message of supporting the transitional serial number capability will be sent out.

[0068] In some specific embodiments, the capability notification message for supporting transition sequence numbers may use a separate capability announcement message, or may reuse the option flag in the existing link state message (i.e., use the flag in the link state message to send the capability notification message information for supporting transition sequence numbers), and the corresponding capability notification message for not supporting transition sequence numbers is respectively set with an aging or cancellation flag of the capability announcement message; for the method of using a separate capability announcement message, OSPF can use the capability announcement message, and ISIS can use the TLV field in the PDU message to implement it.

[0069] In some specific embodiments, it is set on the router device that all devices in the entire network support the transition sequence number capability, and the information of devices in the entire network that do not support the transition sequence number capability is a list. It is determined whether the record in the list of devices in the entire network that do not support the transition sequence number capability is empty. If it is empty, the setting of all devices in the entire network supporting the transition sequence number capability is TRUE. If it is not empty, no processing is performed.

[0070] S1412: flood the state of the transitional sequence number capability switch so that other devices can update the corresponding device's information on the entire network that does not support the transitional sequence number capability according to the state of the transitional sequence number capability switch;

[0071] In some specific embodiments, other devices update the corresponding device's network-wide information of devices that do not support the transitional sequence number capability according to the transitional sequence number switch state, including:

[0072] Receiving a notification message of supporting transition sequence number capability sent by other devices;

[0073] If the received message is a notification message of supporting transitional serial number capability and the device is in the list of devices that do not support transitional serial number capability in the entire network, delete the record of this device from the list of devices that do not support transitional serial number capability in the entire network; if the device is not in the list of devices that do not support transitional serial number capability in the entire network, no processing is performed;

[0074] If the received message is a notification message indicating that the transitional sequence number capability is not supported, determine whether all network devices support the transitional sequence number capability and whether it is TRUE:

[0075] If the value of the capability that all network devices support transition sequence number is TRUE, add the message sender to the information of devices that do not support transition sequence number capability, and the value of the capability that all network devices support transition sequence number is FALSE;

[0076] If the value of "all network devices support transition sequence number capability" is FALSE, the message sender is added to the information of devices that do not support transition sequence number capability.

[0077] S1413: Generate a link state message with a transition sequence number according to the current sequence number and information about devices in the entire network that do not support the transition sequence number capability.

[0078] In some embodiments, the information on devices in the entire network that do not support the transition sequence number capability can be an information list, which records the device information in the entire network that does not support the transition sequence number capability, that is, the device information in the entire network that the transition sequence number capability is turned off. By sending and receiving transition sequence number messages, the information on devices in the entire network that do not support the transition sequence number is updated, and the status of supporting the transition sequence number capability of all devices in the entire network can be synchronously confirmed. When the status of supporting the transition sequence number capability of all devices in the entire network is turned on, the entire network can process the transition sequence number messages normally.

[0079] In some embodiments, when the state of the device transition sequence number capability switch is turned off, the method for processing the transition sequence number link state message includes the following steps:

[0080] Get the status of the transition sequence number capability switch;

[0081] If the state of the transition sequence number capability switch is off and the current sequence number of the current link state message is the maximum sequence number, a link state message with an initial sequence number is generated.

[0082] In some embodiments, when the state of the device transition sequence number capability switch is turned off and the current link state message sequence number is the maximum sequence number, the normal flip processing process is followed to generate a link state message with an initialized sequence number, which is stored in the database and flooded out to ensure the accuracy of the device (router) in processing the message.

[0083] In some embodiments, when the transition sequence number capability switch is turned off, the information of devices that do not support the transition sequence number capability in the entire network is updated, such as Figure 5 As shown, including:

[0084] S1420: turn off the transition sequence number capability switch;

[0085] S1421: Update the local network-wide device information that does not support the transitional sequence number capability according to the status of the transitional sequence number capability switch;

[0086] In some embodiments, when the state of the transition serial number capability switch of the device is off, the support of the transition serial number capability of all devices in the entire network is set to FALSE, and it is determined whether the information of the device exists in the device information of the entire network that does not support the transition serial number capability. If not, the information of the device is added to the device information that does not support the transition serial number capability.

[0087] S1422: Flood the state of the transitional sequence number capability switch so that other devices can update the corresponding device's information on devices that do not support the transitional sequence number capability in the entire network according to the state of the transitional sequence number capability switch.

[0088] In some embodiments, flooding the status of the transition sequence number capability switch is to send out a notification message that does not support the transition sequence number capability, so that other devices update the corresponding device's network-wide information on devices that do not support the transition sequence number capability according to the status of the transition sequence number capability switch. Specifically, the corresponding device distinguishes whether it is a link status message of the device based on the router ID.

[0089] By sending a notification message of not supporting the transitional sequence number capability, other devices can synchronously update the corresponding device's information of not supporting the transitional sequence number capability in the entire network, making the status of supporting the transitional sequence number capability in the entire network more accurate.

[0090] When the device no longer needs to enable the transitional serial number capability, you can disable the transitional serial number capability. Disabling the transitional serial number capability includes the following steps:

[0091] Turn off the transitional serial number capability switch, set the transitional serial number capability of all network devices to FALSE, and add the device to the information of devices that do not support the transitional serial number capability;

[0092] Sending a notification message that the transition sequence number capability is not supported;

[0093] If the whole network does not support the transition sequence number capability and the device information is not empty, and the current sequence number of the current link state message is the maximum sequence number, a link state message with an initial sequence number is generated.

[0094] In some embodiments, if the device information that does not support the transition sequence number capability of the entire network is not empty, and the current sequence number of the current link state message is the maximum sequence number, it means that the sequence number of the link state message has reached the maximum when the transition sequence number capability is not supported and the sequence number needs to be flipped. In this case, the normal process of the sequence number flipping processing is performed to generate a link state message with an initial sequence number, which is stored in the database and flooded out.

[0095] In some embodiments, Figure 6 As shown, the message sending method also includes:

[0096] S1600: Continue to obtain the current sequence number of the current link state message;

[0097] S1610: If the current sequence number is a transitional sequence number, generate a link state message with an initial sequence number;

[0098] In some embodiments, if there is a link state message with a sequence number that is a transition sequence number and the link state message is a self-generated link state message, an initial sequence number link state message is updated and stored in a database; if there is a link state message with a sequence number that is a transition sequence number but the link state message is not a self-generated link state message, the link state message with a sequence number that is a transition sequence number is aged and flooded out.

[0099] S1620: Send out the link state message with the initial sequence number.

[0100] In some embodiments, when the device supports generating and sending transition sequence number messages, the transition sequence number messages can be processed as normal messages. When the transition sequence number message needs to be updated like a normal message or its lifetime expires, the device will continue to generate a link state message with an initial sequence number as an updated message instance of the transition sequence number message, and use the link state message with the initial sequence number to update and send the message, thereby completing the message sequence number flipping processing.

[0101] Second aspect

[0102] like Figure 7 As shown, an embodiment of the present invention provides a method for receiving a message, the method comprising the following steps:

[0103] S2100: receiving a link state message with a transition sequence number sent from an external router;

[0104] In some embodiments, when a device receives a link status message, it determines whether the link status message sequence number is a transition sequence number. If the link status message sequence number is not a transition sequence number, the existing link status message receiving process is followed.

[0105] The link state message of the transition sequence number is a link state message that is newer than the link state message of the maximum sequence number and older than the link state message of the initial sequence number;

[0106] S2200: Process the link state message as a link state message that is newer than a link state message with a sequence number in a second preset range.

[0107] In some embodiments, if the link state message sequence number is a transition sequence number, determining whether a corresponding link state message instance exists in the local database;

[0108] If the local database has a corresponding link state message instance, and the local link state message instance sequence number falls within the preset sequence number range, that is, the local link state message instance sequence number is older than the received link state message sequence number, it means that the transition sequence number link state message is updated, and the received transition sequence number link state message is considered to be the latest link state message;

[0109] If the corresponding link state message instance does not exist in the local database, the link state message of the transition sequence number is updated, and the received updated link state message processing flow is followed;

[0110] It can be seen that the embodiment of the present invention receives the transition sequence number message and processes the link status message as a link status message that is newer than the link status message with the second preset range sequence number, so that the message sequence number can be smoothly transitioned, which can effectively solve the problem of routing oscillation caused by continuous aging and refreshing of messages in the current sequence number flipping process.

[0111] In some embodiments, the link state message is processed as a link state message that is newer than a link state message with a sequence number in a second preset range, such as Figure 8 As shown, including the following:

[0112] S2201: Calculate the transition sequence number comparison error value;

[0113] In some embodiments, due to network transmission reasons, there may be multiple different instances of a link state message in the network. In the worst case, there may be multiple instances of the maximum network diameter. To solve this problem, the embodiment of the present invention introduces a transition sequence number comparison error value, which can be a network diameter, denoted as Dmax, and can be calculated by the Shortest Path First (SPF) algorithm.

[0114] In some embodiments, the calculation process of the transition sequence number comparison error value is as follows: initialize the whole network diameter Dmax to 0, start traversing all regions / levels of the device instance, run the SPF calculation algorithm in each region / level, wherein all link cost values ​​are assumed to be 1 during the calculation process, and finally construct a regional shortest path tree, calculate the maximum distance from the root node to the leaf node as Hmax, and finally Dmax takes the maximum Hmax value among all regions / levels. For example, Figure 3As shown, taking the network including four devices (the first router R1, the second router R2, the fourth router R4, and the sixth router R6) as an example, the four devices in the network are connected in communication in sequence, and the four devices all turn on the transition sequence number capability function and send out a notification message supporting the transition sequence number capability. Among them, the network diameters Dmax of the shortest path trees calculated by the first router R1, the second router R2, the fourth router R4, and the sixth router R6 are 3, 2, 2, and 3 respectively. In some embodiments, the transition sequence number comparison error value can be set to the full network diameter Dmax by static configuration, which can reduce the complexity of dynamic calculation.

[0115] S2202: Compare the error value according to the transition sequence number to obtain a second preset range;

[0116] In some embodiments, the second preset range obtained according to the transition sequence number comparison error value is [maximum sequence number-transition sequence number comparison error value+1, maximum sequence number]. In some embodiments, due to network delay or other network transmission reasons, there may be multiple different instances of a link state message in the network, which are often related to the network diameter Dmax. Therefore, the second preset range can be calculated based on the full network diameter Dmax. For example, if the transition sequence number comparison error value is set to the network diameter Dmax, the second preset range is [maximum sequence number-Dmax+1, maximum sequence number]. Exemplary, Figure 3As shown, taking the network including four devices (the first router R1, the second router R2, the fourth router R4, and the sixth router R6) as an example, the four devices in the network are connected in sequence, and the four devices all enable the transition sequence number capability function and send out a notification message supporting the transition sequence number capability. Among them, the network diameters Dmax of the shortest path trees calculated by the first router R1, the second router R2, the fourth router R4, and the sixth router R6 are 3, 2, 2, and 3 respectively. Then the second preset range in the first router R1 is: [maximum sequence number -Dmax+1, maximum sequence number] = [maximum sequence number -3+1, maximum sequence number] = [maximum sequence number -2, maximum sequence number]; the second preset range in the second router R2 is: [maximum sequence number -Dmax+1, maximum sequence number] = [maximum sequence number -2+1, maximum sequence number] = [maximum sequence number -1, maximum sequence number]; the second preset range in the third router R3 is: [maximum sequence number -Dmax+1, maximum sequence number] = [maximum sequence number -2+1, maximum sequence number] = [maximum sequence number -1, maximum sequence number]; the second preset range in the fourth router R4 is: [maximum sequence number -Dmax+1, maximum sequence number] = [maximum sequence number -3+1, maximum sequence number] = [maximum sequence number -2, maximum sequence number]. The second preset range calculated by comparing the error value between the maximum sequence number and the transition sequence number can solve the problem that there may be multiple different instances of a link status message in the network due to network delay or network transmission reasons, so that the device can process the link status message within the second preset range in a timely manner according to the transition sequence number capability, thereby ensuring the smooth flipping of the link status message sequence number.

[0117] Determine whether the corresponding link status message instance exists in the local database. If so:

[0118] It is then determined whether the current sequence number of the current link state message stored in the local database is within the second preset range. If it is within the second preset range, step S2203 is executed; otherwise, step S2204 is executed.

[0119] S2203: The link state message with the transition sequence number is an updated link state message, and the received updated link state message processing flow is followed.

[0120] In some specific embodiments, if the local link state message instance sequence number is within the range of [maximum sequence number - Dmax + 1, maximum sequence number], the transition sequence number link state message is an updated link state message, and the received updated link state message processing flow is followed;

[0121] S2204: The link state message with the transition sequence number is an older link state message, and the process of receiving an older link state message is performed.

[0122] In some specific embodiments, if the local link state message instance sequence number is not within the range of [maximum sequence number - Dmax + 1, maximum sequence number], the link state message with the transition sequence number is an older link state message, and the processing flow of receiving an older link state message is followed. That is, the lifetime of the transition sequence number has not yet arrived, but a new sequence number that increases from the initial sequence number has been generated. At this time, the transition sequence number is an older message sequence number, and the device will use the link state message with the new sequence number to send and update information.

[0123] If the corresponding link state message instance does not exist in the local database, the link state message with the transition sequence number is updated, and the link state message processing flow of receiving the updated link state message is followed.

[0124] In some embodiments, a device receives a message indicating that it supports transitional sequence number capability, and processes the message, including the following steps:

[0125] Receive the state of the transition sequence number capability switch;

[0126] In some embodiments, when receiving a notification message of supporting transition sequence number capability from a neighbor device, it is determined whether the message notifier is in the device information of not supporting transition sequence number capability:

[0127] If the message notifier is in the device information that does not support the transition sequence number capability, in some specific embodiments, the device information that does not support the transition sequence number capability is a list, the message notifier is deleted from the device list that does not support the transition sequence number capability, and it is further determined whether the device list that does not support the transition sequence number capability is empty. If the device list that does not support the transition sequence number capability is empty, the device support for the transition sequence number capability of all network devices is set to TRUE; if the device list that does not support the transition sequence number capability is not empty, no processing is performed;

[0128] If the message notifier is not in the list of devices that do not support the transition sequence number capability, no processing is performed.

[0129] The link state message is processed as a link state message newer than a link state message with a sequence number in a second preset range according to the state of the transition sequence number capability switch.

[0130] In some embodiments, when a device receives a link state message, it determines whether the link state message sequence number is a transition sequence number:

[0131] If the link state message sequence number is not a transition sequence number, the existing link state message receiving process is followed;

[0132] If the link status message sequence number is a transition sequence number, further determine whether all network devices support the transition sequence number capability, which is TRUE: If all network devices support the transition sequence number capability, which is TRUE, further determine whether there is a corresponding link status message instance in the local database:

[0133] If the local database has a corresponding link state message instance, and the local link state message instance sequence number is within the range of [maximum sequence number - Dmax + 1, maximum sequence number], the link state message with the transition sequence number is an updated link state message, and the updated link state message receiving process is performed; if the local database has a corresponding link state message instance, but the local link state message instance sequence number is not within the range of [maximum sequence number - Dmax + 1, maximum sequence number], the link state message is an older link state message, and the older link state message receiving process is performed;

[0134] If the corresponding link state message instance does not exist in the local database, the link state message with the transition sequence number is an updated link state message, and the received updated link state message processing flow is followed;

[0135] If all network devices support the transition sequence number capability and the capability is FALSE, a confirmation message is replied and the transition sequence number link status message is discarded.

[0136] In some specific embodiments, when a notification message of not supporting the transitional sequence number capability is received, a link state message with a transitional sequence number is generated according to the current sequence number and information of devices in the entire network that do not support the transitional sequence number capability, such as Figure 8 As shown, including the following:

[0137] S2310: receiving a notification message indicating that the transition sequence number capability is not supported;

[0138] Determine whether all network devices support the transition sequence number capability, which is TRUE. If all network devices support the transition sequence number capability, which is TRUE, execute step S2320; otherwise, execute step S2360.

[0139] S2320: Add the message sender to the list of devices that do not support the transition sequence number capability, and set the transition sequence number capability supported by all devices in the network to FALSE;

[0140] Determine whether there is a link state message with a sequence number being a transition sequence number in the local database. If there is a link state message with a sequence number being a transition sequence number in the local database;

[0141] Determine whether the link status message is a self-generated link status message, that is, a link status message generated by the router device. If the link status message is a self-generated link status message, execute step S2330; otherwise, execute step S2350.

[0142] S2330: Generate a link state message with an initial sequence number, store it in a database, and flood it out;

[0143] Determine whether this device is a border router. If this device is a border router, execute step S2340.

[0144] S2340: The generation of transition sequence numbers to other connection areas does not support notification messages.

[0145] In some embodiments, a border router is a router located on the border of one or more OSPF areas and connecting these areas to the backbone network, that is, the border router is considered to be a member device of both the OSPF backbone and the connected areas. The border router simultaneously maintains routing information tables that describe the backbone topology and the topology of other areas. Therefore, when this device is a border router, it is necessary to send transition sequence number capability notification messages to other connected areas so that other connected areas update their routing information tables to simultaneously support processing transition sequence number messages.

[0146] If this device is not a border router, it will not generate transition sequence number non-support notification messages to other connected areas.

[0147] If the local database contains a link state message with a transition sequence number, but the link state message is not a self-generated link state message:

[0148] S2350: Aging and flooding the link state message with the sequence number being the transition sequence number;

[0149] If the local database does not contain a link state message with a sequence number that is a transition sequence number, no processing is performed.

[0150] S2360: Add the message notifier to the list of devices that do not support the transition sequence number capability.

[0151] By receiving the transition sequence number capability notification message, when the router receives the transition sequence number capability support notification message, it synchronously updates the information of the device that does not support the transition sequence number, and sets whether the whole network device supports the transition sequence number capability to TRUE, so that the whole network supports the transition sequence number capability status more accurately and processes the transition sequence number link status message more effectively; when the router receives the transition sequence number capability support notification message, it synchronously updates the information of the device that does not support the transition sequence number, and sets the whole network device supports the transition sequence number capability to FALSE. If the sequence number of the currently received message is the transition sequence number, the message will be aged and flooded out, so that the message update is more accurate.

[0152] In a third aspect, an embodiment of the present invention provides a method for sending and receiving a message, including:

[0153] The message sending method as described in the first aspect;

[0154] and,

[0155] A message receiving method as described in the second aspect.

[0156] In some embodiments, a message sending and receiving method includes: a message sending method as described in steps S1100 to S1300 in the first aspect embodiment; and a message receiving method as described in steps S2100 to S2200 in the second aspect embodiment.

[0157] In a fourth aspect, an embodiment of the present invention provides an electronic device, comprising: a memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program:

[0158] The message sending method as described in the first aspect of the embodiment of the present invention;

[0159] or,

[0160] A message receiving method as described in the second aspect of an embodiment of the present invention.

[0161] In some embodiments, the electronic device may be a router or other electronic device with routing function.

[0162] In a fifth aspect, an embodiment of the present invention provides a message sending and receiving system, comprising at least one first electronic device and at least one second electronic device;

[0163] The first electronic device comprises: a first memory, a first processor, and a computer program stored in the first memory and executable on the first processor, wherein the first processor implements the message sending method as described in the first aspect of the embodiment when executing the program;

[0164] Correspondingly, the second electronic device includes: a second memory, a second processor, and a computer program stored in the second memory and executable on the second processor. When the second processor executes the program, the message receiving method described in the second aspect is implemented.

[0165] In some embodiments, an example is used to illustrate the overall processing of the present invention. Figure 3 As shown, the four devices in the network all have the transition sequence number capability function enabled and send out transition sequence number capability notification messages. The network diameters Dmax of the shortest path trees calculated by the first router R1, the second router R2, the fourth router R4, and the sixth router R6 are 3, 2, 2, and 3, respectively.

[0166] When the first router R1 needs to generate a new flip link state message, due to network reasons, the situations in which the link state message instances of the first router R1 exist in various devices in the current network are as follows: the second router R2 replies to the first router R1 with a maximum sequence number link state message confirmation message with an age of 3600, and the second router R2 successfully sends the maximum sequence number link state message with an age of 3600 to the fourth router R4, and the fourth router R4 has not yet sent the maximum sequence number link state message with an age of 3600 to R6.

[0167] The first router R1 then generates a link state message with a sequence number of the transition sequence number. The second router R2 receives the link state message with the transition sequence number, stores it in the database, and sends the message to the fourth router R4. The fourth router R4 receives the link state message with the transition sequence number, and determines that the instance sequence number of the link state message of the local first router R1 is within the range of [maximum sequence number - 1, maximum sequence number] (i.e., [maximum sequence number - Dmax + 1, maximum sequence number] = [maximum sequence number - 2 + 1, maximum sequence number]), so it considers that the link state message with the transition sequence number is updated, stores it in the local database, and sends the link state message with the transition sequence number to the sixth router R6.

[0168] Similarly, the sixth router R6 determines that the link state message instance sequence number of the local first router R1 is within the range of [maximum sequence number -3+1, maximum sequence number], so it considers that the transition sequence number link state message is updated and stores it in the local database. So far, the databases of all routers have stored the transition sequence number link state message instance of the first router R1, and the link state message interaction process does not produce the problem of continuous aging and routing oscillation as described above.

[0169] In a sixth aspect, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions, wherein the computer-executable instructions are used to:

[0170] Execute the message sending method described in the first aspect of the embodiment;

[0171] or,

[0172] Execute the message receiving method described in the second aspect of the embodiment.

[0173] In some embodiments, an embodiment of the present invention provides a computer-readable storage medium storing computer-executable instructions for:

[0174] Execute the message sending method as described in steps S1100 to S1300 in the embodiment of the first aspect; or, execute the message receiving method as described in steps S2100 to S2200 in the embodiment of the second aspect.

[0175] The message sending method, receiving method, electronic device, system and storage medium proposed in the embodiments of the present invention generate a link state message with a transition sequence number according to the current sequence number of the current link state message, and the link state message with the transition sequence number is newer than the link state message with the maximum sequence number and older than the link state message with the initial sequence number. In this way, when the sequence number of the link state message reaches the maximum and the sequence number needs to be flipped, the old and new sequence numbers can be updated through the link state message with the transition sequence number. It can be seen that the link state message processing method provided by the technical solution allows the sequence number to be smoothly transitioned, which can effectively solve the problem of routing oscillation caused by the continuous aging and refreshing of the link state message in the current sequence number flipping process.

[0176] Those skilled in the art will appreciate that all or some of the steps in the methods disclosed above, and the functional modules / units in the systems and devices may be implemented as software, firmware, hardware, or a suitable combination thereof.

[0177] In hardware implementation, the division between the functional modules / units mentioned in the above description does not necessarily correspond to the division of physical components; for example, a physical component may have multiple functions, or a function or step may be performed by several physical components in cooperation. Some physical components or all physical components may be implemented as software executed by a processor, such as a central processing unit, a digital signal processor or a microprocessor, or implemented as hardware, or implemented as an integrated circuit, such as an application-specific integrated circuit. Such software may be distributed on a computer-readable medium, which may include a computer storage medium (or non-transitory medium) and a communication medium (or temporary medium). As known to those of ordinary skill in the art, the term computer storage medium includes volatile and non-volatile, removable and non-removable media implemented in any method or technology for storing information (such as computer-readable instructions, data structures, program modules or other data). Computer storage media include, but are not limited to, RAM, ROM, EEPROM, flash memory or other memory technology, CD-ROM, digital versatile disk (DVD) or other optical disk storage, magnetic cassettes, magnetic tapes, disk storage or other magnetic storage devices, or any other medium that can be used to store desired information and can be accessed by a computer. Furthermore, it is well known to those skilled in the art that communication media typically embodies computer readable instructions, data structures, program modules, or other data in a modulated data signal such as a carrier wave or other transport mechanism, and may include any information delivery media.

[0178] The preferred embodiments of the present invention are described above with reference to the accompanying drawings, but the scope of the present invention is not limited thereby. Any modification, equivalent substitution and improvement made by those skilled in the art without departing from the scope and essence of the present invention shall be within the scope of the present invention.

Claims

1. A message sending method, including: Get the current sequence number of the current link state message; When the current sequence number is the maximum sequence number, generating a link state message with a transition sequence number; The link state message of the transition sequence number is a link state message that is newer than the link state message of the maximum sequence number and older than the link state message of the initial sequence number; The link state message of the transition sequence number is sent out.

2. The message sending method according to claim 1, characterized in that: Also includes: Turn on the transition sequence number capability switch; The step of generating a link state message with a transition sequence number according to the current sequence number includes: A link state message with a transition sequence number is generated according to the current sequence number and the state of the transition sequence number capability switch.

3. The message sending method according to claim 2, characterized in that: The step of turning on the transition sequence number capability switch includes: Obtaining a current sequence number of the current link state message, and if the current sequence number is within a first preset range, turning on a transition sequence number capability switch, wherein the first preset range is a value between a preset intermediate sequence number and a maximum sequence number; or, The current sequence number of the link state message with the largest sequence number in the local database is obtained, and if the current sequence number is within a first preset range, a transition sequence number capability switch is turned on.

4. The message sending method according to claim 2, characterized in that: After the transition sequence number capability switch is turned on, the method further includes: Update the local information of devices in the entire network that do not support the transitional sequence number capability according to the status of the transitional sequence number capability switch; Flooding the state of the transitional sequence number capability switch so that other devices update the corresponding device's network-wide information on devices that do not support the transitional sequence number capability according to the state of the transitional sequence number capability switch; The generating of a link status message with a transition sequence number according to the current sequence number and the state of the transition sequence number capability switch includes: generating a link status message with a transition sequence number according to the current sequence number and information of devices in the entire network that do not support the transition sequence number capability.

5. The message sending method according to claim 2, characterized in that: Also includes: Get the status of the transition sequence number capability switch; If the state of the transition sequence number capability switch is off, and the current sequence number of the current link state message is the maximum sequence number, a link state message with an initial sequence number is generated.

6. The message sending method according to claim 4, characterized in that: Also includes: Turn off the transition sequence number capability switch; Update the local information of devices in the entire network that do not support the transitional sequence number capability according to the status of the transitional sequence number capability switch; The state of the transitional sequence number capability switch is flooded so that other devices update the network-wide device information that does not support the transitional sequence number capability of the corresponding device according to the state of the transitional sequence number capability switch.

7. The message sending method according to claim 6, characterized in that: Also includes: Get the information of devices in the whole network that do not support the transition serial number capability; If the device information of the whole network not supporting the transition sequence number capability is not empty, and the current sequence number of the current link state message is the maximum sequence number, a link state message with an initial sequence number is generated.

8. The message sending method according to any one of claims 1 to 7, characterized in that: Also includes: Continue to obtain the current sequence number of the current link state message; If the current sequence number is a transitional sequence number, generating a link state message with an initial sequence number; Send out the link state message of the initial sequence number.

9. A message receiving method, comprising: Receive a link state message with a transition sequence number sent from an external router; The link state message of the transition sequence number is a link state message that is newer than the link state message of the maximum sequence number and older than the link state message of the initial sequence number; Construct a shortest path tree in each region or level, calculate the maximum distance from the root node to the leaf node as Hmax according to the shortest path tree, and take the largest Hmax value in all regions or levels as the transition sequence number comparison error value; According to the transition sequence number comparison error value, the second preset range is obtained as [maximum sequence number - transition sequence number comparison error value + 1, maximum sequence number]; In the case that the current sequence number of the current link state message stored in the local database is within the second preset range, the link state message with the transition sequence number is processed as an updated link state message.

10. The message receiving method according to claim 9, characterized in that: Also includes: Receive the state of the transition sequence number capability switch; The processing of the link state message as a link state message that is newer than a link state message with a sequence number in a second preset range includes: The link state message is processed as a link state message newer than a link state message with a sequence number in a second preset range according to the state of the transition sequence number capability switch.

11. The message receiving method according to claim 10, characterized in that: Also includes: Update the information of devices in the entire network that do not support the transitional serial number capability according to the received transitional serial number capability switch status; The processing of the link state message as a link state message that is newer than a link state message with a sequence number in a second preset range includes: According to the information of the devices in the whole network that do not support the transition sequence number capability, the link state message is processed as a link state message that is newer than the link state message with the sequence number in the second preset range.

12. The message receiving method according to claim 9, characterized in that: Also includes: Get the status of the transition sequence number capability switch; If the state of the transition sequence number capability switch is off, processing the link state message as a link state message that is newer than a link state message with a sequence number in a second preset range includes: The link status message is discarded or aged.

13. The message receiving method according to claim 9, characterized in that: Also includes: Get the information of devices in the whole network that do not support the transition serial number capability; If the whole network does not support the transition sequence number capability device information includes the information of the router device, the link state message is processed as a link state message that is newer than the link state message with the second preset range sequence number, including: The link status message is discarded or aged.

14. An electronic device comprising: A memory, a processor, and a computer program stored in the memory and executable on the processor, wherein when the processor executes the program, the following is achieved: The message sending method according to any one of claims 1 to 8; or, A message receiving method as claimed in any one of claims 9 to 13.

15. A message sending and receiving system, comprising at least one first electronic device and at least one second electronic device; The first electronic device comprises: a first memory, a first processor, and a computer program stored in the first memory and executable on the first processor, wherein the first processor implements the message sending method according to any one of claims 1 to 8 when executing the program; Correspondingly, the second electronic device includes: a second memory, a second processor, and a computer program stored in the second memory and executable on the second processor, and when the second processor executes the program, it implements the message receiving method as described in any one of claims 9 to 13.

16. A computer-readable storage medium storing computer-executable instructions for: Execute the message sending method according to any one of claims 1 to 8; or, Execute the message receiving method according to any one of claims 9 to 13.