跳转到主要内容

LoRaWAN协议(七)--完整数据流程

<p>以下的GW指Gateway</p>

<p>所用指令:</p>

<p>tcpdump -i lo -nn -x 'length&gt;100'</p>

<p><strong>入网流程</strong></p>

<p>OTAA入网流程,ABP方式入网则不需要</p>

<ul>
<li>GW -&gt; NS join_request</li>
</ul>

<p>16:38:10.426740 IP 127.0.0.1.49875 &gt; 127.0.0.1.1680: UDP, length 208 &nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 00ec 9d19 4000 4011 9ee5 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 c2d3 0690 00d8 feeb 0154 9f00<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;fffe b827 ebf2 1a07 7b22 7278 706b 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;5b7b 2274 6d73 7422 3a35 3332 3530 3536<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;3230 2c22 6368 616e 223a 362c 2272 6663<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;6822 3a30 2c22 6672 6571 223a 3437 312e<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;3930 3030 3030 2c22 7374 6174 223a 312c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;226d 6f64 7522 3a22 4c4f 5241 222c 2264<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;6174 7222 3a22 5346 3132 4257 3132 3522<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0090: &nbsp;2c22 636f 6472 223a 2234 2f35 222c 226c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00a0: &nbsp;736e 7222 3a2d 3137 2e30 2c22 7273 7369<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00b0: &nbsp;223a 2d38 312c 2273 697a 6522 3a32 332c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00c0: &nbsp;2264 6174 6122 3a22 4141 4541 4143 4141<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00d0: &nbsp;7853 5973 4668 4157 4941 4233 5367 4255<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00e0: &nbsp;6530 4174 345a 6f3d 227d 5d7d<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
7b22 7278 706b 223a<br />
5b7b 2274 6d73 7422 3a35 3332 3530 3536<br />
3230 2c22 6368 616e 223a 362c 2272 6663<br />
6822 3a30 2c22 6672 6571 223a 3437 312e<br />
3930 3030 3030 2c22 7374 6174 223a 312c<br />
226d 6f64 7522 3a22 4c4f 5241 222c 2264<br />
6174 7222 3a22 5346 3132 4257 3132 3522<br />
2c22 636f 6472 223a 2234 2f35 222c 226c<br />
736e 7222 3a2d 3137 2e30 2c22 7273 7369<br />
223a 2d38 312c 2273 697a 6522 3a32 332c<br />
2264 6174 6122 3a22 4141 4541 4143 4141<br />
7853 5973 4668 4157 4941 4233 5367 4255<br />
6530 4174 345a 6f3d 227d 5d7d</p>

<p>{<br />
&nbsp; &nbsp; "rxpk": [<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "tmst": 532505620,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "chan": 6,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "rfch": 0,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "freq": 471.9,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "stat": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "modu": "LORA",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "datr": "SF12BW125",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "codr": "4/5",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "lsnr": -17,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "rssi": -81,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "size": 23,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "data": "AAEAACAAxSYsFhAWIAB3SgBUe0At4Zo="<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; ]<br />
}</p>

<p>data base64 decode:<br />
\x00 \x01 \x00 \x00 \x20 \x00 \xc5 \x26&nbsp;<br />
\x2c \x16 \x10 \x16 \x20 \x00 \x77 \x4a&nbsp;<br />
\x00 \x54 \x7b \x40 \x2d \xe1 \x9a&nbsp;</p>

<p>&nbsp;</p>

<ul>
<li>NS -&gt; AS</li>
</ul>

<p>16:38:10.427560 IP 127.0.0.1.42189 &gt; 127.0.0.1.4000: Flags [P.], seq 976281099:976281164, ack 424415867, win 350, options [nop,nop,TS val 457630 ecr 457618], length 65<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 0075 26ca 4000 4006 15b7 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 a4cd 0fa0 3a30 de0b 194c 127b<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 015e fe69 0000 0101 080a 0006 fb9e<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0006 fb92 7b22 6a6f 696e 223a 7b22 7265<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;7175 6573 7422 3a7b 2266 7261 6d65 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;2241 4145 4141 4341 4178 5359 7346 6841<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;5749 4142 3353 6742 5565 3041 7434 5a6f<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;227d 7d7d 00<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
7b22 6a6f 696e 223a 7b22 7265<br />
7175 6573 7422 3a7b 2266 7261 6d65 223a<br />
2241 4145 4141 4341 4178 5359 7346 6841<br />
5749 4142 3353 6742 5565 3041 7434 5a6f<br />
227d 7d7d 00</p>

