Basic network simulator in C using sockets and concurrency