[P4-dev] Craft special packet, different from the one received

cs.lev cs.lev at gmx.com
Sat Oct 13 06:16:49 EDT 2018


I was wondering whether it is possible to craft a packet (not
necessarily from scratch) upon receiving another one?

In other words, assume I define in my P4 application the following
header types:

I receive a packet with headerA and headerB (but no other headers), and
in response I would like to send back a packet with only headerC and
headerD. Is it feasible?

I am playing with it, but is seems that since I do not parse
(correctly) headerC and headerD upon receiving the packet with only
headerA and headerB, any setting/manipulation (e.g., crafting) to
headerC and headerD does not/cannot work.
However, compiler does not drop any error, but packet with such headers
are not emitted in the deparser phase.


More information about the P4-dev mailing list