WO2016127599A1 - Neighbor discovering method and apparatus - Google Patents

Neighbor discovering method and apparatus Download PDF

Info

Publication number
WO2016127599A1
WO2016127599A1 PCT/CN2015/086126 CN2015086126W WO2016127599A1 WO 2016127599 A1 WO2016127599 A1 WO 2016127599A1 CN 2015086126 W CN2015086126 W CN 2015086126W WO 2016127599 A1 WO2016127599 A1 WO 2016127599A1
Authority
WO
WIPO (PCT)
Prior art keywords
docking device
information
protocol packet
hdlc protocol
docking
Prior art date
Application number
PCT/CN2015/086126
Other languages
French (fr)
Chinese (zh)
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 中兴通讯股份有限公司
Publication of WO2016127599A1 publication Critical patent/WO2016127599A1/en

Links

Images

Definitions

  • This paper relates to the field of data communications, and in particular to a method and apparatus for neighbor discovery.
  • HDLC High-Level Data Link Control
  • the HDLC protocol is complex.
  • the industry usually uses the cHDLC protocol.
  • the cHDLC is a bit-oriented synchronous data control protocol. It is a simplified HDLC protocol. It only sends HELLO packets (the protocol is SLARP broadcast packets). Negotiate.
  • the POSGROUP interface To improve the communication capability of the link, you need to bundle multiple HDLC-encapsulated ports (such as POS ports) into one aggregation port, called the POSGROUP interface.
  • the total bandwidth of the POSGROUP interface is the sum of all member bandwidths. You can increase the bandwidth of the interface.
  • the POSGROUP interface distributes traffic to different links and finally reaches the unified destination. This prevents traffic from being blocked by the same path. Road reliability (in a POSGROUP port, if a member port is Down, traffic can also be transmitted by other interfaces).
  • the HDLC protocol is a one-way control protocol and does not have the ability to discover neighbors.
  • the link single-pass is often caused by transmission problems between point-to-point devices, or the operator cross-connects the optical fibers incorrectly. The error will cause the transmission of the entire aggregate port service to be interrupted, which affects the service usage. Therefore, the relevant processing methods need to be considered.
  • Embodiments of the present invention provide a method and apparatus for neighbor discovery to solve the problem that a neighbor cannot be found.
  • An embodiment of the present invention provides a method for neighbor discovery, where the method includes:
  • the first docking device encapsulates an advanced data link to control HDLC protocol packets; the HDLC protocol
  • the packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device and the remote information of the first docking device are used by the second docking device to perform neighbor determination.
  • the first docking device sends the HDLC protocol packet to the second docking device.
  • the first interface device encapsulates the advanced data link control HDLC protocol packet, including: manually configuring the first interface device local information in the HDLC protocol packet, and the first docking device remote end The information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are configured.
  • the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local end.
  • Information, the remote information of the first docking device is the configured remote information; the self-learning configuration of the first docking device local information and the first docking device remote information in the HDLC protocol packet
  • the local information of the first docking device is the default local information, and the remote information of the first docking device is self-learning remote information or 0.
  • the embodiment of the invention further provides a method for neighbor discovery, the method comprising:
  • the second docking device receives the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface device local information and the first docking device remote information;
  • the second docking device determines, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
  • the determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
  • the second docking device When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
  • the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the embodiment of the present invention further provides a device for neighbor discovery, which is disposed on the first docking device, and the device includes:
  • the encapsulating module is configured to encapsulate the advanced data link to control the HDLC protocol packet;
  • the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device and the first The remote information of the pair of devices is used by the second docking device to perform neighbor determination;
  • the sending module is configured to send the HDLC protocol packet to the second docking device.
  • the encapsulating module encapsulating the advanced data link control HDLC protocol packet is: manually configuring the first interfacing device local information and the first interfacing device remote information in the HDLC protocol packet Or self-learning to configure the first interface device local information and the first docking device remote information in the HDLC protocol packet.
  • the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local end.
  • Information, the remote information of the first docking device is the configured remote information; the self-learning configuration of the first docking device local information and the first docking device remote information in the HDLC protocol packet
  • the local information of the first docking device is the default local information, and the remote information of the first docking device is self-learning remote information or 0.
  • the embodiment of the present invention further provides a device for neighbor discovery, which is disposed on a second docking device, and the device includes:
  • the receiving module is configured to receive the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface device local information and the first docking device remote information;
  • the determining module is configured to determine, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
  • the determining, by the determining module, whether the first docking device is a neighbor of the second docking device, according to the HDLC protocol packet includes:
  • the second docking device When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the determining, by the determining module, whether the first docking device is a neighbor of the second docking device, according to the HDLC protocol packet includes:
  • the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
  • the above solution solves the problem that the neighboring interface cannot be found by the standard HDLC protocol packet encapsulation format, and effectively avoids the interruption of the entire aggregation interface service caused by the member link single-pass or cross-connection error.
  • Embodiment 1 is a flowchart of a method for neighbor discovery in Embodiment 1 of the present invention
  • FIG. 3 is a schematic structural diagram of an apparatus for neighbor discovery in Embodiment 1 of the present invention.
  • FIG. 4 is another schematic structural diagram of an apparatus for neighbor discovery in the first embodiment of the present invention.
  • Embodiment 5 is a flowchart of a method for neighbor discovery in Embodiment 2 of the present invention.
  • FIG. 6 is a schematic diagram of networking in the second embodiment of the present invention.
  • Embodiment 7 is a flowchart of sending an HDLC protocol packet in Embodiment 2 of the present invention.
  • FIG. 8 is a flowchart of receiving an HDLC protocol packet according to Embodiment 2 of the present invention.
  • an embodiment of the present invention provides a method for neighbor discovery, where the method includes:
  • Step S101 The first docking device encapsulates the advanced data link to control the HDLC protocol packet; the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device And the first connection device remote information is used by the second docking device to perform neighbor determination;
  • Step S102 The first docking device sends the HDLC protocol packet to the second docking device.
  • the first interface device encapsulates the advanced data link to control the HDLC protocol packet, including:
  • the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local information, The remote information of the first docking device is configured remote information;
  • the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are self-learned, the local information of the first docking device is the default local information.
  • the remote information of the first docking device is self-learning remote information or 0.
  • an embodiment of the present invention further provides a method for neighbor discovery, where the method includes:
  • Step S103 The second docking device receives the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface of the first docking device and the first pair. Connect to the remote information of the device;
  • Step S104 The second docking device determines, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
  • the determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
  • the second docking device When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the embodiment of the present invention further provides a device for neighbor discovery, which is disposed on the first docking device 1, and the device includes:
  • the encapsulation module 11 is configured to encapsulate an advanced data link control HDLC protocol packet, where the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device is The first docking device remote information is used by the second docking device to perform neighbor determination;
  • the sending module 12 is configured to send the HDLC protocol packet to the second docking device.
  • the encapsulating module 11 encapsulates the advanced data link control HDLC protocol packet, which means:
  • the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local information.
  • the remote information of the first docking device is configured remote information;
  • the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are self-learned, the local information of the first docking device is the default local information.
  • the remote information of the first docking device is self-learning remote information or 0.
  • the embodiment of the present invention further provides a device for neighbor discovery, which is disposed on the second docking device 2, and the device includes:
  • the receiving module 21 is configured to receive the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface device local information and the first docking device remote information;
  • the determining module 22 is configured to determine, according to the HDLC protocol message, whether the first docking device is a neighbor of the second docking device.
  • the determining, by the determining module 22, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
  • the second docking device When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the neighbor discovery method and device provided by the embodiments of the present invention solve the problem that the neighboring network cannot be discovered, and the transmission problem of the entire aggregate interface service interruption caused by the member link single-pass or cross-connection error in the HDLC aggregation link scenario is avoided.
  • the first docking device sends the HDLC protocol packet
  • the second docking device receives the HDLC protocol packet as an example to describe the method for the second docking device to determine its neighbor:
  • Step S201 The first docking device encapsulates the advanced data link to control the HDLC protocol packet; the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device;
  • the two devices in the network are configured as a point-to-point device connection environment.
  • the link aggregation of the POS port based on the HDLC protocol is established between the two bridge devices. Establish an HDLC aggregation channel.
  • the neighbor discovery function can be controlled at the same time by manual configuration.
  • the first docking device usually saves and maintains a relationship between the local information and the remote information, as shown in Table 1 and Table 2.
  • the local device sends the HDLC protocol packet
  • the local device also extends the TLV field carrying the local information and the remote information in addition to the normal configuration protocol packet format, and notifies the information about the local device that is uniquely identified to the remote device. end;
  • Step S202 The first docking device sends the HDLC protocol packet to the second docking device.
  • Step S203 The second docking device receives the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device.
  • the remote device When the remote device receives the HDLC protocol packet, the remote device parses the local and remote information carried in the HDLC protocol packet, and the second docking device. Comparing the local information and the remote information carried in the parsed HDLC protocol packets with the local information and the remote information stored locally by the second docking device, and determining whether the first docking device is a previously docked neighbor. ;
  • Step S204 The second docking device determines, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
  • the determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
  • the second docking device When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
  • the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is the same, the first docking device is the neighbor of the second docking device. If the packets are inconsistent, the packet is discarded and the neighbor discovery detection activity is completed.
  • first docking device and the second docking device are interchangeable, and the first docking device and the second docking device can simultaneously enable the neighbor discovery function.
  • the HDLC is a peer-to-peer connection scenario
  • both the first docking device and the second docking device have the neighbor discovery function enabled, the two ends can mutually discover neighbors, thereby implementing two-way neighbor discovery; if the first device or the second device If the neighbor discovery function is disabled, the device records the fault as the remote end, records the time, discards the packet, and completes the neighbor discovery detection.
  • the first docking device can be configured to enable the neighbor discovery function.
  • the second connection device can also be configured to enable the neighbor discovery function. If the second connection device or the second connection device does not enable the neighbor discovery function, the packet is processed according to standard protocol packets.
  • the HDLC protocol packet can carry the manually configured local and remote information, or carry the default local information and the learned remote information.
  • the default local information can uniquely identify the uniqueness of the first docking device.
  • the parameter such as the interface name interface + host name hostname, can be carried as 0 if no remote information is learned.
  • Step 701 Send a link-building HDLC protocol packet.
  • Step 702 populating a basic message field
  • Step 703 whether the extension is extended, if it is to perform step 704, if not, step 711;
  • the sending of the packet refers to the sending of the built-in HDLC protocol packet, and the extended enabling means that the neighbor discovery function is enabled.
  • Step 704 it is determined whether the local interface information is configured on the sending interface, if yes, step 706 is performed, if no, step 705 is performed;
  • Step 705 taking homtname (host name) + interface name (interface name) splicing (for example, can be spliced with spaces), truncating or filling 0-64B, encapsulating the local information (local info), step 707;
  • Step 706 taking the local information of the configuration, truncating or filling 0 to 64B, encapsulating the information of the local end, and performing step 707;
  • Step 707 the HDLC peer information table is checked, if the information of the peer device saved by the local end is found and matched, step 708 is performed, if no match is found or no match is found, step 710 is performed;
  • Step 708 the current time-received timestamp is less than the protection period, if yes, step 709 is performed, if not, step 710 is performed;
  • Step 709 taking peerinfo, truncating or filling 0 to 64B, encapsulating as peer info, performing step 711;
  • the peer info is the locally saved peer information, and the peer info is encapsulated into the peer information field in the packet.
  • Step 710 padding 0 to 64B, encapsulating as peer info, performing step 711;
  • Step 711 filling an FCS (check code) field
  • FCS field is used to check for packet errors.
  • Step 712 Send an HDLC protocol protection packet.
  • the second docking device when the second docking device receives the HDLC protocol packet, if the neighbor discovery function is enabled, the local information and the remote information stored in the local device can be compared with the information in the received HDLC protocol packet. Whether it is a previous docking neighbor.
  • Step 801 Receive an HDLC protocol packet.
  • Step 802 whether the interface is extended, that is, whether to enable the neighbor discovery function, if yes, go to step 803, if no, go to step 817;
  • Step 803 check the HDLC information table, query whether the peer information has been saved, if yes, execute 805, if not, go to step 804;
  • Step 804 adding an HDLC peer entry, failing to return;
  • Step 805 whether the interface is configured with the peer information, if yes, go to step 809, if no, go to step 806;
  • Step 806 whether the peerinfo in the entry is empty, if yes, go to step 807, if no, go to step 808;
  • Step 807 the local information in the message (local info) is filled in the peerinfo in the entry, step 812 is performed;
  • Step 808 whether the peerinfo in the entry is equal to the local information in the packet, if yes, go to step 812, if no, go to step 811;
  • step 809 the peer information configured on the interface is equal to the local information in the packet. If yes, go to step 810. If no, go to step 811.
  • Step 810 the local information in the message is filled in the peerinfo in the entry, step 812 is performed;
  • Step 811 Fill in the local information in the packet to the Illegal peerinfo in the entry, and return.
  • the Illegal peerinfo is the illegal peer information saved by the local entry.
  • the first successful negotiation is legal. If the second peer information is different, it can be considered as an illegal peer.
  • Step 812 it is determined whether the interface is configured with the local information, if yes, step 815 is performed, if no, step 813 is performed;
  • step 813 the host name and the interface name are spliced with spaces, and 0 to 64B are truncated or filled as the local information.
  • Step 814 Determine whether the local end information of the interface is equal to the peerinfo in the packet. If yes, go to step 816. If no, return.
  • Step 815 Determine whether the local end information of the interface is equal to the peerinfo in the packet. If yes, go to step 816. If no, return.
  • Step 816 time stamp processing
  • the timestamp processing includes saving the time of receiving the packet, which is convenient for calculating and processing timeout.
  • step 817 the packet is processed according to the standard protocol, and is returned.
  • the above solution solves the problem that the neighboring interface cannot be found by the standard HDLC protocol packet encapsulation format, and effectively avoids the interruption of the entire aggregation interface service caused by the member link single-pass or cross-connection error.

