In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-01-26 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Database >
Share
Shulou(Shulou.com)06/01 Report--
I. Overview of OSPF
1. IGP (Interior Gateway Protocol), AS interior gateway routing protocol.
2. Link-state dynamic routing protocol.
3. IP protocol number 89.
4. Area. Area consists of some network range. Area 0 is the backbone area. Router link-state databases within the same area need to be synchronized.
5. Use packet in hello,Database Description,Link State Request,Link State Update,Link State Acknowledgment to discover and establish adjacency, exchange LSA (Link State Advertisement), and synchronize link-state database.
6. Use LSA in 5 to describe the topology in area, the routes of other area in AS, and the routes learned from external AS in AS: 1). Router links advertisements; 2). Network links advertisements; 3). ASBR-Summary link advertisements; 4). AS external link advertisements.
7. Use a link-state database to store LSA and use the SPF (Shortest Path First) algorithm. Taking itself as the root, the acyclic shortest path tree to the destination network is calculated.
II. OSPF Packet
2.1 OSPF message Public header
2.1.1 effect
Encapsulate OSPF packet, indicating the type, source, and source region of packet. It can also be authenticated.
2.1.2 Field description
Type: indicates the type of packet followed by header (1 Mutual Hellot2 Mutual Database Description;3-Link State Request;4-Link State Update;5-Link State Acknowledgment)
Router ID: the unique identification of the router in the area. The interface IP on the router is available.
Area ID: the area to which the router interface that sent the OSPF Packet belongs.
2.2 OSPF Hello Packet
Function: find neighbors, elect DR/BDR (multi-access network), and establish two-way communication relationship.
Field description:
Network Mask: the network mask of the sending interface.
HelloInt:Hello packet cycle delivery interval.
Options: an optional competency field, such as the E bit, is used to indicate whether the region receives AS External link advertisement.
Rtr Pri: Router Priority is used when electing DR/BDR.
DeadInt: the maximum waiting time before receiving a reply from the neighbor. After that, the neighbor Dead is regarded as the waiting time.
Designated Router: the designated router in the multi-access network considered by this router
Backup Designated Router: the backup designated router in the multi-access network considered by this router.
Neighbor: recently received hello packet Router ID (sending router). If you see your own router ID in the received hello packet, you will enter a two-way communication (2-way) state with the sending router of hello packet.
2.3 OSPF Database Description Packet
Function: exchange LSA information in the link-state database. Compare and find that you don't have or are newer than your own stored LSA.
Field description:
Option: the effect is the same as that in Hello.
I/M/MS:I (Init bit, set to 1 means the first DBD,M sent (More bit, means followed by DBD), MS (Master/Slave, set 1 means Master, only 1 master, and the other is slave. During the DBD exchange, Master first sends the DBD packet containing LSA header information, uses a DD sequence number,slave to reply to the DBD packet, and uses the same DD sequence number to confirm the DBD sent by Master while passing LSA. In order to achieve reliable information exchange)
Link State Advertisement Header: the header,header of the LSA packet contains enough information to uniquely confirm an instance of SLA. LSA Header will introduce the following
2.4 OSPF Link State Request
Function: ask neighbors for LSA that they do not have in their database or that are newer than themselves.
Field description:
The LS type:LS type is LSA as described earlier in 5.
Link State ID: the Link State ID field content contained in the LSA header of the corresponding LS type. Its specific value will be introduced later when introducing LSA Header.
Advertisiong Router: the Router that advertises the requested LSA.
The above three fields uniquely confirm the LSA to be requested.
2.5 OSPF Link State Update
Function: send the requested LSA (unicast) to the neighbors, flood the LSA on the network (multicast, send a new LSA when there is a change in the network), and the Upadate packet sent requires neighbor to use Ackownledged packet for confirmation. If you do not receive a confirmation from neighbor, retransmit the changed neighbor unicast to ensure that their database information is synchronized.
Field description:
# advertisements: the number of LSA included.
Link state advertisements: the complete LSA packet.
2.6 OSPF Link State Acknowledgment
Function: confirm the received Update packet. Field description:
# A Link State Advertisement Header: the header of the LSA contained in the received Update packet is sent back to indicate that the specific LSA has been received.
III. OSPF LSA encapsulation
The OSPF packet in 5 described above is used to establish and maintain neighbor relationships and to exchange and keep link-state databases synchronized. It exchanges and stores exactly the LSA in 5 that will be described below.
1 、 Router links
2 、 Network links
3. Summary link (IP network)
4. Summary link (ASBR)
5 、 AS external link
By introducing the contents of different LSA packages, this paper describes how OSPF uses LSA to describe the topology of area and the network segments contained in area. And learn the routing outside area and AS through LSA.
3.1 OSPF LSA Common Header
Function: through LS type,Link State ID,Advertising Router, to uniquely confirm a LSA, and through LS age,LS sequence number to uniquely confirm the latest instance of the LSA.
Field description:
The time since LS age:LSA was generated.
Options: optional capability support, same as Hello.
LS type: the type of LSA that follows under the head (1-Router links;2-Network links;3-Summary links (IP network); 4-Summary link (ASBR); 5-AS external link)
Link State ID: indicates the network environment (internet environment) described by the LSA. There are different values according to different LS type. The value of Router links is router's OSPF Router ID; Network links and the value is IP interface address.
The value of of the Designated Router;Summary link (3) is IP network number;Summary link (4), the value is ASBR's Router ID;AS external link and the value is IP network number.
Advertising Router: generate the router's router ID changed to LSA.
The LS sequence number:LSA serial number is used to detect old or double pupil LSA.
LS checksum: a check value for the entire LSA.
Length of the length:LSA, including the head.
3.2 Router link advertisement
Purpose: describe the state and cost of the interface (or link) belonging to the corresponding area on the router. All the link of the Router belonging to an area must be contained in a Router links advertisement. Each router in area is generated. Its link State ID is the Router ID of the router that generated the LSA.
Field description:
E router B: e indicates whether router is ASBR,B or ABR.
# links: change the number of LINK included in LSA.
The type of Type:link is 1 house point to house house 2 houses network;3-stub network;4-Virtual link.
Link ID: the object that defines the link connection. For different link type, the value is Neighboring router's ID;Transit-network, the value is IP address of Designated Router;Stub-network, the value is IP network/sunet number;Virtrual Link, and the value is Neighboring router's ID.
Link Data: its value is also determined according to the link type: the value of Stub-network is the network mask; of other types, and the value is the IP address of the router associated interface.
TOS 0 metric: the metric value of TOS (the service type defined by Type of Service in IP) 0. Also known as cost.
3.3 Network link advertisement
Purpose: generated by the Designated Router of transit-network (multi-access network), describing all router connected to that multi-access network. Its Link State ID is DR's interface ip.
Field description:
The network mask of the Network Mast:transit-network.
Attached Router: attach (connect) the router-id of the router to the multi-access network, including Designated Router's own router ID.
3.4 Summary link advertisement
Function: generated by ABR (Area Border Router), a Summary links advertisement can only contain one destination route that belongs to this AS but is outside the area. The Link State ID in its lsa header is the destination route (IP network number) it wants to announce.
Field description:
The network mask of IP network number in Network Mast:Link State ID. The IP network number+ Network Mask forms a specific destination network for the route passed by the LSA.
TOS/metric: this route is specific to the metricvalue of different TOS.
TYPE-4
Purpose: the ABR generates the location of the ASBR (Autonomous System Boundary Router) that tells the router in the area to advertise the AS external link advertisements. The value of Link State ID in its LSA header is Router ID of ASBR.
Field description:
Network Mask: in this type of SLA, this field has no meaning and must be set to 0. 0.
3.5 AS External Link advertisement
Function: generated by ASBR, an AS external links advertisement can only contain one destination route outside this AS. The Link State ID in its lsa header is the destination route (IP network number) it wants to announce.
Field description:
The network mask of IP network number in Network Mast:Link State ID. The IP network number+ Network Mask forms a specific destination network for the route passed by the LSA.
E:externel metric type. Set 1 means Type2 external metric (only the external initial cost is used, rerouting to pass its metric within the AS does not increase with the internal path cost). Setting 0 means Type 1 external metric (meaning that the metric of the route increases as the internal path cost increases)
TOS/metric: this route is specific to the metricvalue of different TOS.
Forwarding address: third-party forwarding address. The packet should be sent to this address for further forwarding, not to the ASBR. If the address is changed to 0.0.0.0, the packet is routed to the ASBR and then forwarded in the next step.
Fourth, the working principle of OSPF
How OSPF uses LSA in 5 to build area topologies and learn routing:
In fact, a network is made up of points (routers and stub network attached to routes) and lines (link/network).
OSPF Router learns the following information through Router LSA: 1) identify a router (Router ID); 2) stub network on router such as interface vlan,loopback interface;3), Router ID of Router connected to point-to-point link network segment.
OSPF Router learns the Router attached to multi-access network through Network LSA.
After the LSDB of all OSPF Router in the same area is synchronized, Router can calculate a completed topology diagram of the router connection in the area. For the route to the destination network within the area, the OSPF Router calculates the shortest path to the destination network based on the cost of different links.
Destination network routes outside the area but inside the AS, and routers in the area learn through summary LSA advertised by ABR (ABR is the exit of an AREA)
Routes outside the AS are learned by routers inside the AS through the AS external LSA advertised by ASBR. ASBR is an exit for AS.
Welcome to subscribe "Shulou Technology Information " to get latest news, interesting things and hot topics in the IT industry, and controls the hottest and latest Internet news, technology news and IT industry trends.
Views: 231
*The comments in the above article only represent the author's personal views and do not represent the views and positions of this website. If you have more insights, please feel free to contribute and share.
Continue with the installation of the previous hadoop.First, install zookooper1. Decompress zookoope
"Every 5-10 years, there's a rare product, a really special, very unusual product that's the most un
© 2024 shulou.com SLNews company. All rights reserved.