# A LoRaWAN Network Architecture with MQTT2 MULTICAST
## 7 Results
These leaf switches will also forward the message to their respective proxies. All these messages total \(2F_{1}F_{2}+F_{1}\). There are no ACKs in this scheme. As an illustrative example, let us consider some numbers from The Things Network [4]. Currently, TTN is composed of 20.6K LoRaWAN gateways in 547 communities (coinciding with cities) across 151 countries, with a total of 44.3M messages/day. This means that, on average, 1 message is sent every 40.2 s per gateway. The top 5 largest communities own between 218 and 167 gateways. Thus, we can assume that a large city could deploy around 200 gateways. Figure 13: Packets retransmitted within the SDN network due to one incoming packet using unicast, e.g., with typical MQTT brokers. Let us further consider that the LoRaWAN servers and the MQTT proxies are deployed as containers in the edge nodes. For load balancing and redundancy purposes, we should deploy at least two LoRaWAN servers (with their corresponding MQTT proxies) per city, i.e., one every 100 gateways. In the case of a large region such as Andalusia, with 8 provinces, we could employ an SDN network with a tree topology with fanouts \(F_{2}=2\) and \(F_{1}=8\). With these numbers, one MQTT message (e.g., when a node sends one LoRaWAN frame) will generate 89 messages (\(6\times 8\times 2-3\times 2-1=89\)) within the SDN network (plus their corresponding TCP ACKs) if normal MQTT brokers are employed. If we employ our MQTT proxies with MQTT2 MULTICAST, only 40 messages (\(2\times 8\times 2+8=40\)) are required (without TCP ACKs). Since we are considering in this example 8 cities with 200 gateways per city, assuming 1 message every 40 s (as in TTN), Figure 15 shows the evolution of the number of packets within the SDN network. The reduction in the number of packets is 55% if we only consider data packets, and 77.5% if we also take into account TCP ACKs. We also tested the reduction of signalling traffic comparing our MQTT2 MULTICAST scheme to PIM-SSM, a typical source-based multicast routing protocol. Using PIM-SSM, the  
Figure 14: Packets retransmitted within the SDN network due to one incoming packet using multicast, e.g., with our MQTT proxies. Figure 15: Example of packets retransmitted within the SDN network. nodes and the edge routers require to also send IGMP packets to join multicast groups. This is not required using MQTT2 MULTICAST, because MQTT2 MULTICAST already supports the mapping between publishers, subscribers, their topics, and their corresponding multicast addresses. In this experiment, we again used tshark in all the routers/switches and obtained the number of packets for each protocol by using the appropriate packet filters. Since MQTT proxies aggregate many subscribers, we assume that most likely there is at least one subscriber for a specific topic (a specific ApplicationID in our LoRaWAN network, which aggregates several MQTT topics, as discussed in Section 4). This means that, using MQTT2 MULTICAST, only the initial MQTT2 MULTICAST requests and replies are required. Assuming the previous scenario (\(F_{1}=8,F_{2}=2\)) and one topic (i.e., one ApplicationID mapped to one multicast IP address), the number of messages is very low (only 32 packets). However, the number of messages for joining/maintaining IGMP groups and the PIM-SSM messages to create the multicast routing trees are much higher. We create specific experiments using our network prototype (based on Mininet and RYU) with both solutions (PIM-SSM and MQTT2 MULTICAST). Figure 16 compares both situations, being near 15,000 messages after 5 min in the second case. Thus, our solution highly decreases the required signaling for multicast routing. Finally, we have also tested the scalability of using multicast in our architecture. Since the number of switches in the Mininet is limited by the computational cost of their emulation, we have chosen to calculate the time to generate the multicast routes using graphs instead. For this, the NetworkX [27] library has been used, following the same approach implemented in our testbed.