Landscapes

  • Communication Control (AREA)
  • Computer And Data Communications (AREA)

Abstract

A neighbor discovering method. The method comprises: a first interconnecting device encapsulates a high-level data link control (HDLC) protocol packet, the HDLC protocol packet carries local end information of the first connecting device and remote end information of the first connecting device, and local end information of the first connecting device and remote end information of the first connecting device are used for performing neighbor judgment of a second interconnecting device; and the first interconnecting device sends the HDLC protocol packet to the second interconnecting device.

Description

一种邻居发现的方法和装置Method and device for neighbor discovery 技术领域Technical field
本文涉及数据通信领域,尤其涉及一种邻居发现的方法和装置。This paper relates to the field of data communications, and in particular to a method and apparatus for neighbor discovery.
背景技术Background technique
随着数据链路技术的发展,HDLC(High-Level Data Link Control,高级数据链路控制)技术广泛应用在点到点的高速链路上。由于HDLC协议较为复杂,业界通常使用的是cHDLC协议,cHDLC是一种作为面向比特的同步数据控制协议,是一种简化的HDLC协议,仅仅通过发送HELLO报文(协议为SLARP的广播报文)进行协商。With the development of data link technology, HDLC (High-Level Data Link Control) technology is widely used on point-to-point high-speed links. The HDLC protocol is complex. The industry usually uses the cHDLC protocol. The cHDLC is a bit-oriented synchronous data control protocol. It is a simplified HDLC protocol. It only sends HELLO packets (the protocol is SLARP broadcast packets). Negotiate.
为了提高链路的通信能力,需要将多个基于HDLC封装的端口(比如POS端口)捆绑为一个聚合端口,称为POSGROUP接口,POSGROUP接口的总带宽是所有成员带宽之和,通过这种聚合方式,可以增加接口的带宽;同时可以实现负载分担(POSGROUP接口将流量分散到不同的链路上,最后到达统一目的地,这样可以避免流量都走同一条路径造成的流量阻塞);还可以提高链路的可靠性(在POSGROUP端口中,如一个成员端口状态为Down,流量还能依靠其他的接口进行传输)。To improve the communication capability of the link, you need to bundle multiple HDLC-encapsulated ports (such as POS ports) into one aggregation port, called the POSGROUP interface. The total bandwidth of the POSGROUP interface is the sum of all member bandwidths. You can increase the bandwidth of the interface. At the same time, you can implement load balancing. The POSGROUP interface distributes traffic to different links and finally reaches the unified destination. This prevents traffic from being blocked by the same path. Road reliability (in a POSGROUP port, if a member port is Down, traffic can also be transmitted by other interfaces).
但是,HDLC协议是单向控制协议,不具备发现邻居的能力,在实际应用中,经常由于点到点设备之间传输问题导致的链路单通,或者由于操作人员把光纤交叉连接错误,这些错误会导致整个聚合端口业务中断的传输问题,影响业务使用,因此需要考虑相关的处理办法。However, the HDLC protocol is a one-way control protocol and does not have the ability to discover neighbors. In practical applications, the link single-pass is often caused by transmission problems between point-to-point devices, or the operator cross-connects the optical fibers incorrectly. The error will cause the transmission of the entire aggregate port service to be interrupted, which affects the service usage. Therefore, the relevant processing methods need to be considered.
发明内容Summary of the invention
本发明实施例提供一种邻居发现的方法和装置,以解决无法发现邻居的问题。Embodiments of the present invention provide a method and apparatus for neighbor discovery to solve the problem that a neighbor cannot be found.
本发明实施例提供一种邻居发现的方法,所述方法包括:An embodiment of the present invention provides a method for neighbor discovery, where the method includes:
第一对接设备封装高级数据链路控制HDLC协议报文;所述HDLC协议 报文携带第一对接设备本端信息和第一对接设备远端信息,所述第一对接设备本端信息和第一对接设备远端信息用于所述第二对接设备进行邻居判断;The first docking device encapsulates an advanced data link to control HDLC protocol packets; the HDLC protocol The packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device and the remote information of the first docking device are used by the second docking device to perform neighbor determination.
所述第一对接设备将所述HDLC协议报文发送给第二对接设备。The first docking device sends the HDLC protocol packet to the second docking device.
可选地,所述第一对接设备封装高级数据链路控制HDLC协议报文包括:手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息,或者自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息。Optionally, the first interface device encapsulates the advanced data link control HDLC protocol packet, including: manually configuring the first interface device local information in the HDLC protocol packet, and the first docking device remote end The information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are configured.
可选地,当手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为配置的本端信息,所述第一对接设备的远端信息为配置的远端信息;当自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为默认的本端信息,所述第一对接设备的远端信息为自学习的远端信息或0。Optionally, when the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local end. Information, the remote information of the first docking device is the configured remote information; the self-learning configuration of the first docking device local information and the first docking device remote information in the HDLC protocol packet The local information of the first docking device is the default local information, and the remote information of the first docking device is self-learning remote information or 0.
本发明实施例还提供一种邻居发现的方法,所述方法包括:The embodiment of the invention further provides a method for neighbor discovery, the method comprising:
第二对接设备接收第一对接设备发送的高级数据链路控制HDLC协议报文,所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息;The second docking device receives the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface device local information and the first docking device remote information;
所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居。The second docking device determines, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
可选地,所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:Optionally, the determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
当所述第二对接设备未保存第二对接设备远端信息时,保存所述第一对接设备本端信息;所述第二对接设备判断所述HDLC协议报文携带的第一对接设备远端信息与所述第二对接设备保存的第二对接设备本端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
可选地,所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括: Optionally, the determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
当所述第二对接设备保存有第二对接设备远端信息时,所述第二对接设备判断所述HDLC协议报文携带的第一对接设备本端信息与所述第二对接设备保存的第二对接设备远端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device stores the remote information of the second docking device, the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
本发明实施例还提供一种邻居发现的装置,设置于第一对接设备,所述装置包括:The embodiment of the present invention further provides a device for neighbor discovery, which is disposed on the first docking device, and the device includes:
封装模块,设置为封装高级数据链路控制HDLC协议报文;所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息,所述第一对接设备本端信息和第一对接设备远端信息用于所述第二对接设备进行邻居判断;以及The encapsulating module is configured to encapsulate the advanced data link to control the HDLC protocol packet; the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device and the first The remote information of the pair of devices is used by the second docking device to perform neighbor determination;
发送模块,设置为将所述HDLC协议报文发送给第二对接设备。The sending module is configured to send the HDLC protocol packet to the second docking device.
可选地,所述封装模块封装高级数据链路控制HDLC协议报文是指:手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息,或者自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息。Optionally, the encapsulating module encapsulating the advanced data link control HDLC protocol packet is: manually configuring the first interfacing device local information and the first interfacing device remote information in the HDLC protocol packet Or self-learning to configure the first interface device local information and the first docking device remote information in the HDLC protocol packet.
可选地,当手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为配置的本端信息,所述第一对接设备的远端信息为配置的远端信息;当自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为默认的本端信息,所述第一对接设备的远端信息为自学习的远端信息或0。Optionally, when the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local end. Information, the remote information of the first docking device is the configured remote information; the self-learning configuration of the first docking device local information and the first docking device remote information in the HDLC protocol packet The local information of the first docking device is the default local information, and the remote information of the first docking device is self-learning remote information or 0.
本发明实施例还提供一种邻居发现的装置,设置于第二对接设备,所述装置包括:The embodiment of the present invention further provides a device for neighbor discovery, which is disposed on a second docking device, and the device includes:
接收模块,设置为接收第一对接设备发送的高级数据链路控制HDLC协议报文,所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息;以及 The receiving module is configured to receive the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface device local information and the first docking device remote information;
判断模块,设置为根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居。The determining module is configured to determine, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
可选地,所述判断模块根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:Optionally, the determining, by the determining module, whether the first docking device is a neighbor of the second docking device, according to the HDLC protocol packet, includes:
当所述第二对接设备未保存第二对接设备远端信息时,保存所述第一对接设备本端信息;所述第二对接设备判断所述HDLC协议报文携带的第一对接设备远端信息与所述第二对接设备保存的第二对接设备本端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
可选地,所述判断模块根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:Optionally, the determining, by the determining module, whether the first docking device is a neighbor of the second docking device, according to the HDLC protocol packet, includes:
当所述第二对接设备保存有第二对接设备远端信息时,所述第二对接设备判断所述HDLC协议报文携带的第一对接设备本端信息与所述第二对接设备保存的第二对接设备远端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device stores the remote information of the second docking device, the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
本发明实施例还提供一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现上述方法。The embodiment of the invention further provides a computer readable storage medium storing program instructions, which can be implemented when the program instructions are executed.
上述方案通过对标准HDLC协议报文封装格式进行扩展,解决了无法发现邻居的问题,有效避免了因成员链路单通或者交叉连接错误导致的整个聚合接口业务中断的问题。The above solution solves the problem that the neighboring interface cannot be found by the standard HDLC protocol packet encapsulation format, and effectively avoids the interruption of the entire aggregation interface service caused by the member link single-pass or cross-connection error.
附图概述BRIEF abstract
图1是本发明实施例一中邻居发现的方法的流程图;1 is a flowchart of a method for neighbor discovery in Embodiment 1 of the present invention;
图2是本发明实施例一中邻居发现的方法的另一流程图;2 is another flowchart of a method for neighbor discovery in Embodiment 1 of the present invention;
图3是本发明实施例一中邻居发现的装置的结构示意图;3 is a schematic structural diagram of an apparatus for neighbor discovery in Embodiment 1 of the present invention;
图4是本发明实施例一中邻居发现的装置的另一结构示意图;4 is another schematic structural diagram of an apparatus for neighbor discovery in the first embodiment of the present invention;
图5是本发明实施例二中邻居发现的方法的流程图;5 is a flowchart of a method for neighbor discovery in Embodiment 2 of the present invention;
图6是本发明实施例二中组网示意图; 6 is a schematic diagram of networking in the second embodiment of the present invention;
图7是本发明实施例二中发送HDLC协议报文的流程图;7 is a flowchart of sending an HDLC protocol packet in Embodiment 2 of the present invention;
图8是本发明实施例二中接收HDLC协议报文的流程图。FIG. 8 is a flowchart of receiving an HDLC protocol packet according to Embodiment 2 of the present invention.
本发明的实施方式Embodiments of the invention
下文中将结合附图对本申请实施例进行详细说明。需要说明的是,在不冲突的情况下,本申请中的实施例及实施例中的特征可以相互任意组合。The embodiments of the present application will be described in detail below with reference to the accompanying drawings. It should be noted that, in the case of no conflict, the features in the embodiments and the embodiments in the present application may be arbitrarily combined with each other.
实施例一Embodiment 1
如图1所示,本发明实施例提供一种邻居发现的方法,所述方法包括:As shown in FIG. 1 , an embodiment of the present invention provides a method for neighbor discovery, where the method includes:
步骤S101:第一对接设备封装高级数据链路控制HDLC协议报文;所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息,所述第一对接设备本端信息和第一对接设备远端信息用于第二对接设备进行邻居判断;Step S101: The first docking device encapsulates the advanced data link to control the HDLC protocol packet; the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device And the first connection device remote information is used by the second docking device to perform neighbor determination;
步骤S102:第一对接设备将所述HDLC协议报文发送给第二对接设备。Step S102: The first docking device sends the HDLC protocol packet to the second docking device.
其中,所述第一对接设备封装高级数据链路控制HDLC协议报文包括:The first interface device encapsulates the advanced data link to control the HDLC protocol packet, including:
手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息,或者自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息。Manually configuring the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet, or self-learning to configure the local end of the first docking device in the HDLC protocol packet Information and the first docking device remote information.
当手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为配置的本端信息,所述第一对接设备的远端信息为配置的远端信息;When the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local information, The remote information of the first docking device is configured remote information;
当自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为默认的本端信息,所述第一对接设备的远端信息为自学习的远端信息或0。When the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are self-learned, the local information of the first docking device is the default local information. The remote information of the first docking device is self-learning remote information or 0.
如图2所示,本发明实施例还提供一种邻居发现的方法,所述方法包括:As shown in FIG. 2, an embodiment of the present invention further provides a method for neighbor discovery, where the method includes:
步骤S103:第二对接设备接收第一对接设备发送的高级数据链路控制HDLC协议报文,所述HDLC协议报文携带第一对接设备本端信息和第一对 接设备远端信息;Step S103: The second docking device receives the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface of the first docking device and the first pair. Connect to the remote information of the device;
步骤S104:第二对接设备根据所述HDLC协议报文判断第一对接设备是否为第二对接设备的邻居。Step S104: The second docking device determines, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
其中,所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:The determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
当所述第二对接设备未保存第二对接设备远端信息时,保存所述第一对接设备本端信息;所述第二对接设备判断所述HDLC协议报文携带的第一对接设备远端信息与所述第二对接设备保存的第二对接设备本端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
当所述第二对接设备保存有第二对接设备远端信息时,所述第二对接设备判断所述HDLC协议报文携带的第一对接设备本端信息与所述第二对接设备保存的第二对接设备远端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device stores the remote information of the second docking device, the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
如图3所示,本发明实施例还提供一种邻居发现的装置,设置于第一对接设备1,所述装置包括:As shown in FIG. 3, the embodiment of the present invention further provides a device for neighbor discovery, which is disposed on the first docking device 1, and the device includes:
封装模块11,设置为封装高级数据链路控制HDLC协议报文;所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息,所述第一对接设备本端信息和第一对接设备远端信息用于所述第二对接设备进行邻居判断;以及The encapsulation module 11 is configured to encapsulate an advanced data link control HDLC protocol packet, where the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device is The first docking device remote information is used by the second docking device to perform neighbor determination;
发送模块12,设置为将所述HDLC协议报文发送给第二对接设备。The sending module 12 is configured to send the HDLC protocol packet to the second docking device.
可选地,Optionally,
所述封装模块11封装高级数据链路控制HDLC协议报文是指:The encapsulating module 11 encapsulates the advanced data link control HDLC protocol packet, which means:
手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息,或者自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息。Manually configuring the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet, or self-learning to configure the local end of the first docking device in the HDLC protocol packet Information and the first docking device remote information.
当手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为配置的本端信息, 所述第一对接设备的远端信息为配置的远端信息;When the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local information. The remote information of the first docking device is configured remote information;
当自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为默认的本端信息,所述第一对接设备的远端信息为自学习的远端信息或0。When the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are self-learned, the local information of the first docking device is the default local information. The remote information of the first docking device is self-learning remote information or 0.
如图4所示,本发明实施例还提供一种邻居发现的装置,设置于第二对接设备2,所述装置包括:As shown in FIG. 4, the embodiment of the present invention further provides a device for neighbor discovery, which is disposed on the second docking device 2, and the device includes:
接收模块21,设置为接收第一对接设备发送的高级数据链路控制HDLC协议报文,所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息;以及The receiving module 21 is configured to receive the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface device local information and the first docking device remote information;
判断模块22,设置为根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居。The determining module 22 is configured to determine, according to the HDLC protocol message, whether the first docking device is a neighbor of the second docking device.
可选地,Optionally,
所述判断模块22根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:The determining, by the determining module 22, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
当所述第二对接设备未保存第二对接设备远端信息时,保存所述第一对接设备本端信息;所述第二对接设备判断所述HDLC协议报文携带的第一对接设备远端信息与所述第二对接设备保存的第二对接设备本端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
当所述第二对接设备保存有第二对接设备远端信息时,所述第二对接设备判断所述HDLC协议报文携带的第一对接设备本端信息与所述第二对接设备保存的第二对接设备远端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device stores the remote information of the second docking device, the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
本发明实施例提供的邻居发现方法和装置,解决无法发现邻居的问题,从避免了HDLC聚合链路场景下,因成员链路单通或者交叉连接错误导致的整个聚合接口业务中断的传输问题。The neighbor discovery method and device provided by the embodiments of the present invention solve the problem that the neighboring network cannot be discovered, and the transmission problem of the entire aggregate interface service interruption caused by the member link single-pass or cross-connection error in the HDLC aggregation link scenario is avoided.
实施例二 Embodiment 2
如图5所示,下面以第一对接设备发送HDLC协议报文,第二对接设备接收该HDLC协议报文为例,说明第二对接设备判断其邻居的方法:As shown in FIG. 5, the first docking device sends the HDLC protocol packet, and the second docking device receives the HDLC protocol packet as an example to describe the method for the second docking device to determine its neighbor:
步骤S201:第一对接设备封装高级数据链路控制HDLC协议报文;所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息;Step S201: The first docking device encapsulates the advanced data link to control the HDLC protocol packet; the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device;
如图6所示,网络中两台设备配置成点到点的设备连接环境,其中在两台桥接设备之间建立基于HDLC协议封装的POS端口链路聚合,在点到点路由器设备对接场景下建立HDLC聚合通道。As shown in Figure 6, the two devices in the network are configured as a point-to-point device connection environment. The link aggregation of the POS port based on the HDLC protocol is established between the two bridge devices. Establish an HDLC aggregation channel.
在本实施例中,同时可以通过人工配置方式控制开启邻居发现功能。第一对接设备通常会保存以及维护本端信息与远端信息的关系表,举例如表1和表2所示。第一对接设备本端发送HDLC协议报文的时候,除了正常的构造协议报文格式外,还扩展携带本端信息与远端信息的TLV字段,把相关唯一标识本端设备的信息通告给远端;In this embodiment, the neighbor discovery function can be controlled at the same time by manual configuration. The first docking device usually saves and maintains a relationship between the local information and the remote information, as shown in Table 1 and Table 2. When the local device sends the HDLC protocol packet, the local device also extends the TLV field carrying the local information and the remote information in addition to the normal configuration protocol packet format, and notifies the information about the local device that is uniquely identified to the remote device. end;
表1协议报文格式举例Table 1 Example of protocol packet format
Figure PCTCN2015086126-appb-000001
Figure PCTCN2015086126-appb-000001
表2自学习的本端信息和远端信息报文格式举例Table 2 Examples of local and remote information packet formats for self-learning
Figure PCTCN2015086126-appb-000002
Figure PCTCN2015086126-appb-000002
步骤S202:所述第一对接设备将所述HDLC协议报文发送给第二对接设备; Step S202: The first docking device sends the HDLC protocol packet to the second docking device.
步骤S203:第二对接设备接收第一对接设备发送的高级数据链路控制HDLC协议报文,所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息;Step S203: The second docking device receives the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device.
第二对接设备远端接收到HDLC协议报文的时候,除了解析远端构造的协议报文格式外,会解析出该HDLC协议报文中携带的本端信息与远端信息,第二对接设备将解析出的HDLC协议报文中携带的本端信息和远端信息与第二对接设备本地保存的本端信息和远端信息进行比较,进而可判断第一对接设备是否是其先前对接的邻居;When the remote device receives the HDLC protocol packet, the remote device parses the local and remote information carried in the HDLC protocol packet, and the second docking device. Comparing the local information and the remote information carried in the parsed HDLC protocol packets with the local information and the remote information stored locally by the second docking device, and determining whether the first docking device is a previously docked neighbor. ;
步骤S204:所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居。Step S204: The second docking device determines, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
其中,所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:The determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol packet includes:
当所述第二对接设备未保存第二对接设备远端信息时,保存所述第一对接设备本端信息;所述第二对接设备判断所述HDLC协议报文携带的第一对接设备远端信息与所述第二对接设备保存的第二对接设备本端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
当所述第二对接设备保存有第二对接设备远端信息时,所述第二对接设备判断所述HDLC协议报文携带的第一对接设备本端信息与所述第二对接设备保存的第二对接设备远端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居;如果不一致,则丢弃报文,完成邻居发现检测活动。When the second docking device stores the remote information of the second docking device, the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is the same, the first docking device is the neighbor of the second docking device. If the packets are inconsistent, the packet is discarded and the neighbor discovery detection activity is completed.
需要说明的是,第一对接设备和第二对接设备是可以互换的,第一对接设备和第二对接设备可以同时开启邻居发现功能。由于HDLC是点对点的对接场景,当第一对接设备和第二对接设备都开启了邻居发现功能时,两端就可以实现互相发现邻居,从而实现了双向邻居发现;如果第一设备或第二设备没开启邻居发现功能,则记录为异常远端,并记录时间,丢弃报文,完成邻居发现检测活动。It should be noted that the first docking device and the second docking device are interchangeable, and the first docking device and the second docking device can simultaneously enable the neighbor discovery function. Since the HDLC is a peer-to-peer connection scenario, when both the first docking device and the second docking device have the neighbor discovery function enabled, the two ends can mutually discover neighbors, thereby implementing two-way neighbor discovery; if the first device or the second device If the neighbor discovery function is disabled, the device records the fault as the remote end, records the time, discards the packet, and completes the neighbor discovery detection.
此外,在本实施例中,第一对接设备可以配置是否开启邻居发现功能, 第二对接设备也可以配置是否开启邻居发现功能,如果第二对接设备或第二对接设备未开启邻居发现功能,则按照标准协议报文处理。In addition, in this embodiment, the first docking device can be configured to enable the neighbor discovery function. The second connection device can also be configured to enable the neighbor discovery function. If the second connection device or the second connection device does not enable the neighbor discovery function, the packet is processed according to standard protocol packets.
如图7所示,第一对接设备发送HDLC协议报文时,如果第一对接设备开启邻居发现功能,则会构造带扩展字段的HDLC协议报文发送给远端即第二对接设备。其中HDLC协议报文中可以携带人工配置的本端信息和远端信息,或者携带默认的本端信息以及学习到的远端信息,默认的本端信息可以是能够唯一标识第一对接设备唯一性的参数,例如接口名interface+主机名hostname,如果没有学习到远端信息时,则远端信息可携带为0。As shown in FIG. 7 , when the first docking device sends the HDLC protocol packet, if the first docking device enables the neighbor discovery function, the HDLC protocol packet with the extended field is sent to the remote device, that is, the second docking device. The HDLC protocol packet can carry the manually configured local and remote information, or carry the default local information and the learned remote information. The default local information can uniquely identify the uniqueness of the first docking device. The parameter, such as the interface name interface + host name hostname, can be carried as 0 if no remote information is learned.
包括以下步骤:Includes the following steps:
步骤701,发送建链HDLC协议报文;Step 701: Send a link-building HDLC protocol packet.
步骤702,填充基本报文字段;Step 702, populating a basic message field;
步骤703,发包是否扩展使能,如果是执行步骤704,如果否,执行步骤711;Step 703, whether the extension is extended, if it is to perform step 704, if not, step 711;
其中,发包是指的发送建链HDLC协议报文,扩展使能是指开启邻居发现功能;The sending of the packet refers to the sending of the built-in HDLC protocol packet, and the extended enabling means that the neighbor discovery function is enabled.
步骤704,判断发包接口是否配置本端信息,如果是,执行步骤706,如果否,执行步骤705;Step 704, it is determined whether the local interface information is configured on the sending interface, if yes, step 706 is performed, if no, step 705 is performed;
步骤705,取homtname(主机名)+interface name(接口名)拼接(例如可加空格拼接),截断或者填充0-64B,封装为本端信息(local info),执行步骤707;Step 705, taking homtname (host name) + interface name (interface name) splicing (for example, can be spliced with spaces), truncating or filling 0-64B, encapsulating the local information (local info), step 707;
步骤706,取配置的本端信息,截断或者填充0到64B,封装为本端信息,执行步骤707;Step 706, taking the local information of the configuration, truncating or filling 0 to 64B, encapsulating the information of the local end, and performing step 707;
步骤707,查HDLC对端信息表,如果查到并匹配本端保存的对端设备的信息,则执行步骤708,如果没有查到或者查到没有匹配,则执行步骤710;Step 707, the HDLC peer information table is checked, if the information of the peer device saved by the local end is found and matched, step 708 is performed, if no match is found or no match is found, step 710 is performed;
步骤708,当前时间-接收时间戳是否小于保护周期,如果是,执行步骤709,如果否,执行步骤710;Step 708, the current time-received timestamp is less than the protection period, if yes, step 709 is performed, if not, step 710 is performed;
步骤709,取peerinfo,截断或者填充0到64B,封装为peer info,执行步骤711; Step 709, taking peerinfo, truncating or filling 0 to 64B, encapsulating as peer info, performing step 711;
其中,peerinfo为本地保存的对端信息,peer info为封装到报文中对端信息字段;The peer info is the locally saved peer information, and the peer info is encapsulated into the peer information field in the packet.
步骤710,填充0到64B,封装为peer info,执行步骤711;Step 710, padding 0 to 64B, encapsulating as peer info, performing step 711;
步骤711,填充FCS(校验码)字段;Step 711, filling an FCS (check code) field;
该FCS字段用于检查报文错误;The FCS field is used to check for packet errors.
步骤712,发送HDLC协议保护报文。Step 712: Send an HDLC protocol protection packet.
如图8所示,第二对接设备在接收HDLC协议报文时,如果开启邻居发现功能,通过本地保存的本端信息和远端信息与收到的HDLC协议报文中的信息进行比较可判断是否是先前的对接邻居。As shown in FIG. 8, when the second docking device receives the HDLC protocol packet, if the neighbor discovery function is enabled, the local information and the remote information stored in the local device can be compared with the information in the received HDLC protocol packet. Whether it is a previous docking neighbor.
包括以下步骤:Includes the following steps:
步骤801,接收HDLC协议报文;Step 801: Receive an HDLC protocol packet.
步骤802,接口是否扩展使能,即是否开启邻居发现功能,如果是,执行步骤803,如果否,执行步骤817;Step 802, whether the interface is extended, that is, whether to enable the neighbor discovery function, if yes, go to step 803, if no, go to step 817;
步骤803,查HDLC信息表,查询是否已保存对端信息,如果是,执行805,如果否,执行步骤804;Step 803, check the HDLC information table, query whether the peer information has been saved, if yes, execute 805, if not, go to step 804;
步骤804,添加HDLC对端表项,失败返回;Step 804, adding an HDLC peer entry, failing to return;
步骤805,接口是否配置了对端信息,如果是,执行步骤809,如果否,执行步骤806;Step 805, whether the interface is configured with the peer information, if yes, go to step 809, if no, go to step 806;
步骤806,表项中peerinfo是否为空,如果是,执行步骤807,如果否,执行步骤808;Step 806, whether the peerinfo in the entry is empty, if yes, go to step 807, if no, go to step 808;
步骤807,将报文中的本端信息(local info)填到表项中的peerinfo,执行步骤812;Step 807, the local information in the message (local info) is filled in the peerinfo in the entry, step 812 is performed;
步骤808,表项中的peerinfo是否等于报文中的本端信息,如果是,执行步骤812,如果否,执行步骤811;Step 808, whether the peerinfo in the entry is equal to the local information in the packet, if yes, go to step 812, if no, go to step 811;
步骤809,接口配置的对端信息是否等于报文中的本端信息,如果是,执行步骤810,如果否,执行步骤811;In step 809, the peer information configured on the interface is equal to the local information in the packet. If yes, go to step 810. If no, go to step 811.
步骤810,将报文中的本地信息填到表项中的peerinfo,执行步骤812; Step 810, the local information in the message is filled in the peerinfo in the entry, step 812 is performed;
步骤811,将报文中的本地信息填写到表项中的Illegal peerinfo,返回;Step 811: Fill in the local information in the packet to the Illegal peerinfo in the entry, and return.
其中,Illegal peerinfo为本地表项保存的非法对端信息,第一次协商成功的是合法的,第二次对端信息如果不一样可认为是非法的对端;The Illegal peerinfo is the illegal peer information saved by the local entry. The first successful negotiation is legal. If the second peer information is different, it can be considered as an illegal peer.
步骤812,判断接口是否配置了本端信息,如果是,执行步骤815,如果否,执行步骤813;Step 812, it is determined whether the interface is configured with the local information, if yes, step 815 is performed, if no, step 813 is performed;
步骤813,取主机名和接口名加空格拼接,截断或填充0到64B,作为本端信息;In step 813, the host name and the interface name are spliced with spaces, and 0 to 64B are truncated or filled as the local information.
步骤814,判断接口配置本端信息是否等于报文中的peerinfo,如果是,执行步骤816,如果否,返回;Step 814: Determine whether the local end information of the interface is equal to the peerinfo in the packet. If yes, go to step 816. If no, return.
步骤815,判断接口配置本端信息是否等于报文中的peerinfo,如果是,执行步骤816,如果否,返回;Step 815: Determine whether the local end information of the interface is equal to the peerinfo in the packet. If yes, go to step 816. If no, return.
步骤816,时间戳处理;Step 816, time stamp processing;
其中,时间戳处理包括保存收到报文的时间,便于计算处理超时;The timestamp processing includes saving the time of receiving the packet, which is convenient for calculating and processing timeout.
步骤817,按照标准协议报文处理,返回。In step 817, the packet is processed according to the standard protocol, and is returned.
需要强调的是,本领域的技术人员应该明白,本发明实施例中涵盖的策略和步骤可以用通用的计算装置来实现,它们可以集中在单个的计算装置上,或者分布在多个计算装置所组成的网络上,可选地,它们可以用计算装置可执行的程序代码来实现,从而可以将它们存储在存储装置中由计算装置来执行,或者将它们分别制作成集成电路模块,或者将它们中的多个模块或步骤制作成单个集成电路模块来实现。It should be emphasized that those skilled in the art should understand that the strategies and steps covered in the embodiments of the present invention may be implemented by a general computing device, which may be centralized on a single computing device or distributed among multiple computing devices. Alternatively, they may be implemented by program code executable by the computing device so that they may be stored in the storage device by the computing device, or they may be separately fabricated into integrated circuit modules, or they may be Multiple modules or steps in the fabrication are implemented as a single integrated circuit module.
本领域普通技术人员可以理解上述方法中的全部或部分步骤可通过程序来指令相关硬件完成,所述程序可以存储于计算机可读存储介质中,如只读存储器、磁盘或光盘等。可选地,上述实施例的全部或部分步骤也可以使用一个或多个集成电路来实现,相应地,上述实施例中的各模块/模块可以采用硬件的形式实现,也可以采用软件功能模块的形式实现。本申请实施例不限制于任何特定形式的硬件和软件的结合。 One of ordinary skill in the art will appreciate that all or a portion of the steps described above can be accomplished by a program that instructs the associated hardware, such as a read-only memory, a magnetic or optical disk, and the like. Optionally, all or part of the steps of the foregoing embodiments may also be implemented by using one or more integrated circuits. Accordingly, each module/module in the foregoing embodiment may be implemented in the form of hardware, or may be implemented by using a software function module. Formal realization. The embodiments of the present application are not limited to any particular form of combination of hardware and software.
工业实用性Industrial applicability
上述方案通过对标准HDLC协议报文封装格式进行扩展,解决了无法发现邻居的问题,有效避免了因成员链路单通或者交叉连接错误导致的整个聚合接口业务中断的问题。 The above solution solves the problem that the neighboring interface cannot be found by the standard HDLC protocol packet encapsulation format, and effectively avoids the interruption of the entire aggregation interface service caused by the member link single-pass or cross-connection error.

