P4学习:统计功能
https://www.cnblogs.com/soul-stone/p/9029480.html 基于behavioral-model的simple_route测试统计功能: 1、直接关联统计,这种方式可以工作: // this counter can work!! counter count_lpm_match { type : packets_and_bytes; direct : ipv4_lpm; } table ipv4_lpm { reads { ipv4.dstAddr : lpm; } actions { set_nhop; _drop; } size: 1024; } action set_dmac(dmac) { modify_field(ethernet.dstAddr, dmac); } // this counter can work!! counter count_pkt_fwd { type : packets_and_bytes; direct : fwd_set_dmac; } table fwd_set_dmac { reads { routing_metadata.nhop_ipv4 : exact; } actions { set_dmac; _drop; } size: 512; } 2、table方式,启动失败 #define MAX