Thanks for the answer that clarified a lot.
Code:
The question is if one wants to run multiple instances of the script (be it pcap or udp transport), manually, and life with the limitations, or if someone is willing to integrate this into dynagen/GNS.
I tried making sense out of the dynagen source, to check how much effort such integration would mean - but im too much of a python noob :)
In order to integrate this into dynagen one does not really need to write anything in python, I can do that, becuase that is the easy integration part.
What we actually need (which is much harder to do), is a IOU hypervisor/wrapper that would:
1. encapsulate all those socket/UDP rewrites and provide a clean "per connection" UDP tunnel
2. provide IPC commands over TCP session
3. IPC for add/delete IOU instance
4. IPC for stop/start IOU instance
4. IPC for create/delete a NIC of a specific IOU instance
5. IPC for associating a IOU instance NIC with a UDP tunnel
6. IPC for changing the console port of a IOU instance
The IOU hypervisor/wrapper could be written in any language, will run independenly of dynagen, after start it will listen on a TCP port for incoming IPC connection from dynagen. Dynagen will feed the proper IPC commands to the wrapper, create instances, create nics, provide UDP tunnel details (src port, dst IP, dst port) etc.
We have already 2 wrappers that behave exactly like this:
1. dynamips hypervisor - see the hypervisor.mode file for the IPC description in dynamips sources. Hypervisor.c file contains the C code that implements this.
2. qemuwrapper - see the comments in the qemuwrapper.py file in any GNS3 installation
Also, one can easily observe how the GNS/dynagen is sending the IPC commands to the hypervisors by writing debug=1 into the .net file or into the GNS3 console window.