Optimizing Global SDN-based WANs