Package SSF.Net.Util

SSFNet classes supporting model component addressing and automatic IP address allocation for networks and host/router interfaces.


Interface Summary

Class Summary
cidrBlock Tree of CIDR blocks, constructed from a Net configuration using the optional "cidr" attributes provided for Net and link attributes.

Package SSF.Net.Util Description

SSFNet classes supporting model component addressing and automatic IP address allocation for networks and host/router interfaces.

SSFNET supports multiple addressing and numbering schemes for networks, hosts/routers, and their interfaces.

The SSF.Net.Util.cidrBlock class implements NHI, CIDR block, IP, and AS addressing, and provides convenience methods to translate among these addressing styles.

Topological NHI addressing of Nets, Hosts, Interfaces n:n:n:h(i)

The basis of all addressing schemes is network topology, and in SSFNet, NHI (Net, Host, Interface) strings are the basic notation for identifying nodes and edges in the network graph.

Each Net, Host, Router, and NIC must either specify an integer ID (the id attribute) or an integer ID range (the idrange attribute). At a given level (e.g., within a given Net) the IDs and ID ranges of sub-Nets may not overlap; they need not be compact, however. The same is true of Hosts and Routers, and of NICs.

The global NHI address of a network is created by concatenating the ID of each network from the outermost to the innermost, separated by colons (":"). Similarly, the global NHI address of a host or router is created by concatenating the global NHI address of its containing network with the Host ID, separated by a colon. Finally, the NHI address of a NIC is created by adding the NIC ID, in parenthesis, to the containing Host NIC address.

For example, in this nested Net:

 Net [ id 3
   Net [id 7
    Net [id 8
      Host [id 9 ...
            interface [id 2]

The outmost Net has NHI address 3, the next Net has address 3:7, and the innermost Net has address 3:7:8. The Host has NHI address 3:7:8:9, and the interface has NHI address 3:7:8:9(2).

NHI numbers are specified by the modeler's use of ID attributes. The ids have integer values that need not be sequentially assigned, although it is strongly recommended. The component link does not have the id attribute. The IDs are never automatically generated; omitting an id or idrange attribute at any level other than the topmost level is an error. As per the Net schema, the root Net should not have an id, idrange, or cidr address specified; only imported Nets acquire these.

The id attributes for Nets and for hosts and routers belong to the same address space, thus should be all distinct.

Within each host or router instance the integer values uniquely identify network interfaces.

The above definitions of id attributes permit to compose bigger networks from instances of Net without the need to re-number their internal components' ids.

Note that when a Net is included in another Net, each of its NHI identifiers simply acquires one more N: at the front of the N:N:...:N:H(I) string, when it is addressed from the importing Net. More examples:

Example 1: in the simplest case of a Net containing only hosts, routers and links, use H(I) only, e.g. 33(2) for host 33, interface 2.

Example 2: if a Net contains two Nets numbered 1, 2, then interface 1 on host 7 in Net 1 is 1:7(1), and interface 1 on host 7 in Net 2 is 2:7(1). The corresponding hosts are 1:7 and 2:7, respectively.

Example 3: If Net 1 in Example 2 is further composed of Nets numbered 1,2,3,4, then an interface belonging to lowest level Net 4 could be identified in the master Net as 1:4:98(12), or in words: interface 12 of router 98 in Net 4 in Net 1".

CIDR hierarchy addressing i/j/k/l

Each Link and Net (other than the root (toplevel) Net) in a DML model has associated with it a CIDR block address, consisting of 1 or more integers separated by slashes ("/"). If cidr attributes are entirely omitted, they will be automatically computed by SSF.Net.Net 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.

Simply speaking, cidr attributes specify a logical tree of subblocks of the toplevel IP address block allocated to a model. The values of cidr attributes are slash-separated integers similarly to a UNIX directory tree, and thus manually specified CIDR addresses may be multilevel: e.g., link [ cidr 1/2/4 ...] means "this network link shall get IP addresses from block 4 in block 2 in block 1". No two Nets or links may manually specify the same CIDR address; this is flagged as an error. In general, modelers should defer to the framework for automatic CIDR assignment unless they know what they're doing: It is easy to make errors, and that feature should be used with caution. The manually assigned CIDR attributes are not checked for consistency in SSFNet 1.x.

Read about Variable Length Subnet Mask IP address assignment, and see an example in a mini-tutorial on cidr attributes in DML networks.

IP addressing a.b.c.d/p

The SSFNet version 1.x supports Variable Length Subnet Mask (VLSM) IP address assignement method. The IP addresses may be allocated in either of three mutually exclusive ways:

Manually, using attributes Net.ip, and, Net.router.interface.ip. Use with caution, as manually assigned IP addresses are not verified for consistency in this release.

Using the optional attributes Net.cidr and to guide the IP address assignement algorithm implemented in package SSF.Net.

Fully automatically if neither cidr nor ip attributes are provided.

Autonomous Systems numbers


While not a full addressing scheme, SSFNet supports the automatic assignment of identifier numbers to autonomous systems. An included Net that specifies the AS_status boundary attribute specifies that it is the enclosing Net of an autonomous system, and is assigned the next free autonomous system number, starting from one. It's an error to specify that a Net is the root of an autonomous system if it is contained within another Net that is the root of an autonomous system.

SSFNet 1.x implementation of addressing

Currently the logic of SSF.Net is as follows: if you omit cidr attributes, it makes default cidr blocks automatically; if you omit ip attributes, it uses cidr (provided or computed) to make ip; if you supply ip, it ignores cidr if also provided.