Patent Description:
With an increase of network devices and network protocols, a network environment becomes increasingly complex, and network complexity makes it harder to carry out network maintenance and troubleshooting. For example, disadvantages of software design of a device on a network are increasing gradually. For example, invalid parameters, function errors, and hardware failures inside a device, or faulty operations, forwarding loops, reachability problems, performance degradation outside a device may cause the network to run abnormally due to failures. To resolve these problems, people develop some tools for dealing with the foregoing problems, such as the simple network management protocol (English: simple network management protocol, SNMP for short) and the network flow routine (English: network flow routine, NETFLOW for short). However, with an increasing network scale, these tools gradually become inefficient. Therefore, the industry researches some network verification technologies. The verification technology usually uses a forwarding behavior of a network device and a data structure or a formula to model the network device or an entire network, to verify whether a failure exists on the device or on a network status, for example, providing interfaces such as the telecommunications network protocol (English: Telecommunication Network Protocol, TELNET for short), the SNMP, and the network configuration protocol (English: Network Configuration Protocol, NETCONF) based on the network device, obtaining forwarding information bases of the device, modeling the network device or the entire network by using a data structure or a formula, and verifying whether a problem such as a loop occurs on the network according to a verification algorithm. However, on a large-scale network, because there is a large quantity of forwarding information bases on the device, it takes a relatively long time to obtain these forwarding information bases. However, the device learns entries quickly. As a result, forwarding entries of the device obtained by a verification system are inconsistent with the entries learned by the device. Therefore, a verification result is inaccurate. This brings great challenges to development of the verification technology.

<CIT> discloses a network controller including a flow repository and a consistency verification engine. The flow repository may store a dataflow configuration previously specified by an application. The consistency verification engine may access the dataflow configuration from the flow repository, retrieve flow table entries from a flow table of a network device, identify an inconsistency between the dataflow configuration previously specified by the application and the flow table entries of the network device, and respond to the identified inconsistency.

The invention is set out as in the appended claims. This application provides a method and a system for obtaining a FIB of a device on a network, and a device, so that a verification system can accurately and efficiently obtain the FIB of the device, to realize accuracy of a verification result.

According to a first aspect, this application provides a method for obtaining a FIB of a device. The method includes: A verification system sends a request message to each of a plurality of devices, where the request message carries a command for obtaining a FIB generated at a specified time by each of the plurality of devices, wherein the request message further indicates the specified time or carries a period for obtaining the FIB of each of the plurality of devices, wherein the period indicates each of the plurality of devices to provide the FIB of the device according to the period; the verification system receives a response message sent by each of the plurality of devices, where the response message carries the FIB or a FIB snapshot generated at the specified time by each of the plurality of devices; and the verification system obtains the FIB or the FIB snapshot from the response message of each of the plurality of devices, and verifies, based on the FIB or the FIB snapshot, whether a failure occurs on a network at the specified time.

With reference to the first aspect, in a possible implementation, the response message of each device carries a time at which the device generates the FIB.

According to a second aspect, this application provides a system for obtaining a FIB of a device. The system includes a plurality of devices and a verification system. The verification system is configured to send a request message to each of the plurality of devices, receive a response message sent by each of the plurality of devices, obtain, from the response message sent by each of the plurality of devices, a FIB or a FIB snapshot generated by each of the plurality of devices at a specified time, and verify, based on the FIB or the FIB snapshot, whether a failure occurs on a network at the specified time. The request message carries a command for obtaining the FIB of each of the plurality of devices at the specified time, wherein the request message further indicates the specified time or carries a period for obtaining the FIB of each of the plurality of devices, wherein the period indicates each of the plurality of devices to provide the FIB of the device according to the period. The response message carries the FIB or the FIB snapshot generated at the specified time by each of the plurality of devices. Each of the plurality of devices is configured to receive the request message, obtain the FIB or the FIB snapshot generated at the specified time, generate the response message, and send the response message to the verification system.

With reference to the second aspect, in a first possible implementation, each of the plurality of devices is configured to obtain the specified time from the request message, and stop, at the specified time, updating the FIB of the each of the plurality of devices that is stored in a storage area. Each device obtains, from the storage area, the FIB corresponding to the device.

With reference to the second aspect, in a second possible implementation, each of the plurality of devices is configured to obtain the specified time from the request message, stop, at the specified time, updating the FIB of the device that is stored in a storage area, and obtain the FIB snapshot of the device from the storage area. Alternatively, each of the plurality of devices is configured to obtain the specified time from the request message, and obtain the FIB snapshot of the device that is generated at the specified time.

With reference to the second aspect, in a third possible implementation, the response message of each device carries a time at which the device generates the FIB.

In the specification, claims, and accompanying drawings of the present invention, the terms "first", "second", and so on (if they exist) are intended to distinguish between similar objects but do not necessarily indicate a specific order or sequence. It should be understood that data termed in such a way is interchangeable in proper circumstances, so that the embodiments described herein may be implemented in other orders than the order illustrated or described herein. Moreover, the terms "include", "contain" and any other variants mean to cover a non-exclusive inclusion. For example, a process, method, system, product, or device that includes a list of steps or units is not necessarily limited to those steps or units that are clearly listed, but may include other steps or units that are not clearly listed or that are inherent to such a process, method, system, product, or device.

<FIG> is a schematic diagram of an application scenario in which a device generates a FIB. The network system <NUM> includes: a device <NUM>, the internet (English: Internet), and a device <NUM> and a device <NUM> in the internet. As shown in <FIG>, the devices <NUM>, <NUM>, and <NUM> may be devices configured to forward a data packet, such as routers or switches. The device <NUM> is connected to the internet, and the internet includes a large quantity of IP subnets. As shown in <FIG>, the internet includes the devices <NUM> and <NUM>, and the devices <NUM> and <NUM> are respectively connected to two subnets. For example, the two subnets are <NUM>. <NUM>/<NUM> and <NUM>. <NUM>/<NUM>. The device <NUM> may learn an IP subnet in the internet according to a network protocol, and the device <NUM> generates a FIB of the device <NUM> based on a learned IP subnet route, so as to indicate forwarding of a data packet. A router is used as an example. A router <NUM> may learn routing tables of a router <NUM> and a router <NUM> according to a routing protocol, the router <NUM> generates a FIB on the router <NUM> based on the learned routing tables, and the router <NUM> forwards a data packet based on the FIB. However, the internet usually includes <NUM>,<NUM> IP subnets. Therefore, the device <NUM> needs to learn routes of the <NUM>,<NUM> IP subnets and generate the FIB. It can be learned that the FIB on the device includes a huge quantity of forwarding information bases.

To improve efficiency of network management, verification technologies are widely developed. The verification technology is to verify, based on a verification algorithm, a problem such as reachability or a loop by obtaining FIBs of devices on a network, and modeling the devices on the network or the entire network based on these obtained FIBs according to a data structure or a formula. Therefore, to ensure accuracy and reliability of a verification result, obtaining data required for verification, to be specific, the FIBs of the devices, becomes a key to the verification technology. As shown in Table <NUM>, an experiment result of obtaining a FIB of a device by using the TELNET protocol is provided. The experiment result is used to describe duration of collecting the FIB. As shown in Table <NUM>, duration required for obtaining <NUM>,<NUM> media access control (English: Media Access Control, MAC for short) address tables is <NUM> seconds. If there are <NUM>,<NUM> virtual machines (English: virtual machine, VM for short) in a data center, there are <NUM>,<NUM> entries. It takes about <NUM> seconds to obtain a MAC address table of the device. A difference between a time for obtaining a first MAC address table and a time for obtaining a last MAC address table is at least <NUM> minutes. During the <NUM> minutes, a plurality of changes may occur in a network environment, and a control plane of the device keeps updating and maintaining a routing table. However, because it takes a long time to obtain a forwarding information base, a verification system may not be aware of changes of the obtained forwarding information base. For example, in Table <NUM>, when the verification system obtains the last MAC address table, an obtained first MAC address is unreachable due to a failure. It takes a long time to obtain the MAC address table. Therefore, the verification system may not be aware of the changes when finishing obtaining FIBs. If these inaccurate FIBs are used for verification and computation, an accurate verification result cannot be obtained. This poses a great challenge to the verification technology and is not conducive to development of the verification technology.

For example, as shown in <FIG>, an example of a time axis of obtaining FIBs from the device <NUM> is provided. In <FIG>, at a time T1, the verification system starts to obtain FIBs from the device <NUM>. To be specific, at the time T1, the verification system obtains a route from the device <NUM> to the IP subnet <NUM>. <NUM>/<NUM>. As mentioned above, because there are a large quantity of FIBs, it takes a long time to obtain the FIBs. Obtaining of the FIBs ends at a time T4. At a time T2, the subnet <NUM>. <NUM>/<NUM> of the internet is interrupted due to a failure. For example, the subnet fails because a link of the subnet is interrupted. In this case, the route from the device <NUM> to the subnet <NUM>. <NUM>/<NUM> is unreachable. However, because it takes time to notify the interruption to the device <NUM>, the device <NUM> may not immediately obtain information indicating that the subnet <NUM>. <NUM>/<NUM> is interrupted. In other words, the device <NUM> may not immediately obtain, at a time T3, information indicating that the route to the subnet <NUM>. <NUM>/<NUM> is interrupted. However, there is still a route to the subnet <NUM>. <NUM>/<NUM> in the FIBs of the device <NUM>. The verification system obtains the route to the subnet <NUM>. <NUM>/<NUM>. The verification system takes a long time to obtain FIBs of devices, but the devices learn entries quickly. Therefore, the FIBs of the devices obtained by the verification system may be inconsistent with FIBs learned and updated by the devices. If a route changes, the verification system may not discover the change immediately. However, the verification system still verifies a network based on the obtained FIBs of the devices. As a result, a verification result of the verification system is incorrect.

The network usually includes devices such as a router, a firewall, and a switch. In the verification technology, FIBs of the devices on the network need to be obtained from the devices, and the obtained FIBs of the devices should be generated at a same time, so as to ensure that the obtained FIBs are consistent with data of actual forwarding planes of corresponding devices. However, it can be learned from the foregoing analysis that, a problem in a current manner of obtaining the FIBs: Because it takes a long time to obtain the FIBs from the devices, the FIBs obtained by the verification system are inconsistent with the data of the actual forwarding planes of the devices, so that the FIBs of the devices obtained by the verification system are inaccurate. As a result, the verification result is inaccurate.

To resolve the foregoing technical problem, this application provides a method for obtaining a FIB of a device. In this method, a FIB or a FIB snapshot of each device is obtained at a specified time, so that a verification system can obtain the FIB of the device at the specified time, so as to ensure accuracy of a verification result.

<FIG> is a schematic flowchart of a method for obtaining a FIB of a device according to this application. The method in <FIG> may be used in the scenario in <FIG>, and a first device in <FIG> may be the device <NUM> in <FIG>. A network includes a verification system and a plurality of devices, and the first device is one of the plurality of devices.

The first device receives a request message sent by the verification system.

In a possible implementation, the first device may be a router that is capable of forwarding and processing a data packet. The verification system may be software that obtains a verification result through computation based on an obtained FIB and a mathematical model. The software may be run on the first device, or may be run on another network device. A device that runs the verification software or software system may be referred to as a verification device. The verification system sends a command for generating a FIB at a specified time. The command may be sent to the router according to the NETCONF protocol, the TELNET protocol, or the SNMP protocol.

In a possible implementation, no matter which foregoing protocol is used, the protocol includes a command for obtaining a FIB of the first device that is generated at the specified time. The request message may further include a period for obtaining the FIB. The first device may generate the FIB according to the period, and send the generated FIB to the verification system according to the period. For example, the FIB generated by the first device needs to be obtained for a plurality of times, and an interval is required each time. The period for obtaining the FIB of the first device is <NUM> seconds, and the first device generates the FIB every <NUM> seconds. The first device may send, to the verification system, the FIB generated according to the period.

In a possible implementation, the request message carries the command for obtaining the FIB of the first device that is generated at the specified time, where the FIB includes related entries used by the first device to indicate forwarding of a data packet. For example, the FIB may include entries such as an internet protocol (English: Internet Protocol, IP for short) forwarding information base, a MAC forwarding information base, and a multiprotocol label switching (English: Multiprotocol Label Switching, MPLS for short) forwarding information base. The entries are not limited in this application.

