Butterfly Network

Butterfly network consists of two sources $S_1$ and $S_2$ which generate bits $A$ and $B$ respectively. The bits are statistically independent. The destinations $D_1$ and $D_2$ desire bits generated by both sources. All edges have unit capacity (transmits $1$ bit per $1$ time slot). The aim is to maximize the rate at which $D_1$ and $D_2$ receive information. Consider routing on this network. In the first time slot, $S_1$ sends out bit $A$ along the edges going outward. Similarly $S_2$ sends out bit $B$. After the end of time slot $1$, $D_1$ receives $A$ and $D_2$ receives $B$. In the second time slot, $A$(or $B$) is transmitted by $R_1$ owing to bottleneck path $R_1 \rightarrow R_2$. In the third time slot $R_2$ transmits $A$ (received in the previous time slot) and $R_1$ transmits $B$. Then in the fourth slot, $R_2$ transmits $B$. At the end of four time slots, $D_1$ and $D_2$ receive both bits $A$ and $B$.

Under network coding, the relay $R_1$ combines the messages it receives in the first slot to make $A+B$ (addition in a suitable field to which the message belongs to) and forwards it in the second slot. In the third slot, $R_2$ forwards $A+B$. At the end of three slots $D_1$ and $D_2$ have two bits $A$ and $A+B$. So they can recover both bits $A$ and $B$ in three time slots.

Actually, there would be a continuous flow of data and the same coding operations would be performed. Under routing, $D_1$ would see new bits coming along edge $S_1 \rightarrow D_1$ every slot. But it would get new information from $R_2 \rightarrow D_1$ only every two slots. Similarly, $D_2$ would get information at the same rate as $D_1$, i.e $1.5$ bits/slot.

Under network coding, both the destinations would get information at the rate $2$ bits/slot. This illustrates the basic idea of network coding, i.e combination of messages at intermediate nodes. More generally, one could have non-linear combination of messages arriving along different incident edges. In this case, the destinations receive $2$ linearly independent equations every slot. This is another feature of a linear network code. It must ensure that each destination receives as many linearly independent equations as the number of messages it has to recover every slot.

An interesting feature can also be observed from the butterfly network. The nodes $\{S_1,R_1,D_1\}$ form a tree $T_1$. The nodes $S_2,D_2,R_1$ form a tree $T_2$. The nodes $R_1,R_2,D_1,D_2$ form another three. All the edges strictly internal to the trees (not connecting a node from one tree to the next) carry the same information. $T_1$ carries $A$. $T_2$ carries $B$. $T_3$ carries $A+B$. This leads to a general sufficient condition for network coding - It is sufficient for internal edges in a tree to carry the same information. So there is no coding necessary for those flows. Coding takes place only at nodes which are shared by multiple trees (rather at the intersection between trees). There may exist topologies, where very minimal coding may be sufficient although it may have large number of nodes. This leads to easier code design (reduction in field size) which needs to take into account the subtree structure rather than a more complicated topology of the entire network.