  LoRaWAN is a popular low power wide area network technology widely used in
many scenarios, such as environmental monitoring and smart cities. Different
applications demand various quality of service (QoS), and their service within
a single network requires special solutions for QoS provision. We consider the
problem of QoS provision in heterogeneous LoRaWAN networks that consist of
several groups of devices that require different packet loss rate (PLR). To
solve this problem, we develop a mathematical model that can find the PLR
distribution in a LoRaWAN network. With the model, we show that the PLR can
vary significantly, and it is wrong to consider only the average PLR for the
QoS provision. Finally, we develop an algorithm for assigning modulation and
coding schemes to end-devices that provides PLRs below the required thresholds.
