In addition to Weibo, there is also WeChat
Please pay attention
WeChat public account
Shulou
2025-02-24 Update From: SLTechnology News&Howtos shulou NAV: SLTechnology News&Howtos > Servers >
Share
Shulou(Shulou.com)06/02 Report--
1. Routing principle
Router: complete delivery of the packet to the destination and choose a relatively best path.
Function: let the computers of different network segments communicate normally.
two。 How routers work
(1) computer 1.1 wants to send a packet to 4.1. Because it is a different network segment, the packet is sent to router An of the same network segment.
(2) after router A receives the packet, first check that the destination IP address of the packet is 4.1. Secondly, look at your routing table to find out the output interface S0 corresponding to the destination network segment.
(3) the router in the network transmits the data packet according to this principle, and so does router B. it transmits the data packet from the E0 port, and finally the host 4.1 receives the packet.
3. The formation of routing table
The routing table is a collection of routing entries in a router and is the basis for a router to choose a path.
Directly connected network segment: a network segment directly connected to the router itself, which can have the corresponding relationship between these network segments and ports in the routing table
Non-directly connected network segment: there is no network segment directly connected to the router itself and should be written into the routing table using static or dynamic routes.
4. Static and default routes:
a. Static routes require fixed routes that are manually configured by the administrator on the router.
If you want to add a static route to A, you must indicate:
1. Destination network IP to be reached
two。 The interface IP address of the next router B connected to router An or the local interface of router A
3. Static routes do not change unless the administrator intervenes.
Features:
1. Administrators can control the flow of packets in the network through static routes
two。 Only one-way communication can be realized, and two-way static routes can only be set up at both ends in order to achieve two-way communication.
3. Lack of flexibility, can not change with the change of the network; when there is a link failure, static routes need to be reconfigured.
b. Default route: what the router chooses when it does not match the packet destination address in the routing table. Proper use of default routes can improve network performance and reduce the size of routing tables.
5. The encapsulation process by which a router forwards a packet:
1. What we want to make clear from Host An is that the source IP is 192.168.1.2 of HOST An and the destination IP is 192.168.2.2 of HOST B.
two。 At this point, HOST A will send an ARP broadcast to the E0 port. Upon arrival, the gateway will parse it, and after the resolution is completed, it will give back its MAC address to HOST A.
3. Next, here is the first encapsulation: after receiving the feedback, HOST A takes its own MAC address as the source MAC and sends the feedback 00-11-12-21-22-22 of An as the destination MAC to port E0 of A.
4. After receiving the packet from E0, router A checks whether the destination MAC is for itself and confirms that the packet is to be forwarded through its own route, so router A looks for its own routing table, looks for a routing table entry that matches the destination 192.168.2.2, and then forwards the packet to the E1 interface according to the next-hop address of the routing table.
5. Reencapsulated on E1 interface router A, the source MAC address is 00-11-12-21-33-33 of E1 interface, and the destination MAC address is 00-11-12-21-44-44 of E1 interface of router B connected to it.
6. After receiving the data frame from the E1 interface, router B will also remove the encapsulation of the data link layer, check the destination IP address, match it with the routing table, and then forward the packet to the E0 interface according to the next hop information of the routing table.
7. At this time, router B discovers that the target network segment is directly connected to its E0 interface. Through ARP broadcast, router B gets the feedback from HOST B that its MAC address is 00-11-12-21-66-66.
8. At this time, router B takes the 00-11-12-21-55-55 of its E0 port as the source MAC address, encapsulates the feedback 00-11-12-21-66-66 of HOST B as the destination MAC address, and sends it to HOST B from E0 port. At this time, the forwarding of the packet is completed.
6. When the following images are laid out in GNS3, we draw up an ip address and subnet mask for them, and we can clearly see that the ip addresses of different network segments are at both ends of the router:
7. To enter the interface mode of router ESW1, first configure the address of 192.168.20.10 255.255.255.0 for interface 0ram 0, and don't forget to open port 0Lex0:
8. Then enter port 0x1, configure it with the address of 192.168.10.10 255.255.255.0, and be sure to enter no shut to open the port:
9. Enter the command to view all the ip information of the current device configuration, and you can see that both ip addresses have been configured and the ports are open:
10. Return to global mode and set the static route. The first ip is the network number of the destination, the second is the subnet mask, and the third is the ip address of the next hop:
11. Enter the view command, and the static route has been set successfully:
twelve。 When you enter the ESW2 interface mode, configure the ip information for 0max 0pm 1max 1:
13. In the previous step, you obviously forgot to open the port 0Place1 (don't forget it). Open it again here:
14. Check the configured ip information again, and the configuration has been completed:
15. Then configure ESW2 with a static route:
16. Finally, assign the IP address to the pc1,pc2. Remember to add the gateway address after the address:
17. Try to connect to pc2 on the pc1 port, and the connection is successful:
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.
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.