Sequence Numbers

A difficulty with flooding, as described so far, is that when all routers have received all LSAs, the
flooding must stop. A time-to-live value in the packets could simply be relied on to expire, but it is hardly
efficient to permit LSAs to wander the internetwork until they expire. Take the internetwork in Figure
4.8. Subnet 172.22.4.0 at router A has failed, and A has flooded an LSA to its neighbors B and D,
advertising the new state of the link. B and D dutifully flood to their neighbors, and so on.
Figure 4.8. When a topology change occurs, LSAs advertising the change will be flooded throughout the
internetwork.
Look next at what happens at router C. An LSA arrives from router B at time t1, is entered into C's
topological database, and is forwarded to router F. At some later time t3, another copy of the same LSA
arrives from the longer A-D-E-F-C route. Router C sees that it already has the LSA in its database; the
question is, should C forward this LSA to router B? The answer is no because B has already received the
advertisement. Router C knows this because the sequence number of the LSA it received from router F is
the same as the sequence number of the LSA it received earlier from router B.
When router A sent out the LSA, it included an identical sequence number in each copy. This sequence
number is recorded in the routers' topological databases along with the rest of the LSA; when a router
receives an LSA that is already in the database and its sequence number is the same, the received
information is discarded. If the information is the same but the sequence number is greater, the received
information and new sequence number are entered into the database and the LSA is flooded. In this way,
flooding is abated when all routers have seen a copy of the most recent LSA.
As described so far, it seems that routers could merely verify that their link state databases contain the
same LSA as the newly received LSA and make a flood/discard decision based on that information,
without needing a sequence number. But imagine that immediately after Figure 4.8's network 172.22.4.0
failed, it came back up. Router A might send out an LSA advertising the network as down, with a
sequence number of 166; then it sends out a new LSA announcing the same network as up, with a
sequence number of 167. Router C receives the down LSA and then the up LSA from the A-B-C path, but
then it receives a delayed down LSA from the A-D-E-F-C path. Without the sequence numbers, C would
not know whether or not to believe the delayed down LSA. With sequence numbers, C's database will
indicate that the information from router A has a sequence number of 167; the late LSA has a sequence
number of 166 and is therefore recognized as old information and discarded.

Because the sequence numbers are carried in a set field within the LSAs, the numbers must have some
upper bound. What happens when this maximum sequence number is reached?