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.
Example:

network address 11.1.2.64/26 (network bits underscored)

11.1.2.64/26    = 00001011.00000001.00000010.01000000
                  -----------------------------

broadcast address in this net:
11.1.2.127      = 00001011.00000001.00000010.01111111
                  -----------------------------

netmask:
255.255.255.192 = 11111111.11111111.11111111.11000000
                  -----------------------------

host interface IP address range:
from 11.1.2.65  = 00001011.00000001.00000010.01000001
                  -----------------------------
to   11.1.2.126 = 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 80.00.00.00 /1 128.0.0.0 2048 M 128 A C0.00.00.00 /2 192.0.0.0 1024 M 64 A E0.00.00.00 /3 224.0.0.0 512 M 32 A F0.00.00.00 /4 240.0.0.0 256 M 16 A F8.00.00.00 /5 248.0.0.0 128 M 8 A FC.00.00.00 /6 252.0.0.0 64 M 4 A FE.00.00.00 /7 254.0.0.0 32 M 2 A FF.00.00.00 /8 255.0.0.0 16 M 1 A FF.80.00.00 /9 255.128.0.0 8 M 128 B FF.C0.00.00 /10 255.192.0.0 4 M 64 B FF.E0.00.00 /11 255.224.0.0 2 M 32 B FF.F0.00.00 /12 255.240.0.0 1024 K 16 B FF.F8.00.00 /13 255.248.0.0 512 K 8 B FF.FC.00.00 /14 255.252.0.0 256 K 4 B FF.FE.00.00 /15 255.254.0.0 128 K 2 B FF.FF.00.00 /16 255.255.0.0 64 K 1 B FF.FF.80.00 /17 255.255.128.0 32 K 128 C FF.FF.C0.00 /18 255.255.192.0 16 K 64 C FF.FF.E0.00 /19 255.255.224.0 8 K 32 C FF.FF.F0.00 /20 255.255.240.0 4 K 16 C FF.FF.F8.00 /21 255.255.248.0 2 K 8 C FF.FF.FC.00 /22 255.255.252.0 1 K 4 C FF.FF.FE.00 /23 255.255.254.0 512 2 C FF.FF.FF.00 /24 255.255.255.0 256 1 C FF.FF.FF.80 /25 255.255.255.128 128 1/2 C FF.FF.FF.C0 /26 255.255.255.192 64 1/4 C FF.FF.FF.E0 /27 255.255.255.224 32 1/8 C FF.FF.FF.F0 /28 255.255.255.240 16 1/16 C FF.FF.FF.F8 /29 255.255.255.248 8 1/32 C FF.FF.FF.FC /30 255.255.255.252 4 1/64 C FF.FF.FF.FE /31 255.255.255.254 2 1/128 C FF.FF.FF.FF /32 255.255.255.255 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 Net.link.cidr 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 Net.link.cidr 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. http://www.arin.net/intro.html

Excerpts:

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, http://www.ripe.net/
The Asia-Pacific equivalent of ARIN is APNIC, http://www.apnic.net/

continue the tutorials...