# Design of Software-Defined Radio-Based Adaptable Packet Communication System for Small Satellites
## 3 Design and Implementation
### Software Development  
The software code of the system requires multithreading features, as well as the ability to run in System on Chip (SoC) devices, in order to be integrated into the satellite bus. Therefore, the Ubuntu environment is chosen to run the system, and this allows it to be implemented in Raspberry Pi devices and thus in satellites.  
Raspberry Pi devices have a history in space, and they are currently being used in several small satellite missions. They comply with satellite system standards.  
To develop our system, GNU Radio Companion and Python 2 were used. GNU Radio is a free and open-source software development toolkit that provides signal processing blocks to implement software radios [12].  
The proposed process of software implementation involves generating a basic code in GNU Radio. This basic code is then modified and linked with other segments of the system, which are also Python programs. The main tasks of the code are to transmit and receive the data and signaling packets, and then, according to available information, the system parameters are altered for the next transmission session. In each session, data are transmitted in patches of packets.  
The sequence of the tasks is shown in Figure 3; the flow repeats itself every session.  
The satellite transceiver starts the transmission with the most robust but slowest mode, 2400 bps GMSK. Following this, the data transceiver sends three small patches of packets for signaling. Each operates in a different mode. The ground station transceiver saves the data and signal in local files, and replies by feedback. The satellite sides save the feedback in a local file, and adjust the rate of data transmission for the next patch of data.  
The system is highly dependent on the network transport layer's protocols in exchanging the data. It uses different ports to detect and forward data and signal packets. Figure 4 illustrates how the packets are exchanged between the ports.  
As in Figure 4, seven ports are required in each transceiver. Each one has a dedicated task and data rate. To ensure that no port attempts to transmit while another is transmitting, the threads are organized in the code following the timeline shown in Figure 5.  
In parallel with this sequence, another part of the code listens for feedback from the receiver. Such concurrency is achievable because of the multithreading support capability of Python. Feedback is sent by the ground station each time it receives a signaling message. The feedback is always in the 2400 bps GMSK mode.  
To ensure that the system will not enter an infinite loop if some packets of the patch are not transmitted/received as expected, timeout timers at the transmitting and receiving parts of the code are introduced. In the case of data packet loss, the system stops waiting for the remaining packet, and while it correctly saves the received ones, it will not automatically request the missing packets to be resent. With respect to future improvements, it may be necessary to make is so that the receiver can request the retransmission of specific packets.  
Figure 3: Information flow within the system.