get_main_netid


Description:

public NetworkID get_main_netid ()

This method returns a Networkid. The aim is to be able to testify to a neighbour that we already hooked in its same network. Since the network could split, and we could detect the change moments before our neighbour does, then we must compare not just the GID of level 'levels' -- which is the min of GIDs of level 'levels-1' but we must compare all the GIDs of level levels-1. Add to this, that at the very beginning of our hook when we did not receive an etp yet, we do not have in the maproute the necessary gids, we just received the main one in self.id_myself[-1] Furthermore we have to consider self.id_myself[-2] for our GID at level 'levels-1'. TODO We still have a weakness here. 2 neighbours that belong to the same network but in different gnodes at the uppermost level (eg 1.1.1 and 2.2.2 in a network of 3 levels) have in common only the gnodes of level 2, so they can compare the GIDs at level 2 and the one GID at level 3 (that is the min of GIDs at level 2). If the gsize is quite small (say gsize=4) we have very few IDs (4) that we can compare. They exist for the lifespan of few single nodes. If all these nodes die quite at the same time, then we'll experience a massive rehook.