Вы находитесь на странице: 1из 73

Switching Basics and Intermediate Routing CCNA 3 Chapter 1

www.ciscopress.com

VLSM
Variable-length subnet masks were developed to allow multiple levels of subnetted IP addresses within a single network The routing protocol you use must support VLSM
Open Shortest Path First (OSPF) Enhanced Interior Gateway Routing Protocol (EIGRP) Routing Information Protocol version 2 (RIPv2)

VLSM is crucial for an effective IP addressing plan


www.ciscopress.com

VLSM
Prefix Length

Prefix length is a shorthand way for expressing the subnet mask for a particular network
Number of 1s in the binary representation of the subnet mask
When bits are taken from the host part of an address and added to the network part, the number of the bits in the host part decreases
You create additional subnets at the expense of the number of host devices on each network segment
www.ciscopress.com

VLSM
Prefix Length

Number of subnets can be calculated using the 2s formula, where s is the number of bits by which the default mask is extended In IOS releases prior to 12.0, you must explicitly allow subnet 0 In IOS releases 12.0 and later, subnet 0 is enabled by default The all-1s subnet has always been allowed
www.ciscopress.com

VLSM
Prefix Length

Bits that are not part of the network or subnetwork portions of the address are the range of host address Use the 2h 2 formula (where h is the number of host bits) to calculate available host addresses; all 0s in host portion is the subnet identifier address, all 1s in host portion is the subnet broadcast address

www.ciscopress.com

VLSM
Prefix Length
Network Mask and IP Address for the Range 192.168.1.64 Through 192.168.1.79, with Host Bits Shaded

In the IP network number that accompanies the network mask, the following are true:
When the host bits are all binary 0s, that address is the beginning of the address range When the host bits are all binary 1s, that address is at the end of the address range
www.ciscopress.com

VLSM
Prefix Length

Fourth Octet for the Range 192.168.1.64 Through 192.168.1.79 (continued on next slide)

www.ciscopress.com

VLSM
Prefix Length (continued)

Fourth Octet for the Range 192.168.1.64 Through 192.168.1.79 (continued)

www.ciscopress.com

VLSM
Prefix Length
In this example, PCs use the prefix length of 28 (the subnet mask 255.255.255.240) to determine which other devices on their local network have their first 28 bits in common
A 28-bit prefix length permits 14 hosts per subnet

The PC uses ARP to find the corresponding destination MAC address if communication with any of these devices is necessary If the destination IP address is not in the range for the subnet, the packet is forwarded to the default gateway
www.ciscopress.com

VLSM
Prefix Length

A router works in a similar manner when it makes a routing decision


It compares the destination IP address of the packet to network entries in the routing table The network entries have a prefix length associated with them The router uses the prefix length to determine how many destination bits must match to send the packet out the corresponding outbound interface that is associated with the network number in the routing table
www.ciscopress.com

VLSM
Prefix Length

The router determines from the table where to send the packet destined for 192.168.1.67
In this table, there are four entries for network 192.168.1.0 The third entry is for the 192.168.1.64 subnet, which is the subnet to which 192.168.1.67 belongs Note that the next subnet, 192.168.1.80, begins with a number larger than 192.168.1.67
www.ciscopress.com

VLSM
Benefits of VLSM

More efficient use of IP addresses


Without use of VLSM, a single subnet mask must be implemented with an entire Class A, B, or C network

Greater capacity to use router summarization (discussed later in this chapter)


Allows more hierarchical levels within an addressing plan

Isolation of topology changes from other routers


www.ciscopress.com

VLSM
Benefits of VLSM
VLSM Permits Flexible, Efficient Subnet Address Allocation

www.ciscopress.com

VLSM
VLSM Calculations

VLSM is used to maximize number of possible IP addresses available for a network


Point-to-point serial links require only two host addresses, so a /30 subnet does not waste scarce subnet addresses

With VLSM, you can subnet a subnet! Next slide will show how the subnet 172.16.32.0/20 is further subnetted with a /26 prefix
www.ciscopress.com

