NNTP via Multicast in Perl

Back in 2002 there were several versions of software available that could distribute Usenet feeds over multicast. However, none that I was aware of could handle articles larger than 65536 bytes, the maximum size of an IP packet. So I hacked together about 400 lines of Perl code that implement a simple NNTP client and server together with the necessary fragmentation and defragmentation of arbitrary-sized articles. The scripts also handle their own data checksums (MD5 digests) and multicast transport.

Deployment: the sending script is fed by a normal NNTP/TCP feed, for example on the loopback interface on your main feeder machine. The receiving script runs on a reader machine and feeds the re-assembled articles to port 119 on localhost. Multiple simultaneous streams are possible by putting them on different ports.

The code is highly experimental, especially the receiver. It still uses blocking I/O for the localhost socket, and it doesn't handle closing of this socket very well. Also, since the data is broadcast there is no mechanism for backlogs/requeuing. Therefore a delayed backup feed using the normal NNTP-over-TCP protocol is recommended on each receiver.

Source code:
nntp-mcast-send.pl.
nntp-mcast-receive.pl.