<p>{<br />
&nbsp; &nbsp; "join": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "request": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "frame": "AAEAACAAxSYsFhAWIAB3SgBUe0At4Zo"<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
}</p>

<p>frame base64 decode:<br />
\x00 \x01 \x00 \x00 \x20 \x00 \xc5 \x26&nbsp;<br />
\x2c \x16 \x10 \x16 \x20 \x00 \x77 \x4a&nbsp;<br />
\x00 \x54 \x7b \x40 \x2d \xe1 \x9a&nbsp;</p>

<ul>
<li>AS -&gt; NS</li>
</ul>

<p>16:38:10.439244 IP 127.0.0.1.4000 &gt; 127.0.0.1.42189: Flags [P.], seq 1:53, ack 65, win 6146, options [nop,nop,TS val 457631 ecr 457630], length 52<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 0068 c4fa 4000 4006 7793 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 0fa0 a4cd 194c 127b 3a30 de4c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 1802 fe5c 0000 0101 080a 0006 fb9f<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0006 fb9e 7b22 6a6f 696e 223a 7b22 6d6f<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;7465 6575 6922 3a22 3461 3737 3030 3230<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;3136 3130 3136 222c 2261 6363 6570 7422<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;3a74 7275 657d 7d00<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
7b22 6a6f 696e 223a 7b22 6d6f<br />
7465 6575 6922 3a22 3461 3737 3030 3230<br />
3136 3130 3136 222c 2261 6363 6570 7422<br />
3a74 7275 657d 7d00</p>

<p>{<br />
&nbsp; &nbsp; "join": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "moteeui": "4a770020161016",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "accept": true<br />
&nbsp; &nbsp; }<br />
}</p>

<ul>
<li>NS -&gt; AS</li>
</ul>

<p>16:38:10.440946 IP 127.0.0.1.42189 &gt; 127.0.0.1.4000: Flags [P.], seq 65:185, ack 53, win 350, options [nop,nop,TS val 457631 ecr 457631], length 120<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 00ac 26cc 4000 4006 157e 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 a4cd 0fa0 3a30 de4c 194c 12af<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 015e fea0 0000 0101 080a 0006 fb9f<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0006 fb9f 7b22 6a6f 696e 223a 7b22 6170<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;7065 7569 223a 2232 6332 3663 3530 3032<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;3030 3030 3030 3122 2c22 6d6f 7465 6575<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;6922 3a22 3461 3737 3030 3230 3136 3130<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;3136 222c 2264 6574 6169 6c73 223a 7b22<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;6d6f 7465 6164 6472 223a 2234 3830 3030<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0090: &nbsp;3030 3222 2c22 6465 7669 6365 6e6f 6e63<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00a0: &nbsp;6522 3a33 3135 3732 7d7d 7d00</p>

<p>&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
7b22 6a6f 696e 223a 7b22 6170<br />
7065 7569 223a 2232 6332 3663 3530 3032<br />
3030 3030 3030 3122 2c22 6d6f 7465 6575<br />
6922 3a22 3461 3737 3030 3230 3136 3130<br />
3136 222c 2264 6574 6169 6c73 223a 7b22<br />
6d6f 7465 6164 6472 223a 2234 3830 3030<br />
3030 3222 2c22 6465 7669 6365 6e6f 6e63<br />
6522 3a33 3135 3732 7d7d 7d00</p>

<p>{<br />
&nbsp; &nbsp; "join": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "appeui": "2c26c50020000001",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "moteeui": "4a770020161016",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "details": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "moteaddr": "48000002",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "devicenonce": 31572<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
}</p>

<ul>
<li>AS -&gt; NS</li>
</ul>

