Closed qwe131829 closed 4 years ago
setVlan enables VLAN offloading for this packet, QinQ handling is probably highly specific to the hardware. getEthernetQinQpacket
is probably the better/more portable way here
I also think it is possible, but I cannot accept catching this packert after adding setVlan by TCP dump.
Recently, I need to construct a message with a double-layer vlan for testing. I try to modify pktgen, using setVlan function to construct vlan packet based on udp with X710. However, through wireshark analysis, it is found that type is still ip4,0x800, with vlan missing in the middle. Is there anything need to be modified or is there something wrong with the thinking? If I want to construct QINQ based on this, can I only use getEthernetQinQpacket () to add header?
function txSlave(queue, dstMac) -- memory pool with default values for all packets, this is our archetype local mempool = memory.createMemPool(function(buf) buf:getUdpPacket():fill{ -- fields not explicitly set here are initialized to reasonable defaults ethSrc = queue, -- MAC of the tx device ethDst = dstMac, ip4Src =SRC_IP, ip4Dst = "2.2.2.2", udpSrc = SRC_PORT, udpDst = DST_PORT, pktLength = PKT_LEN } buf:setVlan(1234) -- buf:dump() end)