17.hcna-hntd--ip Routing Basics

Source: Internet
Author: User

The Ethernet switch works at the data link layer and is used for data forwarding within the network. The topology of the enterprise network is generally more complex, different departments, or headquarters and branches may be in different networks, it is necessary to use a router to connect to different networks, to achieve the data between the network forwarding.

Learning Goals:
1. Master the basic working principle of router
2. Mastering the optimal routing method of Router selection

Autonomous systems


In general, we can think of an enterprise network as an autonomous system as (autonomous systems). According to RFC1030, an autonomous system is a network governed by a single entity, which can be an Internet service provider or a large organizational structure. Autonomous systems follow a single, unambiguous routing strategy. Initially, only a single routing protocol is considered within the autonomous system, but with the development of the network, it is now possible to support the simultaneous operation of multiple routing protocols within an autonomous system.

LAN and broadcast domains


An as is usually made up of several different LANs. Take the enterprise network as an example, each department can belong to different local area network, or each branch office and headquarters can belong to different local area network. Hosts within the LAN can communicate with each other through the switch. The hosts between different LANs want to communicate with each other, which can be realized by routers. The router works in the network layer, isolates the broadcast domain, and can be used as the gateway of each LAN to find the optimal path to the destination network, and finally realize the forwarding of the message between different networks.
In this example, RTA and RTB divide the entire network into three different local area networks, each of which is a broadcast domain. LAN1 internal hosts can communicate with each other directly through the switch, as is the case between LAN2 internal hosts. However, LAN1 internal hosts do not have to communicate with each other through a router LAN2 the internal hosts.

Route selection


After the router receives the packet, it chooses an optimal path based on the destination IP address in the packet, forwards the packet to the next router, and the last router on the path is responsible for sending the packet to the destination host. The transmission of packets over the network is like a relay race in sports, each router is responsible for forwarding the packet according to the optimal path of the next-hop router, through multiple routers one station at a stop relay, and finally the packet through the optimal path to the destination. Of course, sometimes the path passed by a packet may not necessarily be optimal due to some special routing policies implemented.
The router can determine the forwarding path of the data message. If more than one path can reach the destination, the router determines the best next hop by making calculations. The principles of calculation vary depending on the routing protocol that is actually used.

IP routing Table


The key to the router forwarding packet is the routing table. Each router holds a routing table, each of which indicates whether the packet is to reach a network or which physical interface a host should send through the router, and which next router can reach that path, or it can no longer go through another router and reach its destination directly.
The following key items are included in the routing table:
Destination Address (Destination): Used to identify the destination address or destination network for the IP packet.
netmask: The structure and function of the network mask have been introduced in the IP addressing course. Similarly, the network mask in the routing table also has important meanings. The IP address and netmask are "logical and" to get the appropriate segment information. In this example: the destination address is 8.0.0.0, the mask is 255.0.0.0, and a Class A segment information (8.0.0.0/8) is obtained after the phase. Another function of the netmask is that when there are multiple entries in the routing table with the same routing information, the router chooses one of its longest masks as a match.
output Interface (Interface): Indicates which interface of the router the IP packet will be forwarded from. Next hop IP address (nexthop): Indicates the interface to the next router through which the IP packet is routed
Access.
Several other fields, such as precedence, measures, and so on in the routing table, will be introduced later.

Create a routing table


Depending on the source, the routes in the routing table are generally divided into the following three categories:
1. Routes discovered by the link layer protocol (also known as interface routes or direct-attached routes).
2. Static routes that are manually configured by the network administrator.
3. Routes discovered by the dynamic routing protocol.

The longest matching principle


When the router forwards the data, it needs to select the optimal route in the routing table. When the data message arrives at the router, the router first extracts the destination IP address of the message, then finds the routing table, and the destination IP address of the message and the Mask field of a table item in the routing table Do "and" operation, and the result of the operation is compared with the destination IP address of the table item in the routing table, otherwise there is no match When a match is made to all the routing table entries, the router chooses the longest mask match.
, there are two table entries in the routing table that reach destination segment 10.1.1.0, and the next-hop address is 20.1.1.2. If the message is to be forwarded to network segment 10.1.1.1, then the 10.1.1.0/30 conforms to the longest matching principle.

Route priority


Routers can learn to route to the same destination network through a variety of different protocols, and when these routes conform to the longest matching principle, you must decide which route takes precedence.
Each routing protocol has a protocol priority (the smaller the value, the higher the priority). When there are multiple routing information, select the highest-priority route as the best route.
, the router learns the route of the network segment 10.1.1.0 through two kinds of routing protocols. Although the RIP protocol provides a more direct-looking route, OSPF has a higher priority, and thus becomes a preferred route and is added to the routing table.

Route metrics


If the router is unable to prioritize the optimal route, the measure (metric) is used to determine which route to join the routing table.
Some common metrics are: hop count, bandwidth, latency, cost, load, reliability, etc. Hop count refers to the number of routers that are passed to the destination. Bandwidth refers to the capacity of the link, and the high-speed link overhead (measure) is small.
The smaller the metric value, the higher the routing priority, so the route metric=1+1=2 in the illustration is the optimal route to the destination, and its table entries can be found in the routing table.

Router forwarding Packet


After the router receives a packet, it checks its destination IP address and then looks for the routing table. After a matching routing table entry is found, the router forwards the packet based on the outgoing interface information and the next hop information indicated by the table entry.

Summarize:
1. What is the order of the routers choosing the optimal route?
2. What does the preference field mean in the routing table?
For:
1. When selecting the optimal route, the router first compares the priority of the same route, and then compares the metric value if the priority is the same. If the metric value is the same, multiple identical routes will implement the equivalent load sharing.
2. The Preference field represents the route priority in the routing table. The equipment manufacturers ' chambers prescribe different priorities for different routing protocols in their respective products.

17.hcna-hntd--ip Routing Basics

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.