Software Defined Networking (SDN) is a novel technique to provide network reconfigurability in Wireless Sensor Networks (WSNs). SDN is highly suitable to be applied in WSNs where high scalability and high reliability are required. To realize the SDN concept, a set of additional nodes, referred to as SDN-controller nodes (or controllers for short), are integrated into the network. Controllers are responsible to advertise routing rules dynamically based on network and link changes. Emerging controllers rises a new research challenge to determine the number and location of controller nodes in a WSN to maximize the network performance subject to both reliability and budget constraints. The budget constraint restricts the maximum number of controller nodes deployed in a WSN. In this paper, we first deal with the challenge to place SDN-controller nodes by introducing an ILP model for the problem which then is solved using the CPLEX ILP solver. We evaluate the results of the proposed method through comparison with the state-of-the-art method. Extensive experiments demonstrate that the proposed method reduces the maximum distance between sensors and controllers by 13% in average in comparison with the state-of-the-art method.