A Remote Testbed System for Mobile Ad-hoc/Sensor Networks

—Nodes in a mobile ad-hoc/sensor networks (MANET) can move at any speed and direction independently. Thus, it's difficult to design a testbed system for network working under such circumstance. Different from traditional software simulation or vehicle-loaded methods, a remote network performance testbed system is proposed in this paper. The main idea of our proposed system is using the rotary motion to create such velocity-changing context. Then, we designed and realized a high speed rotary turntable platforms. Nodes can be deployed on the rotary platform, thus it can movement with the platform at a high speed (up to 168 km/h) during test. Shown by the experiments, the approach is simple, efficient and reliable. The reason of network packet loss in our testbed is also analyzed and tested in this research.


INTRODUCTION
Mobile ad-hoc/sensor networks(MANETs) with high flexibility and survivability have been paid attention by the military and researchers. In recent years, due to the development of vehicular sensor networks and the further popularization of mobile computing devices, MANETs have become a research hotspot. MANETs are continuously self-configuring wireless networks of mobile nodes worked in a decentralized manner [1]. Each node in a MANET is free to move at any velocity (i.e. speed and direction), and will therefore change its links to other nodes frequently.
To test the network performance for MANETs, network simulation tools (such as OPNET, NS2, etc.) are used in most research works. The reason is that it has the advantages of high efficiency and low cost [2]. However, the research of mobile ad-hoc network faces a series of challenges, which mainly reflects in radio channel characteristics, the complexity of the network composition and the mobility of the nodes in the network. Thus it is difficult to accurately conduct the mathematical modeling and analysis [3]. MANET testbeds are in-lab networks built and used by researchers. Network experiments conducted on such actual environment are essential before implementation. Moreover, it can make up for the inadequacy of the simulation to the actual network environment, and it can verify the results of the simulation experiments and revise the mathematics model of the simulation tools [4].
According to the experimental target scenario, MANET testbeds can generally be divided into two categories: indoor testbeds and outdoor testbeds. In the literature [5], authors constructed a MANET testbed composed of five hand-actuated moving nodes (laptops) in an indoor environment, and they investigated the effect of mobility and topology changing on such testbed system. Based on this system, in the literature [6], they implemented this testbed in both indoor and outdoor scenarios and they evaluated the performance by considering network throughput and packet loss parameters. The follow-up studies such as [7] and [8], mainly carried out some protocol performance experiments on similar experiment beds. Different from those experimental schemes, another idea is to use high-speed mobile vehicles to transport nodes to form the mobile network. For example, the DOME [9] testbed consists of 40 test vehicles, each of which is loaded with a node and equipped with a set of wireless communication testing devices. In order to improve the connectivity of such deployed network, relay nodes were installed on the side of the test roads, which is combined with the mobile nodes to form the hybrid mobile network circumstance. Although in these studies nodes have mobility, they inevitably have the shortcomings, such as the limited space, expensive consumption, costs and time-consuming.
In this paper, we propose a novel MANET testbed system. The nodes to be tested are deployed on the round rotating platform whose rotary speed and direction can be precisely controlled, thus the horizontal motion between the nodes can be efficiently and easily realized. We describe the overall architecture and functions of the testbed system in the second part. In the third part we introduce the design idea of the monitoring software and the realization of the three major functional modules. In the last part we test the network communication performance especially the network packet loss ratio on the established testbed and we also analyze the reason of packet loss under such high-speed rotation movement. Following testing functions can be performed by using our system: (1)Performance tests of MANET network. The communication nodes loaded on the turntable platforms provide test data for PC monitoring software. Nodes come into being high-speed mobile network through routing protocol.
(2)Control function. Operator can set the velocity, acceleration, speed and motor rotation direction of the servo motors. The system screen displays the motor running state. In order to operate more safely, the system also provides emergency stop button.
(3)Security monitoring. Cameras are installed above the two motors. Thus, the operator can observe the motor running condition remotely in all directions and from multi-perspectives in the monitoring room.
By now, the hardware components for protocol stack testbed system have been introduced. Next, we will propose the design and realization for these hardware components.

