The protocol used, as said before, is a variant of MQTT known as LA-MQTT that adds the location awareness to the MQTT protocol. Furthermore, I added to LA-MQTT the possibility to be used with multiple brokers that interchanges messagges between them without any loop, even if they are mesh linked.
These are some simple diagrams of an LA-MQTT Multibroker context:
You can find my thesis on AMS Laurea for a detailed explanation on how the protocol works.
Alert: If you find any trace of an API key in the code it's disabled so please use yours.