VLSM
VLSM Calculations

Further Subnetting 172.16.32.0/20 to /26 Prefixes

www.ciscopress.com

VLSM
VLSM Example
VLSM Used to Define Subnets of 172.16.32.0 Across the Boundary Between Octets Three and Four

www.ciscopress.com

VLSM
CIDR and Route Summarization
The definition of classless inter-domain routing (CIDR):
Allocation of one or more blocks of Class C network numbers to each network service provider Organizations using the network service provider for Internet connectivity are allocated bitmask-oriented subsets of the providers address space as required

CIDR (cider) was developed to address the problem of IP address space running out and core Internet routers running out of capacity Route summarization is the representation by a single network of a group of contiguous networks
www.ciscopress.com

VLSM
CIDR and Route Summarization

Route Summarization of Contiguous Subnets of a Class B Network

www.ciscopress.com

VLSM
CIDR and Route Summarization
Route Summarization of Contiguous Subnets of a Class B Network (continued) Router D in previous slide has these networks in its routing table
172.16.12.0/24 172.16.13.0/24 172.16.14.0/24 172.16.15.0/24

To calculate the summary route:


Find the number of highest-order bits that match in all addresses Locate where the common pattern of digits ends Count the number of common bits; this is the length of the summary route
www.ciscopress.com

VLSM
CIDR and Route Summarization
Route Summarization of Contiguous Subnets of a Class B Network (continued) Follow these guidelines when calculating summary routes:
Addresses that do not share the same number of bits as the prefix length of the summary route are not included in the summarization block The IP addressing plan is hierarchical in nature to allow router to aggregate the largest number of IP addresses into a single summary route IP networks can only be summarized in 2n networks (for some n), where the last octet of the first network in the sequence is divisible by 2n
www.ciscopress.com

VLSM
Route Aggregation
By using a prefix length instead of an address class to determine the network portion of the address, CIDR allows routers to aggregate routing information
Shrinks routing table One address and mask combination can represent the routes to multiple networks

Route aggregation is used more loosely than CIDR; describes the summarization of classful networks Without CIDR, routers must maintain tables for individual networks

www.ciscopress.com

VLSM
Route Aggregation
CIDR Permits the Aggregation of Contiguous Class B Networks

www.ciscopress.com

VLSM
Route Aggregation
Summarization Employs the Furthest-to-the-Right Principle

www.ciscopress.com

VLSM
Route Aggregation

In previous slide, the router can summarize routes to these networks using a 13-bit prefix which these 8 networks share
10101100 00011000 00000000 00000000 = 172.24.0.0 11111111 11111000 00000000 00000000 = 255.248.0.0

A single address and mask define a classless prefix that summarizes routes to the eight networks: 172.24.0.0/13
www.ciscopress.com

VLSM
Route Aggregation

Using a prefix to summarize routes results in the following:


More efficient routing A reduced number of CPU cycles when calculating a routing table or sorting through routing table entries to find a match Reduced router memory requirements

www.ciscopress.com

VLSM
Supernetting
The practice of using a summary network to group multiple classful networks into a single address is called supernetting
Subnetting breaks down a classful network Supernetting pastes together classful networks

With Class A and B address space almost exhausted, large organizations requested multiple Class C network addresses from their service providers A block of contiguous Class C addresses can appear as a single large network, or supernet
www.ciscopress.com

VLSM
Supernetting

Supernetting and route aggregation are similar


Route aggregation is used in the context of summarizing routes with BGP Supernetting is a term used when the summarized networks are under common administrative control

Many networking professionals use the terms route summarization and route aggregation interchangeably

www.ciscopress.com

VLSM
CIDR Example
CIDR Permits the Aggregation of Several Classful Networks into a Single Route Advertisement

www.ciscopress.com

Classful and Classless Routing


