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

What are the knowledge points of web routing protocol

2025-01-17 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Network Security >

Share

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

This article mainly explains "what are the knowledge points of web routing protocol". Interested friends may wish to have a look at it. The method introduced in this paper is simple, fast and practical. Next, let the editor take you to learn "what are the knowledge points of web routing protocol"?

One: Mac head and IP head

1. In the MAC header, it is the destination MAC address, then the source MAC address, and then there is a protocol type that indicates that it is the IP protocol.

two。 In the IP header, the most important are the source IP address and the destination IP address.

Two: routing

On any machine, when you want to access another IP address, you will first determine whether the destination IP address and the IP address of the current machine are on the same network segment:

1. If it is the same network segment, put the source IP address and destination IP address directly into the IP header, then obtain the MAC address through ARP, put the source MAC address and destination MAC address into the MAC header and send them out.

two。 If it is not the same network segment, it needs to be sent to the default gateway. The address of the gateway must be the same as the source IP address. People usually call gateways routers. A router is a device that has five network ports or

The network card, which is equivalent to five hands, is connected to five local area networks. The IP address of each hand is the same as the IP address of the local area network. Any packet that wants to be sent to another local area network will reach one of the hands and be brought in.

Take down the MAC header and IP header, choose another hand according to your own routing algorithm, add IP header and MAC header, and send it out.

Three: static routing

Static routing, in fact, is to configure a rule on the router. Whenever you want to choose which hand to throw, you will match the rules one by one, find the rules that match, and send them out of a network port according to the settings in the rules.

As long as the MAC address passes through the gateway, it is bound to change, depending on whether the IP address is changed:

1. Forwarding gateway: a gateway that does not change the IP address.

2.NAT gateway: a gateway that changes the IP address. When many offices visit the public network, they are also NAT, because the public network address is too expensive, so generally the whole office shares one or two IP addresses.

3. Routing table: there are multiple routing rules in a routing table, and each day the rule contains at least three pieces of information: destination network (where does this packet want to go? ), exit device (which port to throw the packet out), next gateway (address of the next router)

The route command and the ip route command can be queried or configured.

For example, ip route add 10.176.48.0 via 20 via 10.173.32.1 indicates that the target network of 10.176.48.0 via 20 is required, starting from the eth0 port and passing through 10.173.32.1. One of the core ideas of this configuration is: according to

Destination IP address to configure routing

4. Configure policy routing: you can configure multiple routing tables, select the routing table based on the source IP address, ingress device, TOS, and so on, and then find the route in the routing table. This allows packets from different sources to take different routes.

Ip rule add from 192.168.1.0/24 table 10

Ip rule add from 192.168.2.0/24 table 20

Indicates that the routing table in table 10 is used for those from the 192.168.1.0 scarp 24 segment, and the routing table for table 20 is used for those from the 192.168.2.0 Universe 24 segment.

Ip route add default scope global nexthop via 100.100.100.1 weight 1 nexthop via 200.200.200.1 weight 2

Indicates that there are two places for the next hop, which are 100.100.100.1 and 200.200.200.1, with a weight of 1 to 2, respectively.

Four: dynamic routing

Using a dynamic router, a dynamic routing table can be generated according to the routing protocol algorithm, which varies with the health of the network.

1. Distance vector routing algorithm: based on the Bellman-Ford algorithm, each router keeps a routing table containing multiple rows, each row corresponding to a router in the network

Each line contains two parts of information, one is the line from which to get to the target router, and the other is the distance to the target router.

two。 Link-state routing algorithm: based on the Dijkstra algorithm, when a router starts, the first thing is to discover the neighbors, and all the neighbors reply. Then calculate the distance from the neighbor.

Send an echo that asks to return immediately, divided by two is the distance. The link-state packets between yourself and your neighbors are then broadcast and sent to every router in the entire network.

In this way, each router can receive the relationship information between it and its neighbors, so each router can build a complete diagram locally, and then focus on this diagram.

Use the Dijkstra algorithm to find the shortest distance between two points.

Five: dynamic routing protocol

1. OSPF based on Link-State routing algorithm

OSPF (Open Shortest Path First, Open shortest path first) is a protocol widely used in data centers. Because it is mainly used in data centers for routing decisions, it is called Interior Gateway Protocol (Interior Gateway Protocol for short IGP).

The focus of the internal gateway protocol is to find the shortest path. Within an organization, the shortest path is often the best. Sometimes OSPF can find multiple shortest paths

Load balancing can be done in this path, which is often referred to as equal-cost routing.

two。 BGP (external Network routing Protocol Border Gateway Protocol) based on distance Vector routing algorithm

At this point, I believe you have a deeper understanding of "what are the knowledge points of web routing protocol". You might as well do it in practice. Here is the website, more related content can enter the relevant channels to inquire, follow us, continue to learn!

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

Network Security

Wechat

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

12
Report