<p>16:38:10.482046 IP 127.0.0.1.4000 &gt; 127.0.0.1.42189: Flags [P.], seq 53:186, ack 185, win 6146, options [nop,nop,TS val 457636 ecr 457631], length 133<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 00b9 c4fc 4000 4006 7740 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 0fa0 a4cd 194c 12af 3a30 dec4<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 1802 fead 0000 0101 080a 0006 fba4<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0006 fb9f 7b22 6a6f 696e 223a 7b22 6d6f<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;7465 6575 6922 3a22 3461 3737 3030 3230<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;3136 3130 3136 222c 2263 6f6d 706c 6574<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;6522 3a7b 2266 7261 6d65 223a 2249 5071<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;414b 5851 374c 532f 436d 5956 4344 7938<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;4b33 6b34 222c 226e 6574 776f 726b 6b65<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0090: &nbsp;7922 3a22 6465 3033 3333 3161 6562 3432<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00a0: &nbsp;3534 6539 3732 3762 3666 6166 6266 3133<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00b0: &nbsp;6462 3364 227d 7d7d 00<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;</p>

<p>7b22 6a6f 696e 223a 7b22 6d6f<br />
7465 6575 6922 3a22 3461 3737 3030 3230<br />
3136 3130 3136 222c 2263 6f6d 706c 6574<br />
6522 3a7b 2266 7261 6d65 223a 2249 5071<br />
414b 5851 374c 532f 436d 5956 4344 7938<br />
4b33 6b34 222c 226e 6574 776f 726b 6b65<br />
7922 3a22 6465 3033 3333 3161 6562 3432<br />
3534 6539 3732 3762 3666 6166 6266 3133<br />
6462 3364 227d 7d7d 00 &nbsp; &nbsp; &nbsp;</p>

<p>{<br />
&nbsp; &nbsp; "join": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "moteeui": "4a770020161016",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "complete": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "frame": "IPqAKXQ7LS/CmYVCDy8K3k4",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "networkkey": "de03331aeb4254e9727b6fafbf13db3d"<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
}</p>

<p>frame base64 decode:<br />
\x20 \xfa \x80 \x29 \x74 \x3b \x2d \x2f&nbsp;<br />
\xc2 \x99 \x85 \x42 \x0f \x2f \x0a \xde&nbsp;<br />
\x4e&nbsp;</p>

<ul>
<li>AS -&gt; CS</li>
</ul>

<p>16:38:10.482266 IP 127.0.0.1.37188 &gt; 127.0.0.1.5000: Flags [P.], seq 3036262291:3036262362, ack 3069608558, win 342, options [nop,nop,TS val 457636 ecr 457633], length 71<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 007b 155e 4000 4006 271d 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 9144 1388 b4f9 af93 b6f6 826e<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 0156 fe6f 0000 0101 080a 0006 fba4<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0006 fba1 7b22 6d6f 7465 223a 7b22 6575<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;6922 3a22 3461 3737 3030 3230 3136 3130<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;3136 222c 226a 6f69 6e22 3a7b 2261 7070<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;6575 6922 3a22 3263 3236 6335 3030 3230<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;3030 3030 3031 227d 7d7d 00</p>

<p>7b22 6d6f 7465 223a 7b22 6575<br />
6922 3a22 3461 3737 3030 3230 3136 3130<br />
3136 222c 226a 6f69 6e22 3a7b 2261 7070<br />
6575 6922 3a22 3263 3236 6335 3030 3230<br />
3030 3030 3031 227d 7d7d 00 &nbsp; &nbsp;&nbsp;</p>

<p>{<br />
&nbsp; &nbsp; "mote": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "eui": "4a770020161016",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "join": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "appeui": "2c26c50020000001"<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; }<br />
}</p>

<p>&nbsp;</p>

<ul>
<li>NS-&gt;GW Join_accept message</li>
</ul>

<p>16:38:14.677344 IP 127.0.0.1.1680 &gt; 127.0.0.1.48034: UDP, length 169<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 00c5 9d74 4000 4011 9eb1 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 0690 bba2 00b1 fec4 0100 0003<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;7b22 7478 706b 223a 7b22 746d 7374 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;3533 3735 3035 3632 302c 2266 7265 7122<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;3a34 3731 2e39 3030 3030 302c 2272 6663<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;6822 3a30 2c22 706f 7765 223a 3134 2c22<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;6d6f 6475 223a 224c 4f52 4122 2c22 6461<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;7472 223a 2253 4631 3242 5731 3235 222c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;2263 6f64 7222 3a22 342f 3522 2c22 6970<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0090: &nbsp;6f6c 223a 7472 7565 2c22 7369 7a65 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00a0: &nbsp;3137 2c22 6461 7461 223a 2249 5071 414b<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00b0: &nbsp;5851 374c 532f 436d 5956 4344 7938 4b33<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00c0: &nbsp;6b34 227d 7d</p>