Behavior of classful routing is limited compared to classless routing
Classful routing protocols(RIPv1, IGRP) cannot do VLSM
Make routing decisions and send routing updates according to Class A, B, and C constructs

Classless routing protocols work independently of Class A, B, and C addresses

In the real world, classful routing protocols are close to becoming irrelevant
www.ciscopress.com

Classful and Classless Routing


Classful Routing
RIPv1 and IGRP are the two classful routing protocols
Rare to see either of these employed on a router today Classful routing protocols do not include subnet mask information in their updates

The router applies two options when receiving a routing update packet
If the routing update information contains the same major network number as configured on the receiving interface, the router applies the subnet mask that is configured on that interface If the routing update information contains a different major network than the one configured on the the receiving interface, the router applies the default subnet mask
www.ciscopress.com

Classful and Classless Routing


Classful Routing

The router applies two options when receiving a routing update packet (continued)
The default classful masks are:
Class A: 255.0.0.0 Class B: 255.255.0.0 Class C: 255.255.255.0

All subnets of the same major network (Classes A, B, and C) must use the same mask when using a classful routing protocol
www.ciscopress.com

Classful and Classless Routing


Classful Routing
Routers running a classful routing protocol perform automatic route summarization across network boundaries
They make assumptions about networks based on their IP address class These assumptions lead to automatic summarization of routes when routers send routing updates across major classful network boundaries

Routers send update packets to other connected routers


Routers sends entire subnet address (without mask); assume the network and the interface use the same subnet mask

www.ciscopress.com

Classful and Classless Routing


Classful Routing
Router receiving the update makes the same assumption
If different masks are used, router would have wrong information in routing table Important to use the same subnet mask on all interfaces that belong to the same classful network

When a router using a classful protocol sends an update regarding information of a subnet of a classful network across an interface belonging to a different classful network, the router assumes the remote router will use the default subnet mask for that IP address class
www.ciscopress.com

Classful and Classless Routing


Classful Routing

Automatic Summarization Occurs at Classful Boundaries with RIPv1 and IGRP

www.ciscopress.com

Classful and Classless Routing


Classful Routing

The process in the previous slide is automatic summarization across the network boundary
Router sends a summary of all the subnets by sending only major network information Classful routing protocols automatically create a classful summary route at major network boundaries Classful routing protocols do not allow summarization at other points within the major network space
www.ciscopress.com

Classful and Classless Routing


Classful Routing

The router that receives the updates behaves in a similar fashion


When a routing update contains information about a different classful network than the one that is in use on its interface, the router applies the default classful mask to that update

When using classful routing protocols, assigning the same subnet mask to all subnets is called fixed-length subnet masking (FLSM) sometimes called static-length subnet masking
www.ciscopress.com

Classful and Classless Routing


Discontiguous Subnets

A classical problem with classful routing protocols:


Discontiguous subnets occur when a major network separates subnets of a major network This can cause erroneous entries in routing tables Traffic will not always reach its destination

Do not permit the use of discontiguous networks when using a classful routing protocol
www.ciscopress.com

Classful and Classless Routing


Discontiguous Subnets

Discontiguous Subnets Present a Problem with Classful Routing

www.ciscopress.com

Classful and Classless Routing


Default Routes

Routers learn paths to destinations in three ways:


The system administrator defines static routes via an attached interface or the next hop to a destination The network engineer manually defines default routes as the path to take when no known route exists to the destination; default routes minimize the size of the routing table Dynamic routing occurs when the router learns of paths to destinations by receiving routing updates from other routers via a routing protocol
www.ciscopress.com

Classful and Classless Routing


Default Routes
You can define a static route with the ip route command:

You can define a default route with the ip default-network command:

www.ciscopress.com

Classful and Classless Routing


Default Routes
A Default Network is Configured Pointing Toward the Internet

www.ciscopress.com

Classful and Classless Routing


Default Routes
You can define a default route to work with either static or dynamic routing:

The 0s represent any destination with any mask Default routes are often referred to as quad-zero routes

www.ciscopress.com

