Solution (source code)

= Solution

<UDP> fits <IP multicast> because each independent datagram can be delivered to a group without establishing a separate transport connection with every receiver. Ordinary <TCP> defines a reliable ordered byte stream between two <endpoints>, with one peer's <acknowledgements>, <receive window> and connection state. A group has many receivers with different losses and capacities, so that interface cannot simply be assigned to one group address. A reliable group service can be designed, but ordinary <TCP> does not provide it. <UDP> itself adds neither group reliability nor <congestion control>; applications must provide whatever additional behaviour they require.

A virtual <multicast distribution tree> lets one <packet> traverse a shared upstream link and be copied only where branches diverge. Compared with a separate <unicast> copy per receiver, this saves repeated transmission over the common links. A <tree> also supplies a unique parent route and avoids forwarding loops when the routing information is consistent. Branches with no interested receivers can be pruned.

For a source-specific <multicast distribution tree>, a <router> needs the group identifier and source identifier, the expected incoming interface, the set of outgoing interfaces leading to interested receivers, and information about local group membership. Timers and join/prune information maintain those decisions. This is naturally keyed by $(S,G)$ for source $S$ and group $G$; other <multicast routing> designs can use a shared group tree. A <router> needs the relevant local forwarding entries, rather than a complete list of all group members everywhere. The result is
$$
\boxed{\text{one upstream copy; replication at branches; per-tree input/output interface state}.}
$$