<?xml version="1.0"?>
<!DOCTYPE rfc SYSTEM "rfc2629.dtd">
<?rfc toc="yes"?>
<?rfc comments="yes"?>
<?rfc inline="yes"?>
<?rfc subcompact="yes"?>
<rfc category="info" ipr="trust200902" docName="draft-lagos-lpwan-icmpv6-static-context-hc-01">
<front>
   <title abbrev="lpwan-icmp-static-context-hc">
      LPWAN Static Context Header Compression (SCHC) for ICMPv6
   </title>
   <author initials="T" surname="Lagos" fullname="Tomás Lagos" role="editor">
      <organization>Universidad Diego Portales</organization>
      <address>
         <postal>
            <street>Escuela de Informatica y Telecomunicaciones</street>
            <street>Av. Ejercito 441</street>
            <city>Santiago</city>
            <region>Region Metropolitana</region>
            <country>Chile</country>
         </postal>
         <phone>+56 (97) 697-6404</phone>
         <email>tomas.lagos@mail.udp.cl</email>
      </address>
   </author>
   <author initials="D" surname="Dujovne" fullname="Diego Dujovne">
      <organization>Universidad Diego Portales</organization>
      <address>
         <postal>
            <street>Escuela de Informatica y Telecomunicaciones</street>
            <street>Av. Ejercito 441</street>
            <city>Santiago</city>
            <region>Region Metropolitana</region>
            <country>Chile</country>
         </postal>
         <phone>+56 (2) 676-8121</phone>
         <email>diego.dujovne@mail.udp.cl</email>
      </address>
   </author>
   <date/>
   <area>Internet Area</area>
   <workgroup>LPWAN</workgroup>
   <keyword>Draft</keyword>
   <abstract>
      <t>
         This document provides the implementation of the LPWAN static context header compression (SCHC) for the Internet Control Message Protocol version 6 (ICMPv6) on networks with star topology. SCHC is a header compression technique which uses RoHC concepts and the flexibility of 6LoWPAN to avoid fields that are known by all network devices and compress the remaining header fields. The ICMPv6 messages considered in this draft are Echo Request, Echo Reply and Neighbor Discovery.
      </t>
   </abstract>
   <note title="Requirements Language">
      <t>
         The key words "MUST", "MUST NOT", "REQUIRED", "SHALL", "SHALL NOT", "SHOULD", "SHOULD NOT", "RECOMMENDED", "NOT RECOMMENDED", "MAY", and "OPTIONAL" in this document are to be interpreted as described in <xref target="RFC2119">RFC 2119</xref>. 
      </t>
   </note>
