[P4-dev] Checksum calculation in Ingress or Egress rather than computerchecksum()

Rajasekhar Chaganti rajasekhar.chaganti at gmail.com
Sun May 31 23:43:20 EDT 2020


Hello,

I am working on parsing the tcp packets based on the flags and modify the
tcp header fields before sending it out to egress port. I was having
difficulties to use the checksum calculation in the computerchecksum() of
the switch as per the V1Switch semantics, as i have to defined multiple
update_checksum functions based on the flags and not seems to useful for
checksum calculation in  computerchecksum(). I was trying to implement to
checksum calculator in match and actions() of ingress or egress module of
the P4 V1 Switch. However, i could not find a way of doing it , as i dont
see any checksum function in v1model.p4 library that can be used in
ingress() or egress().

Can you please provide any insights on how to perform  or someone get
succeed of calculating the checksum in ingress() or egree(); or any other
way of doing this that i am aware of in P4 16 version?


Thanks
Raj Chagant



On Sun, May 31, 2020 at 8:26 PM Rajasekhar Chaganti <
rajasekhar.chaganti at gmail.com> wrote:

> Hello,
>
> I am working on parsing the tcp packets based on the flags and modify the
> tcp header fields before sending it out to egress port. I was having
> difficulties to use the checksum calculation in the computerchecksum() of
> the switch as per the V1Switch semantics, as i have to defined multiple
> update_checksum functions based on the flags and not seems to useful for
> checksum calculation in  computerchecksum(). I was trying to implement to
> checksum calculator in match and actions() of ingress or egress module of
> the P4 V1 Switch. However, i could not find a way of doing it , as i dont
> see any checksum function in v1model.p4 library that can be used in
> ingress() or egress().
>
> Can you please provide any insights on how to perform  or someone get
> succeed of calculating the checksum in ingress() or egree(); or any other
> way of doing this that i am aware of in P4 16 version?
>
>
> Thanks
> Raj Chaganti
>
-------------- next part --------------
An HTML attachment was scrubbed...
URL: <http://lists.p4.org/pipermail/p4-dev_lists.p4.org/attachments/20200531/97dfe5d9/attachment.html>


More information about the P4-dev mailing list