Information flooding method and device
An information flooding method and a device, to flexibly manage flooding information of an interior gateway protocol (IGP) instance, adapt to flooding requirements in different scenarios, improve flooding efficiency, save network resources, and improve flooding information processing efficiency. The method includes: a first network device obtains a flooding information set, where the flooding information set includes flooding information corresponding to each of a plurality of flooding instances, and the plurality of flooding instances belong to one IGP instance. The first network device sends a plurality of packets, where each of the plurality of packets carries a corresponding flooding instance identifier and corresponding flooding information, and the flooding instance identifier is used to identify a flooding instance.
1 . An information flooding method, comprising:
obtaining, by a first network device, a flooding information set, wherein the flooding information set comprises flooding information corresponding to each of a plurality of flooding instances, the plurality of flooding instances are respectively associated with different flooding information, and the plurality of flooding instances belong to one Interior Gateway Protocol (IGP) instance; and
sending, by the first network device, a plurality of packets, wherein each of the plurality of packets carries a corresponding flooding instance identifier and corresponding flooding information, and the flooding instance identifier is used to identify a flooding instance.
2 . The method according to claim 1 , wherein the plurality of flooding instances comprise a first flooding instance, and flooding information of the first flooding instance comprises routing information; and
sending, by the first network device, the plurality of packets comprises:
sending, by the first network device, a first packet to a second network device, wherein the first packet comprises a first flooding instance identifier and the routing information, and the second network device is any neighboring network device of the first network device.
3 . The method according to claim 2 , wherein the routing information comprises one or more of:
a prefix, traffic engineering (TE) information, device capability information, and link information.
4 . The method according to claim 1 , wherein the plurality of flooding instances comprise a second flooding instance, and flooding information of the second flooding instance comprises non-routing information; and
sending, by the first network device, the plurality of packets comprises:
sending, by the first network device, a second packet to a second network device, wherein the second packet comprises a second flooding instance identifier and the non-routing information.
5 . The method according to claim 4 , wherein the second network device is a next-hop network device in a shortest path tree of the first network device, and the shortest path tree is a shortest path from the first network device as a root node to another network device in a network topology.
6 . The method according to claim 5 , wherein the shortest path tree of the first network device is generated based on flooding information of a first flooding instance, and the flooding information of the first flooding instance comprises routing information.
7 . The method according to claim 6 , further comprising:
receiving, by the first network device, a third packet from the second network device, wherein the third packet comprises flooding information of a first flooding instance of the second network device, and the flooding information of the first flooding instance of the second network device comprises routing information of the second network device; and
generating, by the first network device, the shortest path tree based on the flooding information of the first flooding instance of the second network device.
8 . The method according to claim 4 , wherein the non-routing information comprises one or more of the:
application program information, device capability information, and slice information.
9 . The method according to claim 1 , wherein sending, by the first network device, the plurality of packets comprises:
sending, by the first network device, a hello packet to a second network device, wherein the hello packet is used to establish a neighbor relationship between the first network device and the second network device; and
sending, by the first network device, the plurality of packets to the second network device.
10 . The method according to claim 1 , wherein each of the plurality of flooding instances has a corresponding flooding parameter, and the flooding parameter is used to send a packet of a corresponding flooding instance, and the flooding parameter includes one or more of the following:
a maximum age, a maximum link state protocol data unit (LSP) generation interval, a minimum LSP generation interval, a minimum LSP transmission interval, a complete sequence number packet (CSNP) transmission interval, a partial sequence number packet (PSNP) transmission interval, a retransmission interval, and a refresh timer.
11 . An information flooding method, comprising:
receiving, by a second network device, a plurality of packets from a first network device, wherein each of the plurality of packets carries a flooding instance identifier and flooding information that correspond to the packet, a plurality of flooding instances corresponding to the plurality of packets belong to one Interior Gateway Protocol (IGP) instance, and the plurality of flooding instances are respectively associated with different flooding information; and
storing, by the second network device, the flooding information corresponding to the flooding instance identifier.
12 . The method according to claim 11 , wherein storing, by the second network device, the flooding information corresponding to the flooding instance identifier comprises:
updating, by the second network device based on the flooding information, a link state database corresponding to the flooding instance identifier.
13 . The method according to claim 12 , wherein updating, by the second network device based on the flooding information, the link state database corresponding to the flooding instance identifier comprises:
updating, by the second network device through an update process corresponding to the flooding instance identifier, the flooding information into a link state database corresponding to the update process.
14 . The method according to claim 11 , wherein the plurality of packets comprise a first packet, the first packet comprises a first flooding instance identifier and first flooding information, and the first flooding information comprises routing information; and
the method further comprises:
sending, by the second network device, the first packet to a third network device, wherein the third network device is any neighboring network device of the second network device other than the first network device.
15 . The method according to claim 14 , wherein the routing information comprises one or more of:
a prefix, traffic engineering (TE) information, device capability information, and link information.
16 . The method according to claim 11 , wherein the plurality of packets comprise a second packet, the second packet comprises a second flooding instance identifier and second flooding information, and the second flooding information comprises non-routing information; and
the method further comprises:
sending, by the second network device, the second packet to a third network device.
17 . A network device, applied to a network system comprising a plurality of network devices, wherein the plurality of network devices comprise a first network device, the network device is the first network device, and the network device comprises at least one processor, the at least one processor is coupled to at least one memory, and the at least one processor is configured to execute a computer program or instructions stored in the at least one memory, to cause the network device to:
obtain a flooding information set, wherein the flooding information set comprises flooding information corresponding to each of a plurality of flooding instances, the plurality of flooding instances are respectively associated with different flooding information, and the plurality of flooding instances belong to one Interior Gateway Protocol (IGP) instance; and
send a plurality of packets, wherein each of the plurality of packets carries a corresponding flooding instance identifier and corresponding flooding information, and the flooding instance identifier is used to identify a flooding instance.
18 . The network device according to claim 17 , wherein the plurality of flooding instances comprise a first flooding instance, and flooding information of the first flooding instance comprises routing information; and
the at least one processor is configured to execute the computer program or instructions stored in the at least one memory, to cause the network device to: send a first packet to a second network device, wherein the first packet comprises a first flooding instance identifier and the routing information, and the second network device is any neighboring network device of the first network device.
19 . The network device according to claim 17 , wherein each of the plurality of flooding instances has a corresponding flooding parameter, the flooding parameter is used to send a packet of a corresponding flooding instance, and the flooding parameter includes one or more of the following:
a maximum age, a maximum link state protocol data unit (LSP) generation interval, a minimum LSP generation interval, a minimum LSP transmission interval, a complete sequence number packet (CSNP) transmission interval, a partial sequence number packet (PSNP) transmission interval, a retransmission interval, and a refresh timer.