A. Rotary Platform
Rotary platform used in the system is mainly comprised by turntable platform (round aluminum plate), servo motor, and related holders. Motion control card and servo driver are the devices to control the motion of the rotary platform. Servo motor is the executor of rotary platform's motion. The object of rotary platform is shown in Fig. 2. If we set the diameter of the round plate to be d (m), and its rotary speed to be ! (rad/min), we will be able to compute the linear movement speed of nodes, which is The round plate is set with many slots, for the convenience of fixing nodes on the platform. The loading shafts of the round plate and the servo motor are closely connected via a wedge. Motor is fixed on the holder. For the convenience of adjusting the motor on a horizontal level, the four corners of the holder is designed with four adjustable screws. Before the system is powered on, the screws shall be adjusted to keep the motor on a horizontal level to improve the safety performance of the system. The maximum rotate speed of the motor is 3000 (rpm). In order to avoid accident during high speed rotation, the rotary platform is equipped with protective rail. Moreover, high-definition cameras are installed above the rotary platform, so that operators can realtimely observe the rotation of the platform. The core components of rotary platform control part are motion control card, servo driver, and servo motor. Motion control card and servo driver constitutes the motion control device, while servo motor is the motion executor. Rotation of servo motor is controlled via electrical impulse. Impulse frequency determines the rotating speed of motor, while impulse quantity determines the number of rotation. In the following, we will separately introduce the working procedure of motion control card and servo driver.

1)Working Procedure of Motion Control Card.
The upper computer sends out order to motion control card, and the motion control card is designed to analyze the order, to compute the impulse frequency and the quantity to be transmitted. Next, the task of motion control will be assigned to motion control card and servo driver. Operation of motion control card will not occupy the CPU of upper computer. Motion control card is able to control multiple motors to rotate independently or jointly. The control accuracy is high. Quantitative driving, continuous driving and interpolative motion can be realized by the control card. Impulse output methods include single impulse (impulse + direction) or dual impulse (impulse + impulse). Maximum impulse frequency available by motion control card of our implemented system is 2 (MHz); 2-shaft line interpolation is supported, and the maximum interpolation frequency is 1 (MHz). Under positional control mode, a forward-backward counter is designed to manage the logic position of international impulse output. The accuracy of counter can be up to 32digit, with the maximum range between -214748648 and +2147483647. All inputs and outputs of the motion control card have applied opto-coupler isolation, leading to high anti-interference performance. Working principle of motion control card is shown in Fig.3.

2) Working Procedure of Servo Driver.
Servo driver has 3 working modes: speed control, position control and torque control. Speed and torque are controlled by analog quantity signal (mainl voltage). Position can be controlled via impulse sequence order. In the system, the servo driver is set on the working mode of position control. Working principle of the servo driver is shown in Fig.4: In the system, servo driver is connected to encoder port of the servo motor, while the encoder is designed to feed back signals to servo driver, so as to form a loop for position and speed control. This design can improve control precision, while the rotation accuracy of motor reaches up to approximately 1 impulse.
After having connected all wires correctly, we shall have to set related parameters for motion control card and servo driver. For example, in the system, the two devices shall both work under position control mode. If the parameters are not properly set, motor rotation may not be able to meet our designed requirement.
In the system, the servo motor encoder resolution is 20 2 1048576 n = = , and electronic gear ratio 32 k = , i.e. when outputting / 32768 n k = impulses per second, the motor rotates for a round. For this reason, we will be able to figure out the ratio relation between motion control card's impulse frequency p (pulses/s) and the rotation speed (r/min):

B. Ad-hoc Communication Network
The hardware structure of wireless communication network mainly includes the following sections: micro control unit (MCU), power amplifier (PA), RF antenna and communication interface. MCU is designed to control and coordinate the whole system, ensuring normal operation of nodes. In order to test the communication distance of wireless nodes, and to ensure the communication quality, when deploying the wireless nodes, we design PA module. PA is responsible to amplify data output by MCU, and then to send out the data package via RF antenna. Communication interface is used for connection with other equipments. Table 1 shows the result when testing the communication distance of the node, with packet loss rate as the reference index. From the test result, we find that, with PA module, the communication distance is greatly improved and meanwhile the packet loss rate reduced. Thus, the communication quality is ensured.  Fig. 4 shows), i.e. nodes can be connected with a temperature sensor. As the focus of this research is to study the performance of ad-hoc network protocol stack, none of the nodes in system are equipped with sensors. Thus, data packet transmitted in network does not contain sensor data.
In order to study the performance of ad-hoc network upon high speed mobilization, we need to design workable MAC protocol and routing protocol, and to test their working performance via the system. In the system, a compact protocol stack has been designed. Next, we are to focally analyze the function and working process of its MAC layer and routing layer.

C. A Compact Protocol Stack for Node-based Ad-hoc Network 1) Function and Working Process of MAC Layer
The system applies SMAC protocol -a simple stack based on ANSIC source code, which can be used to develop special RF transmitting and receiving programs on MC1321x chip. It is compatible with almost all microprocessors, with the following distinguishing features: (1) ANSIC source code is customized for HCS08 kernel and can be transplanted to almost all CPU kernels (including 4-digit CPU); (2) In a single data packet, the maximum number of bytes for a payload data is 123 Bytes; (3) Automatically detect frame check sequence (FCS); (4) Automatically add two code bytes into each data packet, so as to differentiate SMAC protocol data packet from data packets based on other protocols. Fig. 5 has shown the structure of SMAC protocol data packet. Working process of SMAC protocol is shown in Fig. 6. In this figure we described the overall structure of SMAC protocol. It can be seen from the diagram that, SMAC protocol is in the middle layer of the whole system. It manages the operation and power mode control of MCU chip, while providing encapsulated interface for application programs.

2) Function and Working Process of Routing Layer
Fixed routing protocol is adopted: the source node forms and sends the data packet to the intermediate node via fixed path. After receiving the data packet, the intermediate node will then forward the packet to the master node. This working process is shown in Fig. 7. For the convenience of description, we name these nodes with numbers (as shown in Fig. 7). Intermediate nodes (1, 2, 3, and 4) are deployed on Rotary Platform 1#, and terminal nodes (5, 6, 7, and 8) are deployed on Rotary Platform 2#. The establishment of the network is just the interaction process between master node and ordinary nodes.
Master node's working process: Step 1: After startup and initialization, send a data packet to upper computer; Step 2: Wait for message from remote nodes, and judge if the latency time exceeds 200 ms. If not, execute Step 3, otherwise, execute Step 4; Step 3: Judging whether the address contained in the received data packet is itself. If so, sending the data packet to the upper computer and then executing Step 4. Otherwise, executing Step 4 immediately; Step 4: Judge if there is an order from upper computer. If so, process the order, send the order to intermediate nodes, and move back to Step 2. Otherwise, directly jump to Step 2; Intermediate nodes' working process: Step 1: After startup and initialization, it sends out a JOIN data packet.
Step 2: Wait for data packet and judge if the latency time exceeds 200 ms. If so, continue waiting, otherwise, judge if the address contained in data packet is itself and if the data packet is from the master node; if so, execute Step 3, otherwise, execute Step 4.
Step 3: Judge if the incoming data packet is sent to itself. If so, move back to Step 2. Otherwise, process the data packet and send the data packet to terminal nodes.
Step 4: Judge whether the data packet comes from terminal nodes. If so, executing Step 5. Otherwise, directly going back to Step 2; Step 5: Judging whether the data packet type is JOIN or AQUE. If it is JOIN, turn to JOIN data packet processing mode, otherwise, turning to AQUE processing mode. After processing, send the data packet to master node and go back to Step 2.
Terminal node's working process: Step 1: After startup, send out a JOIN data packet.
Step 2: Wait for incoming data packet and judging whether the time latency exceeds 300ms. If so, continue waiting. Otherwise, judge if the address contained in data packet is itself and if the data packet is from intermediate nodes, if so, execute Step 3. Otherwise, continue waiting.
Step 3: Turn to interrupt processing according to the requesting type of data packet.
Terminal node program design is the simplest, which tries to reduce energy consumption and system complexity on the premise of communication, so as to extend the service life of nodes.
We described the compact protocol stack above. In practice, we will design different protocol stacks according to the testing requirement first, and then utilize our testbed to examine its performance. In the next part, we will introduce the contents related with protocol stack testing software.

