  LoRaWAN (Long Range Wide Area Network) is emerging as an attractive network
infrastructure for ultra low power Internet of Things devices. Even if the
technology itself is quite mature and specified, the currently deployed
wireless resource allocation strategies are still coarse and based on rough
heuristics. This paper proposes an innovative "sequential waterfilling"
strategy for assigning Spreading Factors (SF) to End-Devices (ED). Our design
relies on three complementary approaches: i) equalize the Time-on-Air of the
packets transmitted by the system's EDs in each spreading factor's group; ii)
balance the spreading factors across multiple access gateways, and iii) keep
into account the channel capture, which our experimental results show to be
very substantial in LoRa. While retaining an extremely simple and scalable
implementation, this strategy yields a significant improvement (up to 38%) in
the network capacity over the legacy Adaptive Data Rate (ADR), and appears to
be extremely robust to different operating/load conditions and network topology
configurations.