The first device obtains the FIB or a FIB snapshot of the first device that is generated at the specified time.

In a possible implementation, the first device obtains the FIB or the FIB snapshot generated at the specified time. For example, the first device is a router. The router may continuously learn a route to maintain a routing table, and generate a FIB based on the routing table. Because the router continuously maintains and updates the routing table, and the FIB is updated with an update of the routing table. Therefore, the FIB of the router changes continuously. After receiving the request message, the router obtains, according to the command, a FIB or a FIB snapshot generated at a specified time.

In a possible implementation, the first device may continuously store FIB snapshots generated at different times. The first device obtains, according to the specified time in the request message, a FIB snapshot corresponding to the specified time from the stored FIB snapshots. The first device may alternatively generate, at the specified time, a FIB snapshot according to the specified time. In this way, the first device not only can obtain a FIB snapshot generated at a time before the request message is sent, but also can obtain a FIB snapshot generated at a specified time after the request message is sent.

In a possible implementation, the first device includes a first storage area, and may further include a second storage area. The second storage area stores, in real time, a FIB learned and updated by the first device. The first storage area may store the FIB learned and updated by the first device, or may obtain, in real time, the FIB of the first device by synchronizing with the second storage area. Both the first storage area and the second storage area may be integrated into a memory or a memory card of the first device. Alternatively, the first storage area runs on a memory card. This is not limited in this application. The first device obtains the specified time from the request message, and stops, according to the specified time, updating the FIB stored in the first storage area. In this way, the FIB stored by the first device at the specified time may be obtained. The first device obtains the FIB stored in the first storage area at the specified time. The first device encapsulates the FIB at the specified time into a response packet, and may continue to obtain an update by synchronizing data with the second storage area according to an instruction.

For example, the first device further includes a storage area specially used to store a FIB. The storage area used to store a FIB may be a part of storage space provided by the memory of the first device, or may be storage space provided by the memory card that is added for the first device. The storage area specially used to store a FIB is used to write the FIB of the first device. The storage area specially used to store a FIB is referred to as a FIB storage area below. The first device may write the generated FIB of the first device into a buffer of the first device and the FIB storage area. Alternatively, the first device may write the FIB of the first device into only the buffer of the first device, and the FIB storage area synchronizes with the buffer of the first device in real time, to ensure that FIBs in both the buffer of the first device and the FIB storage area are the same. The first device receives the request message from the verification system, and obtains the specified time from the request message. The first device stops, at the specified time, writing an updated FIB into the FIB storage area; or the FIB storage area stops, at the specified time, synchronizing the FIB with the buffer of the first device, in other words, updating of the FIB in the FIB storage area is stopped at the specified time. In this way, the first device may obtain, from the FIB storage area, the FIB or the FIB snapshot that is generated at the specified time. According to the foregoing method, the first device can obtain the FIB that is generated at the specified time.

The first device generates a response message.

In a possible implementation, the first device encapsulates the obtained FIB of the first device into the response message, or the first device encapsulates the obtained FIB snapshot of the first device into the response message. If the first device obtains the FIB, the first device encapsulates the FIB into the response message. If the first device obtains the FIB snapshot, the first device encapsulates the FIB snapshot into the response message.

In a possible implementation, the response message may have a same type as the request message. For example, the response message may also be sent to the router according to the NETCONF protocol, the TELNET protocol, or the SNMP protocol.

The first device sends the response message to the verification system.

In a possible implementation, the response message further carries a time for obtaining the FIB of the first device. For example, a time stamp of generating the FIB is encapsulated into the response message.

Because the verification system receives a relatively large quantity of FIBs sent by the devices, and the verification system receives FIBs at different moments with an update of FIBs of the devices. Therefore, times for obtaining the FIBs may be carried in the response message, so that the verification system may classify the obtained FIBs according to the carried times. This facilitates verification and computation.

