<html>
  <head>
    <meta content="text/html; charset=utf-8" http-equiv="Content-Type">
  </head>
  <body bgcolor="#FFFFFF" text="#000000">
    Thank you all for your feedback,<br>
    <br>
    let's think for a moment of a protocol that needs to check a trailer
    field, and so that needs to skip a considerable portion of the
    packet (e.g., the upper layer payload), what does the P4 programmer
    do? Does he define dummy header for extracting the payload? I know
    that "extracting" at such a high level could mean many things, but
    imho still the language syntax is a bit counterintuitive if you keep
    such construct. <br>
    <br>
    I don't want to discuss the protocol I'm working on, because it is a
    research idea that is not running on any real device. So, I've
    quickly selected an existing protocol that could generate the same
    issue, that is, the Encapsulating Security Payload (ESP), to start
    brainstorming on.<br>
    <br>
    I will also try to write out the parsing of IPv6 extension headers,
    because I guess this is something needed even there. Have you
    already thought about those?<br>
    <br>
    Best,<br>
    Salvatore<br>
    <br>
    <br>
    <br>
    <br>
    <div class="moz-cite-prefix">On 08/03/2015 08:22 PM, Mihai Budiu
      wrote:<br>
    </div>
    <blockquote
cite="mid:CA+JRXb5KDNYqJA+6sWbZaXm4oRL1hUvBUrFNnoJaUm81=Kma4A@mail.gmail.com"
      type="cite">
      <meta http-equiv="Content-Type" content="text/html; charset=utf-8">
      <div dir="ltr">Today this is the only mechanism to read a
        non-constant number of bytes (i.e., which depends on header
        data).
        <div><br>
        </div>
        <div>Mihai</div>
      </div>
      <div class="gmail_extra"><br>
        <div class="gmail_quote">On Mon, Aug 3, 2015 at 11:16 AM, Gordon
          Brebner <span dir="ltr"><<a moz-do-not-send="true"
              href="mailto:Gordon.Brebner@xilinx.com" target="_blank">Gordon.Brebner@xilinx.com</a>></span>
          wrote:<br>
          <blockquote class="gmail_quote" style="margin:0 0 0
            .8ex;border-left:1px #ccc solid;padding-left:1ex">
            <div link="#0563C1" vlink="#954F72" lang="EN-US">
              <div>
                <p class="MsoNormal"><span style="color:#1f497d">I think
                    that a generic “skip n bytes” operation can be done
                    using a header with a single field of * width and a
                    length expression to compute the desired n.<span>  </span>
                    Is this correct?</span></p>
                <p class="MsoNormal"><span style="color:#1f497d"> </span></p>
                <p class="MsoNormal"><span style="color:#1f497d">Gordon.</span></p>
                <p class="MsoNormal"><span style="color:#1f497d"> </span></p>
                <p class="MsoNormal"><span style="color:#1f497d"> </span></p>
                <div>
                  <div style="border:none;border-top:solid #e1e1e1
                    1.0pt;padding:3.0pt 0in 0in 0in">
                    <p class="MsoNormal"><b><span>From:</span></b><span>
                        P4-dev [mailto:<a moz-do-not-send="true"
                          href="mailto:p4-dev-bounces@p4.org"
                          target="_blank">p4-dev-bounces@p4.org</a>]
                        <b>On Behalf Of </b>LJ Wobker<br>
                        <b>Sent:</b> Monday, August 03, 2015 11:08 AM<br>
                        <b>To:</b> Salvatore Signorello; <a
                          moz-do-not-send="true"
                          href="mailto:p4-dev@p4.org" target="_blank">p4-dev@p4.org</a><br>
                        <b>Subject:</b> Re: [P4-dev] move parser pointer
                        forward</span></p>
                  </div>
                </div>
                <p class="MsoNormal"> </p>
                <p>That's correct - there is no explicit "skip"
                  functionality in the parser.  Think of the parse tree
                  as a continuous graph that walks through the incoming
                  bytestream in order: there are no gaps.  As Mihai
                  suggests, you can always just use a dummy header field
                  for bytes that you don't care about, although I would
                  contend that in most cases it will make more sense to
                  just parse the header with a meaningful name. 
                </p>
                <p> </p>
                <p>Let us consider a contrived case such as: RTP in UDP
                  in ipv4 in ethernet.  Let's further assume (again,
                  contrived) that you know you absolutely do not need to
                  parse any of the specific fields within the UDP
                  header, but you need/want to be able to get to the RTP
                  headers underneath.</p>
                <p> </p>
                <p>You could easily build a parse tree/header definition
                  that treats the entire UDP header as one field,
                  instead of the component fields.  This might or might
                  not be simpler/easier/faster/cheaper for a given
                  target or compiler to handle, and it might (or might
                  not!) be more convenient for the P4 programmer. </p>
                <p> </p>
                <p>Original UDP header format from <a
                    moz-do-not-send="true"
href="https://github.com/p4lang/p4factory/blob/master/targets/switch/p4src/includes/headers.p4"
                    target="_blank">