Claims (14)

  1. 一种邻居发现的方法,所述方法包括:A method for neighbor discovery, the method comprising:
    第一对接设备封装高级数据链路控制HDLC协议报文;所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息,所述第一对接设备本端信息和第一对接设备远端信息用于所述第二对接设备进行邻居判断;The first docking device encapsulates the advanced data link to control the HDLC protocol packet; the HDLC protocol packet carries the first interface device local information and the first docking device remote information, and the first docking device local information and the first The remote information of the docking device is used by the second docking device to perform neighbor determination;
    所述第一对接设备将所述HDLC协议报文发送给第二对接设备。The first docking device sends the HDLC protocol packet to the second docking device.
  2. 如权利要求1所述的方法,其中,所述第一对接设备封装高级数据链路控制HDLC协议报文包括:The method of claim 1, wherein the first docking device encapsulates the advanced data link control HDLC protocol message comprises:
    手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息,或者自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息。Manually configuring the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet, or self-learning to configure the local end of the first docking device in the HDLC protocol packet Information and the first docking device remote information.
  3. 如权利要求2所述的方法,其中,The method of claim 2, wherein
    当手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为配置的本端信息,所述第一对接设备的远端信息为配置的远端信息;When the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local information, The remote information of the first docking device is configured remote information;
    当自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为默认的本端信息,所述第一对接设备的远端信息为自学习的远端信息或0。When the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are self-learned, the local information of the first docking device is the default local information. The remote information of the first docking device is self-learning remote information or 0.
  4. 一种邻居发现的方法,所述方法包括:A method for neighbor discovery, the method comprising:
    第二对接设备接收第一对接设备发送的高级数据链路控制HDLC协议报文,所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息;The second docking device receives the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface device local information and the first docking device remote information;
    所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居。The second docking device determines, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
  5. 如权利要求4所述的方法,其中,所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:The method of claim 4, wherein the determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol message comprises:
    当所述第二对接设备未保存第二对接设备远端信息时,保存所述第一对 接设备本端信息;所述第二对接设备判断所述HDLC协议报文携带的第一对接设备远端信息与所述第二对接设备保存的第二对接设备本端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。Saving the first pair when the second docking device does not save the second docking device remote information The device is connected to the local device, and the second interface device determines whether the remote information of the first docking device carried in the HDLC protocol packet is consistent with the local information of the second docking device saved by the second docking device. The first docking device is a neighbor of the second docking device.
  6. 如权利要求4所述的方法,其中,所述第二对接设备根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:The method of claim 4, wherein the determining, by the second docking device, whether the first docking device is a neighbor of the second docking device according to the HDLC protocol message comprises:
    当所述第二对接设备保存有第二对接设备远端信息时,所述第二对接设备判断所述HDLC协议报文携带的第一对接设备本端信息与所述第二对接设备保存的第二对接设备远端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device stores the remote information of the second docking device, the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
  7. 一种邻居发现的装置,设置于第一对接设备,所述装置包括:A neighbor discovery device is disposed on a first docking device, and the device includes:
    封装模块,设置为封装高级数据链路控制HDLC协议报文;所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息,所述第一对接设备本端信息和第一对接设备远端信息用于所述第二对接设备进行邻居判断;以及The encapsulating module is configured to encapsulate the advanced data link to control the HDLC protocol packet; the HDLC protocol packet carries the local information of the first docking device and the remote information of the first docking device, and the local information of the first docking device and the first The remote information of the pair of devices is used by the second docking device to perform neighbor determination;
    发送模块,设置为将所述HDLC协议报文发送给第二对接设备。The sending module is configured to send the HDLC protocol packet to the second docking device.
  8. 如权利要求7所述的装置,所述封装模块封装高级数据链路控制HDLC协议报文是指:The apparatus according to claim 7, wherein the encapsulating module encapsulates the advanced data link control HDLC protocol message to:
    手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息,或者自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息。Manually configuring the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet, or self-learning to configure the local end of the first docking device in the HDLC protocol packet Information and the first docking device remote information.
  9. 如权利要求8所述的装置,其中,The device of claim 8 wherein
    当手动配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为配置的本端信息,所述第一对接设备的远端信息为配置的远端信息;When the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are manually configured, the local information of the first docking device is the configured local information, The remote information of the first docking device is configured remote information;
    当自学习配置所述HDLC协议报文中的所述第一对接设备本端信息和所述第一对接设备远端信息时,所述第一对接设备本端信息为默认的本端信息,所述第一对接设备的远端信息为自学习的远端信息或0。When the local information of the first docking device and the remote information of the first docking device in the HDLC protocol packet are self-learned, the local information of the first docking device is the default local information. The remote information of the first docking device is self-learning remote information or 0.
  10. 一种邻居发现的装置,设置于第二对接设备,所述装置包括: A neighbor discovery device is disposed on a second docking device, and the device includes:
    接收模块,设置为接收第一对接设备发送的高级数据链路控制HDLC协议报文,所述HDLC协议报文携带第一对接设备本端信息和第一对接设备远端信息;以及The receiving module is configured to receive the advanced data link control HDLC protocol packet sent by the first docking device, where the HDLC protocol packet carries the first interface device local information and the first docking device remote information;
    判断模块,设置为根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居。The determining module is configured to determine, according to the HDLC protocol packet, whether the first docking device is a neighbor of the second docking device.
  11. 如权利要求10所述的装置,所述判断模块根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:The device of claim 10, wherein the determining, by the determining module, whether the first docking device is a neighbor of the second docking device, according to the HDLC protocol packet, includes:
    当所述第二对接设备未保存第二对接设备远端信息时,保存所述第一对接设备本端信息;所述第二对接设备判断所述HDLC协议报文携带的第一对接设备远端信息与所述第二对接设备保存的第二对接设备本端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device does not save the remote information of the second docking device, save the local information of the first docking device; and the second docking device determines the remote end of the first docking device carried by the HDLC protocol packet. Whether the information is consistent with the local information of the second docking device saved by the second docking device. If the information is consistent, the first docking device is a neighbor of the second docking device.
  12. 如权利要求10所述的装置,所述判断模块根据所述HDLC协议报文判断所述第一对接设备是否为所述第二对接设备的邻居包括:The device of claim 10, wherein the determining, by the determining module, whether the first docking device is a neighbor of the second docking device, according to the HDLC protocol packet, includes:
    当所述第二对接设备保存有第二对接设备远端信息时,所述第二对接设备判断所述HDLC协议报文携带的第一对接设备本端信息与所述第二对接设备保存的第二对接设备远端信息是否一致,如果一致,则所述第一对接设备为所述第二对接设备的邻居。When the second docking device stores the remote information of the second docking device, the second docking device determines the first information of the first docking device carried by the HDLC protocol packet and the second server Whether the remote information of the two docking devices is consistent. If the information is consistent, the first docking device is a neighbor of the second docking device.
  13. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求1-3任一项所述的方法。A computer readable storage medium storing program instructions that, when executed, can implement the method of any of claims 1-3.
  14. 一种计算机可读存储介质,存储有程序指令,当该程序指令被执行时可实现权利要求4-6任一项所述的方法。 A computer readable storage medium storing program instructions that, when executed, implement the method of any of claims 4-6.
