WO2012103731A1 - 路由器邻居建立方法和设备 - Google Patents

路由器邻居建立方法和设备 Download PDF

Info

Publication number
WO2012103731A1
WO2012103731A1 PCT/CN2011/076665 CN2011076665W WO2012103731A1 WO 2012103731 A1 WO2012103731 A1 WO 2012103731A1 CN 2011076665 W CN2011076665 W CN 2011076665W WO 2012103731 A1 WO2012103731 A1 WO 2012103731A1
Authority
WO
WIPO (PCT)
Prior art keywords
router
neighboring
neighbor
local
information
Prior art date
Application number
PCT/CN2011/076665
Other languages
English (en)
French (fr)
Inventor
秦韵
Original Assignee
华为技术有限公司
Priority date (The priority date is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the date listed.)
Filing date
Publication date
Application filed by 华为技术有限公司 filed Critical 华为技术有限公司
Priority to EP11857722.0A priority Critical patent/EP2648375B1/en
Priority to PCT/CN2011/076665 priority patent/WO2012103731A1/zh
Priority to CN201180000922.7A priority patent/CN102318287B/zh
Publication of WO2012103731A1 publication Critical patent/WO2012103731A1/zh
Priority to US14/010,205 priority patent/US9154401B2/en

Links

Classifications

    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/026Details of "hello" or keep-alive messages
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L45/00Routing or path finding of packets in data switching networks
    • H04L45/02Topology update or discovery
    • H04L45/03Topology update or discovery by updating link state protocols
    • HELECTRICITY
    • H04ELECTRIC COMMUNICATION TECHNIQUE
    • H04LTRANSMISSION OF DIGITAL INFORMATION, e.g. TELEGRAPHIC COMMUNICATION
    • H04L12/00Data switching networks
    • H04L12/66Arrangements for connecting between networks having differing types of switching systems, e.g. gateways