D. Design of Testbed Software
Functional modules of protocol stack testing software are shown in the below Fig. 8. In the above section, principle and realization of software modules have been stated in detail. The software is able to store the information of data packet passing through the master node in the ad-hoc network, which can be used for later-stage analysis by researchers. The main soft interface of our testbed system is shown in Fig. 9.

A. Platform Settings
We manufactured two round aluminum plates Rotary Platform 1# and Rotary Platform2# (both in diameter of 150 mm, flatness of 0.02mm). The model of motion control card used by the system is ADT-8920A1 [10]; and the model of servo driver is SGDV-7R6A01A [11], while the model of servo motor is SGMGV-09ADC61. During the test, the maximum value of rotary velocity can be 6000 ! rad/min. Therefore, the maximum moving speed of nodes can be up to 84.78 kilometers per hour, and the relative speed can be up to approximately 168 kilometers per hour. In other words, we are able to simulate the high speed circumstance of around 160 kilometers per hour.
Our system totally deploys 9 nodes: 4 intermediate nodes, 4 terminal nodes and 1 sink node. Moreover, the testing system also preserve several relay nodes as backup. In some outdoor tests the distance between testing nodes is too long that we may activate those relay nodes to ensure communication quality. Nodes are deployed as follows: each Rotary Platform is evenly deployed with 4 intermediate nodes. Rotary Platform 2# is evenly deployed with 4 terminal nodes. Nodes are fixed on rotary platforms. The sink node is connected to upper computer via RS232 serial port. Terminal nodes and intermediate nodes are powered by batteries, while the sink node is powered by an AC adapter.

B. Communication Test
We first test packet loss rate of the network by variation of node's moving speed. For the convenience of research, the motion is divided into four circumstances: (1) Platform 1# -Static, Platform 2# -Static; (2) Platform 1# -Static, Platform 2# -Rotating; (3) Platform 1# -Rotating, Platform 2# -Static; (4) Platform 1# and Platform 2# are rotating at the same speed. By classifying and comparing data in the above table, we will be able to draw graph as shown in Fig. 10.
Circumstance II: Platform 2# keeps still, while Platform 1# rotates separately at the uniform speed of 500, 1000, 1500, 2000, 2500 and 3000 circle/min. Circumstance III: Platform 1# and Platform 2# rotate at the same uniform speed, which is 500, 1000, 1500, 2000, 2500 and 3000 r/min. Results of the test are shown in the  table II.   TABLE II. TEST DATA

Speed (r/min) Due Packet
It can be seen from Fig. 10 that network under the Circumstance II performs the worst performance. And network under low-speed motion states (small than 500), whether intermediate nodes move or not will lead to an insignificant effect on packet loss rate. While after the rotation speed beyond 2500, there is a remarkable packet loss rate difference between Circumstance I and Circumstance II (about 10 percent).

