A switch in a data communications network for performing traffic
generation in addition to standard switching and routing operations is
disclosed. The switch uses a fixed number of test packets retained in a
conventional switch buffer to produce one or more infinite packet streams
transmitted to a router under test (RUT). The switching device enqueues
packets in the priority queues, dequeues the packets from the priority
queues, transmits the dequeued packets to the RUT, and re-enqueues a copy
of the dequeued packets into the priority queues from which they were
dequeued. The enqueued packets and associated pointers to packets are
organized into linked lists. By re-writing a copy of each dequeued packet
to the tail of a linked list and updating the pointers, the switch
produces repeatable streams of test packets. The priority buffers,
without the re-write operation, may also be used for conventional egress
traffic.