A key problem in cooperative robotics is the maintenance of a geometric configuration during movement. As a solution for this, a multi-layered and distributed control system is proposed for the swarm of drones in the formation of hierarchical levels based on the leader-follower approach. The complexity of developing a large system can be reduced in this way. To ensure the tracking performance and response time of the ensemble system, nonlinear and linear control designs are presented; (a) Sliding Mode Control connected with Proportional-Derivative controller and (b) Linear Quadratic Regular with integral action respectively. The safe travel distance strategy for collision avoidance is introduced and integrated into the control designs for maintaining the hierarchical states in the formation. Both designs provide a rapid adoption with respect to their settling time without introducing oscillations for the dynamic flight movement of vehicles in the cases of (a) nominal, (b) plant-model mismatch, and (c) external disturbance inputs. Also, the nominal settling time of the swarm is improved by 44% on average when using the nonlinear method as compared to the linear method. Furthermore, the proposed methods are fully distributed so that each UAV autonomously performs the feedback laws in order to achieve better modularity and scalability. INDEX TERMS Unmanned aerial vehicles (UAVs), distributed control, hierarchical systems.