Is the larger code free software and available somewhere for inspection?
Yes, the "larger" program is ns-2, a network simulation program. You find it at http://isi.edu/nsnam/ns/. I'm working with the ns-allinone-2.33 packet. Please let me know if you find some different behaviour of ns-2 from my description, and also if you find a better solution for my problem.
Thank you so much.