Running two simultaneous instances of the Dynamips hypervisor

Running Dynamips can really tax system resources.  Often times it’s CPU utilization that’s first considered with several different routers.  While high CPU utilization can occur (shouldn’t be constant if the idle-pc values are adjusted properly for the different IOS images), I’ve run into more problems with memory utilization.

Each operating system has certain limitations in terms of how much memory space can be accessed by a single user-mode process.  Many people use one or another variant of the Microsoft Windows operating system (OS).  According to Microsoft (http://msdn.microsoft.com/en-us/library/aa366778.aspx), the limit for 32-bit user-mode processes is 2GB.  This can easily be exceeded with a large Dynamips/Dynagen lab.  The following is how I’ve overcome this limitation, by using multiple Dynamips hypervisor instances.

If Linux is your OS of choice, it also has limitations, however these can vary between distro (consult your distro’s documentation).  Even if your distro supports more than 2GB per process, it might be beneficial to utilize two Dynamips hypervisors.

The simple answer to this is to run two Dynamips hypervisors, then split up the routers in your .net files between the two hypervisors.  The following file is the .cmd file that I use to start two hypervisors (this is specific to Windows, although a shell script could easily be written in Linux or other OSs).

@echo off
rem Launch a local copy of dynamips
set dynamips=%CD%dynamips-wxp.exe
cd %TEMP%
start /belownormal /B “Dynamips” “%dynamips%” -H 7200
start /belownormal /B /wait “Dynamips” “%dynamips%” -H 7201
REM start /belownormal /B /wait “Dynamips” “%dynamips%” -H 7202
pause

This can be ideal when dealing with more than a half dozen routers (based on my experience).  The overall system memory usage is still high, however the infamous Dynamips crashing upon starting all of the routers doesn’t occur because of lack of memory resources.

The following is a sample .net file that uses the two hypervisors.  The two additions here are that there are two [localhost] entries (with the hypervisor ports, respectively) and the use of the udp command in each instance.

[localhost:7200]
udp = 15000

[[3640]]
image = <your image here>
ram = 128    # Amount of Virtual RAM to allocate to each router instance.
[[ROUTER CE1LAN]]
fa0/0 = S1 2
console = 2010

[localhost:7201]
udp = 15050

[[3640]]
image = <your image here>
ram = 128    # Amount of Virtual RAM to allocate to each router instance.

[[7200]]
image = <your image here>
npe = npe-200
midplane = std
ram = 256
nvram = 256

[[ROUTER HEAD]]
fa0/0 = S0 1    # outside (internet)
fa1/0 = S4 1    # inside (untrusted)
console = 2016

There are posts within this site that utilize multiple Dynamips hypervisor instances, so keep your eyes open for them!

In closing, I put a shortcut to the .cmd file (see above) to start the two Dynamips hypervisors.  If I anticipate using more than ~6 routers in a lab, I'll break them up between the two hypervisors.  Doing this, I haven't had near the stability issues that I previously had.

Leave a Reply

Your email address will not be published.

HTML tags are not allowed.

WordPress Themes