Scalable Simulation Framework
IP addresses in SSFNet

back to list of tutorials...

Variable Length Subnet Mask (VLSM) addressing in IPv4
how SSFNet assigns IP addresses to networks and interfaces
FYI: ARIN's address assignement policy

This page explains the principles of variable length subnet mask (VLSM) IP address allocation, specified in rfc1519 and rfc1878, and further explained in rfc2328 (OSPFv2).

A good source of information is Chuck Semeria's Understanding IP Addressing: Everything You Ever Wanted To Know (prefixes, CIDR, scaling, route aggregation), and Connected: An Internet Encyclopedia

You should know that SSFNet will automatically assign IP addresses to all host and router interfaces in your DML network model (to get this service, you should omit the cidr and ip attributes for links and Nets, and we recommend that you do omit them unless you understand well how to specify your own address aggregation policy). The IP addresses will be aggregated in blocks according to the CIDR (Classless Interdomain Routing) recommendations.

Variable Length Subnet Mask (VLSM) addressing in IPv4

Suppose that we have designed a network such as shown in Figure 1. In the following sections we describe an algorithm to assign IP addresses to networks and host/router interfaces as currently used by SSFNET.

Figure 1. A simple (but not too simple) network. Rectangles are IP routers, ovals are LANs (level 2 switched networks). Each LAN may have a certain number of hosts connected to it (not drawn). [ PDF version. ]

In the ideal VLSM addressing scheme, the Internet is composed of a hierarchy of subnetworks. The objective is to avoid wasting the IP addresses, and to use aggregated addresses to limit the size of routing tables. See Connected: An Internet Encyclopedia for an explanation of the basic concepts.

The format of a VLSM (possibly aggregated) network address is

a.b.c.d/p = network number (high p bits) + address space (low 32 - p bits)

A network can be further hierarchically subdivided into sub-networks, or in other words a block of IP addresses is hierarchically subdivided into sub-blocks. The division is on bit boundaries, thus the size of each address block is a power of two. If we represent such a hierarchical division of addresses as a tree, the leaf nodes of the tree contain blocks of physical interface addresses, and internal nodes of the tree contain subnet addresses.

It is simple, but important to understand, that a hierarchical subdivision of address space can be applied to networks whose physical topology is not a tree graph.

Two interface numbers correspond to special IP addresses and cannot be assigned to hosts:

  1. all 0 bits = IP network address
  2. all 1 bits = network's broadcast address.

network address (network bits underscored)    = 00001011.00000001.00000010.01000000

broadcast address in this net:      = 00001011.00000001.00000010.01111111

netmask: = 11111111.11111111.11111111.11000000

host interface IP address range:
from  = 00001011.00000001.00000010.01000001
to = 00001011.00000001.00000010.01111110

For convenience we reproduce below the table of prefixes (source: rfc 1878).

The following table lists the variable length subnets from 1 to 32, the CIDR [3] representation form (/xx) and the Decmial equivalents. (M = Million, K=Thousand, A,B,C= traditional class values) Mask value: # of Hex CIDR Decimal addresses Classfull /1 2048 M 128 A C0.00.00.00 /2 1024 M 64 A E0.00.00.00 /3 512 M 32 A F0.00.00.00 /4 256 M 16 A F8.00.00.00 /5 128 M 8 A FC.00.00.00 /6 64 M 4 A FE.00.00.00 /7 32 M 2 A FF.00.00.00 /8 16 M 1 A FF.80.00.00 /9 8 M 128 B FF.C0.00.00 /10 4 M 64 B FF.E0.00.00 /11 2 M 32 B FF.F0.00.00 /12 1024 K 16 B FF.F8.00.00 /13 512 K 8 B FF.FC.00.00 /14 256 K 4 B FF.FE.00.00 /15 128 K 2 B FF.FF.00.00 /16 64 K 1 B FF.FF.80.00 /17 32 K 128 C FF.FF.C0.00 /18 16 K 64 C FF.FF.E0.00 /19 8 K 32 C FF.FF.F0.00 /20 4 K 16 C FF.FF.F8.00 /21 2 K 8 C FF.FF.FC.00 /22 1 K 4 C FF.FF.FE.00 /23 512 2 C FF.FF.FF.00 /24 256 1 C FF.FF.FF.80 /25 128 1/2 C FF.FF.FF.C0 /26 64 1/4 C FF.FF.FF.E0 /27 32 1/8 C FF.FF.FF.F0 /28 16 1/16 C FF.FF.FF.F8 /29 8 1/32 C FF.FF.FF.FC /30 4 1/64 C FF.FF.FF.FE /31 2 1/128 C FF.FF.FF.FF /32 This is a single host route

