inet icon indicating copy to clipboard operation
inet copied to clipboard

pcapng wrong timestamp at TsnSwitch

Open andrew-lukin opened this issue 1 year ago • 1 comments

Platform

  • OMNeT++ version: 6.0.3
  • OS: Xubuntu 20.04
  • INET: 4.5.2

I'm trying to check residence time for TsnSwitch node with pcapng analysis. For this I'm using a simple network with source(TsnDevice) then switch(TsnSwitch) then sink(TsnDevice). I'm recording all the interfaces of a switch into one file. As the result, I'm experiencing the same Arrival time in pcapng files for inbound and outbound packets. So, outbound packets are timestamped with inbound's Arrival time. Then, a check of a correspondent packet timestamp on the sink side shows a proper value, which includes the switch's residence time.

I'm expecting to see smth like this: source eth0 time: 0.000000 switch eth0 time: 0.000006 switch eth1 time: 0.000013 sink eth0 time: 0.000013

but what I get instead: source eth0 time: 0.000000 switch eth0 time: 0.000006 switch eth1 time: 0.000006 sink eth0 time: 0.000013

For EthernetSwitch and StandardHost type nodes everything works as expected, for instance.

I'm using the following configuration for pcapng capturing:

**.crcMode = "computed"
**.fcsMode = "computed"
**.recordPcap = true

**.fileFormat = "pcapng"
**.numPcapRecorders = 1

*.source1.pcapRecorder[*].pcapFile = "results/source1.pcapng"
*.sink1.pcapRecorder[*].pcapFile = "results/sink1.pcapng"
*.switch1.pcapRecorder[*].pcapFile = "results/switch1.pcapng"

It could be added to inet4.5/showcases/tsn/timesynchronization/clockdrift/omnetpp.ini, for instance, with the same result.

andrew-lukin avatar May 23 '24 10:05 andrew-lukin

There's a difference between how StandardHost/EthernetSwitch and TsnDevice/TsnSwitch records PCAPng files. The former records the TX end and RX start timestamps. The latter records the TX start and RX start timestamps. In your case the TX start equals with RX end for all packets processed by the switch. The difference comes that you see comes from the different operation of the above mentioned modules.

I'm not sure what to do with this. Ideally they should work the same way, or at least let the user chose what timestamp to record. I'll come back to this.

levy avatar May 27 '24 13:05 levy