A network emulator, such as the Internet Protocol Traffic and Network Emulator (IP-TNE), enables real applications running on external hosts to interact via a virtual network modelled within the emulator. It combines a real-time network simulation engine with methods to capture specific packets from a network and write packets back to the network with customised headers. This paper explains the reading and writing of packets. It describes which components can be implemented in a portable manner and which need to be implemented in different ways on different operating systems. Both kernel level and user level packet filtering are examined and performance results using gigabit Ethernet and various readers are presented.