Hello,
I was trying to modify the MRI tutorial in P4tutorials to dock more headers and INT information, but after compiling and modifying send.py and receive.py as well, the receive.py couldn`t sniff nor show the packet with the new INT headers.
To exemplify:
I tried to include the packet_length metada in the switch trace header. I included the typedef in the mri.p4 code:
typedef bit<9> egressSpec_t;
typedef bit<48> macAddr_t;
typedef bit<32> ip4Addr_t;
typedef bit<32> switchID_t;
typedef bit<32> qdepth_t;
typedef bit<32> packet_length_t;header switch_t {
switchID_t swid;
qdepth_t qdepth;
packet_length_t packet_length;
}
After that, on ***EGRESS PROCESSING **** I included the following code line:
hdr.swtraces[0].packet_length = (packet_length)standard_metadata.deq_qdepth;
Finally I modify the class SwitchTrace in receive.py and send.py
class SwitchTrace(Packet):
fields_desc = [ IntField(“swid”, 0),
IntField(“qdepth”, 0),
IntField(“packet_length”, 0)]
def extract_padding(self, p):
return “”, p
After I run make in mri directory, I run mininet and xterm h1 and h2. I run send.py in h1 and receive.py in h2. Unfortunately, h2 don`t sniff any package at all. Why this is happening?