<p><br />
7b22 7478 706b 223a 7b22 746d 7374 223a<br />
3533 3735 3035 3632 302c 2266 7265 7122<br />
3a34 3731 2e39 3030 3030 302c 2272 6663<br />
6822 3a30 2c22 706f 7765 223a 3134 2c22<br />
6d6f 6475 223a 224c 4f52 4122 2c22 6461<br />
7472 223a 2253 4631 3242 5731 3235 222c<br />
2263 6f64 7222 3a22 342f 3522 2c22 6970<br />
6f6c 223a 7472 7565 2c22 7369 7a65 223a<br />
3137 2c22 6461 7461 223a 2249 5071 414b<br />
5851 374c 532f 436d 5956 4344 7938 4b33<br />
6b34 227d 7d &nbsp; &nbsp; &nbsp; &nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
{<br />
&nbsp; &nbsp; "txpk": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "tmst": 537505620,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "freq": 471.9,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "rfch": 0,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "powe": 14,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "modu": "LORA",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "datr": "SF12BW125",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "codr": "4/5",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "ipol": true,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "size": 17,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "data": "IPqAKXQ7LS/CmYVCDy8K3k4"<br />
&nbsp; &nbsp; }<br />
}</p>

<p>data base64 decode:<br />
\x20 \xfa \x80 \x29 \x74 \x3b \x2d \x2f&nbsp;<br />
\xc2 \x99 \x85 \x42 \x0f \x2f \x0a \xde&nbsp;<br />
\x4e&nbsp;</p>

<p>&nbsp;</p>

<ul>
<li>GW -&gt; NS</li>
</ul>

<p>16:38:15.360678 IP 127.0.0.1.49875 &gt; 127.0.0.1.1680: UDP, length 113<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 008d 9d77 4000 4011 9ee6 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 c2d3 0690 0079 fe8c 014d 2900<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;fffe b827 ebf2 1a07 7b22 7374 6174 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;7b22 7469 6d65 223a 2232 3031 362d 3131<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;2d32 3420 3136 3a33 383a 3135 2047 4d54<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;222c 2272 786e 6222 3a33 2c22 7278 6f6b<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;223a 312c 2272 7866 7722 3a31 2c22 6163<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;6b72 223a 3130 302e 302c 2264 776e 6222<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;3a31 2c22 7478 6e62 223a 317d 7d</p>

<p>7b22 7374 6174 223a<br />
7b22 7469 6d65 223a 2232 3031 362d 3131<br />
2d32 3420 3136 3a33 383a 3135 2047 4d54<br />
222c 2272 786e 6222 3a33 2c22 7278 6f6b<br />
223a 312c 2272 7866 7722 3a31 2c22 6163<br />
6b72 223a 3130 302e 302c 2264 776e 6222<br />
3a31 2c22 7478 6e62 223a 317d 7d</p>

<p>{<br />
&nbsp; &nbsp; "stat": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "time": "2016-11-24 16:38:15 GMT",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "rxnb": 3,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "rxok": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "rxfw": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "ackr": 100,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "dwnb": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "txnb": 1<br />
&nbsp; &nbsp; }<br />
}</p>

<p>&nbsp;</p>

<h2 id="数据通讯流程">数据通讯流程</h2>

<ul>
<li>GW-&gt;NS</li>
</ul>

<p>16:38:20.430581 IP 127.0.0.1.49875 &gt; 127.0.0.1.1680: UDP, length 216<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 00f4 9e4d 4000 4011 9da9 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 c2d3 0690 00e0 fef3 0116 b300<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;fffe b827 ebf2 1a07 7b22 7278 706b 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;5b7b 2274 6d73 7422 3a35 3432 3531 3235<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;3030 2c22 6368 616e 223a 312c 2272 6663<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;6822 3a31 2c22 6672 6571 223a 3437 322e<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;3530 3030 3030 2c22 7374 6174 223a 312c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;226d 6f64 7522 3a22 4c4f 5241 222c 2264<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;6174 7222 3a22 5346 3132 4257 3132 3522<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0090: &nbsp;2c22 636f 6472 223a 2234 2f35 222c 226c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00a0: &nbsp;736e 7222 3a2d 3138 2e30 2c22 7273 7369<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00b0: &nbsp;223a 2d38 352c 2273 697a 6522 3a32 382c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00c0: &nbsp;2264 6174 6122 3a22 5141 4941 4145 6741<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00d0: &nbsp;4151 4143 7168 6831 5745 4967 4477 584d<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00e0: &nbsp;4366 3576 4174 616b 414e 5348 5267 3d3d<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00f0: &nbsp;227d 5d7d</p>

