Presentation is loading. Please wait.

Presentation is loading. Please wait.

Variable-Length Subnet Masking (VLSM)

Similar presentations


Presentation on theme: "Variable-Length Subnet Masking (VLSM)"— Presentation transcript:

1 Variable-Length Subnet Masking (VLSM)
By R. Benjamin Kessler, CCIE #8762

2 Session Overview A Brief History of IPv4 Addressing
How to subnet a network Why VLSM? What problem are we trying to solve? Typical uses of VLSM How to do VLSM Math Questions © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 2

3 Obligatory OSI Model Reference
IP Addressing functions “live” at layer 3 of the OSI model © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 3

4 IPv4 Addressing History
Original Specifications (RFCs 790 & 791 – Sept., 1981) Fixed Length of four octets (32 bits) Up to 4,294,967,296 unique hosts Each address begins with the “network” portion followed by the “host” portion Three “Classes” (A, B, & C) © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 4

5 IP Address Classes Network “Class” determined by the high order address bits © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 5

6 IP Address Classes (cont’d)
Class “A” Networks – 128 networks (7 bits) Up to 16,777,214 hosts per network Class “B” Networks – 16,384 networks (14 bits) Up to 65,534 hosts per network Class “C” Networks – 2,097,152 networks (21 bits) Up to 254 hosts per network © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 6

7 Problems with IPv4 Addresses
How to Scale… Class “C” networks were too small Class “B” networks were too big © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 7

8 Subnetting Internet Standard Subnetting Procedure – RFC 950 (Aug., 1985) Defined a method to split a network into smaller (equal-size) pieces Increased flexibility for local admins Reduced Internet routing table size Increased stability of global routing table © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 8

9 Subnetting Single advertisement to the Internet;
Multiple segments/subnets internally © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 9

10 Subnet Masking Separates IP address into network and host portions in a “classless” manner Used to determine if the destination host is “local” or “remote.” – ARP or Route? A bitwise AND is performed to determine how datagrams are to be sent: IF bitwise_and(dest_ip_addr, my_ip_mask) = bitwise_and(my_ip_addr, my_ip_mask) THEN send dg locally (ARP) ELSE send dg to gateway (Route) © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 10

11 Subnet Masking IP Address: Subnet Mask:
Subnet Mask: Subnet Address (all zeros in host bits): Broadcast Address (all ones in host bits): Host address written as / Subnet Mask = 20 bits; also known as “Prefix Length” “CIDR Notation” for the address would be: /20 © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 11

12 Subnet Example Host A needs to communicate with Servers 1 & 2.
Must make “ARP or Route” decision © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 12

13 Subnet Example Subnet Mask: Host A: Server 1: Gateway – intf 1:
Host A: Server 1: Gateway – intf 1: Server 2: Gateway – intf 2: © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 13

14 Problems with Subnetting
Once designated, the size and number of subnets remains static. Making changes requires an organization to completely re-address all network subnets A lot of IP addresses are wasted on networks with only a few hosts © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 14

15 Example Network Each Subnet can support up-to 1022 hosts
Network A: wastes 722 addresses (70%) Network B: wastes 972 addresses (95%) Network C: wastes 1020 addresses (99%) Network D: wastes 1002 addresses (98%) Network E: wastes 522 addresses (51%) © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 15

16 Variable Length Subnet Masking (VLSM)
Concept introduced in RFC 1009 (Requirements for Internet Gateways – June, 1987) “Flexible use of the available address space will be increasingly important in coping with the anticipated growth of the Internet. Thus, we allow a particular subnetted network to use more than one subnet mask.” © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 16

17 Variable Length Subnet Masking (VLSM)
VLSM goes “Hand-in-hand” with Classless Inter-Domain Routing (CIDR) Legacy routing protocols are considered “classful” and don’t support VLSM – e.g. RIPv1, IGRP, EGP, etc. More recent protocols support VLSM by including the subnet mask (or prefix length) of a network in the route advertisement and are said to be “classless” – e.g. OSPF, EIGRP, IS-IS, BGPv4, etc. © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 17

18 Classful vs Classless Classful: Classless:
Size defined by the class (A, B, C, etc.) Fixed Network portion RIP & IGRP are classful routing protocols Classless: Network portion can be any size Protocol sends subnet (prefix) information with routes – e.g /18 RIPv2, EIGRP, OSPF, BGPv4 and IS-IS © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 18

