Networking and performance become major issues in cloud computing. Software Defined Networking (SDN) enables flow-level management and makes routing more effective and flexible for datacenter networks (DCNs). A prior dynamic routing algorithm named Flow Migration shows good results in improving throughput and avoiding congestion through simulation. However, as Flow Migration is applied to a SDN-based DCN, tremendous overhead occurs in modifying flow tables of switches. Therefore, a novel Segmented Wildcard Forwarding (SWF) scheme is proposed to facilitate Flow Migration. SWF leverages the symmetry of a Portland topology and applies wildcard matching for balancing network loading and lowering table-modification cost for flows. Experimental results show that on a Portland 4-8-8 datacenter network, the proposed SWF scheme achieves higher throughput over than the traditional SPB does, and even reduces ∼70% modification cost used by the original implementation of Flow Migration. As a result, Segmented Wildcard Forwarding (SWF) is proven a mechanism that practically realizes dynamic routing of SDN but also improves network performance as well as cost for flow migration, simultaneously.