The Internet of Things (IoT) is one of the dominating paradigms of the new era with its abilities to provide ubiquitous intelligence and pervasive interconnections to diverse physical objects. With the advancements, such as new generation 5G communication and cloud/edge computing-based paradigms, the degree of domination is expected to further increase. Therefore, improvements for quality of service have become a critical issue. Traditional packets scheduling algorithms cannot meet the requirements of the large-scale IoT systems. In this paper, a novel scheduling approach is proposed for different data classes (types) to be exchanged between heterogeneous nodes of a generic IoT infrastructure. The possible ways of organizing these classes depending on different metrics, such as time latency, reliability, and data loss, are investigated. The proposed approach has the advantage of being able to tune the priorities and network characteristics to reach a specifically desired performance state. Since each type of packets is considered separately, it is possible to prioritize them, by tuning the related parameters, which changes the priorities between packets. The numerical results presented show that the new approach performs better than the existing typical scheduling approaches. The developed approach can be used in the various IoT applications with the support of 5G communication and edge computing, such as agriculture, wearables, connected cars, smart retail, and smart cities.