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 608 609 610 611 612 613 614 615 616 617 618 619 620 621 622 623 624 625 626 627 628 629 630 631 632 633 634 635 636 637 638 639 640 641 642 643 644 645 646 647 648 649 650 651 652 653 654 655 656 657 658 659 660 661 662 663 664 665 666 667 668 669 670 671 672 673 674 675 676 677 678 679 680 681 682 683 684 685 686 687 688 689 690 691 692 693 694 695 696 697 698 699 700 701 702 703 704 705 706 707 708 709 710 711 712 713 714 715 716 717 718 719 720 721 722 723 724 725 726 727 728 729 730 731 732 733 734 735 736 737 738 739 740 741 742 743 744 745 746 747 748 749 750 751 752 753 754 755 756 757 758 759 760 761 762 763 764 765 766 767 768 769 770 771 772 773 774 775 776 777 778 779 780 781 782 783 784 785 786 787 788 789 790 791 792 793 794 795 796 797 798 799 800 801 802 803 804 805 806 807 808 809 810 811 812 813 814 815 816 817 818 819 820 821 822 823 824 825 826 827 828 829 830 831 832 833 834 835 836 837 838 839 840 841 842 843 844 845 846 847 848 849 850 851 852 853 854 855 856 857 858 859 860 861 862 863 864 865 866 867 868 869 870 871 872 873 874 875 876 877 878 879 880 881 882 883 884 885 886 887 888 889 890 891 892 893 894 895 896 897 898 899 900 901 902 903 904 905 906 907 908 909 910 911 912 913 914 915 916 917 918 919 920 921 922 923 924 925 926 927 928 929 930 931 932 933 934 935 936 937 938 939 940 941 942 943 944 945 946 947 948 949 950 951 952 953 954 955 956 957 958 959 960 961 962 963 964 965 966 967 968 969 970 971 972 973 974 975 976 977 978 979 980 981 982 983 984 985 986 987 988 989 990 991 992 993 994 995 996 997 998 999 1000 1001 1002 1003 1004 1005 1006 1007 1008 1009 1010 1011 1012 1013 1014 1015 1016 1017 1018 1019 1020 1021 1022 1023 1024 1025 1026 1027 1028 1029 1030 1031 1032 1033 1034 1035 1036 1037 1038 1039 1040 1041 1042 1043 1044 1045 1046 1047 1048 1049 1050 1051 1052 1053 1054 1055 1056 1057 1058 1059 1060 1061 1062 1063 1064 1065 1066 1067 1068 1069 1070 1071 1072 1073 1074 1075 1076 1077 1078 1079 1080 1081 1082 1083 1084 1085 1086 1087 1088 1089 1090 1091 1092 1093 1094 1095 1096 1097 1098 1099 1100 1101 1102 1103 1104 1105 1106 1107 1108 1109 1110 1111 1112 1113 1114 1115 1116 1117 1118 1119 1120 1121 1122 1123 1124 1125 1126 1127 1128 1129 1130 1131 1132 1133 1134 1135 1136 1137 1138 1139 1140 1141 1142 1143 1144 1145 1146 1147 1148 1149 1150 1151 1152 1153 1154 1155 1156 1157 1158 1159 1160 1161 1162 1163 1164 1165 1166 1167 1168 1169 1170 1171 1172 1173 1174 1175 1176 1177 1178 1179 1180 1181 1182 1183 1184 1185 1186 1187 1188 1189 1190 1191 1192 1193 1194 1195 1196 1197 1198 1199 1200 1201 1202 1203 1204 1205 1206 1207 1208 1209 1210 1211 1212 1213 1214 1215 1216 1217 1218 1219 1220 1221 1222 1223 1224 1225 1226 1227 1228 1229 1230 1231 1232 1233 1234 1235 1236 1237 1238 1239 1240 1241 1242 1243 1244 1245 1246 1247 1248 1249 1250 1251 1252 1253 1254 1255 1256 1257 1258 1259 1260 1261 1262 1263 1264 1265 1266 1267 1268 1269 1270 1271 1272 1273 1274 1275 1276 1277 1278 1279 1280 1281 1282 1283 1284 1285 1286 1287 1288 1289 1290 1291 1292 1293 1294 1295 1296 1297 1298 1299 1300 1301 1302 1303 1304 1305 1306 1307 1308 1309 1310 1311 1312 1313 1314 1315 1316 1317 1318 1319 1320 1321 1322 1323 1324 1325 1326 1327 1328 1329 1330 1331 1332 1333 1334 1335 1336 1337 1338 1339 1340 1341
|
<pre>Internet Engineering Task Force (IETF) J. Hui, Ed.
Request for Comments: 6282 Arch Rock Corporation
Updates: <a href="./rfc4944">4944</a> P. Thubert
Category: Standards Track Cisco
ISSN: 2070-1721 September 2011
<span class="h1">Compression Format for IPv6 Datagrams</span>
<span class="h1">over IEEE 802.15.4-Based Networks</span>
Abstract
This document updates <a href="./rfc4944">RFC 4944</a>, "Transmission of IPv6 Packets over
IEEE 802.15.4 Networks". This document specifies an IPv6 header
compression format for IPv6 packet delivery in Low Power Wireless
Personal Area Networks (6LoWPANs). The compression format relies on
shared context to allow compression of arbitrary prefixes. How the
information is maintained in that shared context is out of scope.
This document specifies compression of multicast addresses and a
framework for compressing next headers. UDP header compression is
specified within this framework.
Status of This Memo
This is an Internet Standards Track document.
This document is a product of the Internet Engineering Task Force
(IETF). It represents the consensus of the IETF community. It has
received public review and has been approved for publication by the
Internet Engineering Steering Group (IESG). Further information on
Internet Standards is available in <a href="./rfc5741#section-2">Section 2 of RFC 5741</a>.
Information about the current status of this document, any errata,
and how to provide feedback on it may be obtained at
<a href="http://www.rfc-editor.org/info/rfc6282">http://www.rfc-editor.org/info/rfc6282</a>.
<span class="grey">Hui & Thubert Standards Track [Page 1]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-2" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
Copyright Notice
Copyright (c) 2011 IETF Trust and the persons identified as the
document authors. All rights reserved.
This document is subject to <a href="https://www.rfc-editor.org/bcp/bcp78">BCP 78</a> and the IETF Trust's Legal
Provisions Relating to IETF Documents
(<a href="http://trustee.ietf.org/license-info">http://trustee.ietf.org/license-info</a>) in effect on the date of
publication of this document. Please review these documents
carefully, as they describe your rights and restrictions with respect
to this document. Code Components extracted from this document must
include Simplified BSD License text as described in Section 4.e of
the Trust Legal Provisions and are provided without warranty as
described in the Simplified BSD License.
Table of Contents
<a href="#section-1">1</a>. Introduction ....................................................<a href="#page-3">3</a>
<a href="#section-1.1">1.1</a>. Requirements Language ......................................<a href="#page-4">4</a>
<a href="#section-2">2</a>. Specific Updates to <a href="./rfc4944">RFC 4944</a> ....................................<a href="#page-4">4</a>
<a href="#section-3">3</a>. IPv6 Header Compression .........................................<a href="#page-5">5</a>
<a href="#section-3.1">3.1</a>. LOWPAN_IPHC Encoding Format ................................<a href="#page-6">6</a>
<a href="#section-3.1.1">3.1.1</a>. Base Format .........................................<a href="#page-6">6</a>
<a href="#section-3.1.2">3.1.2</a>. Context Identifier Extension .......................<a href="#page-10">10</a>
<a href="#section-3.2">3.2</a>. IPv6 Header Encoding ......................................<a href="#page-11">11</a>
<a href="#section-3.2.1">3.2.1</a>. Traffic Class and Flow Label Compression ...........<a href="#page-11">11</a>
<a href="#section-3.2.2">3.2.2</a>. Deriving IIDs from the Encapsulating Header ........<a href="#page-12">12</a>
<a href="#section-3.2.3">3.2.3</a>. Stateless Multicast Address Compression ............<a href="#page-13">13</a>
<a href="#section-3.2.4">3.2.4</a>. Stateful Multicast Address Compression .............<a href="#page-14">14</a>
<a href="#section-4">4</a>. IPv6 Next Header Compression ...................................<a href="#page-15">15</a>
<a href="#section-4.1">4.1</a>. LOWPAN_NHC Format .........................................<a href="#page-15">15</a>
<a href="#section-4.2">4.2</a>. IPv6 Extension Header Compression .........................<a href="#page-15">15</a>
<a href="#section-4.3">4.3</a>. UDP Header Compression ....................................<a href="#page-17">17</a>
<a href="#section-4.3.1">4.3.1</a>. Compressing UDP Ports ..............................<a href="#page-17">17</a>
<a href="#section-4.3.2">4.3.2</a>. Compressing UDP Checksum ...........................<a href="#page-18">18</a>
<a href="#section-4.3.3">4.3.3</a>. UDP LOWPAN_NHC Format ..............................<a href="#page-20">20</a>
<a href="#section-5">5</a>. IANA Considerations ............................................<a href="#page-20">20</a>
<a href="#section-6">6</a>. Security Considerations ........................................<a href="#page-21">21</a>
<a href="#section-7">7</a>. Acknowledgements ...............................................<a href="#page-22">22</a>
<a href="#section-8">8</a>. References .....................................................<a href="#page-22">22</a>
<a href="#section-8.1">8.1</a>. Normative References ......................................<a href="#page-22">22</a>
<a href="#section-8.2">8.2</a>. Informative References ....................................<a href="#page-23">23</a>
<span class="grey">Hui & Thubert Standards Track [Page 2]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-3" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
<span class="h2"><a class="selflink" id="section-1" href="#section-1">1</a>. Introduction</span>
The [<a href="#ref-IEEE802.15.4" title=""IEEE Std. 802.15.4-2006"">IEEE802.15.4</a>] standard specifies an MTU of 127 bytes, yielding
about 80 octets of actual Media Access Control (MAC) payload with
security enabled, on a wireless link with a link throughput of 250
kbps or less. The 6LoWPAN adaptation format [<a href="./rfc4944" title=""Transmission of IPv6 Packets over IEEE 802.15.4 Networks"">RFC4944</a>] was specified
to carry IPv6 datagrams over such constrained links, taking into
account limited bandwidth, memory, or energy resources that are
expected in applications such as wireless sensor networks. [<a href="./rfc4944" title=""Transmission of IPv6 Packets over IEEE 802.15.4 Networks"">RFC4944</a>]
defines a Mesh Addressing header to support sub-IP forwarding, a
Fragmentation header to support the IPv6 minimum MTU requirement
[<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>], and stateless header compression for IPv6 datagrams
(LOWPAN_HC1 and LOWPAN_HC2) to reduce the relatively large IPv6 and
UDP headers down to (in the best case) several bytes.
LOWPAN_HC1 and LOWPAN_HC2 are insufficient for most practical uses of
IPv6 in 6LoWPANs. LOWPAN_HC1 is most effective for link-local
unicast communication, where IPv6 addresses carry the link-local
prefix and an Interface Identifier (IID) directly derived from IEEE
802.15.4 addresses. In this case, both addresses may be completely
elided. However, though link-local addresses are commonly used for
local protocol interactions such as IPv6 Neighbor Discovery
[<a href="./rfc4861" title=""Neighbor Discovery for IP version 6 (IPv6)"">RFC4861</a>], DHCPv6 [<a href="./rfc3315" title=""Dynamic Host Configuration Protocol for IPv6 (DHCPv6)"">RFC3315</a>], or routing protocols, they are usually
not used for application-layer data traffic, so the actual value of
this compression mechanism is limited.
Routable addresses must be used when communicating with devices
external to the 6LoWPAN or in a route-over configuration where IP
forwarding occurs within the 6LoWPAN. For routable addresses,
LOWPAN_HC1 requires both IPv6 source and destination addresses to
carry the prefix in-line. In cases where the Mesh Addressing header
is not used, the IID of a routable address must be carried in-line.
However, LOWPAN_HC1 requires 64 bits for the IID when carried in-line
and cannot be shortened even when it is derived from the IEEE
802.15.4 16-bit short address. When the destination is an IPv6
multicast address, LOWPAN_HC1 requires the full 128-bit address to be
carried in-line.
As a result, this document defines an encoding format, LOWPAN_IPHC,
for effective compression of Unique Local, Global, and multicast IPv6
Addresses based on shared state within contexts. In addition, this
document also introduces a number of additional improvements over the
header compression format defined in [<a href="./rfc4944" title=""Transmission of IPv6 Packets over IEEE 802.15.4 Networks"">RFC4944</a>].
LOWPAN_IPHC allows for compression of some commonly used IPv6 Hop
Limit values. If the 6LoWPAN is a mesh-under stub, a Hop Limit of 1
for inbound and a default value such as 64 for outbound are usually
enough for application-layer data traffic. Additionally, a Hop Limit
<span class="grey">Hui & Thubert Standards Track [Page 3]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-4" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
value of 255 is often used to verify that a communication occurs over
a single-hop. This specification enables compression of the IPv6 Hop
Limit field in those common cases, whereas LOWPAN_HC1 does not.
This document also defines LOWPAN_NHC, an encoding format for
arbitrary next headers. LOWPAN_IPHC indicates whether the following
header is encoded using LOWPAN_NHC. If so, the bits immediately
following the compressed IPv6 header start the LOWPAN_NHC encoding.
In contrast, LOWPAN_HC1 could be extended to support compression of
next headers using LOWPAN_HC2, but only for UDP, TCP, and ICMPv6.
Furthermore, the LOWPAN_HC2 octet sits between the LOWPAN_HC1 octet
and uncompressed IPv6 header fields. This specification moves the
next header encoding bits to follow all IPv6-related bits, allowing
for a properly layered structure and direct support for IPv6
extension headers.
Using LOWPAN_NHC, this document defines a compression mechanism for
UDP. While [<a href="./rfc4944" title=""Transmission of IPv6 Packets over IEEE 802.15.4 Networks"">RFC4944</a>] defines a compression mechanism for UDP, that
mechanism does not enable checksum compression when rendered possible
by additional upper-layer mechanisms such as upper-layer Message
Integrity Check (MIC). This specification adds the capability to
elide the UDP checksum over the 6LoWPAN, which enables saving of a
further two octets.
Also, using LOWPAN_NHC, this document defines encoding formats for
IPv6-in-IPv6 encapsulation as well as IPv6 Extension Headers. With
LOWPAN_HC1 and LOWPAN_HC2, chains of next headers cannot be encoded
efficiently.
<span class="h3"><a class="selflink" id="section-1.1" href="#section-1.1">1.1</a>. Requirements Language</span>
The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT",
"SHOULD", "SHOULD NOT", "RECOMMENDED", "MAY", and "OPTIONAL" in this
document are to be interpreted as described in <a href="./rfc2119">RFC 2119</a> [<a href="./rfc2119" title=""Key words for use in RFCs to Indicate Requirement Levels"">RFC2119</a>].
<span class="h2"><a class="selflink" id="section-2" href="#section-2">2</a>. Specific Updates to <a href="./rfc4944">RFC 4944</a></span>
This document specifies a header compression format that is intended
to replace that defined in <a href="./rfc4944#section-10">Section 10 of [RFC4944]</a>. Implementation
of <a href="./rfc4944#section-10">Section 10 of [RFC4944]</a> is now NOT RECOMMENDED. New
implementations MAY implement decompression according to <a href="./rfc4944#section-10">Section 10
of [RFC4944]</a> but SHOULD NOT send packets compressed according to
<a href="./rfc4944#section-10">Section 10 of [RFC4944]</a>.
A compliant implementation of [<a href="./rfc4944" title=""Transmission of IPv6 Packets over IEEE 802.15.4 Networks"">RFC4944</a>] as updated by this document
MUST be able to properly process a packet received that makes use of
the provisions of this document. A compliant implementation MAY
implement additional LOWPAN_NHC types (<a href="#section-4">Section 4</a>) that may be
<span class="grey">Hui & Thubert Standards Track [Page 4]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-5" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
registered (<a href="#section-5">Section 5</a>) in the future. It is out of scope of this
document how a compressor learns that a decompressor has additional
capabilities.
<a href="./rfc4944#section-5.3">Section 5.3 of [RFC4944]</a> also defines how to fragment compressed IPv6
datagrams that do not fit within a single link frame. <a href="./rfc4944#section-5.3">Section 5.3 of
[RFC4944]</a> defines the fragment header's datagram_size and
datagram_offset values as the size and offset of the IPv6 datagram
before compression. As a result, all fragment payload outside the
first fragment must carry their respective portions of the IPv6
datagram before compression. This document does not change that
requirement. When using the fragmentation mechanism described in
<a href="./rfc4944#section-5.3">Section 5.3 of [RFC4944]</a>, any header that cannot fit within the first
fragment MUST NOT be compressed.
The header compression format defined in this document preempts the
ESC dispatch value defined in <a href="./rfc4944#section-5.1">Section 5.1 of [RFC4944]</a>. Instead, the
value of 01 000000 is reserved as a replacement value for ESC, to be
finally assigned with the first assignment of extension bytes.
<span class="h2"><a class="selflink" id="section-3" href="#section-3">3</a>. IPv6 Header Compression</span>
In this section, we define the LOWPAN_IPHC encoding format for
compressing the IPv6 header. To enable effective compression,
LOWPAN_IPHC relies on information pertaining to the entire 6LoWPAN.
LOWPAN_IPHC assumes the following will be the common case for 6LoWPAN
communication: Version is 6; Traffic Class and Flow Label are both
zero; Payload Length can be inferred from lower layers from either
the 6LoWPAN Fragmentation header or the IEEE 802.15.4 header; Hop
Limit will be set to a well-known value by the source; addresses
assigned to 6LoWPAN interfaces will be formed using the link-local
prefix or a small set of routable prefixes assigned to the entire
6LoWPAN; addresses assigned to 6LoWPAN interfaces are formed with an
IID derived directly from either the 64-bit extended or the 16-bit
short IEEE 802.15.4 addresses.
+-------------------------------------+----------------------------
| Dispatch + LOWPAN_IPHC (2-3 octets) | In-line IPv6 Header Fields
+-------------------------------------+----------------------------
Figure 1: LOWPAN_IPHC Header
The LOWPAN_IPHC encoding utilizes 13 bits, 5 of which are taken from
the rightmost bits of the dispatch type. The encoding may be
extended by another octet to support additional contexts. Any
information from the uncompressed IPv6 header fields carried in-line
<span class="grey">Hui & Thubert Standards Track [Page 5]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-6" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
follow the LOWPAN_IPHC encoding, as shown in Figure 1. In the best
case, the LOWPAN_IPHC can compress the IPv6 header down to two octets
(the dispatch octet and the LOWPAN_IPHC encoding) with link-local
communication.
When routing over multiple IP hops, LOWPAN_IPHC can compress the IPv6
header down to 7 octets (1-octet dispatch, 1-octet LOWPAN_IPHC,
1-octet Hop Limit, 2-octet Source Address, and 2-octet Destination
Address). The Hop Limit may not be compressed because it needs to
decremented at each hop and may take any value. Stateful address
compression must be applied to the source and destination IPv6
addresses because they do not statelessly match the source and
destination link-layer addresses on intermediate hops.
<span class="h3"><a class="selflink" id="section-3.1" href="#section-3.1">3.1</a>. LOWPAN_IPHC Encoding Format</span>
This section specifies the format of the LOWPAN_IPHC encoding that
describes how an IPv6 header is compressed. The encoding can be 2
octets long for the base encoding or 3 octets long when an additional
context encoding is present. The IPv6 header fields that are not
fully elided are placed immediately after the LOWPAN_IPHC, either in
a compressed form if the field is partially elided or literally.
<span class="h4"><a class="selflink" id="section-3.1.1" href="#section-3.1.1">3.1.1</a>. Base Format</span>
0 1
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
| 0 | 1 | 1 | TF |NH | HLIM |CID|SAC| SAM | M |DAC| DAM |
+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+---+
Figure 2: LOWPAN_IPHC base Encoding
TF: Traffic Class, Flow Label: As specified in [<a href="./rfc3168" title=""The Addition of Explicit Congestion Notification (ECN) to IP"">RFC3168</a>], the 8-bit
IPv6 Traffic Class field is split into two fields: 2-bit Explicit
Congestion Notification (ECN) and 6-bit Differentiated Services
Code Point (DSCP).
00: ECN + DSCP + 4-bit Pad + Flow Label (4 bytes)
01: ECN + 2-bit Pad + Flow Label (3 bytes), DSCP is elided.
10: ECN + DSCP (1 byte), Flow Label is elided.
11: Traffic Class and Flow Label are elided.
<span class="grey">Hui & Thubert Standards Track [Page 6]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-7" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
NH: Next Header:
0: Full 8 bits for Next Header are carried in-line.
1: The Next Header field is compressed and the next header is
encoded using LOWPAN_NHC, which is discussed in <a href="#section-4.1">Section 4.1</a>.
HLIM: Hop Limit:
00: The Hop Limit field is carried in-line.
01: The Hop Limit field is compressed and the hop limit is 1.
10: The Hop Limit field is compressed and the hop limit is 64.
11: The Hop Limit field is compressed and the hop limit is 255.
CID: Context Identifier Extension:
0: No additional 8-bit Context Identifier Extension is used. If
context-based compression is specified in either Source Address
Compression (SAC) or Destination Address Compression (DAC),
context 0 is used.
1: An additional 8-bit Context Identifier Extension field
immediately follows the Destination Address Mode (DAM) field.
SAC: Source Address Compression
0: Source address compression uses stateless compression.
1: Source address compression uses stateful, context-based
compression.
SAM: Source Address Mode:
If SAC=0:
00: 128 bits. The full address is carried in-line.
01: 64 bits. The first 64-bits of the address are elided.
The value of those bits is the link-local prefix padded with
zeros. The remaining 64 bits are carried in-line.
<span class="grey">Hui & Thubert Standards Track [Page 7]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-8" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
10: 16 bits. The first 112 bits of the address are elided.
The value of the first 64 bits is the link-local prefix
padded with zeros. The following 64 bits are 0000:00ff:
fe00:XXXX, where XXXX are the 16 bits carried in-line.
11: 0 bits. The address is fully elided. The first 64 bits
of the address are the link-local prefix padded with zeros.
The remaining 64 bits are computed from the encapsulating
header (e.g., 802.15.4 or IPv6 source address) as specified
in <a href="#section-3.2.2">Section 3.2.2</a>.
If SAC=1:
00: The UNSPECIFIED address, ::
01: 64 bits. The address is derived using context information
and the 64 bits carried in-line. Bits covered by context
information are always used. Any IID bits not covered by
context information are taken directly from the
corresponding bits carried in-line. Any remaining bits are
zero.
10: 16 bits. The address is derived using context information
and the 16 bits carried in-line. Bits covered by context
information are always used. Any IID bits not covered by
context information are taken directly from their
corresponding bits in the 16-bit to IID mapping given by
0000:00ff:fe00:XXXX, where XXXX are the 16 bits carried in-
line. Any remaining bits are zero.
11: 0 bits. The address is fully elided and is derived using
context information and the encapsulating header (e.g.,
802.15.4 or IPv6 source address). Bits covered by context
information are always used. Any IID bits not covered by
context information are computed from the encapsulating
header as specified in <a href="#section-3.2.2">Section 3.2.2</a>. Any remaining bits
are zero.
M: Multicast Compression
0: Destination address is not a multicast address.
1: Destination address is a multicast address.
<span class="grey">Hui & Thubert Standards Track [Page 8]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-9" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
DAC: Destination Address Compression
0: Destination address compression uses stateless compression.
1: Destination address compression uses stateful, context-based
compression.
DAM: Destination Address Mode:
If M=0 and DAC=0 This case matches SAC=0 but for the destination
address:
00: 128 bits. The full address is carried in-line.
01: 64 bits. The first 64-bits of the address are elided.
The value of those bits is the link-local prefix padded with
zeros. The remaining 64 bits are carried in-line.
10: 16 bits. The first 112 bits of the address are elided.
The value of the first 64 bits is the link-local prefix
padded with zeros. The following 64 bits are 0000:00ff:
fe00:XXXX, where XXXX are the 16 bits carried in-line.
11: 0 bits. The address is fully elided. The first 64 bits
of the address are the link-local prefix padded with zeros.
The remaining 64 bits are computed from the encapsulating
header (e.g., 802.15.4 or IPv6 destination address) as
specified in <a href="#section-3.2.2">Section 3.2.2</a>.
If M=0 and DAC=1:
00: Reserved.
01: 64 bits. The address is derived using context information
and the 64 bits carried in-line. Bits covered by context
information are always used. Any IID bits not covered by
context information are taken directly from the
corresponding bits carried in-line. Any remaining bits are
zero.
10: 16 bits. The address is derived using context information
and the 16 bits carried in-line. Bits covered by context
information are always used. Any IID bits not covered by
context information are taken directly from their
corresponding bits in the 16-bit to IID mapping given by
0000:00ff:fe00:XXXX, where XXXX are the 16 bits carried in-
line. Any remaining bits are zero.
<span class="grey">Hui & Thubert Standards Track [Page 9]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-10" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
11: 0 bits. The address is fully elided and is derived using
context information and the encapsulating header (e.g.
802.15.4 or IPv6 destination address). Bits covered by
context information are always used. Any IID bits not
covered by context information are computed from the
encapsulating header as specified in <a href="#section-3.2.2">Section 3.2.2</a>. Any
remaining bits are zero.
If M=1 and DAC=0:
00: 128 bits. The full address is carried in-line.
01: 48 bits. The address takes the form ffXX::00XX:XXXX:XXXX.
10: 32 bits. The address takes the form ffXX::00XX:XXXX.
11: 8 bits. The address takes the form ff02::00XX.
If M=1 and DAC=1:
00: 48 bits. This format is designed to match Unicast-Prefix-
based IPv6 Multicast Addresses as defined in [<a href="./rfc3306" title=""Unicast-Prefix-based IPv6 Multicast Addresses"">RFC3306</a>] and
[<a href="./rfc3956" title=""Embedding the Rendezvous Point (RP) Address in an IPv6 Multicast Address"">RFC3956</a>]. The multicast address takes the form ffXX:XXLL:
PPPP:PPPP:PPPP:PPPP:XXXX:XXXX. where the X are the nibbles
that are carried in-line, in the order in which they appear
in this format. P denotes nibbles used to encode the prefix
itself. L denotes nibbles used to encode the prefix length.
The prefix information P and L is taken from the specified
context.
01: reserved
10: reserved
11: reserved
<span class="h4"><a class="selflink" id="section-3.1.2" href="#section-3.1.2">3.1.2</a>. Context Identifier Extension</span>
This specification expects that a conceptual context is shared
between the node that compresses a packet and the node(s) that needs
to expand it. How the contexts are shared and maintained is out of
scope. What information is contained within a context information is
out of scope. Actions in response to unknown and/or invalid contexts
are out of scope. The specification enables a node to use up to 16
contexts. The context used to encode the source address does not
have to be the same as the context used to encode the destination
address.
<span class="grey">Hui & Thubert Standards Track [Page 10]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-11" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
If the CID field is set to '1' in the LOWPAN_IPHC encoding, then an
additional octet extends the LOWPAN_IPHC encoding following the DAM
bits but before the IPv6 header fields that are carried in-line. The
additional octet identifies the pair of contexts to be used when the
IPv6 source and/or destination address is compressed. The context
identifier is 4 bits for each address, supporting up to 16 contexts.
Context 0 is the default context. The encoding is shown in Figure 3.
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| SCI | DCI |
+---+---+---+---+---+---+---+---+
Figure 3: LOWPAN_IPHC Encoding
SCI: Source Context Identifier. Identifies the prefix that is used
when the IPv6 source address is statefully compressed.
DCI: Destination Context Identifier. Identifies the prefix that is
used when the IPv6 destination address is statefully compressed.
<span class="h3"><a class="selflink" id="section-3.2" href="#section-3.2">3.2</a>. IPv6 Header Encoding</span>
Fields carried in-line (in part or in whole) appear in the same order
as they do in the IPv6 header format [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>]. The Version field is
always elided. Unicast IPv6 addresses may be compressed to 64 or 16
bits or completely elided. Multicast IPv6 addresses may be
compressed to 8, 32, or 48 bits. The IPv6 Payload Length field MUST
always be elided and inferred from lower layers using the 6LoWPAN
Fragmentation header or the IEEE 802.15.4 header.
<span class="h4"><a class="selflink" id="section-3.2.1" href="#section-3.2.1">3.2.1</a>. Traffic Class and Flow Label Compression</span>
The Traffic Class field in the IPv6 header comprises 6 bits of
Diffserv extension [<a href="./rfc2474" title=""Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers"">RFC2474</a>] and 2 bits of Explicit Congestion
Notification (ECN) [<a href="./rfc3168" title=""The Addition of Explicit Congestion Notification (ECN) to IP"">RFC3168</a>]. The TF field in the LOWPAN_IPHC
encoding indicates whether the Traffic Class and Flow Label are
carried in-line in the compressed IPv6 header. When Flow Label is
included while the Traffic Class is compressed, an additional 4 bits
are included to maintain byte alignment. Two of the 4 bits contain
the ECN bits from the Traffic Class field.
To ensure that the ECN bits appear in the same location for all
encodings that include them, the Traffic Class field is rotated right
by 2 bits in the compressed IPv6 header. The encodings are shown
below:
<span class="grey">Hui & Thubert Standards Track [Page 11]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-12" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|ECN| DSCP | rsv | Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 4: TF = 00: Traffic Class and Flow Label carried in-line
1 2
0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
|ECN|rsv| Flow Label |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 5: TF = 01: Flow Label carried in-line
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
|ECN| DSCP |
+-+-+-+-+-+-+-+-+
Figure 6: TF = 10: Traffic Class carried in-line
<span class="h4"><a class="selflink" id="section-3.2.2" href="#section-3.2.2">3.2.2</a>. Deriving IIDs from the Encapsulating Header</span>
LOWPAN_IPHC elides the IIDs of source or destination addresses when
SAM = 3 or DAM = 3, respectively. In this mode, the IID is derived
from the encapsulating header. When the encapsulating header carries
IPv6 addresses, bits for the source and destination addresses are
copied from the source and destination addresses of the encapsulating
IPv6 header.
The remainder of this section defines the mapping from IEEE 802.15.4
[<a href="#ref-IEEE802.15.4" title=""IEEE Std. 802.15.4-2006"">IEEE802.15.4</a>] link-layer addresses to IIDs for both short and
extended IEEE 802.15.4 addresses. IID bits not covered by the
context information MAY be elided if they match the link-layer
address mapping and MUST NOT be elided if they do not.
An extended IEEE 802.15.4 address takes the form of an IEEE EUI-64
address. Generating an IID from an extended address is identical to
that defined in <a href="./rfc4291#appendix-A">Appendix A of [RFC4291]</a>. The only change needed to
transform an IEEE EUI-64 identifier to an interface identifier is to
invert the universal/local bit.
<span class="grey">Hui & Thubert Standards Track [Page 12]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-13" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
A short IEEE 802.15.4 address is 16 bits in length. Short addresses
are mapped into the restricted space of IEEE EUI-64 addresses by
setting the middle 16 bits to 0xfffe, the bottom 16 bits to the short
address, and all other bits to zero. As a result, an IID generated
from a short address has the form:
0000:00ff:fe00:XXXX
where XXXX carries the short address. The universal/local bit is
zero to indicate local scope.
This mapping for non-EUI-64 identifiers differs from that presented
in <a href="./rfc4291#appendix-A">Appendix A of [RFC4291]</a>. Using the restricted space ensures no
overlap with IIDs generated from unrestricted IEEE EUI-64 addresses.
Also, including 0xfffe in the middle of the IID helps avoid overlap
with other locally managed IIDs.
This mapping from a short IEEE 802.15.4 address to 64-bit IIDs is
also used to reconstruct any part of an IID not covered by context
information.
<span class="h4"><a class="selflink" id="section-3.2.3" href="#section-3.2.3">3.2.3</a>. Stateless Multicast Address Compression</span>
LOWPAN_IPHC supports stateless compression of multicast addresses
when M = 1 and DAC = 0. An IPv6 multicast address may be compressed
down to 48, 32, or 8 bits using stateless compression. The format
supports compression of the Solicited-Node Multicast Address (ff02::
1:ffXX:XXXX) as well as any IPv6 multicast address where the upper
bits of the multicast group identifier are zero. The 8-bit
compressed form only carries the least-significant bits of the
multicast group identifier. The 48- and 32-bit compressed forms
carry the multicast scope and flags in-line, in addition to the
least-significant bits of the multicast group identifier.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Flags | Scope | Group Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Group Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 7: DAM = 01. 48-bit Compressed Multicast Address
(ffFS::00GG:GGGG:GGGG)
<span class="grey">Hui & Thubert Standards Track [Page 13]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-14" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Flags | Scope | Group Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 8: DAM = 10. 32-bit Compressed Multicast Address
(ffFS::00GG:GGGG)
0 1 2 3 4 5 6 7
+-+-+-+-+-+-+-+-+
| Group ID |
+-+-+-+-+-+-+-+-+
Figure 9: DAM = 11. 8-bit Compressed Multicast Address (ff02::GG)
<span class="h4"><a class="selflink" id="section-3.2.4" href="#section-3.2.4">3.2.4</a>. Stateful Multicast Address Compression</span>
LOWPAN_IPHC supports stateful compression of multicast addresses when
M = 1 and DAC = 1. This document currently defines DAM = 00:
context-based compression of Unicast-Prefix-based IPv6 Multicast
Addresses [<a href="./rfc3306" title=""Unicast-Prefix-based IPv6 Multicast Addresses"">RFC3306</a>][RFC3956]. In particular, the Prefix Length and
Network Prefix can be taken from a context. As a result, LOWPAN_IPHC
can compress a Unicast-Prefix-based IPv6 Multicast Address down to 6
octets by only carrying the 4-bit Flags, 4-bit Scope, 8-bit
Rendezvous Point Interface ID (RIID), and 32-bit Group Identifier in-
line.
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
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Flags | Scope | Rsvd / RIID | Group Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
| Group Identifier |
+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
Figure 10: DAM = 00. Unicast-Prefix-based IPv6 Multicast
Address Compression
Note that the Reserved field MUST carry the reserved bits from the
multicast address format as described in [<a href="./rfc3306" title=""Unicast-Prefix-based IPv6 Multicast Addresses"">RFC3306</a>]. When a
Rendezvous Point is encoded in the multicast address as described in
[<a href="./rfc3956" title=""Embedding the Rendezvous Point (RP) Address in an IPv6 Multicast Address"">RFC3956</a>], the Reserved field carries the RIID bits in-line.
<span class="grey">Hui & Thubert Standards Track [Page 14]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-15" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
<span class="h2"><a class="selflink" id="section-4" href="#section-4">4</a>. IPv6 Next Header Compression</span>
LOWPAN_IPHC elides the IPv6 Next Header field when the NH bit is set
to 1. This also indicates the use of 6LoWPAN next header
compression, LOWPAN_NHC. The value of IPv6 Next Header is recovered
from the first bits in the LOWPAN_NHC encoding. The following bits
are specific to the IPv6 Next Header value. Figure 11 shows the
structure of an IPv6 datagram compressed using LOWPAN_IPHC and
LOWPAN_NHC.
+-------------+-------------+-------------+-----------------+--------
| LOWPAN_IPHC | In-line | LOWPAN_NHC | In-line Next | Payload
| Encoding | IP Fields | Encoding | Header Fields |
+-------------+-------------+-------------+-----------------+--------
Figure 11: Typical LOWPAN_IPHC/LOWPAN_NHC Header Configuration
<span class="h3"><a class="selflink" id="section-4.1" href="#section-4.1">4.1</a>. LOWPAN_NHC Format</span>
Compression formats for different next headers are identified by a
variable-length bit-pattern immediately following the LOWPAN_IPHC
compressed header. When defining a next header compression format,
the number of bits used SHOULD be determined by the perceived
frequency of using that format. However, the number of bits and any
remaining encoding bits SHOULD respect octet alignment. The
following bits are specific to the next header compression format.
This document defines a compression format for IPv6 Extension and UDP
headers.
+----------------+---------------------------
| var-len NHC ID | compressed next header...
+----------------+---------------------------
Figure 12: LOWPAN_NHC Encoding
<span class="h3"><a class="selflink" id="section-4.2" href="#section-4.2">4.2</a>. IPv6 Extension Header Compression</span>
A necessary property of encoding headers using LOWPAN_NHC is that the
immediately preceding header must be encoded using either LOWPAN_IPHC
or LOWPAN_NHC. In other words, all headers encoded using the 6LoWPAN
encoding format defined in this document must be contiguous. As a
result, this document defines a set of LOWPAN_NHC encodings for
selected IPv6 Extension Headers such that the UDP Header Compression
defined in <a href="#section-4.3">Section 4.3</a> may be used in the presence of those extension
headers.
<span class="grey">Hui & Thubert Standards Track [Page 15]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-16" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
The LOWPAN_NHC encodings for IPv6 Extension Headers are composed of a
single LOWPAN_NHC octet followed by the IPv6 Extension Header. The
format of the LOWPAN_NHC octet is shown in Figure 13. The first 7
bits serve as an identifier for the IPv6 Extension Header immediately
following the LOWPAN_NHC octet. The remaining bit indicates whether
or not the following header utilizes LOWPAN_NHC encoding.
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| 1 | 1 | 1 | 0 | EID |NH |
+---+---+---+---+---+---+---+---+
Figure 13: IPv6 Extension Header Encoding
EID: IPv6 Extension Header ID:
0: IPv6 Hop-by-Hop Options Header [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>]
1: IPv6 Routing Header [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>]
2: IPv6 Fragment Header [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>]
3: IPv6 Destination Options Header [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>]
4: IPv6 Mobility Header [<a href="./rfc6275" title=""Mobility Support in IPv6"">RFC6275</a>]
5: Reserved
6: Reserved
7: IPv6 Header
NH: Next Header:
0: Full 8 bits for Next Header are carried in-line.
1: The Next Header field is elided and the next header is encoded
using LOWPAN_NHC, which is discussed in <a href="#section-4.1">Section 4.1</a>.
For the most part, the IPv6 Extension Header is carried unmodified in
the bytes immediately following the LOWPAN_NHC octet, with two
important exceptions: Length field and Next Header field.
The Next Header field contained in IPv6 Extension Headers is elided
when the NH bit is set in the LOWPAN_NHC encoding octet. Note that
doing so allows LOWPAN_NHC to utilize no more overhead than the non-
encoded IPv6 Extension Header.
<span class="grey">Hui & Thubert Standards Track [Page 16]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-17" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
The Length field contained in a compressed IPv6 Extension Header
indicates the number of octets that pertain to the (compressed)
extension header following the Length field. Note that this changes
the Length field definition in [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>] from indicating the header
size in 8-octet units, not including the first 8 octets. Changing
the Length field to be in units of octets removes wasteful internal
fragmentation.
IPv6 Hop-by-Hop and Destination Options Headers may use a trailing
Pad1 or PadN to achieve 8-octet alignment. When there is a single
trailing Pad1 or PadN option of 7 octets or less and the containing
header is a multiple of 8 octets, the trailing Pad1 or PadN option
MAY be elided by the compressor. A decompressor MUST ensure that the
containing header is padded out to a multiple of 8 octets in length,
using a Pad1 or PadN option if necessary. Note that Pad1 and PadN
options that appear in locations other than the end MUST be carried
in-line as they are used to align subsequent options.
Note that specifying units in octets means that LOWPAN_NHC MUST NOT
be used to encode IPv6 Extension Headers that have more than 255
octets following the Length field after compression.
When the identified next header is an IPv6 Header (EID=7), the NH bit
of the LOWPAN_NHC encoding is unused and MUST be set to zero. The
following bytes MUST be encoded using LOWPAN_IPHC as defined in
<a href="#section-3">Section 3</a>.
<span class="h3"><a class="selflink" id="section-4.3" href="#section-4.3">4.3</a>. UDP Header Compression</span>
This document defines a compression format for UDP headers using
LOWPAN_NHC. The UDP compression format is shown in Figure 14. Bits
0 through 4 represent the NHC ID and '11110' indicates the specific
UDP header compression encoding defined in this section.
<span class="h4"><a class="selflink" id="section-4.3.1" href="#section-4.3.1">4.3.1</a>. Compressing UDP Ports</span>
This specification allows a particular range of ports number (0xf0b0
to 0xf0bf) to be compressed down to 4 bits. This is a stateless
compression that is inherited from [<a href="./rfc4944" title=""Transmission of IPv6 Packets over IEEE 802.15.4 Networks"">RFC4944</a>], as opposed to a new
stateful compression.
The range of ports compressible down to 4 bits is not in a reserved
range. A network stack implementation that is designed to
communicate over a 6LoWPAN should avoid using those ports as dynamic
ports whenever possible.
<span class="grey">Hui & Thubert Standards Track [Page 17]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-18" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
Considering that this represents only 16 contiguous ports, it can be
expected that many incompatible applications will use the same value
of port numbers for their own end-to-end needs. Thus, a port number
in the (0xf0b0 to 0xf0bf) range provides very little information
about the application at the remote end.
The overloading of the 0xf0bX ports increases the risk of getting the
wrong type of payload and misinterpreting the content compared to
ports that are reserved at IANA. As a result, it is recommended that
the use of those ports be associated with a mechanism such as a
Transport Layer Security (TLS) [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>] Message Integrity Check
(MIC) that makes sure that the content is what is expected and is
checked.
<span class="h4"><a class="selflink" id="section-4.3.2" href="#section-4.3.2">4.3.2</a>. Compressing UDP Checksum</span>
The UDP checksum operation is mandatory with IPv6 [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>] for all
packets. For that reason, [<a href="./rfc4944" title=""Transmission of IPv6 Packets over IEEE 802.15.4 Networks"">RFC4944</a>] disallows the compression of the
UDP checksum.
With this specification, a compressor in the source transport
endpoint MAY elide the UDP Checksum if it is authorized by the upper
layer. The compressor MUST NOT set the C bit unless it has received
such authorization. Requiring upper-layer authorization ensures that
the intended transport peer will have sufficient means to deal with
any data corruption that occurs before reaching the destination. The
upper layer MUST NOT provide the authorization unless one of the
following cases is satisfied:
Tunneling: In this case, 6LoWPAN is deployed as a wireless pseudo-
fieldbus by tunneling existing field protocols over UDP. If the
tunneled Protocol Data Unit (PDU) possesses its own addressing,
security and integrity check (e.g., IPsec Encapsulating Security
Payload tunnel mode [<a href="./rfc4303" title=""IP Encapsulating Security Payload (ESP)"">RFC4303</a>] or IP over UDP encapsulation), the
tunneling mechanism MAY authorize eliding the UDP checksum in
order to save on the encapsulation overhead.
Message Integrity Check: In this case, either IPsec Authentication
Header [<a href="./rfc4302" title=""IP Authentication Header"">RFC4302</a>] or some other form of integrity check in the UDP
payload that covers at least the same information as the UDP
checksum (pseudo-header, data) and has at least the same strength.
To help ensure that the UDP Checksum will be properly restored when
expanding a 6LoWPAN packet, an additional integrity check (e.g., a
Layer 2 (L2) Message Integrity Check) MUST be used whenever
transmitting link frames that carry a compressed UDP datagram that
<span class="grey">Hui & Thubert Standards Track [Page 18]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-19" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
elides the checksum. Without this additional integrity check, a UDP
packet may be delivered to an unintended destination since corruption
in data covered by the pseudo-header can go undetected.
A compressor MUST verify the UDP Checksum before it is elided and
MUST ensure that the additional integrity check is in place before
verifying and eliding the checksum. If verification of the UDP
Checksum fails, the compressor MUST drop the packet.
A decompressor that expands a 6LoWPAN packet with the C bit set MUST
compute the UDP Checksum on behalf of the source node and place that
value in the restored UDP header as specified in the incumbent
standards [<a href="./rfc0768" title=""User Datagram Protocol"">RFC0768</a>], [<a href="./rfc2460" title=""Internet Protocol, Version 6 (IPv6) Specification"">RFC2460</a>]. The decompressor MUST unambiguously
determine that an additional integrity check was put in place by the
compressor and verify the integrity check and SHOULD do so after
restoring the UDP Checksum. If the decompressor cannot unambiguously
determine the presence of an integrity check or verification fails,
the decompressor MUST drop the packet.
The recommended ordering of computing and verifying the UDP Checksum
and additional integrity check ensures that data is never stored
unprotected in memory. In practice, functionality separation between
layers may preclude the recommended ordering. However, implementors
should take special note and understand the risks when dealing with
unprotected data covered by the pseudo-header.
To allow intermediate nodes to compress the UDP Checksum, a
forwarding node MAY infer upper-layer authorization for an incoming
packet if it has the C bit set and it can unambiguously determine
that an integrity check covering the same data as the UDP Checksum
was in place while the UDP Checksum was elided. A forwarding node
MUST NOT infer authorization if it cannot unambiguously determine the
presence of and verify an integrity check while the UDP Checksum was
elided.
<span class="grey">Hui & Thubert Standards Track [Page 19]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-20" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
<span class="h4"><a class="selflink" id="section-4.3.3" href="#section-4.3.3">4.3.3</a>. UDP LOWPAN_NHC Format</span>
0 1 2 3 4 5 6 7
+---+---+---+---+---+---+---+---+
| 1 | 1 | 1 | 1 | 0 | C | P |
+---+---+---+---+---+---+---+---+
Figure 14: UDP Header Encoding
C: Checksum:
0: All 16 bits of Checksum are carried in-line.
1: All 16 bits of Checksum are elided. The Checksum is recovered
by recomputing it on the 6LoWPAN termination point.
P: Ports:
00: All 16 bits for both Source Port and Destination Port are
carried in-line.
01: All 16 bits for Source Port are carried in-line. First 8
bits of Destination Port is 0xf0 and elided. The remaining 8
bits of Destination Port are carried in-line.
10: First 8 bits of Source Port are 0xf0 and elided. The
remaining 8 bits of Source Port are carried in-line. All 16
bits for Destination Port are carried in-line.
11: First 12 bits of both Source Port and Destination Port are
0xf0b and elided. The remaining 4 bits for each are carried
in-line.
Fields carried in-line (in part or in whole) appear in the same order
as they do in the UDP header format [<a href="./rfc0768" title=""User Datagram Protocol"">RFC0768</a>]. The UDP Length field
MUST always be elided and is inferred from lower layers using the
6LoWPAN Fragmentation header or the IEEE 802.15.4 header.
<span class="h2"><a class="selflink" id="section-5" href="#section-5">5</a>. IANA Considerations</span>
This document defines a new IPv6 header compression format for
6LoWPAN. The document allocates the following 32 Dispatch type field
values for LOWPAN_IPHC:
01 100000
through
01 111111
<span class="grey">Hui & Thubert Standards Track [Page 20]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-21" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
This assignment preempts the assignment of 01 111111 for ESC
[<a href="./rfc4944" title=""Transmission of IPv6 Packets over IEEE 802.15.4 Networks"">RFC4944</a>]; this preemption is possible because extension bytes that
would enable the use of ESC have not been allocated yet. Instead,
the value:
01 000000
is reserved as a replacement value for ESC, to be finally assigned
with the first assignment of extension bytes.
This document also creates a new IANA registry for the LOWPAN_NHC
header type, with the following initial content:
00000000 to 11011111: (unassigned)
1110000N: IPv6 Hop-by-Hop Options Header [<a href="./rfc6282">RFC6282</a>]
1110001N: IPv6 Routing Header [<a href="./rfc6282">RFC6282</a>]
1110010N: IPv6 Fragment Header [<a href="./rfc6282">RFC6282</a>]
1110011N: IPv6 Destination Options Header [<a href="./rfc6282">RFC6282</a>]
1110100N: IPv6 Mobility Header [<a href="./rfc6282">RFC6282</a>]
1110111N: IPv6 Header [<a href="./rfc6282">RFC6282</a>]
11110CPP: UDP Header [<a href="./rfc6282">RFC6282</a>]
11111000 to 11111110: (unassigned)
Capital letters in bit positions represent class-specific bit
assignments. N indicates whether or not additional LOWPAN_NHC
encodings follow, as defined in <a href="#section-4.2">Section 4.2</a>. CPP represents
variables specific to UDP header compression defined in <a href="#section-4.3">Section 4.3</a>.
The policy for this registry [<a href="./rfc5226" title="">RFC5226</a>] is IETF Review. In this
process, new values SHOULD be assigned in a way that preserves the
NHC ID abstraction of <a href="#section-4">Section 4</a> (i.e., k one-bits followed by one
zero-bit identify the general class of NHC, followed by class-
specific bit assignments).
<span class="h2"><a class="selflink" id="section-6" href="#section-6">6</a>. Security Considerations</span>
The definition of LOWPAN_IPHC permits the compression of header
information on communication that could take place in its absence,
albeit in a less efficient form. It recognizes that a IEEE 802.15.4
PAN may have associated with it a number of prefixes through shared
context. How the shared context is assigned and managed is beyond
the scope of this document.
The overloading of the 0xf0bX ports increases the risk of getting the
wrong type of payload and misinterpreting the content compared to
ports that reserved at IANA. It is thus recommended that the use of
<span class="grey">Hui & Thubert Standards Track [Page 21]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-22" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
those ports be associated with a mechanism such as a Transport Layer
Security (TLS) [<a href="./rfc5246" title=""The Transport Layer Security (TLS) Protocol Version 1.2"">RFC5246</a>] Message Integrity Check (MIC) that validates
that the content is expected and checked for integrity.
<span class="h2"><a class="selflink" id="section-7" href="#section-7">7</a>. Acknowledgements</span>
Thanks to Julien Abeille, Robert Assimiti, Dominique Barthel, Carsten
Bormann, Robert Cragie, Stephen Dawson-Haggerty, Mathilde Durvy, Erik
Nordmark, Christos Polyzois, Joseph Reddy, Shoichi Sakane, Zach
Shelby, Dario Tedeschi, Tony Viscardi, and Jay Werb for useful design
consideration and implementation feedback. Special thanks to David
Black, Lars Eggert, and Carsten Bormann for their contribution in
closing the security issues around UDP compression.
<span class="h2"><a class="selflink" id="section-8" href="#section-8">8</a>. References</span>
<span class="h3"><a class="selflink" id="section-8.1" href="#section-8.1">8.1</a>. Normative References</span>
[<a id="ref-RFC0768">RFC0768</a>] Postel, J., "User Datagram Protocol", STD 6, <a href="./rfc768">RFC 768</a>,
August 1980.
[<a id="ref-RFC2119">RFC2119</a>] Bradner, S., "Key words for use in RFCs to Indicate
Requirement Levels", <a href="https://www.rfc-editor.org/bcp/bcp14">BCP 14</a>, <a href="./rfc2119">RFC 2119</a>, March 1997.
[<a id="ref-RFC2460">RFC2460</a>] Deering, S. and R. Hinden, "Internet Protocol,
Version 6 (IPv6) Specification", <a href="./rfc2460">RFC 2460</a>,
December 1998.
[<a id="ref-RFC2474">RFC2474</a>] Nichols, K., Blake, S., Baker, F., and D. Black,
"Definition of the Differentiated Services Field (DS
Field) in the IPv4 and IPv6 Headers", <a href="./rfc2474">RFC 2474</a>,
December 1998.
[<a id="ref-RFC3168">RFC3168</a>] Ramakrishnan, K., Floyd, S., and D. Black, "The
Addition of Explicit Congestion Notification (ECN) to
IP", <a href="./rfc3168">RFC 3168</a>, September 2001.
[<a id="ref-RFC4291">RFC4291</a>] Hinden, R. and S. Deering, "IP Version 6 Addressing
Architecture", <a href="./rfc4291">RFC 4291</a>, February 2006.
[<a id="ref-RFC4944">RFC4944</a>] Montenegro, G., Kushalnagar, N., Hui, J., and D.
Culler, "Transmission of IPv6 Packets over IEEE
802.15.4 Networks", <a href="./rfc4944">RFC 4944</a>, September 2007.
[<a id="ref-RFC5226">RFC5226</a>] Narten, T. and H. Alvestrand, "Guidelines for Writing
an IANA Considerations Section in RFCs", <a href="https://www.rfc-editor.org/bcp/bcp26">BCP 26</a>,
<a href="./rfc5226">RFC 5226</a>, May 2008.
<span class="grey">Hui & Thubert Standards Track [Page 22]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-23" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
[<a id="ref-RFC6275">RFC6275</a>] Perkins, C., Ed., Johnson, D., and J. Arkko,
"Mobility Support in IPv6", <a href="./rfc6275">RFC 6275</a>, July 2011.
<span class="h3"><a class="selflink" id="section-8.2" href="#section-8.2">8.2</a>. Informative References</span>
[<a id="ref-IEEE802.15.4">IEEE802.15.4</a>] IEEE Computer Society, "IEEE Std. 802.15.4-2006",
October 2006.
[<a id="ref-RFC3306">RFC3306</a>] Haberman, B. and D. Thaler, "Unicast-Prefix-based
IPv6 Multicast Addresses", <a href="./rfc3306">RFC 3306</a>, August 2002.
[<a id="ref-RFC3315">RFC3315</a>] Droms, R., Bound, J., Volz, B., Lemon, T., Perkins,
C., and M. Carney, "Dynamic Host Configuration
Protocol for IPv6 (DHCPv6)", <a href="./rfc3315">RFC 3315</a>, July 2003.
[<a id="ref-RFC3956">RFC3956</a>] Savola, P. and B. Haberman, "Embedding the Rendezvous
Point (RP) Address in an IPv6 Multicast Address",
<a href="./rfc3956">RFC 3956</a>, November 2004.
[<a id="ref-RFC4302">RFC4302</a>] Kent, S., "IP Authentication Header", <a href="./rfc4302">RFC 4302</a>,
December 2005.
[<a id="ref-RFC4303">RFC4303</a>] Kent, S., "IP Encapsulating Security Payload (ESP)",
<a href="./rfc4303">RFC 4303</a>, December 2005.
[<a id="ref-RFC4861">RFC4861</a>] Narten, T., Nordmark, E., Simpson, W., and H.
Soliman, "Neighbor Discovery for IP version 6
(IPv6)", <a href="./rfc4861">RFC 4861</a>, September 2007.
[<a id="ref-RFC5246">RFC5246</a>] Dierks, T. and E. Rescorla, "The Transport Layer
Security (TLS) Protocol Version 1.2", <a href="./rfc5246">RFC 5246</a>,
August 2008.
<span class="grey">Hui & Thubert Standards Track [Page 23]</span></pre>
<hr class='noprint'/><!--NewPage--><pre class='newpage'><span id="page-24" ></span>
<span class="grey"><a href="./rfc6282">RFC 6282</a> IPv6 Datagrams on IEEE 802.15.4 September 2011</span>
Authors' Addresses
Jonathan W. Hui (editor)
Arch Rock Corporation
501 2nd St. Ste. 410
San Francisco, California 94107
USA
Phone: +415 692 0828
EMail: jhui@archrock.com
Pascal Thubert
Cisco Systems
Village d'Entreprises Green Side
400, Avenue de Roumanille
Batiment T3
Biot - Sophia Antipolis 06410
FRANCE
Phone: +33 4 97 23 26 34
EMail: pthubert@cisco.com
Hui & Thubert Standards Track [Page 24]
</pre>
|