-
Notifications
You must be signed in to change notification settings - Fork 1
/
Copy pathieee802154_tap.tex
607 lines (521 loc) · 23.6 KB
/
ieee802154_tap.tex
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
114
115
116
117
118
119
120
121
122
123
124
125
126
127
128
129
130
131
132
133
134
135
136
137
138
139
140
141
142
143
144
145
146
147
148
149
150
151
152
153
154
155
156
157
158
159
160
161
162
163
164
165
166
167
168
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
190
191
192
193
194
195
196
197
198
199
200
201
202
203
204
205
206
207
208
209
210
211
212
213
214
215
216
217
218
219
220
221
222
223
224
225
226
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
368
369
370
371
372
373
374
375
376
377
378
379
380
381
382
383
384
385
386
387
388
389
390
391
392
393
394
395
396
397
398
399
400
401
402
403
404
405
406
407
408
409
410
411
412
413
414
415
416
417
418
419
420
421
422
423
424
425
426
427
428
429
430
431
432
433
434
435
436
437
438
439
440
441
442
443
444
445
446
447
448
449
450
451
452
453
454
455
456
457
458
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
\documentclass[12pt]{article}
\newcommand\maintitle{
IEEE 802.15.4 TAP Link Type Specification
}
\newcommand\authorname{James Ko}
\newcommand\company[1][]{\textit{Exegin Technologies Limited}~}
\newcommand\versionnumber{1.2}
\title{
\maintitle
\\\company
\\\hfill\\\normalsize Version \versionnumber
}
\author{\authorname~\tt{<[email protected]>}}
% Comment out the line below when out of draft
\usepackage{draftwatermark}\SetWatermarkScale{3}
%\SetWatermarkText{Confidential}
\usepackage[none]{hyphenat}
\usepackage[margin=2cm]{geometry}
\usepackage{calc}
\usepackage{hyperref}
\usepackage{listings}
\usepackage{verbatim}
\usepackage{fancyvrb}
\usepackage{fancyhdr}
\usepackage{graphicx}
\usepackage{titlesec}
\usepackage{wrapfig}
%
% Bytefield and color customizations
%
\usepackage{bytefield}
\usepackage{color}
\definecolor{lightgray}{gray}{0.9}
\newcommand{\colorbitbox}[3]{%
\rlap{\bitbox{#2}{\color{#1}\rule{\width}{\height}}}%
\bitbox{#2}{#3}}
% We use literal underscores a lot -- disable it as the subscript indicator.
\catcode`\_=\active
\pagestyle{fancy}
\fancyhead{}
\setlength{\headheight}{0pt}
\renewcommand{\headrulewidth}{0pt}
\renewcommand\_{\textunderscore\allowbreak}
\rfoot{}
\hypersetup{
pdftitle=\maintitle,
pdfauthor=\authorname,
colorlinks=true,
linkcolor=black,
bookmarksnumbered=true
}
\usepackage{indentfirst}
\setlength{\parindent}{0pt}
\setlength{\parskip}{1.5ex}
\setlength{\footskip}{1cm}
\titleformat*{\subsubsection}{\Large\bfseries}
% Set the source-code listing style.
\lstset{
basicstyle=\tt,
showspaces=false,
showstringspaces=false,
numbers=left,
frame=single,
captionpos=b,
breaklines=true,
aboveskip=\baselineskip,
belowskip=\baselineskip,
framextopmargin=0pt,
framexbottommargin=0pt,
escapeinside={/@}{@/}
}
% Some useful formatting tags
% \texttt{terminal text}
% \textbf{bold}
% \texttt{\nameref{sec:<name>}}
\begin{document}
\begin{titlepage}
\vspace{5cm}
\begin{wrapfigure}{R}{0.25\textwidth}
\includegraphics[scale=1]{exegin.png}
\end{wrapfigure}
\vspace{2cm}
{\scshape\LARGE Exegin Technologies Limited \par}
\vspace{5cm}
{\scshape\Large IEEE 802.15.4 TAP Link Type Specification\par}
{\itshape Version \versionnumber}
\vspace{2cm}
\vfill
\vfill
\begin{tabular}{|p{2cm}|p{11.5cm}| p{3cm}|}
\hline
\textbf{Revision} & \textbf{Description} & \textbf{Author}\\
\hline
2019-01-29 & Version 1.0 - Initial Release & James Ko\\
\hline
2019-02-21 & Fix title. Revised introduction. Fix TLV labels.
Removed TI CC24xx FCS Type. Removed pcapng examples. & James Ko\\
\hline
2019-02-22 & Added LQI. Clarify length fields. & James Ko\\
\hline
2019-02-27 & Added rules for constructing TLVs with bit flags, and padding
with zeros. & James Ko\\
\hline
2019-03-13 & Version 1.1 Added TLVs for channel center frequency and
channel plan & James Ko\\ \hline
\hline
2020-10-17 & Version 1.2 Added TLVs for PHY Header (PHR) & James Ko\\
\hline
\end{tabular}
% Bottom of the page
{\large \today\par}
\end{titlepage}
% Contents
\newpage
%\maketitle
\tableofcontents
\newpage
\section{Introduction}\label{sec:intro}
IEEE 802.15.4 is an IEEE standard for Low-Rate Wireless Networks, including
Low-Rate Wireless Personal Area Networks (LR-WPANs) and Low-Power Wide Area
Networks (LPWAN), defining a number of physical (PHY) layers covering a wide
variety of freqency bands and a number of Media Access Control (MAC)
sub-layers for managing data and management services including beacon
management, channel access, frame delivery and validation, and security
mechanisms. Developing, debugging, diagnosing, and maintaining technologies
using IEEE 802.15.4 require capturing packets with a sniffer. Sniffers
generally output captured packets encapsulated in a pcap or pcapng packet
with a specific data link-type (DLT) [\ref{itm:linktypes}] that is understood
by packet analyzers.
Three existing DLTs for IEEE 802.15.4 are defined
\begin{itemize}
\item DLT_IEEE802_15_4_WITHFCS (195),
\item DLT_IEEE802_15_4_NONASK_PHY (215), and
\item DLT_IEEE802_15_4_NOFCS (230).
\end{itemize}
None of the current DLTs provide a means to include out-of-band meta-data such
as received signal strength and channel number which are useful for
diagnostics in any wireless transmission system. Also, analyzers supporting
DLT_IEEE802_15_4_WITHFCS currently assume a 16-bit FCS following the PHY
payload. The IEEE 802.15.4-2015 standard also specifies a 32-bit CRC
equivalent to ANSI X3.66-1979 for SUN PHYs or TVWS PHYs.
This document defines a new DLT and format for presenting captured IEEE
802.15.4 packets with meta-data to packet analyzers.
The latest version of this specification is at
\url{https://github.com/jkcko/ieee802.15.4-tap}.
\newpage
\section{Overview}\label{sec:ovrvw}
The IEEE 802.15.4 TAP DLT design is based on an extensible Type-Length-Value
(TLV) format. The optional meta-data information in encapsulated in one or
more TLVs and included in any packet from a sniffer. Some types may be
duplicated by pcapng options but using the TLVs in this DLT enables providing
the meta-data information in both pcap and pcapng capture streams. Where
types are duplicated by TLVs and pcapng options in the same packet,
the DLT TLVs have priority.
The DLT_IEEE802_15_4_TAP (283) value is specified in the pcap header or pcapng
interface description block (IDB) LinkType field before the the first packet.
An IEEE 802.15.4 TAP packet is encapsulated in the packet data following a
pcap record header or in the packet data of a pcapng Enhanced Packet Block
(EPB).
\subsection{IEEE 802.15.4 TAP Packet}
The IEEE 802.15.4 TAP Packet consists of the TAP Header, zero or more TLV
fields, the PHY payload (PSDU), and optional FCS bytes. All data fields are
encoded in little-endian byte order.
\subsubsection{IEEE 802.15.4 TAP Header}
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| version | reserved (0) | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| TAP TLVs :
: variable length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| ... :
: IEEE 802.15.4 PHY Payload :
: [+ FCS per FCS Type TLV] :
: ... |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\begin{itemize}
\item version - currently only version 0 defined
\item reserved - must be set to 0
\item length - total length of header and TLVs in octets
\end{itemize}
Length is a minimum of 4 octets and must be a multiple of 4. Addition of new
TLVs does not and must not require incrementing the version number.
\newpage
\subsubsection{IEEE 802.15.4 TAP TLVs}
IEEE 802.15.4 TAP TLVs have the following format.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| type | length |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| value :
: variable length, zero padded to 32-bits |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\begin{itemize}
\item type - type identifier
\item length - number of octets for type in value field
(not including padding)
\item value - data for type
\end{itemize}
All padding bits must be set to zero. A TLV with zero (0) length is valid with
no padding bits. Any TLV which defines a set of flags as bits must also
include a mask of known flags which are being provided by the flag bits. A
flags TLV must be defined to have a variable length in multiples of 4-octets
where the first half of the octets (i.e. 2 of 4 octets) are the mask and the
second half are the flags. Mask and flags must be encoded in little-endian
byte order and bit 0 is the least significant bit.
\newpage
\section{IEEE 802.15.4 TAP TLV Types}
The following subsections describe the currently defined TLVs. Developers must
request a new TLV if the meta-data to include does not match the type of the
defined TLVs. Any unknown TLVs will be dissected as a binary blob of the
provided length.
\subsection{FCS Type}
Identifies the FCS type following the PHY Payload. FCS type none (0) is
optional if no FCS is present.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = FCS_TYPE (0) | length = 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| FCS type | padding (0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
The FCS type is one of
\begin{itemize}
\item 0 = None,
\item 1 = 16-bit CRC,
\item 2 = 32-bit CRC.
\end{itemize}
\subsection{Receive Signal Strength}
The received signal strength in dBm as a IEEE-754 floating point number.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = RSS (1) | length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| RSS in dBm |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
Note: RSSI in dB must use a different TLV (TBD).
\newpage
\subsection{Bit Rate}
The transmission data-rate in bps. The bit-rate may change frame to frame in
multi-rate PHY configurations.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = BIT_RATE (2) | length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Bit rate in bps |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\subsection{Channel Assignment}
Channel assignments are defined through a combination of channel numbers and
channel pages. See IEEE 802.15.4-2015 10.1.2 Channel assignments.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = CHANNEL_ASSIGNMENT (3) | length = 3 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Channel number | Channel page | padding (0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\subsection{SUN PHY Information}
An IEEE 802.15.4 SUN PHY is configured to operate in a specified frequency
band, encoding type, and rate mode.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = SUN_PHY_INFORMATION (4)| length = 3 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Band | Type | Mode | padding (0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\begin{itemize}
\item Band - IEEE 802.15.4 Table 7-19 Frequency band identifer values.
\item Type - IEEE 802.15.4 Table 7-20 Modulation scheme encoding values.
\item Mode - IEEE 802.15.4 Rate mode depends on the Band and Type.
\end{itemize}
\newpage
\subsection{Start of Frame Timestamp}
The start of frame timestamp is a monotonically increasing time in nanoseconds
since power on of the receiving device. This value differs from the timestamp
in the pcap or pcapng header which is based on the clock time reported by the
sniffer.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = SOF_TIMESTAMP (5) | length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| nanoseconds |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\subsection{End of Frame Timestamp}
The end of frame timestamp is a monotonically increasing time in nanoseconds
since power on of the receiving device. This value is important to
time-slotted MACs where a packet may overflow a time slot, or where there are
timing constraints on the ack sent in response to a data frame.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = EOF_TIMESTAMP (6) | length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| nanoseconds |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\newpage
\subsection{Absolute Slot Number (ASN)}
For a Time-Slotted Channel Hopping MAC, the Absolute Slot Number (ASN)
is a monotonically increasing number which is synchronized across all nodes on
the network and forms part of the nonce for decryption.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = ASN (7) | length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| ASN (64-bits) |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\subsection{Start of Slot Timestamp}
The start of slot timestamp is a monotonically increasing time in nanoseconds
since power on of the receiving device. For a Time-Slotted Channel Hopping
MAC, the start of slot timestamp, which preceeds the start of frame timestamp,
is essential for debugging and optimizing TSCH configurations.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = SLOT_TIMESTAMP (8) | length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| |
| nanoseconds |
| |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\subsection{Timeslot Length}
The timeslot length in a Time-Slotted Channel Hopping MAC is used for
calculating the delta between end of frame and end of slot.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = TIMESLOT_LENGTH (9) | length = 8 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Length of timeslot in microseconds |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\subsection{Link Quality Indicator}
The Link Quality Indicator (LQI) measurement is a characterization of the
strength and/or quality of the received packet. See IEEE 802.15.4-2015 10.2.6
Link quality indicator.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = LQI (10) | length = 1 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| LQI | padding (0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\subsection{Channel Center Frequency}
A sniffer may provide the channel center frequency of the receiver
as an IEEE-754 floating point number in kHz.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = CHANNEL_FREQUENCY (11) | length = 4 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Channel Center Frequency in kHz |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\newpage
\subsection{Channel Plan}
A channel plan defines the channel 0 center frequency, channel spacing and
number of channels. The center frequency of channel N in the channel plan is
given by the following formula.
\[ ChanCenterFreqN = ChanCenterFreq0 + (N \times ChanSpacing) \]
Frequency values are in kHz and encoded as an IEEE-754 floating point number.
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = CHANNEL_PLAN (12) | length = 10 |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Channel 0 Center Frequency in kHz |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Channel Spacing in kHz |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Number of Channels | padding (0) |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\subsection{PHY Header}
The PHY Header (PHR) preceeds the payload (PSDU) in an IEEE PHY Protocol Data
Unit (PPDU). The sniffer may provide the PHR for a frame if available.
The length of this TLV depends on the PHY Type and PHR format.
The PHR Type and PHR length provide information to the dissector on how to
decode the PHR bits. The data bits of the PHR Header must be encoded in
little-endian order with multi-bit fields ordered from MSB to LSB.
Valid PHR Types are enumerated in the following table:
\begin{tabular}{c | l | l}
\textbf{Value} & \textbf{PHR Type} & \textbf{PHR length in bits}\\
\hline
0 & RAW & Up to $8\cdot n$\\
1 & O-QPSK & 8 \\
2 & CSS & 12 \\
3 & HRP UWB & 19 \\
4 & MSK & 8 or 16 for Extended PHR \\
5 & LRP UWB & 22 \\
6 & SUN FSK & 16 \\
7 & SUN OFDM & 36 \\
8 & SUN O-QPSK & 24 \\
9 & LECIM FSK & 16 \\
10 & TVWS-FSK & 16 \\
11 & TVWS-OFDM & 44 (excluding Tail) or 50 (including Tail) \\
12 & TVWS-NB-OFDM & 38 (excluding Tail) or 44 (including Tail) \\
13 & RCC LMR & 23 (excluding FEC Tail) or 27 (including Tail) \\
14 & CMB O-QPSK & 24 \\
15 & CMB GFSK & 16 \\
16 & TASK & 16 \\
17 & RS-GFSK & 16 (Long) or 8 (Short) \\
18 & Wi-SUN FSK Mode Switch & 16 \\
\end{tabular}
\begin{Verbatim}[samepage=true]
0 1 2 3
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Type = PHY_HEADER (13) | length = 4 + n |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PHR Type | PHR length in bits |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| PHY Header Data |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
\end{Verbatim}
\newpage
\section{Glossary}\label{sec:glos}
\begin{center}
\begin{tabular}{ |p{3cm}|p{10cm}| }
\hline
\textbf{Notation} & \textbf{Description}\\
\hline
CRC & Cyclic Redundancy Check\\
\hline
DLT & Data-Link Type\\
\hline
EPB & Enhance Packet Block (pcapng)\\
\hline
FCS & Frame Check Sequence\\
\hline
IDB & Interface Description Block (pcapng)\\
\hline
IEEE & Institute of Electrical and Electronics Engineers\\
\hline
LR-WPAN & Low-Rate Wireless Personal Area Network\\
\hline
LPWAN & Low-Power Wide Area Network\\
\hline
LSB & Least Significant Bit\\
\hline
LQI & Link Quality Indicator\\
\hline
MAC & Medium Access Control\\
\hline
MSB & Most Significant Bit\\
\hline
pcap & Packet Capture File Format [\ref{itm:libpcap}]\\
\hline
pcapng & PCAP Next Generation Capture File Format [\ref{itm:pcapng}]\\
\hline
PDU & Protocol Data Unit\\
\hline
PHR & PHY Header\\
\hline
PHY & Physical Layer\\
\hline
SUN & Smart Utility Network\\
\hline
TLV & Type-Length-Value\\
\hline
TSCH & Time-Slotted Channel Hopping\\
\hline
TVWS & Television White Space\\
\hline
\end{tabular}
\end{center}
\section{References}\label{sec:references}
\begin{enumerate}
\item Data-Link Types - \url{https://www.tcpdump.org/linktypes.html}\label{itm:linktypes}
\item Packet Capture File Format - \url{https://www.tcpdump.org/manpages/pcap-savefile.5.html}\label{itm:libpcap}
\item PCAP Next Generation Capture File Format - \url{https://github.com/pcapng/pcapng}\label{itm:pcapng}
\end{enumerate}
\section{Contributers}\label{sec:references}
The following have contributed to this spec as authors or reviewers.\\
\tt{
Dario Tedeschi <dat[at]exegin.com>\\
Guy Harris <guy[at]alum.mit.edu>\\
James Ko <jck[at]exegin.com>\\
Jeremie Faucher-Goulet <Jeremie.Faucher-Goulet[at]trilliant.com>\\
Sandra Jessen <sdj[at]exegin.com>\\
}
\end{document}