emulate a network within a single program