Presentation is loading. Please wait.

Presentation is loading. Please wait.

© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Introduction to Routing and Packet Forwarding Routing Protocols and.

Similar presentations


Presentation on theme: "© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Introduction to Routing and Packet Forwarding Routing Protocols and."— Presentation transcript:

1 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Introduction to Routing and Packet Forwarding Routing Protocols and Concepts – Chapter 1

2 ITE PC v4.0 Chapter 1 2 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Objectives  Identify a router as a computer with an OS and hardware designed for the routing process.  Demonstrate the ability to configure devices and apply addresses.  Describe the structure of a routing table.  Describe how a router determines a path and switches packets

3 ITE PC v4.0 Chapter 1 3 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router as a Computer  Describe the basic purpose of a router -Computers that specialize in sending packets over the data network. They are responsible for interconnecting networks by selecting the best path for a packet to travel and forwarding packets to their destination  Routers are the network center -Routers generally have 2 connections: - WAN connection (Connection to ISP) -LAN connection

4 ITE PC v4.0 Chapter 1 4 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router as a Computer  Data is sent in form of packets between 2 end devices  Routers are used to direct packet to its destination

5 ITE PC v4.0 Chapter 1 5 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router as a Computer  Routers examine a packet’s destination IP address and determine the best path by enlisting the aid of a routing table

6 ITE PC v4.0 Chapter 1 6 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router as a Computer  Router components and their functions”  CPU - Executes operating system instructions  Random access memory (RAM) - Contains the running copy of configuration file. Stores routing table. RAM contents are lost when power is off  Read-only memory (ROM) - Holds diagnostic software used when router is powered up. Stores the router’s bootstrap program.  Non-volatile RAM (NVRAM) - Stores startup configuration. This may include IP addresses (Routing protocol, Hostname of router)  Flash memory - Contains the operating system (Cisco IOS)  Interfaces - There exist multiple physical interfaces that are used to connect network. Examples of interface types: -Ethernet / fast Ethernet interfaces -Serial interfaces -Management interfaces

7 ITE PC v4.0 Chapter 1 7 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Four Basic Tasks: –POST –Bootstrap –Cisco IOS –Configuration Router Bootup Process

8 ITE PC v4.0 Chapter 1 8 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Step 1: Performing the POST (Power On Self Test) Stored in and run from ROM Executes diagnostics from ROM on several hardware components (CPU,RAM, NVRAM). After the POST is successful, the router executes the bootstrap program. Router Bootup Process POST ROM1.Perform POST

9 ITE PC v4.0 Chapter 1 9 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public BootstrapROM2.Load Bootstrap  Step 2: Loading the Bootstrap Program The program is copied from ROM into RAM. Executed by CPU. Its main task is to locate the Cisco IOS and load it into RAM. Router Bootup Process

10 ITE PC v4.0 Chapter 1 10 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Cisco IOS TFTP Server Flash3.Locate IOS  Step 3: Locating Cisco IOS Typically stored in flash memory, but it can be stored in other places such as a TFTP server. –If a full IOS image cannot be located, a scaled- down version of the IOS is copied from ROM. »This version of IOS is used to help diagnose any problems and to try to load a complete version of the IOS into RAM.  Step 4: Load Cisco IOS Copy the IOS into RAM for execution. Router Bootup Process

11 ITE PC v4.0 Chapter 1 11 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Configuration NVRAM TFTP Server Console 5.Locate the Configuration File  Step 5: Locating the Configuration File The IOS searches for the previously saved configuration commands (startup configuration file), in NVRAM. If there is no startup configuration, the program searches for a TFTP server. If a TFTP server cannot be found, the router will accept input from the Console.(setup-mode configuration) Router Bootup Process

12 ITE PC v4.0 Chapter 1 12 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Step 6: Loading the Startup Configuration or Entering Setup Mode. If a startup configuration file is found in NVRAM, the IOS loads it into RAM as the running-config file and executes the commands. If the startup configuration file cannot be located, the IOS prompts the user to enter setup mode. Router Bootup Process 6.Execute the Configuration File or enter “Setup” mode.