<p>7b22 7278 706b 223a<br />
5b7b 2274 6d73 7422 3a35 3432 3531 3235<br />
3030 2c22 6368 616e 223a 312c 2272 6663<br />
6822 3a31 2c22 6672 6571 223a 3437 322e<br />
3530 3030 3030 2c22 7374 6174 223a 312c<br />
226d 6f64 7522 3a22 4c4f 5241 222c 2264<br />
6174 7222 3a22 5346 3132 4257 3132 3522<br />
2c22 636f 6472 223a 2234 2f35 222c 226c<br />
736e 7222 3a2d 3138 2e30 2c22 7273 7369<br />
223a 2d38 352c 2273 697a 6522 3a32 382c<br />
2264 6174 6122 3a22 5141 4941 4145 6741<br />
4151 4143 7168 6831 5745 4967 4477 584d<br />
4366 3576 4174 616b 414e 5348 5267 3d3d<br />
227d 5d7d</p>

<p>{<br />
&nbsp; &nbsp; "rxpk": [<br />
&nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "tmst": 542512500,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "chan": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "rfch": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "freq": 472.5,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "stat": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "modu": "LORA",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "datr": "SF12BW125",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "codr": "4/5",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "lsnr": -18,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "rssi": -85,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "size": 28,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "data": "QAIAAEgAAQACqhh1WEIgDwXMCf5vAtakANSHRg=="<br />
&nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; ]<br />
}</p>

<p>data base64 decode:<br />
\x40 \x02 \x00 \x00 \x48 \x00 \x01 \x00&nbsp;<br />
\x02 \xaa \x18 \x75 \x58 \x42 \x20 \x0f&nbsp;<br />
\x05 \xcc \x09 \xfe \x6f \x02 \xd6 \xa4&nbsp;<br />
\x00 \xd4 \x87 \x46&nbsp;</p>

<ul>
<li>NS -&gt; AS</li>
</ul>

