Nowadays, not only wearable and portable devices but also aerial and ground robots can be made smaller, lighter, cheaper, and thus as large as hundreds of them may form a swarm to participate in a complicated cooperative application, such as searching, rescuing, mapping, and war-battling. Devices and robots in such a swarm have three important features, namely, large number, high mobility and short distance, hence they form a dynamic and dense wireless network. Successful swarm cooperative applications require low latency communications and real-time localization. This paper proposes to use ultra-wideband (UWB) radio technology to implement both functionalities, because UWB is very time-sensitive that an accurate distance can be calculated using the transmission and reception timestamps of data messages. A UWB swarm ranging protocol is designed to achieve simultaneously wireless data communication and swarm ranging that allows a device/robot to compute the distances to all the peer neighbors at the same time. This protocol is designed for dynamic and dense networks, meanwhile it can also be used in various wireless networks and implemented on various types of devices/robots including low-end ones. In our experiment, this protocol is implemented on Crazyflies, STM32 microcontroller powered micro drones, with onboard UWB wireless transceiver chips DW1000. Extensive real-world experiments are conducted to verify the proposed protocol on various performance aspects, with a total of 9 Crazyflie drones in a compact area. The implemented swarm ranging protocol is open-sourced at <uri xmlns:mml="http://www.w3.org/1998/Math/MathML" xmlns:xlink="http://www.w3.org/1999/xlink">https://github.com/SEU-NetSI/crazyflie-firmware</uri>