[P4-dev] Incremental checksum with v1model?

hemant at mnkcg.com hemant at mnkcg.com
Sun Feb 16 11:13:32 EST 2020

Hi Tom,

Regarding parsing TCP options, Andy has sample P4 code.  See

The update_checksum requires the length of input data to be a multiple of
output size.  A TCP option may be one octet long and mess up the multiple.
Once we have an update_checksum working for TCP options, p4c should
incorporate the code.  Clearly update_checksum is not working for TCP


-----Original Message-----
From: Tom Barbette <barbette at kth.se> 
Sent: Sunday, February 16, 2020 3:48 AM
To: hemant at mnkcg.com
Subject: Re: [P4-dev] Incremental checksum with v1model?

Hi Hemant!

Thanks but I'm looking at the incremental update. The problem is that we
have TCP options, which can appear at various places and, except if I'm
missing something, cannot be referenced with their correct 16 bit boundary
in the update_checksum, with all the possible placements. 
They're already a mess just to parse in the first place so...

So we're triyng to just "fix" the checksum according to the modifications.


Le 14/02/2020 à 17:28, hemant at mnkcg.com a écrit :
> https://github.com/harshgondaliya/BurstRadar/blob/master/burstradar.p4
> #L270
> Hemant
> -----Original Message-----
> From: P4-dev <p4-dev-bounces at lists.p4.org> On Behalf Of Tom Barbette
> Sent: Friday, February 14, 2020 9:43 AM
> To: p4-dev <p4-dev at lists.p4.org>
> Subject: [P4-dev] Incremental checksum with v1model?
> Hi all,
> Does anyone have an example of incremental checksum correction (in my 
> case for TCP) in P4 with the v1model? I know PSA has the 
> InternetChecksum.substract, but I'd like to run it with v1.
> I tried a few common tricks, but I have a one compilment's bug from 
> time to time.
> Thanks,
> Tom
> _______________________________________________
> P4-dev mailing list
> P4-dev at lists.p4.org
> http://lists.p4.org/mailman/listinfo/p4-dev_lists.p4.org
-------------- next part --------------
A non-text attachment was scrubbed...
Name: smime.p7s
Type: application/pkcs7-signature
Size: 1594 bytes
Desc: not available
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20200216/fd35b629/attachment.p7s>

More information about the P4-dev mailing list