Giter Site home page Giter Site logo

twamp-protocol's Introduction

twamp-protocol

A Two-Way Active Measurement Protocol

Read the RFC: http://tools.ietf.org/html/rfc5357

Developer: Emma Mirică

Contributions: stephanDB

Note: This is a minimal implementation of the TWAMP protocol.

What is not supported:
    - the authenticated, encrypted mode for client and server
    - it has the option to set this mode for client and server, but is not
      yet supported. The messages were defined but the logic is not
      implemented.

To run:
    make
    make setcap
    ./server [-h | -a <not supported> | -p <port>]
    ./client -s <ip_server [-h | -a <not_supported> | -p <port_sender> | -P
    <port_receiver> | -n <test_sessions> | -m <test_sess_msgs>]

twamp-protocol's People

Contributors

demirten avatar emirica avatar jackyleungm avatar jamofer avatar stephdb avatar sumkincpp avatar

Stargazers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

Watchers

 avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar  avatar

twamp-protocol's Issues

make runclient (trivial)

bogdan@everest:~/repos/OSS/review/twamp-protocol$ make runclient
./client localhost
Error, no such host: Success
make: *** [runclient] Error 1

runclient should be updated to be "./client -s localhost"

bogdan@everest:~/repos/OSS/review/twamp-protocol$ ./client -s localhost
Connecting to server 127.0.0.1...
Received ServerGreeting.
Sending SetUpResponse...
Received ServerStart.
Sending RequestTWSession for port 30737...
Sending StartSessions for all active ports ...
Sending TWAMP-Test message 1 for port 20604...
Received TWAMP-Test message response 1 for port 20604.
Round-trip time for TWAMP-Test packet 1 for port 20604 is 310 [usec]
Receive time - Send time for TWAMP-Test packet 1 for port 20604 is 149 [usec]
Reflect time - Send time for TWAMP-Test packet 1 for port 20604 is 168 [usec]
Sending StopSessions for all active ports ...

Jitter Support

Can Jitter be added to the current delay metrics ?
Based on RFC3393

client.c - duplicate code in case of error ("cosmetic")

Not a bug, but some of the code executed in case of error is duplicated in the client:

        free(twamp_test);
        close(servfd);
        exit(EXIT_FAILURE);

Would be nice if all this would reside under a goto, to improve code readability.

Naming convention

Hello,
I'm wondering whether is there any documents for theNwRTD , IntD , FWD , SWD [ms] keywords? What are their full names?

Error in accept: Success

VM:/twamp-protocol$ sudo make
gcc -o server server.c timestamp.c -Wall -lm -g
gcc -o client client.c timestamp.c -Wall -lm -g
VM:
/twamp-protocol$
VM:/twamp-protocol$ make setcap
sudo setcap 'cap_net_bind_service=+ep' ./server
VM:
/twamp-protocol$ ./server &
[1] 2148
VM:/twamp-protocol$ ./client -s localhost
Connecting to server 127.0.0.1...
Error in accept: Success
^C
VM:
/twamp-protocol$

What could be the reason for this error?

PaddingLength should be in Network byte order

I am using this TWAMP tool for my working. I am using the Junos router as TWAMP server and reflector. This tool i am using as TWAMP client. As per RFC 6038 PaddingLength for Unauthenticated TWAMP-Test mode should be >= 27 octets and for Authenticated or Encrypted TWAMP-Test modes, PaddingLength should be >= 56 octets. At the same time, they should be in N/W byte order. Otherwise Juniper server rejects as invalid length.
I fixed it and its working fine now. If someone wants, i can commit the new changes.

Exit code 139

I write a dockerfile

FROM ubuntu
COPY client /usr/bin/
COPY server /usr/bin/
like this and build an image.
but when i run the container it automatically exited with code 139. can you please help me

server.c:253 - gettimeofday: no check of return value

There is no check to see if the shutdown time has been properly initialized.

Subsequent calls to get_actual_shutdown() use this value and add a timeout for determining whether to close client sockets.

If the client's shutdown value is not properly initialized, server may never clean up those clients.

Same for server.c:523 - unchecked initialization of current time. This may result in closing clients unexpectedly.

Really cool stuff (review)

  • getopt(3) - did not know about this, really useful
  • make indent - nice touch
  • cppcheck returned nothing

Library Documentation

I'm trying to use the library, but lost in the abbreviations. So what are these mean,
SW TTL
FW_TOS
SW_TOS
NwRTD
IntD
FWD
SWD
RT

#Session 0, Sender 192.168.224.15:20143, Receiver 10.80.200.1:30720, Mode: 1
Nb of Packets 1, Packet length 160, DSCP 56, TOS 224
Sending Start-Sessions for all active Sender ports...
Time , Snd# , Rcv# , SndPt , RcvPt , Sync , FW TTL, SW TTL, SndTOS, FW_TOS, SW_TOS, NwRTD , IntD , FWD , SWD [ms]
1612353501658 , 0 , 0 , 20143 , 30720 , N , 255 , 252 , 224 , - , 224 , 23.820 , 0.000 , -24611.600 , 24635.420

Recommend Projects

  • React photo React

    A declarative, efficient, and flexible JavaScript library for building user interfaces.

  • Vue.js photo Vue.js

    🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.

  • Typescript photo Typescript

    TypeScript is a superset of JavaScript that compiles to clean JavaScript output.

  • TensorFlow photo TensorFlow

    An Open Source Machine Learning Framework for Everyone

  • Django photo Django

    The Web framework for perfectionists with deadlines.

  • D3 photo D3

    Bring data to life with SVG, Canvas and HTML. 📊📈🎉

Recommend Topics

  • javascript

    JavaScript (JS) is a lightweight interpreted programming language with first-class functions.

  • web

    Some thing interesting about web. New door for the world.

  • server

    A server is a program made to process requests and deliver data to clients.

  • Machine learning

    Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.

  • Game

    Some thing interesting about game, make everyone happy.

Recommend Org

  • Facebook photo Facebook

    We are working to build community through open source technology. NB: members must have two-factor auth.

  • Microsoft photo Microsoft

    Open source projects and samples from Microsoft.

  • Google photo Google

    Google ❤️ Open Source for everyone.

  • D3 photo D3

    Data-Driven Documents codes.