A method of operating a wireless ad hoc network comprising the steps of:: determining a group of intermediate devices on communication paths from a first source device and a second source device to a set of destination devices where each intermediate device of the group has a communication path to a corresponding subset of destination devices such that a communication path exists from both the first source device and the second source device to each destination device of the set of destination devices; configuring each intermediate device of the group of intermediate devices with a first linear network code corresponding to the first source device, and with a second linear network code corresponding to the second source device; configuring each intermediate device of the group of intermediate devices with an additional linear network code between the intermediate device itself and its corresponding subset of destination devices receiving packet data by a first intermediate device of the group of intermediate devices from either the first source device or from the second source device; decoding the packet data using the first linear network code if the packet data was sent from the first source device, or using the second linear network code if the packet data was sent from the second source device; and generating outgoing packet data to a subset of destination devices corresponding to the first intermediate device using an additional linear network code corresponding to the first intermediate device decoding a first set of packets using the first linear network code and decoding a second set of packets using the second linear network code; and generating outgoing data packets by applying the additional linear network code to the union of the first set of packet and the second set of packets; and sending each outgoing data packet to a corresponding intermediate device, the corresponding intermediate device determined according to the additional linear network code. determining a group of intermediate devices on communication paths from a first source device and a second source device to a set of destination devices where each intermediate device of the group has a communication path to a corresponding subset of destination devices such that a communication path exists from both the first source device and the second source device to each destination device of the set of destination devices; configuring each intermediate device of the group of intermediate devices with a first linear network code corresponding to the first source device, and with a second linear network code corresponding to the second source device; configuring each intermediate device of the group of intermediate devices with an additional linear network code between the intermediate device itself and its corresponding subset of destination devices receiving packet data by a first intermediate device of the group of intermediate devices from either the first source device or from the second source device; decoding the packet data using the first linear network code if the packet data was sent from the first source device, or using the second linear network code if the packet data was sent from the second source device; and generating outgoing packet data to a subset of destination devices corresponding to the first intermediate device using an additional linear network code corresponding to the first intermediate device decoding a first set of packets using the first linear network code and decoding a second set of packets using the second linear network code; and generating outgoing data packets by applying the additional linear network code to the union of the first set of packet and the second set of packets; and sending each outgoing data packet to a corresponding intermediate device, the corresponding intermediate device determined according to the additional linear network code.