Transmitting packets in a frame includes receiving the packets. Delay constraints are established, where each delay constraint is associated with a packet. Frame departure times of the frames are predicted, where the frames include the packets. A packet departure time is determined for each packet in accordance with the frame departure time of the frame that includes the packet. An order of the packets is determined using the delay constraints and the packet departure times. The packets are placed in the order, and the frames are formed from the ordered packets.