Flocking of the unmanned aerial vehicle (UAV) network refers to utilize the node’s autonomous mobility to satisfy the principle of cohesion, separation, and alignment. A network with flocking ensures the connectivity between high-speed UAV nodes and simplifies the design of various swarm applications. In this paper, we propose a novel distributed flocking model for UAV swarm networks. The model follows the Boid principle and establishes the master–slave transmission mode among the nodes. The slave node performs the distributed autonomous regulation. An effective flocking method is proposed, which is based on the positioning and communication capabilities of Wi-Fi. The slave node can sense and adjust their distance and direction from the master node. The simulation and experimental results show that our model can guarantee the connectivity between all nodes and has $1.4\times $ the network goodput gain outperforms the traditional flying ad hoc network.