[P4-dev] does P4 support get timestamp and create msg
Jeferson Santiago da Silva
eng.jefersonsantiago at gmail.com
Sat May 13 20:21:38 EDT 2017
Date: Thu, 29 Dec 2016 07:49:02 +0000
> From: sundekui <sundekui at huawei.com>
> To: "p4-dev at lists.p4.org" <p4-dev at lists.p4.org>
> Cc: "Wuwenfu Wu(Wenfu)" <wuwenfu at huawei.com>, "Zhouhan (Joe)"
> <joe.zhouhan at huawei.com>
> Subject: [P4-dev] does P4 support get timestamp and create msg
> <EF69D35496B9DD429EDCAA2577AF664F52D91C at szxeml557-mbx.china.
> Content-Type: text/plain; charset="us-ascii"
> Current I am doing research on P4. I have several questions as following:
> 1. I want to get the timestamp when packets arrive and store it into
> register. For example, for a specified entry, I need to record/update the
> timestamp into the register when packet arrive. In other words the
> according register always stores the arrived time for the latest packet. I
> can't find any timestamp related actions but in p4 spec(1.0.3) I see the
> timestamp keyword(in page10, section 2.2). I guess this can be realized.
> But how to get the timestamp?
> P4 offers no native support for timestamping. It is totally
target-dependent. However, if you are using as target the behavior-model,
there is an intrinsic metadata ingress_global_timestamp accessible in P4.
> 2. How to create totally new msg and send to controller? For example,
> for a specified entry, when the packet count or byte count exceeds a
> number, I want to create a msg and send to controller. I guess if I can
> create msg, I can simply set dest of the msg to controller ip addr and
> output it just like common packet. But how to create totally new msg?
The same here. There is no way in P4 to generate packets in the datapath
element. However, you could try to clone a regular incoming packet to the
CPU port. I haven't tried to modify the content a cloned packet though.
Check it out!
> 3. I see that P4 frontend complier use thrift. So it means the api
> module generated by complier can be located on other location. And app can
> use the api and api to add/modify entry via ip network. Am I correct?
Cannot help here :(.
> Anyone can help me?
> Tony Sun
A recommendation: try to use P4-16.
I also recommend a nice article by Mihai Budiu from Vmware:
Jeferson Santiago da Silva, M.Sc.
Ph.D. Candidate in Computer Engineering
Hardware and Programmable Logic Design Engineer
Phone: +1 (514) 581-1004
Montreal/QC - Canada
Lattes CV: http://lattes.cnpq.br/9568850258686622
-------------- next part --------------
An HTML attachment was scrubbed...
More information about the P4-dev