Elements in massive narrowband Internet of Things (NB-IoT) for 5G networks suffer severely from packet drops due to queue overflow. Active Queue Management (AQM) techniques help in maintaining queue length by dropping packets early, based on certain defined parameters. In this paper, we have proposed an AQM technique, called Aggressive Random Early Detection (AgRED) which, in comparison to previously used Random Early Detection (RED) and exponential RED technique, improves the overall end-to-end delay, throughput, and packet delivery ratio of the massive NB-IoT 5G network while using UDP. This improvement has been achieved due to a sigmoid function used by the AgRED technique, which aggressively and randomly drops the incoming packets preventing them from filling the queue. Because of the incorporation of the AgRED technique, the queue at different nodes will remain available throughout the operation of the network and the probability of delivering the packets will increase. We have analyzed and compared the performance of our proposed AgRED technique and have found that the performance gain for the proposed technique is higher than other techniques (RED and exponential RED) and passive queue management techniques (drop-tail and drop-head). The improvement in results is most significant in congested network deployment scenarios and provides improvements in massive Machine Type Communication, while also supporting ultra-low latency and reliable communication for 5G applications.