0

I'm using SOF_TIMESTAMPING_TX_SOFTWARE to get higher accuracy on the transmission times of my packets. I'm receiving the packets looped back on the error queue. I don't have any problems retrieving the ancillary timing record. But I'm not clear on the format of the packet data that gets looped back to me. It's more than just the packet I transmitted.

I see my packet data prefixed by an IP header. That much makes sense. But there are 6 bytes preceding the IP header that I can't make heads or tails out of. I presume there's a "struct something" somewhere that defines it. Does anyone have any idea what those 6 bytes are?

  • There's an ethernet header before the IP header, but that's larger than 6 bytes. Can you show the hex dump of those 6 bytes? – Barmar Jun 28 '19 at 00:08
  • See https://en.wikipedia.org/wiki/Ethernet_frame – Barmar Jun 28 '19 at 00:08
  • Yes, it looks like the last 4 bytes of the source MAC address and the Ethertype. So it could be the last 6 bytes of an Ethernet frame since it's not a tagged interface. Maybe that's why it's only 6 bytes. If it were a tagged interface that would be the tag and the Ethertype. As it is it's just strange.... – R. Mongiovi Jun 28 '19 at 14:02
  • Ahah, maybe. I found a Linux API document that describes a flag to "request the NIC to treat the last 4 bytes as Ethernet Frame Check Sequence (FCS)." So that would make the 6 mystery bytes an FCS plus the Ethertype. – R. Mongiovi Jun 28 '19 at 14:06

1 Answers1

0

Ok. It was some bad code on my part. Here's what I see using a RAW socket.

Normal ICMPv4 packets being read are an IPv4 header, ICMPv4 header, and payload. The looped ERRQUEUE ICMPv4 packets are Ethernet header, IPv4 header, ICMPv4 header, payload. Normal ICMPv6 packets are just ICMPv6 header and payload, no IPv6 header. Looped ERRQUEUE ICMPv6 packets are Ethernet header, IPv6 header, ICMPv6 header, payload.

Gotta love consistency.