Towards a library for 6bed4?

Applications could benefit from a lib6bed4.so instead of a 6bed4peer daemon. Daemons require admin privileges and control over networks.

At least for UDP, with its simple protocol semantics, it is possible to replace the sockets with an emulation over 6bed4. This would benefit peer-to-peer applications, a powerful way of exploiting 6bed4 to its fullest. It may even be possible to run SCTP and other UDP-encapsulated protocols with some fantasy (not sure about that yet).

The 6bed4peer will pack/unpack UDP/IPv4 content and use a tunnel device to exchange the contained IPv6 traffic. This introduces links to the network context. In contrast, a lib6bed4.so would pack/unpack UDP/IPv6/UDP/IPv4 content, not just UDP/IPv4. The inner UDP ports would be constructed from bind() and connect() calls on a socket emulation, or peer address information as is more commonly done for UDP, and checksum and length follow from the package being exchanged. Delivery is to emulated read() and write() routines, following their customary semantics. Other than that the routing is quite like normal 6bed4 behaviour.

In the style of connect() with UDP, it may be possible to open NAT holes already. As an alternative, we could add the synergy() call that was explored in the socketSYNergy project and defined as a socket API extension. In the setup described above, the usual administrative rights are not required.

So, a lib6bed4.so library would read and write extra UDP/IPv6 headers but otherwise be very similar to the 6bed4peer and especially use the same upstream behaviour (to router and other peers). The library does not need any special privileges and could be run by an ordinary user and an ordinary application.

Edited by Rick van Rein