Linear Sequence Number Spaces
If a restarted router issues to a neighbor an LSA with a sequence number that appears to be
older than the neighbor's stored sequence number,the neighbor will send its own stored LSA
and sequence number back to the router.
Circular Sequence Number Spaces
Two rules to determine the more recent sequence number:
a is considered more recent
a>b , and (a-b)≤n/2
a<b , and (b-a)>n/2
examples(sequence number space is six bits):
n=32
Given two sequence numbers 48 、18
48 > 18, (48-18)=30 30<32 so 48 is more recent
Given two sequence numbers 48 、3
3 < 48, (48-3)=45 45>32 so 3 is more recent
Lollipop-Shaped Sequence Number Spaces
Lollipop-Shaped Sequence Number Spaces are a hybrid of linear and circular sequence number
spaces.
The linear restart numbers form the stick of the lollipop , and the circular number space is
the candy part of the lollipop.
-k < 0 < k
The negative numbers counting up from -k to 0 form the stick , and the positive numbers from
0 to k are the circular space.
Given two numbers a and b and a sequence number space n , b is more recent than a if and
only if:
a < 0 and a < b , or
a > 0 , a < b and (b-a)<n/2 or
a > 0 , a > b and (a-b)>n/2
__________
2^31 positive numbers and 2^31 negative numbers
A 32-bit signed number space N
-N(-2^31,or 0x80000000) and N-1(2^31-1,or 0x7FFFFFFF) are not used.
A router coming online will begin its sequence numbers at -N+1(0x80000001)and increment up
to zero,at which time it has entered the circular number space.When the sequence reaches N-
2(0x7FFFFFFE),the sequence wraps back to zero
----------
Lollipop sequence spaces were used with the original version of OSPF ——OSPFv1
The deployment of OSPFv1 never progressed beyond the experimental stage.
__________________________
LSA通过LS类型、LS标识和宣告路由器来识别,并通过序列号、校验和、老化时间判断LSA新旧。
Seq: 序列号(Seq)的范围是0x80000001到0x7fffffff.
Checksum: 校验和(Checksum)计算除了Age字段以外的所有字段,每5分钟校验1次.
Age: 范围是0到3600秒,16位长.当路由器发出1个LSA后,就把Age设置为0,当这个LSA经过1台路由器以
后,Age就会增加,1个LSA保存在LSDB中的时候,老化时间也会增加.
当收到相同的LSA的多个实例(LS类型、LS标识、宣告路由器相同)的时候,将通过下面的方法来确定哪个
LSA是最新的:
1. 比较LSA实例的序列号,越大的越新.
2. 如果序列号相同,就比较校验和,越大越新.
3. 如果校验和也相同,就比较老化时间,如果只有1个LSA拥有MaxAge(3600秒)的老化时间,它就是最新的.
4. 如果LSA老化时间相差15分钟以上,(叫做MaxAgeDiff),老化时间越小的越新.
5. 如果上述都无法区分,则认为这2个LSA是相同的
本文出自 “Smasher” 博客,谢绝转载!