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

Send Packets while caculate RTT #919

Open
missyoyo opened this issue May 11, 2023 · 3 comments
Open

Send Packets while caculate RTT #919

missyoyo opened this issue May 11, 2023 · 3 comments

Comments

@missyoyo
Copy link

missyoyo commented May 11, 2023

Hello:
I see pkt-gen.c source code can caculate RTT,So I have do some test. I have one PC use two igc(2.5Gbps NIC).
pkt-gen -i netmap:igc1 -f tx -B
pkt-gen -i netmap:igc2 -f rx -B
I can get line-rate when use pkt-gen, That is very good.
486.572591 main_thread [2704] 2.053 Mpps (2.055 Mpkts 2.497 Gbps in 1000994 usec) 39.59 avg_batch 704 min_space
But I want caculate RTT when do this test. So I have ping on igx1 and pong on igc2(new windows, new command).
When I use low send rate, seems works
200.095 Kpps (200.466 Kpkts 243.316 Mbps in 1001854 usec)
I get RTT:
count 231232 RTT: min 27489 av 461857962 ns[462ms seems very large latency but still works]
When I try higher speed,eg:1.001 Mpps (1.002 Mpkts 1.217 Gbps in 1001762 usec),I get PING message
089.904221 ping_body [1364] -- ouch, cannot send
089.904224 ping_body [1364] -- ouch, cannot send
089.904378 ping_body [1364] -- ouch, cannot send
089.904393 ping_body [1364] -- ouch, cannot send
092.906539 ping_body [1397] poll error on queue 0: timeout
095.907572 ping_body [1397] poll error on queue 0: timeout
104.955080 ping_body [1397] poll error on queue 0: timeout

So,May I know,is it possibole to keep high send speed can still can caculate RTT?

@jbrandeb
Copy link

The receiver is probably dropping some or a lot of the frames you're sending. The test you're running is a unidirectional flood. This is probably causing the frames from ping to be among the "dropped" frames. You could set up the receiver to "bounce" back all the packets you received and then measure the RTT from the sender. This would involve different or new apps than pkt-gen, but may be commonly covered by something in netmap that I don't know about.

@missyoyo
Copy link
Author

@jbrandeb Thank you for your answer. Maybe I have a bit of a misunderstanding about measuring RTT. I thought RTT measurement needed to run PING on the sender and then run PONG on the receiver, and then the sender's PING would measure RTT. But after more test, it seems that it's not like that. My current understanding is that the sender sends packets directly, and then the receiver runs PING. Regardless of the speed of the sender, the PING on the receiver can get the RTT. So, my question is, is this understanding correct? In other words, to complete the packet receiving statistics and RTT measurement on the receiver, the receiver needs two tests, one with PING running on the receiver, and the other with RX running on the receiver?
Another Question:Why I get RTT in negative values?
330.643535 ping_body [1454] count 3073704 RTT: min -394137764 av -1712524204 ns
and some RTT seems good?
322.643523 ping_body [1454] count 3075012 RTT: min 195784765 av 876248250 ns
Thank you

@jhk098
Copy link
Contributor

jhk098 commented May 13, 2023

Your understanding is correct. One end of the link runs "ping", which sends packets which contain a seqnum and a timestamp, then (in the same loop) receives the same packets echoed back by the other end of the link ("pong"), takes another timestamp and calculate the time difference with the timestamp found in the packet. The other end of the link runs "pong", which just echoes back received packets (swapping MAC addresses and IP addresses).

That "ouch cannot send" message just means that the TX ring has no space for further transmissions, so that it is not able to send more packets. It is not an issue, it's perfectly ok. We should remove the print.
The ping/pong is just an example. It could be improved to fix some issues.

You could also try the same ping/pong test on a VALE switch, to perform a local test, e.g.

$ pkt-gen -i vale:0 -f pong
$ pkt-gen -i vale:1 -f ping

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

3 participants