Classful and Classless Routing


Classful Routing Table

What does a router running a classful routing protocol do with packets that lie in subnets that have no entry in the routing table?
The router discards the packets!

This can be overcome by using the ip classless command


Causes the router using a classful routing protocol to evaluate all packets using the longest-match criterion As a last resort, the router uses a configured default route
www.ciscopress.com

Classful and Classless Routing


Classless Routing

All routing protocols except RIPv1 and IGRP are classless routing protocols RIPv2, OSPF, IS-IS, EIGRP, and BGPv4 are classless routing protocols that support VLSM and CIDR With classless routing protocols, different subnets in the same major network can have different subnet masks
Maximizes use of addresses
www.ciscopress.com

Classful and Classless Routing


Classless Routing

Classful routing protocols automatically summarize to the classful network boundary; classless routing protocols allow you to control the route summarization process manually (might be needed to limit size of routing tables) Classless routing protocols do not automatically advertise every subnet By default, classless routing protocols perform automatic network summarization at classful boundaries, just like classful protocols
www.ciscopress.com

Classful and Classless Routing


Classless Routing

Difference between classless routing protocols and their predecessors is that you can manually turn off automatic summarization
Use the no auto-summary command Not needed with OSPF or IS-IS

Automatic summarization can cause problems in networks with discontiguous subnets


This can be fixed by turning off automatic summarization
www.ciscopress.com

Classful and Classless Routing


Classless Routing

Discontiguous Subnets Presenting a Problem with Classless Routing

www.ciscopress.com

Classful and Classless Routing


Effect of Auto-Summary and No Auto-Summary
Beginning with IOS Release 12.2(8)T, EIGRP and BGP had auto-summary enabled by default RIPv2 has always had auto-summary enabled by default Default Behavior of RIPv2 is to Automatically Summarize at the Network Boundary

www.ciscopress.com

Classful and Classless Routing


Effect of Auto-Summary and No Auto-Summary

RIPv2 Supports VLSM with Automatic Summarization Disabled

www.ciscopress.com

Classful and Classless Routing


Effect of Auto-Summary and No Auto-Summary

To disable auto-summary in RIPv2, use the no auto-summary command as seen below

www.ciscopress.com

RIP Version 2
RIP Version 1 characteristics
Uses hop count as the metric for path selection Maximum allowable hop count is 15, so infinite distance equals 16 hops Uses hold-down timers to prevent routing loops with a default of 180 seconds Employs split horizon to prevent routing loops Failure to receive routing updates in a timely manner results in removal of routes previously learned from a neighbor
www.ciscopress.com

RIP Version 2
RIP Version 1 characteristics (continued)
The administrative distance is 120 Routing updates are broadcast every 30 seconds by default Is capable of load-balancing over as many as six equal-cost paths; four is the default Does not support authentication Does not support VLSM because it is a classful routing protocol
www.ciscopress.com

RIP Version 2
RIP Version 2 characteristics
Uses hop count as the metric for path selection Maximum allowable hop count is 15, so infinite distance equals 16 hops Uses hold-down timers to prevent routing loops with a default of 180 seconds Employs split horizon to prevent routing loops Failure to receive routing updates in a timely manner results in removal of routes previously learned from a neighbor
www.ciscopress.com

RIP Version 2
RIP Version 2 characteristics (continued)
The administrative distance is 120 Routing updates are multicast every 30 seconds by default Is capable of load-balancing over as many as six equal-cost paths; four is the default Supports clear text and Message Digest 5 (MD5) authentication Supports VLSM because it is a classless routing protocol Supports manual route summarization
www.ciscopress.com

RIP Version 2
Major improvements with RIPv2:
Support of authentication
Clear text is the default MD5 used to encrypt enable secret passwords

VLSM use Sending subnet masks in updates Multicasting routing updates


Uses 224.0.0.9 as destination Keeps PCs and servers from having to process the broadcast
www.ciscopress.com

