Network Security Internet Technology Development Database Servers Mobile Phone Android Software Apple Software Computer Software News IT Information

In addition to Weibo, there is also WeChat

Please pay attention

WeChat public account

Shulou

How to use OSPF to build a bridge with physical network communication

2025-01-31 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >

Share

Shulou(Shulou.com)05/31 Report--

How to use OSPF to build a bridge with the physical network communication, many novices are not very clear about this, in order to help you solve this problem, the following editor will explain for you in detail, people with this need can come to learn, I hope you can gain something.

Preface

With the continuous acceleration of new infrastructure construction and the continuous expansion of the construction scale, the requirements for the network in cloud computing are becoming higher and higher, especially with the cloud on the network of large data centers as the representative to build cloud data centers. how to solve the problem of connection between cloud data center and physical data center is becoming more and more obvious. In the past, most cloud platforms generally reached physical switches or firewall devices by loading "external networks", and then realized routing and interworking with physical data center networks through physical switches or firewalls; but this approach also increases the cost of hardware and operation and maintenance. In this case, OSPF has become a "bridge" to solve the connectivity problems between the internal network of the cloud platform and the physical external network.

OSPF routing protocol simplification

Before we understand the basic concepts of OSPF, let's give a general introduction to routing.

As we all know, routing is divided into directly connected routes, static routes and dynamic routes. Among them, dynamic routing is maintained by dynamic routing protocols, which include RIP, OSPF, IS-IS and so on. The dynamic routing protocol generates and maintains the routing table needed for forwarding through the exchange of routing information. when the network topology changes, the dynamic routing protocol can update the routing table automatically and is responsible for determining the best path of data transmission. In this environment, the administrator does not need to maintain the routing table on the router manually like static routes, but runs a routing protocol on each router. This routing protocol generates routing table entries in the routing table based on the configuration of the interface on the router and the link state of the connection.

OSPF is a link-state internal gateway routing protocol based on SPF algorithm, which is called Open shortest path first Protocol.

Each router running OSPF knows link-state information for the entire network. First of all, the convergence process of OSPF begins with the link-state announcement LSA (Link State Advertisement) flooding, and the routers that receive LSA establish their own link-state database LSDB (Link State Database) based on the information provided by LSA. After that, the shortest path tree of each network is constructed by self-calculation on the basis of LSDB through SPF algorithm. Finally, through the shortest path tree, the optimal route to the destination network is obtained and added to the IP routing table.

In this process, routing information is calculated only if an adjacency is established. After using OSPF, the router sends Hello messages periodically; when it receives the Hello packet from the neighbor, the state changes to the Init state; when the router receives the Hello message from the neighbor, it will switch to the 2-Way state; in this state, the two-way communication has been established, but the adjacency has not yet been established with the neighbor, which is the highest state before the adjacency is established.

If the network is a broadcast network, DR/BDR (DR: designated router in the broadcast network, where all neighbors only synchronize LSA entries with DR/BDR to reduce OSPF traffic; BDR: backup designated router) is elected to establish a relationship with all subsequent routers and reduce neighbor conversations. After that, the network will establish adjacency through the states of ExStart, Exchange, Loading and Full, and then DR will send the calculated topology information of the whole network to all routers. Finally, all routers take themselves as the root, calculate the optimal path to each network segment according to the algorithm and write it into the routing table. The process described in this paragraph is shown in the following figure:

There are many kinds of data link layer protocols, such as Ethernet, PPP, HDLC and frame Relay, etc. The commonly used one is Ethernet. Then when the data link layer protocol is Ethernet, the default network type supported by OSPF is broadcast type. Under this network type, the election of DR and BDR is needed. The purpose of the election is to reduce neighbor sessions and generate network LSA. Generally speaking, after neighbor discovery is completed, the router will conduct a DR election according to the type of network segment and the priority of each interface participating in the election. The higher the value, the higher the priority. The default is 1. When the priority is the same, compare the Router ID. The higher the value, the higher the priority. In order to back up the DR, you have to elect a BDR. DR and BDR establish adjacencies with all routers on the network.

In order to control the scope of LSA flooding, reduce the size of LSDB, and achieve rapid network convergence, OSPF protocol divides an autonomous system into different areas according to certain standards for hierarchical management of routers.

