Code Poetry
and Text Adventures

by catid posted (>30 days ago) 9:07pm Mon. Apr 16th 2012 PDT
Been crunching through a fairly long TODO list getting FEC-based file transfer finished in LibCat.  Here are some highlights:

Bugfix for WirehairFEC : Odd-length messages now encode and decode properly, so it's stable enough for use now in LibCat.  I've incorporated it into LibCat so it is easy to use from the parent project.

Crypto optimizations for LibCat :
+ HMAC-MD5 was replaced with VMAC-ChaCha (5 cycles/byte authenticated encryption with a faster rejection path!)
+ Random padding replaced with AbyssinianPRNG in thread local storage for less memory usage and greater speed

Thread model improvements for LibCat :
+ Thread-Local Storage is now properly implemented in a portable way inside the Thread object.
+ Transport TLS object now stores mutexes for all the Transport objects in a single worker thread, so for 16,000 connexions there are still only 32 mutexes per worker thread for the transport layer, so it can scale better.
+ Each connexion picks a random pair of mutexes to use from the TLS object, so the rate of contention is fairly low despite sharing mutexes.

New features for LibCat:
+ Roaming IP is now compile-time optional.  It adds a userid to each c2s packet so that the server can keep in touch with clients that roam between different IP addresses.
+ Packet compression with LZ4 is now implemented.  It compresses fragmented messages as well as per-packet.
+ c2s Challenge packet is now padded out to the size of the s2c Answer, so that amplification attacks are harder.

Bugfixes for LibCat:
+ Fixed some memory corruption bugs -- mainly crashes on shutdown.  It's much more stable now.
+ Removed old file transfer code from the transport layer, and fixed some bugs in the bandwidth limiter.  That stuff is all working again.
+ Asynchronous DNS client now uses IP helper on Windows platform to fix a bug with the registry-based approach of finding the DNS server address.

+ FEC-based file transfer.  It's partially written.  I'm hammering out the protocol now.
last edit by catid edited (>30 days ago) 9:12pm Mon. Apr 16th 2012 PDT