19 Why VLSM? Benefits – Allows an organization to more efficiently assign IP address space Provides for route summarization/aggregation on non-classfull boundaries Reduces the size of a routing table Increases stability (reduces route flapping) © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 19

20 Efficient Address Assignment
In our previous example, we had our network ( /16) subnetted to with a 22-bit mask – a vast majority of the addresses were wasted using this mask on all subnets. By using VLSM, we can more efficiently assign addresses; this frees the wasted addresses for re-use in other parts of the network. © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 20

21 Example Network w/VLSM
Network A: Using 300 of 512 hosts (59% efficiency) Network B: Using 50 of 62 hosts (80% efficiency) Network C: Using 2 of 2 hosts (100% efficiency) Network D: Using 20 of 30 hosts (67% efficiency) Network E: Using 500 of 512 hosts (98% efficiency) © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 21

22 VLSM Operation Conceptually, a network is divided into subnets; some of the subnets are further divided into sub-subnets; and some of the sub-subnets are divided into sub2-subnets. VLSM permits the recursive division of a network prefix. © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 22

23 BIG Corp Network © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 23

24 Widget Mfg Division © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 24

25 Muncie Plant © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 25

26 VLSM Operation The recursive process does not require the same prefix-length at each level of recursion. The recursive subdivision can be carried out as far as required…until you run out of bits © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 26

27 VLSM Design Considerations
At each level of the hierarchy: How many total subnets does this level require today? How many hosts are there on this level’s largest subnet today? How much growth do we anticipate in the near future for each of the above? OK, at least double it! © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 27

28 VLSM Design and RFC 1918 Address allocation used to be much “harder” because of the need to justify your addressing requirements to some regional addressing authority (e.g. ARIN). For nearly all enterprises, the advent of RFC 1918 and NAT/PAT has made this much “easier” © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 28

29 VLSM Design and RFC 1918 Companies can use “private” addresses internally: – (10/8) – (172.16/12) – ( /16) Address allocations can be much more “liberal” than before. Private Addressing and NAT have extended the life of IPv4 addresses for the last 24 years and will continue to do so for several years down the road. © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 29

30 Requirements for VLSM The routing protocols must carry prefix-length (subnet mask) information for each route advertisement. All routers must consistently forward IP datagrams based on the longest match rule For route aggregation to occur, the addresses must be assigned in contiguous blocks so that there is topological significance. © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 30

31 Requirements for VLSM Routing Protocols –
OSPF, IS-IS, RIPv2, EIGRP, BGPv4 allow the deployment of VLSM by including the prefix length value along with each route advertisement. RIPv1 and IGRP only send the network information (no subnet mask) in each route advertisement and thus are not capable of supporting VLSM. © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 31

32 Requirements for VLSM Longest Match Rule
When forwarding a packet, a router will always prefer the route with the longest matching prefix over other, less-specific routes. router# show ip route .... S /26 [90/ ] via S /24 [120/4] via S /19 [110/229840] via A route with a longer prefix describes a subnet that has fewer possible destination hosts and thus is “more specific.” Routers must forward datagrams using the route with the “longest match” A packet destined toward will be directed toward because it is the most-specific matching route. © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 32

33 Requirements for VLSM Contiguous Assignments
Hierarchical routing requires that addresses be assigned to reflect the actual network topology. Routing information is reduced by taking a block of addresses assigned to a particular region of the network (or topology) and aggregating them into a single routing update for the entire set. This can be done recursively at various points within the hierarchy. If addresses do not have topological significance, aggregation cannot be performed and the size of the routing tables would not be reduced. © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 33

34 Typical Subnet Masks Used
LAN Segments – various masks (/30 or larger) Router Loopback Interfaces (/32) for management and routing protocol purposes Point-to-Point (P2P) Wide-Area-Network (WAN) Interfaces (/30 or /31) Multi-point WAN interfaces (/30 or larger) © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 34

35 VLSM Math Essentially the same as “regular” subnetting, except that subnets can be re-subnetted as needed. How many hosts per subnet? 2n – 2 hosts per subnet Where ‘n’ is the number of “host” bits in the subnet How many “sub” subnets? 2x subnets Where ‘x’ is the number of subnet bits “borrowed” from the parent network © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 35

36 Questions? © Copyright 2005 – Midwest Network Services Group, LLC – all rights reserved Slide # 36


Download ppt "Variable-Length Subnet Masking (VLSM)"

Similar presentations


Ads by Google