@@ -16,8 +16,8 @@ USEMODULE += gnrc_sock_udp
1616[ ` udp.c ` ] ( udp.c ) utilizes ` sock_udp_send() ` and ` sock_udp_recv() ` to exchange UDP packets
1717
1818## Task 6.1: Use UDP for messaging
19- 1 . Compile and run on two ` native ` instances
20- 2 . We have two new shell commands: ` udps ` to start a server and ` udp ` to send a message.
19+ 1 . Compile and run on two ` native ` instances
20+ 2 . We have two new shell commands: ` udps ` to start a server and ` udp ` to send a message.
2121 ```
2222 > help
2323 help
@@ -26,29 +26,32 @@ USEMODULE += gnrc_sock_udp
2626 udp send udp packets
2727 udps start udp server
2828 reboot Reboot the node
29+ version Prints current RIOT_VERSION
30+ pm interact with layered PM subsystem
2931 ps Prints information about running threads.
3032 ping6 Ping via ICMPv6
33+ ping Ping via ICMPv6
3134 random_init initializes the PRNG
3235 random_get returns 32 bit of pseudo randomness
36+ nib Configure neighbor information base
3337 ifconfig Configure network interfaces
34- ncache manage neighbor cache by hand
35- routers IPv6 default router list
3638 >
3739 ```
3840
39- 3 . Start a UDP server on port 8888 with ` udps 8888 ` .
41+ 3 . Start a UDP server on port 8888 with ` udps 8888 ` .
4042 Look at the output of ` ps `
4143 ```
4244 > ps
4345 ps
44- pid | name | state Q | pri | stack ( used) | location
45- 1 | idle | pending Q | 15 | 8192 ( 6240) | 0x806eb80
46- 2 | main | running Q | 7 | 12288 ( 9312) | 0x806bb80
47- 3 | ipv6 | bl rx _ | 4 | 8192 ( 6240) | 0x807bce0
48- 4 | udp | bl rx _ | 5 | 8192 ( 6240) | 0x807f760
49- 5 | gnrc_netdev2_tap | bl rx _ | 4 | 8192 ( 6240) | 0x8079ca0
50- 6 | UDP Server | bl rx _ | 6 | 8192 ( 6240) | 0x8077c60
51- | SUM | | | 53248 (40512)
46+ pid | name | state Q | pri | stack ( used) ( free) | base addr | current
47+ - | isr_stack | - - | - | 8192 ( -1) ( 8193) | 0x5664a540 | 0x5664a540
48+ 1 | idle | pending Q | 15 | 8192 ( 436) ( 7756) | 0x56648260 | 0x5664a0c0
49+ 2 | main | running Q | 7 | 12288 ( 3196) ( 9092) | 0x56645260 | 0x566480c0
50+ 3 | ipv6 | bl rx _ | 4 | 8192 ( 1616) ( 6576) | 0x56654540 | 0x566563a0
51+ 4 | udp | bl rx _ | 5 | 8192 ( 1008) ( 7184) | 0x566524c0 | 0x56654320
52+ 5 | gnrc_netdev_tap | bl rx _ | 2 | 8192 ( 2460) ( 5732) | 0x566568e0 | 0x56658740
53+ 6 | UDP Server | bl mbox _ | 6 | 8192 ( 2452) ( 5740) | 0x56643220 | 0x56645080
54+ | SUM | | | 61440 (11168) (50272)
5255 >
5356 ```
5457 The new thread for the UDP server has the PID 6 in this example.
@@ -57,21 +60,19 @@ USEMODULE += gnrc_sock_udp
5760 ```
5861 > ifconfig
5962 ifconfig
60- Iface 5 HWaddr: 22:7e:b9:04:9f:f0
61-
62- MTU:1500 HL:64
63- Source address length: 6
64- Link type: wired
65- inet6 addr: ff02::1/128 scope: local [multicast]
66- inet6 addr: fe80::207e:b9ff:fe04:9ff0/64 scope: local
67- inet6 addr: ff02::1:ff04:9ff0/128 scope: local [multicast]
63+ Iface 5 HWaddr: 36:1D:81:86:7D:21
64+ L2-PDU:1500 MTU:1500 HL:64 Source address length: 6
65+ Link type: wired
66+ inet6 addr: fe80::341d:81ff:fe86:7d21 scope: link VAL
67+ inet6 group: ff02::1
68+ inet6 group: ff02::1:ff86:7d21
6869 ```
6970
70715. From the second instance, send a udp packet with the `udp` command.
7172 ```
72- > udp fe80::207e:b9ff:fe04:9fef 8888 hello
73- udp fe80::207e:b9ff:fe04:9fef 8888 hello
74- Success: send 5 byte to fe80::207e:b9ff:fe04:9fef
73+ > udp fe80::341d:81ff:fe86:7d21 8888 hello
74+ udp fe80::341d:81ff:fe86:7d21 8888 hello
75+ Success: send 5 byte to fe80::341d:81ff:fe86:7d21
7576 ```
7677
7778## Task 6.2: Communicate with Linux
0 commit comments