Image of Cortney & Jeremy

Creating a NETMAP file for IOU

by Jeremy L. Gaddis on January 9, 2011 · 22 comments

in Networking

Those of you who use Dynamips and Dynagen are familiar with the .net files that are necessary for the virtual routers to interoperate (example). Cisco IOU also uses a file, named “NETMAP” to describe the virtual topology.

Here’s a simple NETMAP file:

101:0
101:18 102:2
102:0

There are two routers represented here, identified by “application ID” values 101 and 102 (which you pass to the IOU images when starting them up).

The first and last lines represent an interface which is connected to nothing. The second line shows that the interface on 101 identified by 18 is connected to the interface on 102 identified by 2. Where do these numbers come from you ask?

Unlike Dynamips/Dynagen, “NETMAP” does not use interface names but, rather, interface IDs. The IDs are not tied to a specific interface type (e.g. Serial or Ethernet). When launching an IOU instance, you can specify (via the command-line) which interfaces you want and how many. The ID used for Serial1/2 and Ethernet1/2 would be the same and, as such, it’s impossible to have both of those interfaces in an single instance.

To calculate the ID used by “interface x/y”, you would use the following formula:

id = x + (y * 16)

Examples:

  • interface 0/0 = 0
  • interface 0/3 = 48
  • interface 1/2 = 33
  • interface 12/1 = 28

Based on this formula, we can see that in the second line of the example NETMAP file, 101′s interface 2/1 is connected to 102′s interface 2/0.

Using this formula (and the resulting values), it should be fairly easily to construct your own NETMAP files from scratch.

Note that you can’t, unfortunately, “bridge” an IOU instance to a physical network without the use of another piece of software named “IOUlive”.

{ 22 comments… read them below or add one }

anonymous January 10, 2011 at 4:30 pm

Hey Jeremy, what’s that? CiscoLeaks?

just kidding…. :-)

Thanks for the great leaks, but I disagree on netmap file format.

Looking on disassembler error strings, seems that you can construct the netmap as follows:

5:2/0 6:2/0

it will connect R5 interface s2/0 to R6 interface s2/0. Easy one.

As next leak we can request IOS-NX please? :-D

An0n

Reply

Ahmed January 11, 2011 at 11:28 am

thank you for sharing this precious info. try this:

1:2/2 2:2/2

it means instance 1 interface 2/2 connected to instance 2 int 2/2:

in my topology they are serial interfaces:

Serial2/2

it works.

Reply

zouheir sawam April 4, 2012 at 5:34 am

hello ,

can you tell us how we can change the topology plz?

Reply

ciscofosho January 12, 2011 at 1:33 am

great info! now i can throw away the spread sheet i made for the interfaceid calculation :P

Reply

Anonymous January 14, 2011 at 1:36 am

Hi, and if i run multiple instances of router like 10 to 12, how will i add Multiple interfaces and access those routers like console ?

Reply

ciscofreak1928312 January 15, 2011 at 8:27 pm

is there an way to connect 3 routers via ethernet ( simple bridging )

Thnx

Reply

Anonymous January 16, 2011 at 12:22 am

There Must be some method to add ATM or NM16ESW Modules.

Reply

ricky January 16, 2011 at 4:36 am

hey, i got the following eror and anyone can resolve it?

root@ubuntu:~#./wrapper-linux -m i86bi_linux-adventerprisek9-ms -p 7200
Waitting on port 7200 …
Process Id for child is 16036, parent is 16035
unable to run router: NO such file or directory
IOU 16036 exit

Reply

Zohirsouam August 8, 2012 at 9:36 am

i have the same probleme as.

Reply

Zohirsouam August 8, 2012 at 9:37 am

Waiting on port 2001 …
Process Id for child is 1188, parent is 1186
Waiting on port 2002 …
Process Id for child is 1191, parent is 1189
Waiting on port 2003 …
Process Id for child is 1194, parent is 1192
Waiting on port 2004 …
Process Id for child is 1197, parent is 1195
Waiting on port 2005 …
Process Id for child is 1200, parent is 1198
Unable to run router: No such file or directory
IOU 1188 exit
root@flyxj:~/netmap/lab01# Unable to run router: No such file or directory
IOU 1191 exit
Unable to run router: No such file or directory
IOU 1194 exit
Unable to run router: No such file or directory
IOU 1197 exit
Unable to run router: No such file or directory
IOU 1200 exit

Reply

mohammed December 23, 2012 at 2:46 am

try adding ./ before the image name, like this

