A platform for writing OpenFlow controllers