## 3 Cognitive Mobile BTS
### Channel Reselection Procedure  
The cognitive BTS implementation is based on Asterisk [36], OpenBTS [22] and GNU Radio [37] open source software (see [28]), and on Ettus USRP hardware [23]. The USRP is a programmable USB SDR device. We modified OpenBTS to achieve the channel change capability we have designed forpreventing possible interferences, by developing two different procedures to cater for the MM idle and dedicated modes of cell phones.  
When the cell phone is in MM idle mode [32], GSM does not provide any procedures to command the MSs to change channels, so we modified the \"Cell reselection\" procedure to offer a better cell to the phones. Specifically, we modified the _System Information Type 2_ message. The network sends this message through the BCCH to all phones within the cell with information about BCCH allocation in neighboring cells. Additionally, we publish the frequency of the channel to which we wish the BTS to jump, as if it were a neighbour cell. We inform the cell phones that they have to take measures of current and surrounding cells to detect the strongest signal. When the BTS switches to the new frequency the phones change to the new channel once it is detected, as it is the strongest signal from the neighboring cells listed in the he _System Information Type 2_ message.  
When the phone is in dedicated mode [33], GSM provides the \"Handover\" and \"Channel assignment\" procedures. The \"Handover\" procedure cannot be implemented without two GSM carriers operating simultaneously. Therefore, we implemented the second procedure, and performed a successful channel change using the \"Cell reselection\" procedure, without any disruption. Figure 7 shows the complete process that corresponds to the diagram in Figure 3.  
Figure 7: Layer 3 message exchange for channel change in dedicated mode.  
The BTS initiates the channel assignment procedure by sending an _Assignment Command_ message to the MSs on the main signaling link. All other transmissions of signaling layer messages are suspended until the BTS effectively changes the channel and indicates that it has resumed operation. When the MSs receive the _Assignment Command_ message, they initiate a local end release of link layer connections, disconnect the physical channels, switch to the assigned channel and initiate the establishment of new lower layer connections. The message contains the new channel configuration and a _starting time_, which is the time the MSs have to wait before accessing the new channel (this is necessary to give the cognitive BTS enough time to change to the new channel). Finally, the MS returns an _Assignment Complete_ message, specifying a \"normal event\" cause to the network through the main Dedicated Control Channel (DCCH). Note that this procedure only allows the redefinition of the TCH for an ongoing communication; it does not inform about the broadcast control channel (BCCH) change. Therefore, the BTS must make the MSs aware of the main channel change. To do this, throughout the call, the BTS announces the BCCH allocation in the neighbouring cells in the _System Information Type 5_ message. We thus modified that message to command the MSs to take measures in the new channel. This mechanism allows both the cognitive BTS and the MSs to change to the new channel without disruptions, avoiding interferences and degradation.