📄 ospf.tex
字号:
%% $XORP: xorp/docs/user_manual/ospf.tex,v 1.12 2007/03/20 21:44:33 atanu Exp $% \chapter{OSPFv2 and OSPFv3}\label{ospf}\section{OSPF Terminology and Concepts}OSPF is the Open Shortest Path First protocol, it is one of twoprinciple Interior Gateway Protocols (IGP) the other being IS-IS. RIPis also an IGP however OSPF and IS-IS have better scaling properties.The initial OSPF specification is RFC 2328 OSPF Version 2 orOSPFv2. This specification is specific to IPv4. There is a laterspecification draft-ietf-ospf-ospfv3-update-14.txt OSPF for IPv6,which happens to be Version 3 or OSPFv3.The specifications for OSPFv2 and OSPFv3 are fairly similar theobvious difference is the handing of IPv4 and IPv6 addresses.The XORP implementation of OSPF supports both OSPFv2 and OSPFv3.For consistency with our other protocols OSPFv2 is {\tt ospf4} andOPSFv3 is {\tt ospf6} in the configuration files, the {\tt 4} in {\ttospf4} refers to the IPv4 address family and {\tt 6} in {\tt ospf6}refers to the IPv6 address family.\subsection{Key OSPF Concepts}As an Interior Gateway Protocol OSPF runs within a single AutonomousSystem. One way that OSPF achieves good scaling properties is to allowan AS to be split into distinct regions that OSPF calls areas. The areasare structured in a two level hierarchy, area {\tt 0.0.0.0} is specialand is called the {\tt BACKBONE} area. All other areas must beconnected to that {\tt BACKBONE} either directly or through virtual links.A fundamental quantity in OSPF that describes topology and routinginformation is the Link State Advertisement (LSA). Every OSPF routerwithin an area should have exactly the same LSAs in itsdatabase. There are different type of LSAs the base specificationdescribes Router-LSAs, Network-LSAs, Summary-LSAs and AS-external-LSAs.The OSPF protocol has explicit support for introducing routes fromother protocols, these routes are introduced via AS-external-LSAs. Forexample, routes from a RIP cloud can be introduced into OSPF and willappear as AS-external-LSAs.Areas in OSPF can be one of three different types {\tt normal}, {\ttstub} and {\tt Not-So-Stubby}. The {\tt BACKBONE} is always {\ttnormal}. All LSAs in OSPF are flooded only within an area, theexception is the AS-external-LSA that can be flooded between all {\ttnormal} areas.OSPF routers are categorised into four overlapping categories, aninternal router whose interfaces are all in one area, an area borderrouter ({\tt ABR}) that has interfaces in more than one area, a backbone routerthat has an interface to the {\tt BACKBONE} and an AS boundary routerthat introduces routes from other protocols.An AS boundary router can be configured in {\tt normal} and {\ttNot-So-Stubby} areas. In a {\tt normal} area the AS boundary routergenerates an AS-external-LSA that is flooded to all other {\tt normal}areas. In a {\tt Not-So-Stubby} an AS boundary router generates aType-7 LSA that {\bf may} be translated at a area border router to anAS-external-LSA, which will be flooded to all {\tt normal} areas. AnAS-external-LSA is never flooded into a {\tt stub} or {\ttNot-So-Stubby} area. The different types of areas exist to limit thenumber of LSAs in a particular area, for example a {\tt stub} area mayhave a small number of internal routes and default routes to the{\tt ABR}s.\section{Standards}XORP OSPF complies with the following standards:\begin{description}\item{\bf RFC 2328}: OSPF Version 2\item{\bf draft-ietf-ospf-ospfv3-update-14.txt} OSPF for IPv6\item{\bf RFC 3101}: The OSPF Not-So-Stubby Area (NSSA) Option\end{description}\newpage\section{Configuring OSPF}\subsection{Configuration Syntax}The configuration syntax for XORP OSPFv2 is given below.\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\killprotocols \{\\\>ospf4 \{\\\>\>targetname: {\it text}\\\>\>router-id: {\it IPv4}\\\>\>rfc1583-compatibility: {\it bool};\>\>ip-router-alert: {\it bool}\\\\\>\>traceoptions \{\\\>\>\>flag \{\\\>\>\>\>all \{\\\>\>\>\>\>disable: {\it bool}\\\>\>\>\>\}\\\>\>\>\}\\\>\>\}\\\\\>\>area {\it IPv4} \{\\\>\>\>area-type: {\it text}\\\\\>\>\>default-lsa \{\\\>\>\>\>disable: {\it bool}\\\>\>\>\>metric: {\it uint(0..0xffffff)}\\\>\>\>\}\\\\\>\>\>summaries \{\\\>\>\>\>disable: {\it bool}\\\>\>\>\}\\\\\>\>\>area-range {\it IPv4Net} \{\\\>\>\>\>advertise: {\it bool}\\\>\>\>\}\\\\\>\>\>virtual-link {\it IPv4} \{\\\>\>\>\>transit-area: {\it ipv4}\\\>\>\>\>hello-interval: {\it uint(1..65535)}\\\>\>\>\>router-dead-interval: {\it uint(1..65535)}\\\>\>\>\>retransmit-interval: {\it uint(1..65535)}\\\>\>\>\>transit-delay: {\it uint(0..3600)}\\\>\>\>\>authentication \{\\\>\>\>\>\>simple-password: {\it text}\\\\\>\>\>\>\>md5 {\it uint(0..255)} \{\\\>\>\>\>\>\>password: {\it text}\\\>\>\>\>\>\>start-time: {\it text(``YYYY-MM-DD.HH:MM'')}\\\>\>\>\>\>\>end-time: {\it text(``YYYY-MM-DD.HH:MM'')}\\\>\>\>\>\>\>max-time-drift: {\it uint(0..65535)}\\\>\>\>\>\>\}\\\>\>\>\>\}\\\>\>\>\}\\\\{\rm continued overleaf....}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\newpage\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill\>\>\>interface {\it text} \{\\\>\>\>\>link-type: {\it text}\\\\\>\>\>\>vif {\it text} \{\\\\\>\>\>\>\>address {\it IPv4} \{\\\>\>\>\>\>\>priority: {\it uint(0..255)}\\\>\>\>\>\>\>hello-interval: {\it uint(1..65535)}\\\>\>\>\>\>\>router-dead-interval: {\it uint(1..4294967295)}\\\>\>\>\>\>\>interface-cost: {\it uint(1..65535)}\\\>\>\>\>\>\>retransmit-interval: {\it uint(1..65535)}\\\>\>\>\>\>\>transit-delay: {\it uint(0..3600)}\\\>\>\>\>\>\>authentication \{\\\>\>\>\>\>\>\>simple-password: {\it text}\\\\\>\>\>\>\>\>\>md5 {\it uint(0..255)} \{\\\>\>\>\>\>\>\>\>password: {\it text}\\\>\>\>\>\>\>\>\>start-time: {\it text(``YYYY-MM-DD.HH:MM'')}\\\>\>\>\>\>\>\>\>end-time: {\it text(``YYYY-MM-DD.HH:MM'')}\\\>\>\>\>\>\>\>\>max-time-drift: {\it uint(0..65535)}\\\>\>\>\>\>\>\>\}\\\>\>\>\>\>\>\}\\\>\>\>\>\>\>passive: {\it text}\\\\\>\>\>\>\>\>neighbor {\it IPv4}\{\\\>\>\>\>\>\>\>router-id: {\it IPv4}\\\>\>\>\>\>\>\}\\\\\>\>\>\>\>\>disable: {\it bool}\\\>\>\>\>\>\}\\\>\>\>\>\}\\\>\>\>\}\\\>\>\}\\\\\>\>import: {\it text} \\\>\>export: {\it text}\\\>\}\\\}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\newpageThe configuration syntax for XORP OSPFv3 is given below.\vspace{0.1in}\noindent\framebox[\textwidth][l]{\scriptsize\begin{minipage}{6in}\begin{alltt}\begin{tabbing}xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\killprotocols \{\\\>ospf6 \{\\\>\>targetname: {\it text}\\\>\>router-id: {\it IPv4}\\\>\>ip-router-alert: {\it bool}\\\\\>\>traceoptions \{\\\>\>\>flag \{\\\>\>\>\>all \{\\\>\>\>\>\>disable: {\it bool}\\\>\>\>\>\}\\\>\>\>\}\\\>\>\}\\\\\>\>area {\it IPv4} \{\\\>\>\>area-type: {\it text}\\\\\>\>\>default-lsa \{\\\>\>\>\>disable: {\it bool}\\\>\>\>\>metric: {\it uint(0..0xffffff)}\\\>\>\>\}\\\\\>\>\>summaries \{\\\>\>\>\>disable: {\it bool}\\\>\>\>\}\\\>\>\>area-range {\it IPv6Net} \{\\\>\>\>\>advertise: {\it bool}\\\>\>\>\}\\\>\>\>virtual-link {\it IPv4} \{\\\>\>\>\>transit-area: {\it ipv4}\\\>\>\>\>hello-interval: {\it uint(1..65535)}\\\>\>\>\>router-dead-interval: {\it uint(1..65535)}\\\>\>\>\>retransmit-interval: {\it uint(1..65535)}\\\>\>\>\>transit-delay: {\it uint(0..3600)}\\\>\>\>\}\\\\%{\rm continued overleaf....}%\end{tabbing}%\end{alltt}%\end{minipage}%}%\vspace{0.1in}%\newpage%\vspace{0.1in}%\noindent\framebox[\textwidth][l]{\scriptsize%\begin{minipage}{6in}%\begin{alltt}%\begin{tabbing}%xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=xx\=\kill\>\>\>interface {\it text} \{\\\>\>\>\>link-type: {\it text}\\\\\>\>\>\>vif {\it text} \{\\\\\>\>\>\>\>address {\it IPv6} \{\\\>\>\>\>\>\>disable: {\it bool}\\\>\>\>\>\>\}\\\>\>\>\>\>priority: {\it uint(0..255)}\\\>\>\>\>\>hello-interval: {\it uint(1..65535)}\\\>\>\>\>\>router-dead-interval: {\it uint(1..4294967295)}\\\>\>\>\>\>interface-cost: {\it uint(1..65535)}\\\>\>\>\>\>retransmit-interval: {\it uint(1..65535)}\\\>\>\>\>\>transit-delay: {\it uint(0..3600)}\\\>\>\>\>\>passive: {\it text}\\\>\>\>\>\>neighbor {\it IPv4}\{\\\>\>\>\>\>\>router-id: {\it IPv4}\\\>\>\>\>\>\}\\\>\>\>\>\>disable: {\it bool}\\\>\>\>\>\>\}\\\>\>\>\>\}\\\>\>\>\}\\\>\>\}\\\\\>\>import: {\it text} \\\>\>export: {\it text}\\\>\}\\\}\end{tabbing}\end{alltt}\end{minipage}}\vspace{0.1in}\noindentThe OSPFv2 and OSPFv3 configurations are practically equivalent withthe following exceptions:\begin{itemize}\item OSPFv3 does not support authentication in the protocol itself.\item OSPFv2 supports a single address per interface/vif, therefore allparameters are set below the address node.\item OSPFv3 supports multiple addresses per interface/vif, thereforeparameters are set below the vif node.\item OSPFv3 does not require any addresses to be configured in whichcase it will advertise all global addresses configured on theinterface/vif. If any addresses are configured in OSPFv3 then onlythose addresses will be advertised. If it is required that noaddresses should be advertised then configuring an address anddisabling it, will stop any global addresses being advertised.\item OSPFv3 in release 1.4 requires that a link local address isconfigured on any interface/vif on which it is configured to run.\end{itemize}The configuration parameters are used as follows:\begin{description}\item{\tt protocols}: This delimits the configuration for all routing protocols in the XORP router configuration. It is mandatory that OSPF configuration is under the {\stt protocols} node in the configuration.\item{\tt ospf4}: This delimits the OSPFv2 configuration part of the XORP router configuration.\item{\tt ospf6}: This delimits the OSPFv3 configuration part of the XORP router configuration.\item{\tt targetname}: This is the name for this instance of OSPF. It defaults to ``{\stt ospfv2}'', and it is not recommended that this default is overridden under normal usage scenarios.\item{\tt router-id}: This is a unique IPv4 address within theAutonomous System. The smallest IP address of an interface belongingto the router is a good choice. The required format of the {\sttrouter-id} is a dotted-decimal IPv4 address.\item{\tt ip-router-alert}: This takes the value {\stt true} or {\sttfalse}. The default state is {\stt false}, if set to {\stt true} theIP router alert option will be placed in all transmitted packets.\item{\tt traceoptions}: This directive if present will enable all tracing.\item{\tt area}: This delimits an area in which multiple virtual linksand interfaces can be configured. The {\stt area} directive take anarea identifier parameter, which by convention is specified as adotted-decimal IPv4 address.\begin{description}\item{\tt area-type}: This is the type of the area, {\stt normal},{\stt stub} or {\stt nssa}.\item{\tt default-lsa}: This directive if present is affective for{\stt stub} or {\stt nssa} areas only. If the router is an Area BorderRouter, then a default-lsa will be introduced into this area.\begin{description}\item{\tt metric}: This is the metric in the default-lsa.\item{\tt disable}: This takes the value {\stt true} or {\sttfalse}. The default setting is {\stt false} it can be set to {\stttrue} to disable the sending of the default-lsa.\end{description}\end{description}\begin{description}\item{\tt summaries}: This directive if present is affective for{\stt stub} or {\stt nssa} areas only. If the router is an Area BorderRouter, then this option controls the introduction of Summary-LSAs intothe area.\begin{description}\item{\tt disable}: This takes the value {\stt true} or {\sttfalse}. The default setting is {\stt false} it can be set to {\stttrue} to disable the sending of Summary-LSAs.\end{description}\end{description}\begin{description}\item{\tt area-range}: If the router is an Area Border Router the IPv4network defines how to summarize this area into other areas.\begin{description}\item{\tt advertise}: This takes the value {\stt true} or {\sttfalse}. The default setting is {\stt true} it can be set to {\sttfalse} to disable the sending of Summary-LSAs. \end{description}\end{description}\begin{description}\item{\tt virtual-link}: This is the {\stt router-id} of the routerwith which a virtual link should be formed. Virtual links can only beconfigured in the {\stt BACKBONE} area. The format of the parameter isa dotted-decimal IPv4 address.\begin{description}\item{\tt transit-area}: This is the transit area through which thevirtual link is formed.\item{\tt hello-interval}: This is the time in seconds between sendinghello packets.\item{\tt router-dead-interval}: This is the time in seconds to wait before
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -