Presentation is loading. Please wait.

Presentation is loading. Please wait.

Introduction to Routing and Packet Forwarding

Similar presentations


Presentation on theme: "Introduction to Routing and Packet Forwarding"— Presentation transcript:

1 Introduction to Routing and Packet Forwarding
Routing Protocols and Concepts – Chapter 1

2 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 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 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 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 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 first of all any router to start working will require operating system, in case of CISCO router we call its operating system as IOS, which is stored in Flash drive bydefaults comes with any router. Second thing it requires is startup-config which is stored in NVRAM, built-in in cisco router, which indicates router what function it has to run, and the third one is running-config which it require in real time basis stored in RAM memory of Router, which is same as our Personal computer's RAM. Now keeping all this fact in mind, Now boot sequence would be, 1. On power on cisco router first will perform the POST( Power on self test).  The POST tests the hardware to verify that all components of the device are operational and present. For example, the POST checks for the different interfaces on the router. The POST is stored in and run from ROM (read-only memory). 2. The bootstrap looks for and loads the Cisco IOS software. The bootstrap is a program in ROM that is used to execute programs. The bootstrap program is responsible for finding where each IOS program is located and then loading the file. By default, the IOS software is loaded from flash memory in all Cisco routers. 3. The IOS software looks for a valid configuration file stored in NVRAM. which is called as startup-config. 4. If a startup-config file is in NVRAM, the router will load and run this file. The router is now operational. If a startup-config file is not in NVRAM, the router will start the setup-mode configuration upon bootup. 5. Any further modification on running router will be stored on RAM, where you need to manually execute command copy running-config startup-config to make your current configuration as a startup-config, every time you boot your router.

7 Router Bootup Process Four Basic Tasks: POST Bootstrap Cisco IOS
Configuration

8 Step 1: Performing the POST (Power On Self Test)
Router Bootup Process POST ROM Perform POST 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.

9 Step 2: Loading the Bootstrap Program
Router Bootup Process Bootstrap ROM 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.

10 Step 3: Locating Cisco IOS
Router Bootup Process Cisco IOS Locate IOS Flash TFTP Server 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.

11 Step 5: Locating the Configuration File
Router Bootup Process Configuration Locate the Configuration File NVRAM TFTP Server Console 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)

12 Step 6: Loading the Startup Configuration or Entering Setup Mode.
Router Bootup Process Execute the Configuration File or enter “Setup” mode. 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.

13 Router Bootup Process POST ROM Perform POST Bootstrap ROM
Load Bootstrap Cisco IOS TFTP Server Flash Locate IOS Load IOS Configuration NVRAM TFTP Server Console Locate the Configuration File Execute the Configuration File or enter “Setup” mode.

14 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 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 Verifying the Router Bootup Process
The show version command is used to view information about the router during the bootup process.

17 However, these terms are often used interchangeably in the industry
Router Interfaces 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

18 Router Ports Must be used during initial configuration of the router.
Console Auxiliary 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.

19

20 Router Interfaces Ethernet Serial Types of router interfaces:
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 .

21

22 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 Interfaces Belonging to Different Networks
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.

24 Interfaces Belonging to Different Networks
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.

25 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 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 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 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 Basic Router Configuration
Device Interface IP Address Subnet Mask Default Gateway R1 Fa0/0 N/A S0/0/0 R2 PC1 PC2

30 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 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 Basic Router Configuration

33 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 Basic Router Configuration
User and Privileged Modes: Configure Host Name: Router> user mode Router> enable Router# privilege mode Router# configure terminal Router(config)# exit Router# config t Router(config)# hostname [name]

35 Basic Router Configuration
Configure Passwords: 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 Basic Router Configuration
Configure Banner Message of the Day: Router(config)# banner motd [# message #]

37 Basic Router Configuration
Configure Interfaces: Each interface MUST belong to a different network. Router(config)# interface [type][number] Router(config-if)# ip address [address] [mask] Router(config-if)# no shutdown

38 Basic Router Configuration
Verifying the Configuration: Saving the Configuration: (copy from to) Router# show running-config Router# show ip route Router# show ip interface brief Router# show interfaces Router# copy running-config startup-config

39 Basic Router Configuration
Device Interface IP Address Subnet Mask Default Gateway R1 Fa0/0 N/A S0/0/0 R2 PC1 PC2

40 Basic Router Configuration – R1
Configure Host Name: Router> Router>enable Router# Router#configure terminal Router(config)#hostname R1 R1(config#)

41 Basic Router Configuration – R1
Configure Privilege Password: R1(config#)enable secret class

42 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)#exit

43 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 Basic Router Configuration – R1
WAN Interface Configuration: R1(config)#interface Serial0/0/0 R1(config-if)#ip address R1(config-if)#clockrate (DCE Only) R1(config-if)#no shutdown

45 Basic Router Configuration – R1
LAN Interface Configuration: R1(config)#interface FastEthernet0/0 R1(config-if)#ip address R1(config-if)#no shutdown