Through the foregoing steps, the verification system may obtain, according to the foregoing method, FIBs generated at the specified time by the plurality of devices on the network, where content of the FIB is a forwarding information status of the device at a specific time. The verification system verifies, based on the FIB obtained at the specified time and a verification algorithm, a problem such as reachability or a loop at the specified time. In addition, in the foregoing method, the verification system may further obtain the FIBs of the devices that are generated at a same time, so as to ensure accuracy of the verification result.

<FIG> is a schematic flowchart of a method for obtaining a FIB of a device according to this application. A router in the method may be the first device in <FIG>, and the router has a function of the first device. A verification system may be a second device in <FIG>, and the verification system has a function of the second device. A scenario in which the method is used may include a plurality of routers and one or more verification systems. In the schematic flowchart of the method shown in <FIG>, the foregoing method is described by using one of the plurality of routers and one verification system as an example. Each of the plurality of routers in this scenario may have a function of the router in <FIG>, and may perform method steps that are performed by the router.

The verification system sends, to the router, a command for obtaining a FIB of the router that is generated at a specified time.

For example, the verification system sends a NETCONF packet to the router, where the NETCONF packet carries the command for obtaining the FIB of the router that is generated by the router at the specified time. The verification system may alternatively carry the command through a TELNET packet or an SNMP packet, where the command instructs the router to obtain the FIB of the router that is generated at the specified time. Optionally, the command may include a cyclic period or a start time of obtaining the FIB of the router. For example, a timestamp or a time carried in the command is <NUM>:<NUM>:<NUM>:<NUM>:<NUM>:<NUM>. This indicates that a FIB generated by the router at <NUM>:<NUM> on February <NUM>, <NUM> is obtained. The command may further carry a period of obtaining the generated FIB, where the period is <NUM> seconds.

The router receives the command sent by the verification system.

The router obtains the FIB generated at the specified time.

For example, the router may generate, based on the FIB generated at the specified time, a FIB in a storage area of the router through software forwarding, for example, according to the RIP protocol (Routing Information Protocol). The router may generate a FIB snapshot based on the FIB of the storage area. Alternatively, a FIB dual-write technology may be used. To be specific, a FIB is generated in one storage area of the router, and the FIB is synchronously written into another storage area of the router at a same time, and writing an entry into the another storage area is stopped at the specified time in the command. In this way, content of the FIB does not change at the specified time. It is equivalent that a FIB at a specific time is stored, so that the router can obtain the FIB at the specified time from the another storage area.

The router generates a packet, where the packet carries the FIB generated by the router at the specified time.

For example, the router may encapsulate the obtained FIB snapshot into the packet and send the packet to the verification system. Alternatively, the router may encapsulate the obtained FIB into the packet and send the packet to the verification system.

For example, the router may encapsulate the obtained FIB of the router into a NETCONF packet, a TELNET packet, or an SNMP packet.

The router sends the packet to the verification system.

The verification system receives the packet sent by the router.

The verification system obtains the FIB of the router based on the packet, and verifies, based on the FIB, whether a failure occurs on a network at the specified time.

For example, the verification system receives a FIB sent by each of the plurality of routers. FIBs of the plurality of devices obtained by the verification system are collected from the devices at a same specified time. The verification system verifies and computes the FIBs at the specified time based on the FIBs collected from the devices at the specified time and based on a mathematical model. In addition, verification analysis is performed to verify whether a failure occurs on the network at the specified time, for example, to verify whether a problem such as a loop or unreachability occurs on the network at the specified time.

According to the foregoing method, the device is enabled to obtain, according to the command, the FIB that is generated at the specified time, and send the FIB to the verification system. In this way, the verification system can obtain FIBs of the devices that are generated at a same time, so as to avoid a problem that a verification result is inaccurate because the FIBs of the devices obtained by the verification system are inaccurate due to a network status or a long time for collecting the FIBs of the devices.

<FIG> shows a device for generating a forwarding information base according to this application. The device may be the device <NUM> in <FIG>, the device in the schematic flowchart of the method in <FIG>, or a router in <FIG>; and may implement functions of the device in <FIG> and the router in <FIG>. The device includes a receiving unit <NUM>, an obtaining unit <NUM>, a generation unit <NUM>, and a sending unit <NUM>. The receiving unit <NUM> is configured to receive a request message sent by a verification system, where the request message carries a command for obtaining a FIB generated at a specified time. The obtaining unit <NUM> is configured to obtain the FIB or a FIB snapshot generated at the specified time. The generation unit <NUM> is configured to generate a response message, where the response message carries the FIB or the FIB snapshot. The sending unit <NUM> is configured to send the response message to the verification system.