./wrapper-linux -m ./i86bi_linux-adventerprisek9-ms -p 7200 1

Reply

Anonymous January 16, 2011 at 5:15 pm

@Anonymous
./wrapper-linux -m ./i86bilinux-adventerprisek9-ms -p 10002 — -s 1 -e 0 -m 256 102 &
./wrapper-linux -m ./i86bi
linux-adventerprisek9-ms -p 10003 — -s 1 -e 0 -m 256 103 &
./wrapper-linux -m ./i86bi_linux-adventerprisek9-ms -p 10004 — -s 1 -e 0 -m 256 104 &

Just need to telnet to the port specified with -p

Reply

anonymous January 17, 2011 at 3:37 pm

@ciscofreak1928312

just put 1:0/0 2:0/0 3:0/0 in NETMAP

Reply

anonymous January 17, 2011 at 7:30 pm

An addition to all that: IOU across boxes works!!!

Specify 1:0/0 2:0/0@remote in NETMAP file.

Both local and remote hostnames must be resolvable by DNS or /etc/hosts to their respective LAN IPs and not 127.0.0.1, otherwise IOU will bind on 127.0.0.1 and will not accept any connections. The base port used is UDP 49000 (e.g. for id 10 is 49010).

I also noticed you cannot use the same local and remote ids, but this is acceptable IMHO.

Thanks

Reply

Anonymous January 18, 2011 at 3:45 am

wow man thanks

Reply

dmtjvn February 1, 2011 at 9:39 am

while trying to run on ubuntu I am getting following error will be able to help me how to resolve this ?

ThinkPad-T410:~/iou$ ./i86bilinux-adventerprisek9-ms
./i86bi
linux-adventerprisek9-ms: error while loading shared libraries: libcrypto.so.4: cannot open shared object file: No such file or directory

Thanks

Reply

Jeremy L. Gaddis February 1, 2011 at 9:48 am

@dmtjvn — read the FAQ.

Reply

Baba Diao March 8, 2011 at 11:45 am

Hi, I am trying to use IOU and can’t seem to have the serial interface connected: here is the example I am trying to setup:
1:2/0 3:2/0
2:2/0 3:2/1
Basically I am trying to simulate a Frame-relay switching with R3 connecting R1(S2/0) to R2(S2/0). But it doesn’t work. Then I tried to verify if I can establish a connection to the direct connected serial and he didn’t work either. Am I missing something or is there any specification I need to add to make it work????
Thank you for your help

Reply

mohammednisaf@hotmail.com March 23, 2011 at 4:21 am

Here you go R1-Hub R2 and R3 Spoke, R4 – frame relay switch.

Netmap

4:2/1 1:2/1
4:2/2 2:2/2

4:2/3 3:2/3

R4-Frame relay config

interface Serial2/1
no ip address
encapsulation frame-relay
logging event subif-link-status
logging event dlci-status-change
serial restart-delay 0
no frame-relay inverse-arp
frame-relay intf-type dce
frame-relay route 102 interface Serial2/2 201
frame-relay route 103 interface Serial2/3 301
!
interface Serial2/2
no ip address
encapsulation frame-relay
logging event subif-link-status
logging event dlci-status-change
serial restart-delay 0
no frame-relay inverse-arp
frame-relay intf-type dce
frame-relay route 201 interface Serial2/1 102
!
interface Serial2/3
no ip address
encapsulation frame-relay
logging event subif-link-status
logging event dlci-status-change
serial restart-delay 0
no frame-relay inverse-arp
frame-relay intf-type dce
frame-relay route 301 interface Serial2/1 103
!

R1

interface Serial2/1.12 point-to-point
ip address 10.1.12.1 255.255.255.0
frame-relay interface-dlci 102
!
interface Serial2/1.13 point-to-point
ip address 10.1.13.1 255.255.255.0
frame-relay interface-dlci 103

R2

interface Serial2/2.12 point-to-point
ip address 10.1.12.2 255.255.255.0
frame-relay interface-dlci 201

R3

interface Serial2/3.13 point-to-point
ip address 10.1.13.3 255.255.255.0
frame-relay interface-dlci 301

Reply

Asdasd December 21, 2011 at 12:17 pm

If someone could make a video regarding the NETMAP file

Reply

Zohirsouam April 4, 2012 at 5:31 am

hello,

how we can change the topology.

Reply

Chandan Dey March 24, 2014 at 4:09 am

How can I create Desktop/Server/Cloud in Web IOU.

Reply

Leave a Comment

Previous post:

Next post: