## 1 Introduction  
Software-defined networking (SDN) [1; 2] is an attractive networking paradigm that improves network performance by logically centralized control. However, due to economic and operational constraints, SDN-enabled devices may not be able to be fully deployed at a time, particularly, in large scale networks [3]. During the gradual migration period, there exists a new type of network, which is called a hybrid SDN [4; 5]. This kind of network consists of Legacy Forwarding Devices (LFDs) and SDN-enabled Forwarding Devices (SFDs). LFDs can find paths and form their own routing table. SFDs are under the control of SDN controllers, which needs the guide from controllers, such as how to establish their routing tables. In SDN architecture, SDN controllers [6; 7] are essential components, which is an application that can manage flows to improve network performance. In a large SDN or a hybrid SDN, only one SDN controller may be not sufficient for numerous reasons: latency, load balance, scalability, and reliability [8; 9]. Especially in a wide area network (WAN), one controller usually cannot cover all the areas within the limited capacity and SFD-to-controller latency. Hence, several controllers [10] need to be deployed to guarantee the performance of network control. Besides, to greatly improve the control performance, SDN controllers can be located at different places [11] in SDN (or hybrid SDN) WANs. There are two ways of communication between SDN switches and SND controllers, namely in-band and out-of-band communication [12]. In the first case, controllers are usually directly connected with SFDs, and control messages share the same links with other data. In the second case, there is usually an independent network for the control message. For WANs, in-band communication is more suitable, because out-of-band communication with long distance needs huge deployment costs [13]. In the hybrid SDN WAN, the control messages may pass through the LFDs. Control messages are transmitted among the data packets on the same physical channel. In LFDs, which are out of control of SDN controllers, control messages need to queue with data packets. In SFDs, the control messages can be forwarded under the control of SDN controllers with a higher priority and without queuing with data packets. A good controller assignment policy is vital to guarantee a good network management, which has been well studied. Nevertheless, an important scenario, the hybrid SDN, has been ignored in the previous studies. To optimize the assignment of controllers in hybrid SDN WANs, three important aspects should be considered. First, LFDs have impacts over the control messages latency and loss rate, especially when the legacy devices are in a bad situation, such as traffic congestion. Second, processing PACKET_IN messages from SFDs is the most significant part of the working load of controllers. Because of the limitation on the controllers' capacity, the heavy-load of controllers brings more failure probability [14]. Thus, the capacity of controllers needs to be taken into consideration. Third, in hybrid SDNs, there are new paths generated by the SDN devices partially deployed, which can be used in control messages forwarding. In this paper, we propose a dynamic controller assignment scheme in hybrid SDNs, which is called the Legacy Based Assignment (LBA). This scheme can dynamically delegate each controller with a subset of SFDs in the hybrid SDNs, whose objective is to minimize average SFD-to-controller latency. Firstly, we analyze the influence of LFDs of hybrid SDNs in SFD-to-controller latency, which is caused by routing queuing in LFDs. Secondly, we formulate the dynamic controller assignment problem to be a 0-1 Integer Linear Programming. In the formulation, in addition to the impact of LFDs, the capacity limitation of the controllers and the available routing paths generated by the SDN partially deployment are also considered.