<p>16:38:20.786860 IP 127.0.0.1.42189 &gt; 127.0.0.1.4000: Flags [P.], seq 219:530, ack 221, win 359, options [nop,nop,TS val 458666 ecr 458661], length 311<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 016b 2713 4000 4006 1478 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 a4cd 0fa0 3a30 dee6 194c 1357<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 0167 ff5f 0000 0101 080a 0006 ffaa<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0006 ffa5 7b22 6170 7022 3a7b 226d 6f74<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;6565 7569 223a 2234 6137 3730 3032 3031<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;3631 3031 3622 2c22 6469 7222 3a22 7570<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;222c 2273 6571 6e6f 223a 312c 2275 7365<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;7264 6174 6122 3a7b 2270 6f72 7422 3a32<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;2c22 7061 796c 6f61 6422 3a22 7168 6831<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0090: &nbsp;5745 4967 4477 584d 4366 3576 4174 616b<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00a0: &nbsp;227d 2c22 6d6f 7465 7478 223a 7b22 6672<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00b0: &nbsp;6571 223a 3437 322e 352c 2264 6174 7222<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00c0: &nbsp;3a22 5346 3132 4257 3132 3522 2c22 636f<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00d0: &nbsp;6472 223a 2234 2f35 222c 2261 6472 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00e0: &nbsp;6661 6c73 657d 2c22 6777 7278 223a 5b7b<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00f0: &nbsp;2265 7569 223a 2266 6666 6562 3832 3765<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0100: &nbsp;6266 3231 6130 3722 2c22 7469 6d65 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0110: &nbsp;2232 3031 362d 3131 2d32 3454 3136 3a33<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0120: &nbsp;383a 3230 5a22 2c22 7469 6d65 6672 6f6d<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0130: &nbsp;6761 7465 7761 7922 3a66 616c 7365 2c22<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0140: &nbsp;6368 616e 223a 312c 2272 6663 6822 3a31<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0150: &nbsp;2c22 7273 7369 223a 2d38 352c 226c 736e<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0160: &nbsp;7222 3a2d 3138 7d5d 7d7d 00<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
7b22 6170 7022 3a7b 226d 6f74<br />
6565 7569 223a 2234 6137 3730 3032 3031<br />
3631 3031 3622 2c22 6469 7222 3a22 7570<br />
222c 2273 6571 6e6f 223a 312c 2275 7365<br />
7264 6174 6122 3a7b 2270 6f72 7422 3a32<br />
2c22 7061 796c 6f61 6422 3a22 7168 6831<br />
5745 4967 4477 584d 4366 3576 4174 616b<br />
227d 2c22 6d6f 7465 7478 223a 7b22 6672<br />
6571 223a 3437 322e 352c 2264 6174 7222<br />
3a22 5346 3132 4257 3132 3522 2c22 636f<br />
6472 223a 2234 2f35 222c 2261 6472 223a<br />
6661 6c73 657d 2c22 6777 7278 223a 5b7b<br />
2265 7569 223a 2266 6666 6562 3832 3765<br />
6266 3231 6130 3722 2c22 7469 6d65 223a<br />
2232 3031 362d 3131 2d32 3454 3136 3a33<br />
383a 3230 5a22 2c22 7469 6d65 6672 6f6d<br />
6761 7465 7761 7922 3a66 616c 7365 2c22<br />
6368 616e 223a 312c 2272 6663 6822 3a31<br />
2c22 7273 7369 223a 2d38 352c 226c 736e<br />
7222 3a2d 3138 7d5d 7d7d 00</p>

<p><br />
{<br />
&nbsp; &nbsp; "app": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "moteeui": "4a770020161016",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "dir": "up",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "seqno": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "userdata": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "port": 2,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "payload": "qhh1WEIgDwXMCf5vAtak"<br />
&nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; "motetx": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "freq": 472.5,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "datr": "SF12BW125",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "codr": "4/5",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "adr": false<br />
&nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; "gwrx": [<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "eui": "fffeb827ebf21a07",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "time": "2016-11-24T16:38:20Z",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "timefromgateway": false,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "chan": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "rfch": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "rssi": -85,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "lsnr": -18<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; ]<br />
&nbsp; &nbsp; }<br />
}</p>

<p>&nbsp;</p>

<ul>
<li>AS -&gt; NC</li>
</ul>

<p>16:38:20.787061 IP 127.0.0.1.45769 &gt; 127.0.0.1.6000: Flags [P.], seq 3402358219:3402358475, ack 524101621, win 342, options [nop,nop,TS val 458666 ecr 458646], length 256<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 0134 9fbb 4000 4006 9c06 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 b2c9 1770 cacb ddcb 1f3d 27f5<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 0156 ff28 0000 0101 080a 0006 ffaa<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0006 ff96 7b22 6170 7022 3a7b 226d 6f74<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;6565 7569 223a 2234 6137 3730 3032 3031<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;3631 3031 3622 2c22 6469 7222 3a22 7570<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;222c 2273 6571 6e6f 223a 312c 226d 6f74<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;6574 7822 3a7b 2266 7265 7122 3a34 3732<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;2e35 2c22 6461 7472 223a 2253 4631 3242<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0090: &nbsp;5731 3235 222c 2263 6f64 7222 3a22 342f<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00a0: &nbsp;3522 2c22 6164 7222 3a66 616c 7365 7d2c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00b0: &nbsp;2267 7772 7822 3a5b 7b22 6575 6922 3a22<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00c0: &nbsp;6666 6665 6238 3237 6562 6632 3161 3037<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00d0: &nbsp;222c 2274 696d 6522 3a22 3230 3136 2d31<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00e0: &nbsp;312d 3234 5431 363a 3338 3a32 305a 222c<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00f0: &nbsp;2274 696d 6566 726f 6d67 6174 6577 6179<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0100: &nbsp;223a 6661 6c73 652c 2263 6861 6e22 3a31<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0110: &nbsp;2c22 7266 6368 223a 312c 2272 7373 6922<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0120: &nbsp;3a2d 3835 2c22 6c73 6e72 223a 2d31 387d<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0130: &nbsp;5d7d 7d00</p>

