idnits 2.17.1 draft-watteyne-6lo-minimal-fragment-01.txt: Checking boilerplate required by RFC 5378 and the IETF Trust (see https://trustee.ietf.org/license-info): ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/1id-guidelines.txt: ---------------------------------------------------------------------------- No issues found here. Checking nits according to https://www.ietf.org/id-info/checklist : ---------------------------------------------------------------------------- No issues found here. Miscellaneous warnings: ---------------------------------------------------------------------------- == The copyright year in the IETF Trust and authors Copyright Line does not match the current year -- The document date (March 06, 2018) is 2215 days in the past. Is this intentional? -- Found something which looks like a code comment -- if you have code sections in the document, please surround them with '' and '' lines. Checking references for intended status: Informational ---------------------------------------------------------------------------- == Outdated reference: A later version (-01) exists of draft-thubert-6lo-fragment-recovery-00 Summary: 0 errors (**), 0 flaws (~~), 2 warnings (==), 2 comments (--). Run idnits with the --verbose option for more detailed information about the items above. -------------------------------------------------------------------------------- 2 6lo T. Watteyne, Ed. 3 Internet-Draft Analog Devices 4 Intended status: Informational C. Bormann 5 Expires: September 7, 2018 Universitaet Bremen TZI 6 P. Thubert 7 Cisco 8 March 06, 2018 10 LLN Minimal Fragment Forwarding 11 draft-watteyne-6lo-minimal-fragment-01 13 Abstract 15 This document gives an overview of LLN Minimal Fragment Forwarding. 16 When employing adaptation layer fragmentation in 6LoWPAN, it may be 17 beneficial for a forwarder not to have to reassemble each packet in 18 its entirety before forwarding it. This has been always possible 19 with the original fragmentation design of RFC4944. This document 20 details the Virtual Reassembly Buffer (VRB) implementation technique 21 which reduces the latency and increases end-to-end reliability in 22 route-over forwarding, and discusses its limits. 24 Status of This Memo 26 This Internet-Draft is submitted in full conformance with the 27 provisions of BCP 78 and BCP 79. 29 Internet-Drafts are working documents of the Internet Engineering 30 Task Force (IETF). Note that other groups may also distribute 31 working documents as Internet-Drafts. The list of current Internet- 32 Drafts is at https://datatracker.ietf.org/drafts/current/. 34 Internet-Drafts are draft documents valid for a maximum of six months 35 and may be updated, replaced, or obsoleted by other documents at any 36 time. It is inappropriate to use Internet-Drafts as reference 37 material or to cite them other than as "work in progress." 39 This Internet-Draft will expire on September 7, 2018. 41 Copyright Notice 43 Copyright (c) 2018 IETF Trust and the persons identified as the 44 document authors. All rights reserved. 46 This document is subject to BCP 78 and the IETF Trust's Legal 47 Provisions Relating to IETF Documents 48 (https://trustee.ietf.org/license-info) in effect on the date of 49 publication of this document. Please review these documents 50 carefully, as they describe your rights and restrictions with respect 51 to this document. Code Components extracted from this document must 52 include Simplified BSD License text as described in Section 4.e of 53 the Trust Legal Provisions and are provided without warranty as 54 described in the Simplified BSD License. 56 Table of Contents 58 1. Overview of 6LoWPAN Fragmentation . . . . . . . . . . . . . . 2 59 2. Limits of Per-Hop Fragmentation and Reassembly . . . . . . . 4 60 2.1. Latency . . . . . . . . . . . . . . . . . . . . . . . . . 4 61 2.2. Memory Management and Reliability . . . . . . . . . . . . 4 62 3. Virtual Reassembly Buffer (VRB) Implementation . . . . . . . 5 63 4. Critique of VRB . . . . . . . . . . . . . . . . . . . . . . . 7 64 5. Security Considerations . . . . . . . . . . . . . . . . . . . 8 65 6. IANA Considerations . . . . . . . . . . . . . . . . . . . . . 8 66 7. Acknowledgments . . . . . . . . . . . . . . . . . . . . . . . 8 67 8. Informative References . . . . . . . . . . . . . . . . . . . 8 68 Authors' Addresses . . . . . . . . . . . . . . . . . . . . . . . 8 70 1. Overview of 6LoWPAN Fragmentation 72 6LoWPAN fragmentation is defined in [RFC4944]. Although [RFC6282] 73 updates [RFC4944], it does not redefine 6LoWPAN fragmentation. 75 We use Figure 1 to illustrate 6LoWPAN fragmentation. We assume node 76 A forwards a packet to node B, possibly as part of a multi-hop route 77 between IPv6 source and destination nodes which are neither A nor B. 79 +---+ +---+ 80 ... ---| A |-------------------->| B |--- ... 81 +---+ +---+ 82 # (frag. 5) 84 123456789 123456789 85 +---------+ +---------+ 86 | # ###| |### # | 87 +---------+ +---------+ 88 outgoing incoming 89 fragmentation reassembly 90 buffer buffer 92 Figure 1: Fragmentation at node A, reassembly at node B. 94 Node A starts by compacting the IPv6 packet using header compression 95 defined in [RFC6282]. If the resulting 6LoWPAN packet does not fit 96 into a single link-layer frame, node A's 6LoWPAN sublayer cuts it 97 into multiple 6LoWPAN fragments, which it transmits as separate link- 98 layer frames to node B. Node B's 6LoWPAN sublayer reassembles these 99 fragments, inflates the compressed header fields back to the original 100 IPv6 header, and hands over the full IPv6 packet to its IPv6 layer. 102 In Figure 1, a packet forwarded by node A to node B is cut into nine 103 fragments, numbered 1 to 9. Each fragment is represented by the '#' 104 symbol. Node A has sent fragments 1, 2, 3, 5, 6 to node B. Node B 105 has received fragments 1, 2, 3, 6 from node A. Fragment 5 is still 106 being transmitted at the link layer from node A to node B. 108 A reassembly buffer for 6LoWPAN contains: 110 o datagram_size, 111 o datagram_tag and link-layer sender and receiver addresses (to 112 which the datagram_tag is local), 113 o actual packet data from the fragments received so far, in a form 114 that makes it possible to detect when the whole packet has been 115 received and can be processed or forwarded, 116 o a timer that allows discarding the partial packet after a timeout. 118 A fragmentation header is added to each fragment; it indicates what 119 portion of the packet that fragment corresponds to. Section 5.3 of 120 [RFC4944] defines the format of the header for the first and 121 subsequent fragments. All fragments are tagged with a 16-bit 122 "datagram_tag", used to identify which packet each fragment belongs 123 to. Each fragment can be uniquely identified by the source and 124 destination link-layer addresses of the frame that carries it, and 125 the datagram_tag. The value of the datagram_tag only needs to be 126 locally unique to nodes A and B. 128 Node B's typical behavior, per [RFC4944], is as follows. Upon 129 receiving a fragment from node A with a datagram_tag previously 130 unseen from node A, node B allocates a buffer large enough to hold 131 the entire packet. The length of the packet is indicated in each 132 fragment (the datagram_size field), so node B can allocate the buffer 133 even if the first fragment it receives is not fragment 1. As 134 fragments come in, node B fills the buffer. When all fragments have 135 been received, node B inflates the compressed header fields into an 136 IPv6 header, and hands the resulting IPv6 packet to the IPv6 layer. 138 This behavior typically results in per-hop fragmentation and 139 reassembly. That is, the packet is fully reassembled, then 140 (re)fragmented, at every hop. 142 2. Limits of Per-Hop Fragmentation and Reassembly 144 There are at least 2 limits to doing per-hop fragmentation and 145 reassembly: 147 2.1. Latency 149 When reassembling, a node needs to wait for all the fragments to be 150 received before being able to generate the IPv6 packet, and possibly 151 forward it to the next hop. This repeats at every hop. 153 This may result in increased end-to-end latency compared to the case 154 where each fragment would be forwarded without per-hop reassembly. 156 2.2. Memory Management and Reliability 158 Constrained nodes have limited memory. Assuming 1 kB reassembly 159 buffers, typical nodes only have enough memory for 1-3 reassembly 160 buffers. 162 Assuming the topology from Figure 2, where nodes A, B, C and D all 163 send packets through node E. We further assume that node E's memory 164 can only hold 3 reassembly buffers. 166 +---+ +---+ 167 ... --->| A |------>| B | 168 +---+ +---+\ 169 \ 170 +---+ +---+ 171 | E |--->| F | ... 172 +---+ +---+ 173 / 174 / 175 +---+ +---+ 176 ... --->| C |------>| D | 177 +---+ +---+ 179 Figure 2: Illustrating the Memory Management Issue. 181 When nodes A, B and C concurrently send fragmented packets, all 3 182 reassembly buffers in node E are occupied. If, at that moment, node 183 D also sends a fragmented packet, node E has no option but to drop 184 one of the packets, lowering end-to-end reliability. 186 3. Virtual Reassembly Buffer (VRB) Implementation 188 One implementation of 6LoWPAN fragmentation overcomes the limits 189 listed in Section 2. The idea is for a node to immediately 190 retransmit a fragment it receives, without fully reassembling the 191 packet. This idea was introduced in Section 2.5.2 of [BOOK]. That 192 is, a node may attempt to send out the data for a fragment in the 193 form of a forwarded fragment, as soon as all necessary information 194 for that is available. 195 Obviously, all fragments need to be sent with the same outgoing 196 address (otherwise a full reassembly implementation would discard the 197 fragments) and the same datagram_tag. 199 We use Figure 3 to illustrate VRB, and focus on the behavior of node 200 E. With VRB, node E maintains a VRB table which functions similarly 201 to a switching table: when receiving a fragment from node B with 202 datagram_tag=2, forward it to node F with datagram_tag=8. 204 +---+ +---+ 205 | A |----->| B | +-------------+-------------+ 206 +---+ #(5) +---+\ #(2) | incoming | outgoing | 207 \ +-------+-----+-------+-----+ 208 +---+ #(8) +---+ |L2 src | tag |L2 dest| tag | 209 | E |----->| F | +=======+=====+=======+=====+ 210 +---+ %(5) +---+ | B | 2 | F | 8 | 211 / | D | 2 | F | 5 | 212 / %(2) | empty | 213 +---+ %(1) +---+ | empty | 214 | C |----->| D | +-------+-----+-------+-----+ 215 +---+ +---+ Node E's VRB table. 217 Figure 3: Illustrating VRB. #(5) and %(1) are fragments from packets 218 coming from nodes A and C, with datagram_tag set to 5 and 1, 219 respectively. 221 The VRB table is initially empty. An implementation might have for 222 example pre-allocate memory for a VRB table with 4 entries (as in 223 Figure 3), initially cleared. 225 When node E receives fragment 1 from node B with datagram_tag=2, it 226 inspects the contents of the fragment and reads out the destination 227 IPv6 address. When it is not destined to it, node E identifies the 228 next hop to send this fragment to. It then creates an entry in the 229 VRB table which contains 4 fields: (1) the link-layer address of the 230 sender of the fragment it received, (2) the datagram_tag of the 231 fragment it received, (3) the link-layer address of the next hop, (4) 232 a datagram_tag for the fragments it will send. The latter 233 datagram_tag must be locally unique. 235 Note that, if node E had multiple interfaces, the VRB table would 236 also need additional column to identify the incoming and outgoing 237 interface. 239 Any subsequent fragment that matches the "incoming" columns in the 240 node's VRB table are immediately forwarded using the information in 241 the "outgoing" columns. Note that, while this results in a behavior 242 similar to link-layer switching, what is really happening is that the 243 node has a virtual reassembly buffer. That is, it operates as if the 244 packet were reassembled and fragmented, without ever actually holding 245 a fully reassembled packet in memory. 247 Upon forwarding the last fragment of a packet, the VRB table entry 248 can be cleared, and reused for a future packet. If the last fragment 249 of a packet is dropped, the VRB table entry can be invalidated by 250 timeout. Its timeout value is set to a maximum of 60 seconds as the 251 reassembly timeout defined in [RFC4944]. 253 A simple implementation may do away with any attempt to keep packet 254 data in the virtual reassembly buffer. It then has to discard all 255 non-first fragments for which a reassembly buffer is not already 256 available (penalizing reordering, which however may be rare). 258 In case fragments can come out of order (a rare case, as all 259 fragments of a packet are sent between the same neighbors), an 260 implementation can use multiple the following two techniques. In 261 case fragment 1 isn't received first, it can temporarily buffer 262 fragments 2, 3, etc., until fragment 1 is received, and a next hop 263 neighbor can be identified. Similarly, as the final fragment of the 264 packet isn't necessarily received last, an implementation can 265 maintain a bitmap of already forwarded fragments to know when all 266 fragments have been forwarded (and the corresponding VRB entry can be 267 cleared). 269 Note that the decision to do local processing of a packet needs to be 270 taken with the first fragment - such packets of course do need to be 271 fully reassembled (unless transport and application also can cope 272 with fragments, which they rarely can in the presence of security). 274 It is possible for a network to be composed of some nodes that 275 implement VRB, and others that don't. Nodes that do not implement 276 VRB reassemble the packet. 278 [RFC6282] defines the header compression format for 6LoWPAN. One 279 important impact of header compression is that the header is no 280 longer of a fixed length. In particular, changes made by a forwarder 281 may gain or lose the ability to use a more highly compressed variant, 282 changing the length of the header in the packet. 284 If the change increases the size, the maximum frame size may be 285 exceeded, leading to the need to re-fragment in the forwarder. This 286 is less of a problem with full reassembly, but with virtual 287 reassembly can lead to the need for sending an additional frame for 288 each packet. 290 The well-known approach to minimize the probability of this need is 291 for the original sender to put all slack in the frame sizes into the 292 _first_ packet, making this the smallest fragment and not the last 293 one as would be done in a naive implementation. (This also has other 294 consequences related to delivery probability, which are not discussed 295 here.) This makes sure an additional fragment only needs to be sent 296 if the header expansion during forwarding would have created an 297 additional fragment with full reassembly as well. 299 4. Critique of VRB 301 VRB overcomes the limits listed in Section 2. Nodes don't wait for 302 the last fragment before forwarding, reducing end-to-end latency. 303 Similarly, the memory footprint of VRB is just the VRB table, 304 reducing the packet drop probability significantly. 306 There are, however, limits: 308 Non-zero Packet Drop Probability: Each VRB table entry can be 12 B 309 (assuming 16-bit link-layer addresses). This is a footprint 2 310 orders of magnitude smaller compared to needing a 1280-byte 311 reassembly buffer for each packet. Yet, the size of the VRB 312 table necessarily remains finite. In the extreme case where a 313 node is required to concurrently forward more packets that it has 314 entries in its VRB table, packets are dropped. 315 No Fragment Recovery: There is no mechanism in VRB for the node that 316 reassembles a packet to request a single missing fragment. 317 Dropping a fragment requires the whole packet to be resent. This 318 causes unnecessary traffic, as fragments are forwarded even when 319 the destination node can never construct the original IPv6 320 packet. 321 No Per-Fragment Routing: All subsequent fragments follow the same 322 sequence of hops from the source to the destination node as 323 fragment 1. 325 The severity and occurrence of these limits depends on the link-layer 326 used. Whether these limits are acceptable depends entirely on the 327 requirements the application places on the network. 329 If the limits are both present and not accepted by the application, 330 future specifications may define new protocols to overcome these 331 limits. One example is [I-D.thubert-6lo-fragment-recovery] which 332 defines a protocol which allows fragment recovery. 334 5. Security Considerations 336 An attacker can perform a DoS attack on a node implementing VRB by 337 generating a large number of bogus "fragment 1" fragments without 338 sending subsequent fragments. This causes the VRB table to fill up. 340 Secure joining and the link-layer security that it sets up protects 341 against those attacks from network outsiders. 343 6. IANA Considerations 345 No requests to IANA are made by this document. 347 7. Acknowledgments 349 The authors would like to thank Yasuyuki Tanaka for his in-depth 350 review of this document. 352 8. Informative References 354 [BOOK] Shelby, Z. and C. Bormann, "6LoWPAN", John Wiley & Sons, 355 Ltd monograph, DOI 10.1002/9780470686218, November 2009. 357 [I-D.thubert-6lo-fragment-recovery] 358 Thubert, P., "6LoWPAN Selective Fragment Recovery", draft- 359 thubert-6lo-fragment-recovery-00 (work in progress), 360 February 2018. 362 [RFC4944] Montenegro, G., Kushalnagar, N., Hui, J., and D. Culler, 363 "Transmission of IPv6 Packets over IEEE 802.15.4 364 Networks", RFC 4944, DOI 10.17487/RFC4944, September 2007, 365 . 367 [RFC6282] Hui, J., Ed. and P. Thubert, "Compression Format for IPv6 368 Datagrams over IEEE 802.15.4-Based Networks", RFC 6282, 369 DOI 10.17487/RFC6282, September 2011, 370 . 372 Authors' Addresses 373 Thomas Watteyne (editor) 374 Analog Devices 375 32990 Alvarado-Niles Road, Suite 910 376 Union City, CA 94587 377 USA 379 Email: thomas.watteyne@analog.com 381 Carsten Bormann 382 Universitaet Bremen TZI 383 Postfach 330440 384 Bremen D-28359 385 Germany 387 Email: cabo@tzi.org 389 Pascal Thubert 390 Cisco Systems, Inc 391 Building D 392 45 Allee des Ormes - BP1200 393 MOUGINS - Sophia Antipolis 06254 394 France 396 Email: pthubert@cisco.com