Routing simulator in C