<p>&nbsp;</p>

<ul>
<li>AS -&gt;CS</li>
</ul>

<p>16:38:20.787587 IP 127.0.0.1.37188 &gt; 127.0.0.1.5000: Flags [P.], seq 105:416, ack 36, win 342, options [nop,nop,TS val 458666 ecr 458662], length 311<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 016b 15a4 4000 4006 25e7 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 9144 1388 b4f9 affc b6f6 8291<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 0156 ff5f 0000 0101 080a 0006 ffaa<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0006 ffa6 7b22 6170 7022 3a7b 226d 6f74<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;6565 7569 223a 2234 6137 3730 3032 3031<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;3631 3031 3622 2c22 6469 7222 3a22 7570<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;222c 2273 6571 6e6f 223a 312c 2275 7365<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;7264 6174 6122 3a7b 2270 6f72 7422 3a32<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;2c22 7061 796c 6f61 6422 3a22 4151 4944<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0090: &nbsp;4241 5547 4277 674a 4367 734d 4451 3450<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00a0: &nbsp;227d 2c22 6d6f 7465 7478 223a 7b22 6672<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00b0: &nbsp;6571 223a 3437 322e 352c 2264 6174 7222<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00c0: &nbsp;3a22 5346 3132 4257 3132 3522 2c22 636f<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00d0: &nbsp;6472 223a 2234 2f35 222c 2261 6472 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00e0: &nbsp;6661 6c73 657d 2c22 6777 7278 223a 5b7b<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x00f0: &nbsp;2265 7569 223a 2266 6666 6562 3832 3765<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0100: &nbsp;6266 3231 6130 3722 2c22 7469 6d65 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0110: &nbsp;2232 3031 362d 3131 2d32 3454 3136 3a33<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0120: &nbsp;383a 3230 5a22 2c22 7469 6d65 6672 6f6d<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0130: &nbsp;6761 7465 7761 7922 3a66 616c 7365 2c22<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0140: &nbsp;6368 616e 223a 312c 2272 6663 6822 3a31<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0150: &nbsp;2c22 7273 7369 223a 2d38 352c 226c 736e<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0160: &nbsp;7222 3a2d 3138 7d5d 7d7d 00<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
7b22 6170 7022 3a7b 226d 6f74<br />
6565 7569 223a 2234 6137 3730 3032 3031<br />
3631 3031 3622 2c22 6469 7222 3a22 7570<br />
222c 2273 6571 6e6f 223a 312c 2275 7365<br />
7264 6174 6122 3a7b 2270 6f72 7422 3a32<br />
2c22 7061 796c 6f61 6422 3a22 4151 4944<br />
4241 5547 4277 674a 4367 734d 4451 3450<br />
227d 2c22 6d6f 7465 7478 223a 7b22 6672<br />
6571 223a 3437 322e 352c 2264 6174 7222<br />
3a22 5346 3132 4257 3132 3522 2c22 636f<br />
6472 223a 2234 2f35 222c 2261 6472 223a<br />
6661 6c73 657d 2c22 6777 7278 223a 5b7b<br />
2265 7569 223a 2266 6666 6562 3832 3765<br />
6266 3231 6130 3722 2c22 7469 6d65 223a<br />
2232 3031 362d 3131 2d32 3454 3136 3a33<br />
383a 3230 5a22 2c22 7469 6d65 6672 6f6d<br />
6761 7465 7761 7922 3a66 616c 7365 2c22<br />
6368 616e 223a 312c 2272 6663 6822 3a31<br />
2c22 7273 7369 223a 2d38 352c 226c 736e<br />
7222 3a2d 3138 7d5d 7d7d</p>

