The design of deadlock- and livelock-free packet switching networks