46 Basic Router Configuration – R1
Each Interface Belongs to a Separate Network: R1(config)#interface FastEthernet0/1 R1(config-if)#ip address overlaps with FastEthernet0/0 R1(config-if)#no shutdown FastEthernet0/1: incorrect IP address assignment

47 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 interface Serial0/0

48 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

49 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 /24 is directly connected, FastEthernet0/0 C /24 is directly connected, Serial0/0/0

50 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 Example /24 /24 /24

52 Directly Connected Routes

53 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 Codes: Indicate how the route was learned.

55 Network Address and Subnet Mask
Code Exit Interface

56 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 The router only knows about its own directly connected networks.
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 Static Routing -Denoted with the code S in the routing table
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 Static Routing Connected and Static routes

60 Static routes are examined in detail in the next chapter.
Static Routing 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.

61 RIP will be fully discussed in later chapters.
Dynamic Routing R1 has automatically learned about the /24 network from R2 through the dynamic routing protocol RIP (Routing Information Protocol). RIP will be fully discussed in later chapters.

62 Dynamic Routing Routes are automatically learned from other routers.
Dynamic routing means: Routes are automatically learned from other routers. Each router automatically discovers its neighbor routers. Routers exchange routing information.

63 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 Routing Table Structure
Routing Table Principles -3 principles regarding routing tables: Every router makes its decisions alone, based on the information it has in its routing table. Different routing table may contain different information A routing table can tell how to get to a destination but not how to get back

65 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 Asymmetric Routing 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.

67 Introduction to Routing and Packet Forwarding
Path Determination and Switching Functions

68 Internet Protocol (IP) Packet Format
Layer 3 addresses: Source Address: Source host address Destination Address: Destination host address Does not change during the forwarding of the data.

69 MAC Layer Frame Format Layer 2 addresses:
Source address: Sending interface. Destination address: Destination interface. Interface-to-Interface on the same network. Changes from network to network.

70 Best Path and Metrics 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.

71 Comparing Hop count and Bandwidth Metrics
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)

72 Comparing Hop Count and Bandwidth Metrics
Using RIP: The lowest hop count is 2. The packet will be forwarded from R1 to R3. T1 = 1.5MbPs Using OSPF: Based on the bandwidth, the packet will be forwarded from R1 to R2 to R3. More hops, but faster lines.

73 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 Packet Forwarding Two Functions: Path Determination Switching

75 Path Determination 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.

76 Path Determination R1 receives a packet destined for PC1.
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.

77 Path Determination 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.

78 ? Path Determination 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.

79 Packet Switching -A packet received by a router will do the following:
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 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 Switching Function 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 path determination function – Routing a switching function – Packet Forwarding Let’s go through all of the stages these routers use to route and switch this packet. Remember: Two addresses are needed to move a packet from the source to the destination. MAC Address IP Address

82 Switching Function Layer 2 Destination Layer 2 Source Layer 3 Destination Layer 3 Source A111 H111 Host X begins by encapsulating a packet with Host Y’s IP address and Router A’s MAC address. How does Host X know to forward the packet to Router A and not directly to Host Y? How does HOST X obtain Router A’s Layer 2 address? Queries the router for the router’s MAC address (more later). Host X determines that the destination is NOT on the same network. (More Later) The packet is forwarded to the default gateway.

83 Switching Function Router A receives the packet on port fa0/0.
Layer 2 Destination Layer 2 Source Layer 3 Destination Layer 3 Source A111 H111 Router A receives the packet on port fa0/0. NOW what happens? Router A uses the destination IP address to search its routing table for network /24. It finds that it has a next hop address of and an exit port of fa0/1.

84 Switching Function Layer 2 Destination Layer 2 Source Layer 3 Destination Layer 3 Source A111 H111 Router A knows that the exit port is an Ethernet interface. NOW what happens? 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 Switching Function A222 B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination H111 A111 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.

86 Switching Function A222 B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination 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 Switching Function Router B receives the packet. NOW what happens?
A222 B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Router B receives the packet. NOW what happens? Router B uses the destination IP address to search its routing table for network /24. It finds that it has a next hop address of and an exit port of s0/1 – a serial interface.

88 Switching Function A222 B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination 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 Switching Function A222 B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination 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.

90 Finally, the frame is switched out port s0/1 on Router B.
Switching Function B222 FFFF Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination A222 B111 Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination 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 of exit port of Router B – the source of the frame. Finally, the frame is switched out port s0/1 on Router B.

91 Switching Function B222 FFFF Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination 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 /24. It finds that the network is a directly connected network with an exit interface of fa0/0.

92 Switching Function B222 FFFF Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination 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 Switching Function B222 FFFF Layer 3 Source Layer 3 Destination Layer 2 Source Layer 2 Destination Router C looks in a table of IP address to MAC address for all connected networks. 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.”

94 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 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.


Download ppt "Introduction to Routing and Packet Forwarding"

Similar presentations


Ads by Google