出自:

http://www.gxlaoyou.com/home.php?mod=space&uid=46&do=blog&id=10

·OSPF属于IGP,是Link-State协议,基于IP 协议号 89。
·采用SPF算法(Dijkstra算法)计算最佳路径。(1.最短 2.无环)
·快速响应网络变化。
·以较低频率(每隔30分钟)发送定期更新,被称为链路状态刷新。
·网络变化时是触发更新。
·支持等价的负载均衡,我们所学的协议中,只有EIGRP支持不等价负载。(默认4,最大16)
 
一个路由器产生的LSA会把自己所有接口的信息都包含其中,对端邻居会把LSA放入LSDB中,继续泛洪此LSA,直到网络中的所有路由器都收到此LSA。
OSPF既有周期更新(30分),又有触发更新。

链路状态路由协议(也可以说OSPF)工作原理:
1-首先每台路由器通过使用Hello报文与它的邻居之间建立邻接关系 。
2-然 后每台路由器向每个邻居发送链路状态通告(LSA),有时叫链路状态报文(LSP).今天你先把理解成某条路由(当然它不仅包含路由信息还包含拓扑信 息),这个LSA我们后面会专门拿1天课程来讲! 每个邻居在收到(LSA)LSP之后要依次向它的邻居转发这些(LSA)LSP(一般我们也叫做Flooding泛洪LSA/LSP)。
3-接下来每台路由器要在数据库中保存一份它所收到的LSA/LSP的备份(LSDB),所有区域内路由器的数据库(LSDB)应该相同。这张表相对EIGRP的TOP表更详细!那么(LSDB)存放的就是一条一条LSA!
4-最后,依照拓扑数据库(LSDB)-每台路由器使用Dijkstra算法(SPF算法)计算出到每个网络的最短无环路径树(shortest path first),并将Cost(其实就是Metric)值最小放到到路由选择表中!
OSPF的简化原理:发Hello报文(问候网友是否在?)——建立邻居关系(组团)——形成链路状态数据库(使用LSA发送出去)[相当打怪捡到宝物放入宝物库]——SPF算法(通过宝贝玛雅之石合成好装备)——形成路由表(装备打造成功)!
SPF算法:
1、在一个区域内的所有路由器有同样的LSDB
2、每一个路由器在计算时都将自已做为树根
3、具有去往目标的最低cost值的路由是最好的路径
4、最好的路由被放入转发表
Link-State Advertisement-LSA的选择操作:
LSU是什么呢?
它就是一个信封(容器)-存放真正的一条或者多条LSA!
当一台路由器收到Link-State  update(LSU),它会取出里面的LSA条目,放到链路状态数据库LS-datebase进行比较:
(1) 如果我没有!我就会添加到链路状态数据库LS-datebase!然后反馈一个LSack给LSA的发送源-表明我收到了!(如果对方没有收到 LSack,对方就会重发一次LSA过来),这样自己又要向邻居洪泛(flood)LSA,保证你的邻居也能收到LSA,洪泛(flood)LSA完成之 后,运行SPF算法选出最新路由表!
(2)如果我已经有一条(SEQ=100),那么就比较序列号,就要分三种情况:
①如果你的序列号(seq=100)跟我一样,那我就直接忽略丢弃掉这条LSA!
②如果我的序列号跟你不一样,你的序列号(seq=101)比我高,那就添加LSA到LS-datebase返回到(1)操作
③如果我的序列号跟你不一样,但你序列号(seq=99)比我低,那我就要把LSA从LS-datebase取出来封装到LSU,发送给信息源,告诉它-要更新的是你而不是我!

Question 1:

Which of the following statements below best describe the process identifier that is used to run OSPF on a router? (Choose two)

A – It is an optional parameter required only if multiple OSPF processes are running on the router
B – It is locally significant
C – It is needed to identify a unique instance of an OSPF database
D – All routers in the same OSPF area must have the same process ID if they are to exchange routing information

Answer: B C

Question 2:

Why R1 can’t establish an OSPF neighbor relationship with R3 according to the following graphic? (Choose two)

A – Configure EIGRP on these routers with a lower administrative distance
B – All routers should be configured for backbone Area 1
C – R1 and R3 have been configured in different areas
D – The hello and dead interval timers are not configured the same values on R1 and R3

Answer: C D

Explanation:

A is not correct because configure EIGRP on these routers (with a lower administrative distance) will force these routers to run EIGRP, not OSPF.

B is not correct because the backbone area of OSPF is always Area 0.

C and D are correct because these entries must match on neighboring routers:

- Hello and dead intervals
Area ID (Area 0 in this case)
– Authentication password
– Stub area flag

Question 3:

Which items are correct about the routing protocol OSPF? (Choose three)

A – Support VLSM
B – Increase routing overhead on the network
C – Confine network instability to one area of the network
D – Allow extensive control of routing updates

Answer: A C D

Explanation:

Routing overhead is the amount of information needed to describe the changes in a dynamic network topology. All routers in an OSPF area have identical copies of the topology database and the topology database of one area is hidden from the rest of the areas to reduce routing overhead because fewer routing updates are sent and smaller routing trees are computed and maintained (allow extensive control of routing updates and confine network instability to one area of the network).

Question 4:

Which three features are of OSPF routing protocol? (Choose three)

A – Converge quickly
B – OSPF is a classful routing protocol
C – Identify the best route by use of cost
D – Before exchanging routing information, OSPF routers find out neighbors

Answer: A C D

Question 5:

OSPF routing uses the concept of areas. What are the characteristics of OSPF areas? (Chose three)

A – Each OSPF area requires a loopback interface to be configured
B – Areas may be assigned any number from 0 to 65535
C – Area 0 is called the backbone area
D – Hierarchical OSPF networks do not require multiple areas
E – Multiple OSPF areas must connect to area 0
F – Single area OSPF networks must be configured in area 1

Answer: B C E

Explanation:

I used to think the answers should be C D E and here is my explanation:

OSPF can use an active interface for its router ID, so a loopback interface is not a must -> A is incorrect.

OSPF Area is a 32-bit number so we can use up to 232 – 1 = 4294967296 – 1 (since Area 0 is the first area). Remember that only process ID is a 16-bit number and ranges from 1 to 65535 -> B is incorrect.

F is incorrect too because single area OSPF netwoks must be configured in Area 0, which is called the backbone area.

For answer D, it is a bit hard to guess what they want to say about “hierarchical” but we should understand “Hierarchical OSPF networks” as “OSPF networks”. D is correct bercause we can only have one area (area 0 – the backbone area) for our networks.

But TT commented on 01-11-2010:

Especially to note on choice B, D, and E:

Choice B: we all know that The areas can be any number from 0 to 4.2 billion and 1 to 65,535 for the Process ID. As choice B specifies ‘area’ (be aware, it’s not saying ‘process id), there is no reason to say that we cannot assign numbers from 0 to 65535 for area # (it is using ‘may be’, not ‘have to be’ or ‘ought to be’). Hence, we do not worry about assigning ’0′.

Choice E: as Area 0 is the backbone, we all understand that any areas in a OSPF network have to be connected to it. And actually this is implicitly saying that multiple areas form a hierarchical OSPF network, as Area 0 being a root and others being its leaves.

Choice D: when it specifies ‘Hierarchical’, at least 2 areas should be required to form such topology (of course that includes Area 0)

Although Choice B is not an absolutely accurate statement since it not only can be assigned up to 65535, it is still a correct answer. And again, it specifies ‘area’, not ‘process id’, so ’0′ can be included. Finally, it would be meaningless to call OSPF a hierarchical network if no more than one area is present.

—————————————————————————————————-

I reviewed the question and think it is a more suitable solution with choice B than choice D, surely it is a tricky question!

Question 6:

Part of the OSPF network is shown below:

Configuration exhibit:

R1 routing commands:

ip route 0.0.0.0 0.0.0.0 serial0/0
router ospf 1
network 172.16.100.0 0.0.0.3 area 0
network 172.16.100.64 0.0.0.63 area 0
network 172.16.100.128 0.0.0.31 area 0
default-information originate

You work as a network technician, study the exhibits carefully. Assume that all router interfaces are operational and correctly configured. In addition, assume that OSPF has been correctly configured on router R2. How will the default route configured on R1 affect the operation of R2?

A – Any packet destined for a network that is not directly connected to router R2 will be dropped immediately
B – Any packet destined for a network that is not directly connected to router R1 will be dropped
C – Any packet destined for a network that is not directly connected to router R2 will be dropped immediately because of the lack of a gateway on R1
D – The network directly connected to a router R2 will not be able to communicate with the 172.16.100.0, 172.16.100.28 and 172.16.100.64 subnetworks.
E – Any packet destined for a network that is not referenced in the routing table of router R2 will be directed to R1. R1 will then send that packet back to R2 and a routing loop will occur

Answer: E

Explanation:

First, notice that the more-specific routes will always be favored over less-specific routes regardless of the administrative distance set for a protocol. In this case, because we use OSPF for three networks (172.16.100.0 0.0.0.3, 172.16.100.64 0.0.0.63, 172.16.100.128 0.0.0.31) so the packets destined for these networks will not be affected by the default route.

The default route configured on R1 “ip route 0.0.0.0 0.0.0.0 serial0/0″ will send any packet whose destination network is not referenced in the routing table of router R2 to R1, it doesn’t drop anything so answers A, B and C are not correct. D is not correct too because these routes are declared in R1 and the question says that “OSPF has been correctly configured on router R2″, so network directly connected to router R2 can communicate with those three subnetworks.

As said above, the default route configured on R1 will send any packet destined for a network that is not referenced in its routing table to R2; R2 in turn sends it to R1 because it is the only way and a routing loop will occur.