1The comments and instructions below are for legacy IP stack in Zephyr. 2 3tunslip6 4======== 5 6tunslip6 can be used in host side to create a tun device that 7is connected to a unix socket that qemu is providing. This 8way it is possible to pass packets between host and target 9system via slip protocol. 10 11You need to connect tunslip6 to the second qemu serial line 12through a UNIX socket (qemu option -serial unix:/tmp/slip-socket). 13 141) Start socat 15 16$ socat PTY,link=/tmp/slip.dev UNIX-LISTEN:/tmp/slip.sock 17 182) Start qemu, use the listener demo app. Note that you need to 19 set CONFIG_NETWORKING_UART=y in your configuration. 20 21 You might need to set the platform and ARCH like this if simple_uart 22 driver is not found in your default platform. 23 24$ make PLATFORM_CONFIG=basic_cortex_m3 ARCH=arm \ 25 QEMU_EXTRA_FLAGS="-serial none -serial unix:/tmp/slip.sock" qemu 26 27 or just simply 28 29$ make qemu 30 313) Start tunslip6 32 33$ sudo ./tunslip6 -s `readlink /tmp/slip.dev` 2001:db8::1/64 34 354) Send data to listener 36 37$ nc -u -6 2001:db8::2 4242 <<EOF 38foobar 39EOF 40 41There are also convenience scripts for running socat, radvd and 42tunslip6 processes called loop-socat.sh, loop-radvd.sh and 43loop-slip.sh. So to simplify things you need three terminals 44for doing this: 45 46Terminal 1: 47$ ./loop-socat.sh 48 49Terminal 2: 50$ sudo ./loop-slip.sh 51 52Terminal 3: 53$ sudo ./loop-radvd.sh 54 55After running these scripts you do not need to manual restart 56them when qemu process stops. 57 58 59radvd 60===== 61In order the IPv6 stateless address auto configuration (SLAAC) 62to work, you need to run radvd or similar tool in host side. 63There is an example radvd.conf file present in the tools directory. 64 65$ sudo radvd -d 1 -C radvd.conf -m stderr 66 67 68tunslip 69======= 70 71tunslip if for IPv4 networks and it can be used in host side 72to create a tun device that is connected to a unix socket that 73qemu is providing. This way it is possible to pass packets 74between host and target system via slip protocol. 75 76You need to connect tunslip to the second qemu serial line 77through a UNIX socket (qemu option -serial unix:/tmp/slip-socket). 78 791) Start socat 80 81$ socat PTY,link=/tmp/slip.dev UNIX-LISTEN:/tmp/slip.sock 82 832) Start qemu, use the listener demo app. Note that you need to 84 set CONFIG_NETWORKING_UART=y in your configuration. 85 86 You might need to set the platform and ARCH like this if simple_uart 87 driver is not found in your default platform. 88 89$ make PLATFORM_CONFIG=basic_cortex_m3 ARCH=arm \ 90 QEMU_EXTRA_FLAGS="-serial none -serial unix:/tmp/slip.sock" qemu 91 923) Start tunslip 93 94$ sudo ./tunslip -s `readlink /tmp/slip.dev` 192.0.2.1 255.255.255.0 95 964) Send data to listener 97 98$ nc -u 192.0.2.2 4242 <<EOF 99foobar 100EOF 101 102 103echo-client 104=========== 105 106echo-client is a tool that is run in Linux host side and 107which sends pre-defined UDP data packets to echo-server 108application that is running in qemu side. This client 109process verifies that it is able to receive data correctly 110from the echo-server and thus verify that the upper layer 111networking components in Zephyr IP stack work properly. 112 113You needs to setup the slip connection (see the steps 1 to 3) 114in tunslip6 section of this document. 115 116Example: 117 118$ ./echo-client 2001:db8::2 119 120In order to send multicast IPv6 packets, one needs to 121give the network interface as a parameter. 122 123$ ./echo-client -i tun0 ff84::2 124 125 126echo-server 127=========== 128 129echo-server is a tool that is run in Linux host side and 130which waits UDP data sent by echo-client application that 131is running in qemu side. 132 133You needs to setup the slip connection (see the steps 1 to 3) 134in tunslip6 section of this document. Make sure that the Linux 135host firewall is not blocking the packets that the echo-client 136running in qemu is sending via tun0 device. 137 138Example: 139 140$ sudo ./echo-server -i tun0 141 142 143dtls-client 144=========== 145 146dtls-client is a tool that is run in Linux host side and 147which connects to dtls-server running in qemu. 148 149You needs to setup the slip connection (see the steps 1 to 3) 150in tunslip6 section of this document. 151 152Example: 153 154$ make dtls-client 155 156$ ./dtls-client -b 2001:db8::1 2001:db8::2 157 158 159dtls-server 160=========== 161 162dtls-server is a tool that is run in Linux host side and 163which waits DTLS data sent by dtls-client application that 164is running in qemu side. 165 166You needs to setup the slip connection (see the steps 1 to 3) 167in tunslip6 section of this document. 168 169Example: 170 171$ make dtls-server 172 173$ ./dtls-server -i tun0 174 175monitor_15_4 176============ 177 178monitor_15_4 is a tool that is run in Linux host side and 179which reads data from pipes which is written buy 15.4 test 180application from qemu. This is T juntion tool which reads 181and writes data from pipes and feed into pipes (this way 182both qemus communicate each other) and same time data 183written in PCAP format for wireshark monitoring. 184 185Please also read samples/network/test_15_4/README for 186how to configure and run two qemus. 187 188Make and run this tool 189 190$ make 191 192Usage : monitor_15_4 <sample pcap file> [<pipe_1> <pipe_2>] 193 194$ monitor_15_4 sample.pcap 195 196or 197 198$ monitor_15_4 sample.pcap /tmp/ip-15-4-1 /tmp/ip-15-4-2 199 200 201coap-client 202=========== 203 204coap-client is a tool that is run in Linux host side and 205which connects to coap-server running in qemu. 206 207You needs to setup the slip connection (see the steps 1 to 3) 208in tunslip6 section of this document. 209 210Example: 211 212$ make coap-client 213 214If you want to use DTLS then run client like this 215$ sudo ./coap-client -i tun0 2001:db8::2 216 217For non-DTLS case, run client like this 218$ sudo ./coap-client -n -i tun0 2001:db8::2 219 220 221coap-observe-client 222=================== 223 224You can test the coap-observe-client that is running in qemu 225using the coap-server example server that is found in libcoap. 226So get libcoap package which can be found here 227https://github.com/obgm/libcoap.git 228Compile and install the libcoap library in host. 229 230You needs to setup the slip connection (see the steps 1 to 3) 231in tunslip6 section of this document. 232 233$ /home/user/libcoap/examples/coap-server -A 2001:db8::1 -p 5683 234 235Then in the samples/network/coap_observe_client directory, say 236 237$ make qemu 238