1. Standard: standard area (Standard Area), which supports all types of LSA

2. Stub: stub area (Stub Area). Type 4 and 5 LSA are not supported

3. The terminal region (Not So Stubby Area) of NSSA:Stub evolution, which only supports learning type 7 LSA.

Among them, the size of the routing table of the router in the Stub area and the amount of routing information transmitted will be greatly reduced. External routing cannot be introduced into Stub area, which can avoid the consumption of bandwidth and storage resources of Stub area router by a large number of external routes.

Then, for scenarios that need to introduce external routes and avoid resource consumption caused by external routes, the Stub area can no longer meet the demand. Therefore, the deformation of the Stub region, the NSSA region (not so stub area), is produced.

Implementation of OSPF in ZStack Cloud platform

We can configure VPC- routing protocol in the network resource-VPC- routing protocol resource in the OSPF cloud platform.

Regional ID: in an autonomous system, each OSPF zone is identified by a regional ID and is globally unique. Area 0 (area ID:0.0.0.0) is called the backbone area, and all areas must be connected to the backbone area.

Regional types: OSPF regions include Standard, Stub and NSSA. The same VPC router can be added to different OSPF areas, but networks (VPC networks, public networks) on the same VPC router can only be added to one OSPF area.

Authentication method: in order to enhance the security of the protocol package, OSPF protocol supports regional authentication encryption, and OSPF zone supports three authentication methods. 1. None: do not authenticate identity when receiving message; 2. Plaintext: authenticate identity by password carried in message; 3. MD5: authenticate identity by Key ID and password hash value carried in message when receiving message.

Application scenarios of OSPF

Scenario 1: two different virtual VPC network environments where users exist on the cloud platform. In order for the two VPC network environments to communicate with each other, in the ZStack environment, create an OSPF area in the same area, and join two virtual VPC routers isolated from the three-layer network into the same OSPF area; through the OSPF protocol, the routers establish neighbors and communicate with each other, so that the networks in two different virtual VPC routers can communicate with each other. The process is shown in the following figure:

Scenario 2: there are two sets of network environments for users: one is the virtual VPC network environment on the cloud platform, and the other is the traditional network environment in which the OSPF protocol is configured in the physical environment. In order for two sets of network environments to communicate with each other, in the ZStack environment, create an OSPF area which is the same as the physical environment, and add the virtual VPC router and the traditional router isolated from the three-layer network to the same OSPF area; the routers establish neighbor relationship and communicate with each other through the OSPF protocol, so that the network in the virtual VPC router and the traditional network can communicate with each other.

Different VPC networks realize network interworking through OSPF

Finally, we demonstrate the configuration process of OSPF through actual combat. Let's first take a look at the configuration flow chart of OSPF. Here, let's take application scenario 1 as an example. First, create two VPC networks to verify the connectivity of the network when the OSPF protocol is not used; then, create the OSPF area and join the VPC router to the OSPF area; finally, verify the network connectivity after the OSPF protocol takes effect.

The specific steps are as follows:

Step 1: create two VPC networks, VPC network-01 (192.168.3.0) and VPC network-01 (192.168.4.0).

Step 2: create two CVMs using two VPC networks, namely VPC CVM-01 (address: 192.168.3.254) and VPC CVM-02 (address: 192.168.4.101).

Step 3: verify the connectivity of the network without using OSPF protocol. Test VPC CVM-02 on VPC CVM-01 with ping, and you can see that normal communication is not possible.

Step 4: create an OSPF area and add the VPC router to the OSPF area. The area ID is 0.0.0.0, the type is Standard standard area, and the authentication method is None.

After waiting for a period of time, you can see that DR and BDR have been successfully elected, the neighbor status is Full, and the adjacency has been established successfully.

Step 5: verify the connectivity of the network when using OSPF protocol. Ping test VPC CVM-02 on VPC CVM-01, and you can see that it can communicate normally.

Is it helpful for you to read the above content? If you want to know more about the relevant knowledge or read more related articles, please follow the industry information channel, thank you for your support.

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: 0

*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.

Share To

Servers

Wechat

© 2024 shulou.com SLNews company. All rights reserved.

12
Report