Definitions

  • the embodiments of the present invention relate to the field of information technology, and in particular, to a router neighbor establishment method and device. Background technique
  • Open Shortest Path First is an internal gateway protocol.
  • the protocol specifies that the routers in the subnet include: Designated Router (DR), Back Designated Router (BDR), and non-designated router or backup designated router (Not DR or BDR Router; DR Other).
  • the link state database (LSDB) of all routers in the subnet is consistent, and the DR generates a Link State advertisement (LSA) indicating the network.
  • the router in the subnet needs to exchange LSDB information with the DR, and the DR generates a network description (Network LSA) for the network, and floods all the routers in the subnet by the DR.
  • Network LSA Network LSA
  • the router in the subnet calculates the shortest path tree with the local end as the root node according to the router node information (Router LSA) and Network LSA in the LSDB, and calculates all the routes in the subnet area according to the shortest path tree.
  • Router LSA router node information
  • Network LSA Network LSA in the LSDB
  • any node in the network needs to establish a neighbor relationship with all devices.
  • a small device with limited resources may not be able to establish a connection relationship with other devices after establishing a neighbor relationship with some devices.
  • the device will affect the 0SPF function of the device. For example, the subnet route cannot be calculated and the routing information of the local router cannot be advertised. Summary of the invention
  • the embodiment of the invention provides a method and a device for establishing a router neighbor to solve the prior art.
  • a small device cannot establish a neighbor relationship with all devices on the network, which affects the OSPF function.
  • the embodiment of the invention provides a method for establishing a router neighbor, which includes:
  • the embodiment of the invention further provides a router, including:
  • An acquiring unit configured to acquire a first discovery protocol Hello message sent by the neighboring router, where the first hello message carries the identifier information and priority information of the neighboring router;
  • a determining unit configured to: according to the priority information of the neighboring router, and/or the priority information of the local router, and/or the identifier information of the neighboring router is a virtual link peer configured by the local router The identifier information of the device is used to determine whether to add related information of the neighbor router to the neighbor list of the local router.
  • the method and device for establishing a router neighbor according to the embodiment of the present invention, after the local router receives the Hello message from the neighboring router, according to the priority information of the neighboring router, and/or the priority information of the local router, and the neighboring router. Whether the virtual link peer device configured for the local router determines whether to establish a neighbor relationship with the neighboring router, so that the small device can establish a neighbor relationship with the DR and the BDR in the network to ensure the normal OSPF function of the small device.
  • FIG. 1 is a schematic flowchart of a method for establishing a router neighbor according to an embodiment of the present invention
  • FIG. 2 is a schematic flowchart of another embodiment of a method for establishing a router neighbor according to the present invention
  • schematic diagram
  • FIG. 4 is a schematic structural diagram of still another embodiment of a router provided by the present invention. detailed description
  • FIG. 1 is a schematic flowchart of a method for establishing a router neighbor according to an embodiment of the present invention. As shown in FIG. 1 , the method includes:
  • S101 Acquire a first discovery protocol Hello message sent by the neighboring router, where the first Hello message carries the identifier information and priority information of the neighboring router;
  • the priority information of the neighboring router, and/or the priority information of the local router, and/or the identifier information of the neighboring router is the identifier of the virtual link peer device configured by the local router.
  • the information is used to determine whether to add related information of the neighbor router to the neighbor list of the local router.
  • the execution of the above steps is a router.
  • the router can be various devices with routing functions in the communication network. For example, it can be various sensors with routing functions in the Internet of Things.
  • the embodiments provided by the present invention are applicable to routers capable of acting as DRs or BDRs, and are particularly suitable for small routers that handle performance and resource priority.
  • routers use Hello packets to discover neighboring routers.
  • the information carried in the first Hello packet includes: identifier information of the neighboring router and priority information of the neighboring router. It should be noted that, the information carried in the first Hello packet involved in this embodiment refers only to the identifier information of the neighbor router and the neighbor router related to the present invention.
  • Priority information in fact, the first Hello message also carries a neighbor list in the neighboring router, the neighbor list includes information about a router that establishes a neighbor relationship with the neighboring router, and the related information may include: establishing a neighbor relationship Identification information and priority information of the router.
  • the local router After the local router obtains the first Hello packet sent by the neighboring router, it determines whether the neighboring router is the discovered neighbor. If it is the discovered neighbor, it returns the received packet to the neighboring state machine of the local router. Event (HelloRecv event), if it is not a discovered neighbor, the local router can be based on the priority information of the neighboring router, and/or the priority information of the local router, and/or whether the identification information of the neighboring router is The identifier information of the virtual link peer device configured by the end router (that is, whether the neighbor router is the virtual link peer device configured by the local router) determines whether to establish a neighbor relationship with the neighbor router.
  • Event HaRecv event
  • the neighboring router may be a DR or a BDR.
  • the neighboring router needs to establish a neighbor relationship with the neighboring router.
  • the neighbor relationship is established with the neighboring router.
  • the related information of the neighboring router is added to the neighboring list (that is, the data structure of the neighboring router is established in the neighbor list of the local router), and the related information of the neighboring router added in the neighbor list of the local router may include: Identification information, priority information, and other information about the neighboring router.
  • the local router may be the DR or the BDR.
  • the DR needs to be exchanged with all the routers in the subnet.
  • the LSDB information is generated and the network LSA information is generated for the subnet. Therefore, the DR needs to establish a neighbor relationship with all neighboring routers. Therefore, if the local router is a DR or BDR, you need to establish a neighbor relationship with the neighboring router. Add the neighbor list of the local router. Information about the neighboring router; in addition, if the identification information of the neighboring router is the identity information of the virtual link peer device configured by the local router (that is, whether the neighboring router is the virtual link peer device configured for the local router) Then, the neighboring router needs to establish a neighbor relationship, and the related information of the neighboring router is added to the neighbor list of the local router.
  • the neighboring router does not function as the DR or the BDR. Similarly, if the priority of the local router is 0, Generally, the local router does not act as a DR or BDR. If the priority of the neighboring router is 0, and the priority of the local router is 0, and the neighboring router is not the virtual link peer device configured by the local router.
  • the neighboring router may not be associated with the neighboring router, that is, the information about the neighboring router is not added to the neighboring list of the local router, and the first Hello packet is directly discarded.
  • the local router determines that the neighbor relationship is not established with the neighboring router, the local router does not need to update the neighbor list of the local router.
  • the neighbor list of the local router does not include the related information of the neighbor router. Therefore, the local router is saved.
  • the memory resources and processing resources ensure that the local router can establish neighbor relationships with the DRs and BDRs on the network to ensure normal OSPF functions of small devices.
  • the interface state machine of the local router expires, the DR election is performed, and the DR election list of the local router does not include the related information of the neighbor router. This simplifies the DR election process and improves the DR election efficiency.
  • the first Hello packet may also carry the neighbor list of the neighboring router. If the neighboring router has not found the local router, or the neighboring router has discovered the local router, but does not establish a neighbor relationship with the local router.
  • the neighbor list of the neighboring router does not include information about the local router. If it is determined that a neighbor relationship is established with the neighboring router, and the neighbor router is added with information about the neighboring router, the state of the neighboring router may be further set to state 1 (1-WAY), indicating that the local router discovers the neighboring router, but The neighbor router has not discovered the local router.
  • the neighbor router has discovered the local router and established a neighbor relationship with the local router. You can set the status of the neighbor router in the neighbor list of the local router to State 2 (2-WAY), indicating that the local router discovers the neighbor router, and the neighbor router discovers the local router.
  • State 2 (2-WAY)
  • the local router determines that it does not establish a neighbor relationship with the neighboring router, the local router does not include the information about the neighboring router in the neighbor list carried by the local router. If the local router determines to establish a neighbor relationship with the neighboring router. , the local router needs to be on the local end Add the information about the neighbor router to the neighbor list of the device, and the third router broadcasts the information.
  • the neighbor list carried in the Hello packet includes information about the neighbor router.
  • the local router When the status of a neighboring router in the neighbor list of the local router is state 2, that is, the local router discovers the neighboring router, and the neighboring router discovers the local router, when the interface state machine of the local router times out, it enters the DR election.
  • the information about the neighbor router is added to the DR election list. It can be seen that if the neighboring router and/or the local router can determine whether to establish a neighbor relationship according to the priority information and the virtual link peer device configured by the local router, the neighboring router and/or the local router can determine whether to establish a neighbor relationship. You can avoid adding router-related information that cannot become a DR or BDR to the DR list and participate in DR elections. This simplifies the DR election process and improves DR election efficiency.
  • first packet, the second packet, and the third packet which are used in the present invention, are used to distinguish the Hello packets sent by different routers, and refer to all the Hello packets sent by a certain router. It does not specifically refer to a certain essay issued by a certain router.
  • the method for establishing a router neighbor after the local router receives the Hello message of the neighboring router, according to the priority information of the neighboring router, and/or the priority information of the local router, and whether the neighboring router is
  • the virtual link peer device configured on the local router determines whether the neighbor relationship is established with the neighboring router. This ensures that the small device can establish neighbor relationships with the DR and BDR on the network to ensure normal OSPF functions of the small device.
  • FIG. 2 is a schematic flowchart of still another embodiment of a method for establishing a router neighbor according to the present invention. As shown in FIG. 2, this embodiment provides a complete process of router neighbor establishment, DR election, and router LSA exchange. During the router neighbor establishment process, the local router determines whether to establish a neighbor relationship with the neighboring router according to the priority of the neighboring router, the priority of the local router, and whether the neighboring router is the virtual link peer device configured by the local router.
  • Router 1 Routei ; R1
  • Router 2 Router 2; R2
  • R1 has a priority of 0 ( Pri: 0 )
  • R2 has a priority of 0 ( Pri: 0 ).
  • DR Other Router 3 (Router 3; R3) has a priority of 1 (Pri: 1) and can be used as a DR or BDR.
  • R1 It is not a virtual link peer device configured with R2, and R2 is not a virtual link peer device configured with R1.
  • the method specifically includes:
  • Router neighbor establishment part
  • R1 broadcasts a Hello message, where the message carries R1 identification information (R1) and priority information (Pri: 0);
  • the neighbor list carried in the Hello packet broadcasted by R1 does not include information about the neighbor router.
  • R2 obtains the Hello message L ⁇ sent by R1, discards the Hello message, and does not establish a neighbor relationship with R1.
  • R2 determines that the priority of R1 is 0, therefore, R1 does not act as a DR or a BDR;
  • R2 further determines that the local priority is 0, and the local router does not act as a DR or BDR. R2 further determines that R1 is not the virtual link peer device configured by the local router. Therefore, R2 discards the Hello packet. The neighbor relationship is not established with R1. The information about R1 is not added to the neighbor list of the local router.
  • S203 and R2 broadcast a Hello message, and the message carries R2 identification information (R2) and priority information (Pri: 0).
  • R2 identification information R2
  • Primary information Prior: 0
  • the Hello message broadcast by R2 is performed.
  • the neighbor information carried in the list does not include the identification information of R1).
  • S204 and R3 obtain the Hello message L ⁇ sent by the R1, and add the R1 related information R1 to the neighbor list.
  • the neighbor list can also be used. Include other information about the neighboring router, for example: priority information, etc., to establish a neighbor relationship with R1.
  • the neighbor list of the Hello packets sent by R1 does not include the information about R3, R3 will be the R1 of the local router neighbor list.
  • the status is set to state 1 (R1: 1-WAY X is specific.
  • R3 determines that the priority of R1 is 0. Therefore, R1 does not act as DR or BDR; R3 further determines that the priority of the local end is 1, then the local router As a DR or BDR, the information about R1 is added to the R3 neighbor list to establish a neighbor relationship with R1.
  • R3 obtains the Hello message sent by R2, adds R2 related information R2 to the neighbor list, and establishes a neighbor relationship with R2. Because the neighbor list of the Hello message sent by R2 does not include the information about R3, R3 Set the state of R2 in the neighbor list of the local router to state 1 (R2:
  • R3 determines that the priority of R2 is 0. Therefore, R2 does not act as a DR or a BDR.
  • R3 further determines that the local priority is 1, and the local router may act as a DR or a BDR. Then, R3 adds R2 information to the neighbor list and establishes a neighbor relationship with R2.
  • 1-WAY in S205 indicates that R3 finds R2, but R2 has not found R3.
  • R3's neighbor list includes:
  • R3 broadcasts a Hello message, where the message carries the R3 identification information R3 and the priority information (Pri: 1). At this time, the neighbor list carried in the Hello message broadcasted by the R3 carries the information about R1 and R2. .
  • R1 obtains the Hello message L ⁇ sent by R2, discards the Hello message, and does not establish a neighbor relationship with R2.
  • R1 determines that the priority of R2 is 0. Therefore, R2 does not act as a DR or BDR. R1 further determines that the local priority is 0, and the local router does not act as a DR or BDR; R1 further determines R2. It is not the virtual link peer device configured by the local router. Therefore, R1 discards the Hello packet and does not establish a neighbor relationship with R2.
  • the S1 and R1 After receiving the Hello message sent by the R3, the S1 and R1 add the related information of the R3 to the neighbor list, and establish a neighbor relationship with the R3. Because the neighbor list of the Hello message sent by the R3 includes the information about the R1, the R1 will The status of R3 in the neighbor list of the end router is set to state 2 (R3:
  • R1 determines that the priority of R3 is 1, and R3 may act as a DR or a BDR.
  • R1 adds the information about R3 to the neighbor list and establishes a neighbor relationship with R3.
  • S208 2-WAY indicates that R1 finds R3, and R3 finds R1.
  • the R1 broadcasts the Hello message, and the R1 carries the R1 identification information (R1) and the priority information (Pri: 0).
  • R1 identification information R1
  • Primary information Primary: 0
  • the neighbor list carried in the Hello message broadcasted by the R1 carries the R3 related information. ;
  • S210 and R2 obtain the Hello message L ⁇ sent by R3, add the related information of R3 to the neighbor list, and establish a neighbor relationship with R3. Because the neighbor list of the Hello message sent by R3 includes the information about R2, R2 will The status of R3 in the neighbor list of the end router is set to state 2 ( R3: 2-WAY ).
  • R2 determines that the priority of R3 is 1, and R3 may serve as a DR or a BDR. Then R1 adds R3 related information to the neighbor list.
  • the S211 and the R2 broadcast the Hello message, and the R2 carries the R2 identification information (R2) and the priority information (Pri: 0).
  • the neighbor list carried in the Hello message broadcasted by the R2 carries the R3 related information. .
  • the two routers receive the Hello packets sent by other routers in no particular order.
  • R2 receives the Hello packets sent by R1 and R3 receives the Hello packets sent by R1 in S204.
  • the S203R2 broadcasts Hello packets and R3 broadcast Hello packets in no particular order. Not here - repeat.
  • the interface state machine of S212 and R1 times out and enters the DR election.
  • the DR election list for R1 includes: R1 and R3.
  • the interface state machine of S213 and R2 times out and enters the DR election.
  • the DR election list for R2 includes: R2 and R3.
  • the interface state machine of S213 and R3 times out and enters the DR election.
  • the DR election list for R3 includes: R1, R2, and R3.
  • the DR election list of each router has one more identity identifier of the local router than the neighbor list. Interest.
  • the neighbor state machine of the local router is used to discover neighbor routers. When a neighbor router reaches
  • the local router After the 2-WAY state, that is, the local router discovers the neighboring router, and the neighboring router discovers the local router, the local router adds the identification information of the neighboring router to the DR election list.
  • the timeout time of the interface state machines of R1, R2, and R3 may be inconsistent and there is no sequence relationship. According to the election algorithm, the communication system can ensure that the DRs finally elected by each router are the same router.
  • the interface state machine of R1 changes to DR other
  • the interface state machine of R2 changes to DR other
  • the interface state machine of R3 changes to DR.
  • the process of performing LSA exchange between R1 and DR is composed of multiple unicast signalings between R1 and R3. This is a prior art and is represented by only one signaling in Fig. 2.
  • R3 FULL (full state)
  • R3: FULL indicates that R1 and R3 complete LSA exchange
  • R2 and DR LSA exchange is completed
  • R2 neighbor The list is: R3: FULL, indicating that R2 and R3 have completed LSA exchange
  • the neighbors of R3 are: J: R1: FULL, R2: FULL.
  • the router neighboring method is provided by the embodiment of the present invention. After the local router receives the Hello message from the neighboring router, the local router according to the priority information of the neighboring router, the priority information of the local router, and whether the neighboring router is the local end.
  • the virtual link peer device configured by the router determines whether to establish a neighbor relationship with the neighbor router. Ensure that the small device can establish a neighbor relationship with the DR and BDR on the network to ensure the normal 0SPF function of the small device. If the local router does not establish a neighbor relationship with the neighboring router, the local router does not need to update the neighbor list. When the interface state machine of the local router times out, the DR election is entered. The DR election list of the local router is also not included. The identification information of the neighboring router simplifies the process of DR election and improves the efficiency of DR election.
  • FIG. 3 is a schematic structural diagram of an embodiment of a router provided by the present invention. As shown in FIG. 4, the router includes: an obtaining unit 11 and a determining unit 12;
  • the obtaining unit 11 is configured to obtain a first discovery protocol Hello message sent by the neighboring router, where the first hello message carries the identifier information and priority information of the neighboring router;
  • the determining unit 12 is configured to: according to the priority information of the neighboring router, and/or the priority information of the local router, and/or the identifier information of the neighboring router is a virtual link pair configured by the local router The identifier information of the end device determines whether the related information of the neighbor router is added to the neighbor list of the local router.
  • the router provided by the embodiment of the present invention may be various devices having a routing function in a communication network, for example, may be various sensors having a routing function in the Internet of Things.
  • the router can be a router that can act as a DR or BDR, or a small router that handles performance and resource prioritization.
  • routers use Hello packets to discover neighboring routers.
  • the determining unit 12 may be based on the priority information of the neighboring router, and/or the priority of the local router. Whether the information, and/or the identification information of the neighboring router is the identity information of the virtual link peer device configured by the local router, that is, whether the neighboring router is the virtual link peer device configured by the local router, Establish a neighbor relationship with the neighbor router.
  • the determining unit 12 may determine, by using the priority information of the neighboring router, the neighboring router as the DR or the BDR. If the priority of the neighboring router is not 0, the neighboring router may be the DR or the BDR. It is determined that the neighboring router needs to establish a neighbor relationship with the neighboring router. Similarly, the determining unit 12 can determine whether the local router can function as a DR or a BDR by using the priority information of the local router. If the priority of the local router is not 0, The end router may be a DR or a BDR.
  • the determining unit 12 determines that it needs to establish a neighbor relationship with all neighboring routers. If the local router is likely to be a DR or a BDR, the determining unit 12 determines that a neighbor relationship needs to be established with the neighboring router. In addition, if the neighboring router is a virtual link peer device configured by the local router, the determining unit 12 determines that the need is needed. Establish a neighbor relationship with the neighbor router. The data structure of the neighbor router is established in the neighbor list.
  • the neighboring router does not function as the DR or the BDR. Similarly, if the priority of the local router is 0, The terminal router does not act as the DR or the BDR. If the priority of the neighboring router is 0, and the priority of the local router is 0, and the neighboring router is not the virtual link peer device configured by the local router, the determining unit 12 It is determined that the neighbor relationship is not established with the neighboring router, and the first Hello packet is directly discarded.
  • the local router does not need to update the neighbor list.
  • the interface state machine of the local router times out, the DR election is entered, and the DR election list of the local router is also not included.
  • the identification information of the neighboring router simplifies the process of DR election and improves the efficiency of DR election.
  • the router After receiving the Hello packet from the neighboring router, the router provided by the embodiment of the present invention The priority information of the neighboring router, and/or the priority information of the local router, and whether the neighboring router is the virtual link peer device configured by the local router, determines whether to establish a neighbor relationship with the neighboring router, thereby ensuring the small device. Establishes a neighbor relationship with the DR and BDR on the network to ensure normal OSPF functions of small devices.
  • FIG. 4 is a schematic structural diagram of another embodiment of a router according to the present invention. As shown in FIG. 4, the router includes: an obtaining unit 11 and a determining unit 12;
  • the first Hello packet further carries a neighbor list of the neighboring router, and if the determining unit 12 determines to add the related information of the neighboring router to the neighbor list of the local router, the implementation is performed.
  • the router provided in the example can also include:
  • the determining unit 13 is configured to determine whether the related information of the local router is included in the neighbor list of the neighboring router;
  • the setting unit 14 is configured to: if the neighboring router of the neighboring router does not include the related information of the local router, set the state of the neighboring router in the neighbor list of the local router to state 1, State 1 is used to indicate that the local router discovers the neighboring router, and the neighboring router has not found the local router; if the neighboring router's neighbor list includes related information of the local router, The state of the neighboring router in the neighboring list of the local router is set to state 2. The state 2 is used to indicate that the local router discovers the neighboring router, and the neighboring router discovers the local router.
  • the determining unit 12 may further include: a determining module 121 and a processing module 122;
  • the determining module 121 is configured to determine, according to the priority information of the neighboring router, whether the priority of the neighboring router is 0, and if the priority of the neighboring router is 0, according to the priority information of the local router And determining whether the priority of the local router is 0. If the priority of the local router is 0, determining whether the identifier information of the neighboring router is a virtual link peer device configured by the local router Identification information;
  • the processing module 122 is configured to: if the determining module determines that the identifier information of the neighboring router is not the identifier information of the virtual link peer device configured by the local router, discarding the first Hello message.
  • the router provided in this embodiment may further include: a first broadcast unit 15; the first broadcast unit 15 is configured to: after the processing module 122 discards the first Hello packet, broadcast the second Hello The second Hello packet carries the identifier information and the priority information of the local router, and the second Hello packet further carries the neighbor list of the local router, where the local router The neighbor information is not included in the neighbor list.
  • the processing module 122 may be further configured to: if the determining module 121 determines that the priority of the neighboring router is not 0, add the foregoing in the neighbor list of the local router. Information about neighbor routers.
  • the processing module 122 is further configured to: if the determining module 121 determines that the priority of the local router is not 0, add related information of the neighbor router to the neighbor list of the local router.
  • the processing module 122 is further configured to: if the determining module 121 determines that the neighboring router identifier information is the identifier information of the virtual link peer device configured by the local router, the neighbor list of the local router Add related information of the neighbor router.
  • the router provided in this embodiment may further include: a second broadcast unit 16;
  • the second broadcast unit 16 is configured to: after the processing module adds the related information of the neighboring router to the neighboring list of the local router, broadcast a third Hello packet, where the third Hello packet carries the The identifier information and the priority information of the local router are also included, where the third Hello packet further carries the neighbor list of the local router, and the neighbor list of the local router includes related information of the neighbor router.
  • the router provided by the embodiment of the present invention is an execution device of the router neighbor establishment method provided by the embodiment of the present invention.
  • the process of implementing the router neighbor establishment method refer to the method embodiment, and details are not described herein.
  • the router After receiving the Hello packet from the neighboring router, the router according to the embodiment of the present invention, according to the priority information of the neighboring router, the priority information of the local router, and whether the neighboring router is the primary router
  • the virtual link peer device configured by the end router determines whether to establish a neighbor relationship with the neighbor router. Ensure that small devices can establish neighbor relationships with DRs and BDRs on the network to ensure normal OSPF functions of small devices. If it is determined that the neighbor relationship is not established, the neighbor list is not updated. When the interface state machine times out, the DR election is entered. The DR election list also does not include the identifier information of the neighbor router. The process has improved the efficiency of DR elections.

Landscapes

  • Engineering & Computer Science (AREA)
  • Computer Networks & Wireless Communication (AREA)
  • Signal Processing (AREA)
  • Data Exchanges In Wide-Area Networks (AREA)

Description

路由器邻居建立方法和设备 技术领域
本发明实施例涉及信息技术领域, 特别涉及一种路由器邻居建立方法和 设备。 背景技术
开放最短路径优先(Open Shortest Path First; OSPF )是一种内部网 关协议。该协议规定子网中的路由器包括: 指定路由器(Designated Router; DR ) 、 备份指定路由器( Back Designated Router; BDR )和非指定路由器 或备份指定路由器(Not DR or BDR Router; DR Other ) 。 子网中所有路由 器的连接状态数据库(Link state database; LSDB )都是一致的, 由 DR产 生表示该网络的连接状态宣告 ( Link state advertisement; LSA ) 。 子网中 的路由器需要和 DR交换 LSDB信息,并由 DR为该网络生成一个描述本网络的 信息 (Network LSA ) , 并由 DR洪泛到子网中所有的路由器。 子网中的路 由器根据 LSDB中的描述路由器节点的信息 ( Router LSA ) 和 Network LSA, 计算出以本端为根节点的最短路径树, 并根据最短路径树计算出子网 区域内所有的路由。
现有技术中, 网络中的任一节点需要同所有设备建立邻居关系, 然而处 理资源有限的小型设备, 在和一部分设备建立邻居关系后, 可能无法和其他 设备建立连接关系, 而一旦这些设备不能和可以作为 DR、 BDR的路由器建立 邻居关系, 则将影响这些设备的 0SPF功能, 例如: 无法计算出子网路由, 无法发布本端路由器的路由信息等。 发明内容
本发明实施例提供一种路由器邻居建立方法和设备, 以解决现有技术中 小型设备无法和网络中所有设备建立邻居关系, 影响 OSPF功能的问题。 本发明实施例提供了一种路由器邻居建立方法, 包括:
获取邻居路由器发送的第一发现协议 Hello报文,所述第一 Hello报文中 携带所述邻居路由器的标识信息和优先级信息;
根据所述邻居路由器的优先级信息, 和 /或本端路由器的优先级信息, 和
/或所述邻居路由器的标识信息是否为所述本端路由器配置的虚链路对端设 备的标识信息, 确定是否在所述本端路由器的邻居列表中添加所述邻居路由 器的相关信息。
本发明实施例还提供一种路由器, 包括:
获取单元, 用于获取邻居路由器发送的第一发现协议 Hello报文, 所述 第一 Hello报文中携带所述邻居路由器的标识信息和优先级信息;
确定单元, 用于根据所述邻居路由器的优先级信息, 和 /或本端路由器的 优先级信息, 和 /或所述邻居路由器的标识信息是否为所述本端路由器配置的 虚链路对端设备的标识信息, 确定是否在所述本端路由器的邻居列表中添加 所述邻居路由器的相关信息。
本发明实施例提供的路由器邻居建立方法和设备, 当本端路由器收到邻 居路由器的 Hello报文后, 根据该邻居路由器的优先级信息, 和 /或本端路由 器的优先级信息,以及邻居路由器是否为本端路由器配置的虚链路对端设备, 确定是否与该邻居路由器建立邻居关系, 从而保证小型设备能够与网络中的 DR和 BDR建立邻居关系, 保证小型设备正常的 OSPF功能。 附图说明
为了更清楚地说明本发明实施例或现有技术中的技术方案, 下面将对实 施例或现有技术描述中所需要使用的附图作简单地介绍, 显而易见地, 下面 描述中的附图仅仅是本发明的一些实施例, 对于本领域普通技术人员来讲, 在不付出创造性劳动的前提下, 还可以根据这些附图获得其他的附图。 图 1为本发明提供的路由器邻居建立方法一个实施例的流程示意图; 图 2为本发明提供的路由器邻居建立方法又一个实施例的流程示意图; 图 3为本发明提供的路由器一个实施例的结构示意图;
图 4为本发明提供的路由器又一个实施例的结构示意图。 具体实施方式
下面将结合本发明实施例中的附图, 对本发明实施例中的技术方案进行 清楚、 完整地描述, 显然, 所描述的实施例仅仅是本发明一部分实施例, 而 不是全部的实施例。 基于本发明中的实施例, 本领域普通技术人员在没有做 出创造性劳动前提下所获得的所有其他实施例, 都属于本发明保护的范围。
图 1为本发明提供的路由器邻居建立方法一个实施例的流程示意图,如图 1所示, 该方法包括:
S101、获取邻居路由器发送的第一发现协议 Hello报文, 所述第一 Hello 报文中携带所述邻居路由器的标识信息和优先级信息;
S102、根据所述邻居路由器的优先级信息,和 /或本端路由器的优先级信 息, 和 /或所述邻居路由器的标识信息是否为所述本端路由器配置的虚链路对 端设备的标识信息, 确定是否在所述本端路由器的邻居列表中添加所述邻居 路由器的相关信息。
以上步骤的执行主体为路由器, 该路由器可以是通信网络中的具有路由 功能的各种设备, 例如: 可以是物联网中的各种具有路由功能的传感器。
本发明提供的实施例, 适用于能够作为 DR或 BDR的路由器, 尤其适用 于处理性能和资源优先的小型路由器。
在采用 OSPF等协议的通信网络中, 路由器之间通过 Hello报文来发现 邻居路由器。 第一 Hello报文中携带的信息包括: 邻居路由器的标识信息和 邻居路由器的优先级信息。 需要说明的是, 本实施例中涉及的第一 Hello报 文携带的信息, 仅提及与本发明相关的邻居路由器的标识信息和邻居路由器 的优先级信息, 而实际上第一 Hello报文中还携带邻居路由器中的邻居列表, 该邻居列表中包括与邻居路由器建立邻居关系的路由器的相关信息, 这些相 关信息可以包括: 建立邻居关系的路由器的标识信息以及优先级信息等。
当本端路由器获取到邻居路由器发送的第一 Hello报文后, 首先判断该 邻居路由器是否为已发现的邻居, 如果是已发现的邻居, 则向本端路由器的 邻居状态机返回收到报文事件( HelloRecv事件), 如果不是已发现的邻居, 则本端路由器可以根据该邻居路由器的优先级信息, 和 /或本端路由器的优先 级信息, 和 /或该邻居路由器的标识信息是否为本端路由器配置的虚链路对端 设备的标识信息 (即, 该邻居路由器是否为本端路由器配置的虚链路对端设 备), 确定是否与该邻居路由器建立邻居关系。
具体的: 如果该邻居路由器的优先级不为 0, 则说明该邻居路由器有可 能作为 DR或 BDR, 则需要与该邻居路由器建立邻居关系, 与邻居路由器建 立邻居关系具体是: 在本端路由器的邻居列表中添加该邻居路由器的相关信 息 (即, 在本端路由器的邻居列表中建立该邻居路由器的数据结构), 其中, 在本端路由器的邻居列表中添加的邻居路由器的相关信息可以包括: 标识信 息、 优先级信息以及该邻居路由器的其他信息; 同样, 如果本端路由器的优 先级不为 0, 则说明本端路由器有可能作为 DR或 BDR, 由于 DR需要和子 网中的所有的路由器交换 LSDB信息,并为该子网生成 Network LSA信息, 因此, DR需要和所有的邻居路由器建立邻居关系, 因此, 如果本端路由器有 可能作为 DR或 BDR, 则需要与该邻居路由器建立邻居关系, 在本端路由器 的邻居列表中添加该邻居路由器的相关信息; 另外, 如果该邻居路由器的标 识信息为本端路由器配置的虚链路对端设备的标识信息 (即, 该邻居路由器 是否为本端路由器配置的虚链路对端设备 ),则需要与该邻居路由器建立邻居 关系, 在本端路由器的邻居列表中添加该邻居路由器的相关信息。
如果发出第一 Hello报文的邻居路由器的优先级为 0, 则通常情况下, 该 邻居路由器不会作为 DR或 BDR; 同样的, 如果本端路由器的优先级为 0, 则通常情况下, 本端路由器也不会作为 DR或 BDR; 如果邻居路由器的优先 级为 0, 并且本端路由器的优先级为 0, 并且邻居路由器不是本端路由器配置 的虚链路对端设备, 则可以不与该邻居路由器建立邻居关系, 即, 不在本端 路由器的邻居列表中添加该邻居路由器的相关信息, 而直接将该第一 Hello 报文丟弃。
如果本端路由器确定不与邻居路由器建立邻居关系, 则本端路由器无需 对本端路由器的邻居列表进行更新, 本端路由器的邻居列表中不包括该邻居 路由器的相关信息, 因此, 节约了本端路由器的内存资源和处理资源, 从而 保证本端路由器能够与网络中的 DR和 BDR建立邻居关系,保证小型设备正 常的 OSPF功能。 并且, 当本地路由器的接口状态机超时时, 进入 DR选举, 本端路由器的 DR选举列表中也同样不包括该邻居路由器的相关信息, 从而 简化了 DR选举的过程, 提高了 DR选举效率。
进一步的, 由于第一 Hello报文中还可携带邻居路由器的邻居列表, 如 果邻居路由器尚未发现本端路由器, 或者, 邻居路由器已经发现了本端路由 器, 但并未与本端路由器建立邻居关系, 则邻居路由器的邻居列表中不包括 本端路由器的相关信息。 如果确定与邻居路由器建立邻居关系, 在本端路由 器中添加邻居路由器的相关信息, 则还可以进一步将该邻居路由器的状态设 置为状态 1 ( 1-WAY ), 表示本端路由器发现邻居路由器, 但邻居路由器尚未 发现本端路由器;
如果邻居路由器的邻居列表中包括本端路由器的相关信息, 则说明邻居 路由器已发现本端路由器, 并且与本端路由器建立邻居关系, 则可以将本端 路由器的邻居列表中邻居路由器的状态设置为状态 2 ( 2-WAY ), 表示本端路 由器发现邻居路由器, 且邻居路由器发现本端路由器。
如果本端路由器确定不与邻居路由器建立邻居关系, 则本端路由器广播 的第二 Hello报文中携带的邻居列表中不包括该邻居路由器的相关信息; 如 果本端路由器确定与邻居路由器建立邻居关系, 则本端路由器需要在本端路 由器的邻居列表中添加该邻居路由器的相关信息, 则本端路由器广播的第三
Hello报文中携带的邻居列表中包括该邻居路由器的相关信息。
由于当本端路由器的邻居列表中某一邻居路由器的状态为状态 2时, 即 本端路由器发现邻居路由器, 且邻居路由器发现本端路由器时, 当本地路由 器的接口状态机超时时, 进入 DR选举, 才会将该邻居路由器的相关信息加 入到 DR选举列表中。 可以看出, 如果邻居路由器和 /或本端路由器在接收到 对方的 Hello报文时, 能够根据优先级信息和是否为本端路由器配置的虚链 路对端设备, 确定是否建立邻居关系, 则可以避免将不可能成为 DR或 BDR 的路由器相关信息加入到 DR列表中, 参加 DR选举, 从而简化了 DR选举 的过程, 提高了 DR选举效率。
需要说明的是, 本发明中涉及到的第一报文、 第二报文和第三报文是用 于区分不同路由器广播的 Hello报文,是泛指某一路由器发出的所有 Hello报 文, 而并非特指某一路由器发出的某个 ·艮文。
本发明实施例提供的路由器邻居建立方法, 当本端路由器收到邻居路由 器的 Hello报文后, 根据该邻居路由器的优先级信息, 和 /或本端路由器的优 先级信息, 以及邻居路由器是否为本端路由器配置的虚链路对端设备, 确定 是否与该邻居路由器建立邻居关系, 从而保证小型设备能够与网络中的 DR 和 BDR建立邻居关系, 保证小型设备正常的 OSPF功能。
图 2为本发明提供的路由器邻居建立方法又一个实施例的流程示意图,如 图 2所示, 本实施例提供了路由器邻居建立、 DR选举以及路由器 LSA交换的 完整流程。 在路由器邻居建立过程中, 本端路由器根据邻居路由器的优先级、 本端路由器的优先级以及邻居路由器是否为本端路由器配置的虚链路对端设 备来确定是否与邻居路由器建立邻居关系。
其中, 路由器 1 ( Routei ; R1 )和路由器 2 ( Router2; R2 )均为低端设 备, R1的优先级为 0( Pri: 0 ), R2的优先级为 0( Pri: 0 ),只能作为 DR Other。 路由器 3 ( Router3; R3 )的优先级为 1 ( Pri: 1 ), 可以作为 DR或 BDR。 R1 不是 R2配置的虚链路对端设备, R2不是 R1配置的虚链路对端设备。
该方法具体包括:
路由器邻居建立部分:
5201、 R1广播 Hello报文, 该报文中携带 R1 的标识信息( R1 )和优先 级信息(Pri: 0 );
假设 R1尚未与网络中的其他路由器建立邻居关系,此时, R1广播的 Hello 报文中携带的邻居列表中不包括邻居路由器的相关信息。
5202、 R2获取到 R1发送的 Hello报 L^ , 丟弃该 Hello报文, 不与 R1 建立邻居关系;
具体的, R2判断出 R1的优先级为 0, 因此, R1不会作为 DR或 BDR;
R2进一步判断出本端的优先级为 0, 则本端路由器不会作为 DR或 BDR; R2 进一步判断出 R1不是本端路由器配置的虚链路对端设备,因此, R2将该 Hello 报文丟弃, 不与 R1建立邻居关系, 不在本端路由器的邻居列表中添加 R1的相 关信息;
S203、 R2广播 Hello报文, 该报文中携带 R2的标识信息( R2 )和优先 级信息(Pri: 0 ), 此时, 由于 R2不与 R1 建立邻居关系, 因此, R2广播的 Hello报文中携带的邻居列表中不包括 R1的标识信息)。
S204、 R3获取到 R1发送的 Hello报 L^ , 在邻居列表中添加 R1的相关 信息 R1 (本实施中仅以邻居列表中添加邻居路由器的标识信息 R1为例, 实际 上, 邻居列表中还可以包括邻居路由器的其他信息, 例如: 优先级信息等), 与 R1建立邻居关系; 由于 R1发送的 Hello报文的邻居列表中不包括 R3的相关 信息, 则 R3将本端路由器邻居列表中 R1的状态设为状态 1 ( R1 : 1-WAY X 具体的, R3判断出 R1的优先级为 0, 因此, R1不会作为 DR或 BDR; R3进一步判断出本端的优先级为 1 , 则本端路由器可能作为 DR或 BDR, 则 R3邻居列表中添加 R1的相关信息, 与 R1建立邻居关系。
其中, S204中的 1-WAY表示 R3发现 R1 , 但 R1尚未发现 R3。 5205、 R3获取到 R2发送的 Hello报 l^ , 在邻居列表中添加 R2的相关 信息 R2, 与 R2建立邻居关系; 由于 R2发送的 Hello报文的邻居列表中不包 括 R3的相关信息,则 R3将本端路由器邻居列表中 R2的状态设为状态 1 ( R2:
1- WAY )。
具体的, R3判断出 R2的优先级为 0, 因此, R2不会作为 DR或 BDR;
R3进一步判断出本端的优先级为 1 , 则本端路由器可能作为 DR或 BDR, 则 R3在邻居列表中添加 R2的相关信息, 与 R2建立邻居关系。
其中, S205中的 1-WAY表示 R3发现 R2, 但 R2尚未发现 R3。
此时, R3的邻居列表中包括:
R1 : 1-WAY;
R2: 1-WAY。
5206、 R3广播 Hello报文, 该报文中携带 R3的标识信息 R3和优先级信 息(Pri: 1 ), 此时, R3广播的 Hello报文中携带的邻居列表中携带 R1和 R2 的相关信息。
S207、 R1获取到 R2发送的 Hello报 L^ , 丟弃该 Hello报文, 不与 R2 建立邻居关系;
具体的, R1判断出 R2的优先级为 0, 因此, R2不会作为 DR或 BDR; R1进一步判断出本端的优先级为 0, 则本端路由器不会作为 DR或 BDR; R1 进一步判断出 R2不是本端路由器配置的虚链路对端设备,因此, R1将该 Hello 报文丟弃, 不与 R2建立邻居关系;
S208、 R1获取到 R3发送的 Hello报文后,在邻居列表中添加 R3的相关 信息, 与 R3建立邻居关系; 由于 R3发送的 Hello报文的邻居列表中包括 R1 的相关信息, 则 R1将本端路由器的邻居列表中 R3的状态设为状态 2 ( R3:
2- WAY )。
具体的, R1判断出 R3的优先级为 1 , 则 R3可能作为 DR或 BDR, 则
R1在邻居列表中添加 R3的相关信息, 与 R3建立邻居关系。 其中, S208中 的 2-WAY表示 R1发现 R3, 并且 R3发现 R1。
S209、 R1广播 Hello报文, 该报文中携带 R1 的标识信息( R1 )和优先 级信息(Pri: 0 ), 此时, R1广播的 Hello报文中携带的邻居列表中携带 R3的 相关信息;
S210、 R2获取到 R3发送的 Hello报 L^ , 在邻居列表中添加 R3的相关 信息, 与 R3建立邻居关系; 由于 R3发送的 Hello报文的邻居列表中包括 R2 的相关信息, 则 R2将本端路由器的邻居列表中 R3的状态设为状态 2 ( R3: 2-WAY )。
具体的, R2判断出 R3的优先级为 1 , 则 R3可能作为 DR或 BDR, 则 R1在邻居列表中添加 R3的相关信息 R3: 2-WAY, 与 R3建立邻居关系。 其 中, S210中的 2-WAY表示 R2发现 R3, 并且 R3发现 R2。
S211、 R2广播 Hello报文, 该报文中携带 R2的标识信息( R2 )和优先级 信息(Pri: 0 ), 此时, R2广播的 Hello报文中携带的邻居列表中携带 R3的相 关信息。
需要说明的是, 两个路由器接收到其他路由器广播的 Hello报文不分先后 顺序, 例如: S202中 R2接收 R1发送的 Hello报文和 S204中 R3接收到 R1 发送的 Hello报文不分先后顺序。 另外, S203R2广播 Hello报文和 R3广播 Hello报文也不分先后顺序。 在此不——赘述。
DR选举部分:
S212、 R1的接口状态机超时, 进入 DR选举;
R1的 DR选举列表包括: R1和 R3。
S213、 R2的接口状态机超时, 进入 DR选举;
R2的 DR选举列表包括: R2和 R3。
S213、 R3的接口状态机超时, 进入 DR选举;
R3的 DR选举列表包括: R1、 R2和 R3。
其中, 各路由器的 DR选举列表比邻居列表多一个本端路由器的标识信 息。 本端路由器的邻居状态机用于发现邻居路由器, 当某一邻居路由器达到
2-WAY状态后, 即, 本端路由器发现该邻居路由器, 该邻居路由器发现本端 路由器, 则本端路由器就将该邻居路由器的标识信息加入 DR选举列表中。
另外, 需要说明的是, R1、 R2和 R3的接口状态机超时的时间可能是不 一致的, 也没有先后关系, 通信系统中根据选举算法能够保证各路由器最终 选举出来的 DR是同一个路由器。
DR选举之后, R1的接口状态机变迁到 DR other, R2的接口状态机变 迁到 DR other, R3的接口状态机变迁到 DR。
LSA交换部分:
S214、 R1与 R3 ( DR )进行 LSA交换;
R1与 DR进行 LSA交换的过程由 R1和 R3之间交互的多个单播信令构 成, 此为现有技术, 在图 2中仅以一个信令来表示。
R1与 R3 ( DR )的 LSA交换完成后, R1的邻居列表为: R3: FULL (完 全状态), R3: FULL表示 R1和 R3完成了 LSA交换; R2与 DR的 LSA交 换完成后, R2的邻居列表为: R3: FULL, 表示 R2和 R3完成了 LSA交换; R3与 R1和 R2LSA交换完成后, R3的邻居歹' J表为: R1 : FULL, R2: FULL。
本发明实施例提供的路由器邻居建立方法, 当本端路由器收到邻居路由 器的 Hello报文后, 本端路由器根据邻居路由器的优先级信息、 本端路由器的 优先级信息以及邻居路由器是否为本端路由器配置的虚链路对端设备来确定 是否与邻居路由器建立邻居关系。 保证小型设备能够与网络中的 DR和 BDR 建立邻居关系, 保证小型设备正常的 0SPF功能。 如果本端路由器确定不与 邻居路由器建立邻居关系, 则本端路由器无需对邻居列表进行更新, 当本地 路由器的接口状态机超时时, 进入 DR选举, 本端路由器的 DR选举列表中 也同样不包括该邻居路由器的标识信息, 从而简化了 DR选举的过程, 提高 了 DR选举效率。
需要说明的是: 对于前述的各方法实施例, 为了简单描述, 故将其都表 述为一系列的动作组合, 但是本领域技术人员应该知悉, 本发明并不受所描 述的动作顺序的限制, 因为依据本发明, 某些步骤可以采用其他顺序或者同 时进行。 其次, 本领域技术人员也应该知悉, 说明书中所描述的实施例均属 于优选实施例, 所涉及的动作和模块并不一定是本发明所必须的。
在上述实施例中, 对各个实施例的描述都各有侧重, 某个实施例中没有 详述的部分, 可以参见其他实施例的相关描述。
本领域普通技术人员可以理解: 实现上述方法实施例的全部或部分步骤 可以通过程序指令相关的硬件来完成, 前述的程序可以存储于一计算机可读 取存储介质中, 该程序在执行时, 执行包括上述方法实施例的步骤; 而前述 的存储介质包括: ROM、 RAM, 磁碟或者光盘等各种可以存储程序代码的介 质。
图 3为本发明提供的路由器一个实施例的结构示意图, 如图 4所示, 该 路由器包括: 获取单元 11和确定单元 12;
获取单元 11 , 用于获取邻居路由器发送的第一发现协议 Hello报文, 所 述第一 Hello报文中携带所述邻居路由器的标识信息和优先级信息;
确定单元 12,用于根据所述邻居路由器的优先级信息,和 /或本端路由器 的优先级信息, 和 /或所述邻居路由器的标识信息是否为所述本端路由器配置 的虚链路对端设备的标识信息, 确定是否在所述本端路由器的邻居列表中添 加所述邻居路由器的相关信息。
本发明实施例提供的路由器, 可以是通信网络中的具有路由功能的各种 设备, 例如: 可以是物联网中的各种具有路由功能的传感器。 该路由器可以 是能够作为 DR或 BDR的路由器,也可以是处理性能和资源优先的小型路由 器。
在采用 OSPF等协议的通信网络中, 路由器之间通过 Hello报文来发现 邻居路由器。 当获取单元 11获取到邻居路由器发送的第一 Hello报文后, 确 定单元 12可以根据该邻居路由器的优先级信息, 和 /或本端路由器的优先级 信息, 和 /或该邻居路由器的标识信息是否为本端路由器配置的虚链路对端设 备的标识信息(即,该邻居路由器是否为本端路由器配置的虚链路对端设备), 确定是否与该邻居路由器建立邻居关系。
具体的:确定单元 12可以通过邻居路由器的优先级信息判断该邻居路由 器能够作为 DR或 BDR, 如果邻居路由器的优先级不为 0, 则说明该邻居路 由器有可能作为 DR或 BDR, 则确定单元 12确定需要与该邻居路由器建立 邻居关系; 同样,确定单元 12也可以通过本端路由器的优先级信息判断本端 路由器是否能够作为 DR或 BDR, 如果本端路由器的优先级不为 0, 则说明 本端路由器有可能作为 DR或 BDR, 由于 DR需要和子网中的所有的路由器 交换 LSDB信息, 并为该子网生成 Network LSA信息, 因此, 确定单元 12 确定需要和所有的邻居路由器建立邻居关系, 因此, 如果本端路由器有可能 作为 DR或 BDR, 则确定单元 12确定需要与该邻居路由器建立邻居关系; 另外, 如果邻居路由器是本端路由器配置的虚链路对端设备, 则确定单元 12 确定需要与该邻居路由器建立邻居关系, 在邻居列表中建立该邻居路由器的 数据结构。
如果发出第一 Hello报文的邻居路由器的优先级为 0, 则通常情况下, 该 邻居路由器不会作为 DR或 BDR; 同样的, 如果本端路由器的优先级为 0, 则通常情况下, 本端路由器也不会作为 DR或 BDR; 如果邻居路由器的优先 级为 0, , 并且本端路由器的优先级为 0, 并且邻居路由器不是本端路由器配 置的虚链路对端设备,则确定单元 12可以确定不与该邻居路由器建立邻居关 系, 而直接将该第一 Hello报文丟弃。
如果确定单元 12确定不与邻居路由器建立邻居关系,则本端路由器无需 对邻居列表进行更新, 当本地路由器的接口状态机超时时, 进入 DR选举, 本端路由器的 DR选举列表中也同样不包括该邻居路由器的标识信息, 从而 简化了 DR选举的过程, 提高了 DR选举效率。
本发明实施例提供的路由器, 当收到邻居路由器的 Hello报文后, 根据 该邻居路由器的优先级信息, 和 /或本端路由器的优先级信息, 以及邻居路由 器是否为本端路由器配置的虚链路对端设备, 确定是否与该邻居路由器建立 邻居关系,从而保证小型设备能够与网络中的 DR和 BDR建立邻居关系,保 证小型设备正常的 OSPF功能。
图 4为本发明提供的路由器又一个实施例的结构示意图, 如图 4所示, 该路由器包括: 获取单元 11和确定单元 12;
进一步的, 所述第一 Hello报文中还携带所述邻居路由器的邻居列表, 若所述确定单元 12 确定在所述本端路由器的邻居列表中添加所述邻居路由 器的相关信息, 则本实施例提供的路由器还可以包括:
判断单元 13, 用于判断所述邻居路由器的邻居列表中是否包括所述本端 路由器的相关信息;
设置单元 14, 用于若所述邻居路由器的邻居列表中不包括所述本端路由 器的相关信息, 则将所述本端路由器的邻居列表中所述邻居路由器的状态设 置为状态 1 , 所述状态 1 用于表示所述本端路由器发现所述邻居路由器, 所 述邻居路由器尚未发现所述本端路由器; 若所述邻居路由器的邻居列表中包 括所述本端路由器的相关信息, 则将所述本端路由器的邻居列表中所述邻居 路由器的状态设置为状态 2, 所述状态 2用于表示所述本端路由器发现所述 邻居路由器, 且所述邻居路由器发现所述本端路由器。
确定单元 12可以进一步包括: 判断模块 121和处理模块 122;
判断模块 121 , 用于根据所述邻居路由器的优先级信息, 判断所述邻居 路由器的优先级是否为 0, 若所述邻居路由器的优先级为 0, 则根据所述本端 路由器的优先级信息, 判断所述本端路由器的优先级是否为 0, 若所述本端 路由器的优先级为 0, 则判断所述邻居路由器的标识信息是否为所述本端路 由器配置的虚链路对端设备的标识信息;
处理模块 122, 用于若所述判断模块判断出所述邻居路由器的标识信息 不是所述本端路由器配置的虚链路对端设备的标识信息, 则丟弃所述第一 Hello报文。
在此基础上, 本实施例提供的路由器还可以包括: 第一广播单元 15; 第一广播单元 15, 用于在所述处理模块 122丟弃所述第一 Hello报文之 后, 广播第二 Hello报文, 所述第二 Hello报文中携带所述本端路由器的标识 信息和优先级信息, 所述第二 Hello报文中还携带所述本端路由器的邻居列 表, 所述本端路由器的邻居列表中不包括所述邻居路由器的相关信息。
作为另一种可行的实施方式, 处理模块 122还可以用于: 若所述判断模 块 121判断出所述邻居路由器的优先级不为 0, 则在所述本端路由器的邻居 列表中添加所述邻居路由器的相关信息。
处理模块 122还可以用于: 若所述判断模块 121判断出所述本端路由器 的优先级不为 0, 则在所述本端路由器的邻居列表中添加所述邻居路由器的 相关信息。
处理模块 122也可以用于: 若所述判断模块 121判断出所述邻居路由器 标识信息是所述本端路由器配置的虚链路对端设备的标识信息, 则在所述本 端路由器的邻居列表中添加所述邻居路由器的相关信息。
进一步的, 本实施例提供的路由器还可以包括: 第二广播单元 16;
第二广播单元 16, 用于在所述处理模块在所述本端路由器的邻居列表中 添加所述邻居路由器的相关信息之后, 广播第三 Hello报文, 所述第三 Hello 报文中携带所述本端路由器的标识信息和优先级信息, 所述第三 Hello报文 中还携带所述本端路由器的邻居列表, 所述本端路由器的邻居列表中包括所 述邻居路由器的相关信息。
本发明实施例提供的路由器, 为本发明实施例提供的路由器邻居建立方 法的执行设备, 其具体实行路由器邻居建立方法的过程可参见方法实施例, 不再赘述。
本发明实施例提供的路由器, 当收到邻居路由器的 Hello报文后,根据邻 居路由器的优先级信息、 本端路由器的优先级信息, 以及邻居路由器是否为本 端路由器配置的虚链路对端设备来确定是否与邻居路由器建立邻居关系。 保 证小型设备能够与网络中的 DR和 BDR建立邻居关系,保证小型设备正常的 OSPF 功能。 如果确定不与邻居路由器建立邻居关系, 则无需对邻居列表进 行更新, 当接口状态机超时时, 进入 DR选举, DR选举列表中也同样不包括 该邻居路由器的标识信息, 从而简化了 DR选举的过程, 提高了 DR选举效 率。
最后应说明的是: 以上实施例仅用以说明本发明的技术方案, 而非对其 限制; 尽管参照前述实施例对本发明进行了详细的说明, 本领域的普通技术 人员应当理解: 其依然可以对前述各实施例所记载的技术方案进行修改, 或 者对其中部分技术特征进行等同替换; 而这些修改或者替换, 并不使相应技 术方案的本质脱离本发明各实施例技术方案的精神和范围。

Claims

权利 要 求
1、 一种路由器邻居建立方法, 其特征在于, 包括:
获取邻居路由器发送的第一发现协议 Hello报文,所述第一 Hello报文中 携带所述邻居路由器的标识信息和优先级信息;
根据所述邻居路由器的优先级信息, 和 /或本端路由器的优先级信息, 和
/或所述邻居路由器的标识信息是否为所述本端路由器配置的虚链路对端设 备的标识信息, 确定是否在所述本端路由器的邻居列表中添加所述邻居路由 器的相关信息。
2、 根据权利要求 1所述的方法, 其特征在于, 所述第一 Hello报文中还 携带所述邻居路由器的邻居列表, 若确定在所述本端路由器的邻居列表中添 加所述邻居路由器的相关信息, 则还所述方法包括:
判断所述邻居路由器的邻居列表中是否包括所述本端路由器的相关信 自 ·
若所述邻居路由器的邻居列表中不包括所述本端路由器的相关信息, 则 将所述本端路由器的邻居列表中所述邻居路由器的状态设置为状态 1 , 所述 状态 1用于表示所述本端路由器发现所述邻居路由器, 所述邻居路由器尚未 发现所述本端路由器; 若所述邻居路由器的邻居列表中包括所述本端路由器 的相关信息, 则将所述本端路由器的邻居列表中所述邻居路由器的状态设置 为状态 2, 所述状态 2用于表示所述本端路由器发现所述邻居路由器, 且所 述邻居路由器发现所述本端路由器。
3、根据权利要求 1或 2所述的方法, 其特征在于, 所述根据所述邻居路 由器的优先级信息, 和 /或本端路由器的优先级信息, 和 /或所述邻居路由器的 标识信息是否为所述本端路由器配置的虚链路对端设备的标识信息, 确定是 否在所述本端路由器的邻居列表中添加所述邻居路由器的相关信息, 包括: 根据所述邻居路由器的优先级信息, 判断所述邻居路由器的优先级是否 为 0; 若所述邻居路由器的优先级为 0, 则根据所述本端路由器的优先级信息, 判断所述本端路由器的优先级是否为 0;
若所述本端路由器的优先级为 0, 则判断所述邻居路由器的标识信息是 否为所述本端路由器配置的虚链路对端设备的标识信息;
若所述邻居路由器的标识信息不是所述本端路由器配置的虚链路对端设 备的标识信息, 则丟弃所述第一 Hello报文。
4、 根据权利要求 3所述的方法, 其特征在于, 所述丟弃所述第一 Hello 报文之后, 还包括:
广播第二 Hello报文,所述第二 Hello报文中携带所述本端路由器的标识 信息和优先级信息, 所述第二 Hello报文中还携带所述本端路由器的邻居列 表, 所述本端路由器的邻居列表中不包括所述邻居路由器的相关信息。
5、 根据权利要求 3所述的方法, 其特征在于, 还包括:
若所述邻居路由器的优先级不为 0, 则在所述本端路由器的邻居列表中 添加所述邻居路由器的相关信息。
6、 根据权利要求 3所述方法, 其特征在于, 还包括:
若所述本端路由器的优先级不为 0, 则在所述本端路由器的邻居列表中 添加所述邻居路由器的相关信息。
7、 根据权利要求 3所述的方法, 其特征在于, 还包括:
若所述邻居路由器标识信息是所述本端路由器配置的虚链路对端设备的 标识信息, 则在所述本端路由器的邻居列表中添加所述邻居路由器的相关信 自
8、 根据权利要求 5-7任一项所述的方法, 其特征在于, 所述在所述本端 路由器的邻居列表中添加所述邻居路由器的相关信息之后, 还包括:
广播第三 Hello报文,所述第三 Hello报文中携带所述本端路由器的标识 信息和优先级信息, 所述第三 Hello报文中还携带所述本端路由器的邻居列 表, 所述本端路由器的邻居列表中包括所述邻居路由器的相关信息。
9、 一种路由器, 其特征在于, 包括:
获取单元, 用于获取邻居路由器发送的第一发现协议 Hello报文, 所述 第一 Hello报文中携带所述邻居路由器的标识信息和优先级信息;
确定单元, 用于根据所述邻居路由器的优先级信息, 和 /或本端路由器的 优先级信息, 和 /或所述邻居路由器的标识信息是否为所述本端路由器配置的 虚链路对端设备的标识信息, 确定是否在所述本端路由器的邻居列表中添加 所述邻居路由器的相关信息。
10、 根据权利要求 9所述的路由器, 其特征在于, 所述第一 Hello报文 中还携带所述邻居路由器的邻居列表, 若所述确定单元确定在所述本端路由 器的邻居列表中添加所述邻居路由器的相关信息, 则所述路由器还包括: 判断单元, 用于判断所述邻居路由器的邻居列表中是否包括所述本端路 由器的相关信息;
设置单元, 用于若所述邻居路由器的邻居列表中不包括所述本端路由器 的相关信息, 则将所述本端路由器的邻居列表中所述邻居路由器的状态设置 为状态 1 , 所述状态 1 用于表示所述本端路由器发现所述邻居路由器, 所述 邻居路由器尚未发现所述本端路由器; 若所述邻居路由器的邻居列表中包括 所述本端路由器的相关信息, 则将所述本端路由器的邻居列表中所述邻居路 由器的状态设置为状态 2, 所述状态 2用于表示所述本端路由器发现所述邻 居路由器, 且所述邻居路由器发现所述本端路由器。
11、根据权利要求 9或 10所述的路由器, 其特征在于, 所述确定单元包 括:
判断模块, 用于根据所述邻居路由器的优先级信息, 判断所述邻居路由 器的优先级是否为 0, 若所述邻居路由器的优先级为 0, 则根据所述本端路由 器的优先级信息, 判断所述本端路由器的优先级是否为 0, 若所述本端路由 器的优先级为 0, 则判断所述邻居路由器的标识信息是否为所述本端路由器 配置的虚链路对端设备的标识信息; 处理模块, 用于若所述判断模块判断出所述邻居路由器的标识信息不是 所述本端路由器配置的虚链路对端设备的标识信息, 则丟弃所述第一 Hello 报文。
12、 根据权利要求 11所述的路由器, 其特征在于, 还包括:
第一广播单元, 用于在所述处理模块丟弃所述第一 Hello报文之后, 广 播第二 Hello报文,所述第二 Hello报文中携带所述本端路由器的标识信息和 优先级信息, 所述第二 Hello报文中还携带所述本端路由器的邻居列表, 所 述本端路由器的邻居列表中不包括所述邻居路由器的相关信息。
13、根据权利要求 11所述的路由器,其特征在于,所述处理模块还用于: 若所述判断模块判断出所述邻居路由器的优先级不为 0, 则在所述本端路由 器的邻居列表中添加所述邻居路由器的相关信息。
14、根据权利要求 11所述的路由器,其特征在于,所述处理模块还用于: 若所述判断模块判断出所述本端路由器的优先级不为 0, 则在所述本端路由 器的邻居列表中添加所述邻居路由器的相关信息。
15、根据权利要求 11所述的路由器,其特征在于,所述处理模块还用于: 若所述判断模块判断出所述邻居路由器标识信息是所述本端路由器配置的虚 链路对端设备的标识信息, 则在所述本端路由器的邻居列表中添加所述邻居 路由器的相关信息。
16、 根据权利要求 13-15任一项所述的路由器, 其特征在于, 还包括: 第二广播单元, 用于在所述处理模块在所述本端路由器的邻居列表中添 加所述邻居路由器的相关信息之后, 广播第三 Hello报文, 所述第三 Hello报 文中携带所述本端路由器的标识信息和优先级信息, 所述第三 Hello报文中 还携带所述本端路由器的邻居列表, 所述本端路由器的邻居列表中包括所述 邻居路由器的相关信息。
PCT/CN2011/076665 2011-06-30 2011-06-30 路由器邻居建立方法和设备 WO2012103731A1 (zh)

Priority Applications (4)

Application Number Priority Date Filing Date Title
EP11857722.0A EP2648375B1 (en) 2011-06-30 2011-06-30 Method and device for establishing router neighbor
PCT/CN2011/076665 WO2012103731A1 (zh) 2011-06-30 2011-06-30 路由器邻居建立方法和设备
CN201180000922.7A CN102318287B (zh) 2011-06-30 2011-06-30 路由器邻居建立方法和设备
US14/010,205 US9154401B2 (en) 2011-06-30 2013-08-26 Method and device for establishing router neighbor

Applications Claiming Priority (1)

Application Number Priority Date Filing Date Title
PCT/CN2011/076665 WO2012103731A1 (zh) 2011-06-30 2011-06-30 路由器邻居建立方法和设备

Related Child Applications (1)

Application Number Title Priority Date Filing Date
US14/010,205 Continuation US9154401B2 (en) 2011-06-30 2013-08-26 Method and device for establishing router neighbor

Publications (1)

Publication Number Publication Date
WO2012103731A1 true WO2012103731A1 (zh) 2012-08-09

Family

ID=45429435

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2011/076665 WO2012103731A1 (zh) 2011-06-30 2011-06-30 路由器邻居建立方法和设备

Country Status (4)

Country Link
US (1) US9154401B2 (zh)
EP (1) EP2648375B1 (zh)
CN (1) CN102318287B (zh)
WO (1) WO2012103731A1 (zh)

Families Citing this family (17)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN102546426B (zh) 2012-02-02 2014-09-24 杭州华三通信技术有限公司 用于实现以太网承载光纤通道的路由生成方法和装置
CN102546427B (zh) * 2012-02-02 2015-04-29 杭州华三通信技术有限公司 一种基于ospf协议的平滑重启方法和路由器
CN103004150B (zh) * 2012-06-27 2015-07-08 华为技术有限公司 最短路径优先邻居建立方法、节点及系统
US8902794B2 (en) * 2012-09-27 2014-12-02 Cisco Technology, Inc. System and method for providing N-way link-state routing redundancy without peer links in a network environment
US8862772B2 (en) * 2012-10-09 2014-10-14 Cisco Technology, Inc. System and method for implementing a multilevel data center fabric in a network environment
CN102932259A (zh) * 2012-11-20 2013-02-13 华为技术有限公司 邻居关系处理方法和路由设备
CN103491596B (zh) * 2013-09-29 2016-09-28 天公(山东)信息科技有限公司 一种微功率无线通信方法
CN103997457B (zh) * 2014-06-05 2018-05-08 重庆金美通信有限责任公司 一种OSPF无编号broadcast、NBMA接口的实现方法
CN104394098B (zh) * 2014-11-20 2018-07-10 迈普通信技术股份有限公司 一种报文处理方法和装置
CN105991452B (zh) * 2015-01-30 2019-05-31 国基电子(上海)有限公司 路由器及借用他人网络上网的方法
CN104852849B (zh) * 2015-05-04 2018-10-19 华为技术有限公司 一种ospf配置方法以及相关装置
CN105991349B (zh) * 2015-05-25 2020-04-03 杭州迪普科技股份有限公司 一种邻居表项备份方法及装置
CN107483224B (zh) * 2017-05-16 2021-01-19 上海博达数据通信有限公司 基于dr选举的无线路由版本升级方法
CN107612660A (zh) * 2017-09-28 2018-01-19 上海盈联电信科技有限公司 网络节点扫描方法
FR3087610B1 (fr) * 2018-10-17 2022-04-01 Bull Sas Echange de donnees dans une infrastructure des objets connectes
CN109873764B (zh) * 2019-02-21 2021-12-24 杭州迪普科技股份有限公司 建立定向ospf邻居关系的方法、装置、电子设备
CN110445714B (zh) * 2019-08-12 2021-08-20 徐州恒佳电子科技有限公司 一种基于ospf虚链路的改进型区域通信方法

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009702A (zh) * 2006-12-31 2007-08-01 中国科学院计算技术研究所 一种ospf全邻接条件下lsa被动式采集方法
CN101515859A (zh) * 2009-04-02 2009-08-26 杭州华三通信技术有限公司 一种因特网协议安全隧道传输组播的方法及设备
WO2009113786A2 (en) * 2008-03-10 2009-09-17 Samsung Electronics Co., Ltd. Method of removing the redundant information and compressing an ospf hello packet on a stable network

Family Cites Families (10)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
US5473599A (en) * 1994-04-22 1995-12-05 Cisco Systems, Incorporated Standby router protocol
US5953312A (en) * 1996-09-13 1999-09-14 Bay Networks Method and apparatus for determining alternate routes in a network using a connection-oriented protocol
US20030123457A1 (en) * 2001-12-27 2003-07-03 Koppol Pramod V.N. Apparatus and method for distributed software implementation of OSPF protocol
FR2839228B1 (fr) * 2002-04-30 2004-11-05 Thales Sa Procede d'adaptation du protocole de routage ospf au reseau radio
US7203175B2 (en) * 2002-08-15 2007-04-10 Cisco Technology, Inc. Arrangement for router attachments between roaming mobile routers in a mobile network
CN100558108C (zh) * 2006-03-13 2009-11-04 华为技术有限公司 一种快速建立邻居关系的方法及系统
US20080317047A1 (en) * 2007-06-20 2008-12-25 Motorola, Inc. Method for discovering a route to a peer node in a multi-hop wireless mesh network
US7706304B2 (en) * 2007-06-21 2010-04-27 Telefonaktiebolaget L M Ericsson (Publ) Method and system for assigning routers to hosts
CN100579076C (zh) * 2007-08-24 2010-01-06 华为技术有限公司 一种邻居关系建立方法和路由器
CN102111325B (zh) * 2009-12-23 2013-08-14 杭州华三通信技术有限公司 链路故障快速检测方法及装置

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN101009702A (zh) * 2006-12-31 2007-08-01 中国科学院计算技术研究所 一种ospf全邻接条件下lsa被动式采集方法
WO2009113786A2 (en) * 2008-03-10 2009-09-17 Samsung Electronics Co., Ltd. Method of removing the redundant information and compressing an ospf hello packet on a stable network
CN101515859A (zh) * 2009-04-02 2009-08-26 杭州华三通信技术有限公司 一种因特网协议安全隧道传输组播的方法及设备

Non-Patent Citations (2)

* Cited by examiner, † Cited by third party
Title
"OSPF Version 2, RFC 2328 (draft-ietf-ospf-vers2)", IETF, 30 April 1998 (1998-04-30) *
See also references of EP2648375A4 *

Also Published As

Publication number Publication date
EP2648375A4 (en) 2013-12-04
US20130336434A1 (en) 2013-12-19
US9154401B2 (en) 2015-10-06
CN102318287A (zh) 2012-01-11
CN102318287B (zh) 2014-09-17
EP2648375B1 (en) 2018-11-07
EP2648375A1 (en) 2013-10-09

Similar Documents

Publication Publication Date Title
WO2012103731A1 (zh) 路由器邻居建立方法和设备
JP6250825B2 (ja) データネットワークに最大冗長木(maximally redundant tree)をデプロイする方法およびシステム
US10044610B2 (en) System, method and apparatus providing bi-directional forwarding detection support to unnumbered IP interfaces
TWI461030B (zh) 在快速重新路由條件下之資源保留協定訊務工程平穩重新啟動
JP6017702B2 (ja) Twampを増強するための方法及び装置
TWI499237B (zh) 廣播網路之標籤分配協定與內部閘道協定同步化
RU2521092C2 (ru) Синхронизация ldp и igp для широковещательных сетей
US9668160B2 (en) Topology discovery based on SCTP/X2 snooping
WO2013082983A1 (zh) OpenFlow网络域间的数据发送方法及装置
US8667174B2 (en) Method and system for survival of data plane through a total control plane failure
WO2014047784A1 (zh) 报文转发路径确定方法及网络设备、控制设备
WO2013044751A1 (zh) 基于性能的路由方法和设备
WO2007003088A1 (fr) Méthode et système de mise à jour d’une route
EP3058777B1 (en) Topology discovery based on explicit signaling
WO2015154420A1 (zh) 基于isis的路由计算方法及装置
WO2012130083A1 (zh) 一种配置地址解析协议arp表项的方法和装置
RU2656709C1 (ru) Способ и устройство лавинной маршрутизации на основе протокола isis
JP2022052741A (ja) 境界ゲートウェイプロトコルのためのターゲットネイバー探索
WO2011029241A1 (zh) 一种路由处理方法、系统和路由器
CN111327530B (zh) 数据发送方法、装置、网络系统及交换机
WO2017000566A1 (zh) 一种获取设备接口mru值的方法及装置
WO2021219049A1 (zh) 一种信息上报方法、信息处理方法、装置及设备
WO2015100610A1 (zh) 保持用户设备ip地址固定的方法和设备
CN110430088B (zh) 一种ndn网络中邻居节点发现并自动建立连接的方法
WO2012167623A1 (zh) 一种选择路由的方法及设备

Legal Events

Date Code Title Description
WWE Wipo information: entry into national phase

Ref document number: 201180000922.7

Country of ref document: CN

121 Ep: the epo has been informed by wipo that ep was designated in this application

Ref document number: 11857722

Country of ref document: EP

Kind code of ref document: A1

WWE Wipo information: entry into national phase

Ref document number: 2011857722

Country of ref document: EP

NENP Non-entry into the national phase

Ref country code: DE