VLSM and RIPv2 Warren Toomey GCIT. Introduction Switches deliver frames to stations. Routers deliver...
-
Upload
ginger-holt -
Category
Documents
-
view
223 -
download
2
Transcript of VLSM and RIPv2 Warren Toomey GCIT. Introduction Switches deliver frames to stations. Routers deliver...
Introduction
Switches deliver frames to stations. Routers deliver packets to networks. Only the final router
has to deliver a packet to a station, as they are both on the same network.
Routers operate at OSI Layer 3. In particular, IP routers use link-independent addresses.
An IP address identifies an interface which is connected to a network. This means that routers have at least 2 IP addresses.
This also means that every point-to-point WAN connection between routers is also a separate IP network.
Introduction
Why do routers only route to networks? To keep their routing tables small, and to keep the process of routing fast.
At present, hundreds of millions of Internet stations connected to the Internet. But only hundreds of thousands of networks connected to the Internet.
Router tables look like the following:
Network Mask Cost Next Router
121.245.0.0 /16 23 66.4.1.2
192.167.23.0 /24 11 18.34.5.6
Networks and Subnets
Originally, 3 network sizes: Class A, B and C
Problems: not given out in a geographical basis
– No ability to aggregate networks Sizes are generally too big or too small Each network is a broadcast domain: broadcast
storms
Class
Network Field
Host Field
# Networks
# Hosts First Octet
A 8 bits 24 bits 126 16 million 0 to 126
B 16 bits 16 bits 16,384 65,534 128 to 191
C 24 bits 8 bits 2 million 254 192 to 223
Subnets
Earliest solution: subnet a network into many equal-sized networks
– Subnets kept hidden behind router, which aggregates all subnets into one network
Subnets
Done by borrowing bits from the host field to create the subnet field. Smaller subnets = smaller broadcast domains
Problem: R1 to R2 link is a subnet: we only need 2 IP addresses but there are 254, so we waste 252 IP addresses
Routing with Subnets
Early routing protocols (e.g. RIPv1) were classful but could deal with subnets as long as they were contiguous (not separated).
In previous diagram, R1 could advertise 131.66.0.0 /16
Discontiguous subnets not possible. R3 gets same advertisement from R1 and R2. Which way is right? Both of them!
Drawbacks of Subnets
All subnets are the same size. Many IP addresses are wasted
Cannot deal with discontiguous subnets, as any routing advertisement has to be classful (only /8, /16 or /24)
CIDR: Classless Internet Domain Routing
Create new routing protocols, or update existing routing protocols, to send the subnet mask with every advertisement
Allows the receiving router to determine the size of the network, i.e. the range of host addresses on that network
Allows routers to aggregate routes and advertised summarized routes to their neighbours
– e.g. two adjacent /24 subnets can be advertised as one /23 subnet
CIDR: Classless Internet Domain Routing
RIP was updated to RIPv2 to support CIDR New protocols such as EIGRP and OSPF support
CIDR IP address allocations no longer need to be
contiguous or the same size, as they were with subnets
Netmasks, Network Sizes, Step Factors
Netmask used to indicate the network part of the IP address (used to route packets) and the host part (used by last router for final delivery to station)
Traditionally, a 32-bit pattern with 1's for the network part and 0's for the host part, e.g.
– 11111111 11111111 11111111 00000000 Dotted decimal notation: 255.255.255.0 Prefix notation: /24 (number of 1 bits) We will use all three netmask formats
Netmasks, Network Sizes, Step Factors
Netmask tells you the size of the network
– e.g. /24 has 8 bits for hosts. 28 = 256 hosts
– On each subnet, 2 IP addresses are reserved Netmask also tells you the “step factor”: how far apart the
subnets are apart Once you have the base IP address of a network plus the
mask, you can determine:
– The network identity (same as base address)
– The broadcast address (last IP address in range)
– The set of usable IP addresses (all but 1st and last)
Step FactorsPrefix Netmask Step Factor Prefix Mask Step Factor
/8 (A) 255.0.0.0 1 in 1st octet /24 (C) 255.255.255.0 1 in 3rd octet
/9 255.128.0.0 128 in 2nd octet /25 255.255.255.128 128 in 4th octet
/10 255.192.0.0 64 in 2nd octet /26 255.255.255.192 64 in 4th octet
/11 255.224.0.0 32 in 2nd octet /27 255.255.255.224 32 in 4th octet
/12 255.240.0.0 16 in 2nd octet /28 255.255.255.240 16 in 4th octet
/13 255.248.0.0 8 in 2nd octet /29 255.255.255.248 8 in 4th octet
/14 255.252.0.0 4 in 2nd octet /30 255.255.255.252 4 in 4th octet
/15 255.254.0.0 2 in 2nd octet
/16 (B) 255.255.0.0 1 in 2nd octet
/17 255.255.128.0 128 in 3rd octet
/18 255.255.192.0 64 in 3rd octet
/19 255.255.224.0 32 in 3rd octet
/20 255.255.240.0 16 in 3rd octet
/21 255.255.248.0 8 in 3rd octet
/22 255.255.252.0 4 in 3rd octet
/23 255.255.254.0 2 in 3rd octet
Netmasks, Network Sizes, Step Factors
The number of addresses on any network is always 2host bits, and the number of usable host addresses on any network is always 2host bits -2.
The network identity address (i.e the first address on the network) must be a multiple of the step factor.
What type of address is 148.76.21.0/20?
/20: step factor is 16 in the 3rd octet, but 21 is not a multiple of 16. Therefore it must be a usable IP address in this subnet
Identity address: host bits all 0's, multiple of step factor. 148.76.16.0
Broadcast address: host bits all 1's, also the address below the next network.
Step factor is 16 in 3rd octet, so next network is 148.76.32.0
So broadcast address on the 148.76.16.0 network is 148.76.31.255
VLSM: Allocating Addresses
Variable Length Subnet Masks: process of dividing an IP allocation into subnets of different sizes, with different masks
Requires CIDR routing to advertise the different sizes.
Several ways of doing VLSM. Here are my rules:
1. Work out the required size for each network. Leave room for the identity & broadcast address.
2. Allocate networks from the biggest down to the smallest.
3. After each allocation, leftover addresses. Use from the biggest remaining down to smallest for future allocations.
4. Keep networks of the same size adjacent in the numbering. Keep networks connected to the same router adjacent in the numbering, too.
VLSM: Other Rules of Thumb
If you split a /N range into two, you end up with two /N+1 ranges.
Split into 4, get /N+2 ranges. Split into 8, get /N+3 ranges etc.
Remember to watch the step factor as you are subdividing and allocating addresses!
Remember that links between 2 routers are also networks. Allocate a size /30 subnet to each one.
Place point-to-point router address allocations at the bottom of the original address range.
VLSM: An Example
We are given 193.85.72.0/24 to VLSM subdivide Four LAN subnets. Two router-to-router (/30) subnets LAN 1: 20 hosts. Closet power of 2 is 32. Use /27 LAN 2: 12 hosts. Closest power of 2 is 16. Use /28 LAN 3: 25 hosts. Same as LAN 1: /27 LAN 4: 87 hosts. Closest power of 2 is 128. Use /25
VLSM: An Example
Start with 193.85.72.0, allocate the /25 (step of 128) Next is 193.85.72.128, allocate one /27 (step of 32) Next is 193.85.72.160, allocate next /27 (step of 32) Next is 192.85.72.192, allocate the /28 (step of 16) We have allocated IP ranges for the LANs We are up to 192.85.72.208. From here to 255 not yet used
VLSM: An Example
We are up to 193.85.72.208, with only the two /30 router to router links left to allocate
We have 256-208= 48 IPs left, but only need to allocate two /30 subnets (4 each), so we still have lots of IPs left
Start at the bottom and allocate two /30s (step of 4)
– 193.85.72.248 /30
– 193.85.72.252 /30
VLSM: An Example
Subnet Mask Range
193.85.72.0 /25 72.0 to 72.127 (126 usable IPs)
193.85.72.128 /27 72.128 to 72.159 (30 usable IPs)
193.85.72.160 /27 72.160 to 72.191 (30 usable IPs)
192.85.72.192 /28 72.192 to 72.207 (14 usable IPs)
193.85.72.248 /30 72.248 to 72.251 (2 usable IPs)
193.85.72.252 /30 72.252 to 72.255 (2 usable IPs)
Route Aggregation
A set of routes can be aggregated or summarised when there is a single route with a smaller mask prefix which covers the set of routes exactly
This lessens the RAM requirements for every router, and also allows them to find the correct route for each packet more quickly
Special conditions to make this occur. It's not easy to develop a design to do this
Example Route Summarisation Say we want to advertise a summarised route of 180.1.1.0 /25
This is the range 180.1.1.0 to 180.1.1.127 (step factor of 128)
We can break this into two /26 subnets (size 64 each)
0 to 63 for one of them, 64 to 127 for the other
Let's subdivide the second one into two /27 subnets (size 32 each)
64 to 95 for the first, 96 to 127 for the second
We now have one /26 and two /27s which exactly cover the original route of /25.
So, if we had these routes:
180.1.1.0/26, 180.1.1.64/27 and 180.1.1.96/27
We could summarise them as a single route: 180.1.1.0 /25
RIP Version 2: CIDR Support The first version of RIP does not support VLSM or CIDR
On Cisco routers, run show ip protocols to see what version of RIP your router uses to send advertisements
To switch to RIP version 2:
RIP Version 2: Summarisation RIPv2 still summarises network on classful boundaries by default
To stop this from happening: no auto-summary
RIP Version 2: Static Routes RIPv2 can advertise existing static routes too
Use the redistrubute static command
RIP Version 2: Debugging RIP v2 debugging enabled: you can see the advertisements with the
masks for each route