In a possible implementation, the obtaining unit <NUM> is configured to obtain the specified time from the request message; the generation unit <NUM> is configured to stop, at the specified time, updating a FIB of a first device that is stored in a storage area; and the obtaining unit <NUM> is configured to obtain the FIB of the first device from the storage area.

In a possible implementation, the obtaining unit <NUM> is configured to obtain the specified time from the request message; the generation unit <NUM> is configured to stop, at the specified time, updating a FIB of a first device that is stored in a storage area; and the obtaining unit <NUM> is configured to obtain the FIB snapshot of the first device from the storage area. Alternatively, the obtaining unit <NUM> is configured to obtain the specified time from the request message; and the obtaining unit <NUM> is configured to obtain the FIB snapshot of the first device that is generated at the specified time.

In a possible implementation, the request message further carries a period for obtaining the FIB of the first device, and the first device provides the FIB of the first device to the verification system according to the period.

In a possible implementation, the device further includes an adding unit. The adding unit is configured to add a time for generating the FIB of the first device to the response message.

In this specific implementation, for specific implementations of the receiving unit <NUM>, the obtaining unit <NUM>, the generation unit <NUM>, and the sending unit <NUM>, refer to functions and implementation steps of the first device in <FIG> and the router in <FIG>. For brevity, details are not described again.

<FIG> shows a verification device according to this application. The verification device includes a sending unit <NUM>, a receiving unit <NUM>, an obtaining unit <NUM>, and a verification unit <NUM>. The sending unit <NUM> is configured to send a request message to each of a plurality of devices, where the request message carries a command for obtaining a forwarding information base FIB generated at a specified time by each of the plurality of devices. The receiving unit <NUM> is configured to receive a response message sent by each of the plurality of devices, where the response message carries the FIB or a FIB snapshot generated at the specified time by each of the plurality of devices. The obtaining unit <NUM> is configured to obtain the FIB or the FIB snapshot from the response message of each of the plurality of devices. The verification unit <NUM> is configured to verify, based on the FIB or the FIB snapshot, whether a failure occurs on a network at the specified time.

In a possible implementation, the request message further carries a period for obtaining the FIB of each of the plurality of devices, and the period indicates each of the plurality of devices to provide the FIB of the device according to the period.

In a possible implementation, the response message of each device carries a time at which the device generates the FIB.

In this specific implementation, for specific implementations of the sending unit <NUM>, the receiving unit <NUM>, the obtaining unit <NUM>, and the verification unit <NUM>, refer to functions and implementation steps of the verification systems in <FIG> and <FIG>. For brevity, details are not described again.

<FIG> shows another device according to this application. The device may be the device <NUM> in <FIG>, the first device in the schematic flowchart of the method in <FIG>, or the router in <FIG>; and may implement functions of the first device and the router. The device includes a network interface <NUM> and a processor <NUM>, and may further include a memory <NUM>.

The processor <NUM> includes, but is not limited to, one or more of a central processing unit (English: central processing unit, CPU for short), a network processor (English: network processor, NP for short), an application-specific integrated circuit (English: application-specific integrated circuit, ASIC for short), or a programmable logic device (English: programmable logic device, PLD for short). The PLD may be a complex programmable logic device (English: complex programmable logic device, CPLD for short), a field-programmable gate array (English: field-programmable gate array, FPGA for short), generic array logic (English: generic array logic, GAL for short), or any combination thereof. The processor <NUM> is responsible for management of a bus <NUM> and general processing, and may further provide various functions, including timing, a peripheral interface, voltage regulation, power management, and another control function. The memory <NUM> may be configured to store data used by the processor <NUM> when the processor <NUM> performs an operation.

The network interface <NUM> may be a wired interface, for example, a fiber distributed data interface (English: Fiber Distributed Data Interface, FDDI for short), or an Ethernet (English: Ethernet) interface. The network interface <NUM> may alternatively be a wireless interface, for example, a wireless local area network interface.