PCT/CN2015/086126 2015-02-15 2015-08-05 Neighbor discovering method and apparatus WO2016127599A1 (en)

Applications Claiming Priority (2)

Application Number Priority Date Filing Date Title
CN201510083959.0A CN105991448B (en) 2015-02-15 2015-02-15 Neighbor discovery method and device
CN201510083959.0 2015-02-15

Publications (1)

Publication Number Publication Date
WO2016127599A1 true WO2016127599A1 (en) 2016-08-18

Family

ID=56614045

Family Applications (1)

Application Number Title Priority Date Filing Date
PCT/CN2015/086126 WO2016127599A1 (en) 2015-02-15 2015-08-05 Neighbor discovering method and apparatus

Country Status (2)

Country Link
CN (1) CN105991448B (en)
WO (1) WO2016127599A1 (en)

Families Citing this family (1)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN112565080B (en) * 2020-12-02 2022-01-25 北京邮电大学 Neighbor establishing method and device with open shortest path first

Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1280450A (en) * 1999-07-09 2001-01-17 现代电子产业株式会社 Transmit-receiver base station of digit mobile communication system
CN101379765A (en) * 2005-11-18 2009-03-04 思科技术公司 Techniques for configuring customer equipment for network operations from provider edge
CN103227733A (en) * 2013-04-27 2013-07-31 神州数码网络(北京)有限公司 Topology discovery method and topology discovery system

