📄 rfc1247.txt
字号:
[Moy] [Page 23]RFC 1247 OSPF Version 2 July 19914. Functional SummaryA separate copy of OSPF's basic routing algorithm runs in each area.Routers having interfaces to multiple areas run multiple copies of thealgorithm. A brief summary of the routing algorithm follows.When a router starts, it first initializes the routing protocol datastructures. The router then waits for indications from the lower-levelprotocols that its interfaces are functional.A router then uses the OSPF's Hello Protocol to acquire neighbors. Therouter sends Hello packets to its neighbors, and in turn receives theirHello packets. On broadcast and point-to-point networks, the routerdynamically detects its neighboring routers by sending its Hello packetsto the multicast address AllSPFRouters. On non-broadcast networks, someconfiguration information is necessary in order to discover neighbors.On all multi-access networks (broadcast or non-broadcast), the HelloProtocol also elects a Designated router for the network.The router will attempt to form adjacencies with some of its newlyacquired neighbors. Topological databases are synchronized betweenpairs of adjacent routers. On multi-access networks, the DesignatedRouter determines which routers should become adjacent.Adjacencies control the distribution of routing protocol packets.Routing protocol packets are sent and received only on adjacencies. Inparticular, distribution of topological database updates proceeds alongadjacencies.A router periodically advertises its state, which is also called linkstate. Link state is also advertised when a router's state changes. Arouter's adjacencies are reflected in the contents of its link stateadvertisements. This relationship between adjacencies and link stateallows the protocol to detect dead routers in a timely fashion.Link state advertisements are flooded throughout the area. The floodingalgorithm is reliable, ensuring that all routers in an area have exactlythe same topological database. This database consists of the collectionof link state advertisements received from each router belonging to thearea. From this database each router calculates a shortest-path tree,with itself as root. This shortest-path tree in turn yields a routingtable for the protocol.4.1 Inter-area routingThe previous section described the operation of the protocol within asingle area. For intra-area routing, no other routing information is[Moy] [Page 24]RFC 1247 OSPF Version 2 July 1991pertinent. In order to be able to route to destinations outside of thearea, the area border routers inject additional routing information intothe area. This additional information is a distillation of the rest ofthe Autonomous System's topology.This distillation is accomplished as follows: Each area border router isby definition connected to the backbone. Each area border routersummarizes the topology of its attached areas for transmission on thebackbone, and hence to all other area border routers. A area borderrouter then has complete topological information concerning thebackbone, and the area summaries from each of the other area borderrouters. From this information, the router calculates paths to alldestinations not contained in its attached areas. The router thenadvertises these paths to its attached areas. This enables the area'sinternal routers to pick the best exit router when forwarding traffic todestinations in other areas.4.2 AS external routesRouters that have information regarding other Autonomous Systems canflood this information throughout the AS. This external routinginformation is distributed verbatim to every participating router.There is one exception: external routing information is not flooded into"stub" areas (see Section 3.6).To utilize external routing information, the path to all routersadvertising external information must be known throughout the AS(excepting the stub areas). For that reason, the locations of these ASboundary routers are summarized by the (non-stub) area border routers.4.3 Routing protocol packetsThe OSPF protocol runs directly over IP, using IP protocol 89. OSPFdoes not provide any explicit fragmentation/reassembly support. Whenfragmentation is necessary, IP fragmentation/reassembly is used. OSPFprotocol packets have been designed so that large protocol packets cangenerally be split into several smaller protocol packets. This practiceis recommended; IP fragmentation should be avoided whenever possible.Routing protocol packets should always be sent with the IP TOS field setto 0. If at all possible, routing protocol packets should be givenpreference over regular IP data traffic, both when being sent andreceived. As an aid to accomplishing this, OSPF protocol packets shouldhave their IP precedence field set to the value Internetwork Control(see [RFC 791]).[Moy] [Page 25]RFC 1247 OSPF Version 2 July 1991All OSPF protocol packets share a common protocol header that isdescribed in Appendix A. The OSPF packet types are listed below inTable 8. Their formats are also described in Appendix A. Type Packet name Protocol function __________________________________________________________ 1 Hello Discover/maintain neighbors 2 Database Description Summarize database contents 3 Link State Request Database download 4 Link State Update Database update 5 Link State Ack Flooding acknowledgment Table 8: OSPF packet types.OSPF's Hello protocol uses Hello packets to discover and maintainneighbor relationships. The Database Description and Link State Requestpackets are used in the forming of adjacencies. OSPF's reliable updatemechanism is implemented by the Link State Update and Link StateAcknowledgment packets.Each Link State Update packet carries a set of new link stateadvertisements one hop further away from their point of origination. Asingle Link State Update packet may contain the link stateadvertisements of several routers. Each advertisement is tagged withthe ID of the originating router and a checksum of its link statecontents. The five different types of OSPF link state advertisementsare listed below in Table 9.LS Advertisement Advertisement descriptiontype name____________________________________________________________________________1 Router links advs. Originated by all routers. This advs. advertisement describes the collected states of the router's interfaces to an area. Flooded throughout a single area only.____________________________________________________________________________2 Network links Originated for multi-access networks by advs. the Designated Router. This advertisement contains the list of routers connected to the network. Flooded throughout a single area only.[Moy] [Page 26]RFC 1247 OSPF Version 2 July 1991LS Advertisement Advertisement descriptiontype name________________________________________________________________________________________________________________________________________________________3,4 Summary link Originated by area border routers, and advs. flooded throughout their associated area. Each summary link advertisement describes a route to a destination outside the area, yet still inside the AS (i.e., an inter-area route). Type 3 advertisements describe routes to networks. Type 4 advertisements describe routes to AS boundary routers.____________________________________________________________________________5 AS external Originated by AS boundary routers, and link advs. flooded throughout the AS. Each external advertisement describes a route to a destination in another Autonomous System. Default routes for the AS can also be described by AS external advertisements. Table 9: OSPF link state advertisements.As mentioned above, OSPF routing packets (with the exception of Hellos)are sent only over adjacencies. Note that this means that all protocolpackets travel a single IP hop, except those that are sent over virtualadjacencies. The IP source address of an OSPF protocol packet is oneend of a router adjacency, and the IP destination address is either theother end of the adjacency or an IP multicast address.4.4 Basic implementation requirementsAn implementation of OSPF requires the following pieces of systemsupport:Timers Two different kind of timers are required. The first kind, called single shot timers, fire once and cause a protocol event to be processed. The second kind, called interval timers, fire at continuous intervals. These are used for the sending of packets at regular intervals. A good example of this is the regular broadcast of Hello packets (on broadcast networks). The granularity of both kinds of timers is one second. Interval timers should be implemented to avoid drift. In some[Moy] [Page 27]RFC 1247 OSPF Version 2 July 1991 router implementations, packet processing can affect timer execution. When multiple routers are attached to a single network, all doing broadcasts, this can lead to the synchronization of routing packets (which should be avoided). If timers cannot be implemented to avoid drift, small random amounts should be added to/subtracted from the timer interval at each firing.IP multicast Certain OSPF packets use IP multicast. Support for receiving and sending IP multicasts, along with the appropriate lower-level protocol support, is required. These IP multicast packets never travel more than one hop. For information on IP multicast, see [RFC 1112].Lower-level protocol support The lower level protocols referred to here are the network access protocols, such as the Ethernet data link layer. Indications must be passed from from these protocols to OSPF as the network interface goes up and down. For example, on an ethernet it would be valuable to know when the ethernet transceiver cable becomes unplugged.Non-broadcast lower-level protocol support Remember that non-broadcast networks are multi-access networks such as a X.25 PDN. On these networks, the Hello Protocol can be aided by providing an indication to OSPF when an attempt is made to send a packet to a dead or non-existent router. For example, on a PDN a dead router may be indicated by the reception of a X.25 clear with an appropriate cause and diagnostic, and this information would be passed to OSPF.List manipulation primitives Much of the OSPF functionality is described in terms of its operation on lists of link state advertisements. For example, the advertisements that will be retransmitted to an adjacent router until acknowledged are described as a list. Any particular advertisement may be on many such lists. An OSPF implementation needs to be able to manipulate these lists, adding and deleting constituent advertisements as necessary.Tasking support Certain procedures described in this specification invoke other procedures. At times, these other procedures should be executed in-line, that is, before the current procedure is finished. This is indicated in the text by instructions to execute a procedure. At other times, the other procedures are to be executed only when the current procedure has finished. This is indicated by instructions to schedule a task.[Moy] [Page 28]RFC 1247 OSPF Version 2
⌨️ 快捷键说明
复制代码
Ctrl + C
搜索代码
Ctrl + F
全屏模式
F11
切换主题
Ctrl + Shift + D
显示快捷键
?
增大字号
Ctrl + =
减小字号
Ctrl + -