# Virtual Pheromone Based Network Flow Control For Modular Robotic Systems
## 3 Virtual Pheromone Based Network Flow Control
### Neighbourhood Discovery & Awareness and Link Maintenance  
We briefly summarize the key characteristics of the neighbourhood discovery & awareness and the link management to show the probability of transmitting data packets. More detailed information of this layer can be found in [17].  
_Neighbourhood discovery & awareness:_ All the modules are considered in _free_ state at the beginning; that is, a module may have maximum \(N\) physical communication channels available for the neighbourhood discovery & awareness. They periodically send out \"hello\" signal through its physical channels to search for neighbours. When \"echo\" and \"confirmation\" signals have been received, the involved modules change the stage from _free_ to _busy_. The channels receiving \"hello\" are marked _passive_ and the other are marked as _active_. As a result, a _vacant_ channel with the newly identified neighbour is updated to _occupied_ state. The number of physical communication channels available for the neighbourhood discovery process on such a module is reduced to \(n\), \(n<N\). If a module does not receive an \"echo\" in a directional channel, it continues searching on other channels. Here, the deadline for echo to be received is set equal to three time the duration of closing interval \(t_{c}\).  
When two robotic modules are physically connected, their directional channels are aligned for line-of-sight communication. On a robotic module, signals are only sent over a selected channel for a short period of time, hence \(P_{s}=1\). A successful neighbourhood discovery process on a module occurs when signals are correctly received. The probability for a successful neighbourhood discovery process between two _free_ modules is  
\[\begin{split} P_{\text{C}}&=P_{s}\times P_{r}\times F _{tr}\\ &=\frac{1}{N}\times F_{tr}=\frac{1}{N}\times(1-\frac{t_{c}}{t_{w1 }})\end{split} \tag{1}\]  
where the closing time \(t_{c}\) is caused by the receiving robot when it performs the discovery process on other channels; the processing time \(t_{w1}\) is the interval between two consecutive discovery processes when the robots are in _free_ state. The time factor \(F_{tr}\) represents the serial processing characteristic of robotic modules.  
When _free_ modules send out \"hello\" signal, but the connected modules might be busy searching for new neighbours on other channels that have not yet occupied, the probability for a robot in _busy_ state to discover a robot in _free_ state is  
\[\begin{split} P_{\text{C}}&=P_{s}\times P_{r}\times F _{tr}\\ &=\frac{1}{n}\times(1-\frac{t_{c}}{t_{w1}})\end{split} \tag{2}\]  
Note that \(n=N\) when the robot is in _free_ state as in Equation (1).  
_Link maintenance:_ For a robot in _busy_ state, the closing time is added up due to the link maintenance process. The time factor becomes \(F_{tr}=F_{d}\times F_{m}=(1-t_{c}/t_{w2})\times(1-t_{c}/t_{w3})\), where the time factor \(F_{d}\) is used for the discovery process with \(t_{w2}\) as the processing time in _busy_ state, and the time factor \(F_{m}\) is used for the maintenance process with \(t_{w3}\) as the processing time of the link maintenance process. As a result, the probability for a robot to recognize a neighbourhood module in _busy_ state is  
\[\begin{split} P_{\text{C}}&=P_{s}\times P_{r}\times F _{tr}\\ &=\frac{1}{n}\times(1-\frac{t_{c}}{t_{w2}})\times(1-\frac{t_{c}}{t _{w3}})\end{split} \tag{3}\]  
At this state, the robotic module has recognized the direction of its neighbour from the neighbourhood discovery process, thus the probability for a link maintenance signal can be received by its neighbour is calculated as:  
\[\begin{split} P_{\text{C}}&=P_{s}\times P_{r}\times F _{tr}\\ &=1\times(1-\frac{t_{c}}{t_{w2}})\times(1-\frac{t_{c}}{t_{w3}}) \end{split} \tag{4}\]