The memory <NUM> may include, but is not limited to, a content-addressable memory (English: content-addressable memory, CAM for short), for example, a ternary content addressable memory (English: ternary CAM, TCAM for short) or a random access memory (English: random access memory, RAM for short).

The memory <NUM> may alternatively be integrated into the processor <NUM>. If the memory <NUM> and the processor <NUM> are components independent of each other, the memory <NUM> is connected to the processor <NUM>. For example, the memory <NUM> and the processor <NUM> may communicate with each other through the bus. The network interface <NUM> and the processor <NUM> may communicate with each other through the bus, or the network interface <NUM> may be directly connected to the processor <NUM>.

The bus <NUM> may include any quantity of interconnected buses and bridges, and the bus <NUM> connects various circuits including one or more processors represented by the processor <NUM> and memories represented by the memory <NUM>. The bus <NUM> may further connect various other circuits such as a peripheral device, a voltage stabilizer, and a power management circuit. These are all well-known in the art, and therefore are not described in further details in this specification.

In a possible implementation, the network interface <NUM> is configured to receive a request message sent by a verification system and send a response message to the verification system, where the request message carries a command for obtaining a FIB generated at a specified time, and the response message carries the FIB or a FIB snapshot. The processor <NUM> is configured to obtain the FIB or the FIB snapshot generated at the specified time, and generate the response message.

In a possible implementation, the processor <NUM> is further configured to obtain the specified time from the request message, stop, at the specified time, updating a FIB of the first device that is stored in a storage area, and obtain the FIB of the first device from the storage area. The memory <NUM> is configured to store the FIB of the first device, and makes an update based on learning of the first device.

In a possible implementation, the processor <NUM> is configured to obtain the specified time from the request message, stop, at the specified time, updating a FIB of the first device that is stored in a storage area, and obtain a FIB snapshot of the first device from the storage area. Alternatively, the processor <NUM> is configured to obtain the specified time from the request message, and obtain a FIB snapshot of the first device that is generated at the specified time.

In a possible implementation, the processor <NUM> is further configured to add a time for generating the FIB of the first device to the response message.

In this specific implementation, for specific implementations of the processor <NUM>, the network interface <NUM>, and the memory <NUM>, refer to functions and implementation steps of the first device in <FIG> and the router in <FIG>. For brevity, details are not described again.

<FIG> shows another verification device according to this application. The device includes a network interface <NUM> and a processor <NUM>, and may further include a memory <NUM>.

In a possible implementation, the network interface <NUM> is configured to send a request message to each of a plurality of devices, and receive a response message sent by each of the plurality of devices. The request message carries a command for obtaining a forwarding information base FIB generated at a specified time by each of the plurality of devices, and the response message carries the FIB or a FIB snapshot generated at the specified time by each of the plurality of devices. The processor <NUM> is configured to obtain the FIB or the FIB snapshot from the response message of each of the plurality of devices, and verify, based on the FIB or the FIB snapshot, whether a failure occurs on a network at the specified time.

In this specific implementation, for specific implementations of the processor <NUM> and the network interface <NUM>, refer to functions and implementation steps of the verification systems in <FIG> and <FIG>. For brevity, details are not described again.

<FIG> shows a system for obtaining a FIB of a device according to this application. The system includes a plurality of devices <NUM> and <NUM>, and a verification device <NUM>. The verification device <NUM> sends a request message to each of the device <NUM> and the device <NUM>, receives a response message sent by each of the device <NUM> and the device <NUM>, obtains, from the response message of each of the device <NUM> and the device <NUM>, a forwarding information base FIB or a FIB snapshot generated by each of the devices at a specified time, and verifies, based on the FIB or the FIB snapshot, whether a failure occurs on a network at the specified time. The request message carries a command for obtaining the FIB of each of the plurality of devices at the specified time. The response message carries the FIB or the FIB snapshot generated at the specified time by each of the plurality of devices. The device <NUM> and the device <NUM> are configured to receive the request message, obtain the FIB or the FIB snapshot generated at the specified time, generate the response message, and send the response message to the verification system.