RIP Version 2
Multicasting routing updates (continued)
Keeps PCs and servers from having to process the broadcast (continued)
IP sends the packet to the User Datagram Protocol (UDP) and UDP checks whether RIP port 520 is available; most PCs and servers do not have a process running on this port and discard the packet Sometimes it is running as a gateway discovery technique in TCP/IP services, such as UNIX or Windows

www.ciscopress.com

RIP Version 2
Broadcast disadvantages of RIPv1
RIPv1 can fit up to 25 networks/subnets in each update; updates are sent every 30 seconds
If the routing table has 1000 subnets, 40 packets will be sent every 30 seconds Each of these broadcasts will have to be looked at by all devices on the network

www.ciscopress.com

RIP Version 2
Multicast advantages of RIPv2
The IP multicast address for RIPv2 has its own MAC address: 0x0100.5e00.0009 Devices such as PCs and servers read this MAC address and determine it is not for them; they discard the frame If a device cant distinguish this MAC address, the packet will be discarded at the IP layer (OSI network layer) as the multicast IP address is not the IP address of the device
www.ciscopress.com

RIPv2 Configuration
The router rip command starts a RIP routing process; the network command causes the implementation of these three functions:
Routing updates are multicast out an interface Routing updates are processed if they enter that same interface The subnet that is directly connected to that interface is advertised
www.ciscopress.com

RIPv2 Configuration
Sample Network and Configuration of RIPv2

www.ciscopress.com

RIPv2 Configuration
In the previous slide, these commands were used to configure Router A:
Enable RIP as the routing protocol: router RIP Identify Version 2 as the RIP being used: version 2 Specifying a directly connected network: network 172.16.0.0 Specifying a directly connected network: network 10.0.0.0
www.ciscopress.com

Verifying RIP Configuration


Sample Network for Verifying RIP Configuration

www.ciscopress.com

Verifying RIP Configuration


Most common commands for verifying RIP Configuration:
Display parameters for routing protocols: show ip protocols Summary of IP information and status of all interfaces: show ip interface brief Ensure that appropriate commands are configured for the RIP network: show running-config Display contents of routing table: show ip route

www.ciscopress.com

Verifying RIP Configuration

www.ciscopress.com

Verifying RIP Configuration

www.ciscopress.com

Verifying RIP Configuration


Fields in the Routing Table Defined

www.ciscopress.com

Troubleshooting RIP Configuration


Sample Network for Troubleshooting RIP Configuration

The debug ip rip command displays real-time RIP routing updates as they are sent and received To turn off debugging, use the no debug ip rip or the undebug all (u all) commands
www.ciscopress.com

Troubleshooting RIP Configuration


The debug ip rip command

www.ciscopress.com

Troubleshooting RIP Configuration


Sample debug ip rip output

www.ciscopress.com

Summary
Classless IP addressing is implemented with:
VLSM: the ability to subnet a subnet and use different subnet masks in the same classful network CIDR: the allocation of blocks of contiguous address space to customers by ISPs Route summarization: a generic term that describes the use of a single network to represent a sequence of logically contiguous networks Route aggregation: a generalized form of supernetting Supernetting: pasting together classful networks into supernets
www.ciscopress.com

Summary
Classful routing protocols:
RIPv1 IGRP

Classless routing protocols:


RIPv2 EIGRP OSPF IS-IS BGPv4

www.ciscopress.com

Summary
RIPv2, EIGRP, and BGPv4 can turn automatic route summarization on and off RIPv2 is an improvement to RIPv1 Adds authentication, VLSM support, passing of subnet masks in routing updates, and multicasting of routing updates Configuring RIPv2 requires adding the version 2 command; adding no auto-summary is recommended All connected networks participating in RIP are defined with the network command in the form of classful networks
www.ciscopress.com

Summary
RIP configuration can be verified with several commands: show ip protocols, show ip interface brief, show running-config, and show ip route You can troubleshoot RIP with the debug ip rip command

www.ciscopress.com