</front>
<middle>
    <section title="TEMPORARY EDITORIAL NOTES" anchor="temp_edit_notes">
      <t>
        This document is an Internet Draft, so it is work-in-progress by nature.  It contains the following work-in-progress elements:
      </t>   
      <t>
      <list style="symbols">
           <t>
              "TODO" statements are elements which have not yet been written by the authors for some reason (lack of time, ongoing discussions with no clear consensus, etc).  The statement does indicate that the text will be written at some time.
           </t>
           <t>
              "TEMPORARY" appendices are there to capture current ongoing discussions, or the changelog of the document.  These appendiceswill be removed in the final text.
           </t>
           <t>
              "IANA_" identifiers are placeholders for numbers assigned by IANA. These placeholders are to be replaced by the actual values they represent after their assignment by IANA.
           </t>
           <t>
              The string "REMARK" is put before a remark (questions, suggestion, etc) from an author, editor of contributor.  These are on-going discussions at the time to writing, NOT part of the final text.
           </t>
           <t>
              This section will be removed in the final text.
           </t>
        </list> 
	</t>
   </section> 
   <section title="Introduction"  anchor="sec_intro">
      <t>
        LPWANs are networks where low power consumption, high delay and extremely small packets characterize the traffic. The nodes are tipically connected in a star topology, with a central gateway that connects the network to the Internet. Most IP-based networks require ICMP services to enable network configuration and testing, such as neighbor node detection and round trip time calculation. Because ICMPv6 has redundant information in header fields, SCHC can be deployed efficiently, especially for LPWA devices that are constrained by a small available bandwidth and power limitations.       
      </t>
      <t>
        This document describes ICMPv6 message compression using SCHC compression defined on <xref target="I-D.toutain-lpwan-ipv6-static-context-hc"/> to reduce to the minimum the required LPWAN packet size.
      </t>
   </section>
  
  <section title="LoRa networks using ICMPv6 message"   anchor="sec_LoRa">
      <t>
          High coverage and low power communication technologies - LoRa networks - allow the construction of data capture systems with the goal of covering a large area with a low bandwidth. This technology is characterized by the transmission of short packets and their direct sequence spread spectrum - DSSS.
      </t>
      <t>
          To maintain communications between the nodes and the outer is necessary the implementation of a neighbor discovery protocol. The internet layer will be composed by the ICMPv6 protocol. 
      </t>
      <t>
          The use of SCHC in LoRa messages is fundamental in the  ICMPv6 comunication. This is because the IPv6 header consist in 40 Bytes and the ICMPv6 header in the worst esenario can be reach lenght over the 36 Bytes. For a LoRa escenario the field checksum of a ICMPv6 message will be avoided how is shown in the next chapters. This is because LoRa message posses CRC so it is not necesassary to send it.
      </t>
      <t>
         The fields link layer and target address (only link local) in a ICMPv6 message are going be sended ones as they will be saved in the memory of the LoRa Gateway. For more datails see <xref target='sec_gateway_tables' /> 
 
      </t>
  </section>  
   
   <section title="SCHC compression over Echo Request - Echo Reply"   anchor="sec_echo">
      <t>
         Echo Request and Echo Reply are composed by the same fields:
          <list style="symbols">
             <t>
                Type: Message type. In case it is Echo Request the value will be 0x80. If it is Echo Reply will be 0x81.
             </t>
             <t>
                Code: Always 0.
             </t>
             <t>
                Checksum: This field is composed by 2 Bytes where the values are calculated as defined on <xref target="RFC4443">RFC 4443</xref>.
             </t>
             <t>
                Identifier: It is the ID of the package.
             </t>
             <t>
                Sequence: It is the sequence number of the transmitted packet.
             </t>
          </list>
          For a SCHC compression it is necessary to identify which fields stay static to build the context. 
      </t>
      <t>
        The fields Code and checksum can be elided because Code is always zero and Checksum can be calculated after the decompression of the packet.  In the case of Type, this field can be represented in the SCHC rule.  The Identifier and Sequence fields will be sent after the SCHC rule.
      </t>
      <texttable>
        <ttcol>Field</ttcol><ttcol>FP</ttcol><ttcol>DI</ttcol><ttcol>Match Opera.</ttcol><ttcol>Comp Decomp Action</ttcol><ttcol></ttcol><ttcol>Sent [bits]</ttcol>
        <c> Type       </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c>      </c>
        <c> Code       </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c>      </c>
        <c> Checksum   </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> compute-checksum </c> <c> </c> <c>      </c>
        <c> Identifier </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> sent             </c> <c> </c> <c> [16] </c>
        <c> Sequence   </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> sent             </c> <c> </c> <c> [16] </c>

    </texttable>
   </section>   
   <section title="Router Solicitation SCHC compression"         anchor="sec_rsoln">
    <t>
    The Router Solicitation packet header is composed by:
        <list style="symbols">
           <t>
              Type: Type of message. Value: 0x85.
           </t>
           <t>
              Code: Always 0.
           </t>
           <t>
              Checksum: This field is composed by 2 Bytes where the values are caculated as defined on <xref target="RFC4443">RFC 4443</xref>
           </t>
           <t>
              Reserved: These 4 bytes have a 0 value.
           </t>
           <t>
              Option: This field corresponds to the MAC address.
           </t>
        </list>
          The most significant field is the MAC address of the network host. As mentioned on <xref target="RFC4861">RFC 4861</xref>, Router Solicitation should have a Link-Local Source Address and a Router Multicast Address which can be integrated after the packet decompression.
    </t>
    <texttable>
        <ttcol>Field</ttcol><ttcol>FP</ttcol><ttcol>DI</ttcol><ttcol>Match Opera.</ttcol><ttcol>Comp Decomp Action</ttcol><ttcol></ttcol><ttcol>Sent [bits]</ttcol>
        <c> Type                </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c>      </c>
        <c> Code                </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c>      </c>
        <c> Checksum            </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> compute-checksum </c> <c> </c> <c>      </c>
        <c> Reserved            </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c>      </c>
        <c> Option - type       </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c>      </c>
        <c> Option - length     </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> compute-length   </c> <c> </c> <c>      </c>
        <c> Option - link-layer </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> sent             </c> <c> </c> <c> [48] </c>

    </texttable>
   </section> 
   <section title="Router Advertisement SCHC compression"        anchor="sec_radvt">
    <t>
      The Router Advertisement packet header is composed by:
        <list style="symbols">
           <t>
              Type: Type of message. Value: 0x86.
           </t>
           <t>
              Code: Always 0.
           </t>
           <t>
              Checksum: This field is composed by 2 Bytes where they values are caculated as it is explained on <xref target="RFC4443">RFC 4443</xref>.
           </t>
           <t>
              Current Hop Limit: Because this is a star topology, the value MUST be set to 255.
           </t>
           <t>
              Autoconfig Flags: Depending on the router configuration, it will advertise if DHCP is allowed or not.
           </t>
           <t>
              Router Lifetime: This field indicates the time that the Router keeps the condition of default device.
           </t>
           <t>
              Reachable Time: Indicates to the host how much time a neighbour is considered reachable.
           </t>
           <t>
              Retransmission Timer: Indicates the delay that the host should have before transmission.
           </t>
           <t>
              Options: This field contains the MAC Address, MTU and the IPv6 Prefix of the network.
           </t>
        </list>
        The SCHC compression for Router Advertisement is designed to send the MAC address of the packet. Like the Echo message, the Type field can be represented in the SCHC rule.
    </t>
    <t>
      The Current Hop Limit, Autoconfig Flags, Lifetime Router, Reachable Time, and Retransmission Timer fields can be deleted if the host knows these values. The MTU of this packet can be elided and the IPv6 prefix helps the SCHC compression of the global address, omitting the first 8 bytes of the address.
    </t>
      <texttable>
        <ttcol>Field</ttcol><ttcol>FP</ttcol><ttcol>DI</ttcol><ttcol>Match Opera.</ttcol><ttcol>Comp Decomp Action</ttcol><ttcol></ttcol><ttcol>Sent [bits]</ttcol>
        <c> Type                        </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Code                        </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Checksum                    </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> compute-checksum </c> <c> </c> <c> </c>
        <c> Current Hop Limit           </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Autoconfig Flags            </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Router Lifetime             </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Reachable Time              </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Retransmission Timer        </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - type               </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - length             </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> compute-length   </c> <c> </c> <c> </c>
        <c> Option - link-layer         </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> sent             </c> <c> </c> <c> [48] </c>
        <c> Option - type               </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - length             </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - reserved           </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - MTU                </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - type               </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - length             </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - Flag               </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - Valid lifetime     </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - Preferred lifetime </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - reserved           </c> <c> 1 </c> <c> Bi </c> <c> equal  </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - prefix             </c> <c> 1 </c> <c> Bi </c> <c> ignore </c> <c> not sent         </c> <c> </c> <c> </c>
    </texttable>
   </section> 
   <section title="SCHC compression over Neighbor Solicitation"       anchor="sec_nsoln">
    <t>
      The Neighbor Solicitation packet header is composed by:
        <list style="symbols">
           <t>
              Type: Type of message. Value: 0x87.
           </t>
           <t>
              Code: Always 0.
           </t>
           <t>
              Checksum: This field is composed by 2 Bytes where the values are caculated as it is specified on <xref target="RFC4443">RFC 4443</xref>.
           </t>
           <t>
              Target Address: It contains the address to be resolved.
           </t>
           <t>
              Options: This field contains the MAC Address from the host.
           </t>
        </list>
        For SCHC compression over Neighbor Solicitation, the MAC address and the Target Address are the minimal fields for the transmision. If the Target address has a Link-Local value, the last 8 Bytes of the address are sent, otherwise, the full 16 Bytes are sent. The type field can be represented in the SCHC rule.
    </t>
    <texttable>
        <ttcol>Field</ttcol><ttcol>FP</ttcol><ttcol>DI</ttcol><ttcol>Match Opera.</ttcol><ttcol>Comp Decomp Action</ttcol><ttcol></ttcol><ttcol>Sent [bits]</ttcol>
        <c> Type                </c> <c> 1 </c> <c> Bi </c> <c> equal          </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Code                </c> <c> 1 </c> <c> Bi </c> <c> equal          </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Checksum            </c> <c> 1 </c> <c> Bi </c> <c> ignore         </c> <c> compute-checksum </c> <c> </c> <c> </c>
        <c> Target Address      </c> <c> 1 </c> <c> Bi </c> <c> match- mapping </c> <c> sent             </c> <c> </c> <c> link-local [64] global [128]</c>
        <c> Option - type       </c> <c> 1 </c> <c> Bi </c> <c> equal          </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - length     </c> <c> 1 </c> <c> Bi </c> <c> ignore         </c> <c> compute-length   </c> <c> </c> <c> </c>
        <c> Option - link-layer </c> <c> 1 </c> <c> Bi </c> <c> ignore         </c> <c> sent             </c> <c> </c> <c> [48] </c>
    </texttable>
   </section> 
   <section title="SCHC compression over Neighbor Advertisement"      anchor="sec_vadvt">
    <t>
      A Neighbor Advertisement is composed by:
        <list style="symbols">
           <t>
              Type: Type of message. Value: 0x88.
           </t>
           <t>
              Code: Is always 0.
           </t>
           <t>
              Checksum: This field is composed by 2 Bytes where the values are caculated as it is specified on <xref target="RFC4443">RFC 4443</xref>.
           </t>
           <t>
              Flags: Describes first if the device sending the packet is a router or a node, second if the packet is sent because it is a neighbor search response and third, if the receiver has to rewrite the host information.
           </t>
           <t>
              Target Address: If it is a reply of a Neighbor Solicitation request, it contains the same Target address, otherwise it will contain the address to be resolved.
           </t>
           <t>
              Options: If the packet source is a Multicast Neighbor Solicitation reply, the MAC is sent, otherwise it is elided.
           </t>
        </list>
        For the compression of SCHC in Neighbor Advertisement, the MAC address is sent if it is a Multicast neighborhood request response. If the Target address has a Link-Local value, the last 8 Bytes of the address will be sent, otherwise, the full 16 Bytes will be transmitted. If the Flags field is known by the host, it can be deleted. The Type field can be represented in the SCHC rule.
    </t>
    <texttable>
        <ttcol>Field</ttcol><ttcol>FP</ttcol><ttcol>DI</ttcol><ttcol>Match Opera.</ttcol><ttcol>Comp Decomp Action</ttcol><ttcol></ttcol><ttcol>Sent [bits]</ttcol>
        <c> Type                </c> <c> 1 </c> <c> Bi </c> <c> equal          </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Code                </c> <c> 1 </c> <c> Bi </c> <c> equal          </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Checksum            </c> <c> 1 </c> <c> Bi </c> <c> ignore         </c> <c> compute-checksum </c> <c> </c> <c> </c>
        <c> Flags               </c> <c> 1 </c> <c> Bi </c> <c> equal          </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Target Address      </c> <c> 1 </c> <c> Bi </c> <c> match- mapping </c> <c> sent             </c> <c> </c> <c> link-local [64] global [128] </c>
        <c> Option - type       </c> <c> 1 </c> <c> Bi </c> <c> equal          </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - length     </c> <c> 1 </c> <c> Bi </c> <c> ignore         </c> <c> not sent         </c> <c> </c> <c> </c>
        <c> Option - link-layer </c> <c> 1 </c> <c> Bi </c> <c> ignore         </c> <c> not sent         </c> <c> </c> <c> </c>

    </texttable>
   </section>
   <section title="LoRa Gateway tables" anchor="sec_gateway_tables">
    <t>
      (TODO)
    </t>
   </section>
   <!-- <section title="SCHC compression over Redirect"                    anchor="sec_redit">
   </section> -->
   <section title="Acknowledgments"                                  anchor="sec_acks">
      <t>
         
      </t>
      <t>
         This work is partially supported by 16STIC-08 STIC-AmSud PEACH Research Project. We would also like to thank the Red Snapper project for their support.
      </t> 
   </section>
</middle>
<back>
   <references title="Normative References">
      <!-- RFC 6TiSCH-->
      <!-- RFC others -->
      <?rfc include='reference.RFC.2119'?>       <!-- Key words for use in RFCs to Indicate Requirement Levels -->
      <!-- I-D 6TiSCH -->
      <!-- I-D others -->
      <!-- external -->
   </references>
   <references title="Internet Control Message Protocol (ICMPv6) for the Internet Protocol Version 6 (IPv6) Specification">
      <?rfc include='reference.RFC.4443'?>       <!-- Key words for use in RFCs to Indicate Requirement Levels -->
   </references>
   <references title="Neighbor Discovery for IP version 6 (IPv6)">
      <?rfc include='reference.RFC.4861'?>       <!-- Key words for use in RFCs to Indicate Requirement Levels -->
   </references>
   <references title="LPWAN Static Context Header Compression (SCHC) and fragmentation for IPv6 and UDP">
      <?rfc include='reference.I-D.toutain-lpwan-ipv6-static-context-hc'?>
   </references> 
</back>
</rfc>
