Document Details

InviolableRainforest

Uploaded by InviolableRainforest

2024

Shreen Khalaf

Tags

ip routing computer networks data communication networking

Summary

This document provides a lecture on IP routing, covering basic concepts, routing protocols, and packet forwarding. It details how routers determine the best path for data transmission within an internetwork.

Full Transcript

IP Routing Created By Shreen Khalaf 10/31/2024 Routing Basics  IP routing is basically the process of moving packets from one network to another network using routers.  The primary functions of a router are to determine the best p...

IP Routing Created By Shreen Khalaf 10/31/2024 Routing Basics  IP routing is basically the process of moving packets from one network to another network using routers.  The primary functions of a router are to determine the best path to forward packets based on the information in its routing table, and to forward packets toward their destination Created By Shreen Khalaf 10/31/2024 Routing protocol and a routed protocol  Routers use routing protocols to dynamically find all networks within the greater internetwork.  RIP, RIPv2, EIGRP, and OSPF are examples routing protocols  routed protocol send user data (packets) through the established enterprise.  Routed protocols are assigned to an interface and determine the method of packet delivery  Examples of routed protocols are IP and IPv6 Created By Shreen Khalaf 10/31/2024  Router must know 1. Destination address 2. Possible routes 3. The best route 4. How to maintain and verify routing information Created By Shreen Khalaf 10/31/2024 Path Determination Router Functions Example The router uses its IP routing table to determine which path (route) to use to forward a packet. R1 and R2 will use their respective IP routing tables to first determine the best path, and then forward the packet. Path Determination Best Path Equals Longest Match The best path in the routing table is also known as the longest match. The routing table contains route entries consisting of a prefix (network address) and prefix length. For there to be a match between the destination IP address of a packet and a route in the routing table, a minimum number of far-left bits must match between the IP address of the packet and the route in the routing table. The prefix length of the route in the routing table is used to determine the minimum number of far-left bits that must match. The longest match is the route in the routing table that has the greatest number of far-left matching bits with the destination IP address of the packet. The longest match is always the preferred route. Note: The term prefix length will be used to refer to the network portion of both IPv4 and IPv6 addresses. Path Determination IPv4 Longest Match Example In the table, an IPv4 packet has the destination IPv4 address 172.16.0.10. The router has three route entries in its IPv4 routing table that match this packet: 172.16.0.0/12, 172.16.0.0/18, and 172.16.0.0/26. Of the three routes, 172.16.0.0/26 has the longest match and would be chosen to forward the packet. For any of these routes to be considered a match there must be at least the number of matching bits indicated by the subnet mask of the route. Destination IPv4 Address Address in Binary 10101100.00010000.00000000.000010 172.16.0.10 10 Route Prefix/Prefix Address in Binary Entry Length 1 172.16.0.0/12 10101100.00010000.00000000.00001010 10101100.00010000.00000000.0000101 2 172.16.0.0/18 0 Routing table  Basically a map of the internetwork,  describes how to find remote networks.  If a network is directly connected, then the router already knows how to get to it.  If not directly connected use static or dynamic routing Created By Shreen Khalaf 10/31/2024 Networks from the Perspective of R1 Created By Shreen Khalaf 10/31/2024 Build the Routing Table  Directly Connected Networks  Directly connected networks are networks that are configured on the active interfaces of a router.  A directly connected network is added to the routing table when an interface is configured with an IP address and subnet mask (prefix length) and is active (up and up).  Remote Networks  Remote networks are networks that are not directly connected to the router. Routers learn about remote networks in two ways: 1. Static routes - Added to the routing table when a route is manually configured. 2. Dynamic routing protocols - Added to the routing table when routing protocols dynamically learn about the remote network. Dynamic routing protocols include Enhanced Interior Gateway Routing Protocol (EIGRP), Open Shortest Path First (OSPF), as well as several others. Created By Shreen Khalaf 10/31/2024 Packet Forwarding The following steps describe the packet forwarding process shown in the figure:  The data link frame with an encapsulated IP packet arrives on the ingress interface.  The router examines the destination IP address in the packet header and consults its IP routing table.  The router finds the longest matching prefix in the routing table.  The router encapsulates the packet in a data link frame and forwards it out the egress interface. The destination could be a device connected to the network or a next-hop router.  However, if there is no matching route entry the packet is dropped. Created By Shreen Khalaf 10/31/2024 Created By Shreen Khalaf 10/31/2024 Forwards the Packet to a Device on a Directly Connected Network If the route entry indicates that the egress interface is a directly connected network, the packet can be forwarded directly to the destination device. Typically this is an Ethernet LAN. To encapsulate the packet in the Ethernet frame, the router needs to determine the destination MAC address associated with the destination IP address of the packet. The process varies based on whether the packet is an IPv4 or IPv6 packet. Created By Shreen Khalaf 10/31/2024 Forwards the Packet to a Device on a Directly Connected Network Cont.  IPv4 packet - The router checks its ARP table for the destination IPv4 address and an associated Ethernet MAC address. If there is no match, the router sends an ARP Request. The destination device will return an ARP Reply with its MAC address. The router can now forward the IPv4 packet in an Ethernet frame with the proper destination MAC address.  IPv6 packet - The router checks its neighbor cache for the destination IPv6 address and an associated Ethernet MAC address. If there is no match, the router sends an ICMPv6 Neighbor Solicitation (NS) message. The destination device will return an ICMPv6 Neighbor Advertisement (NA) message with its MAC address. The router can now forward the IPv6 packet in an Ethernet frame with the proper destination MAC address Created By Shreen Khalaf 10/31/2024 Forward the Packet to a Next-Hop Router If the route entry indicates that the destination IP address is on a remote network, meaning a device on network that is not directly connected. The packet must be forwarded to the next-hop router. The next-hop address is indicated in the route entry. If the forwarding router and the next-hop router are on an Ethernet network, a similar process (ARP and ICMPv6 Neighbor Discovery) will occur for determining the destination MAC address of the packet as described previously. The difference is that the router will search for the IP address of the next-hop router in its ARP table or neighbor cache, instead of the destination IP address of the packet. Created By Shreen Khalaf 10/31/2024 Drop the Packet - No Match in Routing Table  If there is no match between the destination IP address and a prefix in the routing table, and if there is no default route, the packet will be dropped. Created By Shreen Khalaf 10/31/2024 14.3 Basic Router Configuration Review © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 17 Basic Router Configuration Review Topology The topology in the figure will be used for configuration and verification examples. It will also be used in the next topic to discuss the IP routing table. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 18 Basic Router Configuration Review Configuration Commands R1(config)# ipv6 unicast-routing Router> enable R1(config)# interface gigabitethernet 0/0/0 Router# configure terminal R1(config-if)# description Link to LAN 1 Enter configuration commands, one per line. End with R1(config-if)# ip address 10.0.1.1 255.255.255.0 CNTL/Z. R1(config-if)# ipv6 address 2001:db8:acad:1::1/64 Router(config)# hostname R1 R1(config-if)# ipv6 address fe80::1:a link-local R1(config)# enable secret class R1(config-if)# no shutdown R1(config)# line console 0 R1(config-if)# exit R1(config-line)# logging synchronous R1(config)# interface gigabitethernet 0/0/1 R1(config-line)# password cisco R1(config-if)# description Link to LAN 2 R1(config-line)# login R1(config-if)# ip address 10.0.2.1 255.255.255.0 R1(config-line)# exit R1(config-if)# ipv6 address 2001:db8:acad:2::1/64 R1(config)# line vty 0 4 R1(config-if)# ipv6 address fe80::1:b link-local R1(config-line)# password cisco R1(config-if)# no shutdown R1(config-line)# login R1(config-if)# exit R1(config-line)# transport input ssh telnet R1(config)# interface serial 0/1/1 R1(config-line)# exit R1(config-if)# description Link to R2 R1(config)# service password-encryption R1(config)# R1(config-if)# ip address 10.0.3.1 255.255.255.0 banner motd # R1(config-if)# ipv6 address 2001:db8:acad:3::1/64 Enter TEXT message. End with a new line and the # R1(config-if)# ipv6 address fe80::1:c link-local *********************************************** R1(config-if)# no shutdown WARNING: Unauthorized access is prohibited! R1(config-if)# exit *********************************************** R1# copy running-config startup-config # Destination filename [startup-config]? Building configuration... [OK] R1# © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 19 Basic Router Configuration Review Verification Commands Common verification commands include the following: show ip interface brief show running-config interface interface-type number show interfaces show ip interface show ip route ping In each case, replace ip with ipv6 for the IPv6 version of the command. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 20 Sh ip route Created By Shreen Khalaf 10/31/2024 Routing table  L – Identifies the address assigned to a router interface. This allows the router to efficiently determine when it receives a packet for the interface instead of being forwarded.  C – Identifies a directly connected network.  Each local route has a /32 prefix, defining a route just for the one address Created By Shreen Khalaf 10/31/2024 IP Routing Table Directly Connected Networks the router must have at least one active interface configured with an IP address and subnet mask (prefix length). This is known as a directly connected network or a directly connected route. Routers add a directly connected route to its routing table when an interface is configured with an IP address and is activated. A directly connected network is denoted by a status code of C in the routing table. The route contains a network prefix and prefix length. The routing table also contains a local route for each of its directly connected networks, indicated by the status code of L. For IPv4 local routes the prefix length is /32 and for IPv6 local routes the prefix length is /128. This means the destination IP address of the packet must match all the bits in the local route for this route to be a match. The purpose of the local route is to efficiently determine when it receives a packet for the interface instead of a packet that needs to be forwarded. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 23 IP Routing Table Static Routes Static routes are manually configured. They define an explicit path between two networking devices. They are not automatically updated and must be manually reconfigured if the network topology changes. Static routing has three primary uses: It provides ease of routing table maintenance in smaller networks that are not expected to grow significantly. It uses a single default route to represent a path to any network that does not have a more specific match with another route in the routing table. Default routes are used to send traffic to any destination beyond the next upstream router. It routes to and from stub networks. A stub network is a network accessed by a single route, and the router has only one neighbor. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 24 static routing and dynamic routing  The static routing method  The Dynamic routing used a requires someone to hand type route that routing protocol is all network locations into the adjust automatically routing table  a protocol on one router  Used for small network communicates with the same protocol running on neighboring routers  Created By Shreen Khalaf 10/31/2024 Static and Dynamic Routing Static or Dynamic? Static and dynamic routing are not mutually exclusive. Rather, most networks use a combination of dynamic routing protocols and static routes. Static routes are commonly used in the following scenarios: As a default route forwarding packets to a service provider For routes outside the routing domain and not learned by the dynamic routing protocol When the network administrator wants to explicitly define the path for a specific network For routing between stub networks Static routes are useful for smaller networks with only one path to an outside network. They also provide security in a larger network for certain types of traffic, or links to other networks that need more control. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 26 Static and Dynamic Routing Static or Dynamic? (Cont.) Dynamic routing protocols are implemented in any type of network consisting of more than just a few routers. Dynamic routing protocols are scalable and automatically determine better routes if there is a change in the topology. Dynamic routing protocols are commonly used in the following scenarios: In networks consisting of more than just a few routers When a change in the network topology requires the network to automatically determine another path For scalability. As the network grows, the dynamic routing protocol automatically learns about any new networks. © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 27 Static and Dynamic Routing Static or Dynamic? (Cont.) The table shows a comparison of some the differences between dynamic and static routing. Feature Dynamic Routing Static Routing Configuration Independent of network Increases with network complexity size size Automatically adapts to Administrator Topology changes topology changes intervention required Suitable for simple to Suitable for simple Scalability complex network topologies topologies Security must be Security Security is inherent configured Uses CPU, memory, and No additional resources © 2016 Cisco and/or its affiliates. All rights reserved. Cisco Confidential 28 Resource Usage Static Routes Created By Shreen Khalaf 10/31/2024 ip route command  ip route [destination_network] [mask] [next-hop_address or exitinterface] [administrative_distance]  ip route The command used to create the static route.  destination_network The network you’re placing in the routing table.  mask The subnet mask being used on the network.  next-hop_address This is the IP address of the next-hop router  administrative_distance By default, static routes have an administrative distance of 1 or 0 if you use an exit interface instead of a next-hop address. Created By Shreen Khalaf 10/31/2024 Lab 1 Created By Shreen Khalaf 10/31/2024 Lab 1 Created By Shreen Khalaf 10/31/2024 Created By Shreen Khalaf 10/31/2024 LAB-A configuration  Lab_A#config t  Lab_A(config)#ip route 172.16.30.0 255.255.255.0 172.16.20.2  Lab_A(config)#ip route 172.16.40.0 255.255.255.0 172.16.20.2  Lab_A(config)#ip route 172.16.50.0 255.255.255.0 172.16.20.2  Save the current configuration for the Lab_A router by going to privileged mode, typing copy run start, and pressing Ente Created By Shreen Khalaf 10/31/2024 LAB B configuration  add routes to networks 172.16.10.0 and 172.16.40.0.  Lab_B#config t  Lab_B(config)#ip route 172.16.10.0 255.255.255.0 172.16.20.1  Lab_B(config)#ip route 172.16.40.0 255.255.255.0 172.16.30.2  Save the current configuration for router Lab_B by going to the enabled mode, typing copy run start, and pressing Enter Created By Shreen Khalaf 10/31/2024 LAB C configuration  Create static routes so that router Lab_C can see all networks, using the commands shown here:  Lab_C#config t  Lab_C(config)#ip route 172.16.10.0 255.255.255.0 172.16.30.1 Lab_C(config)#ip route 172.16.20.0 255.255.255.0 172.16.30.1  Lab_C(config)#ip route 172.16.50.0 255.255.255.0 172.16.30.1  Save the current configuration for router Lab_C by going to the enable mode, typing copy run start, and pressing Enter. Created By Shreen Khalaf 10/31/2024 Test connection Created By Shreen Khalaf 10/31/2024 Lab 2 Created By Shreen Khalaf 10/31/2024 Show routing table  RouterA#sh ip route Created By Shreen Khalaf 10/31/2024 Configure Router A  RouterA(config)#ip route 10.0.0.0 255.0.0.0 20.0.0.1  RouterA(config)#ip route 40.0.0.0 255.0.0.0 30.0.0.2  RouterA(config)#exit  RouterA#  %SYS-5-CONFIG_I: Configured from console by console   RouterA#copy run start Created By Shreen Khalaf 10/31/2024 Sh ip route for Router B Created By Shreen Khalaf 10/31/2024 Configure Router B  RouterB(config)#ip route 30.0.0.0 255.0.0.0 20.0.0.2  RouterB(config)#ip route 40.0.0.0 255.0.0.0 20.0.0.2  RouterB(config)#exit  RouterB#  %SYS-5-CONFIG_I: Configured from console by console   RouterB#copy run start  Destination filename [startup-config]?  Building configuration...  [OK] Created By Shreen Khalaf 10/31/2024 Show ip route for router C Created By Shreen Khalaf 10/31/2024 Configure Router C  RouterC(config)#ip route 20.0.0.0 255.0.0.0 30.0.0.1  RouterC(config)#ip route 10.0.0.0 255.0.0.0 30.0.0.1  RouterC(config)#exit  RouterC#  %SYS-5-CONFIG_I: Configured from console by console   RouterC#copy run start  Destination filename [startup-config]?  Building configuration...  [OK]  RouterC# Created By Shreen Khalaf 10/31/2024 Test connection Created By Shreen Khalaf 10/31/2024 Default Route  ip route 0.0.0.0 0.0.0.0 172.16.20.2 Created By Shreen Khalaf 10/31/2024 Default Route  A default route specifies a next-hop router to use when the routing table does not contain a specific route that matches the destination IP address. The default route can be entered manually as a static route or learned automatically from a dynamic routing protocol.  A default route over IPv4 has a route entry of 0.0.0.0/0 and a default route over IPv6 has a route entry of ::/0. The /0 prefix length indicates that zero bits or no bits need to match the destination IP address for this route entry to be used. If there are no routes with a longer match, more than 0 bits, then the default route is used to forward the packet. The default route is sometimes referred to as a gateway of last resort. Created By Shreen Khalaf 10/31/2024 LAB-A configuration Created By Shreen Khalaf 10/31/2024 Task2 Configure static routing for the following topology Created By Shreen Khalaf 10/31/2024 Created By Shreen Khalaf 10/31/2024

Use Quizgecko on...
Browser
Browser