TODO change RawPacketIO constructor to take a timeval (change socketIO also) complete API doc in doxygen write tutuorial/intro big mistake: single output queue; need one per PacketIO object? OVERVIEW The Packet Engine (pEng) framework supports generation of network packets, primarily for network testing. Control is provided over packet contents and transmit time. Incoming packets are also monitored and can be used to control packet transmission, to support request/reply tests. Packet creation is supported by the Raw Socket Toolkit (link). ***** BASIC USE For a pEng run, the tester provides three items: 1. IO[0..M-1]: an array of PacketIO objects A PacketIO object is an abstraction of an Ethernet interface. The framework provides several PacketIO classes for instantiation. 2. I[0..N-1]: an array of PacketIter objects A PacketIter object supports the methods next: provides a new packet for tx hasNext: indicates whether a packet is available Each packet contains a buffer, an ioId, and a timestamp NOTE: ioId index into IO array; streamId index into I array. For packets to be transmitted: ... For received packets: ... The tester implements one or more PacketIter classes. 3. A PacketIterId object provides methods to set and get the streamId in a packet. The stream id is an index into the I array. Example: like testTimeIter; 2 CBR iters, with some conflict ***** ARCHITECTURE TX/RX DIAGRAM HERE: jpg from xfig TRANSMIT PacketSchedule polls the iterators and queues the packets for transmission. When 2 packets have transmit times close enough to cause a conflict, the scheduler modifies one or both transmit times. PacketTransmit removes packets, passing them to the appropriate packet IO object. RECEIVE TimeIter PacketIO Tester provides vector of iterators set of packet iterators next, hasNext, notify, id *** transmit side: multiplex pEng merges packets from packetIters and queues them for tx guaranteed: packets from a given iter sent in orde retrieved using next() attempted: packets tx'ed near timestamp *** receive side: demultiplex pEng polls packetIOs and dispatches packets to notify methods using id Packet PacketEvent PacketTrace PacketPool PacketSchedule PacketTransmit PacketReceive PacketEngine TESTER'S TASKS Write PacketIters, including notify; perhaps TimeIters Write PacketIterId, including notify Hack main instantiate PacketIters, PacketIterId, PacketPool, PacketIOs instantiate and start PacketEngine