VLSM - Variable Length Subnet Masking

TCP/IP Protocols Overview  |  IP  |  ARP  |  ICMP  |  

Variable Length Subnet Masks



11111111  11111111  11111100  00000000



Main Router:    11111111    11111111    11111100    00000000   
Field Router: 11111111 11111111 11111111 10000000


Sales = 001
Accounting = 010
Marketing = 011
Tech Support =    100

So, at a particular location, we discover that the bit sequence "000011" has been used to represent the site, say the network at the field office in Palo Alto, California. Here are the four divisions:

Sales = 000011 001 XXXXXXX
Accounting = 000011 010 XXXXXXX
Marketing = 000011 011 XXXXXXX
Tech Support =    000011    100    XXXXXXX

The "X"s represent the bits that are available to differentiate between individual stations (hosts) in each department. When viewed in the binary sense this scheme identifies FOUR fields. The NETWORK PORTION (in each case this is, the SUBNET (which is 000011), a "sub"-subnet (001,010,011, and 100) and the node portion (the "X"s). The routers understand how to divide the address based on the subnet mask. The world, in our example, sees The company sees Each field office sees The router masks the address and looks up the result in its table to determine how to forward the frame. Since the router "thinks" in binary there is no confusion, no problem. We, however, don't think in binary. Consider these three stations shown with their dotted decimal and binary representations:    10100000 . 00000110 . 00001100 . 10000001 10100000 . 00000110 . 00001110 . 00000001    10100000 . 00000110 . 00001110 . 10000001

When looking at the dotted-decimal notation there is nothing immediately obtuse. In fact, when looking at the binary you don't necessarily see the conflict immediately. To understand any subnet masking it is necessary to break the 32-bit address into the fields defined by the variable length masks.


Result = 10100000 . 00000110 . 00000000 . 00000000



Mask = 11111100 . 00000000
(160.6).12.129 00001100 . 10000001
(160.6).14.1 00001110 . 00000001
(160.6).14.129    00001110 . 10000001



  Result Of Masking
Mask = 11111111 . 10000000  
(160.6).12.129 00001100 . 10000001 00001100 . 10000000
(160.6).14.1 00001110 . 00000001 00001110 . 00000000
(160.6).14.129    00001110 . 10000001    00001110 . 10000000

It is critical that you understand this last step. Do you see that the bits included by the mask have been included in the result? Do you see the three additional bits used as the mask went from to Now we can assess the validity of the addresses. We know that the design intent called for four "sub"-subnetworks (001, 010, 011, and 100). Don't be confused because these bits "span" the dot in the dotted-decimal notation. This is the confusing aspect of using anything other than "255"s in a subnet mask; the actual fields don't break at the dots. The fields break as defined by the mask bits.

In this example, we know that all three stations are on the subnet defined with the leading bits "000011". This leaves the "other" three bits to further differentiate between sub-subnets. (By the way, the term "sub"-subnet is being used only in the context of this document. The real world simply calls all of them "subnets" without regard for their level of hierarchical differentiation.) The remaining three bits may be broken out as follows (this is the table above simply repeated and clarified):

  Result Of Masking
Mask = 11111111 . 10000000  

Compare this to the design document which defined:

Sales = 000011 001 XXXXXXX
Accounting = 000011 010 XXXXXXX
Marketing = 000011 011 XXXXXXX
Tech Support =    000011 100 XXXXXXX

What we now see is that the address has the subnet bits 101 at the mask point This is an address which is not defined by the design of the network. Herein lies the danger with variable length masking: it's awfully confusing to our decimal brains.

WildPackets is now Savvius

