In recent years, with the growth in the use of Unmanned Aerial Vehicles (UAVs), UAV-based systems have become popular in both military and civil applications. The lack of reliable communication infrastructure in these scenarios has motivated the use of UAVs to establish a network as flying nodes, also known as Flying Ad Hoc Networks (FANETs). However, the high mobility degree of flying and terrestrial users may be responsible for constant changes in the network topology, which makes more challenging to guarantee their communication during the operational time. In this context, this article presents a Software-defined networking (SDN) based Topology management for FANETs-called of STFANET-, which is a coordination protocol that englobes both an efficient SDN-based UAV communication and a set of topology management algorithms. The goal is to establish and maintain a FANET topology in order to provide a constant and reliable communication link among independent nodes-which are performing individual or collaborative missions-through relays units. Simulation results show the efficiency of the proposed protocol in order to provide communication in a dynamic scenario. Considering its use in a military setting, STFANET managed to achieve 25% of packet loss in transmitting data packets, 1.5ms of latency and 71% of connectivity on average. INDEX TERMS FANET, topology management, relay node placement, SDN, communication protocol.