I'm looking to generate VxLAN packets via the stateless python API, and am unable to generate packets with a varied inner packet UDP header that has a valid checksum, since the only vm instruction class I could find which provides a fix to the UDP checksum is the STLVmFixChecksumHw class, however, my HW does not support fixing the inner packet's checksum.
As I cannot use the STLVmFixChecksumHw class to fix the checksum, I'm looking for an alternate. Is there a SW based UDP checksum fixer class?
If not, how can I manipulate the STL VM framework so that I can calculate it manually and update it?
Here is my code for the VM:
vm = STLScVmRaw([
STLVmFlowVar(name="inner_udp_src_port",
min_value=self.innerUdpSrcPortRangeLow,
max_value=self.innerUdpSrcPortRangeHigh,
size=2, op="inc"),
STLVmWrFlowVar(fv_name="inner_udp_src_port",
pkt_offset="UDP:1.sport"),
STLVmFixChecksumHw(l3_offset="IP:1",
l4_offset="UDP:1",
l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP),
STLVmFlowVar(name="vxlan_entropy_src_port",
min_value=self.outerUdpSrcPortRangeLow,
max_value=self.outerUdpSrcPortRangeHigh,
size=2, op="inc"),
STLVmWrFlowVar(fv_name="vxlan_entropy_src_port",
pkt_offset="UDP.sport"),
STLVmFixChecksumHw(l3_offset="IP",
l4_offset="UDP",
l4_type=CTRexVmInsFixHwCs.L4_TYPE_UDP),
])
Note, that the checksum is properly fixed for the outer packet, but not for the inner packet, as my HW does not support a fix checksum offload for the inner packet.
During the Trex run, I get the following warning:
"WARNING: No IP underlayer to compute checksum. Leaving null."
Here is a tcpdump sampling of a packet generated:
tcpdump: listening on ens1f0, link-type EN10MB (Ethernet), capture size 262144 bytes
16:41:55.214958 24:8a:07:ad:7a:fa > 50:6b:4b:d5:57:fe, ethertype IPv4 (0x0800), length 196: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto UDP (17), length 182)
70.70.70.6.1025 > 70.70.70.5.4789: [udp sum ok] VXLAN, flags [I] (0x08), vni 0
e4:11:22:06:00:00 > e4:11:22:05:00:00, ethertype IPv4 (0x0800), length 146: (tos 0x0, ttl 64, id 1, offset 0, flags [none], proto UDP (17), length 132, bad cksum 0 (->6d5b)!)
1.1.6.6.1052 > 1.1.5.6.1025: [bad udp cksum 0x0d8f -> 0xf2b8!] UDP, length 104
0x0000: 506b 4bd5 57fe 248a 07ad 7afa 0800 4500
0x0010: 00b6 0001 0000 4011 619f 4646 4606 4646
0x0020: 4605 0401 12b5 00a2 1342 0800 0000 0000
0x0030: 0000 e411 2205 0000 e411 2206 0000 0800
0x0040: 4500 0084 0001 0000 4011 0000 0101 0606
0x0050: 0101 0506 041c 0401 0070 0d8f 6162 6364
0x0060: 6566 6768 696a 6b6c 6d6e 6f70 7172 7374
0x0070: 7576 7778 797a 4142 4344 4546 4748 494a
0x0080: 4b4c 4d4e 4f50 5152 5354 5556 5758 595a
0x0090: 6162 6364 6566 6768 696a 6b6c 6d6e 6f70
0x00a0: 7172 7374 7576 7778 797a 4142 4344 4546
0x00b0: 4748 494a 4b4c 4d4e 4f50 5152 5354 5556
0x00c0: 5758 595a
1 packet captured
1 packet received by filter
0 packets dropped by kernel
--
You received this message because you are subscribed to the Google Groups "TRex Traffic Generator" group.
To unsubscribe from this group and stop receiving emails from it, send an email to trex-tgn+u...@googlegroups.com.
To post to this group, send email to trex...@googlegroups.com.
To view this discussion on the web visit https://groups.google.com/d/msgid/trex-tgn/e799b74a-c85a-4eb0-96d6-a7a3aba65cdb%40googlegroups.com.
For more options, visit https://groups.google.com/d/optout.