A method comprising: transmitting, by a first network node, a first election message, the first election message being transmitted in response to the first network node failing to connect to a second network node serving as a master network node of a subnetwork including the first network node and the second network node, the transmitting using a message broker of the first network node, the second network node being a slave node to a third network node serving as a master network node to a network including the subnetwork; receiving, at the first network node and from a fourth network node in the subnetwork, a second election message; comparing, by the first network node, a network hierarchical level of the first network node with a network hierarchical level of the fourth network node, the network hierarchical level of the first network node being set based at least on a capability of the first network node to handle communications from multiple network nodes and pass the communications on to other network nodes and/or a server to form a hub-spoke network having a reduced quantity of network paths; designating, by the first network node, the first network node as the master network node of the subnetwork based at least on the network hierarchical level of the first network node being higher than the network hierarchical level of the fourth network node, the first network node becoming a hub node of the hub-spoke network with the fourth network node as a spoke node of the hub-spoke network as a result of the designating, and the first network node becoming another slave node of the third network node as a result of the designating; and transmitting, by the first network node to the fourth network node, an instruction to use the message broker of the first network node for communicating over the network. transmitting, by a first network node, a first election message, the first election message being transmitted in response to the first network node failing to connect to a second network node serving as a master network node of a subnetwork including the first network node and the second network node, the transmitting using a message broker of the first network node, the second network node being a slave node to a third network node serving as a master network node to a network including the subnetwork; receiving, at the first network node and from a fourth network node in the subnetwork, a second election message; comparing, by the first network node, a network hierarchical level of the first network node with a network hierarchical level of the fourth network node, the network hierarchical level of the first network node being set based at least on a capability of the first network node to handle communications from multiple network nodes and pass the communications on to other network nodes and/or a server to form a hub-spoke network having a reduced quantity of network paths; designating, by the first network node, the first network node as the master network node of the subnetwork based at least on the network hierarchical level of the first network node being higher than the network hierarchical level of the fourth network node, the first network node becoming a hub node of the hub-spoke network with the fourth network node as a spoke node of the hub-spoke network as a result of the designating, and the first network node becoming another slave node of the third network node as a result of the designating; and transmitting, by the first network node to the fourth network node, an instruction to use the message broker of the first network node for communicating over the network.