13 ITE PC v4.0 Chapter 1 13 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router Bootup Process POST ROM1.Perform POST BootstrapROM2.Load BootstrapCisco IOS TFTP Server Flash3.Locate IOS 4.Load IOS Configuration NVRAM TFTP Server Console 5.Locate the Configuration File 6.Execute the Configuration File or enter “Setup” mode.

14 ITE PC v4.0 Chapter 1 14 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router as a Computer  Major phases to the router boot-up process  Test router hardware Power-On Self Test (POST) Execute bootstrap loader  Locate & load Cisco IOS software -Locate IOS -Load IOS  Locate & load startup configuration file or enter setup mode -Bootstrap program looks for configuration file

15 ITE PC v4.0 Chapter 1 15 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router as a Computer  Verify the router boot-up process: -The show version command is used to view information about the router during the bootup process. Information includes:  Platform model number  Image name & IOS version  Bootstrap version stored in ROM  Image file name & where it was loaded from  Number & type of interfaces  Amount of NVRAM  Amount of flash  Configuration register

16 ITE PC v4.0 Chapter 1 16 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  The show version command is used to view information about the router during the bootup process. Verifying the Router Bootup Process

17 ITE PC v4.0 Chapter 1 17 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Port: –Normally means one of the management ports used for administrative access.  Interface: –Normally refers to interfaces that are capable of sending and receiving user traffic. However, these terms are often used interchangeably in the industry Router Interfaces

18 ITE PC v4.0 Chapter 1 18 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Console Port: –Used to connect a terminal or most likely a PC running terminal emulator software, –Must be used during initial configuration of the router.  Auxiliary (AUX) Port: –Not all routers have auxiliary ports. –At times, can be used similarly to a console port and can also be used to attach a modem. Router Ports Console Auxiliary

19 ITE PC v4.0 Chapter 1 19 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public

20 ITE PC v4.0 Chapter 1 20 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Router Interface is a physical connector that enables a router to send or receive packets  Each interface connects to a separate network  Consist of socket or jack found on the outside of a router  Routers have multiple interfaces used to connect to multiple networks.  Types of router interfaces: -Ethernet -Fastethernet -Serial. Router Interfaces Ethernet Serial

21 ITE PC v4.0 Chapter 1 21 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public

22 ITE PC v4.0 Chapter 1 22 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router Interfaces Every Interface on a router: - Belongs to a different network - Is a host on a different network - Has an IP address on a different network

23 ITE PC v4.0 Chapter 1 23 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  LAN Interfaces: –Ethernet –Fast Ethernet  Used to connect the router to the LAN. –Similar to the connection to a PC’s Ethernet NIC. Layer 2 MAC address Participates in the Ethernet LAN like any other host. –Typically an RJ-45 jack. Router to Switch: straight-through cable. Router to Router: cross-over cable. PC to Router: cross-over cable. Interfaces Belonging to Different Networks

24 ITE PC v4.0 Chapter 1 24 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  WAN Interfaces: –Serial  Used to connect routers to external networks, usually over a larger geographical distance. –The Layer 2 encapsulation can be different types (PPP, Frame Relay, HDLC).  Similar to LAN interfaces, each WAN interface has its own IP address and subnet mask, making it a member of a specific network. Interfaces Belonging to Different Networks

25 ITE PC v4.0 Chapter 1 25 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  The clock rate serves to synchronize the receiver on the other side of the link.  Each clock pulse signals the transmission of a bit.  Note that only DCE interfaces are generating/sending a clock

26 ITE PC v4.0 Chapter 1 26 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router as a Computer  Routers and the Network Layer Routers use destination IP address to forward packets  The path a packet takes is determined after a router consults information in the routing table.  After router determines the best path  Packet is encapsulated into a frame  Frame is then placed on network medium in form of Bits

27 ITE PC v4.0 Chapter 1 27 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Router as a Computer  Routers Operate at Layers 1, 2 & 3  Router receives a stream of encoded bits  Bits are decoded and passed to layer 2  Router de-encapsulates the frame  Remaining packet passed up to layer 3 -Routing decision made at this layer by examining destination IP address  Packet is then re-encapsulated & sent out outbound interface

28 ITE PC v4.0 Chapter 1 28 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Configure Devices and Apply Addresses  When designing a new network or mapping an existing network you must provide the following information in the form of a document: -Topology drawing that Illustrates physical connectivity –Address table that provides the following information:  Device name  Interfaces used  IP addresses  Default gateway

