WO2008089680A1 - A method and router for establishing communication - Google Patents
A method and router for establishing communication Download PDFInfo
- Publication number
- WO2008089680A1 WO2008089680A1 PCT/CN2008/070117 CN2008070117W WO2008089680A1 WO 2008089680 A1 WO2008089680 A1 WO 2008089680A1 CN 2008070117 W CN2008070117 W CN 2008070117W WO 2008089680 A1 WO2008089680 A1 WO 2008089680A1
- Authority
- WO
- WIPO (PCT)
- Prior art keywords
- router
- interval
- configuration time
- packet
- time
- Prior art date
Links
Classifications
-
- H—ELECTRICITY
- H04—ELECTRIC COMMUNICATION TECHNIQUE
- H04L—TRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
- H04L12/00—Data switching networks
- H04L12/54—Store-and-forward switching systems
- H04L12/56—Packet switching systems
Definitions
- the present invention relates to the field of computer network communication, and in particular, to a method and a router for establishing communication.
- OSPF Open Shortest Path First
- OSPF is a link state-based protocol, including a neighbor relationship establishment mechanism, a link state description mechanism, a link state propagation mechanism, and an efficient routing algorithm. Established and maintained, that is, the Hello packets in OSPF are the basic of OSPF.
- a router running the OSPF protocol on the same network segment needs to send Hello packets to discover each other and establish a neighbor relationship. After the neighbor relationship is established, you need to send Hello packets to maintain the neighbor relationship. If the Hello message of the other party is not received within a certain interval, the neighbor relationship will be broken.
- hello messages are sent at a fixed interval Hellolnterval, in a peer-to-peer (P2P) network, a point-to-multipoint (P2MP) network, and a broadcast (broadcast) network.
- the Hellolnterval defaults to 10s.
- the Hellolnterval in the non-broadcast multi-access network NBMA is 30s.
- the router After the neighbor relationship is established, the router still sends Hello packets at Hello interval to maintain the neighbor relationship. However, the OSPF protocol can be allowed for a certain period of time. If the hello message is not received in the segment, the neighbor relationship is not maintained. The dead interval is set to the maximum time limit for receiving the Hello packet. In the Deadlnterval time range, the router does not receive the Hello packet from the peer. Will break. Hellolnterval and Deadlnterval are configurable. Normally, the default value of Deadlnterval is configured to be four times that of Hellolnterval.
- the neighbor relationship needs to be implemented by using a 1_way hello message and a 2_thress hello message.
- the 1 - way hello message is sent to the sender.
- the neighbor list of the hello message does not include the receiver.
- Router ID; 2 - way hello packet is the sender's router ID for the sender.
- the neighbor list contains the receiver's router ID.
- the hello message indicates that the neighbor relationship has been established.
- Router A sends a 1-way hello packet to Router B.
- the 1-way hello packet includes Hellolnterval and Deadlnterval configured by Router A. If Router A is configured with Hellolnterval and Deadlnterval and Router B.
- Router B sends a 2-way hello packet to Router A, and the neighbor relationship is established.
- the condition for establishing a neighbor relationship between Router A and Router B is that the Hellolnterval and Deadlnterval configured on both sides must be the same. If the Hellolnterval and Deadlnterval are configured, the neighbor relationship cannot be established.
- Router A sends the first 1-way hello packet to Router B.
- the first 1-way hello packet includes the Hellolnterval configured by Router A.
- Router B discards the first-thrace hello packet and sends a second 1_way hello packet to Router A.
- the neighbor relationship cannot be established.
- the conditions for maintaining the neighbor relationship are as follows: The routers that establish the neighbor relationship still send hello packets according to the Hellolnterval interval when the neighbor relationship is established. If the peerlnterval is exceeded, the peer does not receive the hello. The message cancels the neighbor relationship.
- the current OSPF protocol requires that the Hellolnterval and Deadlnterval of the neighbors must be the same. Otherwise, the neighbor relationship cannot be established. After the neighbor relationship is established, the Hellolnterval and Deadlnterval must also be the same. Otherwise, the neighbor relationship will be the same. rupture. Therefore, when the Hellolnterval and Deadlnterval configured by the neighbors are different, the neighbor relationship cannot be established. Further, if Hellolnterval and Deadlnterval are changed, the existing neighbor relationship is broken, and the neighbor relationship needs to be re-established. Therefore, the requirements of many specific networks cannot be met in practical applications. In addition, when low-speed equipment is connected to high-speed equipment, considering the speed processing capability of low-speed equipment, high-speed equipment must maintain Hellolnterval consistent with low-speed equipment to discover low-speed equipment, which seriously affects the performance of high-speed equipment.
- the present invention provides a method and router for establishing communication, so that communication can still be established when the interval configuration time (such as Hellolnterval) configured by both routers is inconsistent.
- the object of the present invention is achieved by the following technical solutions:
- the second router receives the first packet from the first router, where the first packet includes: a first interval configuration time;
- the second router determines the second reporting interval according to the first interval configuration time, and sends a second packet to the first router in the second reporting interval to establish communication with the first router.
- the first interval configuration time is not equal to the second interval configuration time of the second router.
- a router includes: a message receiving unit, a first storage unit, a report interval selecting unit, and a message sending unit, where
- a packet receiving unit configured to receive a first packet from a neighboring router, where the first packet includes: a first interval configuration time;
- a first storage unit configured to store a second interval configuration time
- a reporting interval selection unit configured to determine a second transmission interval when the second interval configuration time is different from the first interval configuration time
- a message sending unit configured to send the second message in the second reporting interval.
- the second router determines the second transmission interval by referring to the first configuration interval.
- the second message is sent in the second reporting interval, and the communication can be established with the first router.
- FIG. 1 is a successful diagram of establishing a neighbor relationship in the prior art
- FIG. 2 is a diagram showing a failure of establishing a neighbor relationship in the prior art
- FIG. 3 is a flowchart of a method for establishing communication according to an embodiment of the present invention.
- FIG. 4 is a flowchart of Hello message transmission according to an embodiment of the present invention.
- FIG. 5 is a flowchart of Hello message transmission according to an embodiment of the present invention.
- FIG. 6 is a structural diagram of a router according to another embodiment of the present invention.
- Step 301 The first router sends the first packet to the second router at the first interval configuration time, where the first packet is a 1-way Hello packet, and includes: an identifier (identity) of the first router, An identification, a first interval configuration time, and a first maintenance configuration time.
- the first interval configuration time is a Hellolnterval configured by the first router itself.
- the first maintenance configuration time is the Deadlnterval configured by the first router itself, which is Deadlntervall 1.
- the first identifier is used to indicate whether the first router supports the Hello packet negotiation, and may be a bit in the option field of the Hello packet that is not used by the current protocol, for example, the lowest bit in the option field. When the first identifier is 1, it indicates the first The router supports Hello packet negotiation. When the first identifier is 0, the first router does not support Hello packet negotiation. Of course, the first identifier can be placed in other bits in the option field. You can also set different values for the first identifier. Whether the first router supports the Hello packet negotiation.
- the first packet carries the first identifier in the first packet when the router supports the Hello packet negotiation, and does not carry the first identifier when the Hello packet negotiation is not supported.
- the first router does not support packet negotiation; and vice versa, that is, when the first packet does not include the first identifier, the first router supports the packet negotiation.
- Support for Hello message negotiation means that the Hellolnterval and Deadlnterval of the router configuration allowed to communicate with itself are different from the Hellolnterval and Deadlnterval configured by itself.
- Step 302 The second router determines, according to the first identifier in the first packet, whether the first router supports Hello packet negotiation. If no, go to step 303. If yes, go to step 304.
- Step 303 The second router sends the second packet to the first router at the second interval, and the second packet is sent to the first router.
- the Hello message includes: an ID of the second router, an ID of the first router, a second identifier, a first interval configuration time, and a first maintenance configuration time.
- the first maintenance configuration time is a second deadline and is saved.
- the second reporting time limit is that the second router actually allows the maximum time limit of the Hello message to be received from the first router, and the first router and the second router work in the normal working mode, establish communication, and end the process;
- Step 304 The second router configures the time according to the first interval in the first text and the second interval configuration time of the second interval, and selects the second reporting interval according to the preset election criteria and saves the second interval.
- the second packet is sent to the first router.
- the second packet is a 2-way Hello packet, and includes: an ID of the first router, an ID of the second router, a second identifier, a second interval configuration time, and
- the second interval is configured as follows: the second interval configuration time is the HelloInterval configured by the second router itself, and is the HelloInterval21, and the second maintenance configuration time is the Deadlnterval configured by the second router itself, which is Deadlnterval21;
- the first maintenance configuration time and the second maintenance configuration time are selected, and the second collection time limit is elected according to the preset election criteria, and the first router and the second router work in the negotiation mode to establish communication.
- the processing procedure of the second router is similar to the step 303: the second router configures the first interval in the first packet as the second reporting interval and saves the packet, and sends the packet to the first router at the second reporting interval.
- the second packet where the second packet is a 2-way Hello packet, includes: an ID of the second router, an ID of the first router, a second identifier, a first interval configuration time, and a first maintenance configuration time; The first maintenance configuration time is set as the second receiving time limit and is saved.
- the second receiving time limit is that the second router actually does not receive the maximum time limit of the Hello message from the first router, and the first router and the second router work in the normal state. Work mode, establish communication.
- the election criteria can be a maximum election, a minimum election, a weighted average election, or an average election.
- the second router elects the maximum value in the first interval configuration time and the second interval configuration time as the second transmission interval, and elects in the first maintenance configuration time and the second maintenance configuration time.
- the maximum value is used as the second closing time limit.
- the first router and the second router can only negotiate the interval configuration time (Hellolnterval), and the value of the maintenance interval configuration time (Deadlnterval) is defaulted to be several times the negotiated Hellolnterval.
- the first router and the second router After the first router and the second router establish communication (such as establishing a neighbor relationship between the two routers), the first router can change the first interval configuration time and the first maintenance configuration time as long as the second router supports packet negotiation. It can be configured to support packet negotiation or not to support packet negotiation. Referring to FIG. 4, the first router and the second router maintain the communication process including:
- Step 401 The first router receives the second packet from the second router, where the second packet is in the second packet.
- the second identifier is used to identify whether the second router supports the Hello packet negotiation.
- the second router supports the Hello packet negotiation, and configures the time according to the second interval in the second packet and the first interval configuration time of the second packet.
- the first election message is sent to the second router and the third message is sent to the second router.
- the third message is a 2-way Hello message, including: The identifier, the ID of the first router, the ID of the second router, the first interval configuration time, and the first maintenance configuration time; according to the second maintenance configuration time in the second packet and the first maintenance configuration time of the second packet, according to the preset
- the first time limit for the election of the election criteria is the first time limit for receiving the Hello message from the second router.
- the election criteria of the first router and the second router are preferably consistent. Because the election criteria are the same, the reporting interval and the receiving time limit of the two parties are the same. If the election criteria of the first router and the second router are inconsistent, the interval between the two parties is The time limit for receiving the report is different. One party must meet the request interval of the other party and the time limit for receiving the report. Otherwise, the neighbor relationship may oscillate. For example, the first interval configuration time is
- the second interval configuration time is 5S
- the first maintenance configuration time is 4S
- the second maintenance configuration time is
- the election criterion of the first router is the minimum election, the first reporting interval is 1S, the first reporting interval is 4S, the election criterion of the second router is the maximum election, the second reporting interval is 5S, and the second reporting is The time limit is 20 S.
- the first router does not receive the Hello packet from the second router within 4S, and the neighbor relationship is broken.
- Step 402 The second router determines, according to the first identifier in the third packet, whether the first router supports Hello packet negotiation. If yes, go to step 403. If no, go to step 410.
- Step 403 The second router determines the first interval configuration time in the third text and the previous received
- Step 404 The second router, according to the first interval configuration time in the third packet and the second interval configuration time of the third packet, elects the current second transmission interval according to the preset election criteria and saves, and performs step 406.
- Step 405 The second reporting interval of the previous election of the second router is used as the current second reporting interval, and the second reporting interval of the previous election in this step is the second reporting interval of the election in step 304.
- Step 406 The second router determines whether the first maintenance configuration time in the third packet is the same as the first maintenance configuration time in the previous received packet. If not, perform step 407, if the same, Step 408 is performed; the previously received text in this step is the first text.
- Step 407 The second router selects and saves the current second receiving time limit according to the preset election criterion according to the first maintenance configuration time and the second maintenance configuration time in the third packet, and performs step 409.
- Step 408 The second receiving time limit of the previous election of the second router is used as the current second receiving time limit.
- the second receiving time limit of the previous election in this step is the second receiving time limit of the election in step 304.
- Step 409 The second router sends a fourth packet at the current second sending interval.
- the fourth packet is a 2-way Hello packet, and includes: an ID of the first router, an ID of the second router, and a second identifier.
- the second interval configuration time and the second maintenance configuration time, the first router and the second router work in a negotiation working mode, and the process ends.
- Step 410 The second router sends a fourth packet to the second router in the second interval of the third interval in the third interval, where the fourth packet is a 2-way Hello message.
- the first maintenance configuration time in the third packet is the second deadline.
- a router and a second router operate in a normal working mode.
- the hello message sending process is:
- Step 501 The second router determines whether the second interval configuration time and the second maintenance configuration time of the second router change. When only the second interval configuration time is changed, the HelloInterval21 is changed to HelloInterval22, and step 502 is performed, when only the second maintenance is changed. When the change time is changed to Deadlnterval22, step 503 is executed. When the second interval configuration time and the second maintenance configuration time are changed simultaneously, that is, HelloInterval21 is changed to HelloInterval22, and Deadlnterval21 is changed to Deadlnterval22, step 504 is performed.
- Step 502 The second router elects a current second sending interval according to the current second interval configuration time and the current first interval configuration time of the first router.
- the fifth packet is sent at the current second sending interval.
- the fifth packet is a 2-way Hello message, including: a first router ID, a second router ID, a second identifier, a current second interval configuration time HelloInterval22, and a current second maintenance configuration time Deadlnterval21; Process.
- Step 503 The second router according to the current second maintenance configuration time and the current current of the first router The first maintaining the configuration time, and electing the current second receiving time limit.
- the fifth message includes: a first router ID, a second router ID, a second identifier, a current second interval configuration time HelloInterval21, and a current second. Maintain the configuration time Deadlnterval22; End this process.
- Step 504 The second router elects a current second transmission interval according to the current second interval configuration time and the current first interval configuration time of the first router, and the current second maintenance configuration time and the current current configuration of the first router.
- the first maintaining the configuration time, and electing the current second receiving time limit; in the second receiving time limit of the previous election, the second of the previous election interval and the current second reporting interval are the smaller ones to the first router.
- the fifth packet is sent to the first router at the current second reporting interval, and the fifth packet includes: the first router ID, the first packet.
- the current first interval configuration time and the first maintenance configuration time of the first router are learned by the currently received packet; the second transmission interval of the previous election is: the first one of the current message is received from the first The second interval for the election of the router is the second interval for the election. The second period for the previous election is: the second deadline for the election of the packet from the first router when the current packet is received.
- the smaller one of the second reporting interval and the current second reporting interval of the previous election sends a message to the first router, in order to avoid the second round of the current election.
- the reporting interval and the second reporting deadline are significantly different from the second reporting interval and the second reporting interval of the previous election, and the notification packet sent to the first router is lost.
- the HelloInterval21 configured by the second router is IS
- the Deadlnterval21 is 4S
- the Hellolntervalll of the first router is 2S
- the Deadlntervalll is 8S.
- the election criteria of the two routers are the same, and the maximum interval is elected.
- the second reporting interval is 2S
- the first reporting deadline and the second reporting deadline are both 8S.
- the second router changes the configuration value, HelloInterval22 is 10S, Deadlnterval22 is 40S, the second interval of the current election is 10S, and the second reporting time is 40S. At this time, the second router should be the second in the previous election. In the 8S receiving time limit, the second sending interval 2S of the previous election sends a message to the first router, informing the first router to change the election value, and sending a message to the first router at the second reporting interval 10S of the current election. Because the first reporting time limit of the first election of the first router is 8S, it is impossible to receive the packet from the second router within 8S, the communication is interrupted, and the first router cancels the neighbor relationship.
- a router has multiple interfaces. Each interface is connected to at least one router.
- the working mode of the routers on each interface is usually the same, that is, the negotiation mode or the normal working mode, because every two routers in the network are They are connected to each other through interfaces, so all routers in the network work in normal working mode as long as there is a neighbor router in the network that does not support negotiation. Once the neighboring routers in the network that do not support negotiation leave, that is, no neighboring routers in the network do not support negotiation, the router can switch to the negotiation mode.
- FIG. 6 is a structural diagram of a router according to Embodiment 2 of the present invention.
- the router in this embodiment includes: a message receiving unit 601, a first storage unit 602, a reporting interval selecting unit 603, and a text sending unit 604, where
- the message receiving unit 601 is configured to receive a first packet from a neighboring router, such as the first router, where the first packet includes: a first interval configuration time;
- a first storage unit 602 configured to store a second interval configuration time
- a reporting interval selection unit 603, configured to determine a second reporting interval by referring to the first interval configuration time when the second interval configuration time is different from the first interval configuration time;
- the message sending unit 604 is configured to send the second message in the second reporting interval.
- the first packet received by the packet receiving unit 601 further includes: a first maintenance configuration time; optionally, the router further includes:
- a second storage unit 605, configured to store a second maintenance configuration time
- the aging time selection unit 606 is configured to determine a second acknowledgment time limit in the first maintenance configuration time in the first message received by the reference message receiving unit 601. For example, in the case that the first router supports the packet negotiation, the second receiving time limit is determined according to the first maintenance configuration time and the second maintenance configuration time in the second storage unit 605 according to the election criteria; or, in the first In the case that the router does not support the packet negotiation, the first maintenance configuration time is the second receiving time limit.
- the first packet in the packet receiving unit 601 further includes: a first identifier, where the first identifier is used to indicate whether the first router supports packet negotiation;
- the router further includes:
- the message negotiation determining unit 607 is configured to determine, according to the first identifier, whether the neighboring router supports the message negotiation, and output the determination result.
- An identifier storage unit 608, configured to store the second identifier
- the hairline interval selecting unit 603 includes: a first selecting unit 701.
- the first selecting unit 701 is configured to: when the second interval configuration time is different from the first interval configuration time, and when the judgment result of the message negotiation determining unit 607 is yes (that is, the first router supports message negotiation), according to the election Standard, according to the second interval configuration time from the first storage unit 602 and the first interval configuration time from the message receiving unit 601, the second transmission interval is elected;
- the second message sent by the message sending unit 604 includes: a second identifier from the identifier storage unit 608, and a second interval configuration time from the first storage unit 602.
- the closing time limit selection unit 606 includes: a second selection unit 801,
- the second selecting unit 801 is configured to: when the result of the message negotiation determining unit 607 is yes (ie, the first router supports message negotiation), according to the election criterion, according to the second maintenance configuration time from the second storage unit 605 The first maintenance configuration time from the message receiving unit 601 is to elect a second closing time limit.
- the transmission interval selection unit 603 further includes: a third selection unit 702.
- the third selecting unit 702 is configured to: when the result of the message negotiation determining unit 607 is negative (that is, the first router does not support the message negotiation), the first interval configuration time of the packet receiving unit 601 is the second sending. 4 ⁇ interval;
- the second message sent by the message sending unit 604 includes: a second identifier from the identifier storage unit 608, and a first interval configuration time from the message receiving unit 601;
- the closing time limit selection unit 606 further includes: a fourth selection unit 802,
- the fourth selecting unit 802 is configured to: when the result of the message negotiation determining unit 607 is negative (that is, the first router does not support the message negotiation), the first maintenance configuration time from the message receiving unit 601 is the second receiving report. time limit.
- the report interval selection unit 603 further includes: a fifth selection unit 703, configured to use the first interval configuration time of the message receiving unit 601 as the second report interval; One of the element 703 and the third selection unit 702 is selected.
- the second message sent by the message sending unit 604 includes: a first interval configuration time from the message receiving unit 601;
- the acknowledgment time limit selection unit 606 further includes: a sixth selection unit 803, configured to use the first maintenance configuration time from the message receiving unit 601 as a second acknowledgment time limit.
- a sixth selection unit 803 configured to use the first maintenance configuration time from the message receiving unit 601 as a second acknowledgment time limit.
- One of the sixth selection unit 803 and the fourth selection unit 802 can be selected according to the actual situation.
- the router further includes: a first determining unit 609, configured to determine whether the first interval configuration time in the two adjacent packets received by the packet receiving unit 601 is the same, generate a first determination result, and output; Determining whether the first maintenance configuration time of the two adjacent messages received by the message receiving unit 601 is the same, generating a second determination result, and outputting;
- the first selection unit 701 is configured to: when the first determination result from the first determining unit 609 is YES, the first reporting interval of the previous election is the current first reporting interval;
- the second selection unit 801 is configured to: when the second determination result from the first determining unit 609 is YES, the first closing time limit of the previous election is the current first closing time limit.
- the router further includes: a second determining unit 610, configured to determine whether the second interval configuration time stored by the first storage unit 602 changes, and determining whether the second maintenance configuration time stored by the second storage unit 605 changes Generating a notification message and outputting if the second interval configuration time and the second maintenance configuration time change simultaneously;
- the message sending unit 604 is configured to: after receiving the notification message of the second determining unit 610, in the first receiving time limit of the previous election of the second selecting unit 801, the current first sending by the first selecting unit 701 The smaller one of the first interval of the report interval and the previous election sends a fifth message to the neighboring router.
- the fifth message includes: a second identifier, a current second interval configuration time from the first storage unit 602. And the current second maintenance configuration time from the second storage unit 605, after the first reporting time limit of the previous election, sending the fifth message at the first reporting interval of the current election.
- the embodiment of the present invention configures the second router to support the packet negotiation.
- the second router determines the second reporting interval, sends the second packet in the second reporting interval, establishes a communication with the first router, establishes a neighbor relationship, and may change the second interval configuration time or / and the second maintenance configuration time, can meet the requirements in practical applications
- For a specific network for example, gracefully restarting the GR, you can extend the second maintenance configuration time and increase the success rate of the GR when needed.
- the first router starts sending the first packet according to the first interval configuration time configured by itself.
- the first router is a high-speed device.
- the low-speed device can be discovered at the speed of the high-speed device. After the communication is established, the message can be sent at the low-speed device sending frequency, which can utilize the advantages of the high-speed device. , and does not affect the traffic of the network.
Landscapes
- Engineering & Computer Science (AREA)
- Computer Networks & Wireless Communication (AREA)
- Signal Processing (AREA)
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
A method for establishing communication comprises: the second router receives the first message from the first router, wherein the first message comprises the first interval configuration time; if the first interval configuration time is different from the second interval configuration time of the second router, the second router determines the second message transmitting interval according to the first interval configuration time and sends the second message to the first router within the second message transmitting interval time to establish the communication with the first router. By the above-mentioned technical solution, the communication can be established when the interval configuration time (such as HelloInterval) configured by the both routers is not consistent with each other.
Description
一种建立通信的方法及路由器 Method and router for establishing communication
本申请要求于 2007 年 1 月 23 日提交中国专利局、 申请号为 200710002703.8、 发明名称为 "一种建立通信的方法及路由器"的中国专利申请 的优先权, 其全部内容通过引用结合在本申请中。 The present application claims priority to Chinese Patent Application No. 200710002703.8, entitled "A Method for Establishing Communication and Routers", filed on January 23, 2007, the entire contents of which is incorporated herein by reference. in.
技术领域 Technical field
本发明涉及计算机网络通信领域, 特别涉及一种建立通信的方法及路由 器。 The present invention relates to the field of computer network communication, and in particular, to a method and a router for establishing communication.
背景技术 Background technique
OSPF ( Open Shortest Path First, 最短路径优先协议) 是一种基于链路状 态的协议, 包括邻居关系建立机制, 链路状态描述机制, 链路状态传播机制以 及高效的路由算法, 其中, 邻居关系的建立与维护, 即 OSPF协议中的 Hello 报文是 OSPF协议的基本。 OSPF (Open Shortest Path First) is a link state-based protocol, including a neighbor relationship establishment mechanism, a link state description mechanism, a link state propagation mechanism, and an efficient routing algorithm. Established and maintained, that is, the Hello packets in OSPF are the basic of OSPF.
连接在同一网段上的运行 OSPF 协议的多台路由器, 在邻居关系建立之 前, 需要发送 Hello报文来发现彼此, 建立邻居关系, 当邻居关系建立以后, 需要发送 Hello报文来维持邻居关系 , 如果在一定时间间隔内接收不到对方的 Hello 报文, 邻居关系就会破裂。 在现有技术中, Hello 报文以固定的间隔 Hellolnterval发送, 在点对点(P2P, peer-to peer ) 网络中、 点对多点(P2MP, point to multipoint )网络、及 Broadcast (广播)网络上的 Hellolnterval默认为 10s, 在非广播多点接入网络 NBMA中的 Hellolnterval为 30s, 在邻居关系建立后, 路由器仍然以 Hellolnterval 为时间间隔发送 Hello 报文来维持邻居关系, 但 OSPF协议能够允许在一定时间段内接收不到对方的 Hello报文仍维持邻居关 系, Deadlnterval (破裂间隔) 为允许接收不到 Hello 报文的最大时限, 在 Deadlnterval时间段内路由器接收不到对方的 Hello报文, 邻居关系就会破裂。 Hellolnterval和 Deadlnterval是可配置的, 通常, Deadlnterval的默认值配置成 Hellolnterval的四倍。 A router running the OSPF protocol on the same network segment needs to send Hello packets to discover each other and establish a neighbor relationship. After the neighbor relationship is established, you need to send Hello packets to maintain the neighbor relationship. If the Hello message of the other party is not received within a certain interval, the neighbor relationship will be broken. In the prior art, hello messages are sent at a fixed interval Hellolnterval, in a peer-to-peer (P2P) network, a point-to-multipoint (P2MP) network, and a broadcast (broadcast) network. The Hellolnterval defaults to 10s. The Hellolnterval in the non-broadcast multi-access network NBMA is 30s. After the neighbor relationship is established, the router still sends Hello packets at Hello interval to maintain the neighbor relationship. However, the OSPF protocol can be allowed for a certain period of time. If the hello message is not received in the segment, the neighbor relationship is not maintained. The dead interval is set to the maximum time limit for receiving the Hello packet. In the Deadlnterval time range, the router does not receive the Hello packet from the peer. Will break. Hellolnterval and Deadlnterval are configurable. Normally, the default value of Deadlnterval is configured to be four times that of Hellolnterval.
现有技术中建立邻居关系需要 1 _ way hello报文和 2 _ way hello报文来实 现, 1 - way hello报文对于发送方而言就是发送的 hello报文的邻居列表中不 包含接收方的 Router ID; 2 - way hello报文对于发送方而言就是发送的 hello 报文的邻居列表中包含接收方的 Router ID; 当双方路由器彼此发送 2 - way
hello报文表示双方的邻居关系均已建立。 邻居关系建立过程如图 1 所示, 路 由器 A向路由器 B发送 1 - way hello报文, 1 - way hello报文中包括路由器 A 配置的 Hellolnterval和 Deadlnterval, 如果路由器 A配置的 Hellolnterval和 Deadlnterval与路由器 B配置的 Hellolnterval和 Deadlnterval相同, 路由器 B 向路由器 A发送 2 - way hello报文, 邻居关系建立。 路由器 A与路由器 B建 立邻居关系的条件是双方配置的 Hellolnterval和 Deadlnterval必须一致。 如果 双方配置的 Hellolnterval和 Deadlnterval不一致, 邻居关系不能建立, 如图 2 所示, 路由器 A向路由器 B发送第一 1 - way hello报文, 第一 1 - way hello 报文中包括路由器 A配置的 Hellolnterval和 Deadlnterval, 如果路由器 B配置 的 Hellolnterval, Deadlnterval与路由器 A配置的不相同, 则路由器 B丢弃第 — 1 - way hello报文, 向路由器 A发送第二 1 _ way hello报文,邻居关系不能 建立。 In the prior art, the neighbor relationship needs to be implemented by using a 1_way hello message and a 2_thress hello message. The 1 - way hello message is sent to the sender. The neighbor list of the hello message does not include the receiver. Router ID; 2 - way hello packet is the sender's router ID for the sender. The neighbor list contains the receiver's router ID. When the two routers send each other 2 - way The hello message indicates that the neighbor relationship has been established. As shown in Figure 1, Router A sends a 1-way hello packet to Router B. The 1-way hello packet includes Hellolnterval and Deadlnterval configured by Router A. If Router A is configured with Hellolnterval and Deadlnterval and Router B. The configured Hellolnterval and Deadlnterval are the same. Router B sends a 2-way hello packet to Router A, and the neighbor relationship is established. The condition for establishing a neighbor relationship between Router A and Router B is that the Hellolnterval and Deadlnterval configured on both sides must be the same. If the Hellolnterval and Deadlnterval are configured, the neighbor relationship cannot be established. As shown in Figure 2, Router A sends the first 1-way hello packet to Router B. The first 1-way hello packet includes the Hellolnterval configured by Router A. And Deadlnterval, if the Hellolnterval and Deadlnterval configured by Router B are different from those configured by Router A, Router B discards the first-thrace hello packet and sends a second 1_way hello packet to Router A. The neighbor relationship cannot be established.
邻居关系建立后, 维持邻居关系的条件是: 建立好邻居关系的双方路由器 仍然按照建立邻居关系时的 Hellolnterval的时间间隔来发送 hello报文, 如果 超过 Deadlnterval的时间段内没有收到对方的发送 hello报文 , 则取消邻居关 系。 After the neighbor relationship is established, the conditions for maintaining the neighbor relationship are as follows: The routers that establish the neighbor relationship still send hello packets according to the Hellolnterval interval when the neighbor relationship is established. If the peerlnterval is exceeded, the peer does not receive the hello. The message cancels the neighbor relationship.
从对现有技术的分析可以看出, 目前的 OSPF 协议要求邻居双方的 Hellolnterval和 Deadlnterval必须一致, 否则邻居关系不能建立, 且建立邻居 关系之后, 其 Hellolnterval和 Deadlnterval也必须一致, 否则邻居关系就会破 裂。 因此, 当邻居双方配置的 Hellolnterval和 Deadlnterval不同时, 不能建立 邻居关系。 进一步, 如果改变 Hellolnterval和 Deadlnterval, 会导致已有的邻 居关系破裂, 需要重新建立邻居关系, 因此, 在实际应用中不能满足许多特定 网络的需要。 此外, 当低速设备和高速设备相连的时候, 考虑到低速设备的速 度处理能力, 高速设备必须保持和低速设备一致的 Hellolnterval来发现低速设 备, 这严重影响了高速设备性能的发挥。 As shown in the analysis of the prior art, the current OSPF protocol requires that the Hellolnterval and Deadlnterval of the neighbors must be the same. Otherwise, the neighbor relationship cannot be established. After the neighbor relationship is established, the Hellolnterval and Deadlnterval must also be the same. Otherwise, the neighbor relationship will be the same. rupture. Therefore, when the Hellolnterval and Deadlnterval configured by the neighbors are different, the neighbor relationship cannot be established. Further, if Hellolnterval and Deadlnterval are changed, the existing neighbor relationship is broken, and the neighbor relationship needs to be re-established. Therefore, the requirements of many specific networks cannot be met in practical applications. In addition, when low-speed equipment is connected to high-speed equipment, considering the speed processing capability of low-speed equipment, high-speed equipment must maintain Hellolnterval consistent with low-speed equipment to discover low-speed equipment, which seriously affects the performance of high-speed equipment.
发明内容 Summary of the invention
本发明提供一种建立通信的方法及路由器,使在双方路由器配置的间隔配 置时间 (如 Hellolnterval ) 不一致的时候, 仍然能够建立通信。
为解决上述技术问题, 本发明的目的是通过以下技术方案实现的: 一种建立通信的方法, 该方法包括: The present invention provides a method and router for establishing communication, so that communication can still be established when the interval configuration time (such as Hellolnterval) configured by both routers is inconsistent. In order to solve the above technical problem, the object of the present invention is achieved by the following technical solutions: A method for establishing communication, the method comprising:
第二路由器接收来自第一路由器的第一报文, 所述第一报文包括: 第一间 隔配置时间; The second router receives the first packet from the first router, where the first packet includes: a first interval configuration time;
第二路由器根据所述第一间隔配置时间, 确定第二发报间隔, 并在所述第 二发报间隔时间内向第一路由器发送第二报文, 以建立与第一路由器的通信; 其中, 所述第一间隔配置时间与第二路由器的第二间隔配置时间不相等。 The second router determines the second reporting interval according to the first interval configuration time, and sends a second packet to the first router in the second reporting interval to establish communication with the first router. The first interval configuration time is not equal to the second interval configuration time of the second router.
一种路由器, 包括: 报文接收单元, 第一存储单元, 发报间隔选择单元, 艮文发送单元, 其中, A router includes: a message receiving unit, a first storage unit, a report interval selecting unit, and a message sending unit, where
报文接收单元,用于接收来自邻居路由器的第一报文,所述第一报文包括: 第一间隔配置时间; a packet receiving unit, configured to receive a first packet from a neighboring router, where the first packet includes: a first interval configuration time;
第一存储单元, 用于存储第二间隔配置时间; a first storage unit, configured to store a second interval configuration time;
发报间隔选择单元,用于当所述第二间隔配置时间与所述第一间隔配置时 间不同时, 确定第二发 ^艮间隔; a reporting interval selection unit, configured to determine a second transmission interval when the second interval configuration time is different from the first interval configuration time;
报文发送单元, 用于在所述第二发报间隔时间内发送第二报文。 And a message sending unit, configured to send the second message in the second reporting interval.
以上技术方案可以看出,本发明通过在第一路由器配置的第一间隔配置时 间与第二路由器配置的第二间隔配置时间不同时,第二路由器参考第一配置间 隔确定第二发报间隔, 在第二发报间隔时间内发送第二报文, 进而可以和第一 路由器建立通信。 The foregoing technical solution can be seen that, when the first interval configuration time configured by the first router is different from the second interval configuration time configured by the second router, the second router determines the second transmission interval by referring to the first configuration interval. The second message is sent in the second reporting interval, and the communication can be established with the first router.
附图说明 DRAWINGS
图 1为现有技术中邻居关系建立成功图; FIG. 1 is a successful diagram of establishing a neighbor relationship in the prior art;
图 2为现有技术中邻居关系建立失败图; 2 is a diagram showing a failure of establishing a neighbor relationship in the prior art;
图 3为本发明一个实施例提供的建立通信的方法流程图; FIG. 3 is a flowchart of a method for establishing communication according to an embodiment of the present invention;
图 4为本发明一个实施例提供的 Hello报文传送流程图; FIG. 4 is a flowchart of Hello message transmission according to an embodiment of the present invention;
图 5为本发明一个实施例提供的 Hello报文传送流程图; FIG. 5 is a flowchart of Hello message transmission according to an embodiment of the present invention;
图 6为本发明另一个实施例提供的路由器结构图。 FIG. 6 is a structural diagram of a router according to another embodiment of the present invention.
具体实施方式 detailed description
以下参照附图, 对本发明的实施例详细说明。 Embodiments of the present invention will be described in detail below with reference to the accompanying drawings.
参阅图 3, 其为本发明建立通信的方法实施例流程图, 该流程包括以下步
骤: Referring to FIG. 3, it is a flowchart of an embodiment of a method for establishing communication according to the present invention, where the process includes the following steps. Step:
步骤 301、 第一路由器以第一间隔配置时间向第二路由器发送第一报文, 其中,第一报文为 1 - way Hello报文, 包括: 第一路由器的 ID ( identity,身份)、 第一标识、 第一间隔配置时间和第一维持配置时间。 Step 301: The first router sends the first packet to the second router at the first interval configuration time, where the first packet is a 1-way Hello packet, and includes: an identifier (identity) of the first router, An identification, a first interval configuration time, and a first maintenance configuration time.
其中, 第一间隔配置时间为第一路由器自身配置的 Hellolnterval , 此时为 The first interval configuration time is a Hellolnterval configured by the first router itself.
Hellolnterval 11。 第一维持配置时间为第一路由器自身配置的 Deadlnterval , 此 时为 Deadlntervall 1。 第一标识用于表示第一路由器是否支持 Hello报文协商, 可以是 Hello报文 option字段中目前协议没有使用的某一位, 例如 option字段 中最低位, 当第一标识为 1时表示第一路由器支持 Hello报文协商, 当第一标 识为 0 时表示第一路由器不支持 Hello报文协商, 当然可以将第一标识置于 option字段中其他位; 也可以对第一标识设置不同的值表示第一路由器是否支 持 Hello报文协商; 此外, 还可以只在路由器支持 Hello报文协商时在第一报 文中携带第一标识, 而在不支持 Hello报文协商时不携带第一标识, 即当第一 报文不包括第一标识时默认第一路由器不支持报文协商; 反之亦然, 即当第一 报文不包括第一标识时默认第一路由器支持报文协商。 总而言之, 可以通过多 种具体实现方式告知对方路由器自己是否支持 Hello报文协商。 支持 Hello报 文协商表示允许与自己通信的路由器配置的 Hellolnterval和 Deadlnterval与自 己配置的 Hellolnterval和 Deadlnterval不同。 Hellolnterval 11. The first maintenance configuration time is the Deadlnterval configured by the first router itself, which is Deadlntervall 1. The first identifier is used to indicate whether the first router supports the Hello packet negotiation, and may be a bit in the option field of the Hello packet that is not used by the current protocol, for example, the lowest bit in the option field. When the first identifier is 1, it indicates the first The router supports Hello packet negotiation. When the first identifier is 0, the first router does not support Hello packet negotiation. Of course, the first identifier can be placed in other bits in the option field. You can also set different values for the first identifier. Whether the first router supports the Hello packet negotiation. In addition, the first packet carries the first identifier in the first packet when the router supports the Hello packet negotiation, and does not carry the first identifier when the Hello packet negotiation is not supported. When the first packet does not include the first identifier, the first router does not support packet negotiation; and vice versa, that is, when the first packet does not include the first identifier, the first router supports the packet negotiation. In summary, you can use the specific implementation to tell the other router whether it supports Hello packet negotiation. Support for Hello message negotiation means that the Hellolnterval and Deadlnterval of the router configuration allowed to communicate with itself are different from the Hellolnterval and Deadlnterval configured by itself.
步骤 302、 第二路由器根据第一报文中的第一标识判断第一路由器是否支 持 Hello报文协商, 如果否, 执行步骤 303 , 如果是, 执行步骤 304。 Step 302: The second router determines, according to the first identifier in the first packet, whether the first router supports Hello packet negotiation. If no, go to step 303. If yes, go to step 304.
步骤 303、 第二路由器以第一 文中的第一间隔配置时间为第二发 间隔 并保存, 以第二发报间隔向第一路由器发送第二报文, 此时, 第二报文为 2 _ way Hello报文, 包括: 第二路由器的 ID, 第一路由器的 ID, 第二标识, 第一 间隔配置时间和第一维持配置时间; 以第一维持配置时间为第二收报时限并保 存, 以第二收报时限为第二路由器实际允许接收不到来自第一路由器的 Hello • ^文的最大时限, 第一路由器和第二路由器工作在普通工作模式, 建立通信, 结束本流程; Step 303: The second router sends the second packet to the first router at the second interval, and the second packet is sent to the first router. The Hello message includes: an ID of the second router, an ID of the first router, a second identifier, a first interval configuration time, and a first maintenance configuration time. The first maintenance configuration time is a second deadline and is saved. The second reporting time limit is that the second router actually allows the maximum time limit of the Hello message to be received from the first router, and the first router and the second router work in the normal working mode, establish communication, and end the process;
步骤 304、 第二路由器根据第一 文中的第一间隔配置时间和自身的第二 间隔配置时间, 按照预设的选举标准选举第二发报间隔并保存, 以第二发报间
隔向第一路由器发送第二报文, 此时, 第二报文为 2 - way Hello报文, 包括: 第一路由器的 ID、 第二路由器的 ID、 第二标识、 第二间隔配置时间和第二维 持配置时间; 其中,第二间隔配置时间为第二路由器自身配置的 HelloInterval, 此时为 HelloInterval21 , 第二维持配置时间为第二路由器自身配置的 Deadlnterval, 此时为 Deadlnterval21; 根据第一报文中的第一维持配置时间和 自己的第二维持配置时间,按照预设的选举标准选举第二收报时限并保存, 第 一路由器和第二路由器工作在协商模式, 建立通信。 Step 304: The second router configures the time according to the first interval in the first text and the second interval configuration time of the second interval, and selects the second reporting interval according to the preset election criteria and saves the second interval. The second packet is sent to the first router. The second packet is a 2-way Hello packet, and includes: an ID of the first router, an ID of the second router, a second identifier, a second interval configuration time, and The second interval is configured as follows: the second interval configuration time is the HelloInterval configured by the second router itself, and is the HelloInterval21, and the second maintenance configuration time is the Deadlnterval configured by the second router itself, which is Deadlnterval21; In the text, the first maintenance configuration time and the second maintenance configuration time are selected, and the second collection time limit is elected according to the preset election criteria, and the first router and the second router work in the negotiation mode to establish communication.
前面已经提到, 当第一报文中没有第一标识时, 可以默认为第一路由器不 支持 Hello报文协商, 即不需要执行步骤 302所述的根据第一报文中的第一标 识来判断第一路由器是否支持 Hello报文协商。 这种情况下第二路由器的处理 过程与步骤 303类似:第二路由器以第一报文中的第一间隔配置时间为第二发 报间隔并保存, 以第二发报间隔向第一路由器发送第二报文, 此时, 第二报文 为 2 - way Hello报文, 包括: 第二路由器的 ID, 第一路由器的 ID, 第二标识, 第一间隔配置时间和第一维持配置时间;以第一维持配置时间为第二收报时限 并保存, 以第二收报时限为第二路由器实际允许接收不到来自第一路由器的 Hello报文的最大时限, 第一路由器和第二路由器工作在普通工作模式, 建立 通信。 As mentioned above, when there is no first identifier in the first packet, the first router does not support the Hello packet negotiation by default, that is, the first identifier in the first packet is not required to be performed in step 302. Determine whether the first router supports Hello packet negotiation. In this case, the processing procedure of the second router is similar to the step 303: the second router configures the first interval in the first packet as the second reporting interval and saves the packet, and sends the packet to the first router at the second reporting interval. The second packet, where the second packet is a 2-way Hello packet, includes: an ID of the second router, an ID of the first router, a second identifier, a first interval configuration time, and a first maintenance configuration time; The first maintenance configuration time is set as the second receiving time limit and is saved. The second receiving time limit is that the second router actually does not receive the maximum time limit of the Hello message from the first router, and the first router and the second router work in the normal state. Work mode, establish communication.
选举标准可以为最大值选举、 最小值选举、加权平均值选举或平均值选举 等。 例如: 选举标准为最大值选举时, 第二路由器在第一间隔配置时间和第二 间隔配置时间中选举最大值作为第二发报间隔,在第一维持配置时间和第二维 持配置时间中选举最大值作为第二收报时限。 The election criteria can be a maximum election, a minimum election, a weighted average election, or an average election. For example, when the election criterion is the maximum election, the second router elects the maximum value in the first interval configuration time and the second interval configuration time as the second transmission interval, and elects in the first maintenance configuration time and the second maintenance configuration time. The maximum value is used as the second closing time limit.
此外,第一路由器和第二路由器可以只协商间隔配置时间 ( Hellolnterval ), 而将维持间隔配置时间(Deadlnterval )的值默认为协商后的 Hellolnterval的几 倍。 In addition, the first router and the second router can only negotiate the interval configuration time (Hellolnterval), and the value of the maintenance interval configuration time (Deadlnterval) is defaulted to be several times the negotiated Hellolnterval.
第一路由器和第二路由器建立通信(如建立两个路由器之间的邻居关系) 后, 只要第二路由器支持报文协商, 第一路由器就可以改变第一间隔配置时间 和第一维持配置时间, 可以配置成支持报文协商或者不支持报文协商, 参阅图 4, 第一路由器和第二路由器维持通信过程包括: After the first router and the second router establish communication (such as establishing a neighbor relationship between the two routers), the first router can change the first interval configuration time and the first maintenance configuration time as long as the second router supports packet negotiation. It can be configured to support packet negotiation or not to support packet negotiation. Referring to FIG. 4, the first router and the second router maintain the communication process including:
步骤 401、 第一路由器收到来自第二路由器的第二报文, 从第二报文中的
第二标识(用以标识第二路由器是否支持 Hello报文协商)获知第二路由器支 持 Hello报文协商, 根据第二报文中的第二间隔配置时间和自己的第一间隔配 置时间,按照预设的选举标准选举第一发 ^J'司隔并保存, 以第一发报间隔向第 二路由器发送第三报文, 其中, 第三报文为 2 - way Hello报文, 包括: 第一 标识, 第一路由器的 ID, 第二路由器的 ID, 第一间隔配置时间和第一维持配 置时间; 根据第二报文中的第二维持配置时间和自己的第一维持配置时间,按 照预设的选举标准选举第一收报时限,第一收报时限为第一路由器实际允许接 收不到来自第二路由器的 Hello报文的最大时限; Step 401: The first router receives the second packet from the second router, where the second packet is in the second packet. The second identifier is used to identify whether the second router supports the Hello packet negotiation. The second router supports the Hello packet negotiation, and configures the time according to the second interval in the second packet and the first interval configuration time of the second packet. The first election message is sent to the second router and the third message is sent to the second router. The third message is a 2-way Hello message, including: The identifier, the ID of the first router, the ID of the second router, the first interval configuration time, and the first maintenance configuration time; according to the second maintenance configuration time in the second packet and the first maintenance configuration time of the second packet, according to the preset The first time limit for the election of the election criteria is the first time limit for receiving the Hello message from the second router.
第一路由器和第二路由器的选举标准最好取得一致, 因为选举标准一致, 双方的发报间隔和收报时限才相同,如果第一路由器和第二路由器的选举标准 不一致, 双方的发报间隔或收报时限就不同, 一方就要满足另一方的发报间隔 和收报时限的要求, 否则邻居关系可能出现振荡。 例如, 第一间隔配置时间为 The election criteria of the first router and the second router are preferably consistent. Because the election criteria are the same, the reporting interval and the receiving time limit of the two parties are the same. If the election criteria of the first router and the second router are inconsistent, the interval between the two parties is The time limit for receiving the report is different. One party must meet the request interval of the other party and the time limit for receiving the report. Otherwise, the neighbor relationship may oscillate. For example, the first interval configuration time is
1S, 第二间隔配置时间为 5S, 第一维持配置时间为 4S, 第二维持配置时间为1S, the second interval configuration time is 5S, the first maintenance configuration time is 4S, and the second maintenance configuration time is
20S, 第一路由器的选举标准为最小值选举, 第一发报间隔为 1S, 第一收报时 限为 4S, 第二路由器的选举标准为最大值选举, 第二发报间隔为 5S, 第二收 报时限为 20 S。 建立通信后, 因为第二发报间隔为 5S, 而第一收报时限为 4S, 第一路由器在 4S内就接收不到来自第二路由器的 Hello报文, 邻居关系破裂。 20S, the election criterion of the first router is the minimum election, the first reporting interval is 1S, the first reporting interval is 4S, the election criterion of the second router is the maximum election, the second reporting interval is 5S, and the second reporting is The time limit is 20 S. After the communication is established, because the second reporting interval is 5S, and the first reporting interval is 4S, the first router does not receive the Hello packet from the second router within 4S, and the neighbor relationship is broken.
步骤 402、 第二路由器根据第三报文中的第一标识判断第一路由器是否支 持 Hello报文协商, 如果是, 执行步骤 403, 如果否, 执行步骤 410。 Step 402: The second router determines, according to the first identifier in the third packet, whether the first router supports Hello packet negotiation. If yes, go to step 403. If no, go to step 410.
步骤 403、 第二路由器判断第三 文中的第一间隔配置时间与前次收到的 Step 403: The second router determines the first interval configuration time in the third text and the previous received
• ^文中的第一间隔配置时间是否相同, 如果不同, 执行步骤 404, 如果相同, 执行步骤 405; 此步骤中的前次收到的 文为第一 ·^艮文。 • If the first interval configuration time in the text is the same, if it is different, go to step 404. If it is the same, go to step 405; the previous received text in this step is the first one.
步骤 404、 第二路由器根据第三报文中的第一间隔配置时间和自己的第二 间隔配置时间, 按照预设的选举标准选举当前的第二发报间隔并保存, 执行步 骤 406。 Step 404: The second router, according to the first interval configuration time in the third packet and the second interval configuration time of the third packet, elects the current second transmission interval according to the preset election criteria and saves, and performs step 406.
步骤 405、 第二路由器以前次选举的第二发报间隔作为当前的第二发报间 隔, 此步骤中前次选举的第二发报间隔为步骤 304中选举的第二发报间隔。 Step 405: The second reporting interval of the previous election of the second router is used as the current second reporting interval, and the second reporting interval of the previous election in this step is the second reporting interval of the election in step 304.
步骤 406、 第二路由器判断第三报文中的第一维持配置时间与前次收到的 报文中的第一维持配置时间是否相同, 如果不同, 执行步骤 407, 如果相同,
执行步骤 408; 此步骤中的前次收到的 文为第一 ·^艮文。 Step 406: The second router determines whether the first maintenance configuration time in the third packet is the same as the first maintenance configuration time in the previous received packet. If not, perform step 407, if the same, Step 408 is performed; the previously received text in this step is the first text.
步骤 407、 第二路由器根据第三报文中的第一维持配置时间和自己的第二 维持配置时间, 按照预设的选举标准选举当前的第二收报时限并保存, 执行步 骤 409。 Step 407: The second router selects and saves the current second receiving time limit according to the preset election criterion according to the first maintenance configuration time and the second maintenance configuration time in the third packet, and performs step 409.
步骤 408、 第二路由器以前次选举的第二收报时限作为当前的第二收报时 限, 此步骤中前次选举的第二收报时限为步骤 304中选举的第二收报时限。 Step 408: The second receiving time limit of the previous election of the second router is used as the current second receiving time limit. The second receiving time limit of the previous election in this step is the second receiving time limit of the election in step 304.
步骤 409、 第二路由器以当前的第二发报间隔发送第四报文, 第四报文为 2 - way Hello报文, 包括: 第一路由器的 ID, 第二路由器的 ID, 第二标识, 第二间隔配置时间和第二维持配置时间,第一路由器和第二路由器工作在协商 工作模式, 结束本流程。 Step 409: The second router sends a fourth packet at the current second sending interval. The fourth packet is a 2-way Hello packet, and includes: an ID of the first router, an ID of the second router, and a second identifier. The second interval configuration time and the second maintenance configuration time, the first router and the second router work in a negotiation working mode, and the process ends.
步骤 410、 第二路由器以第三 "¾文中的第一间隔配置时间为当前的第二发 报间隔, 向第二路由器发送第四报文, 此时, 第四报文为 2 - way Hello报文, 包括: 第一路由器的 ID, 第二路由器的 ID, 第二标识, 第一间隔配置时间和 第一维持配置时间; 以第三报文中第一维持配置时间为第二收报时限, 第一路 由器和第二路由器工作在普通工作模式。 Step 410: The second router sends a fourth packet to the second router in the second interval of the third interval in the third interval, where the fourth packet is a 2-way Hello message. The ID of the first router, the ID of the second router, the second identifier, the first interval configuration time, and the first maintenance configuration time. The first maintenance configuration time in the third packet is the second deadline. A router and a second router operate in a normal working mode.
当第二路由器工作在协商模式 , 第二路由器自身的第二间隔配置时间和 / 或第二维持配置时间发生改变时, 参阅图 5, Hello报文发送过程为: When the second router works in the negotiation mode, and the second interval configuration time and/or the second maintenance configuration time of the second router itself changes, referring to FIG. 5, the hello message sending process is:
步骤 501、 第二路由器判断自身的第二间隔配置时间和第二维持配置时间 是否发生变化, 当仅改变第二间隔配置时间时, 即将 HelloInterval21 改变成 HelloInterval22 ,执行步骤 502, 当仅改变第二维持配置时间,将 Deadlnterval21 改变成 Deadlnterval22时, 执行步骤 503 , 当第二间隔配置时间和第二维持配 置时间同时改变, 即将 HelloInterval21 改变成 HelloInterval22 , 且将 Deadlnterval21改变成 Deadlnterval22时, 执行步骤 504。 Step 501: The second router determines whether the second interval configuration time and the second maintenance configuration time of the second router change. When only the second interval configuration time is changed, the HelloInterval21 is changed to HelloInterval22, and step 502 is performed, when only the second maintenance is changed. When the change time is changed to Deadlnterval22, step 503 is executed. When the second interval configuration time and the second maintenance configuration time are changed simultaneously, that is, HelloInterval21 is changed to HelloInterval22, and Deadlnterval21 is changed to Deadlnterval22, step 504 is performed.
步骤 502、 第二路由器根据当前的第二间隔配置时间和第一路由器当前的 第一间隔配置时间, 选举当前的第二发 间隔; 以当前的第二发报间隔发送第 五报文, 此时, 第五报文为 2 - way Hello报文, 包括: 第一路由器 ID、 第二 路由器 ID、 第二标识、 当前的第二间隔配置时间 HelloInterval22和当前的第 二维持配置时间 Deadlnterval21; 其结束本流程。 Step 502: The second router elects a current second sending interval according to the current second interval configuration time and the current first interval configuration time of the first router. The fifth packet is sent at the current second sending interval. The fifth packet is a 2-way Hello message, including: a first router ID, a second router ID, a second identifier, a current second interval configuration time HelloInterval22, and a current second maintenance configuration time Deadlnterval21; Process.
步骤 503、 第二路由器根据当前的第二维持配置时间和第一路由器当前的
第一维持配置时间, 选举当前的第二收报时限, 此时, 第五报文包括: 第一路 由器 ID、 第二路由器 ID、 第二标识、 当前的第二间隔配置时间 HelloInterval21 和当前的第二维持配置时间 Deadlnterval22; 结束本流程。 Step 503: The second router according to the current second maintenance configuration time and the current current of the first router The first maintaining the configuration time, and electing the current second receiving time limit. At this time, the fifth message includes: a first router ID, a second router ID, a second identifier, a current second interval configuration time HelloInterval21, and a current second. Maintain the configuration time Deadlnterval22; End this process.
步骤 504、 第二路由器根据当前的第二间隔配置时间和第一路由器当前的 第一间隔配置时间, 选举当前的第二发 ^艮间隔; 居当前的第二维持配置时间 和第一路由器当前的第一维持配置时间, 选举当前的第二收报时限; 在前次选 举的第二收报时限内,以前次选举的第二发报间隔和当前的第二发报间隔中较 小者向第一路由器发送第五报文, 在前次选举的第二收报时限后, 以当前的第 二发报间隔向第一路由器发送第五报文,此时,第五报文包括:第一路由器 ID、 第二路由器 ID、 第二标识、 当前的第二间隔配置时间 HelloInterval22和当前 的第二维护配置时间 Deadlnterval22。 Step 504: The second router elects a current second transmission interval according to the current second interval configuration time and the current first interval configuration time of the first router, and the current second maintenance configuration time and the current current configuration of the first router. The first maintaining the configuration time, and electing the current second receiving time limit; in the second receiving time limit of the previous election, the second of the previous election interval and the current second reporting interval are the smaller ones to the first router. After the second packet is sent, the fifth packet is sent to the first router at the current second reporting interval, and the fifth packet includes: the first router ID, the first packet. The second router ID, the second identifier, the current second interval configuration time HelloInterval22, and the current second maintenance configuration time Deadlnterval22.
其中,第一路由器当前的第一间隔配置时间和第一维持配置时间由当前收 到的报文获知; 前次选举的第二发报间隔为: 在收到当前报文的前一个来自第 一路由器的报文时选举的第二发报间隔; 前次选举的第二收报时限为: 在收到 当前报文的前一个来自第一路由器的报文时选举的第二收报时限。 The current first interval configuration time and the first maintenance configuration time of the first router are learned by the currently received packet; the second transmission interval of the previous election is: the first one of the current message is received from the first The second interval for the election of the router is the second interval for the election. The second period for the previous election is: the second deadline for the election of the packet from the first router when the current packet is received.
在第二路由器前次选举的收报时限内,以前次选举的第二发报间隔和当前 的第二发报间隔中较小者向第一路由器发送报文,是为了避免当前选举的第二 发报间隔和第二收报时限与前次选举的第二发报间隔和第二收报时限改变较 大, 向第一路由器发送的通知报文丢失。 例如, 第二路由器原来配置的 HelloInterval21 为 I S , Deadlnterval21 为 4S , 第一路由器原来配置的 Hellolntervalll为 2S, Deadlntervalll为 8S, 两个路由器的选举标准相同, 为 最大值选举, 则第一发报间隔和第二发报间隔都为 2S, 第一收报时限和第二 收报时限都为 8S。 进而, 如果第二路由器改变配置值, HelloInterval22为 10S, Deadlnterval22为 40S,当前选举的第二发报间隔为 10S,第二收报时限为 40S, 此时, 第二路由器应该在前次选举的第二收艮时限 8S内, 以前次选举的第二 发报间隔 2S向第一路由器发送报文, 通知第一路由器改变选举值, 如果以当 前选举的第二发报间隔 10S向第一路由器发送报文,由于第一路由器前次选举 的第一收报时限为 8S,在 8S内不可能收到来自第二路由器的报文,通信中断, 第一路由器取消邻居关系。
一台路由器有多个接口, 每一个接口下面连接至少一台路由器, 每个接口 下的路由器的工作模式通常是相同的, 即为协商模式或者为普通工作模式, 因 网絡中每两个路由器都是通过接口彼此连接的,所以只要网络中有一个邻居路 由器不支持协商, 该网络的所有路由器都工作在普通工作模式。 一旦网络中不 支持协商的邻居路由器离开, 即网络中没有邻居路由器不支持协商, 则路由器 可以切换到协商模式。 In the closing time limit of the previous election of the second router, the smaller one of the second reporting interval and the current second reporting interval of the previous election sends a message to the first router, in order to avoid the second round of the current election. The reporting interval and the second reporting deadline are significantly different from the second reporting interval and the second reporting interval of the previous election, and the notification packet sent to the first router is lost. For example, the HelloInterval21 configured by the second router is IS, the Deadlnterval21 is 4S, the Hellolntervalll of the first router is 2S, and the Deadlntervalll is 8S. The election criteria of the two routers are the same, and the maximum interval is elected. The second reporting interval is 2S, and the first reporting deadline and the second reporting deadline are both 8S. Further, if the second router changes the configuration value, HelloInterval22 is 10S, Deadlnterval22 is 40S, the second interval of the current election is 10S, and the second reporting time is 40S. At this time, the second router should be the second in the previous election. In the 8S receiving time limit, the second sending interval 2S of the previous election sends a message to the first router, informing the first router to change the election value, and sending a message to the first router at the second reporting interval 10S of the current election. Because the first reporting time limit of the first election of the first router is 8S, it is impossible to receive the packet from the second router within 8S, the communication is interrupted, and the first router cancels the neighbor relationship. A router has multiple interfaces. Each interface is connected to at least one router. The working mode of the routers on each interface is usually the same, that is, the negotiation mode or the normal working mode, because every two routers in the network are They are connected to each other through interfaces, so all routers in the network work in normal working mode as long as there is a neighbor router in the network that does not support negotiation. Once the neighboring routers in the network that do not support negotiation leave, that is, no neighboring routers in the network do not support negotiation, the router can switch to the negotiation mode.
选举标准的配置^ ^于接口的,同一台路由器的多个接口可以有不同的选 举标准, 也可以在同一个接口上配置多个选举标准, 即根据邻居的不同使用状 态配置不同的选举标准; 邻居关系建立后, 当路由器接口工作在协商模式时, 如果路由器选举标准发生变化,可以在维持邻居关系的基础上根据新的选举标 准重新选举发报间隔和收报时限,且对于发报间隔和收报时限可以使用相同的 选举标准, 以避免邻居关系的不稳定。 The configuration of the election criteria ^ ^ On the interface, multiple interfaces of the same router can have different election criteria, and multiple election criteria can be configured on the same interface, that is, different election criteria are configured according to the different usage states of the neighbors; After the neighbor relationship is established, when the router interface works in the negotiation mode, if the router election criteria changes, the interval for reporting and the time limit for receiving the report can be re-elected according to the new election criteria, and the interval for reporting and receiving is reported. Time limits can use the same election criteria to avoid instability in neighbor relationships.
参阅图 6, 其为本发明实施例二提供的一种路由器结构图。 本实施例中的 路由器包括: 报文接收单元 601, 第一存储单元 602 , 发报间隔选择单元 603, · ^文发送单元 604 , 其中, FIG. 6 is a structural diagram of a router according to Embodiment 2 of the present invention. The router in this embodiment includes: a message receiving unit 601, a first storage unit 602, a reporting interval selecting unit 603, and a text sending unit 604, where
报文接收单元 601 , 用于接收来自邻居路由器(如第一路由器) 的第一报 文, 第一报文包括: 第一间隔配置时间; The message receiving unit 601 is configured to receive a first packet from a neighboring router, such as the first router, where the first packet includes: a first interval configuration time;
第一存储单元 602 , 用于存储第二间隔配置时间; a first storage unit 602, configured to store a second interval configuration time;
发报间隔选择单元 603, 用于当第二间隔配置时间与第一间隔配置时间不 同时, 参考所述第一间隔配置时间确定第二发报间隔; a reporting interval selection unit 603, configured to determine a second reporting interval by referring to the first interval configuration time when the second interval configuration time is different from the first interval configuration time;
报文发送单元 604 , 用于在第二发报间隔时间内发送第二 4艮文。 The message sending unit 604 is configured to send the second message in the second reporting interval.
报文接收单元 601接收的第一报文还包括: 第一维持配置时间; 可选的, 该路由器还包括: The first packet received by the packet receiving unit 601 further includes: a first maintenance configuration time; optionally, the router further includes:
第二存储单元 605, 用于存储第二维持配置时间; a second storage unit 605, configured to store a second maintenance configuration time;
收报时限选择单元 606 , 用于参考报文接收单元 601接收的第一报文中的 第一维持配置时间确定第二收报时限。 例如, 在第一路由器支持报文协商的情 况下,按照选举标准,根据所述第一维持配置时间和第二存储单元 605中的第 二维持配置时间确定第二收报时限; 或者, 在第一路由器不支持报文协商的情 况下, 以所述第一维持配置时间为所述第二收报时限。
报文接收单元 601中的第一报文还包括: 第一标识, 所述第一标识用以表 示第一路由器是否支持报文协商; The aging time selection unit 606 is configured to determine a second acknowledgment time limit in the first maintenance configuration time in the first message received by the reference message receiving unit 601. For example, in the case that the first router supports the packet negotiation, the second receiving time limit is determined according to the first maintenance configuration time and the second maintenance configuration time in the second storage unit 605 according to the election criteria; or, in the first In the case that the router does not support the packet negotiation, the first maintenance configuration time is the second receiving time limit. The first packet in the packet receiving unit 601 further includes: a first identifier, where the first identifier is used to indicate whether the first router supports packet negotiation;
可选的, 该路由器还包括: Optionally, the router further includes:
报文协商判断单元 607 , 用于根据第一标识判断邻居路由器是否支持报文 协商, 输出判断结果。 The message negotiation determining unit 607 is configured to determine, according to the first identifier, whether the neighboring router supports the message negotiation, and output the determination result.
标识存储单元 608 , 用于存储第二标识; An identifier storage unit 608, configured to store the second identifier;
发艮间隔选择单元 603包括: 第一选择单元 701。 第一选择单元 701 , 用 于当第二间隔配置时间与第一间隔配置时间不同时, 且当报文协商判断单元 607的判断结果为是(即第一路由器支持报文协商) 时, 按照选举标准, 根据 来自第一存储单元 602的第二间隔配置时间和来自报文接收单元 601的第一间 隔配置时间, 选举第二发 4艮间隔; The hairline interval selecting unit 603 includes: a first selecting unit 701. The first selecting unit 701 is configured to: when the second interval configuration time is different from the first interval configuration time, and when the judgment result of the message negotiation determining unit 607 is yes (that is, the first router supports message negotiation), according to the election Standard, according to the second interval configuration time from the first storage unit 602 and the first interval configuration time from the message receiving unit 601, the second transmission interval is elected;
报文发送单元 604发送的第二报文包括:来自标识存储单元 608的第二标 识, 来自第一存储单元 602的第二间隔配置时间。 The second message sent by the message sending unit 604 includes: a second identifier from the identifier storage unit 608, and a second interval configuration time from the first storage unit 602.
收报时限选择单元 606包括: 第二选择单元 801 , The closing time limit selection unit 606 includes: a second selection unit 801,
第二选择单元 801 , 用于当报文协商判断单元 607的判断结果为是(即第 一路由器支持报文协商)时, 按照选举标准, 根据来自第二存储单元 605的第 二维持配置时间和来自报文接收单元 601的第一维持配置时间 ,选举第二收报 时限。 The second selecting unit 801 is configured to: when the result of the message negotiation determining unit 607 is yes (ie, the first router supports message negotiation), according to the election criterion, according to the second maintenance configuration time from the second storage unit 605 The first maintenance configuration time from the message receiving unit 601 is to elect a second closing time limit.
发报间隔选择单元 603还包括: 第三选择单元 702。 第三选择单元 702, 用于 当报文协商判断单元 607的判断结果为否(即第一路由器不支持报文协商)时, 以才艮文接收单元 601的第一间隔配置时间为第二发 4艮间隔; The transmission interval selection unit 603 further includes: a third selection unit 702. The third selecting unit 702 is configured to: when the result of the message negotiation determining unit 607 is negative (that is, the first router does not support the message negotiation), the first interval configuration time of the packet receiving unit 601 is the second sending. 4艮 interval;
报文发送单元 604发送的第二报文包括:来自标识存储单元 608的第二标 识, 来自报文接收单元 601的第一间隔配置时间; The second message sent by the message sending unit 604 includes: a second identifier from the identifier storage unit 608, and a first interval configuration time from the message receiving unit 601;
收报时限选择单元 606还包括: 第四选择单元 802, The closing time limit selection unit 606 further includes: a fourth selection unit 802,
第四选择单元 802 , 用于当报文协商判断单元 607的判断结果为否 (即第 一路由器不支持报文协商)时, 以来自报文接收单元 601的第一维持配置时间 为第二收报时限。 The fourth selecting unit 802 is configured to: when the result of the message negotiation determining unit 607 is negative (that is, the first router does not support the message negotiation), the first maintenance configuration time from the message receiving unit 601 is the second receiving report. time limit.
发报间隔选择单元 603还包括: 第五选择单元 703 , 用于以报文接收单元 601的第一间隔配置时间为第二发报间隔; 可以根据实际情况, 在第五选择单
元 703和第三选择单元 702中选择一种。 The report interval selection unit 603 further includes: a fifth selection unit 703, configured to use the first interval configuration time of the message receiving unit 601 as the second report interval; One of the element 703 and the third selection unit 702 is selected.
报文发送单元 604发送的第二报文包括:来自报文接收单元 601的第一间 隔配置时间; The second message sent by the message sending unit 604 includes: a first interval configuration time from the message receiving unit 601;
收报时限选择单元 606还包括: 第六选择单元 803 , 用于以来自报文接收 单元 601的第一维持配置时间为第二收报时限。 可以根据实际情况, 在第六选 择单元 803和第四选择单元 802中选择一种。 The acknowledgment time limit selection unit 606 further includes: a sixth selection unit 803, configured to use the first maintenance configuration time from the message receiving unit 601 as a second acknowledgment time limit. One of the sixth selection unit 803 and the fourth selection unit 802 can be selected according to the actual situation.
可选的, 路由器还包括: 第一判断单元 609, 用于判断报文接收单元 601 接收的相邻两个报文中的第一间隔配置时间是否相同,生成第一判断结果并输 出;还可以判断报文接收单元 601接收的相邻两个报文中的第一维持配置时间 是否相同, 生成第二判断结果并输出; Optionally, the router further includes: a first determining unit 609, configured to determine whether the first interval configuration time in the two adjacent packets received by the packet receiving unit 601 is the same, generate a first determination result, and output; Determining whether the first maintenance configuration time of the two adjacent messages received by the message receiving unit 601 is the same, generating a second determination result, and outputting;
第一选择单元 701用于当来自第一判断单元 609的第一判断结果为是时, 以前次选举的第一发报间隔为当前的第一发报间隔; The first selection unit 701 is configured to: when the first determination result from the first determining unit 609 is YES, the first reporting interval of the previous election is the current first reporting interval;
第二选择单元 801用于当来自第一判断单元 609的第二判断结果为是时, 以前次选举的第一收报时限为当前的第一收报时限。 The second selection unit 801 is configured to: when the second determination result from the first determining unit 609 is YES, the first closing time limit of the previous election is the current first closing time limit.
可选的, 路由器还包括: 第二判断单元 610, 用于判断第一存储单元 602 存储的第二间隔配置时间是否发生变化,判断第二存储单元 605存储的第二维 持配置时间是否发生变化,如果第二间隔配置时间和第二维持配置时间同时发 生变化时, 生成通知消息并输出; Optionally, the router further includes: a second determining unit 610, configured to determine whether the second interval configuration time stored by the first storage unit 602 changes, and determining whether the second maintenance configuration time stored by the second storage unit 605 changes Generating a notification message and outputting if the second interval configuration time and the second maintenance configuration time change simultaneously;
报文发送单元 604, 用于在收到第二判断单元 610的通知消息后, 在第二 选择单元 801前次选举的第一收才艮时限内,以第一选择单元 701当前的第一发 报间隔和前次选举的第一发报间隔中较小者向邻居路由器发送第五报文,第五 4艮文包括: 第二标识, 来自第一存储单元 602的当前的第二间隔配置时间和, 来自第二存储单元 605的当前的第二维持配置时间,在前次选举的第一收报时 限后, 以当前选举的第一发报间隔发送第五报文。 The message sending unit 604 is configured to: after receiving the notification message of the second determining unit 610, in the first receiving time limit of the previous election of the second selecting unit 801, the current first sending by the first selecting unit 701 The smaller one of the first interval of the report interval and the previous election sends a fifth message to the neighboring router. The fifth message includes: a second identifier, a current second interval configuration time from the first storage unit 602. And the current second maintenance configuration time from the second storage unit 605, after the first reporting time limit of the previous election, sending the fifth message at the first reporting interval of the current election.
从以上分析可以看出,本发明的实施例将第二路由器配置成支持报文协商 的路由器,在第一路由器配置的第一间隔配置时间与第二路由器配置的第二间 隔配置时间不相同时, 第二路由器确定第二发报间隔, 在第二发报间隔时间内 发送第二报文, 和第一路由器建立通信, 建立邻居关系; 可以在维持通信的基 础上改变第二间隔配置时间或 /和第二维持配置时间, 在实际应用中能满足许
多特定网络的需要, 比如优雅重启 GR, 可以在需要的时候延长第二维持配置 时间, 提高 GR的成功率; 第一路由器开始时按照自己配置的第一间隔配置时 间发送第一报文, 当第一路由器为高速设备, 第二路由器为低速设备时, 可以 以高速设备的速度来发现低速设备, 在建立通信后, 可以以低速设备的发报频 率发送报文, 既能利用高速设备的优点, 又对网络的流量不造成影响。 As can be seen from the above analysis, the embodiment of the present invention configures the second router to support the packet negotiation. When the first interval configuration time configured by the first router is different from the second interval configuration time configured by the second router. The second router determines the second reporting interval, sends the second packet in the second reporting interval, establishes a communication with the first router, establishes a neighbor relationship, and may change the second interval configuration time or / and the second maintenance configuration time, can meet the requirements in practical applications For a specific network, for example, gracefully restarting the GR, you can extend the second maintenance configuration time and increase the success rate of the GR when needed. The first router starts sending the first packet according to the first interval configuration time configured by itself. The first router is a high-speed device. When the second router is a low-speed device, the low-speed device can be discovered at the speed of the high-speed device. After the communication is established, the message can be sent at the low-speed device sending frequency, which can utilize the advantages of the high-speed device. , and does not affect the traffic of the network.
以上对本发明所提供的一种建立通信的方法及路由器进行了详细介绍,本 明只是用于帮助理解本发明的方法及其核心思想; 同时, 对于本领域的一般技 术人员, 依据本发明的思想, 在具体实施方式及应用范围上均会有改变之处, 综上所述, 本说明书内容不应理解为对本发明的限制。
The foregoing describes a method and a router for establishing communication provided by the present invention. The present invention is only used to help understand the method and core idea of the present invention. Meanwhile, for those skilled in the art, the idea according to the present invention is The details of the present invention and the scope of application are subject to change. In the above, the contents of the present specification should not be construed as limiting the present invention.
Claims
1、 一种建立通信的方法, 其特征在于, 包括: A method for establishing communication, characterized in that it comprises:
第二路由器接收来自第一路由器的第一报文,所述第一报文包括第一间隔 配置时间; The second router receives the first packet from the first router, where the first packet includes a first interval configuration time;
如果所述第一间隔配置时间与第二路由器的第二间隔配置时间不同,则所 述第二路由器参考所述第一间隔配置时间确定第二发报间隔,并在所述第二发 报间隔时间内向第一路由器发送第二报文, 以建立与第一路由器的通信。 If the first interval configuration time is different from the second interval configuration time of the second router, the second router determines the second reporting interval with reference to the first interval configuration time, and at the second reporting interval Sending a second packet to the first router to establish communication with the first router.
2、 根据权利要求 1所述的方法, 其特征在于, 如果所述第一路由器支持 报文协商,则所述第二路由器参考所述第一间隔配置时间确定第二发报间隔具 体包括: 所述第二路由器按照选举标准,根据所述第一报文中的第一间隔配置 时间和所述第二间隔配置时间选举第二发 4艮间隔; The method according to claim 1, wherein, if the first router supports packet negotiation, the second router determines, according to the first interval configuration time, that the second reporting interval specifically includes: According to the election criterion, the second router elects a second transmission interval according to the first interval configuration time and the second interval configuration time in the first packet.
所述第二报文包括所述第二间隔配置时间。 The second message includes the second interval configuration time.
3、 根据权利要求 2所述的方法, 其特征在于, 所述第一报文还包括第一 维持配置时间, 所述方法还包括: 所述第二路由器按照选举标准, 根据所述第 一报文中的所述第一维持配置时间和所述第二路由器的第二维持配置时间选 举第二收报时限; The method according to claim 2, wherein the first packet further includes a first maintenance configuration time, the method further includes: the second router according to an election criterion, according to the first report The first maintaining configuration time in the text and the second maintaining configuration time of the second router electing a second closing time limit;
所述第二报文还包括所述第二维持配置时间。 The second message further includes the second maintenance configuration time.
4、 根据权利要求 2所述的方法, 其特征在于, 所述第一报文中还包括表 示所述第一路由器是否支持报文协商的第一标识,所述第二报文中还包括表示 所述第二路由器是否支持 · ^文协商的第二标识。 The method according to claim 2, wherein the first packet further includes a first identifier indicating whether the first router supports packet negotiation, and the second packet further includes a representation. Whether the second router supports the second identifier of the text negotiation.
5、 根据权利要求 1所述的方法, 其特征在于, 如果所述第一路由器不支 持报文协商,则所述第二路由器参考所述第一间隔配置时间确定第二发报间隔 具体包括: 所述第二路由器以所述第一间隔配置时间为所述第二发报间隔; 所述第二报文包括所述第一间隔配置时间。 The method according to claim 1, wherein, if the first router does not support the packet negotiation, the determining, by the second router, the second interval, by using the first interval configuration time, specifically includes: The second router uses the first interval configuration time as the second transmission interval; the second packet includes the first interval configuration time.
6、 根据权利要求 5所述的方法, 其特征在于, 所述第一报文还包括第一 维持配置时间, 所述方法还包括: 所述第二路由器以所述第一维持配置时间为 第二收报时限; The method according to claim 5, wherein the first packet further includes a first maintenance configuration time, the method further includes: the second router adopting the first maintenance configuration time as a first Second closing time limit;
所述第二报文还包括所述第一维持配置时间。 The second message further includes the first maintenance configuration time.
7、 根据权利要求 1所述的方法, 其特征在于, 所述第一路由器支持报文
协商, 所述方法还包括: The method according to claim 1, wherein the first router supports a packet. Negotiation, the method further includes:
第二路由器接收来自第一路由器的第三报文,所述第三报文包括第一间隔 配置时间; The second router receives a third packet from the first router, where the third packet includes a first interval configuration time;
如果所述第三报文中的第一间隔配置时间与所述第二路由器前次收到的 报文中的第一间隔配置时间不同,则所述第二路由器根据所述第三报文中的第 一间隔配置时间和所述第二间隔配置时间,按照选举标准选举当前的第二发报 间隔, 以所述当前的第二发 4艮间隔发送第四 文。 If the first interval configuration time in the third packet is different from the first interval configuration time in the packet received by the second router, the second router is configured according to the third packet. And the second interval configuration time and the second interval configuration time, the current second transmission interval is elected according to the election criterion, and the fourth text is sent at the current second transmission interval.
8、 根据权利要求 7所述的方法, 其特征在于, 还包括: 8. The method according to claim 7, further comprising:
如果所述第三报文中的第一间隔配置时间与所述第二路由器前次收到报 文中的第一间隔配置时间相同,则以前次选举的第二发报间隔为当前的第二发 间隔。 If the first interval configuration time in the third packet is the same as the first interval configuration time in the second received packet of the second router, the second interval of the previous election is the current second interval. Hair interval.
9、 根据权利要求 1所述的方法, 其特征在于, 所述第一路由器支持报文 协商, 所述方法还包括: The method according to claim 1, wherein the first router supports packet negotiation, and the method further includes:
所述第三报文包括第一维持配置时间; The third packet includes a first maintenance configuration time;
如果所述第三报文中的第一维持配置时间与所述第二路由器前次收到的 报文中的第一维持配置时间不同,则所述第二路由器根据所述第三报文中的第 一维持配置时间和所述第二维持配置时间,按照选举标准选举当前的第二收报 时限。 If the first maintenance configuration time in the third packet is different from the first maintenance configuration time in the packet received by the second router, the second router is configured according to the third packet. The first maintenance configuration time and the second maintenance configuration time, and the current second reception time limit is elected according to the election criteria.
10、 根据权利要求 9所述的方法, 其特征在于, 还包括: 10. The method according to claim 9, further comprising:
如果所述第三报文中的第一维持配置时间与所述第二路由器前次收到报 文中的第一维持配置时间相同,则以前次选举的第二收报时限为当前的第二收 报时限。 If the first maintenance configuration time in the third packet is the same as the first maintenance configuration time in the previous received packet of the second router, the second collection time limit of the previous election is the current second receipt. time limit.
11、 根据权利要求 1至 10中任意一项所述的方法, 其特征在于, 当所述 第二路由器改变第二间隔配置时间和第二维持配置时间时, 所述方法还包括: 所述第二路由器根据当前的第二间隔配置时间和所述第一路由器当前的 第一间隔配置时间, 按照选举标准选举当前的第二发报间隔; 以及根据当前的 第二维持配置时间和所述第一路由器当前的第一维持配置时间,按照选举标准 选举当前的第二收报时限; The method according to any one of claims 1 to 10, wherein, when the second router changes the second interval configuration time and the second maintenance configuration time, the method further includes: And the second router selects a current second transmission interval according to the election criterion according to the current second interval configuration time and the current first interval configuration time of the first router; and according to the current second maintenance configuration time and the first The current first maintenance configuration time of the router, and the current second receiving time limit is elected according to the election criteria;
在前次选举的第二收报时限内,以前次选举的第二发报间隔和当前选举的
第二发报间隔中较小者向第一路由器发送第五报文; During the second closing time limit of the previous election, the second reporting interval of the previous election and the current election The smaller one of the second reporting intervals sends the fifth packet to the first router;
在前次选举的第二收报时限后,以当前的第二发 4艮间隔向第一路由器发送 第五报文。 After the second closing time limit of the previous election, the fifth message is sent to the first router at the current second transmission interval.
12、 根据权利要求 1至 10中任意一项所述的方法, 其特征在于: 当所述第二路由器仅改变第二间隔配置时间时, 所述方法还包括: 所述第 二路由器根据当前的第二间隔配置时间和第一路由器当前的第一间隔配置时 间, 按照选举标准选举当前的第二发报间隔; The method according to any one of claims 1 to 10, wherein: when the second router only changes the second interval configuration time, the method further includes: the second router according to the current The second interval configuration time and the current first interval configuration time of the first router, and the current second transmission interval is elected according to the election criteria;
当所述第二路由器仅改变第二维持配置时间时, 所述方法还包括: 所述第 二路由器根据当前的第二维持配置时间和第一路由器当前的第一维持配置时 间, 按照选举标准选举当前的第二收报时限。 When the second router only changes the second maintenance configuration time, the method further includes: the second router electing according to the election criteria according to the current second maintenance configuration time and the current first maintenance configuration time of the first router The current second closing time limit.
13、 根据权利要求 2、 3、 4、 7、 8、 9、 10、 11或 12所述的方法, 其特征 在于: 13. A method according to claim 2, 3, 4, 7, 8, 9, 10, 11 or 12, characterized in that:
所述选举标准为最大值选举、最小值选举、平均值选举或加权平均值选举。 The election criteria are a maximum election, a minimum election, an average election, or a weighted average election.
14、 根据权利要求 1至 13中任意一项所述的方法, 其特征在于, 所述以 建立与第一路由器的通信具体为: 以建立与第一路由器的邻居关系。 The method according to any one of claims 1 to 13, wherein the establishing the communication with the first router is specifically: establishing a neighbor relationship with the first router.
15、 一种路由器, 其特征在于, 包括: 15. A router, comprising:
报文接收单元, 用于接收来自第一路由器的第一报文, 所述第一报文包括 第一间隔配置时间; a message receiving unit, configured to receive a first packet from the first router, where the first packet includes a first interval configuration time;
第一存储单元, 用于存储第二间隔配置时间; a first storage unit, configured to store a second interval configuration time;
发^ J'司隔选择单元,用于当所述第二间隔配置时间与所述第一间隔配置时 间不同时, 参考所述第一间隔配置时间确定第二发 ·^艮间隔; And determining, by the first interval configuration time, a second transmission interval when the second interval configuration time is different from the first interval configuration time;
报文发送单元,用于在所述第二发报间隔时间内向所述第一路由器发送第 二报文, 以建立与所述第一路由器的通信。 And a message sending unit, configured to send a second message to the first router during the second reporting interval to establish communication with the first router.
16、 根据权利要求 15所述的路由器, 其特征在于, 所述报文接收单元接 收的所述第一报文还包括第一维持配置时间; 所述路由器还包括: The router according to claim 15, wherein the first packet received by the packet receiving unit further includes a first maintenance configuration time; the router further includes:
第二存储单元, 用于存储第二维持配置时间; a second storage unit, configured to store a second maintenance configuration time;
收报时限选择单元,用于在所述第一维持配置时间和所述第二维持配置时 间不同时, 参考所述第一维持配置时间确定第二收报时限。 The aging time selection unit is configured to determine a second acknowledgment time limit with reference to the first maintenance configuration time when the first maintenance configuration time and the second maintenance configuration time are different.
17、 根据权利要求 15所述的路由器, 其特征在于, 所述发报间隔选择单
元包括: 第一选择单元, 用于当所述第二间隔配置时间与所述第一间隔配置时 间不同并且所述第一路由器支持报文协商时,按照选举标准根据所述第二间隔 配置时间和所述第一间隔配置时间选举第二发报间隔; The router according to claim 15, wherein the transmission interval selection list The element includes: a first selecting unit, configured to configure a time according to the second interval according to an election criterion when the second interval configuration time is different from the first interval configuration time and the first router supports message negotiation And selecting, by the first interval configuration time, a second reporting interval;
所述报文发送单元发送的第二报文包括所述第二间隔配置时间。 The second packet sent by the packet sending unit includes the second interval configuration time.
18、 根据权利要求 16所述的路由器, 其特征在于, 所述收报时限选择单 元包括: The router according to claim 16, wherein the receiving time limit selection unit comprises:
第二选择单元,用于当所述第一维持配置时间和所述第二维持配置时间不 同并且所述第一路由器支持■ ^文协商时,按照选举标准根据所述第二维持配置 时间和所述第一报文中的第一维持配置时间选举第二收报时限。 a second selecting unit, configured to: according to the election criterion, according to the second maintenance configuration time and location, when the first maintenance configuration time and the second maintenance configuration time are different and the first router supports the negotiation The first maintenance configuration time in the first packet is used to elect a second deadline.
19、 根据权利要求 15所述的路由器, 其特征在于, 所述发报间隔选择单 元包括: 第三选择单元, 用于当所述第二间隔配置时间与所述第一间隔配置时 间不同并且所述第一路由器不支持报文协商时,以所述第一报文中的第一间隔 配置时间为第二发报间隔; The router according to claim 15, wherein the transmission interval selection unit comprises: a third selection unit, configured to: when the second interval configuration time is different from the first interval configuration time, When the first router does not support the packet negotiation, the first interval in the first packet is configured as the second interval.
所述报文发送单元发送的第二报文包括所述第一间隔配置时间。 The second packet sent by the packet sending unit includes the first interval configuration time.
20、 根据权利要求 16所述的路由器, 其特征在于, 所述收报时限选择单 元包括: The router according to claim 16, wherein the receiving time limit selection unit comprises:
第四选择单元,用于当所述第一维持配置时间和所述第二维持配置时间不 同并且所述第一路由器不支持报文协商时,以所述第一报文中的第一维持配置 时间为第二收报时限。 a fourth selecting unit, configured to: when the first maintaining configuration time and the second maintaining configuration time are different, and the first router does not support packet negotiation, using a first maintenance configuration in the first packet Time is the second closing time limit.
21、 根据权利要求 15至 20中任意一项所述的路由器, 其特征在于: 所述 报文接收单元接收到的所述第一报文还包括用以表示所述第一路由器是否支 持报文协商的第一标识; The router according to any one of claims 15 to 20, wherein the first packet received by the packet receiving unit further includes a flag indicating whether the first router supports the packet. The first identifier of the negotiation;
所述路由器还包括: 报文协商判断单元, 用于根据所述第一标识判断所述 第一路由器是否支持报文协商, 输出判断结果; 标识存储单元, 用于存储用以 表示所属路由器是否支持报文协商的第二标识; The router further includes: a packet negotiation determining unit, configured to determine, according to the first identifier, whether the first router supports packet negotiation, and output a determination result; and the identifier storage unit is configured to store whether the router belongs to the router The second identifier of the message negotiation;
所述报文发送单元发送的所述第二报文包括所述第二标识。 The second packet sent by the packet sending unit includes the second identifier.
22、 根据权利要求 17所述的路由器, 其特征在于, 还包括: The router according to claim 17, further comprising:
第一判断单元,用于判断所述报文接收单元接收的相邻两个报文中的第一 间隔配置时间是否相同, 生成第一判断结果并输出;
所述第一选择单元还用于当来自所述第一判断单元的第一判断结果为是 时, 以前次选举的第一发 4艮间隔为当前的第一发 ^艮间隔。 a first determining unit, configured to determine whether the first interval configuration time of the two adjacent packets received by the packet receiving unit is the same, generating a first determination result, and outputting; The first selecting unit is further configured to: when the first determination result from the first determining unit is YES, the first sending interval of the previous election is the current first sending interval.
23、 根据权利要求 18所述的路由器, 其特征在于, 还包括: The router according to claim 18, further comprising:
第一判断单元,用于判断所述报文接收单元接收的相邻两个报文中的第一 维持配置时间是否相同, 生成第二判断结果并输出; a first determining unit, configured to determine whether the first maintaining configuration time of the two adjacent messages received by the message receiving unit is the same, generating a second determination result, and outputting;
所述第二选择单元还用于当来自所述第一判断单元的第二判断结果为是 时, 以前次选举的第一收报时限为当前的第一收报时限。 The second selecting unit is further configured to: when the second determining result from the first determining unit is yes, the first receiving time limit of the previous election is the current first receiving time limit.
24、 根据权利要求 18所述的路由器, 其特征在于, 所述发报间隔选择单 元包括: 第一选择单元, 用于当所述第二间隔配置时间与所述第一间隔配置时 间不同并且所述第一路由器支持报文协商时,按照选举标准根据所述第二间隔 配置时间和所述第一报文中的第一间隔配置时间选举第二发报间隔; The router according to claim 18, wherein the reporting interval selecting unit comprises: a first selecting unit, configured to: when the second interval configuration time is different from the first interval configuration time, When the first router supports the packet negotiation, the second reporting interval is elected according to the second interval configuration time and the first interval configuration time in the first packet according to the election criteria;
所述报文发送单元发送的第二报文包括所述第二间隔配置时间; 所述路由器还包括: The second packet sent by the packet sending unit includes the second interval configuration time; the router further includes:
第二判断单元,用于判断所述第一存储单元存储的所述第二间隔配置时间 是否发生变化,判断所述第二存储单元存储的所述第二维持配置时间是否发生 变化, 如果所述第二间隔配置时间和所述第二维持配置时间同时发生变化, 则 生成通知消息并输出; a second determining unit, configured to determine whether the second interval configuration time stored by the first storage unit changes, and determining whether the second maintenance configuration time stored by the second storage unit changes The second interval configuration time and the second maintenance configuration time change simultaneously, and a notification message is generated and output;
报文发送单元, 用于在收到所述第二判断单元的所述通知消息后, 在所述 第二选择单元前次选举的第一收报时限内,以所述第一选择单元当前的第一发 报间隔和前次选举的第一发报间隔中较小者向邻居路由器发送第五报文,所述 第五报文包括: 所述第二标识, 来自所述第一存储单元的所述当前的第二间隔 配置时间和当前的第二维持配置时间; 在前次选举的第一收报时限后, 以当前 选举的第一发报间隔发送所述第五报文。 a message sending unit, configured to: after receiving the notification message of the second determining unit, in a first receiving time limit of a previous election of the second selecting unit, by using a current The smaller one of the first reporting interval of the reporting interval and the previous election sends a fifth packet to the neighboring router, where the fifth packet includes: the second identifier, the location from the first storage unit The current second interval configuration time and the current second maintenance configuration time are sent. After the first reporting time limit of the previous election, the fifth message is sent at the first reporting interval of the current election.
25、 根据权利要求 15至 20中任意一项所述的路由器, 其特征在于, 所述 以建立与第一路由器的通信具体为: 以建立与第一路由器的邻居关系。
The router according to any one of claims 15 to 20, wherein the establishing the communication with the first router is specifically: establishing a neighbor relationship with the first router.
Applications Claiming Priority (2)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN200710002703.8 | 2007-01-23 | ||
CN200710002703.8A CN101026559B (en) | 2007-01-23 | 2007-01-23 | Communication establishing method and router |
Publications (1)
Publication Number | Publication Date |
---|---|
WO2008089680A1 true WO2008089680A1 (en) | 2008-07-31 |
Family
ID=38744471
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
PCT/CN2008/070117 WO2008089680A1 (en) | 2007-01-23 | 2008-01-16 | A method and router for establishing communication |
Country Status (2)
Country | Link |
---|---|
CN (1) | CN101026559B (en) |
WO (1) | WO2008089680A1 (en) |
Families Citing this family (5)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN101026559B (en) * | 2007-01-23 | 2010-07-28 | 华为技术有限公司 | Communication establishing method and router |
CN101686188B (en) * | 2008-09-27 | 2013-01-09 | 华为技术有限公司 | Method for establishing route table, routing method and router in hierarchy sequential address packet network |
CN102281194A (en) * | 2011-08-01 | 2011-12-14 | 华为技术有限公司 | Message transmission method and network equipment |
CN104022910B (en) * | 2014-06-25 | 2018-01-09 | 新华三技术有限公司 | A kind of parameter consultation method and its device |
WO2022236621A1 (en) * | 2021-05-10 | 2022-11-17 | 北京小米移动软件有限公司 | Data packet sending method and apparatus, and storage medium |
Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002034002A1 (en) * | 2000-10-17 | 2002-04-25 | Telefonaktiebolaget Lm Ericsson (Publ) | Method of improving the performance between one mobile station and a base station by selective setting of the retransmission time-out values |
CN1622547A (en) * | 2003-11-28 | 2005-06-01 | 华为技术有限公司 | Link management method |
CN101026559A (en) * | 2007-01-23 | 2007-08-29 | 华为技术有限公司 | Communication establishing method and router |
-
2007
- 2007-01-23 CN CN200710002703.8A patent/CN101026559B/en not_active Expired - Fee Related
-
2008
- 2008-01-16 WO PCT/CN2008/070117 patent/WO2008089680A1/en active Application Filing
Patent Citations (3)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
WO2002034002A1 (en) * | 2000-10-17 | 2002-04-25 | Telefonaktiebolaget Lm Ericsson (Publ) | Method of improving the performance between one mobile station and a base station by selective setting of the retransmission time-out values |
CN1622547A (en) * | 2003-11-28 | 2005-06-01 | 华为技术有限公司 | Link management method |
CN101026559A (en) * | 2007-01-23 | 2007-08-29 | 华为技术有限公司 | Communication establishing method and router |
Non-Patent Citations (1)
Title |
---|
MOY J.: "Ascend Communications", INC. NETWORK WORKING GROUP REQUEST FOR COMMENTS: 2328 OSPF VERSION 2, April 1998 (1998-04-01) * |
Also Published As
Publication number | Publication date |
---|---|
CN101026559A (en) | 2007-08-29 |
CN101026559B (en) | 2010-07-28 |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
US7843817B2 (en) | Congestion control in wireless mesh networks | |
US9622276B2 (en) | Method and device for determining to establish multi-protocol label switching traffic engineering tunnel | |
WO2012003743A1 (en) | Method and apparatus for forwarding multicast traffic | |
US8085710B2 (en) | Minimizing packet loss during fast roaming | |
WO2005020022A2 (en) | Self-healing tree network | |
WO2006130279A1 (en) | Multiple wireless spanning tree protocol for use in a wireless mesh network | |
WO2008040170A1 (en) | Multi-hop wireless relay communication system and downlink data transmitting method and device thereof | |
WO2008031334A1 (en) | Route updating method, system and router | |
WO2021232841A1 (en) | Communication method and apparatus | |
WO2015096409A1 (en) | Method, device and system for discovering link in software-defined network | |
JP2011004298A (en) | Packet transfer system, network management device, and edge node | |
WO2015070383A1 (en) | Link aggregation method, apparatus, and system | |
WO2007003088A1 (en) | A method and system for updating a route | |
WO2021227561A1 (en) | Communication method and apparatus | |
WO2007076661A1 (en) | A congestion controlling method and network device for real time multicasting service. | |
WO2010095028A2 (en) | Maximum transmission unit (mtu) size discovery mechanism and method for data-link layers | |
WO2012167474A1 (en) | Method, device and system for detecting network loop | |
WO2012162672A1 (en) | Multipath overlay network and its multipath management protocol | |
WO2008089680A1 (en) | A method and router for establishing communication | |
CN102281533B (en) | Method, system and router for establishing LSP based on RT | |
WO2012163219A1 (en) | Lsp network congestion processing method, device and system | |
EP3989511A1 (en) | Supporting multiple transport options for border gateway protocol | |
WO2012040971A1 (en) | Key management method and system for routing protocol | |
CN109873763B (en) | Communication method and device | |
EP2523401B1 (en) | Virtual networks within a physical network |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
121 | Ep: the epo has been informed by wipo that ep was designated in this application |
Ref document number: 08700775 Country of ref document: EP Kind code of ref document: A1 |
|
NENP | Non-entry into the national phase |
Ref country code: DE |
|
122 | Ep: pct application non-entry in european phase |
Ref document number: 08700775 Country of ref document: EP Kind code of ref document: A1 |