Family Cites Families (4)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN100411390C (en) * 2006-02-13 2008-08-13 华为技术有限公司 Method for realizing neighbour discovery
CN101938477A (en) * 2010-08-31 2011-01-05 中山大学 Method for implementing XML data information exchange
CN102223278B (en) * 2011-05-17 2015-06-24 中兴通讯股份有限公司 Realization method and system for enabling LLDP function on non-Ethernet link
US10225196B2 (en) * 2013-02-15 2019-03-05 Nxp Usa, Inc. Apparatus, system and method for controlling packet data flow

Patent Citations (3)

* Cited by examiner, † Cited by third party
Publication number Priority date Publication date Assignee Title
CN1280450A (en) * 1999-07-09 2001-01-17 现代电子产业株式会社 Transmit-receiver base station of digit mobile communication system
CN101379765A (en) * 2005-11-18 2009-03-04 思科技术公司 Techniques for configuring customer equipment for network operations from provider edge
CN103227733A (en) * 2013-04-27 2013-07-31 神州数码网络(北京)有限公司 Topology discovery method and topology discovery system

Also Published As

Publication number Publication date
CN105991448A (en) 2016-10-05
CN105991448B (en) 2020-06-26

Similar Documents

Publication Publication Date Title
DK2989759T3 (en) PROCEDURE AND SYSTEM TO SUPPORT DRCP (DISTRIBUTED RELAY CONTROL PROTOCOL) OPERATIONS BY COMMUNICATION FAILURE
EP3154227A1 (en) Packet transmission method, node, path management server and storage medium
US8638692B2 (en) System and method for end-to-end automatic configuration of network elements using a link-level protocol
KR102364803B1 (en) Communication method, communication device and storage medium
US11497077B2 (en) Method and apparatus for port management of ethernet bridges
EP3211832B1 (en) Fault detection method and device
JP2017526297A (en) Method and system for supporting distributed repeater control protocol (DRCP) operation during misconfiguration
US9025439B2 (en) Method and system to enable re-routing for home networks upon connectivity failure
CN104270309A (en) Method for achieving multi-hop BFD under IP RAN equipment
US8411701B2 (en) Inter-working of EFM-OAM and CFM-OAM for mobile backhaul networks
KR102257945B1 (en) Service data transmission method and device
WO2013128483A1 (en) Relay device, relay device control method, and network system
WO2012058930A1 (en) Method and system for link failure detection
US20060002299A1 (en) Method and apparatus for detecting support for a protocol defining supplemental headers
WO2015070383A1 (en) Link aggregation method, apparatus, and system
WO2012088962A1 (en) Method and system for automatically discovering oduflex bandwidth lossless adjustment capability
WO2020135238A1 (en) Method, apparatus and system for planning path
WO2016124117A1 (en) Method, switching device and network controller for protecting links in software-defined network (sdn)
CN110138635B (en) Protocol conversion function verification device and method supporting FC and Ethernet
WO2022121638A1 (en) Packet processing method and device
US9467397B2 (en) Port mode synchronization between switches
JP5352502B2 (en) Packet communication system and packet communication apparatus control method
WO2016127599A1 (en) Neighbor discovering method and apparatus
JP2012039461A (en) Communication device, communication method, and communication program
WO2013042564A1 (en) Diagnostic system

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: 15881758

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: 15881758

Country of ref document: EP

Kind code of ref document: A1