29 ITE PC v4.0 Chapter 1 29 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration DeviceInterfaceIP AddressSubnet Mask Default Gateway R1 Fa0/0192.168.1.1255.255.255.0N/A S0/0/0192.168.2.1255.255.255.0N/A R2 Fa0/0192.168.3.1255.255.255.0N/A S0/0/0192.168.2.2255.255.255.0N/A PC1N/A192.168.1.10255.255.255.0192.168.1.1 PC2N/A192.168.3.10255.255.255.0192.168.3.1

30 ITE PC v4.0 Chapter 1 30 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Configure Devices and Apply Addresses  Basic Router Configuration  A basic router configuration should contain the following: -Router name - Host name should be unique -Banner - At a minimum, banner should warn against unauthorized use: A login banner is displayed whenever someone connects to the router by telnet or console connections. -Passwords - Use strong passwords -Interface configurations - Specify interface type, IP address and subnet mask. Describe purpose of interface. Issue no shutdown command. If DCE serial interface issue clock rate command.  After entering in the basic configuration the following tasks should be completed -Verify basic configuration and router operations. -Save the changes on a router

31 ITE PC v4.0 Chapter 1 31 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Configure Devices and Apply Addresses  Verify Basic Router Configuration - Issue the show running-config command - Save the basic router configuration by Issuing the copy running-config startup-config command -Additional commands that will enable you to further verify router configuration are:  Show running-config - Displays configuration currently in RAM  Show startup-config - Displays configuration file NVRAM  Show IP route - Displays routing table  Show interfaces - Displays all interface configurations  Show IP int brief - Displays abbreviated interface configuration information

32 ITE PC v4.0 Chapter 1 32 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration

33 ITE PC v4.0 Chapter 1 33 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Configure Devices and Apply Addresses  Basic Router Configuration  User mode allows you to view the state of the router, but does not allow you to modify its configuration. Router>  The enable command is used to enter the privileged EXEC mode. This mode allows the user to make configuration changes on the router. The router prompt will change from a ">" to a "#" in this mode. Router>enable Router# Router#config t Router(config)#hostname R1

34 ITE PC v4.0 Chapter 1 34 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  User and Privileged Modes:  Configure Host Name: Basic Router Configuration Router>user mode Router> enable Router#privilege mode Router# configure terminal Router(config)# exit Router# config t Router(config)# hostname [name]

35 ITE PC v4.0 Chapter 1 35 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Configure Passwords: Basic Router Configuration Privilege password: Router(config)# enable secret [password] Console password: Router(config)# line console 0 Router(config-line)# password [password] Router(config-line)# login Telnet password: Router(config)# line vty 0 4 Router(config-line)# password [password] Router(config-line)# login

36 ITE PC v4.0 Chapter 1 36 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Configure Banner Message of the Day: Basic Router Configuration Router(config)# banner motd [# message #]

37 ITE PC v4.0 Chapter 1 37 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Configure Interfaces:  Each interface MUST belong to a different network. Basic Router Configuration Router(config)# interface [type][number] Router(config-if)# ip address [address] [mask] Router(config-if)# no shutdown

38 ITE PC v4.0 Chapter 1 38 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Verifying the Configuration:  Saving the Configuration: (copy from to) Basic Router Configuration Router# show running-config Router# show ip route Router# show ip interface brief Router# show interfaces Router# copy running-config startup-config

39 ITE PC v4.0 Chapter 1 39 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration DeviceInterfaceIP AddressSubnet Mask Default Gateway R1 Fa0/0192.168.1.1255.255.255.0N/A S0/0/0192.168.2.1255.255.255.0N/A R2 Fa0/0192.168.3.1255.255.255.0N/A S0/0/0192.168.2.2255.255.255.0N/A PC1N/A192.168.1.10255.255.255.0192.168.1.1 PC2N/A192.168.3.10255.255.255.0192.168.3.1

40 ITE PC v4.0 Chapter 1 40 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  Configure Host Name: Router> Router>enable Router# Router#configure terminal Router(config)#hostname R1 R1(config#)