C. Analysis of the reason why packet loss exists under
high-speed rotation For the serious problem of packet loss in the MANET under high-speed rotation, let's establish Doppler model in wireless sensor networks. With the two high-speed rotating platforms as the analysis background, we select one of the visualized high-speed movement scenes for analysis, and the schematic diagram is shown in Fig. 11. As shown above, we assume that node B on turntable platform 1# rotates at a certain speed n . We assume that it is in position X at moment 1 T , and in position Y at moment 2 T . During the motion time period t ! , node B receives the data from the terminal node A on the platform 2#. 1 ! , 2 ! are respectively the included angles of incident wave at moment 1 T and 2 T . When two turntable platforms are in a certain distance and the motion interval is small, we can consider that the included angle of incident wave has this result: 1 2 ! ! ! " = . At present, when the wireless electromagnetic wave is received respectively on point X and on point Y , the path difference is: In Formula (1), d is the diameter of the turntable platform, thus the phase change value of the receipt signals caused by the path difference is expressed as: Based on the Formula (2), we can obtain the frequency change value, namely Doppler frequency shift. (3) is the maximum Doppler frequency shift.
" " # # is the relative mobile speed between node A and node B. According to the Formula (3), dB f is about the turntable platform diameter d , the rotating speed and the incident angle of the electromagnetic wave transmission. The higher the rotating speed is, the bigger the Doppler frequency shift is. If the mobile forwarding node moves towards to the direction of the electromagnetic wave incidence of the terminal node, the Doppler frequency shift is positive (the received frequency increases); on the contrary, the Doppler frequency shift is negative (the increase of the received frequency drops).
D. Testing the Doppler effect of node transmission under the condition of high-speed rotation. For further verification and comparison, we design four different topological structures to test communication, so as to simulate the packet loss of high-speed nodes in the case of static routing. As the performance index, the packet loss rates in four different topological structures are compared, which lays a basis for the Doppler effect reason. Testing network topologies are shown in Fig. 12.  Fig. 12 (B), terminal nodes No. 1, 2, 3, 4 on the turntable platform 1# transmit to the sink node respectively through the forwarding nodes 5, 6, 7, 8. No. 1 node on turntable platform 1# in Fig. 12 (C) transmits to the sink node through the other nodes on its own turntable platform, and the condition of no. 5 node is the same as No.1 node in Fig. 12 (C). In Fig. 12 (D), No. 1 and No. 4 nodes are the terminal source nodes. They transmit through nodes on its own turntable platform and the node on another turntable platform to the sink node. According to the experimental data, the contrast curve chart of the packet loss rate is shown in Fig. 13. Figure 13. Packet loss rates of four network topologies As you can see from Fig. 13, with the increase of the rotating speed, the packet loss rates are on the rise in four topological structures. In the stationary state packet loss rates are all small (about one percent). When the rotating speed is small, the difference of the packet loss rates is not big. While with the packet loss rate rising, the difference of the packet loss rates of four topologies is obvious. The reason why packet loss with multi-hop is more than that with single hop is that data error accumulates through the forwarding and transmission of multiple nodes, leading to the greater packet loss. For single hop transmission, the PAPER A REMOTE TESTBED SYSTEM FOR MOBILE AD-HOC/SENSOR NETWORKS reason why the packet loss increases with the increase of rotating speed is that the Doppler effect appears in the signal transmission process of the network under the condition of rotating. With the increase of rotational speed, the Doppler effect between nodes becomes more and more obvious. This is also the reason why the packet loss rate of D is bigger than that of C in the case of the same hop count. Since the transmission of D is between two turntable platforms, the relative speed of node is much bigger, thus the frequency shift is much more, resulting in more packet loss. Therefore, in multi-hop transmission, the Doppler effect happens repeatedly between nodes under high-speed moving. In other words, there are multiple transmission signal fading, bringing out the rising of packet loss rate. The situation is even worse with the increase of the middle forwarding nodes.

V. CONCLUSION
This paper mainly proposes a remote testbed system for testing the performance of ad-hoc/sensor network protocol stack. It is analyzed that in the high-speed movement environment, the Doppler effects in the signal transmission of wireless sensor networks will happen, that greatly reduce the transmission performance of networks, leading to high packet loss rate. In the future work, this system has a certain innovativeness, as well as deficiencies. For example, design of ad-hoc network protocol stack still needs to be improved. Indexes for analyzing network performance can be diversified, such as network delay.