Ÿ Best match between destination IP address and network address in routing table IP Packet enters router’s Ethernet interface.. Router searches for a best match between packet’s destina
Trang 2Topics
l Inside the Router
Ÿ Routers are computers
Ÿ Router CPU and Memory
Ÿ Internetwork Operating
System
Ÿ Router Bootup Process
Ÿ Router Ports and Interfaces
Ÿ Routers and the Network
Ÿ Best Path and Metrics
Ÿ Equal Cost Load Balancing
Ÿ Basic Router Configuration
l Building the Routing Table
Ÿ Introducing the Routing Table
Ÿ Directly Connected Networks
Ÿ Static Routing
Ÿ Dynamic Routing
Ÿ Routing Table Principles
Trang 3Inside the Router
l Routers are computers
l Router CPU and Memory
l Internetwork Operating System
l Router Bootup Process
l Router Ports and Interfaces
l Routers and the Network Layer
Trang 4Routers are Computers
l A router is a computer:
Ÿ CPU, RAM, ROM, Operating System
l 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.
Leonard Kleinrock and the first IMP.
Trang 5l Routers forwarding packets (packet switching):
Ÿ From the original source to the final destination.
Ÿ Selects best path based on destination IP address
l A router connects multiple networks:
Ÿ Interfaces on different IP networks
Trang 6l Router interfaces:
Trang 7Routers Determine the Best Path
l The router’s primary responsibility:
Ÿ Determining the best path
Ÿ Forwarding packets toward their destination
Trang 8Routers Determine the Best Path
l Routing table
Ÿ Determines best path
Ÿ Best match between destination IP address and network
address in routing table
IP Packet enters router’s Ethernet interface.
Router examines the packet’s destination IP address.
Router searches for a best match between packet’s 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.
Trang 9Router
CPU and
Memory
l CPU - Executes operating system instructions
Ÿ running copy of configuration file
Ÿ routing table
Ÿ ARP cache
Ÿ Diagnostic software used when router is powered up
Ÿ Router’s bootstrap program
Ÿ Scaled down version of operating system IOS
Ÿ Stores startup configuration (including IP addresses, Routing protocol)
l Flash memory - Contains the operating system (Cisco IOS)
l Interfaces - There exist multiple physical interfaces that are used to connect
network Examples of interface types:
Ÿ Ethernet / fast Ethernet interfaces
Ÿ Serial interfaces
Ÿ Management interfaces
Trang 1010Router physical characteristics
Trang 11Ÿ Managing file systems
l Many different IOS images
l An IOS image is a file that contains the entire IOS for that router
Ÿ Router model
Ÿ IOS features
l Example IPv6 or a routing protocol such as Intermediate System–
to–Intermediate System (IS-IS).
Trang 12Router Bootup Process (more in later course)
Trang 14Where is the permanent configuration file stored used during boot-up? NVRAM
Where is the diagnostics software stored executed by hardware modules? ROM
Where is the backup (partial) copy of the IOS stored? ROM
Where is IOS permanently stored before it is copied into RAM? FLASH
Where are the bootsystem commands stored which are used to locate
Trang 16IOS
Bootup program
ios (partial) running-config
IOS (running)
Trang 171 POST
2 Bootstrap code executed
3 Check Configuration Register value (NVRAM)
0 = ROM Monitor mode
1 = ROM IOS
2 - 15 = startup-config in NVRAM
2 Check for IOS boot system commands in startup-config file (NVRAM)
If boot system commands in startup-config
a Run boot system commands in order they appear in startup-config to locate the IOS
b If boot system commands fail, use default fallback sequence to locate the IOS (Flash, TFTP, ROM)
3 Locate and load IOS, Default fallback sequence: No IOS boot system commands in startup-config
a Flash (sequential)
b TFTP server (netboot) - The router uses the configuration register value to form a filename from
which to boot a default system image stored on a network server
c ROM (partial IOS) or keep retrying TFTP depending upon router model
- If no IOS located, get partial IOS version from ROM
4 Locate and load startup-config configuration
a If startup-config found, copy to running-config
b If startup-config not found, prompt for setup-mode
c If setup-mode bypassed, create a “skeleton” default running-config (no startup-config)
Router Boot Process –
Details (later)
Trang 18Verify the router boot-up process
l show version command is used to view information about the
router during the bootup process (later)
Trang 19Ports and Interfaces
l Port - normally means one of the management ports used for
administrative access
l Interface normally refers to interfaces that are capable of sending
and receiving user traffic.
l Note: However, these terms are often used interchangeably in the
industry and even with IOS output.
Trang 20Ÿ PC running terminal emulator software
l No need for network access
l Used for initial configuration
Auxiliary (AUX) port
l Not all routers have auxiliary ports.
Ÿ At times, can be used similarly to a console port
Ÿ Can also be used to attach a modem
l Note: Auxiliary ports will not be used in this curriculum.
Trang 21Router Interfaces
l Interfaces - Receive and forward packets
Ÿ Various types of networks
Ÿ Different types of media and connectors
Ÿ Different types of interfaces
l Fast Ethernet interfaces - LANs
l Serial interfaces - WAN connections including T1, DSL, and ISDN
Trang 22Router Interfaces
l Router Interface:
Ÿ Different network
Ÿ IP address and subnet mask of that network
l Cisco IOS will not allow two active interfaces on the same
router to belong to the same network.
FastEthernet 0/0 MAC: 0c00-3a44-190a 192.168.1.1/24
FastEthernet 0/0 MAC: 0c00-41cc-ae12 10.1.0.1/16
Serial 0/0 172.16.1.1/24
Serial 0/1 172.16.1.2/24
Trang 23LAN Interfaces
l Ethernet and Fast Ethernet interfaces
l 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
l Typically an RJ-45 jack (UTP)
Ÿ Router to switch: straight-through cable
Ÿ Router to router: crossover cable
Trang 24WAN Interfaces
l Point-to-Point, ISDN, and Frame Relay interfaces
l Connects routers to external networks.
l The Layer 2 encapsulation can be different types including:
Ÿ Frame Relay
Ÿ HDLC (High-Level Data Link Control)
l Note: MAC addresses are used only on Ethernet interfaces and are
not on WAN interfaces
l Layer 2 WAN encapsulation types and addresses are covered in a
later course.
Trang 25l Layer 3 device because its primary forwarding
decision is based on the information in the Layer 3 IP
packet (destination IP address)
l This is known as routing.
Trang 2626Routers Operate at Layers 1, 2, and 3
Trang 27Path Determination and
Switching Functions
l Packet Fields and Frame Formats
l Best Path and Metrics
l Equal Cost Load Balancing
l Path Determination
l Switching Function
Trang 28Path Determination and Switching Functions
l The following sections focus on exactly what happens to data as it
moves from source to destination
Ÿ Review the packet and frame field specifications
Ÿ Discuss in detail how the frame fields change from hop to hop,
whereas the packet fields remain unchanged
Trang 29Ethernet Frame
l Layer 2 addresses:
Ÿ Interface-to-Interface on the same network.
Ÿ Changes as packet is decapsulated and encapsulated from
network to network
l 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)
IPv4 (Internet Protocol)
Trang 30Best Path
l Router’s best-path to a network:
Ÿ optimum or “shortest” path
l Routing protocol dependent
l Dynamic routing protocols use their own rules and metrics
l A metric is the quantitative value used to measure the distance to a
given route
l The best path to a network is the path with the lowest metric
l Example, a router will prefer a path that is one hop away over a path
that is two hops away.
Trang 31Best Path
1.5 Mbps
1.5 Mbps
l Comparing Dynamic Routing Protocols: RIP and OSPF
l RIP uses hop count
Ÿ R1 to R3
Ÿ Fewer links but much slower
l OSPF uses bandwidth
Ÿ R1 to R2 to R3
Ÿ More routers but much faster links
Trang 32What 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.
192.168.1.0/24
Trang 33Can 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.
192.168.1.0/24
Trang 34Path Forwarding
l Packet forwarding involves two functions:
Ÿ Path determination function
Ÿ Switching function
Trang 35Path Forwarding
l Path determination function is the process of how the router determines
which path to use when forwarding a packet.
l To determine the best path, the router searches its routing table for a
network address that matches the packet’s destination IP address.
l One of three path determinations results from this search:
Directly connected network
Router receives packet.
Destination IP address matches a network on one
of its directly connected networks.
Packet is forwarded out that network.
Trang 36Path Forwarding
l Path determination function is the process of how the router determines
which path to use when forwarding a packet.
l To determine the best path, the router searches its routing table for a
network address that matches the packet’s destination IP address.
l One of three path determinations results from this search:
Remote
network
Router receives packet.
Destination IP address matches a remote network which can only be reached via another router.
Packet is forwarded out that network to the next-hop router.
Trang 37Path Forwarding
l Path determination function is the process of how the router determines
which path to use when forwarding a packet.
l To determine the best path, the router searches its routing table for a
network address that matches the packet’s destination IP address.
l One of three path determinations results from this search:
Router receives packet.
Destination IP address does NOT match any network in the router’s routing table.
Packet is dropped.
No route determined
Does this mean the network does not
exist?
No, only that the router does not know
about that network (later)
Trang 38Path Forwarding
l Switching function is the process used by a router to:
Ÿ Accept a packet on one interface and
Ÿ Forward it out another interface
l A key responsibility of the switching function is to encapsulate
packets in the appropriate data-link frame type for the outgoing data
link.
Trang 39What 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
Trailer Type
800
Source MAC 00-20
Source IP 192.168.1.10
Dest IP 192.168.4.10
Layer 3 IP Packet
Trailer Type
800
Source MAC 0A-10
Trang 40Remember: Encapsulation
l Now, let’s do an example…
Data Other IP
fields
Source IP Address
Destination IP Address
Trailer Data
Type
Source Address
Destination
Address
Layer 3 IP Packet
Layer 2 Data Link Frame
Current Data Link
Address of Host or Router’s exit interface
Next hop Data
Link Address of
Host or Router’s
interface
These change from
host to router, router to
router, and router to
host.
These addresses
do not change!
Trang 41l This is just a summary.
l The details will be shown next!
l Now for the details…
Trailer Type
800
Source MAC 0A-10
Source IP 192.168.1.10
Dest IP 192.168.4.10
Layer 3 IP Packet
Trailer Type
800
Source MAC 00-20
Dest MAC
0B-31
Data
IP fields
Source IP 192.168.1.10
Dest IP 192.168.4.10
Trailer Type
800
Source Add Dest Add
FF-FF
Trang 42From Host X to Router RTA
l Host X begins by encapsulating the IP packet into a data link frame (in this
case Ethernet) with RTA’s Ethernet 0 interface’s MAC address as the data
link destination address.
l 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
l How does Host X know or get RTA’s Ethernet address?
Ÿ Checks ARP Table for Default Gateway IP Address and associated
MAC Address.
l What if it there is not an entry in the ARP Table?
Ÿ Host X sends an ARP Request and RTA sends an ARP Reply
Trailer Type
800
Source MAC 0A-10
Source IP 192.168.1.10
Dest IP 192.168.4.10
Layer 3 IP Packet
Trang 43RTA
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.
l 192.168.4.0/24 has next-hop-ip address of 192.168.2.2 and an exit-interface of e1
l 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
l 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
Trailer Type
800
Source MAC 00-20
Source IP 192.168.1.10
Dest IP 192.168.4.10
Layer 3 IP Packet
RTA Routing Table Network Hops Next-hop-ip Exit-interface 192.168.1.0/24 0 Dir.Conn e0
192.168.2.0/24 0 Dir.Conn e1 192.168.3.0/24 1 192.168.2.2 e1 192.168.4.0/24 2 192.168.2.2 e1
RTA ARP Cache
IP Address MAC Address
192.168.2.2 0B-31
Trailer Type
800
Source MAC 0A-10
Dest MAC
00-10
Trang 44RTB
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.
l 192.168.4.0/24 has next-hop-ip address of 192.168.3.2 and an exit-interface of Serial0
l 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
l 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.)
l The data link destination address is set to a broadcast (there’s only one other end of the pipe).
5 Packet is encapsulated into a new data link (serial, PPP) frame and sent out the link
Trailer Type
800
Source Add Dest Add
FF-FF
Layer 2 Data Link Frame
Data
IP fields
Source IP 192.168.1.10
Dest IP 192.168.4.10
Layer 3 IP Packet
RTB Routing Table Network Hops Next-hop-ip Exit-interface 192.168.1.0/24 1 192.168.2.1 e0
192.168.2.0/24 0 Dir.Conn e0 192.168.3.0/24 0 Dir.Conn s0 192.168.4.0/24 1 192.168.3.2 s0
Trailer Type
800
Source MAC 00-20
Dest MAC
0B-31