Transmit on time stamp is configured through the NTAPI configuration stream.
Configuration parameters
Transmit on time stamp is configured per port using the function NT_ConfigWrite() with a NtConfigTransmitOnTimestamp_s structure. NtConfigTransmitOnTimestamp_s has the following members:
| Field | Description |
|---|---|
| portNo |
Specifies the port for which to configure transmit on time stamp. |
| data.timeDelta |
Specifies the delta in ns to add to time stamp before comparing to SmartNIC time. See Frame transmit condition for further explanation. |
| data.enable |
Enables transmit on time stamp.
|
| data.forceTxOnTs |
Forces transmit on time stamp, regardless of the To transmit PCAP frames on time stamp, set |
| data.timeDeltaAdjust |
Specifies the adjustment in ns to add to data.timeDelta
whenever a |
For the PCAP descriptor, which does not have a txNow bit,
txNow is considered set.
Time stamp formats
The following time stamp formats are supported:
| Descriptor | Time stamp format |
|---|---|
| Standard | Native Unix (10 ns) |
| Native Unix ns (1 ns) | |
| PCAP | PCAP-ns |
| PCAP-μs |
Program flow for setting up transmit on time stamp
The general program flow for setting up transmit on time stamp will look like this:
- Read the time stamp from the first frame and convert the value to ns.
- Read the SmartNIC time and convert the value to ns.
- Calculate
data.timeDelta: ∆ = SmartNIC time – first frame time stamp + additional offset. - Configure transmit on time stamp per port:
- Use a config stream with
NT_CONFIG_PARM_PORT_TRANSMIT_ON_TIMESTAMPparameters. - Set calculated
data.timeDelta. - Set
data.enableto enable the port for transmit on time stamp. - Set
data.forceTxOnTsto ignore thetxNowbit in packet descriptor (which is assumed set for PCAP).
- Use a config stream with
This program flow is illustrated in Example.
Program flow for replaying a capture file repeatedly
data.timeDeltaAdjust is useful for replaying a Napatech capture file
repeatedly without reconfiguring data.timeDelta at the start of each
replay. The program flow will look like this:- Read the time stamp from the first and the last frame and convert the values to ns.
- Read the SmartNIC time and convert the value to ns.
- Calculate the estimated transmission time for last frame in ns.
- Calculate
data.timeDeltaAdjust= last frame time stamp - first frame time stamp + estimated transmission time for last frame - Calculate
data.timeDelta: ∆ = SmartNIC time – first frame time + additional offset -data.timeDeltaAdjust. - Configure transmit on time stamp per port:
- Use a config stream with
NT_CONFIG_PARM_PORT_TRANSMIT_ON_TIMESTAMPparameters. - Set calculated
data.timeDelta. - Set calculated
data.timeDeltaAdjust. - Set
data.enableto enable the port for transmit on time stamp.
- Use a config stream with
- At the start of each replay, set
txSetClockfor the first frame, using the macro NT_NET_SET_PKT_TXSETCLOCK().