<p>{<br />
&nbsp; &nbsp; "app": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "moteeui": "4a770020161016",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "dir": "up",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "seqno": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; "userdata": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "port": 2,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "payload": "AQIDBAUGBwgJCgsMDQ4P"<br />
&nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; "motetx": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "freq": 472.5,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "datr": "SF12BW125",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "codr": "4/5",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "adr": false<br />
&nbsp; &nbsp; &nbsp; &nbsp; },<br />
&nbsp; &nbsp; &nbsp; &nbsp; "gwrx": [<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; {<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "eui": "fffeb827ebf21a07",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "time": "2016-11-24T16:38:20Z",<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "timefromgateway": false,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "chan": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "rfch": 1,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "rssi": -85,<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; "lsnr": -18<br />
&nbsp; &nbsp; &nbsp; &nbsp; &nbsp; &nbsp; }<br />
&nbsp; &nbsp; &nbsp; &nbsp; ]<br />
&nbsp; &nbsp; }<br />
}</p>

<p>app.userdata.payload &nbsp;base64+aes 解密,得到:<br />
\x01 \x02 \x03 \x04 \x05 \x06 \x07 \x08&nbsp;<br />
\x09 \x0a \x0b \x0c \x0d \x0e \x0f&nbsp;<br />
可以看到是用户发上去的负载了,说明解密的工作完成了</p>

<p>&nbsp;</p>

<h2 id="其他">其他</h2>

<ul>
<li>GW-&gt;NS 时间同步包</li>
</ul>

<p>16:37:45.362854 IP 127.0.0.1.49875 &gt; 127.0.0.1.1680: UDP, length 113 &nbsp;&nbsp;<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 008d 9692 4000 4011 a5cb 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 c2d3 0690 0079 fe8c 01a0 6800<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;fffe b827 ebf2 1a07 7b22 7374 6174 223a<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;7b22 7469 6d65 223a 2232 3031 362d 3131<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;2d32 3420 3136 3a33 373a 3435 2047 4d54<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;222c 2272 786e 6222 3a30 2c22 7278 6f6b<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;223a 302c 2272 7866 7722 3a30 2c22 6163<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0070: &nbsp;6b72 223a 3130 302e 302c 2264 776e 6222<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0080: &nbsp;3a30 2c22 7478 6e62 223a 307d 7d<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
7b22 7374 6174 223a<br />
7b22 7469 6d65 223a 2232 3031 362d 3131<br />
2d32 3420 3136 3a33 373a 3435 2047 4d54<br />
222c 2272 786e 6222 3a30 2c22 7278 6f6b<br />
223a 302c 2272 7866 7722 3a30 2c22 6163<br />
6b72 223a 3130 302e 302c 2264 776e 6222<br />
3a30 2c22 7478 6e62 223a 307d 7d</p>

<p>&nbsp;</p>

<ul>
<li>AS -&gt; NC</li>
</ul>

<p>16:38:24.471968 IP 127.0.0.1.45769 &gt; 127.0.0.1.6000: Flags [P.], seq 268:327, ack 14, win 342, options [nop,nop,TS val 459035 ecr 459030], length 59<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0000: &nbsp;4500 006f 9fd5 4000 4006 9cb1 7f00 0001<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0010: &nbsp;7f00 0001 b2c9 1770 cacb ded7 1f3d 2802<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0020: &nbsp;8018 0156 fe63 0000 0101 080a 0007 011b<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0030: &nbsp;0007 0116 7b22 6777 223a 7b22 6575 6922<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0040: &nbsp;3a22 6666 6665 6238 3237 6562 6632 3161<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0050: &nbsp;3037 222c 226c 6f72 6172 6567 696f 6e22<br />
&nbsp; &nbsp; &nbsp; &nbsp; 0x0060: &nbsp;3a22 6575 726f 7065 3836 3322 7d7d 00<br />
&nbsp; &nbsp; &nbsp; &nbsp;&nbsp;<br />
7b22 6777 223a 7b22 6575 6922<br />
3a22 6666 6665 6238 3237 6562 6632 3161<br />
3037 222c 226c 6f72 6172 6567 696f 6e22<br />
3a22 6575 726f 7065 3836 3322 7d7d 00</p>

<p>{<br />
&nbsp; &nbsp; "gw": {<br />
&nbsp; &nbsp; &nbsp; &nbsp; "eui": "fffeb827ebf21a07",<br />
&nbsp; &nbsp; &nbsp; &nbsp; "loraregion": "europe863"<br />
&nbsp; &nbsp; }<br />
}</p>

<p>文章来源:<a href="http://www.cnblogs.com/answerinthewind/&quot; id="Header1_HeaderTitle">AnswerInTheWind</a></p>