In a possible implementation, the device <NUM> is configured to obtain the specified time from the request message, and stop, at the specified time, updating a FIB of the device <NUM> that is stored in a storage area. The device <NUM> obtains, from the storage area, the FIB of the device <NUM>.

In a possible implementation, the device <NUM> is configured to obtain the specified time from the request message, stop, at the specified time, updating the FIB of the device <NUM> that is stored in a storage area, and obtain the FIB snapshot of the device <NUM> from the storage area. Alternatively, the device <NUM> is configured to obtain the specified time from the request message, and obtain the FIB snapshot of the device <NUM> that is generated at the specified time.

In a possible implementation, the request message further carries a period for obtaining the FIB of the device <NUM> in the plurality of devices, and the period indicates the device <NUM> in the plurality of devices to provide the FIB of the device <NUM> according to the period.

In a possible implementation, the response message of each device carries a time at which the device <NUM> generates the FIB.

Because the device <NUM> and the device <NUM> have a same function and perform a same step in a system, the step performed by the device <NUM> in the foregoing implementations may be performed by the device <NUM>. Therefore, the foregoing function of the device <NUM> is not described again.

The device <NUM> and the device <NUM> each may be the first device in the schematic flowchart of the method in <FIG> or the router in <FIG>; and may implement functions of the first device and the router. Alternatively, the device <NUM> and the device <NUM> each may be the device in <FIG> or <FIG>.

The verification device <NUM> may be the verification system in the schematic flowchart of the method in <FIG> or the verification device in the schematic flowchart of the method in <FIG>; and may implement functions of the verification device or the verification system. Alternatively, the verification device <NUM> may be a first PE device in <FIG> or <FIG>. The verification device <NUM> may alternatively be the verification device in <FIG> or <FIG>.

In this specific implementation, for specific implementations of the devices <NUM> and <NUM>, refer to functions and implementation steps of the first device in <FIG> or the router in <FIG>. For a specific implementation of the verification device <NUM>, refer to functions and implementation steps of the verification systems in <FIG> and <FIG>. For brevity, details are not described again.

It should be understood that sequence numbers of the foregoing methods do not mean execution sequences in various embodiments of this application. The execution sequences of the methods should be determined according to functions and internal logic of the methods, and should not be construed as any limitation on the implementation processes of the embodiments of this application.

In the several embodiments provided in this application, it should be understood that the disclosed methods and devices may be implemented in other manners. For example, division into modules is merely logical function division and may be other division in actual implementation. For example, a plurality of modules or components may be combined or integrated into another system, or some features may be ignored or not performed. In addition, the displayed or discussed mutual couplings or direct couplings or communication connections may be implemented through some interfaces.

The modules described as separate parts may or may not be physically separate, and parts displayed as modules may or may not be physical units, may be located in one position, or may be distributed on a plurality of network units.

In addition, functional modules in the embodiments of the present invention may be integrated into one processing unit, or each of the modules may exist alone physically, or two or more modules are integrated into one module. The integrated module may be implemented in a form of hardware, or may be implemented in a form of hardware in addition to a software functional unit.

Claim 1:
A method for obtaining a forwarding information base, FIB, of a device (<NUM>, <NUM>), wherein the method comprises:
sending, by a verification system (<NUM>), a request message to each of a plurality of devices (<NUM>, <NUM>), wherein the request message carries a command for obtaining a FIB generated at a specified time by each of the plurality of devices (<NUM>, <NUM>), wherein the request message further indicates the specified time or carries a period for obtaining the FIB of each of the plurality of devices (<NUM>, <NUM>), wherein the period indicates each of the plurality of devices (<NUM>, <NUM>) to provide the FIB of the device (<NUM>, <NUM>) according to the period;
receiving, by the verification system (<NUM>), a response message sent by each of the plurality of devices (<NUM>, <NUM>), wherein the response message carries the FIB or a FIB snapshot generated at the specified time by each of the plurality of devices (<NUM>, <NUM>); and
obtaining, by the verification system (<NUM>), the FIB or the FIB snapshot from the response message sent by each of the plurality of devices (<NUM>, <NUM>), and verifying, based on the FIB or the FIB snapshot, whether a failure occurs on a network at the specified time.