🎧 New: AI-Generated Podcasts Turn your study notes into engaging audio conversations. Learn more

IP routing basics.pdf

Loading...
Loading...
Loading...
Loading...
Loading...
Loading...
Loading...

Full Transcript

A unique network node can be found based on a specific IP address. Each IP address belongs to a unique subnet. These subnets may be distributed around the world and constitute a global network. To implement communication between different subnets, network devices need to forward IP pa...

A unique network node can be found based on a specific IP address. Each IP address belongs to a unique subnet. These subnets may be distributed around the world and constitute a global network. To implement communication between different subnets, network devices need to forward IP packets from different subnets to their destination IP subnets. A gateway and an intermediate node (a router) select a proper path according to the destination address of a received IP packet, and forward the packet to the next router. The last-hop router on the path performs Layer 2 addressing and forwards the packet to the destination host. This process is called route-based forwarding. The intermediate node selects the best path from its IP routing table to forward packets. A routing entry contains a specific outbound interface and next hop, which are used to forward IP packets to the corresponding next-hop device. Based on the information contained in a route, a router can forward IP packets to the destination along the required path. The destination address and mask identify the destination address of an IP packet. After an IP packet matches a specific route, the router determines the forwarding path according to the outbound interface and next hop of the route. The next-hop device for forwarding the IP packet cannot be determined based only on the outbound interface. Therefore, the next-hop device address must be specified. A router forwards packets based on its IP routing table. An IP routing table contains many routing entries. An IP routing table contains only optimal routes but not all routes. A router manages routing information by managing the routing entries in its IP routing table. Direct routes are the routes destined for the subnets to which directly connected interfaces belong. They are automatically generated by devices. Static routes are manually configured by network administrators. Dynamic routes are learned by dynamic routing protocols, such as OSPF, IS-IS, and BGP. When a packet matches a direct route, a router checks its ARP entries and forwards the packet to the destination address based on the ARP entry for this destination address. In this case, the router is the last hop router. The next-hop address of a direct route is not an interface address of another device. The destination subnet of the direct route is the subnet to which the local outbound interface belongs. The local outbound interface is the last hop interface and does not need to forward the packet to any other next hop. Therefore, the next-hop address of a direct route in the IP routing table is the address of the local outbound interface. When a router forwards packets using a direct route, it does not deliver packets to the next hop. Instead, the router checks its ARP entries and forwards packets to the destination IP address based on the required ARP entry. The Preference field is used to compare routes from different routing protocols, while the Cost field is used to compare routes from the same routing protocol. In the industry, the cost is also known as the metric. RTA learns two routes to the same destination, one is a static route and the other an OSPF route. It then compares the preferences of the two routes, and prefers the OSPF route because this route has a higher preference. RTA installs the OSPF route in the IP routing table. The table lists the preferences of some common routing protocols. Actually, there are multiple types of dynamic routes. We will learn these routes in subsequent courses. The IP packets from 10.0.1.0/24 need to reach 40.0.1.0/24. After receiving these packets, the gateway R1 searches its IP routing table for the next hop and outbound interface and forwards the packets to R2. After the packets reach R2, R2 forwards the packets to R3 by searching its IP routing table. Upon receipt of the packets, R3 searches its IP routing table, finding that the destination IP address of the packets belongs to the subnet where a local interface resides. Therefore, R3 directly forwards the packets to the destination subnet 40.0.1.0/24. The disadvantage of static routes is that they cannot automatically adapt to network topology changes and so require manual intervention. Dynamic routing protocols provide different routing algorithms to adapt to network topology changes. Therefore, they are applicable to networks on which many Layer 3 devices are deployed. Dynamic routing protocols are classified into two types based on the routing algorithm: â–« Distance-vector routing protocol â–ª RIP â–« Link-state routing protocol â–ª OSPF â–ª IS-IS â–« BGP uses a path vector algorithm, which is modified based on the distance- vector algorithm. Therefore, BGP is also called a path-vector routing protocol in some scenarios. Dynamic routing protocols are classified into the following types by their application scope: â–« IGPs run within an autonomous system (AS), including RIP, OSPF, and IS-IS. â–« EGP runs between different ASs, among which BGP is the most frequently used. When the link between RTA and RTB is normal, the two routes to 20.0.0.0/30 are both valid. In this case, RTA compares the preferences of the two routes, which are 60 and 70 respectively. Therefore, the route with the preference value 60 is installed in the IP routing table, and RTA forwards traffic to the next hop 10.1.1.2. If the link between RTA and RTB is faulty, the next hop 10.1.1.2 is unreachable, which causes the corresponding route invalid. In this case, the backup route to 20.0.0.0/30 is installed in the IP routing table. RTA forwards traffic destined for 20.0.0.1 to the next hop 10.1.2.2. On a large-scale network, routers or other routing-capable devices need to maintain a large number of routing entries, which will consume a large amount of device resources. In addition, the IP routing table size is increasing, resulting in a low efficiency of routing entry lookup. Therefore, we need to minimize the size of IP routing tables on routers while ensuring IP reachability between the routers and different network segments. If a network has scientific IP addressing and proper planning, we can achieve this goal by using different methods. A common and effective method is route summarization, which is also known as route aggregation. To enable RTA to reach remote network segments, we need to configure a specific route to each network segment. In this example, the routes to 10.1.1.0/24, 10.1.2.0/24, and 10.1.3.0/24 have the same next hop, that is, 12.1.1.2. Therefore, we can summarize these routes into a single one. This effectively reduces the size of RTA's IP routing table. In most cases, both static and dynamic routes need to be associated with an outbound interface. This interface is the egress through which the device is connected to a destination network. The outbound interface in a route can be a physical interface such as a 100M or GE interface, or a logical interface such as a VLANIF or tunnel interface. There is a special interface, that is, Null interface. It has only one interface number, that is, 0. Null0 is a logical interface and is always up. When Null0 is used as the outbound interface in a route, data packets matching this route are discarded, like being dumped into a black-hole. Therefore, such a route is called a black-hole route. 1. The router first compares preferences of routes. The route with the lowest preference value is selected as the optimal route. If the routes have the same preferences, the router compares their metrics. If the routes have the same metric, they are installed in the IP routing table as equal-cost routes. 2. To configure a floating route, configure a static route with the same destination network segment and mask as the primary route but a different next hop and a larger preference value. 3. The summary route is 10.1.0.0/20.

Use Quizgecko on...
Browser
Browser