Hi,
I have a question on MRI exercise in tutorial repository. By default, the exercise uses UDP protocol, everything works fine. I want to change UDP protocol to TCP protocol for experimental purpose, so I’ve just only modified the code of send.py and receive.py a little bit
send.py
pkt = Ether(src=get_if_hwaddr(iface), dst="ff:ff:ff:ff:ff:ff") / IP(
dst=addr, options = IPOption_MRI(count=0,
swtraces=[])) / TCP(
dport=1234, sport=random.randint(49152,65535)) / sys.argv[2]
receive.py
def handle_pkt(pkt):
if TCP in pkt and pkt[TCP].dport == 1234:
print("got a packet")
pkt.show2()
# hexdump(pkt)
sys.stdout.flush()
def main():
ifaces = [i for i in os.listdir('/sys/class/net/') if 'eth' in i]
iface = ifaces[0]
print("sniffing on %s" % iface)
sys.stdout.flush()
sniff(iface = iface,
prn = lambda x: handle_pkt(x))
I run the exercise again, send 1 packet from h1 to h2. On h2’s xterm window, the packet is successfully received
But in Wireshark, there’s just only a SYN packet generated from h1
I’ve check all other interfaces of switches, there’s no SYN/ACK or ACK generated back from h2.
Do I also need to modified the p4 code to parse tcp header so that TCP protocol can function properly, because with UDP, there’s no need to do that?
Thank you!