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] Incoherent timestamps in packtcapture service #295

Closed
FedeParola opened this issue Apr 29, 2020 · 3 comments
Closed

[BUG] Incoherent timestamps in packtcapture service #295

FedeParola opened this issue Apr 29, 2020 · 3 comments
Labels
bug Something isn't working

Comments

@FedeParola
Copy link
Collaborator

Describe the bug

Packets captured with the packetcapture service form two completely different timestamp sequences.

To Reproduce

Run the following script:

sudo ip netns del ns1 1>/dev/null 2>&1
sudo ip netns del ns2 1>/dev/null 2>&1
sudo ip link del veth1 1>/dev/null 2>&1
sudo ip link del veth2 1>/dev/null 2>&1

sudo ip netns add ns1
sudo ip link add veth1 type veth peer name veth1_
sudo ip link set veth1_ netns ns1
sudo ip link set veth1 up
sudo ip netns exec ns1 ip addr add 10.0.0.1/24 dev veth1_
sudo ip netns exec ns1 ip link set veth1_ up

sudo ip netns add ns2
sudo ip link add veth2 type veth peer name veth2_
sudo ip link set veth2_ netns ns2
sudo ip link set veth2 up
sudo ip netns exec ns2 ip addr add 10.0.0.2/24 dev veth2_
sudo ip netns exec ns2 ip link set veth2_ up

polycubectl helloworld add hw1
polycubectl hw1 ports add veth1 peer=veth1
polycubectl hw1 ports add veth2 peer=veth2
polycubectl hw1 set action=forward
polycubectl packetcapture add pc1
polycubectl pc1 set capture=bidirectional
polycubectl pc1 set filter="all"
polycubectl attach pc1 hw1:veth1

Generate some packets with ping command and inspect the capture.

Expected behavior

Timestamps should all be in sequence.

Additional context

This is probably related to the fact that some timestamps are retrieved from skb and others with pcn_ktime_get_ns().

@FedeParola FedeParola added the bug Something isn't working label Apr 29, 2020
@riccardo-rusca
Copy link
Contributor

Hi @FedeParola

I've tried to reproduce this bug, so I've run your script and then I run a ping command
sudo ip netns exec ns1 ping 10.0.0.2 -c 5

I've also tried to repeat all the procedure 3 times and all the time the capture is fine, also capturing more traffic with multiple ping

Maybe can you add a picture of your wrong capture to understand better the problem?

This is the one of the captures:

Schermata da 2020-05-01 13-12-29

@riccardo-rusca
Copy link
Contributor

The timestamp in CubeType::XDP_DRV or CubeType::XDP_SKB are all retrieved with pcn_ktime_get_ns()
While in CubeType::TC timestamp are all retrieved with ctx->tstamp , only if ctx->tstamp == 0 the timestamp are retrieved with pcn_ktime_get_ns()

@FedeParola
Copy link
Collaborator Author

Mmmh I've just tried to replicate the problem again and this time everything is fine...
The other day some of the packets had timestamps completely different from the others but unfortunately I didn't take a screenshot.
I will open a new issue if I experience the problem again, paying more attention to my configuration.
Apologize for wasting you time.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
bug Something isn't working
Projects
None yet
Development

No branches or pull requests

2 participants