In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-04-05 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Development >
Share
Shulou(Shulou.com)06/01 Report--
OSPF open shortest path first protocol is one of the most widely used routing protocols in the network. It belongs to the interior gateway routing protocol, which can adapt to the network environment of various sizes, and is a typical link-state protocol.
Experimental purpose
To master the configuration method of OSPF protocol, to view the routing generated by learning the dynamic routing protocol OSPF, to be familiar with the link mode of WAN cable.
Experimental background
Suppose the campus network is connected to the campus network exit router through a layer 3 switch, and the router is connected to another router outside the campus. Now it is necessary to make proper configuration to realize the communication between the internal host of the campus network and the external host of the campus network. In order to simplify the management and maintenance of network management, the school decided to use OSPF protocol to achieve interoperability.
Technical principle
OSPF (Open Shortest Path First) open shortest path first protocol is one of the most widely used routing protocols in the network. It belongs to the interior gateway routing protocol, which can adapt to the network environment of various sizes, and is a typical link-state protocol. By spreading the link state information of the equipment to the whole network, the OSPF routing protocol makes each device in the network finally synchronize a database with the link state of the whole network, and then the router uses the SPF algorithm to calculate the shortest path to other networks, and finally forms the routing information of the whole network.
OSPF (Open Shortest Path First) is an interior gateway protocol (Interior Gateway Protocol, referred to as IGP). In contrast to RIP, OSPF is a link-state routing protocol, while RIP is a distance vector routing protocol. A link is another term for a router interface, so OSPF is also called an interface-state routing protocol. OSPF establishes a link-state database by advertising the status of network interfaces between routers to generate the shortest path tree, which is used by each OSPF router to construct a routing table.
Basic concepts and terminology
Link statu
The OSPF router collects the connection state information of each router in its network area, namely link-state information (Link-State), and generates a link-state database (Link-State Database). The router has the link-state information of all the routers in the area, which is equivalent to knowing the topology of the entire network. The OSPF router uses the shortest path first algorithm (Shortest Path First, SPF) to independently calculate the route to any destination.
Region
Each area is like a separate network, and the OSPF router in that area holds only the link state of that area. The link-state database of each router can maintain a reasonable size, and the time of routing calculation and the number of messages will not be too large.
The main difference between the five areas is their relationship to the external router:
Standard area: a standard area can receive link update information and route summaries.
Backbone area (transfer area): the backbone area is the central entity that connects each area. The backbone area is always "area 0", and all other areas are connected to this area to exchange routing information. The backbone area has all the properties of the standard area.
Stub area (stub Area): a stub area is an area that does not accept routing information outside the autonomous system. If a route other than the autonomous system is required, it uses the default route of 0.0.0.0.
Full stub area: it does not accept routes from external autonomous systems and route summarization from other areas within the autonomous system. Messages that need to be sent outside the area use the default route: 0.0.0.0. The full stub area is defined by Cisco itself.
Incomplete stub area (NSAA): it is similar to a stub area, but allows you to receive external routing information sent as LSA Type 7, and to convert LSA Type 7 to LSA Type 5.
Metric cost (link cost)
The OSPF metric cost (link cost) is calculated based on the link bandwidth. It is basically inversely proportional to the link bandwidth. In other words, the larger the bandwidth, the smaller the cost, and the better the link. The calculation formula is as follows: interface cost = reference bandwidth / logical bandwidth (logical bandwidth is usually the same as physical interface bandwidth) OSPF first calculates the cost of each segment of the link separately, and then calculates the network cost from the current node to any destination address, that is, the accumulation of multiple links. The path with the least cost to reach the target network is selected as the best path. The ospf interface cost has a default reference value, that is, the interface bandwidth defaults to 100Mbps. If the actual bandwidth value is 10m, then the cost=100/10=10 of the interface, if the actual bandwidth of the interface is 100Mpbs, then the interface cost is cost=100/100=1. But now that the network has entered the 1000m era, there will be 100m and 1000m bandwidth with the same cost of 1 in ospf. Therefore, if the interface bandwidth value is high in practical application, the reference bandwidth value of the port should be reconfigured.
O 192.168.4.0 Vlan20 24 [110 Vlan20 65] 192.168.3.2, 00:01:00, O routing protocol code: O stands for RIP,S stands for static, when using the show command, there is a description at the top. 192.168.4.0amp 24 is the mask of the target network and the target network [110amp 65] to represent the administrative distance and the metric, respectively.
Administrative distance
Is to compare the advantages and disadvantages of the algorithm through the administrative distance. The smaller the value of the administrative distance, the router thinks that the better the algorithm of the protocol is, the more accurate the calculation result is, and gives priority to the results of the protocol.
The administrative distances of common routing protocols are: directly connected routes 0 static routes 1 EIGRP summary route 5 EBGP 20 EIGRP 90 IGRP 100 OSPF 110 IS-IS 115 RIP (v1&v2) 120 EGP 140 ODR 160 ExEIGRP (external EIGRP) 170 IBGP 200 unknown 255
Metric is a parameter used to measure the advantages and disadvantages of the same routing protocol in calculating multiple paths to the same destination address. The smallest metric is recorded in the routing table. For example, OSPF calculates that there are three paths to the 192.168.4.0 Universe 24 network. The cost values of the three paths are 145,230 and 99 respectively. After comparison, it is found that the metric value of 99 is the smallest and will be considered as the best path and will be added to the routing table. The reference factors commonly used as metrics are: hop count, bandwidth, delay, reliability, load, MTU and so on. Different routing protocols use different parameters as metrics, some are one, some are multiple. For example, RIP uses hop count as a metric. EIGRP uses both bandwidth and delay by default, and a maximum of five can be used. OSPF uses cost (cost) as a metric, and cost is related to the port bandwidth, which is basically inversely proportional to the port bandwidth, that is, the greater the port bandwidth, the lower the cost, and the better the link. Via 192.168.3.2 indicates the next hop address. That is, to get to the 192.168.4.0 network, you must first reach 192.168.3.2. In addition, via can also be understood as: update the source, that is, who the routing message is from. 00:01:00 when the message was updated. Vlan20 outgoing interface, indicating that data should be sent out of its own interface when reaching the destination network.
Five essentials of routing table
Destination address destination netmask priority (metric and administrative distance) next-hop address out of interface * *
Experimental procedure
Create a new packet tracer topology diagram
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: 268
*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.