Assignment of IP addresses to networks and host interfaces in SSFNet

SSFNet uses a two-stage procedure for assigning adress prefixes to networks, and IP addresses to host/router network interfaces.

In the first stage a modeler needs to specify the Net.cidr attribute for all included Nets, and attributes for all links, that represent the mapping of a desired subdivision of a top-level IP address block to the subnetworks.

The second stage - actual assignement of VLSM IP addresses to host/router interfaces and to subnets - is done automatically by a procedure implemented in package SSF.Net that reads the network DML file that includes the cidr attributes

If you DO NOT specify the Net.cidr and attributes, SSFNet will automatically do it for you as follows: links and Nets are assigned CIDR block addresses relative to that of the Net in which they are defined, starting from CIDR block zero.

Thus a network has one (or more) top-level prefixes, and for each prefix it has a hierarchy of subnets. Along a path in a subnet tree (from the root towards smaller subnets) each subnetting level has a longer prefix.

We illustrate the procedure for the example network topology shown above. One way of a hierarchical subdivision of our example network is shown in Figure 2 (print a PDF file if you don't see the small digits on screen). Note that a correct hierarchical subdivision must have the following properties:

Figure 2. One possible hierarchical assignement of subnetworks to IP address blocks. Each of the pink areas (1, 2, 3, 4) should receive a CIDR address block, which will be recursively subdivided according to the "cidr" tags attached to point-to-point links, LANs, and aggregate subnetworks (blue, yellow and green). Figure 3 shows the resulting tree representation of the subdivision of IP address blocks; leaf elements correspond to point-to-point links and LANs where the IP addresses are assigned to network interfaces. [ PDF version. ]

In this example the whole network is first divided into four pink subdivisions whose cidr attribute values are 1, 2, 3 and 4.

Let's focus on subnet "2". It is further subdivided into two blue sub-subnets with cidr values "2/5" and "2/6", and several networks which won't be subdivided any further: the LAN "L 1" which is assigned cidr value "2/1", and three point-to-point networks with values "2/2", "2/3" and "2/4". Don't forget that point-to-point IP links are subnets with two IP addresses, thus can always be assigned the /30 prefix.

Subdividing further, look at subnet "2/5": it has one LAN "L 3" with cidr = 2/5/5, and four point-to-point subnets.

You can continue analyzing the subdivisions and corresponding cidr attributes by printing Figure 2. Note that in the pink subnet with level "3" (lower right) there are LANs that interconnect several routers.

Figure 3. The tree representation of the subdivision of IP address blocks; leaf elements correspond to links (point-to-point and LANs) where the IP addresses are assigned to network interfaces. [ PDF version. ]

ARIN's address allocation policies

ARIN is a non-profit organization established for the purpose of administration and registration of Internet Protocol (IP) numbers to the geographical areas previously managed by Network Solutions, Inc. (InterNIC). ARIN became operational on 12/22/97 (That's why it's not mentioned in older textbooks). ARIN follows the rfc guidelines; and in essence is the authority whose practice operationally defines ASs and rules for CIDR block assignement to ASs.


In an effort to ensure that CIDR is implemented and utilized as efficiently as possible, ARIN issues blocks of addresses on appropriate CIDR-supported bit boundaries. To ensure that connectivity across the Internet is maintained, ISPs should use the following order of priority when they request IP address space:

1.Request IP address space from their upstream provider;
2.Request IP address space from their provider's provider;
3.Request IP address space from ARIN as a last resort.

In assigning IP address space to end users, ARIN takes guidance from assignment policies and procedures set forth in RFC 2050.

To enhance the possibility to receive IP addresses that are routable
across the Internet, end users requiring less than 32 class C’s should contact their upstream Internet Service Provider (ISP) to receive IP address space. For the reasons above, the minimum block of IP address space assigned by ARIN is a /19. End users must therefore meet the requirements for justifying the assignment of a /19.

Utilization rate of address space is a key factor in justification for network number assignment. Requestors must show exactly how previous address assignments have been utilized. The basic criteria that should be met to receive network numbers are:

a 25% immediate utilization rate, and
a 50% utilization rate within one year.

The European equivalent of ARIN is RIPE,
The Asia-Pacific equivalent of ARIN is APNIC,

continue the tutorials...