Common Packet Header
Version (1 octet) This field details the current version of OSPF used by the local router. It is set to a value of 2, the default value.
Type (1 octet) This field specifies the type of OSPF packet. Possible values include:
- 1—Hello packet
- 2—Database descriptor
- 3—Link-state request
- 4—Link-state update
- 5—Link-state acknowledgment
Packet Length (2 octets) This field displays the total length, in octets, of the OSPF packet.
Router ID (4 octets) The router ID of the advertising router appears in this field.
Area ID (4 octets) This field contains the 32-bit area ID assigned to the interface used to send the OSPF packet.
Checksum (2 octets) This field displays a standard IP checksum for the entire OSPF packet, excluding the 64-bit authentication field.
Authentication Type (2 octets) The specific type of authentication used by OSPF is encoded in this field. Possible values are:
- 0—Null authentication
- 1—Simple password
- 2—MD5 cryptographic authentication
Authentication (8 octets) This field displays the authentication data to verify the packet’s integrity.
Hello Packet
The hello packet, type code 1, is addressed to the AllSPFRouters multicast address of 224.0.0.5 for broadcast and point-to-point connections. Other connection types unicast the hello packet to their neighbor.
Network Mask (4 octets) This field contains the subnet mask of the advertising OSPF interface. Unnumbered point-to-point interfaces and virtual links set this value to 0.0.0.0.
Hello Interval (2 octets) This field displays the value of the hello interval requested by the advertising router. Possible values range from 1 to 255, with a default value of 10 seconds.
Options (1 octet) The local router advertises its capabilities in this field. Each bit in the Options field represents a different function. The various bit definitions are:
- Bit 7 The DN bit is used for loop prevention in a Virtual Private Network (VPN) environment. An OSPF router receiving an update with the bit set does not forward that update.
- Bit 6 The O bit indicates that the local router supports opaque LSAs.
- Bit 5 The DC bit indicates that the local router supports Demand Circuits. The JUNOS software does not use this feature.
- Bit 4 The EA bit indicates that the local router supports the External Attributes LSA for carrying BGP information in an OSPF network. The JUNOS software does not use this feature.
- Bit 3 The N/P bit describes the handling and support of not-so-stubby LSAs.
- Bit 2 The MC bit indicates that the local router supports multicast OSPF LSAs. The JUNOS software does not use this feature.
- Bit 1 The E bit describes the handling and support of external LSAs.
- Bit 0 The T bit indicates that the local router supports TOS routing functionality. The JUNOS software does not use this feature.
Router Dead Interval (4 octets) This field shows the value of the dead interval requested by the advertising router. Possible values range from 1 to 65,535. The JUNOS software uses a default value of 40 seconds.
Designated Router (4 octets) The interface address of the current designated router is displayed in this field. A value of 0.0.0.0 is used when no designated router has been elected.
Backup Designated Router (4 octets) The interface address of the current backup designated router is displayed in this field. A value of 0.0.0.0 is used when no backup designated router has been elected.
Neighbor (Variable) This field displays the router ID of all OSPF routers for which a hello packet has been received on the network segment.
Database Description Packet
Interface MTU (2 octets) This field contains the MTU value, in octets, of the outgoing interface.
When the interface is used on a virtual link, the field is set to a value of 0x0000.
Options (1 octet) The local router advertises its capabilities in this field. The bit values are discussed in the “Hello Packet” section earlier in this chapter.
Flags (1 octet) This field provides an OSPF router with the capability to exchange multiple DD packets with a neighbor during an adjacency formation. The flag definitions include the following:
- Bits 3 through 7 These bit values are currently undefined and must be set to a value of 0.
- Bit 2 The I bit, or Initial bit, designates whether this DD packet is the first in a series of packets. The first packet has a value of 1, while subsequent packets have a value of 0.
- Bit 1 The M bit, or More bit, informs the remote router whether the DD packet is the last in a series. The last packet has a value of 0, while previous packets have a value of 1.
- Bit 0 The MS bit, or Master/Slave bit, is used to indicate which OSPF router is in control of the database synchronization process. The master router uses a value of 1, while the slave uses a value of 0.
DD Sequence Number (4 octets) This field guarantees that all DD packets are received and processed during the synchronization process through use of a sequence number. The Master router initializes this field to a unique value in the first DD packet, with each subsequent packet being incremented by 1.
LSA Headers (Variable) This field carries the LSA headers describing the local router’s database information. Each header is 20 octets in length and uniquely identifies each LSA in the database. Each DD packet may contain multiple LSA headers.
Link-State Request Packet
Link-State Type (4 octets) This field displays the type of LSA being requested. The possible type codes include:
1—Router LSA
2—Network LSA
3—Network summary LSA
4—ASBR summary LSA
5—AS external LSA
6—Group membership LSA
7—NSSA external LSA
8—External attributes LSA
9—Opaque LSA (link-local scope)
10—Opaque LSA (area scope)
11—Opaque LSA (AS scope)
Link-State ID (4 octets) This field encodes information specific to the LSA. Each different type of advertisement places different information here.
Advertising Router (4 octets) The router ID of the OSPF router that first originated the LSA is encoded in this field.
Link-State Update Packet
Number of LSAs (4 octets) This field displays the number of LSAs carried within the linkstate update packet.
Link-State Advertisements (Variable) The complete LSA is encoded within this variable-length field. Each type of LSA has a common header format along with specific data fields to describe its information. A link-state update may contain a single LSA or multiple LSAs.
Link-State Acknowledgment Packet
Forming Adjacencies
Adjacency States
Down Down is the starting state for all OSPF routers. A start event, such as configuring the protocol, transitions the router to the Init state. The local router may list a neighbor in this state when no hello packets have been received within the specified router dead interval for that interface.
Init The Init state is reached when an OSPF router receives a hello packet but the local router ID is not listed in the received Neighbor field. This means that bidirectional communication has not been established between the peers.
Attempt The Attempt state is valid only for Non-Broadcast Multi-Access (NBMA) networks. It means that a hello packet has not been received from the neighbor and the local router is going to send a Unicast hello packet to that neighbor within the specified hello interval period.
2-Way The 2-Way state indicates that the local router has received a hello packet with its own router ID in the Neighbor field. Thus, bidirectional communication has been established and the peers are now OSPF neighbors.
ExStart In the ExStart state, the local router and its neighbor establish which router is in charge of the database synchronization process. The higher router ID of the two neighbors controls which router becomes the master.
Exchange In the Exchange state, the local router and its neighbor exchange DD packets that describe their local databases.
Loading Should the local router require complete LSA information from its neighbor, it transitions to the Loading state and begins to send link-state request packets.
Full The Full state represents a fully functional OSPF adjacency, with the local router having received a complete link-state database from its peer. Both neighboring routers in this state add the adjacency to their local database and advertise the relationship in a link-state update packet.
1. Chardonnay initiates the conversation by sending a hello packet to Shiraz using the 224.0.0.5 multicast address. The DR and BDR fields are set to 0.0.0.0 and the Neighbor field is empty because Chardonnay has yet to receive any OSPF packets from Shiraz.
2. Shiraz transitions to the Init state (bidirectional communication has not been established) and responds to Chardonnay with a hello packet. Shiraz lists the router ID of Chardonnay, 192.168.1.1, in the Neighbor field of the packet and sets the DR and BDR fields to 0.0.0.0.
3. Chardonnay briefly transitions to the 2-Way state (bidirectional communication has been established), but quickly moves to the ExStart state. Chardonnay and Shiraz are now OSPF neighbors. At this point, Chardonnay sends a DD packet to Shiraz. The flags of the DD packet are set to negotiate the Master/Slave relationship to determine which router controls the synchronization process. The I bit, the M bit, and the MS bit are all set to 1; Chardonnay is starting the conversation, has more information to send, and is going to control the conversation. In addition, a sequence number (x) is chosen to identify the DD packets in this conversation.
4. Shiraz has a higher router ID (192.168.2.2) than Chardonnay and should be the Master for the process. It therefore responds with its own DD packet using a different sequence number (a). Shiraz also sets the I, M, and MS bits to 1 to designate its role in the synchronization process.
5. Chardonnay recognizes Shiraz’s higher router ID and role as the Master by generating a new DD packet containing the sequence number advertised by Shiraz (a) and having both the MS and I bits set to 0. At this time, Chardonnay transitions to the Exchange state.
6. Having completed the Master/Slave negotiation process, Shiraz also transitions to the Exchange state and begins sending DD packets with higher sequence numbers that contain the database information.
7. Chardonnay acknowledges the receipt of all DD packets by sending its own DD packets with the same sequence number. These new DD packets contain the information in Chardonnay’s link-state database. As each router receives a DD packet, it notes which LSA headers in the received packet are not in its own local database. This header information is contained in a memory structure called the link-state request list.
8. Shiraz receives a DD packet with the M bit set to 0, which indicates that Chardonnay has sent all of the information in its database. Shiraz examines its link-state request list and finds no entries. It then transitions to the Full state and continues sending DD packets to Chardonnay.
9. Chardonnay continues to advertise DD packets with the M bit set to 0 to Shiraz as acknowledgments. This indicates that it is still receiving DD packets from Shiraz and potentially adding information to its link-state request list. When Shiraz finally sends a DD packet with the M bit set to 0, Chardonnay examines its request list and finds multiple headers for which it needs information.
10. Chardonnay transitions to the Loading state and begins requesting its missing data structures using link-state request packets. It receives the needed information from Shiraz in the form of a link-state update packet. This process continues until Chardonnay has emptied the link-state request list, at which point it transitions to the Full state.
LSA Types
Type 1 LSA
Type 1 LSA — Router LSA — объявление о состоянии каналов маршрутизатора. Эти LSA распространяются всеми маршрутизаторами. Распространяются только в пределах одной зоны.
В Router LSA содержится:
- описание всех каналов маршрутизатора
- стоимость (cost) каждого канала
- список соседей на каждом интерфейсе (в зоне маршрутизатора)
LSA Type 1 link types и соответствующие link ID:
- Point-to-point соединение с другим маршрутизатором — Router ID соседа
- Соединение с транзитной сетью (сеть, в которой есть как минимум два непосредственно присоединенных маршрутизатора) — IP-адрес DR
- Соединение с тупиковой сетью (сеть, к которой присоединен только один маршрутизатор) — номер сети/подсети
- Virtual link — Router ID соседа
Type 2 LSA
Type 2 LSA — Network LSA — объявление о состоянии каналов сети. Распространяется DR в сетях со множественным доступом. Network LSA не создается для сетей в которых не выбирается DR. Распространяются только в пределах одной зоны.
В LSA содержится описание всех маршрутизаторов присоединенных к сети, включая DR.
Link-state ID — IP-адрес интерфейса DR.
Type 3 LSA
Type 3 LSA — Network Summary LSA — суммарное объявление о состоянии каналов сети. Объявление распространяется пограничными маршрутизаторами. Объявление описывает только маршруты к сетям вне зоны и не описывает маршруты внутри автономной системы. Маршрутизатор отправляет информацию о сетях и о стоимости пути к этим сетям, но не отправляет информацию о топологии сети. Пограничный маршрутизатор отправляет отдельное объявление для каждой известной ему сети.
Link-state ID — номер сети назначения.
Когда маршрутизатор получает Network Summary LSA от пограничного маршрутизатора он не запускает алгоритм вычисления кратчайшего пути. Маршрутизатор просто добавляет к стоимости маршрута указанного в LSA стоимость маршрута к пограничному маршрутизатору. Затем маршрут к сети через пограничный маршрутизатор помещается в таблицу маршрутизации.
Type 4 LSA
Type 4 LSA — ASBR Summary LSA — суммарное объявление о состоянии каналов пограничного маршрутизатора автономной системы.
Объявление распространяется пограничными маршрутизаторами (ABR). ASBR Summary LSA отличается от Network Summary LSA тем, что распространяется информация не о сети, а о пограничном маршрутизаторе автономной системы.
Link-state ID — Router ID ASBR, информацию о котором отправляет LSA.
Type 5 LSA
Type 5 LSA — AS External LSA — объявления о состоянии внешних каналов автономной системы. Объявление распространяется пограничным маршрутизатором автономной системы в пределах всей автономной системы.
Объявление описывает маршруты внешние для автономной системы OSPF или маршруты по умолчанию (default route) внешние для автономной системы OSPF.
Link-state ID — номер внешней сети.
Type 7 LSA
Комментариев нет:
Отправить комментарий