
直接上中文版吧,原文在下面
译文:
我在以前的工作岗位上,别人经常请我指导他们如何准备应聘网络工程师和职业服务的技术面试。一个CCIE和有与之相称的经验通常是通过上述技术面试的一个方法,所以那些应聘者在知道他们已经具备上述资格的时候就不再垂头丧气了。
除非应聘者来自有系统提供商背景的工作岗位,否则他们很可能不具备实际的MPLS和IS-IS知识,而仅仅具备一些简单的BGP经验。所以,我面试时经常不在MPLS和IS-IS上进行深挖,而是仅仅只尝试判断他们的对这些即将很快进入他们工作领域协议的快速学习能力。我是这么做的,但是我希望每个应聘者都拥有广泛和深厚的OSPF经验,并且这些才是我大多数问题所关注的重点所在。
下面这个问题是排在我最喜欢的技术面试问题中第一位的,这几乎在我每次面试的时候都会问的。这是一个可以透露出一个人是否对协议是怎样工作的有一些了解,不仅仅局限于它是怎样配置的。可是还是令我震惊的是,还是有很多应聘者倒在了这道问题上。
这道问题就是:
为什么OSPF要求两个非骨干区域的所有通信流量都要通过骨干区域(area 0)?
对比链路状态协议的三个基本概念,这些概念几乎是每个初学OSPF的人都知晓的,这个问题的答案将很容易得出。
第一个概念是:
每个链路状态路由器将把关于自身、直连链路和其邻居的信息泛洪给其他路由器。从这泛洪的信息中,每个路由器将建立一个完全相同的链路状态数据库。然后每个路由器将依据这个数据库独立地运行最短路径协议计算——一个使用分布式信息的本地计算——来生成一个最短路径树。这个树是一个去往其他每个路由器最短路径的分类图。
一个链路状态协议的优点是链路状态数据库提供了整个网络的详细“视图”,阻止了大多数的路由环路。这个和距离矢量协议不同,距离矢量协议的路由信息是逐跳传输到整个网络的并且计算是每跳进行的——一个使用本地信息的分布式计算。每一个路由器跟着一个路由器,这样的架构是建立在下一跳路由器已经正确地完成了路径选择计算并且正确地传递了结果。当一个路由器通告它所学的前缀给他的邻居,基本上可以说成是“我知道如何到达目的地。”因为每一个距离矢量路由器只知道它邻居所告示给他的,并且除去它的邻居外,对整个网络没有一个清晰的视图,距离矢量协议是容易出现环路的。
第二个概念是:
当链路状态域变大,泛洪和链路状态数据库的大小变成了一个相当具有规模的问题。这个问题的解决办法是将路由域打破成多个区域:这样第一个概念就被修改了,变成了泛洪只发生在一个区域边界以内,并且这样导致链路状态数据库只包含了来自区域内路由器的信息。这发过来又意味着每一个路由器计算的最短生成树仅仅描述了去往这个区域内其他路由器的路径。
第三个概念是:
OSPF区域间是通过一个或者多个区域间路由器(ABR)连接的(其他主要的链路状态协议,如IS-IS的连接方式有些不同)。ABR维护各别的链路状态数据库,并且各自计算每个它们所连接区域的最短路径树。因此,一个ABR被定义为是同属于两个或多个区域的成员。它将通过向目标区域泛洪3类的LSAs来通告它从源区域所学习到的前缀。这样也基本上可以说成是“我知道如何到达目的地。”
等一下——最后一个概念描述的不是链路状态,这是距离矢量。在区域中的路由器是看不到ABR以外的东西,并且相信ABR正确地告诉他们通过它可以到达的前缀。区域内的生成树计算起源于一个描述ABR之外所有前缀都视为以一些特殊的开销链接到ABR上的叶节点的最短路径树
以上将引导我们得出问题的答案:
因为区域间OSPF是距离矢量,这是容易出现环路的。要避免环路的话需要一个无环的区域间拓扑结构。这个就是为什么OSPF要求两个非骨干区域的所有通信流量都要通过骨干区域(area 0)的原因。
以上是我送你的一个小礼物。你下一次面试被一个老笨蛋用类似这个问题来分辨哪些是只会动手的,哪些是真正了解一些OSPF的时候,你就可以微笑地面对他灰白的脸了。
I was often called upon, in past jobs, to conduct technical interviews with applicants to network engineering and professional services positions. A CCIE and experience commensurate with that certification was typically a gateway to just being considered for a technical interview, so these job candidates were no slouches in what they knew.
Unless the candidate came from a service provider background they probably had no practical MPLS and IS-IS, and only basic BGP, experience. So I usually couldn’t dig very deep there, and only tried to determine their capacity for quickly coming up to speed on those protocols. I did, however, expect every candidate to have extensive experience with OSPF and that’s where I focused most of my questions.
That leads to my favorite technical interview question, one that I asked almost every time. It’s a question that reveals whether a person has some understanding of how the protocol works, rather than just how to configure it. And I am still surprised how often people stumble on it.
Here it is:
Why does OSPF require all traffic between non-backbone areas to pass through a backbone area (area 0)?
Comparing three fundamental concepts of link state protocols, concepts that even most OSPF beginners understand, easily derives the answer to the question.
The first concept is this:
Every link state router floods information about itself, its links, and its neighbors to every other router. From this flooded information each router builds an identical link state database. Each router then independently runs a shortest-path-first calculation on its database – a local calculation using distributed information – to derive a shortest-path tree. This tree is a sort of map of the shortest path to every other router.
One of the advantages of link state protocols is that the link state database provides a “view” of the entire network, preventing most routing loops. This is in contrast to distance vector protocols, in which route information is passed hop-by-hop through the network and a calculation is performed at each hop – a distributed calculation using local information. Each router along a route is dependent on the router before it to perform its calculations correctly and then correctly pass along the results. When a router advertises the prefixes it learns to its neighbors it’s basically saying, “I know how to reach these destinations.” And because each distance vector router knows only what its neighbors tell it, and has no “view” of the network beyond the neighbors, the protocol is vulnerable to loops.
The second concept is this:
When link state domains grow large, the flooding and the resulting size of the link state database becomes a scaling problem. The problem is remedied by breaking the routing domain into areas: That first concept is modified so that flooding occurs only within the boundaries of an area, and the resulting link state database contains only information from the routers in the area. This, in turn, means that each router’s calculated shortest-path tree only describes the path to other routers within the area.
The third concept is this:
OSPF areas are connected by one or more Area Border Routers (the other main link state protocol, IS-IS, connects areas somewhat differently) which maintain a separate link state database and calculate a separate shortest-path tree for each of their connected areas. So an ABR by definition is a member of two or more areas. It advertises the prefixes it learns in one area to its other areas by flooding Type 3 LSAs into the areas that basically say, “I know how to reach these destinations.”
Wait a minute – what that last concept described is not link state, it’s distance vector. The routers in an area cannot “see” past the ABR, and rely on the ABR to correctly tell them what prefixes it can reach. The SPF calculation within an area derives a shortest-path tree that depicts all prefixes beyond the ABR as leaf subnets connected to the ABR at some specified cost.
And that leads us to the answer to the question:
Because inter-area OSPF is distance vector, it is vulnerable to routing loops. It avoids loops by mandating a loop-free inter-area topology, in which traffic from one area can only reach another area through area 0.
This is my little gift to you. The next time you are being interviewed by an old coot that likes to use this question to weed out the cookbook operators from those who actually understand a little about OSPF, you can bring a smile to his grizzled face.
|
|