150 likes | 298 Views
Forwarding and Routing IP Packets. Don't ask for a light load, but rather ask for a strong back. - Unknown. Objectives. Describe how packets are delivered from a source to a destination using direct and indirect delivery methods
E N D
Forwarding and Routing IP Packets Don't ask for a light load, but rather ask for a strong back. - Unknown Chapter 6
Objectives • Describe how packets are delivered from a source to a destination using direct and indirect delivery methods • Explain how routers forward packets based on the entries in their routing table(s) • Explain what is meant by address aggregation (or, route aggregation) • Describe how routers build their routing tables Chapter 6
Direct versus Indirect Delivery of Packets • Direct Delivery • Source and destination of the packet are on the same network, or • Delivery is between the last router and the destination host Chapter 6
Indirect Delivery of Packets • If source and destination of the packet are NOT on the same network, the packet is forwarded from one router to another until it reaches a router connected to the same network as the destination host Chapter 6
Routing and Forwarding • Routing is the task of finding a path from a sender to a desired destination. • Forwarding means sending the packet towards its destination, based on the routing information. • Routing Table: • A compilation of all the networks (and sometimes hosts) that the router can reach • Entries in the routing table are known as “routes” and consist of a network address, a “next hop” (the IP address of the next router in the path to the destination), and a metric indicating how “good” the path is Chapter 6
Understanding Forwarding • When a packet is received on a router interface, after checking its validity (by checking the Header Checksum, etc.) the router must find out the packet’s final destination • The router reads the Destination IP Address, and then looks in the Network field of its routing table for a match • If a match is found, then the packet is forwarded to the corresponding next hop, which is usually another router on a directly connected network • If a match is not found, the packet is sent to the router listed as the default next hop in the routing table (normally with a network address of 0.0.0.0) Chapter 6
Forwarding Example - Fig. 6.13 Chapter 6
Table 6.1 Routing table for router R1 in Figure 6.13 • Show the forwarding process if a packet arrives at R1 in Figure 6.13 with the destination address: • 180.70.65.140 (Eg: 8) --> Forwards through m0 • 201.4.22.35 (Eg: 9) --> Forwards through m3 • 18.24.32.78 (Eg:10) --> Forwards through m2 Chapter 6
Address (or, Route) Aggregation • Router R1 (in Fig. 6.15) is connected to networks of 4 organizations. R1’s routing table contains 4 entries (or, routes) for these 4 networks. • In router R2’s routing table, these 4 separate route entries are aggregated into a single route entry. • As the 4 blocks of addresses for the 4 organizations are aggregated into one larger block (i.e., 140.24.7.0/24) in router R2, this is called Address Aggregation. • As the 4 route entries in R1 are aggregated into a single route entry in R2’s routing table, this is also called Route Aggregation. Chapter 6
Figure 6.15Address aggregation Chapter 6
Longest Mask (or, Prefix) Matching • When there are routes with different masks (or, network prefixes), the routing table is sorted from the longest mask to the shortest mask. • This ensures that, when forwarding a packet, if there are multiple matches to the destination network in a routing table, the route with the longest mask (or, prefix) is chosen. Chapter 6
Figure 6.16Longest mask matching Chapter 6
How does the Routing Table get built? • A route entry can be placed in a routing table in three basic ways • Through direct connection. A router knows about its directly connected networks through interface configuration (Connected routes) • Manual configuration (Static routes) • Dynamically, by using a routing protocol (Dynamic routes) • Routers use routing protocols to exchange information periodically about various networks they are connected to, and use that information to build up their routing tables Chapter 6