p4factory/master/targets/switch/p4src/includes/headers.p4</a></p>
                <p style="text-align:center" align="center"> </p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:"Courier
                    New";color:black">header_type udp_t {</span></p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:"Courier
                    New";color:black">    fields {</span></p>
                <p class="MsoNormal"><b><span
                      style="font-size:10.0pt;font-family:"Courier
                      New";color:black">        srcPort : 16;</span></b></p>
                <p class="MsoNormal"><b><span
                      style="font-size:10.0pt;font-family:"Courier
                      New";color:black">        dstPort : 16;</span></b></p>
                <p class="MsoNormal"><b><span
                      style="font-size:10.0pt;font-family:"Courier
                      New";color:black">        length_ : 16;</span></b></p>
                <p class="MsoNormal"><b><span
                      style="font-size:10.0pt;font-family:"Courier
                      New";color:black">        checksum : 16;</span></b></p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:"Courier
                    New";color:black">    }</span></p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:"Courier
                    New";color:black">}</span></p>
                <p> </p>
                <p>Modified/ simpler version as described:</p>
                <p> </p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:"Courier
                    New";color:black">header_type udp_t {</span></p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:"Courier
                    New";color:black">    fields {</span></p>
                <p class="MsoNormal"><b><span
                      style="font-size:10.0pt;font-family:"Courier
                      New";color:black">        meaningless_blob :
                      64;</span></b></p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:"Courier
                    New";color:black">    }</span></p>
                <p class="MsoNormal"><span
                    style="font-size:10.0pt;font-family:"Courier
                    New";color:black">}</span></p>
                <p> </p>
                <p> </p>
                <p>So that’s probably a longer answer than you really
                  needed, but I figured I’d write it out for posterity.</p>
                <p> </p>
                <p> </p>
                <p>--lj        </p>
                <p> </p>
                <p> </p>
                <p> </p>
                <p> </p>
                <p> </p>
                <p>-----Original Message-----<br>
                  From: P4-dev [mailto:<a moz-do-not-send="true"
                    href="mailto:p4-dev-bounces@p4.org" target="_blank">p4-dev-bounces@p4.org</a>]
                  On Behalf Of Salvatore Signorello<br>
                  Sent: Monday, August 03, 2015 10:01 AM<br>
                  To: <a moz-do-not-send="true"
                    href="mailto:p4-dev@p4.org" target="_blank">p4-dev@p4.org</a><br>
                  Subject: [P4-dev] move parser pointer forward</p>
                <p> </p>
                <p>Hi all,</p>
                <p> </p>
                <p>could someone confirm that the actual specification
                  doesn't provide any
                </p>
                <p>construct to advance the parsing pointer except the
                  "extract" one?</p>
                <p> </p>
                <p>Is it possible to skip the parsing of some fields
                  without defining and
                </p>
                <p>extracting a header including them?</p>
                <p> </p>
                <p>Best,</p>
                <p>Salvatore</p>
                <p> </p>
                <p> </p>
                <p> </p>
                <p> </p>
                <p> </p>
                <p>_______________________________________________</p>
                <p>P4-dev mailing list</p>
                <p><a moz-do-not-send="true" href="mailto:P4-dev@p4.org"
                    target="_blank"><span
                      style="color:windowtext;text-decoration:none">P4-dev@p4.org</span></a></p>
                <p>Listinfo - <a moz-do-not-send="true"
                    href="http://mail.p4.org/mailman/listinfo/p4-dev_p4.org"
                    target="_blank">
                    <span style="color:windowtext;text-decoration:none">http://mail.p4.org/mailman/listinfo/p4-dev_p4.org</span></a></p>
                <p>Archives - <a moz-do-not-send="true"
                    href="http://mail.p4.org/pipermail/p4-dev_p4.org/"
                    target="_blank">
                    <span style="color:windowtext;text-decoration:none">http://mail.p4.org/pipermail/p4-dev_p4.org/</span></a></p>
              </div>
              <br>
              <br>
              This email and any attachments are intended for the sole
              use of the named recipient(s) and contain(s) confidential
              information that may be proprietary, privileged or
              copyrighted under applicable law. If you are not the
              intended recipient, do not read, copy, or forward this
              email message or any attachments. Delete this email
              message and any attachments immediately.
              <br>
              <br>
            </div>
            <br>
            _______________________________________________<br>
            P4-dev mailing list<br>
            <a moz-do-not-send="true" href="mailto:P4-dev@p4.org">P4-dev@p4.org</a><br>
            Listinfo - <a moz-do-not-send="true"
              href="http://mail.p4.org/mailman/listinfo/p4-dev_p4.org"
              rel="noreferrer" target="_blank">http://mail.p4.org/mailman/listinfo/p4-dev_p4.org</a><br>
            Archives - <a moz-do-not-send="true"
              href="http://mail.p4.org/pipermail/p4-dev_p4.org/"
              rel="noreferrer" target="_blank">http://mail.p4.org/pipermail/p4-dev_p4.org/</a><br>
          </blockquote>
        </div>
        <br>
      </div>
    </blockquote>
    <br>
  </body>
</html>