Documenti di Didattica
Documenti di Professioni
Documenti di Cultura
CIS 82 Routing Protocols and Concepts Rick Graziani Cabrillo College graziani@cabrillo.edu Last Updated: 2/16/2009
This Presentation
For detailed information see the notes section within this PowerPoint. This presentation is based on the Exploration course/book, Routing Protocols and Concepts. For a copy of this presentation and access to my web site for other CCNA, CCNP, and Wireless resources please email me for a username and password. Email: graziani@cabrillo.edu Web Site: www.cabrillo.edu/~rgraziani
Note
This chapter contains mostly introductory material. Most of not all of this information will be explained in more detail in later chapters or later courses. The bootup process and the IOS are examined in a later course. Do not worry or focus too much on the details for now. This will all be examined and explained in the following chapters.
Topics
Inside the Router Routers are computers Router CPU and Memory Internetwork Operating System Router Bootup Process Router Ports and Interfaces Routers and the Network Layer Path Determination and Switching Function Packet Fields and Frame Formats Best Path and Metrics Equal Cost Load Balancing Path Determination Switching Function
CLI Configuration and Addressing Implementing Basic Addressing Schemes Basic Router Configuration Building the Routing Table Introducing the Routing Table Directly Connected Networks Static Routing Dynamic Routing Routing Table Principles
A router is a computer: CPU, RAM, ROM, Operating System The first router: used for the Advanced Research Projects Agency Network (ARPANET): IMP (Interface Message Processor) Honeywell 516 minicomputer that brought the ARPANET to life on August 30, 1969.
Routers forwarding packets (packet switching): From the original source to the final destination. Selects best path based on destination IP address A router connects multiple networks: Interfaces on different IP networks
The routers primary responsibility: Determining the best path Forwarding packets toward their destination
10
IP Packet enters routers Ethernet interface. Router examines the packets destination IP address. Router searches for a best match between packets destination IP address and network address in routing table. Using the exit-interface in the route, the packet is forwarded to the next router or the final destination.
Routing table Determines best path. Best match between destination IP address and network address in routing table
11
12
13
Responsible for managing the hardware and software resources: Allocating memory Managing processes Security Managing file systems Many different IOS images. An IOS image is a file that contains the entire IOS for that router. Router model IOS features Example IPv6 or a routing protocol such as Intermediate System toIntermediate System (IS-IS).
14
15
Bootup Process
startup-config
IOS
NVRAM
ROM FLASH NVRAM
startup-config
IOS
? ? ? ? ? ? ?
startup-config
IOS
startup-config IOS
startup-config
IOS
19
20
21
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. Note: However, these terms are often used interchangeably in the industry and even with IOS output.
22
Management Ports
Console port Terminal PC running terminal emulator software No need for network access Used for initial configuration
Auxiliary (AUX) port Not all routers have auxiliary ports. At times, can be used similarly to a console port Can also be used to attach a modem. Note: Auxiliary ports will not be used in this curriculum.
23
Router Interfaces
Interfaces - Receive and forward packets. Various types of networks Different types of media and connectors. Different types of interfaces. Fast Ethernet interfaces - LANs Serial interfaces - WAN connections including T1, DSL, and ISDN
24
Router Interfaces
Router Interface: Different network IP address and subnet mask of that network Cisco IOS will not allow two active interfaces on the same router to belong to the same network.
25
LAN Interfaces
Ethernet and Fast Ethernet interfaces Connects the router to the LAN Layer 2 MAC address Participates in the Ethernet Address Resolution Protocol (ARP): Maintains ARP cache for that interface Sends ARP requests when needed Responds with ARP replies when required Typically an RJ-45 jack (UTP). Router to switch: straight-through cable Router to router: crossover cable
26
WAN Interfaces
Point-to-Point, ISDN, and Frame Relay interfaces Connects routers to external networks. The Layer 2 encapsulation can be different types including: PPP Frame Relay HDLC (High-Level Data Link Control). Note: MAC addresses are used only on Ethernet interfaces and are not on WAN interfaces. Layer 2 WAN encapsulation types and addresses are covered in a later course.
27
Layer 3 device because its primary forwarding decision is based on the information in the Layer 3 IP packet (destination IP address). This is known as routing.
28
29
31
Ethernet Frame
Layer 2 addresses: Interface-to-Interface on the same network. Changes as packet is decapsulated and encapsulated from network to network Layer 3 addresses: Original source layer 3 address (IP) Final destination layer 3 address (IP) Does not change (except with NAT, but this is not a concern of IP but an internal network process)
32
Best Path
Routers best-path to a network: optimum or shortest path Routing protocol dependent Dynamic routing protocols use their own rules and metrics. A metric is the quantitative value used to measure the distance to a given route. The best path to a network is the path with the lowest metric. Example, a router will prefer a path that is one hop away over a path that is two hops away.
33
Best Path
1.5 Mbps
1.5 Mbps
Comparing Dynamic Routing Protocols: RIP and OSPF RIP uses hop count R1 to R3 Fewer links but much slower OSPF uses bandwidth R1 to R2 to R3 More routers but much faster links
34
To reach the 192.168.1.0/24 network it is 2 hops via R2 and 2 hops via R4.
192.168.1.0/24
What happens if a routing table has two or more paths with the same metric to the same destination network? (equal-cost metric) Router will perform equal-cost load balancing.
35
T1 T3
192.168.1.0/24
Can a router use multiple paths if the paths (cost, metric) to reach the destination network are not equal? Yes, if the routers are using the EIGRP routing protocol which supports unequal cost load balancing.
36
Path Forwarding
Packet forwarding involves two functions: Path determination function Switching function
37
Path Forwarding
38
Path Forwarding
Remote network
Path determination function is the process of how the router determines which path to use when forwarding a packet. To determine the best path, the router searches its routing table for a network address that matches the packets destination IP address. One of three path determinations results from this search: Directly connected network Remote network No route determined
39
Path Forwarding
No route determined
Does this mean the network does not Path determination function is the process of how the router determines exist? which path to use when forwarding a packet.
To determine the best path, the router searches its routing table for a No, only address that the router does not know network that matches the packets destination IP address. about that network. (later) results from this search: One of three path determinations Directly connected network Remote network No route determined
40
Path Forwarding
Switching function is the process used by a router to: Accept a packet on one interface and Forward it out another interface A key responsibility of the switching function is to encapsulate packets in the appropriate data-link frame type for the outgoing data link.
41
192.168.4.10
Path Forwarding
192.168.1.10
Layer 3 IP Packet
Dest. IP 192.168.4.10 Source IP 192.168.1.10 IP fields Data Trailer
What does a router do with a packet received from one network and destined for another network? 1. Decapsulates the Layer 3 packet by removing the Layer 2 frame header and trailer 2. Examines the destination IP address of the IP packet to find the best path in the routing table 3. Encapsulates the Layer 3 packet into a new Layer 2 frame and forwards the frame out the exit interface
42
Remember: Encapsulation
These addresses do not change! These change from host to router, router to router, and router to host.
Layer 2 Data Link Frame
Destination Address Source Address Type Data Trailer
Layer 3 IP Packet
Destination IP Address Source IP Address Other IP fields Data
Layer 3 IP Packet
Dest. IP 192.168.4.10 Source IP 192.168.1.10 IP fields Data Trailer
This is just a summary. The details will be shown next! Now for the details
44
Layer 3 IP Packet
Dest. IP 192.168.4.10 Source IP 192.168.1.10 IP fields Data Trailer
From Host X to Router RTA Host X begins by encapsulating the IP packet into a data link frame (in this case Ethernet) with RTAs Ethernet 0 interfaces MAC address as the data link destination address. How does Host X know to forward to packet to RTA and not directly to Host Y? IP Source and IP Destination Addresses are on different networks How does Host X know or get RTAs Ethernet address? Checks ARP Table for Default Gateway IP Address and associated MAC Address. What if it there is not an entry in the ARP Table? Host X sends an ARP Request and RTA sends an ARP Reply
45
Layer 3 IP Packet
Dest. IP 192.168.4.10 Source IP 192.168.1.10 IP fields Data Trailer Trailer
RTA Routing Table Hops Next-hop-ip Exit-interface 0 Dir.Conn. e0 0 Dir.Conn e1 1 192.168.2.2 e1 2 192.168.2.2 e1
RTA 1. RTA examines Destination MAC address, which matches the E0 MAC address, so it copies in the frame. 2. RTA sees the Type field is 0x800, IP packet in the data field, a packet which needs to be routed. 3. RTA strips off the Ethernet frame. RTA looks up the Destination IP Address in its routing table. 192.168.4.0/24 has next-hop-ip address of 192.168.2.2 and an exit-interface of e1. Since the exit interface is on an Ethernet network, RTA must resolve the next-hop-ip address with a destination MAC address. 4. RTA looks up the next-hop-ip address of 192.168.2.2 in its ARP cache. If the entry was not in the ARP cache, the RTA would need to send an ARP request out e1. RTB would send back an ARP reply, so RTA can update its ARP cache with an entry for 192.168.2.2. 5. Packet is encapsulated into a new data link (Ethernet) frame. 46
Layer 3 IP Packet
Dest. IP 192.168.4.10 Source IP 192.168.1.10 IP fields Data Trailer
RTB Routing Table Hops Next-hop-ip Exit-interface 1 192.168.2.1 e0 0 Dir.Conn e0 0 Dir.Conn s0 1 192.168.3.2 s0
RTB 1. RTB examines Destination MAC address, which matches the E0 MAC address, and copies in the frame. 2. RTB sees Type field, 0x800, IP packet in the data field, a packet which needs to be routed. 3. RTB strips off the Ethernet frame. RTB looks up the Destination IP Address in its routing table. 192.168.4.0/24 has next-hop-ip address of 192.168.3.2 and an exit-interface of Serial0. Since the exit interface is not an Ethernet network, RTB does not have to resolve the next-hop-ip address with a destination MAC address. When the interface is a point-to-point serial connection, (like a pipe), RTB encapsulates the IP packet into the proper data link frame, using the proper serial encapsulation (HDLC, PPP, etc.). The data link destination address is set to a broadcast (theres only one other end of the pipe). 5. Packet is encapsulated into a new data link (serial, PPP) frame and sent out the link.
47
Layer 3 IP Packet
Dest. IP 192.168.4.10 Source IP 192.168.1.10 IP fields Data Trailer
RTC Routing Table Network Hops Next-hop-ip Exit-interface 192.168.1.0/24 2 192.168.3.1 s0 192.168.2.0/24 1 192.168.3.1 s0 192.168.3.0/24 0 Dir.Conn s0 192.168.4.0/24 0 Dir.Conn e0
RTC 1. RTC copies in the data link (serial, PPP) frame. 2. RTC sees the Type field is 0x800, IP packet in the data field, a packet which needs to be routed. 3. RTC strips off the data link, serial, frame. RTC looks up the Destination IP Address in its routing table.
RTC realizes that this Destination IP Address is on the same network as one of its interfaces and it can sent the packet directly to the destination and not another router. Since the exit interface is on an directly connected Ethernet network, RTC must resolve the destination ip address with a destination MAC address. 2. RTC looks up the destination ip address of 192.168.4.10 in its ARP cache. If the entry was not in the ARP cache, the RTC would need to send an ARP request out e0. Host Y would send back an ARP reply, so RTC can update its ARP cache with an entry for 192.168.4.10.
5. Packet is encapsulated into a new data link (Ethernet) frame and sent out the interface. 48
Layer 3 IP Packet
Dest. IP 192.168.4.10 Source IP 192.168.1.10 IP fields Data Trailer
Host Y Layer 2: Data Link Frame 1. Host Y examines Destination MAC address, which matches its Ethernet interface MAC address, and copies in the frame. 2. Host Y sees the Type field is 0x800, IP packet in the data field, which needs to be sent to its IP process. 3. Host Y strips off the data link, Ethernet, frame and sends it to its IP process. Layer 3: IP Packet 4. Host Ys IP process examines the Destination IP Address to make sure it matches its own IP Address.. If it does not, the packet will be dropped. 5. The packets protocol field is examined to see where to send the data portion of this IP packet: TCP, UDP or other? Layer 4: TCP, UDP or other? 49
Layer 3 IP Packet
Dest. IP 192.168.4.10 Source IP 192.168.1.10 IP fields Data Trailer
50
Networking Lab
NetLab
Packet Tracer
52
Console port
Rollover cable Terminal or a PC with terminal emulation software
=
Important: A console connection is not the same as a network connection!
54
Tera Term, HyperTerminal, Putty, etc. PC: Serial port & Router: Console Port Rollover or Console Cable
Console Port
55
NIC
What
What
When should you not use a network connection to configure the router?
router (telnet). software/command do you need? TCP/IP, Terminal prompt (DOS), Tera Term, etc. cable and ports do you use? PC & Router: Ethernet NIC Ethernet straight-through cable When the change may disconnect the telnet connection.
56
When can you use a network connection to the router? When there is a network connection to the
NIC Serial
Console Port
57
NetLab
58
NetLab
Basic Router Pod
59
up up up up
up up up up
60
61
telnet password
banner
configure interface
62
Other Commands
Router# copy running-config startup-config Router# Router# Router# Router# show show show show running-config ip route ip interface brief interfaces
63
Different Modes
Router# hostname R1 ^ % Invalid input detected at '^' marker. Router# configure terminal Router(config)# hostname R1 R1(config)#
Serial Connectors
Smart Serial Older Serial
2500 have the older, larger serial interfaces Later Cisco routers use the smart serial interfaces which allows more data to be forwarded across fewer cable pins.
65
Serial Connectors
DCE Cable
DTE Cable
Router is typically a DTE device. The DTE cable is connected to the serial interface on the router to a CSU/DSU device (DCE).
66
67
68
R1(config-if)# descri *Mar 1 01:28:04.242: %LINK-3-UPDOWN: Interface FastEthernet0/0, changed state to up *Mar 1 01:28:05.243: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/0, changed state to up R1(config-if)# description
To keep the unsolicited output separate from your input, enter line configuration mode for the console port and add the logging synchronous
69
Fa0/1
70
Fa0/1
71
Fa0/1
72
Verifying Interfaces
R1# show interfaces <some interfaces not shown> FastEthernet0/0 is up, line protocol is up (connected) Hardware is Lance, address is 0007.eca7.1511 (bia 00e0.f7e4.e47e) Description: R1 LAN Internet address is 192.168.1.1/24 MTU 1500 bytes, BW 100000 Kbit, DLY 100 usec, rely 255/255, load 1/255 Encapsulation ARPA, loopback not set ARP type: ARPA, ARP Timeout 04:00:00, Last input 00:00:08, output 00:00:05, output hang never Last clearing of show interface counters never Queueing strategy: fifo Output queue :0/40 (size/max) 5 minute input rate 0 bits/sec, 0 packets/sec 5 minute output rate 0 bits/sec, 0 packets/sec 0 packets input, 0 bytes, 0 no buffer Received 0 broadcasts, 0 runts, 0 giants, 0 throttles <output omitted> Serial0/0 is up, line protocol is up (connected) Hardware is HD64570 Description: Link to R2 Internet address is 192.168.2.1/24 MTU 1500 bytes, BW 1544 Kbit, DLY 20000 usec, rely 255/255, load 1/255 Encapsulation HDLC, loopback not set, keepalive set (10 sec) Last input never, output never, output hang never <output omitted>
73
Note: shutdown is the default. no shutdown does not show in the configuration.
74
Save Configuration
R1# copy running-config startup-config R1# show startup-config Using 728 bytes ! version 12.3 ! hostname R1 ! interface FastEthernet0/0 description R1 LAN ip address 192.168.1.1 255.255.255.0 ! interface Serial0/0 description Link to R2 ip address 192.168.2.1 255.255.255.0 clock rate 64000 ! banner motd ^C ****************************************** WARNING!! Unauthorized Access Prohibited!! ****************************************** ^C line con 0 password cisco login line vty 0 4 password cisco login ! end
75
77
Routing table is a data file in RAM that is used to store route information about: Directly connected networks Remote networks
78
Exit Interfaces
79
directly connected network is a network that is directly attached to one of the router interfaces. When a routers interface is configured with an IP address and subnet mask, the interface becomes a host on that attached network. Active directly connected networks are added to the routing table.
80
Remote Network
A remote network is a network that is not directly connected to the router. A remote network is a network that can only be reached by sending the packet to another router. Remote networks are added to the routing table using: (later) Dynamic routing protocol Static routes
81