Figure 8-7: The Routing Process Routing Processing an individual packet and passing it on its way is called routing Router ports are called interfaces Packet arrives in one interface The router sends the packet out another interface 8-21
8-21 Figure 8-7: The Routing Process • Routing – Processing an individual packet and passing it on its way is called routing • Router ports are called interfaces • Packet arrives in one interface • The router sends the packet out another interface
Figure 8-7: The Routing Process The routing table Each router has a routing table that it uses to make routing decisions Routing table rows Each row represents a route for a range of IP addresses--often a network or subnet All packets with addresses in this range are routed according to that row Route IP Address Range Metric Next-Hop Governed by the route Router 60.3XX 9 B 8-22
8-22 Figure 8-7: The Routing Process • The Routing Table – Each router has a routing table that it uses to make routing decisions – Routing Table Rows • Each row represents a route for a RANGE of IP addresses—often a network or subnet • All packets with addresses in this range are routed according to that row Route IP Address Range Governed by the route Metric Next-Hop Router 1 60.3.x.x 9 B
Figure 8-7: The Routing Process The routing table Routing table Columns Row(route)number: Not in real routing tables IP address range governed by the row Metric for the quality of the route Next-hop router that should get the packet next if the row is selected as the best match Route IP Address Metric Next-Hop Range Router 60.3XX 2 128.171XX 92 BB 8-23
8-23 Figure 8-7: The Routing Process • The Routing Table – Routing Table Columns • Row (route) number: Not in real routing tables • IP address range governed by the row • Metric for the quality of the route • Next-hop router that should get the packet next if the row is selected as the best match Route IP Address Range Metric Next-Hop Router 1 60.3.x.x 9 B 2 128.171.x.x 2 B
Figure 8-7: The Routing Process A Routing Decision The router looks at the destination ip address in an arriving packet (in this case, 60.3.47.12 1. The router determines which rows match(have an IP address range containing the packets destination IP address) The router must check ALL rows for possible matches Route IP Address Metric Next-Hop Arriving Packet Range Router 60.3.47.12 60.3XX B Match 2 128.171.x.x 92 No Match 24
8-24 Figure 8-7: The Routing Process • A Routing Decision – The router looks at the destination IP address in an arriving packet (in this case, 60.3.47.12). – 1. The router determines which rows match (have an IP address range containing the packet’s destination IP address) • The router must check ALL rows for possible matches Route IP Address Range Metric Next-Hop Router 1 60.3.x.x 9 B 2 128.171.x.x 2 B Arriving Packet 60.3.47.12 Match No Match
Figure 8-7: The Routing Process A Routing Decision 2. After finding all matches, the router then determines the best-match row 2A. Selects the row with the loNgest match 60.3.x.x has 16 bits of match 60.3. 47x has 24 bits of match so is a better match 2B. If two or more rows tie for the longest match router uses the metric column value If cost, lowest metric value is best If speed, highest metric value is best Etc 8-25
8-25 Figure 8-7: The Routing Process • A Routing Decision – 2. After finding all matches, the router then determines the BEST-MATCH row • 2A. Selects the row with the LONGEST MATCH – 60.3.x.x has 16 bits of match – 60.3.47.x has 24 bits of match so is a better match • 2B. If two or more rows tie for the longest match, router uses the METRIC column value – If cost, lowest metric value is best – If speed, highest metric value is best – Etc