41 ITE PC v4.0 Chapter 1 41 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  Configure Privilege Password: R1(config#)enable secret class

42 ITE PC v4.0 Chapter 1 42 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  Configure Passwords: R1(config)#line console 0 R1(config-line)#password cisco R1(config-line)#login R1(config)#line vty 0 4 R1(config-line)#password cisco R1(config-line)#login R1(config-line)#exit

43 ITE PC v4.0 Chapter 1 43 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  Configure Banner Message of the Day: –Enter a text message. End with the character ‘#’. R1(config)#banner motd # ****************************************** WARNING!! Unauthorized Access Prohibited!! ****************************************** # R1(config)#

44 ITE PC v4.0 Chapter 1 44 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  WAN Interface Configuration: R1(config)#interface Serial0/0/0 R1(config-if)#ip address 192.168.2.1 255.255.255.0 R1(config-if)#clockrate 64000 (DCE Only) R1(config-if)#no shutdown

45 ITE PC v4.0 Chapter 1 45 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  LAN Interface Configuration: R1(config)#interface FastEthernet0/0 R1(config-if)#ip address 192.168.1.1 255.255.255.0 R1(config-if)#no shutdown

46 ITE PC v4.0 Chapter 1 46 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  Each Interface Belongs to a Separate Network: R1(config)#interface FastEthernet0/1 R1(config-if)#ip address 192.168.1.2 255.255.255.0 192.168.1.0 overlaps with FastEthernet0/0 R1(config-if)#no shutdown 192.168.1.0 overlaps with FastEthernet0/0 FastEthernet0/1: incorrect IP address assignment

47 ITE PC v4.0 Chapter 1 47 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  Verifying Basic Router Configuration: R1#show running-config ! version 12.3 ! hostname R1 ! interface FastEthernet0/0 description R1 LAN ip address 192.168.1.1 255.255.255.0 ! interface Serial0/0

48 ITE PC v4.0 Chapter 1 48 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  Saving the Configuration: R1#copy running-config startup-config R1#show startup-config ! version 12.3 ! hostname R1 ! interface FastEthernet0/0 description R1 LAN ip address 192.168.1.1 255.255.255.0 !

49 ITE PC v4.0 Chapter 1 49 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Basic Router Configuration – R1  Show the Routing Table: R1# show ip route Codes: C - connected, S - static..(Output Omitted). Gateway of last resort is not set C 192.168.1.0/24 is directly connected, FastEthernet0/0 C 192.168.2.0/24 is directly connected, Serial0/0/0

50 ITE PC v4.0 Chapter 1 50 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Routing Table Structure  Routing Table is data file stored in ram and contains information about:  Directly connected networks - network that is directly attached to one of the router interfaces.  Remotely connected networks - this is a network that is not directly connected to a particular router  Detailed information about the networks include source of information, network address & subnet mask, and Ip address of next-hop router  Show ip route command is used to view a routing table

51 ITE PC v4.0 Chapter 1 51 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Example 192.168.1.0/24 192.168.2.0/24 192.168.3.0/24

52 ITE PC v4.0 Chapter 1 52 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Directly Connected Routes

53 ITE PC v4.0 Chapter 1 53 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Adding a connected network to the routing table - Router interfaces  Each router interface is a member of a different network  Activated using the no shutdown command  In order for static and dynamic routes to exist in routing table you must have directly connected networks

54 ITE PC v4.0 Chapter 1 54 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Codes: Indicate how the route waslearned.

55 ITE PC v4.0 Chapter 1 55 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Code Network Address and Subnet Mask Exit Interface

56 ITE PC v4.0 Chapter 1 56 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  A remote network is a network that is not directly connected to a router. –Remote networks are added to the routing table using two methods: Dynamic Routing Protocols: –Routes to remote networks that were learned automatically by the router. Static Routes: –Routes manually configured. –Either or both methods can be used in the same router.

57 ITE PC v4.0 Chapter 1 57 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Before any static or dynamic routing is configured: –The router only knows about its own directly connected networks. –Static and dynamic routes cannot exist in the routing table without first configuring a router’s own directly connected networks. –The router cannot send packets out an interface unless that interface is enabled with an IP address and subnet mask.

58 ITE PC v4.0 Chapter 1 58 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Static Routing  Static routes in the routing table - Includes: network address and subnet mask and IP address of next hop router or exit interface -Denoted with the code S in the routing table -Routing tables must contain directly connected networks used to connect remote networks before static or dynamic routing can be used  When to use static routes?? - When network only consists of a few routers -Network is connected to internet only through one ISP

59 ITE PC v4.0 Chapter 1 59 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Static Routing  Connected and Static routes

60 ITE PC v4.0 Chapter 1 60 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  A static route is defined using the: –Network address and subnet mask of the remote network. –The IP address of the next-hop router.  Static routes are denoted with the code S in the routing table. Static routes are examined in detail in the next chapter. Static Routing

61 ITE PC v4.0 Chapter 1 61 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  R1 has automatically learned about the 192.168.4.0/24 network from R2 through the dynamic routing protocol RIP (Routing Information Protocol). RIP will be fully discussed in later chapters. Dynamic Routing

62 ITE PC v4.0 Chapter 1 62 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Dynamic routing means: –Routes are automatically learned from other routers. –Each router automatically discovers its neighbor routers. –Routers exchange routing information. Dynamic Routing

63 ITE PC v4.0 Chapter 1 63 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Dynamic routing  Dynamic routing protocols - Used to add remote networks to a routing table -Are used to discover networks -Are used to update and maintain routing table  Automatic network discovery - Routers are able discover new networks by sharing routing information  IP routing protocols. Example of routing protocols include: - RIP -IGRP -EIGRP -OSPF

64 ITE PC v4.0 Chapter 1 64 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Routing Table Structure  Routing Table Principles -3 principles regarding routing tables: 1.Every router makes its decisions alone, based on the information it has in its routing table. 2.Different routing table may contain different information 3. A routing table can tell how to get to a destination but not how to get back

65 ITE PC v4.0 Chapter 1 65 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Routing Table Structure  Effects of the 3 Routing Table Principles - Packets are forwarded through the network from one router to another, on a hop by hop basis. -Packets can take path “X” to a destination but return via path “Y” (Asymmetric routing).

66 ITE PC v4.0 Chapter 1 66 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Routers do not necessarily have the same information in their routing tables. –Packets can traverse the network using one path. –Return through another path.  Asymmetric routing is more common in the Internet, which uses the BGP routing protocol. Asymmetric Routing

67 ITE PC v4.0 Chapter 1 67 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Introduction to Routing and Packet Forwarding Path Determination and Switching Functions

68 ITE PC v4.0 Chapter 1 68 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Layer 3 addresses: –Source Address: Source host address –Destination Address: Destination host address –Does not change during the forwarding of the data. Internet Protocol (IP) Packet Format

69 ITE PC v4.0 Chapter 1 69 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Layer 2 addresses: –Source address: Sending interface. –Destination address: Destination interface. –Interface-to-Interface on the same network. Changes from network to network. MAC Layer Frame Format

70 ITE PC v4.0 Chapter 1 70 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  If there are multiple paths to a network: –Best path determination involves evaluating multiple paths to the same destination and choosing the optimum route. –Each path uses a different router interface. –Depends on the routing protocol. Metric (value) the protocol uses to determine the distance to the destination network. The best path is the metric that has the lowest value. Best Path and Metrics

71 ITE PC v4.0 Chapter 1 71 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Hop Count as a metric: –The hop count is the number of routers that a packet must traverse between the source and destination networks. –The fewer number of hops (lowest metric), the better the route. –Routing Information Protocol (RIP)  Bandwidth (Capacity) as a metric: –The bandwidth is the carrying capacity (speed) of the link. –The metric is a calculated value that represents the fastest route to the destination based on the speed of the links between the source and destination. –Open Shortest Path First (OSPF) Comparing Hop count and Bandwidth Metrics

72 ITE PC v4.0 Chapter 1 72 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Comparing Hop Count and Bandwidth Metrics Using RIP: The lowest hop count is 2. The packet will be forwarded from R1 to R3. Using OSPF: Based on the bandwidth, the packet will be forwarded from R1 to R2 to R3. More hops, but faster lines.

73 ITE PC v4.0 Chapter 1 73 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Equal Cost Load Balancing What happens if a router has multiple paths with the same metric to the same destination network? The router will forward the packets, alternating between the “equal cost” interfaces.

74 ITE PC v4.0 Chapter 1 74 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Two Functions: –Path Determination –Switching Packet Forwarding

75 ITE PC v4.0 Chapter 1 75 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  The process of how the router determines which path to use when forwarding a packet. –The router searches its routing table for a network address that matches the packet’s destination network. –One of three path determinations results from this search. Directly connected network. Remote network. No route determined. Path Determination

76 ITE PC v4.0 Chapter 1 76 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Directly Connected Network: –R1 receives a packet destined for PC1. –R1 looks in the routing table and determines that the destination network is out its FastEthernet port. –The packet is forwarded directly to the device with the packet’s destination IP address. Path Determination

77 ITE PC v4.0 Chapter 1 77 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  Remote Network : –R1 receives a packet from PC1 whose ultimate destination is PC2. –R1 looks in the routing table and determines that the path to the destination network is via its WAN port. –The packet is forwarded to another router. Remote networks can only be reached by forwarding packets to another router. Path Determination

78 ITE PC v4.0 Chapter 1 78 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public  No Route Determined: –R1 receives a packet from PC1 whose ultimate destination is PC2. –R1 looks in the routing table and cannot find a path to a directly connected network or remote network. –If the router does not have a default route, the packet is discarded. The router sends an Internet Control Message Protocol (ICMP) Unreachable message to the source IP address of the packet. Path Determination ?

79 ITE PC v4.0 Chapter 1 79 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Packet Switching  Switching Function of Router is the process used by a router to switch a packet from an incoming interface to an outgoing interface on the same router. -A packet received by a router will do the following:  Strips off layer 2 headers.  Examines destination IP address located in Layer 3 header to find best route to destination.  Re-encapsulates layer 3 packet into layer 2 frame.  Forwards frame out exit interface.

80 ITE PC v4.0 Chapter 1 80 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Packet Switching  As a packet travels from one networking device to another -The Source and Destination IP addresses NEVER change -The Source & Destination MAC addresses CHANGE as packet is forwarded from one router to the next. -TTL field decrement by one until a value of zero is reached at which point router discards packet (prevents packets from endlessly traversing the network)

81 ITE PC v4.0 Chapter 1 81 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Host X sends a packet to Host Y. Host X sends a packet to Host Y. A router generally relays a packet from one data link to another, using two basic functions: a function – Routinga path determination function – Routing a function – Packet Forwardinga switching function – Packet Forwarding Let’s go through all of the stages these routers use to route and switch this packet. Switching Function Remember: Two addresses are needed to move a packet from the source to the destination. MAC Address IP Address

82 ITE PC v4.0 Chapter 1 82 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public How does Host X know to forward the packet to Router A and not directly to Host Y? Switching Function Layer 2 Destination Layer 2 Source Layer 3 Destination Layer 3 Source A111H111192.168.4.10192.168.1.10 Host X begins by encapsulating a packet with Host Y’s IP address and Router A’s MAC address. How does HOST X obtain Router A’s Layer 2 address? Host X determines that the destination is NOT on the same network. (More Later) The packet is forwarded to the default gateway. Queries the router for the router’s MAC address (more later).

83 ITE PC v4.0 Chapter 1 83 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public NOW what happens? Switching Function Layer 2 Destination Layer 2 Source Layer 3 Destination Layer 3 Source A111H111192.168.4.10192.168.1.10 Router A receives the packet on port fa0/0. Router A uses the destination IP address to search its routing table for network 192.168.4.0/24.. It finds that it has a next hop address of 192.168.2.2 and an exit port of fa0/1.

84 ITE PC v4.0 Chapter 1 84 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public NOW what happens? Switching Function Layer 2 Destination Layer 2 Source Layer 3 Destination Layer 3 Source A111H111192.168.4.10192.168.1.10 Router A knows that the exit port is an Ethernet interface. Router A looks in a table of IP address to MAC address for all connected networks. If the network isn’t there, it queries Router B for it’s MAC address.

85 ITE PC v4.0 Chapter 1 85 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Switching Function 192.168.1.10192.168.4.10H111A111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Router A now has all of the information it needs to forward the packet. It knows that the destination MAC address is B111 and that the exit port is fa0/1. Router A now re-encapsulates the frame, changing the Layer 2 addresses and switches the frame out port fa0/1. 192.168.1.10192.168.4.10A222B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination

86 ITE PC v4.0 Chapter 1 86 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 192.168.1.10192.168.4.10A222B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Switching Function Notice that the Layer 3 addresses in the packet DID NOT change! Also notice that the router A uses routing information to find: The next hop Layer 3 address The next hop Layer 2 address The exit port to use to forward the frame.

87 ITE PC v4.0 Chapter 1 87 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 192.168.1.10192.168.4.10A222B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Switching Function Router B receives the packet. NOW what happens? Router B uses the destination IP address to search its routing table for network 192.168.4.0/24. It finds that it has a next hop address of 192.168.3.2 and an exit port of s0/1 – a serial interface.

88 ITE PC v4.0 Chapter 1 88 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 192.168.1.10192.168.4.10A222B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Switching Function Router B knows that the exit port is a serial interface. NOW what happens? Since the exit interface is a serial interface, NOT an Ethernet interface, Router B does not need the Layer 2 address for the next hop. Remember, serial interfaces are like a pipe – one way in and one way out.

89 ITE PC v4.0 Chapter 1 89 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 192.168.1.10192.168.4.10A222B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Switching Function When the interface is a point-to- point serial connection, the routing table process does not even look at the next-hop IP address. Router B now encapsulates the IP packet into the proper data link frame. Router B now encapsulates the IP packet into the proper data link frame.

90 ITE PC v4.0 Chapter 1 90 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 192.168.1.10192.168.4.10A222B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination 192.168.1.10192.168.4.10B222FFFF Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Switching Function The destination Layer 2 address is set to a broadcast since there is only one end to the pipe. The source Layer 2 address is set to the MAC @ of exit port of Router B – the source of the frame. Finally, the frame is switched out port s0/1 on Router B.

91 ITE PC v4.0 Chapter 1 91 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 192.168.1.10192.168.4.10B222FFFF Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Switching Function Router C receives the frame on the serial interface - port s0/1 NOW what happens? Router C uses the destination IP address to search its routing table for network 192.168.4.0/24. It finds that the network is a directly connected network with an exit interface of fa0/0.

92 ITE PC v4.0 Chapter 1 92 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 192.168.1.10192.168.4.10B222FFFF Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Switching Function Router C realizes that this destination IP address is on the same network as one of its interfaces and it can send the packet directly to the destination and not another router. Since the exit interface is on an directly connected Ethernet network, Router C must obtain the destination’s MAC address.

93 ITE PC v4.0 Chapter 1 93 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public 192.168.1.10192.168.4.10B222FFFF Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Switching Function Router C looks in a table of IP address to MAC address for all connected networks. If the entry was not in the table, If the entry was not in the table, Router C would need to send a query out fa0/0 that says, “What is the MAC address for this IP address?” Host Y would send back a reply that says, “This is the MAC address that matches the IP Address you sent.” Host Y would send back a reply that says, “This is the MAC address that matches the IP Address you sent.”

94 ITE PC v4.0 Chapter 1 94 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Summary  Routers are computers that specialize in sending data over a network.  Routers are composed of: -Hardware i.e. CPU, Memory, System bus, Interfaces -Software used to direct the routing process  IOS  Configuration file  Routers need to be configured. Basic configuration consists of: -Router name -Router banner -Password(s) -Interface configurations i.e. IP address and subnet mask  Routing tables contain the following information -Directly connected networks -Remotely connected networks -Network addresses and subnet masks -IP address of next hop address

95 ITE PC v4.0 Chapter 1 95 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public Summary  Routers determine a packets path to its destination by doing the following  Receiving an encapsulated frame & examining destination MAC address.  If the MAC address matches then Frame is de-encapsulated so that router can examine the destination IP address.  If destination IP address is in routing table or there is a static route then Router determines next hop IP address. Router will re-encapsulate packet with appropriate layer 2 frame and send it out to next destination.  Process continues until packet reaches destination.  Note - only the MAC addresses will change the source and destination IP addresses do not change.

96 ITE PC v4.0 Chapter 1 96 © 2007 Cisco Systems, Inc. All rights reserved.Cisco Public


Download ppt "© 2007 Cisco Systems, Inc. All rights reserved.Cisco Public ITE PC v4.0 Chapter 1 1 Introduction to Routing and Packet Forwarding Routing Protocols and."

Similar presentations


Ads by Google