perfsonar / owamp

A tool for performing one-way or two-way active measurements
Apache License 2.0
70 stars 30 forks source link

TWAMP limiting the flow of packets? #40

Closed laeti-tia closed 5 years ago

laeti-tia commented 5 years ago

During the TWAMP webinar preparation, we run into this capping of TWAMP packets when compared to OWAMP:

geantadmin^2@psmall-poz2:)~$ twping -c 10000 -i 0.001 psmall-g-1.basnet.by
Approximately 13.0 seconds until results available

--- twping statistics from [psmall-g-1.basnet.by]:9361 to [psmall-poz2.man.poznan.pl]:19049 ---
SID:    505eaab3df6b27639381e8e7a1cf2076
first:  2018-10-12T16:00:04.610
last:   2018-10-12T16:00:14.541
908 sent, 0 lost (0.000%), 0 send duplicates, 0 reflect duplicates
round-trip time min/median/max = 12.8/13/25.8 ms, (err=0.553 ms)
send time min/median/max = 5.48/5.6/6.75 ms, (err=0.277 ms)
reflect time min/median/max = 7.28/7.4/20.2 ms, (err=0.277 ms)
reflector processing time min/max = 0.00906/0.127 ms
two-way jitter = 0.1 ms (P95-P50)
send jitter = 0.1 ms (P95-P50)
reflect jitter = 0.1 ms (P95-P50)
send hops = 7 (consistently)
reflect hops = 7 (consistently)

OWAMP doesn't exhibit the same behavior:

geantadmin^2@psmall-poz2:)~$ owping -c 10000 -i 0.001 psmall-g-1.basnet.by
Approximately 12.9 seconds until results available

--- owping statistics from [psmall-poz2.man.poznan.pl]:8991 to [psmall-g-1.basnet.by]:9229 ---
SID:    505eaab3df6b281e075a918610ddb218
first:  2018-10-12T16:03:11.011
last:   2018-10-12T16:03:21.218
10000 sent, 2 lost (0.020%), 0 duplicates
one-way delay min/median/max = 5.44/5.6/16.1 ms, (err=0.271 ms)
one-way jitter = 0.1 ms (P95-P50)
hops = 7 (consistently)
no reordering

--- owping statistics from [psmall-g-1.basnet.by]:9170 to [psmall-poz2.man.poznan.pl]:8942 ---
SID:    96fea012df6b281e0ad40e70282345a0
first:  2018-10-12T16:03:11.011
last:   2018-10-12T16:03:20.874
10000 sent, 0 lost (0.000%), 0 duplicates
one-way delay min/median/max = 7.22/7.4/20.3 ms, (err=0.271 ms)
one-way jitter = 0.1 ms (P95-P50)
hops = 7 (consistently)
no reordering

What might be causing this smaller number of packets TWAMP is sending when compared to OWAMP?

vvidic commented 5 years ago

On Fri, Oct 12, 2018 at 12:56:00PM -0700, Antoine Delvaux wrote:

What might be causing this smaller number of packets TWAMP is sending when compared to OWAMP?

It could be that TWAMP is waiting for a response before sending the next test packet. OWAMP on the other hand just sends out all the packets and collectes the results at the end of the test. Maybe you can verify this with tcpdump?

-- Valentin Vidic Computer Systems Engineer - Expert Department of Computer Infrastructure and Services Croatian Academic and Research Network - CARNET Josipa Marohnica 5, HR-10000 Zagreb, Croatia tel: +385 1 6661 714, fax. +385 1 6661 635 gsm: +385 91 2480 919 www.CARNet.hr

vvidic commented 5 years ago

On Fri, Oct 12, 2018 at 12:56:00PM -0700, Antoine Delvaux wrote:

During the TWAMP webinar preparation, we run into this capping of TWAMP packets when compared to OWAMP:

The send/receive loop should be in run_tw_test:

do{
        ...
        if( (sent = sendto(ep->sockfd,ep->payload,
                        ep->len_payload,0,rsaddr,rsaddrlen)) < 0){
        ...
        resp_len = recvfromttl(ep->cntrl->ctx,ep->sockfd,
                               ep->payload,resp_len_payload,lsaddr,lsaddrlen,
                               (struct sockaddr*)&peer_addr,&peer_addr_len,
                               &twdatarec.reflected.ttl);
        ....
        if((nanosleep(&sleeptime,NULL) == 0) || (errno == EINTR)){
            goto AGAIN;
        }
        ....
} while(i < ep->tsession->test_spec.npackets);

-- Valentin Vidic Computer Systems Engineer - Expert Department of Computer Infrastructure and Services Croatian Academic and Research Network - CARNET Josipa Marohnica 5, HR-10000 Zagreb, Croatia tel: +385 1 6661 714, fax. +385 1 6661 635 gsm: +385 91 2480 919 www.CARNet.hr

vvidic commented 5 years ago

Maybe it would be possible to adjust the timeout for recvfromttl so it just waits till the next packet is to be sent. Shall we ask the patch author what he thinks?

vvidic commented 5 years ago

I will give this one another try next week, maybe we can manage something...

vvidic commented 5 years ago

I've created a PR with a possible fix, please test...