CN103117930A - Method and device for detecting static route configuration - Google Patents
Method and device for detecting static route configuration Download PDFInfo
- Publication number
- CN103117930A CN103117930A CN2013100492533A CN201310049253A CN103117930A CN 103117930 A CN103117930 A CN 103117930A CN 2013100492533 A CN2013100492533 A CN 2013100492533A CN 201310049253 A CN201310049253 A CN 201310049253A CN 103117930 A CN103117930 A CN 103117930A
- Authority
- CN
- China
- Prior art keywords
- neighbor
- message
- ipv6 address
- address
- static route
- Prior art date
- Legal status (The legal status 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 status listed.)
- Granted
Links
Images
Landscapes
- Data Exchanges In Wide-Area Networks (AREA)
Abstract
本发明实施例提供一种静态路由配置的检测方法和装置。所述方法包括:路由器接收静态路由的配置信息,所述配置信息包括目的IPv6地址和下一跳IPv6地址。所述路由器查找匹配所述下一跳IPv6地址的邻居缓存表项。如果找不到匹配下一跳IPv6地址的邻居缓存表项,则发送第一邻居请求消息。所述第一邻居请求消息的目标地址是下一跳IPv6地址,目的地址是对应下一跳IPv6地址的请求节点组播地址。所述路由器确定在第一预设的时间内是否收到响应所述第一邻居请求消息的第一邻居通告消息。如果在所述第一预设的时间内没有接收到响应所述第一邻居请求消息的所述第一邻居通告消息,则设置所述静态路由不活跃。本发明实施例可提高静态路由配置的可靠性。
Embodiments of the present invention provide a static routing configuration detection method and device. The method includes: the router receives configuration information of the static route, and the configuration information includes a destination IPv6 address and a next-hop IPv6 address. The router searches for a neighbor cache entry matching the next-hop IPv6 address. If no neighbor cache entry matching the next-hop IPv6 address is found, a first neighbor solicitation message is sent. The target address of the first neighbor solicitation message is a next-hop IPv6 address, and the destination address is a request node multicast address corresponding to the next-hop IPv6 address. The router determines whether a first Neighbor Advertisement message in response to the first Neighbor Solicitation message is received within a first preset time. If the first neighbor advertisement message in response to the first neighbor solicitation message is not received within the first preset time, the static route is set to be inactive. The embodiments of the present invention can improve the reliability of static route configuration.
Description
技术领域technical field
本发明实施例涉及网络路由技术,尤其涉及一种静态路由配置的检测方法和装置。The embodiment of the present invention relates to network routing technology, and in particular to a detection method and device for static routing configuration.
背景技术Background technique
目前,互联网通信已经开始使用互联网协议版本6(Internet ProtocolVersion6,以下缩写为IPv6)。IPv6是互联网工程任务组(Internet EngineeringTask Force,IETF)设计的用于替代现行版本IPv4的下一代IP协议。At present, Internet communication has begun to use Internet Protocol Version 6 (Internet Protocol Version 6, hereinafter abbreviated as IPv6). IPv6 is the next-generation IP protocol designed by the Internet Engineering Task Force (IETF) to replace the current version of IPv4.
基于IPv6的网络由主机和路由器构成,网络三层流量通过路由信息进行报文转发。路由是数据通信网络中最基本的要素。路由信息就是指导报文转发的路径信息,路由的过程就是报文中继转发的过程。路由器保存路由表和转发信息库(Forwarding Information Base,以下缩写为FIB)。路由器通过FIB指导报文转发。路由表中保存了各种路由协议发现的路由,根据来源不同,路由表中的路由通常可分为以下三类:链路层协议发现的路由,也称为接口路由或直连路由;由管理员手工配置的静态路由;以及动态路由协议发现的路由。An IPv6-based network consists of hosts and routers, and Layer 3 traffic on the network is forwarded through routing information. Routing is the most fundamental element in a data communication network. Routing information is the path information that guides packet forwarding, and the routing process is the process of packet relay and forwarding. The router saves the routing table and forwarding information base (Forwarding Information Base, hereinafter abbreviated as FIB). The router guides packet forwarding through the FIB. The routes discovered by various routing protocols are stored in the routing table. According to different sources, the routes in the routing table can generally be divided into the following three categories: routes discovered by link layer protocols, also known as interface routes or direct routes; Static routes manually configured by administrators; and routes discovered by dynamic routing protocols.
静态路由是一种需要管理员手工配置的特殊路由,多用于网络结构比较简单的场景。举例来说,一条静态路由包含以下要素:1)目的地址与掩码;2)出接口或下一跳IPv6地址。出接口为本设备指向下一跳IPv6地址的端口,静态路由器也可以配置下一跳IPv6地址迭代出接口的配置,两者的实际功能一致。例如,“ipv6route-static33::3641::2”,其中,33::3为目的地址,64为掩码,1::2为下一跳路由器的地址。与动态路由协议不同,静态路由自身没有检测机制。当网络发生故障的时候,需要管理员介入。另外,如果管理员配置失误,通信也可能出现问题,如静态路由配置错误或者链路问题。现有技术中,人工为静态路由绑定双向转发检测(Bidirectional ForwardingDetection,简称BFD)会话,用于检测静态路由所在链路的状态,这种方式需要人工配置,工作量大,耗时长,而且容易出错。Static routing is a special routing that needs to be manually configured by the administrator. It is mostly used in scenarios with a relatively simple network structure. For example, a static route includes the following elements: 1) destination address and mask; 2) outgoing interface or next-hop IPv6 address. The outbound interface is the port pointing to the next-hop IPv6 address of the device. The static router can also be configured to iterate the outbound interface with the next-hop IPv6 address. The actual functions of the two are the same. For example, "ipv6route-static33::3641::2", where 33::3 is the destination address, 64 is the mask, and 1::2 is the address of the next-hop router. Unlike dynamic routing protocols, static routing has no detection mechanism of its own. When a network failure occurs, administrator intervention is required. In addition, if the administrator misconfigures, there may be communication problems, such as misconfigured static routes or link problems. In the prior art, a static route is manually bound to a Bidirectional Forwarding Detection (BFD) session to detect the status of the link where the static route is located. error.
发明内容Contents of the invention
本发明实施例提供一种静态路由配置的检测方法和装置,以提高静态路由配置的可靠性,减少人工配置的工作量。Embodiments of the present invention provide a static routing configuration detection method and device, so as to improve the reliability of the static routing configuration and reduce the workload of manual configuration.
第一方面,提供一种静态路由配置的检测方法。所述方法包括:路由器接收静态路由的配置信息,所述配置信息包括目的IPv6地址和下一跳IPv6地址。所述路由器查找匹配所述下一跳IPv6地址的邻居缓存表项。如果找不到匹配所述下一跳IPv6地址的邻居缓存表项,则发送第一邻居请求消息。所述第一邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是对应所述下一跳IPv6地址的请求节点组播地址。所述路由器确定在第一预设的时间内是否收到响应所述第一邻居请求消息的第一邻居通告消息。如果在所述第一预设的时间内没有接收到响应所述第一邻居请求消息的所述第一邻居通告消息,则设置所述静态路由不活跃。In the first aspect, a method for detecting static routing configuration is provided. The method includes: the router receives configuration information of the static route, and the configuration information includes a destination IPv6 address and a next-hop IPv6 address. The router searches for a neighbor cache entry matching the next-hop IPv6 address. If no neighbor cache entry matching the next-hop IPv6 address is found, a first neighbor solicitation message is sent. The target address of the first neighbor solicitation message is the next-hop IPv6 address, and the destination address is a request node multicast address corresponding to the next-hop IPv6 address. The router determines whether a first Neighbor Advertisement message in response to the first Neighbor Solicitation message is received within a first preset time. If the first neighbor advertisement message in response to the first neighbor solicitation message is not received within the first preset time, the static route is set to be inactive.
根据第一方面,提供第一种可能的实现方式。所述方法还包括:如果在所述第一预设的时间内接收到响应所述第一邻居请求消息的所述第一邻居通告消息,且所述第一邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。According to the first aspect, a first possible implementation manner is provided. The method further includes: if the first Neighbor Advertisement message in response to the first Neighbor Solicitation message is received within the first preset time, and the target address carried in the first Neighbor Advertisement message is the If the next-hop IPv6 address is specified, the static route is set active.
根据第一方面或第一方面的第一种可能的实现方式,提供第二种可能的实现方式。所述方法还包括:如果所述路由器找到匹配所述下一跳IPv6地址的邻居缓存表项,且所述邻居缓存表项的状态为可达,则设置所述静态路由活跃。According to the first aspect or the first possible implementation manner of the first aspect, a second possible implementation manner is provided. The method further includes: if the router finds a neighbor cache entry matching the next-hop IPv6 address, and the state of the neighbor cache entry is reachable, setting the static route active.
根据第一方面或第一方面的第一种或第二种可能的实现方式,提供第三种可能的实现方式。所述方法还包括:如果所述路由器找到匹配所述下一跳IPv6地址的邻居缓存表项,且所述邻居缓存表项状态不是可达,则通过出接口发送第二邻居请求消息,所述第二邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。如果在第二预设的时间内没有接收到响应所述第二邻居请求消息的第二邻居通告消息,则设置所述静态路由不活跃。According to the first aspect or the first or second possible implementation manner of the first aspect, a third possible implementation manner is provided. The method further includes: if the router finds a neighbor cache entry matching the next-hop IPv6 address, and the state of the neighbor cache entry is not reachable, sending a second neighbor solicitation message through an outbound interface, the The target address of the second neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. If no second neighbor advertisement message in response to the second neighbor solicitation message is received within a second preset time, the static route is set to be inactive.
根据第一方面的第三种实现方式,提供第四种可能的实现方式。所述方法还包括:如果在第二预设的时间内接收到响应所述第二邻居请求消息的第二邻居通告消息,所述第二邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。According to the third implementation manner of the first aspect, a fourth possible implementation manner is provided. The method further includes: if a second Neighbor Advertisement message in response to the second Neighbor Solicitation message is received within a second preset time, the target address carried in the second Neighbor Advertisement message is the next-hop IPv6 address, set the static route active.
根据第一方面或者第一方面的上述任何一种实现方式,提供第五种可能的实现方式。所述方法还包括:当路由器收到请求删除所述静态路由对应的邻居缓存表项的消息时,所述路由器通过所述出接口发送第三邻居请求消息,所述第三邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。如果在第三预设的时间内接收到响应所述第三邻居请求消息的第三邻居通告消息,所述第三邻居通告消息携带的目标地址为所述下一跳IPv6地址,则省略执行删除所述邻居缓存表项的操作,保持所述静态路由活跃。如果在所述第三预设的时间内没有接收到响应所述第三邻居请求消息的第三邻居通告消息,则删除所述邻居缓存表项,所述静态路由设置不活跃。According to the first aspect or any one of the foregoing implementation manners of the first aspect, a fifth possible implementation manner is provided. The method further includes: when the router receives a message requesting to delete the neighbor cache entry corresponding to the static route, the router sends a third neighbor solicitation message through the outbound interface, and the target of the third neighbor solicitation message is The address is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. If a third Neighbor Advertisement message in response to the third Neighbor Solicitation message is received within a third preset time, and the target address carried in the third Neighbor Advertisement message is the next-hop IPv6 address, then omitting to perform deletion The operation of the neighbor cache entry keeps the static route active. If no third neighbor advertisement message in response to the third neighbor solicitation message is received within the third preset time, the neighbor cache entry is deleted, and the static routing setting is inactive.
根据第一方面或者第一方面的上述任何一种实现方式,提供第六种可能的实现方式。所述方法还包括:周期性地发送第四邻居请求消息,所述第四邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。如果在第四预设的时间内接收到响应所述第四邻居请求消息的第四邻居通告消息,则设置所述静态路由活跃。如果在第四预设的时间内未接收到响应所述第四邻居请求消息的邻居通告消息,则设置所述静态路由不活跃。According to the first aspect or any one of the foregoing implementation manners of the first aspect, a sixth possible implementation manner is provided. The method further includes: periodically sending a fourth neighbor solicitation message, the target address of the fourth neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. If a fourth Neighbor Advertisement message in response to the fourth Neighbor Solicitation message is received within a fourth preset time, the static route is set to be active. If a neighbor advertisement message in response to the fourth neighbor solicitation message is not received within a fourth preset time, the static route is set to be inactive.
根据第一方面或者第一方面的上述任何一种实现方式,提供第七种可能的实现方式。所述配置信息还包括出接口和匹配长度。According to the first aspect or any one of the foregoing implementation manners of the first aspect, a seventh possible implementation manner is provided. The configuration information also includes the outgoing interface and matching length.
根据第一方面或者第一方面的第一种到第六种实现方式的任何一种实现方式,提供第八种可能的实现方式。当所述配置信息不包括出接口时,所述路由器根据所述下一跳IPv6地址迭代出所述静态路由的出接口。According to the first aspect or any one of the first to sixth implementation manners of the first aspect, an eighth possible implementation manner is provided. When the configuration information does not include an outbound interface, the router iterates out the outbound interface of the static route according to the next-hop IPv6 address.
第二方面提供一种静态路由配置的检测装置,包括:接收模块,用于路由器接收到静态路由的配置信息,所述配置信息至少包括目的IPv6地址和下一跳IPv6地址;查找模块,用于所述路由器查找匹配所述下一跳IPv6地址的邻居缓存表项;发送模块,用于如果找不到匹配所述下一跳IPv6地址的邻居缓存表项,则发送第一邻居请求消息,所述第一邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是对应所述下一跳IPv6地址的请求节点组播地址;确定模块,用于确定在第一预设的时间内是否收到响应所述第一邻居请求消息的第一邻居通告消息;设置状态模块,用于如果在第一预设的时间内没有接收到响应所述第一邻居请求消息的第一邻居通告消息,则设置所述静态路由不活跃。The second aspect provides a detection device for static routing configuration, including: a receiving module, configured for a router to receive static routing configuration information, the configuration information including at least a destination IPv6 address and a next-hop IPv6 address; a search module, configured for The router searches for a neighbor cache entry matching the next-hop IPv6 address; a sending module, configured to send a first neighbor solicitation message if no neighbor cache entry matching the next-hop IPv6 address is found. The target address of the first neighbor solicitation message is the next-hop IPv6 address, and the destination address is the request node multicast address corresponding to the next-hop IPv6 address; the determining module is configured to determine that within the first preset time Whether a first neighbor advertisement message in response to the first neighbor request message is received; a state module is set, for if the first neighbor advertisement message in response to the first neighbor request message is not received within the first preset time , then set the static route inactive.
根据第二方面,提供第一种可能的实现方式。所述设置状态模块,还用于:如果在第一预设的时间内接收到响应所述第一邻居请求消息的第一邻居通告消息,且所述第一邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。According to the second aspect, a first possible implementation manner is provided. The setting state module is further configured to: if a first neighbor notification message in response to the first neighbor request message is received within a first preset time, and the target address carried in the first neighbor notification message is the If the next-hop IPv6 address is specified, the static route is set active.
根据第二方面或者第二方面的第一种实现方式,提供第二种可能的实现方式。所述设置状态模块,还用于:如果所述路由器找到匹配所述下一跳IPv6地址的邻居缓存表项,且所述邻居缓存表项的状态为可达,则设置所述静态路由活跃。According to the second aspect or the first implementation manner of the second aspect, a second possible implementation manner is provided. The setting state module is further configured to: if the router finds a neighbor cache entry matching the next-hop IPv6 address, and the state of the neighbor cache entry is reachable, then set the static route active.
根据第二方面或者第二方面的第一种或第二种实现方式,提供第三种可能的实现方式。所述发送模块还用于:如果所述路由器找到匹配所述下一跳IPv6地址的邻居缓存表项,且所述邻居缓存表项状态不是可达,则通过出接口发送第二邻居请求消息,所述第二邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。所述确定模块,还用于确定在第二预设的时间内是否接收到响应所述第二邻居请求消息的第二邻居通告消息。所述设置状态模块,还用于:如果在第二预设的时间内没有接收到响应所述第二邻居请求消息的第二邻居通告消息,则设置所述静态路由不活跃。According to the second aspect or the first or second implementation manner of the second aspect, a third possible implementation manner is provided. The sending module is further configured to: if the router finds a neighbor cache entry matching the next-hop IPv6 address, and the state of the neighbor cache entry is not reachable, send a second neighbor solicitation message through an outgoing interface, The target address of the second neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. The determining module is further configured to determine whether a second neighbor notification message in response to the second neighbor request message is received within a second preset time. The setting status module is further configured to: set the static route to be inactive if no second neighbor advertisement message in response to the second neighbor solicitation message is received within a second preset time.
结合第二方面的第三种可能的实现方式,提供第四种可能的实现方式。所述设置状态模块,还用于:如果在所述第二预设的时间内接收到响应所述第二邻居请求消息的所述第二邻居通告消息,所述第二邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。In combination with the third possible implementation manner of the second aspect, a fourth possible implementation manner is provided. The setting state module is further configured to: if the second neighbor notification message in response to the second neighbor request message is received within the second preset time, the target carried in the second neighbor notification message address is the next hop IPv6 address, then set the static route to be active.
根据第二方面或者第二方面的上述任何一种实现方式,提供第五种可能的实现方式。所述接收模块,还用于接收请求删除所述静态路由对应的邻居缓存表项的消息。所述发送模块还用于通过出接口发送第三邻居请求消息,所述第三邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。所述确定模块,还用于确定在第三预设的时间内是否接收到响应所述第三邻居请求消息的第三邻居通告消息。所述装置还包括:省略删除模块,用于如果在第三预设的时间内接收到响应所述第三邻居请求消息的第三邻居通告消息,所述第三邻居通告消息携带的目标地址为所述下一跳IPv6地址,则省略执行删除所述邻居缓存表项的操作,保持所述静态路由活跃。所述装置还包括:删除模块,用于如果在所述第三预设的时间内没有接收到响应所述第三邻居请求消息的第三邻居通告消息,则删除所述邻居缓存表项,设置所述静态路由不活跃。According to the second aspect or any of the foregoing implementation manners of the second aspect, a fifth possible implementation manner is provided. The receiving module is further configured to receive a message requesting to delete the neighbor cache entry corresponding to the static route. The sending module is further configured to send a third neighbor solicitation message through an outgoing interface, the target address of the third neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. The determining module is further configured to determine whether a third neighbor notification message in response to the third neighbor request message is received within a third preset time. The device further includes: an omitting deletion module, configured to receive a third neighbor notification message in response to the third neighbor request message within a third preset time, and the target address carried in the third neighbor notification message is For the next-hop IPv6 address, the operation of deleting the neighbor cache entry is omitted, and the static route is kept active. The device also includes: a deletion module, configured to delete the neighbor cache entry if a third neighbor notification message in response to the third neighbor request message is not received within the third preset time, and set The static route is not active.
根据第二方面或者第二方面的上述任何一种实现方式,提供第六种可能的实现方式。所述发送模块还用于:周期性地发送第四邻居请求消息,所述第四邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。所述确定模块,还用于确定在第四预设的时间内是否接收到响应所述第四邻居请求消息的第四邻居通告消息。所述设置状态模块,还用于:如果在第四预设的时间内接收到响应所述第四邻居请求消息的邻居通告消息,则设置所述静态路由活跃,如果在第四预设的时间内没有接收到响应所述第四邻居请求消息的邻居通告消息,则设置所述静态路由不活跃。According to the second aspect or any of the foregoing implementation manners of the second aspect, a sixth possible implementation manner is provided. The sending module is further configured to: periodically send a fourth neighbor solicitation message, the target address of the fourth neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. The determining module is further configured to determine whether a fourth Neighbor Advertisement message in response to the fourth Neighbor Solicitation message is received within a fourth preset time. The setting status module is further configured to: if a neighbor notification message in response to the fourth neighbor solicitation message is received within a fourth preset time, then set the static route to be active, if within the fourth preset time If no Neighbor Advertisement message is received in response to the fourth Neighbor Solicitation message, the static route is set to be inactive.
根据第二方面或者第二方面的上述任何一种实现方式,提供第七种可能的实现方式。所述配置信息还包括出接口和匹配长度。According to the second aspect or any of the foregoing implementation manners of the second aspect, a seventh possible implementation manner is provided. The configuration information also includes the outgoing interface and matching length.
根据第二方面或者第二方面的第一种到第六种中的任何一种实现方式,提供第八种可能的实现方式。所述装置还包括:迭代模块,用于当所述配置信息不包括所述出接口时,所述路由器根据所述下一跳IPv6地址迭代出所述静态路由的出接口。According to the second aspect or any one of the first to sixth implementation manners of the second aspect, an eighth possible implementation manner is provided. The device further includes: an iteration module, configured to, when the configuration information does not include the outbound interface, the router iterate out the outbound interface of the static route according to the next-hop IPv6 address.
本发明实施例提供的静态路由配置的检测方法和装置,路由器接收静态路由的配置信息,配置信息包括下一跳IPv6地址。路由器查找匹配所述下一跳IPv6地址的邻居缓存表项,如果找不到匹配所述下一跳IPv6地址的邻居缓存表项,则发送第一邻居请求消息,如果在第一预设的时间内没有收到响应所述第一邻居请求消息的第一邻居响应消息,则设置所述静态路由活跃。本发明实施例的方案,能够自动发现静态路由配置错误或者链路问题,可以提高静态路由配置的可靠性,减少人工配置的工作量。In the method and device for detecting static routing configuration provided by the embodiments of the present invention, a router receives static routing configuration information, and the configuration information includes a next-hop IPv6 address. The router searches for a neighbor cache entry matching the next-hop IPv6 address, if no neighbor cache entry matching the next-hop IPv6 address is found, then sends a first neighbor solicitation message, if within the first preset time If no first neighbor response message is received in response to the first neighbor solicitation message, the static route is set active. The solutions of the embodiments of the present invention can automatically discover static routing configuration errors or link problems, improve the reliability of static routing configuration, and reduce the workload of manual configuration.
附图说明Description of drawings
为了更清楚地说明本发明实施例或现有技术中的技术方案,下面将对实施例或现有技术描述中所需要使用的附图作一简单地介绍,显而易见地,下面描述中的附图是本发明的一些实施例,对于本领域普通技术人员来讲,在不付出创造性劳动性的前提下,还可以根据这些附图获得其他的附图。In order to more clearly illustrate the technical solutions in the embodiments of the present invention or the prior art, the following will briefly introduce the drawings that need to be used in the description of the embodiments or the prior art. Obviously, the accompanying drawings in the following description These are some embodiments of the present invention. For those skilled in the art, other drawings can also be obtained according to these drawings without any creative effort.
图1为本发明一个实施例中静态路由配置的检测方法的流程图;Fig. 1 is the flowchart of the detection method of static routing configuration in one embodiment of the present invention;
图2为本发明又一个实施例中静态路由配置的检测方法的流程图;Fig. 2 is the flowchart of the detection method of static routing configuration in another embodiment of the present invention;
图3为本发明实施例所适用的场景一的组网示意图;FIG. 3 is a schematic diagram of networking in
图4为本发明实施例所适用的场景二的组网示意图;FIG. 4 is a schematic diagram of networking in
图5为本发明实施例所适用的场景三的组网示意图;FIG. 5 is a schematic diagram of networking in scenario three applicable to the embodiment of the present invention;
图6为本发明一个实施例中静态路由配置的检测装置的结构示意图;FIG. 6 is a schematic structural diagram of a detection device for static routing configuration in an embodiment of the present invention;
图7为本发明又一个实施例中静态路由配置的检测装置的结构示意图;FIG. 7 is a schematic structural diagram of a detection device for static routing configuration in another embodiment of the present invention;
图8为本发明一个实施例中静态路由配置的检测装置的结构示意图;FIG. 8 is a schematic structural diagram of a detection device for static routing configuration in an embodiment of the present invention;
图9为本发明另一个实施例提供的路由器的结构示意图。Fig. 9 is a schematic structural diagram of a router provided by another embodiment of the present invention.
具体实施方式Detailed ways
为使本发明实施例的目的、技术方案和优点更加清楚,下面将结合本发明实施例中的附图,对本发明实施例中的技术方案进行清楚、完整地描述,显然,所描述的实施例是本发明一部分实施例,而不是全部的实施例。基于本发明中的实施例,本领域普通技术人员在没有做出创造性劳动前提下所获得的所有其他实施例,都属于本发明保护的范围。In order to make the purpose, technical solutions and advantages of the embodiments of the present invention clearer, the technical solutions in the embodiments of the present invention will be clearly and completely described below in conjunction with the drawings in the embodiments of the present invention. Obviously, the described embodiments It is a part of embodiments of the present invention, but not all embodiments. Based on the embodiments of the present invention, all other embodiments obtained by persons of ordinary skill in the art without making creative efforts belong to the protection scope of the present invention.
本发明实施例的静态路由配置的检测方法可以由检测装置来执行,该检测装置可集成在路由器中。The detection method of the static routing configuration in the embodiment of the present invention may be executed by a detection device, and the detection device may be integrated in a router.
该路由器中配置有静态路由。静态路由是指由管理员手工配置的路由。当网络的拓扑结构或链路的状态发生变化时,管理员需要手工去修改路由表中相关的静态路由信息。举例来说,静态路由信息在缺省情况下是私有的,不会传递给其他的路由器,因此使用静态路由网络安全保密性高。当然,管理员也可以通过对路由器进行设置使之成为共享的。静态路由一般适用于比较简单的网络环境,在这样的环境中,管理员易于清楚地了解网络的拓扑结构,便于设置正确的路由信息。There are static routes configured in this router. Static routes refer to routes manually configured by administrators. When the network topology or link status changes, the administrator needs to manually modify the relevant static routing information in the routing table. For example, static routing information is private by default and will not be passed on to other routers. Therefore, the use of static routing has high network security and confidentiality. Of course, the administrator can also make it shared by setting up the router. Static routing is generally applicable to a relatively simple network environment. In such an environment, administrators can easily understand the topology of the network and set correct routing information.
举例来说,路由器A(地址为1::1/64)的下一跳为路由器B(地址为1::2/64),通过路由器B要将报文转发给目的地址为33::3的主机,管理员就要在路由器A上配置一条“ipv6route-static33::3641::2”的路由信息,该静态路由信息决定了报文转发的路径为路由器A到路由器B,再由路由器B转发给目的地址33::3的主机。For example, the next hop of router A (address 1::1/64) is router B (address 1::2/64), and the packet needs to be forwarded to the destination address 33::3 through router B The administrator needs to configure a routing information of "ipv6route-static33::3641::2" on router A. This static routing information determines the path of packet forwarding from router A to router B, and then router B Forward to the host with the destination address 33::3.
本实施例提供对如上静态路由的检测方案,该实施例的方法可以包括:This embodiment provides a detection scheme for the above static routing, and the method of this embodiment may include:
检测装置基于路由器中配置的静态路由中的下一跳IPv6地址,进行邻居缓存表项学习;The detection device performs neighbor cache entry learning based on the next-hop IPv6 address in the static route configured in the router;
其中,邻居发现(Neighbor Discovery,以下缩写为ND)是确定邻居节点之间关系的一组消息和进程,IPv6的邻居发现协议替代了IPv4的地址解析协议(Address Resolution Protocol,以下缩写为ARP)、Internet控制报文协议路由器发现(Internet Control Message Protocol Router Discovery,ICMPRouter Discovery)和ICMP重定向(Redirect)消息,并提供了其他功能。Among them, Neighbor Discovery (Neighbor Discovery, hereinafter abbreviated as ND) is a set of messages and processes to determine the relationship between neighbor nodes. The IPv6 Neighbor Discovery Protocol replaces the IPv4 Address Resolution Protocol (Address Resolution Protocol, hereinafter abbreviated as ARP), Internet Control Message Protocol Router Discovery (ICMPRouter Discovery) and ICMP Redirect (Redirect) messages, and provides other functions.
对于一个节点而言,当其配置IPv6地址之后,首先会确定此地址是否可用、不冲突。当一个节点是主机时,路由器需要通知主机向特定目的地址转发报文的理想下一跳IPv6地址;当一个节点是路由器时,需要发布自己的地址、地址前缀和其他配置参数以指导主机进行参数配置。在IPv6报文转发过程中,节点需要确定邻居节点的媒体访问控制(Media Access Control,以下缩写为MAC)地址和邻居节点的IPv6地址的对应关系和其可达性。邻居缓存包括邻居节点的MAC地址和邻居节点的IPv6地址的对应关系。For a node, after configuring an IPv6 address, it first determines whether the address is available and does not conflict. When a node is a host, the router needs to inform the host of the ideal next-hop IPv6 address to forward the message to a specific destination address; when a node is a router, it needs to publish its own address, address prefix and other configuration parameters to guide the host to perform parameters configuration. During the IPv6 message forwarding process, the node needs to determine the correspondence between the Media Access Control (Media Access Control, hereinafter abbreviated as MAC) address of the neighbor node and the IPv6 address of the neighbor node and its reachability. The neighbor cache includes the correspondence between the MAC address of the neighbor node and the IPv6 address of the neighbor node.
具体的,上述例子中,静态路由配置的下一跳IPv6地址为路由器B的IPv6地址。又举例来说,静态路由的配置信息可以包括出接口。路由器A在配置静态路由之后,查找邻居缓存确定该下一跳IPv6地址匹配的邻居缓存表项是否存在,若确定该下一跳IPv6地址匹配的邻居缓存表项不存在,根据该下一跳IPv6地址进行邻居发现。检测装置根据所述邻居发现的结果,设置所述静态路由的状态,例如活跃,或者不活跃。举例来说,若确定该下一跳IPv6地址匹配的邻居缓存表项存在且状态为可达时,设置所述静态路由活跃。Specifically, in the above example, the next-hop IPv6 address configured in the static route is the IPv6 address of router B. For another example, the configuration information of the static route may include an outbound interface. After router A configures a static route, it searches the neighbor cache to determine whether the neighbor cache entry matching the next-hop IPv6 address exists. If it is determined that the neighbor cache entry matching the next-hop IPv6 address does not exist, the address for neighbor discovery. The detection device sets the state of the static route, such as active or inactive, according to the result of the neighbor discovery. For example, if it is determined that the neighbor cache entry matching the next-hop IPv6 address exists and the state is reachable, the static route is set active.
下面采用几个具体的实施例,对上述技术方案进行详细说明。The above technical solution will be described in detail below using several specific embodiments.
图1为本发明一个实施例中静态路由配置的检测方法的流程图,如图1所示,包括101、路由器接收静态路由的配置信息。举例来说,所述配置信息包括目的IPv6地址和下一跳IPv6地址。可选地,所述配置信息还可以包括出接口和匹配长度。可选地,当所述配置信息不包括所述出接口时,所述路由器根据所述下一跳IPv6地址迭代出所述出接口。FIG. 1 is a flow chart of a detection method for static routing configuration in an embodiment of the present invention. As shown in FIG. 1 , it includes 101. A router receives configuration information of a static routing. For example, the configuration information includes a destination IPv6 address and a next-hop IPv6 address. Optionally, the configuration information may also include an outbound interface and a matching length. Optionally, when the configuration information does not include the outbound interface, the router iterates out the outbound interface according to the next-hop IPv6 address.
102、路由器查找匹配下一跳IPv6地址的邻居缓存表项。102. The router searches for a neighbor cache entry matching the next-hop IPv6 address.
举例来说,所述路由器存储邻居缓存,所述邻居缓存包括至少一个邻居缓存表项,所述至少一个邻居缓存表项包括所述路由器的邻居设备的IPv6地址和对应的出接口。For example, the router stores a neighbor cache, where the neighbor cache includes at least one neighbor cache entry, and the at least one neighbor cache entry includes an IPv6 address and a corresponding outgoing interface of a neighbor device of the router.
103、如果找不到匹配所述下一跳IPv6地址的邻居缓存表项,则发送第一邻居请求消息(Neighbor Solicitation message),所述第一邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是对应所述下一跳IPv6地址的请求节点组播地址(solicited-node multicast address corresponding to thenext-hop IPv6address)。103. If no neighbor cache entry matching the next-hop IPv6 address is found, send a first neighbor solicitation message (Neighbor Solicitation message), where the target address of the first neighbor solicitation message is the next-hop IPv6 address address, and the destination address is the solicited-node multicast address corresponding to the next-hop IPv6 address corresponding to the next-hop IPv6 address.
104、所述路由器确定在第一预设的时间内是否收到响应所述第一邻居请求消息的第一邻居通告消息(Neighbor Advertisement message)。104. The router determines whether a first neighbor advertisement message (Neighbor Advertisement message) in response to the first neighbor solicitation message is received within a first preset time.
105、如果在所述第一预设的时间内没有接收到响应所述第一邻居通告消息,则设置所述静态路由不活跃。105. If no response to the first neighbor advertisement message is received within the first preset time, set the static route to be inactive.
图2为本发明又一个实施例中静态路由配置的检测方法的流程图,相较于图1所示的方法,还可以包括:在105后执行重复执行103和104,即重复发送所述第一邻居请求消息,确定在所述第一预设的时间内是否接收到所述第一邻居通告消息。如果在所述第一预设的时间内接收到所述第一邻居通告消息,执行106、设置所述静态路由活跃。可选地,重复发送所述第一邻居请求消息的时间间隔可以递增。例如,初始时,1秒后,第二次发送所述第一邻居请求消息。如果没有在第一预设时间内接收到所述第一邻居通告消息,则过10秒后第三次发送所述第一邻居请求消息。如果仍没有在第一预设时间内接收到所述第一邻居通告消息,则过20秒后第三次发送所述第一邻居请求消息,以此类推。这种按照时间递增方式重复进行邻居发现的方式可以节省资源FIG. 2 is a flow chart of a detection method for static routing configuration in another embodiment of the present invention. Compared with the method shown in FIG. A neighbor solicitation message, determining whether the first neighbor advertisement message is received within the first preset time. If the first neighbor advertisement message is received within the first preset time, perform 106, set the static route active. Optionally, the time interval for repeatedly sending the first neighbor solicitation message may be incremented. For example, initially, after 1 second, the first neighbor solicitation message is sent for the second time. If the first neighbor notification message is not received within the first preset time, the first neighbor request message is sent for the third time after 10 seconds. If the first neighbor notification message is still not received within the first preset time, the first neighbor request message is sent for the third time after 20 seconds, and so on. This method of repeatedly performing neighbor discovery in a time-incremental manner can save resources
本发明实施例提供的静态路由配置的检测方法,通过为路由器配置静态路由时查找匹配所述下一跳IPv6地址的邻居缓存表项,如果找不到匹配所述下一跳IPv6地址的邻居缓存表项,则进行邻居发现,如果在预设的时间接收不到邻居通告消息,则设置所述静态路由不活跃。本发明实施例能够实现静态路由配置的自动检测,可以提高静态路由配置的可靠性,减少人工配置的工作量。The static routing configuration detection method provided by the embodiment of the present invention is to search for a neighbor cache entry matching the next-hop IPv6 address when configuring a static route for the router, if no neighbor cache matching the next-hop IPv6 address is found table entry, neighbor discovery is performed, and if no neighbor notification message is received within the preset time, the static route is set to be inactive. The embodiment of the present invention can realize the automatic detection of the static route configuration, can improve the reliability of the static route configuration, and reduce the workload of manual configuration.
可选地,上述实施例中,收到所述第一邻居通告消息后,创建第一邻居缓存表项,存储所述第一邻居缓存表项与所述静态路由的对应关系。可选地,如果在所述第一预设的时间内接收到响应所述第一邻居请求消息的第一邻居通告消息,所述第一邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。Optionally, in the foregoing embodiment, after receiving the first neighbor notification message, a first neighbor cache entry is created, and a correspondence between the first neighbor cache entry and the static route is stored. Optionally, if a first Neighbor Advertisement message in response to the first Neighbor Solicitation message is received within the first preset time, the target address carried in the first Neighbor Advertisement message is the next-hop IPv6 address, set the static route active.
可选地,上述实施例所述的方法还可以包括:如果所述路由器找到匹配所述下一跳IPv6地址和出接口的邻居缓存表项,且所述邻居缓存表项的状态为可达(reachable),则设置所述静态路由活跃。可选地,所述路由器存储所述匹配的邻居缓存表项与所述静态路由的对应关系。举例来说,所述静态路由的配置信息包括所述出接口。又举例来说,当所述静态路由的配置信息不包括所述出接口时,所述路由设备根据所述下一跳IPv6地址迭代出所述出接口。Optionally, the method described in the foregoing embodiment may further include: if the router finds a neighbor cache entry that matches the next-hop IPv6 address and the outbound interface, and the state of the neighbor cache entry is reachable ( reachable), then set the static route active. Optionally, the router stores the correspondence between the matching neighbor cache entry and the static route. For example, the configuration information of the static route includes the outbound interface. For another example, when the configuration information of the static route does not include the outbound interface, the routing device iterates out the outbound interface according to the next-hop IPv6 address.
可选地,上述实施例所述的方法还可以包括:如果所述路由器找到匹配所述下一跳IPv6地址和所述出接口的邻居缓存表项,且所述邻居缓存表项的状态不是可达(reachable),则通过所述出接口发送第二邻居请求消息,所述第二邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。如果在所述第二预设的时间内没有接收到响应所述第二邻居请求消息的第二邻居通告消息,则设置所述静态路由不活跃。可选地,如果在第二预设的时间内接收到响应所述第二邻居请求消息的第二邻居通告消息,所述第二邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。可选地,所述路由器存储所述匹配的邻居缓存表项与所述静态路由的对应关系。Optionally, the method described in the foregoing embodiment may further include: if the router finds a neighbor cache entry that matches the next-hop IPv6 address and the outgoing interface, and the state of the neighbor cache entry is not available If reachable, then send a second neighbor solicitation message through the outbound interface, where the target address of the second neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. If the second neighbor advertisement message in response to the second neighbor solicitation message is not received within the second preset time, the static route is set to be inactive. Optionally, if a second Neighbor Advertisement message in response to the second Neighbor Advertisement message is received within a second preset time, the target address carried in the second Neighbor Advertisement message is the next-hop IPv6 address, Then set the static route active. Optionally, the router stores the correspondence between the matching neighbor cache entry and the static route.
举例来说,所述第二预设的时间与所述第一预设的时间可以相同,也可以不同。For example, the second preset time may be the same as or different from the first preset time.
可选地,上述实施例所述的方法还可以包括:周期性地发送第四邻居请求消息,所述第四邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址,如果在第四预设的时间内接收到响应所述第四邻居请求消息的第四邻居通告消息,则设置所述静态路由活跃,如果在第四预设的时间内没有接收到响应所述第四邻居请求消息的第四邻居通告消息,设置所述静态路由不活跃。举例来说,当所述静态路由删除时,省略周期性发送所述第四邻居请求消息的操作。Optionally, the method described in the foregoing embodiment may further include: periodically sending a fourth neighbor solicitation message, where the target address of the fourth neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. A hop IPv6 address, if a fourth Neighbor Advertisement message in response to the fourth Neighbor Solicitation message is received within a fourth preset time, the static route is set to be active, if not received within a fourth preset time and setting the static route inactive until a fourth neighbor advertisement message in response to the fourth neighbor solicitation message. For example, when the static route is deleted, the operation of periodically sending the fourth neighbor solicitation message is omitted.
本发明实施例提供的静态路由配置的检测方法,通过为路由器配置静态路由时,在邻居缓存表项不存在时进行邻居发现的表项学习,能够自动发现静态路由配置错误或者链路问题,提高了流量转发的可靠性。The static route configuration detection method provided by the embodiment of the present invention can automatically detect static route configuration errors or link problems by performing neighbor discovery table entry learning when the neighbor cache entry does not exist when configuring static routes for the router, and improving The reliability of traffic forwarding is improved.
可选地,上述实施例所述的方法还可以包括:当路由器收到请求删除所述静态路由对应的邻居缓存表项的消息时,所述路由器则通过所述出接口发送第三邻居请求消息,所述第三邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。如果在所述第三预设的时间内接收到响应所述第三邻居请求消息的第三邻居通告消息,所述第三邻居通告消息携带的目标地址为所述下一跳IPv6地址,则省略执行删除所述邻居缓存表项的操作,保持所述静态路由活跃。可选地,如果在所述第三预设的时间内没有接收到响应所述第三邻居请求消息的第三邻居通告消息,则删除所述邻居缓存表项,设置所述静态路由不活跃。Optionally, the method described in the foregoing embodiments may further include: when the router receives a message requesting to delete the neighbor cache entry corresponding to the static route, the router sends a third neighbor solicitation message through the outbound interface , the target address of the third neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. If a third Neighbor Advertisement message in response to the third Neighbor Solicitation message is received within the third preset time, and the target address carried in the third Neighbor Advertisement message is the next-hop IPv6 address, omit Execute the operation of deleting the neighbor cache entry to keep the static route active. Optionally, if a third neighbor notification message in response to the third neighbor solicitation message is not received within the third preset time, the neighbor cache entry is deleted, and the static route is set to be inactive.
采用上述方案,可以避免静态路由不会被错误删除,提高静态路由的可用性。By adopting the above solution, it is possible to prevent the static route from being deleted by mistake, and improve the usability of the static route.
以下以几个具体应用场景为例,进一步对图2所示实施例进行详细说明。The following uses several specific application scenarios as examples to further describe the embodiment shown in FIG. 2 in detail.
图3为本发明实施例所适用的场景一的组网示意图,如图3所示,本实施例说明的是,若在组网链路某段出问题情况下,利用本发明实施例的方法可以有效规避流量不通的发生。Fig. 3 is a schematic diagram of the networking of
具体的,图3的组网中,路由器RTA、路由器RTB和路由器RTC中间通过二层交换机连接,当交换机和RTB链接的链路出问题时,RTA和交换机相连的接口无法感知,此时如果在RTA上面配置静态路由,下一跳是RTB的地址时,本发明实施例针对此场景可以在配置静态路由时根据路由器RTB的IPv6地址查找邻居缓存确定是否存在匹配的邻居缓存表项,如果不存在匹配的邻居缓存表项,则发送邻居请求消息,此时由于交换机和RTB之间的链路问题,收不到响应所述邻居请求消息的邻居通告消息,则设置静态路由不活跃。不活跃的路由不会下发到FIB表项中,从而不会通过所述发生故障的路径传输数据流。Specifically, in the network shown in Figure 3, the router RTA, router RTB, and router RTC are connected through a
图4为本发明实施例所适用的场景二的组网示意图,如图4所示,本实施例说明的是,若在管理员配置错误的情况下,利用本发明实施例的方法可以有效规避流量断流的发生。Figure 4 is a schematic diagram of the networking of the second scenario applicable to the embodiment of the present invention. Occurrence of flow interruption.
具体的,图4的组网中,路由器RTA和路由器RTB通过双链路相连接,其中路由器RTA的一条链路地址1:2::1/64、出接口Ethernet1/0/0与路由器RTB地址1:2::2/64、出接口Ethernet1/0/1相连接,路由器RTA的另一条链路地址2:1::1/64、出接口Ethernet2/0/0与路由器RTB地址2:1::2/64、出接口Ethernet2/0/1相连接。若管理员在RTA上面配置静态路由时由于操作失误,配了错误的下一跳和出接口,做成如下配置时:Specifically, in the network shown in Figure 4, the router RTA and the router RTB are connected through a dual link, wherein a link address of the router RTA is 1:2::1/64, the outgoing interface Ethernet1/0/0 is connected to the address of the router RTB 1:2::2/64, the outgoing interface Ethernet1/0/1 is connected, another link address of the router RTA is 2:1::1/64, the outgoing interface Ethernet2/0/0 is connected to the router RTB address 2:1 ::2/64 and outgoing interface Ethernet2/0/1 are connected. If the administrator configures the static route on the RTA due to an operation error and configures the wrong next hop and outbound interface, the configuration is as follows:
ipv6 route-static 1:2::264Ethernet 1/0/0 2:1::2ipv6 route-static 1:2::
本发明实施例通过查找邻居缓存,以及进行邻居发现,可以发现这种错误,避免数据流传输中断。而现有的技术方案中配置静态路由后,所述静态路由会用于指导报文转发,并没有检测配置的静态路由是否可达,因为出接口Ethernet1/0/0和下一跳IPv6地址2:1::2没有连接,导致数据流传输中断。In the embodiment of the present invention, by searching the neighbor cache and performing neighbor discovery, such errors can be found to avoid interruption of data stream transmission. In the existing technical solution, after configuring a static route, the static route will be used to guide packet forwarding, and there is no detection of whether the configured static route is reachable, because the outbound interface Ethernet1/0/0 and the next-hop IPv6 address 2 :1::2 is not connected, causing the data flow to be interrupted.
图5为本发明实施例所适用的场景三的组网示意图。具体的,图5的组网中,路由器RTA和路由器RTB连接,路由器RTB与目的地址33::3/64的主机连接。在RTA如果配置一个到达目的地址33::3的静态路由:FIG. 5 is a schematic diagram of networking in scenario 3 applicable to the embodiment of the present invention. Specifically, in the networking shown in FIG. 5 , the router RTA is connected to the router RTB, and the router RTB is connected to the host with the destination address 33::3/64. If a static route to the destination address 33::3 is configured on RTA:
ipv6 route-static 33::3 64 1::2ipv6 route-static 33::3 64 1::2
本发明实施例会在配置静态路由时查找邻居缓存确定下一跳IPv6地址匹配的邻居缓存表项是否存在,如果不存在,则进行邻居发现,在预设的时间内收到响应邻居请求消息的邻居通告消息时,设置静态路由活跃,而现有技术在RTA上配置静态路由后,就会将该配置的静态路由下发到FIB用于指导报文转发,把到达33::3的流量引入,流量引入后才会由流量触发1::2的ND表项的学习,因此,在学习到ND表项之前的流量都被丢弃。而本发明实施例由于接收到数据流前已学习到了ND表项,故不会丢包。The embodiment of the present invention will search the neighbor cache to determine whether the neighbor cache entry matching the next-hop IPv6 address exists when configuring the static route, and if not, perform neighbor discovery and receive the neighbor responding to the neighbor request message within the preset time When notifying a message, set the static route to be active, but in the prior art, after the static route is configured on the RTA, the configured static route will be sent to the FIB to guide the packet forwarding, and the traffic arriving at 33::3 will be introduced. The learning of the 1::2 ND entry is triggered by the traffic after the traffic is introduced. Therefore, the traffic before the ND entry is learned is discarded. However, in the embodiment of the present invention, since the ND entry has been learned before receiving the data stream, no packet loss will occur.
图6为本发明一个实施例中静态路由配置的检测装置的结构示意图,可以执行上述实施例提供的静态路由配置的检测方法,该装置可集成在路由器中。如图6所示,本发明实施例的装置,包括:接收模块61,用于接收静态路由的配置信息,所述配置信息至少包括目的IPv6地址和下一跳IPv6地址;FIG. 6 is a schematic structural diagram of an apparatus for detecting a static routing configuration in an embodiment of the present invention, which can execute the method for detecting a static routing configuration provided in the above-mentioned embodiment, and the apparatus can be integrated in a router. As shown in FIG. 6, the device of the embodiment of the present invention includes: a receiving
查找模块62,用于查找匹配所述下一跳IPv6地址的邻居缓存表项;A
发送模块63,用于如果找不到匹配所述下一跳IPv6地址的邻居缓存表项,则发送第一邻居请求消息,所述第一邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是对应所述下一跳IPv6地址的请求节点组播地址;Sending
确定模块64,用于确定在第一预设的时间内是否收到响应所述第一邻居请求消息的第一邻居通告消息;A
设置状态模块65,用于如果在第一预设的时间内没有接收到响应所述第一邻居请求消息的第一邻居通告消息,则设置所述静态路由不活跃。The
本实施例的装置,可以用于执行上述实施例提供的静态路由配置的检测方法,各操作的实现细节请参考方法实施例,此处不再赘述。The device in this embodiment can be used to execute the static routing configuration detection method provided in the above embodiments. For implementation details of each operation, please refer to the method embodiment, which will not be repeated here.
本发明实施例提供的静态路由配置的检测装置,接收静态路由的配置信息,查找匹配的邻居缓存表项,如果找不到匹配的邻居缓存表项,则进行邻居发现,如果在第一预设的时间内没有接收到响应所述第一邻居请求消息的第一邻居通告消息,则设置所述静态路由不活跃。因此,这种方案能够自动发现静态路由配置错误或者链路问题,可以提高静态路由配置的可靠性,减少人工配置的工作量。The detection device for static routing configuration provided by the embodiment of the present invention receives configuration information of static routing, searches for a matching neighbor cache entry, and performs neighbor discovery if no matching neighbor cache entry is found. If no first neighbor advertisement message is received in response to the first neighbor solicitation message within a time period, the static route is set to be inactive. Therefore, this solution can automatically discover static route configuration errors or link problems, improve the reliability of static route configuration, and reduce the workload of manual configuration.
可选的,所述设置状态模块65,还用于:如果在所述第一预设的时间内接收到响应所述第一邻居请求消息的所述第一邻居通告消息,且所述第一邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。Optionally, the
可选的,所述设置状态模块65,还用于:如果所述路由器找到匹配所述下一跳IPv6地址的邻居缓存表项,且所述邻居缓存表项的状态为可达,则设置所述静态路由活跃。Optionally, the setting
可选的,所述发送模块63还用于:如果所述路由器找到匹配所述下一跳IPv6地址的邻居缓存表项,且所述邻居缓存表项状态不是可达,则通过出接口发送第二邻居请求消息,所述第二邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。Optionally, the sending
所述确定模块64,还用于确定在第二预设的时间内是否接收到响应所述第二邻居请求消息的第二邻居通告消息。The determining
所述设置状态模块65,还用于:如果在第二预设的时间内没有接收到响应所述第二邻居请求消息的第二邻居通告消息,则设置所述静态路由不活跃。The
可选的,所述设置状态模块65,还用于:如果在所述第二预设的时间内接收到响应所述第二邻居请求消息的所述第二邻居通告消息,所述第二邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。Optionally, the
图7为本发明又一个实施例中静态路由配置的检测装置的结构示意图,图7所示的装置相较于上述图6所示的装置,还可以包括:FIG. 7 is a schematic structural diagram of a detection device for static routing configuration in another embodiment of the present invention. Compared with the device shown in FIG. 6 above, the device shown in FIG. 7 may further include:
触发模块66,用于当所述下一跳IPv6地址匹配的邻居缓存表项存在且状态不是可达时,或当在所述第一预设的时间内没有接收到响应所述第一邻居请求消息的第一邻居通告消息时,触发所述发送模块63重复发送所述第一邻居请求消息。A
举例来说,其中,所述触发模块66具体用于当所述下一跳IPv6地址的邻居缓存表项存在,且状态不是可达时,或当在所述第一预设的时间内没有接收到响应所述第一邻居请求消息的第一邻居通告消息时,按照时间递增方式触发所述发送模块63重复发送所述第一邻居请求消息。For example, wherein, the
可选的,所述发送模块63还用于:Optionally, the sending
周期性地发送第四邻居请求消息,所述第四邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址;periodically sending a fourth neighbor solicitation message, the target address of the fourth neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address;
所述确定模块64,还用于确定在第四预设的时间内是否接收到响应所述第四邻居请求消息的第四邻居通告消息。The determining
所述设置状态模块65,还用于:如果在第四预设的时间内接收到响应所述第四邻居请求消息的第四邻居通告消息,则设置所述静态路由活跃,如果在第四预设的时间内没有接收到响应所述第四邻居请求消息的第四邻居通告消息,则设置所述静态路由不活跃。The
图7所示的装置,可以用于执行上述实施例提供的静态路由配置的检测方法,各操作的实现细节请参考方法实施例,此处不再赘述。The device shown in FIG. 7 can be used to execute the detection method for the static routing configuration provided in the above embodiment. For the implementation details of each operation, please refer to the method embodiment, which will not be repeated here.
图8为本发明一个实施例中静态路由配置的检测装置的结构示意图,图8所示的装置相较于图7所示的装置,所述接收模块61还用于接收请求删除静态路由对应的邻居缓存表项的消息。所述发送模块63还用于通过所述出接口发送第三邻居请求消息,所述第三邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。Fig. 8 is a schematic structural diagram of a detection device for static route configuration in an embodiment of the present invention. Compared with the device shown in Fig. 7, the device shown in Fig. 8 is further configured to receive a request to delete the corresponding static route Information about neighbor cache entries. The sending
所述确定模块64,还用于确定在第三预设的时间内是否接收到响应所述第三邻居请求消息的第三邻居通告消息。The determining
省略删除模块67,用于如果在第三预设的时间内接收到响应所述第三邻居请求消息的第三邻居通告消息,所述第三邻居通告消息携带的目标地址为所述下一跳IPv6地址,则省略执行删除所述静态路由对应的邻居缓存表项的操作,保持所述静态路由活跃。Omitting the
删除模块68,用于如果在所述第三预设的时间内没有接收到响应所述第三邻居请求消息的第三邻居通告消息,则删除所述静态路由对应的邻居缓存表项,设置所述静态路由不活跃。The
图8所示的装置,收到请求删除静态路由对应的邻居缓存表项的消息时,进行邻居发现,可以避免路由被错误删除,确保路由的可用性。The device shown in FIG. 8 performs neighbor discovery when receiving a message requesting to delete a neighbor cache entry corresponding to a static route, which can prevent the route from being deleted by mistake and ensure the availability of the route.
可选的,如图8所示,上述各实施例的装置中的所述发送模块63,包括第一发送单元631和第二发送单元632,其中:Optionally, as shown in FIG. 8, the sending
所述第一发送单元631,用于当所述下一跳IPv6地址匹配的邻居缓存表项不存在时,发送所述第一邻居请求消息,所述第一邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是对应所述下一跳IPv6地址的请求节点组播地址。The
所述第二发送单元632,用于当所述下一跳IPv6地址匹配的邻居缓存表项存在而状态不是可达时,通过出接口发送第二邻居请求消息,所述第二邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。The
图8所示的装置,可以避免静态路由不会被错误删除,提高静态路由的可用性。The device shown in FIG. 8 can prevent the static route from being deleted by mistake, and improve the usability of the static route.
可选的,所述静态路由的配置信息还包括出接口和匹配长度。Optionally, the configuration information of the static route also includes an outgoing interface and a matching length.
可选的,图8所示的装置还包括:Optionally, the device shown in Figure 8 also includes:
迭代模块69,用于当所述静态路由的配置信息不包括所述出接口时,根据所述下一跳IPv6地址迭代出所述静态路由的出接口。An
图8所示的装置,可以用于执行上述实施例提供的静态路由配置的检测方法,各操作的实现细节请参考方法实施例,此处不再赘述。The device shown in FIG. 8 can be used to execute the detection method for static routing configuration provided in the above embodiment. For the implementation details of each operation, please refer to the method embodiment, which will not be repeated here.
综上所述,本发明实施例提供的静态路由配置的检测方法和装置,接收静态路由的配置信息,进行邻居发现,可以自动发现静态路由配置错误或者链路问题,可以提高静态路由配置的可靠性,减少人工配置的工作量。In summary, the static routing configuration detection method and device provided by the embodiments of the present invention can receive static routing configuration information and perform neighbor discovery, which can automatically detect static routing configuration errors or link problems, and can improve the reliability of static routing configuration. performance and reduce the workload of manual configuration.
图9为本发明另一个实施例提供的路由器的结构示意图,该路由器包括至少一个处理器901,至少一个网络接口902,存储器903,和至少一个通信总线904,用于实现装置之间的连接通信。处理器901用于执行存储器903中存储的指令。举例来说,存储器903可以包含高速随机存取存储器(RAM:Random Access Memory),也可以还包括非不稳定的存储器(non-volatilememory),例如至少一个磁盘存储器。通过至少一个网络接口902实现路由器与其他路由器或主机之间的通信连接。Fig. 9 is a schematic structural diagram of a router provided by another embodiment of the present invention, the router includes at least one
在一些实施方式中,存储器903存储了程序905,程序905可以被处理器901执行,这个程序包括执行一种静态路由配置的检测方法,该方法包括:接收静态路由的配置信息,所述配置信息至少包括目的IPv6地址和下一跳IPv6地址。所述路由器查找匹配所述下一跳IPv6地址的邻居缓存表项。如果找不到匹配所述下一跳IPv6地址的邻居缓存表项,则发送第一邻居请求消息,所述第一邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是对应所述下一跳IPv6地址的请求节点组播地址。如果在第一预设的时间内没有接收到响应所述第一邻居请求消息的第一邻居通告消息,则设置所述静态路由不活跃。In some implementations, the
可选地,上述程序905还可以包括:如果在所述第一预设的时间内接收到响应所述第一邻居请求消息的所述第一邻居通告消息,且所述第一邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。Optionally, the
可选地,上述程序905还可以包括:如果找到匹配所述下一跳IPv6地址的邻居缓存表项,且所述邻居缓存表项的状态为可达,则设置所述静态路由活跃。Optionally, the
可选地,上述905还可以包括:如果找到匹配所述下一跳IPv6地址的邻居缓存表项,且所述邻居缓存表项状态不是可达,则通过出接口发送第二邻居请求消息,所述第二邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。如果在第二预设的时间内没有接收到响应所述第二邻居请求消息的第二邻居通告消息,则设置所述静态路由不活跃。Optionally, the above 905 may also include: if a neighbor cache entry matching the next-hop IPv6 address is found, and the state of the neighbor cache entry is not reachable, sending a second neighbor solicitation message through the outbound interface, so The target address of the second neighbor solicitation message is the next-hop IPv6 address, and the destination address is the next-hop IPv6 address. If no second neighbor advertisement message in response to the second neighbor solicitation message is received within a second preset time, the static route is set to be inactive.
可选地,上述程序905还可以包括:如果在第二预设的时间内接收到响应所述第二邻居请求消息的第二邻居通告消息,所述第二邻居通告消息携带的目标地址为所述下一跳IPv6地址,则设置所述静态路由活跃。Optionally, the
可选地,上述程序905还包括:当收到请求删除所述静态路由对应的邻居缓存表项的消息时,通过出接口发送第三邻居请求消息,所述第三邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。如果在第三预设的时间内接收到响应所述第三邻居请求消息的第三邻居通告消息,所述第三邻居通告消息携带的目标地址为所述下一跳IPv6地址,则省略执行删除所述邻居缓存表项的操作,保持所述静态路由活跃。如果在所述第三预设的时间内没有接收到响应所述第三邻居请求消息的所述第三邻居通告消息,则删除所述邻居缓存表项,设置所述静态路由不活跃。Optionally, the
可选地,上述程序905还可以包括:周期性地发送第四邻居请求消息,所述第四邻居请求消息的目标地址是所述下一跳IPv6地址,目的地址是所述下一跳IPv6地址。如果在第四预设的时间内接收到响应所述第四邻居请求消息的第四邻居通告消息,则设置所述静态路由活跃,如果在第四预设的时间内没有接收到响应所述第四邻居请求消息的第四邻居通告消息,则设置所述静态路由不活跃。Optionally, the
可选地,所述静态路由的配置信息还包括出接口和匹配长度。Optionally, the configuration information of the static route also includes an outgoing interface and a matching length.
可选地,上述程序905还可以包括,当所述配置信息不包括所述出接口时,根据所述下一跳IPv6地址迭代出所述静态路由的出接口。Optionally, the
本领域普通技术人员可以理解:实现上述各方法实施例的全部或部分步骤可以通过程序指令相关的硬件来完成。前述的程序可以存储于一计算机可读取存储介质中。该程序在执行时,执行包括上述各方法实施例的步骤;而前述的存储介质包括:ROM、RAM、磁碟或者光盘等各种可以存储程序代码的介质。Those of ordinary skill in the art can understand that all or part of the steps for implementing the above method embodiments can be completed by program instructions and related hardware. The aforementioned program can be stored in a computer-readable storage medium. When the program is executed, it executes the steps including the above-mentioned method embodiments; and the aforementioned storage medium includes: ROM, RAM, magnetic disk or optical disk and other various media that can store program codes.
最后应说明的是:以上各实施例仅用以说明本发明实施例的技术方案,而非对其限制;尽管参照前述各实施例对本发明实施例进行了详细的说明,本领域的普通技术人员应当理解:其依然可以对前述各实施例所记载的技术方案进行修改,或者对其中部分或者全部技术特征进行等同替换;而这些修改或者替换,并不使相应技术方案的本质脱离本发明实施例各实施例技术方案的范围。Finally, it should be noted that: the above embodiments are only used to illustrate the technical solutions of the embodiments of the present invention, not to limit them; although the embodiments of the present invention have been described in detail with reference to the foregoing embodiments, those of ordinary skill in the art It should be understood that it is still possible to modify the technical solutions described in the foregoing embodiments, or perform equivalent replacements for some or all of the technical features; and these modifications or replacements do not make the essence of the corresponding technical solutions deviate from the embodiments of the present invention. The scope of the technical solutions of each embodiment.
Claims (18)
Priority Applications (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310049253.3A CN103117930B (en) | 2013-02-07 | 2013-02-07 | The detection method of static routing configuration and device |
Applications Claiming Priority (1)
| Application Number | Priority Date | Filing Date | Title |
|---|---|---|---|
| CN201310049253.3A CN103117930B (en) | 2013-02-07 | 2013-02-07 | The detection method of static routing configuration and device |
Publications (2)
| Publication Number | Publication Date |
|---|---|
| CN103117930A true CN103117930A (en) | 2013-05-22 |
| CN103117930B CN103117930B (en) | 2016-01-27 |
Family
ID=48416208
Family Applications (1)
| Application Number | Title | Priority Date | Filing Date |
|---|---|---|---|
| CN201310049253.3A Active CN103117930B (en) | 2013-02-07 | 2013-02-07 | The detection method of static routing configuration and device |
Country Status (1)
| Country | Link |
|---|---|
| CN (1) | CN103117930B (en) |
Cited By (7)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106612341A (en) * | 2016-11-24 | 2017-05-03 | 上海易杵行智能科技有限公司 | Method for intelligently configuring network management address of neighbor switcher |
| CN107260140A (en) * | 2017-06-09 | 2017-10-20 | 上海斐讯数据通信技术有限公司 | A kind of whole day rhythm of the heart method and system |
| CN107592243A (en) * | 2017-10-23 | 2018-01-16 | 上海斐讯数据通信技术有限公司 | A kind of method and device for verifying router static binding function |
| CN110113202A (en) * | 2019-04-30 | 2019-08-09 | 新华三信息安全技术有限公司 | A kind of IPsec diagnostic method, device and local device |
| CN111953606A (en) * | 2020-07-14 | 2020-11-17 | 锐捷网络股份有限公司 | Routing iteration loop detection method and device, electronic equipment and storage medium |
| CN112637057A (en) * | 2020-12-30 | 2021-04-09 | 锐捷网络股份有限公司 | Route management method and device |
| JP2022509605A (en) * | 2018-11-14 | 2022-01-21 | ランディス・ギア イノベーションズ インコーポレイテッド | Systems and methods for finding adjacent nodes in a network |
Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1681254A (en) * | 2004-04-08 | 2005-10-12 | 华为技术有限公司 | A Method for Ethernet Link State Maintenance |
| CN1859377A (en) * | 2005-11-17 | 2006-11-08 | 华为技术有限公司 | Method for maintaining static route based on link layer protocol |
| CN102035676A (en) * | 2010-12-07 | 2011-04-27 | 中兴通讯股份有限公司 | ARP (Address Resolution Protocol) interaction based method and equipment for detecting and recovering link fault |
-
2013
- 2013-02-07 CN CN201310049253.3A patent/CN103117930B/en active Active
Patent Citations (3)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN1681254A (en) * | 2004-04-08 | 2005-10-12 | 华为技术有限公司 | A Method for Ethernet Link State Maintenance |
| CN1859377A (en) * | 2005-11-17 | 2006-11-08 | 华为技术有限公司 | Method for maintaining static route based on link layer protocol |
| CN102035676A (en) * | 2010-12-07 | 2011-04-27 | 中兴通讯股份有限公司 | ARP (Address Resolution Protocol) interaction based method and equipment for detecting and recovering link fault |
Cited By (12)
| Publication number | Priority date | Publication date | Assignee | Title |
|---|---|---|---|---|
| CN106612341A (en) * | 2016-11-24 | 2017-05-03 | 上海易杵行智能科技有限公司 | Method for intelligently configuring network management address of neighbor switcher |
| CN106612341B (en) * | 2016-11-24 | 2020-05-22 | 上海易杵行智能科技有限公司 | Method for intelligently configuring network management address of neighbor switch |
| CN107260140A (en) * | 2017-06-09 | 2017-10-20 | 上海斐讯数据通信技术有限公司 | A kind of whole day rhythm of the heart method and system |
| CN107592243A (en) * | 2017-10-23 | 2018-01-16 | 上海斐讯数据通信技术有限公司 | A kind of method and device for verifying router static binding function |
| CN107592243B (en) * | 2017-10-23 | 2020-12-22 | 王蕴卓 | Method and device for verifying static binding function of router |
| JP2022509605A (en) * | 2018-11-14 | 2022-01-21 | ランディス・ギア イノベーションズ インコーポレイテッド | Systems and methods for finding adjacent nodes in a network |
| JP7410145B2 (en) | 2018-11-14 | 2024-01-09 | ランディス・ギア イノベーションズ インコーポレイテッド | System and method for neighbor node discovery in a network |
| CN110113202A (en) * | 2019-04-30 | 2019-08-09 | 新华三信息安全技术有限公司 | A kind of IPsec diagnostic method, device and local device |
| CN110113202B (en) * | 2019-04-30 | 2022-02-25 | 新华三信息安全技术有限公司 | IPsec diagnosis method and device and home terminal equipment |
| CN111953606A (en) * | 2020-07-14 | 2020-11-17 | 锐捷网络股份有限公司 | Routing iteration loop detection method and device, electronic equipment and storage medium |
| CN112637057A (en) * | 2020-12-30 | 2021-04-09 | 锐捷网络股份有限公司 | Route management method and device |
| CN112637057B (en) * | 2020-12-30 | 2022-08-16 | 锐捷网络股份有限公司 | Route management method and device |
Also Published As
| Publication number | Publication date |
|---|---|
| CN103117930B (en) | 2016-01-27 |
Similar Documents
| Publication | Publication Date | Title |
|---|---|---|
| US11611509B2 (en) | Communication method, communications device, and communications system | |
| CN107846342B (en) | Method, device and system for forwarding VXLAN message | |
| EP2974234B1 (en) | Generating a host route | |
| CN103117930B (en) | The detection method of static routing configuration and device | |
| US20210203586A1 (en) | Communication Method, Device, and System | |
| JP7306642B2 (en) | Loop avoidance communication method, loop avoidance communication device and loop avoidance communication system | |
| CN104081749B (en) | DAD-NS triggered address resolution for DOS attack protection | |
| US11711243B2 (en) | Packet processing method and gateway device | |
| TW201134151A (en) | RSVP-TE graceful restart under fast re-route conditions | |
| CN101425942A (en) | Method, apparatus and system for bidirectional forwarding detection implementation | |
| KR20220098152A (en) | Communication method and device | |
| WO2021109997A1 (en) | Anti-fiber breakage method and device for segment routing tunnel, ingress node and storage medium | |
| CN104852826A (en) | Loop detecting method and device | |
| CN105323163A (en) | Routing calculation method and device based on ISIS | |
| CN110881006A (en) | Method, network device and computer storage medium for sending message | |
| WO2022218132A1 (en) | Route update method, apparatus and system | |
| US20170289099A1 (en) | Method and Device for Managing Internet Protocol Version 6 Address, and Terminal | |
| CN102916894A (en) | Network traffic forwarding method and source routing equipment | |
| US20250219933A1 (en) | Intra-domain source address validation fast reroute using igps | |
| CN117378180A (en) | Method and device for path switching management |
Legal Events
| Date | Code | Title | Description |
|---|---|---|---|
| C06 | Publication | ||
| PB01 | Publication | ||
| C10 | Entry into substantive examination | ||
| SE01 | Entry into force of request for substantive examination | ||
| C14 | Grant of patent or utility model | ||
| GR01 | Patent grant |