Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[Bug] regression with nanosecond timestamps #863

Closed
fklassen opened this issue Jun 2, 2024 · 1 comment
Closed

[Bug] regression with nanosecond timestamps #863

fklassen opened this issue Jun 2, 2024 · 1 comment
Assignees
Labels

Comments

@fklassen
Copy link
Member

fklassen commented Jun 2, 2024

Feature #796 introduced a feature that is not supported by older versions of `libpcap. Need to detect and support older versions.

To Reproduce
Steps to reproduce the behavior:

  1. In my dev environment I start an older bigendian ppc image and compile. It fails.

Expected behavior
Expect build to work, and that timestamps are properly handled throught the system.

System (please complete the following information):

  • OS: Linux
  • OS version: PPC
  • Tcpreplay Version 4.5.0
@fklassen fklassen self-assigned this Jun 2, 2024
fklassen added a commit that referenced this issue Jun 2, 2024
Add macros that can properly convert between PCAP timestamps and timespec/timeval.

We still use pcap_open_offline() for tcprewrite.c, otherwise tests fail because timestamps get written inconsistently across libpcap versions.

Also fix multiplier calculation error.
fklassen added a commit that referenced this issue Jun 2, 2024
Add macros that can properly convert between PCAP timestamps and timespec/timeval.

We still use pcap_open_offline() for tcprewrite.c, otherwise tests fail because timestamps get written inconsistently across libpcap versions.

Also fix multiplier calculation error.
fklassen added a commit that referenced this issue Jun 3, 2024
Also fix intermittent test failure in TOS test. It seems there is a memory alignment issue.
fklassen added a commit that referenced this issue Jun 3, 2024
Add macros that can properly convert between PCAP timestamps and timespec/timeval.

We still use pcap_open_offline() for tcprewrite.c, otherwise tests fail because timestamps get written inconsistently across libpcap versions.

Also fix multiplier calculation error.
@fklassen
Copy link
Member Author

fklassen commented Jun 3, 2024

fixed in PR #865

@fklassen fklassen closed this as completed Jun 3, 2024
@fklassen fklassen added the bug label Jun 3, 2024
@github-project-automation github-project-automation bot moved this to Done in 4.5 Aug 27, 2024
TheSableCZ pushed a commit to CESNET/FlowTest that referenced this issue Sep 10, 2024
Recently new version of tcpreplay was released[1].
This version now uses nanosecond timestamp precision[2][3]
instead of microsecond precision.

However, function datetime.datetime.fromisoformat() in
Python up to 3.10 doesn't accept this format and fails with
following error:

  tools/ft-orchestration/src/generator/tcpreplay.py:262: in stats
      start_time = datetime.datetime.fromisoformat(start_time)
  E   ValueError: Invalid isoformat string: '1970-01-01 01:16:52.837054314'

This commit fixes the issue by cropping nanosecond precision back to
microsecond precision.

Another solution would be to upgrade to Python 3.11, where
fromisoformat() accepts nanosecond precision (even though it
internally crops it back to microseconds).

[1] https://github.com/appneta/tcpreplay/releases/tag/v4.5.1
[2] appneta/tcpreplay#796
[3] appneta/tcpreplay#863
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Status: Done
Development

No branches or pull requests

1 participant