Giter VIP home page Giter VIP logo

udpping's Introduction

UDPping

ping with UDP protocol 🛠

How it looks like

root@raspberrypi:~# ./udpping.py 44.55.66.77 4000
UDPping 44.55.66.77 via port 4000 with 64 bytes of payload
Reply from 44.55.66.77 seq=0 time=138.357 ms
Reply from 44.55.66.77 seq=1 time=128.062 ms
Request timed out
Reply from 44.55.66.77 seq=3 time=136.370 ms
Reply from 44.55.66.77 seq=4 time=140.743 ms
Request timed out
Reply from 44.55.66.77 seq=6 time=143.438 ms
Reply from 44.55.66.77 seq=7 time=142.684 ms
Reply from 44.55.66.77 seq=8 time=138.871 ms
Reply from 44.55.66.77 seq=9 time=138.990 ms
^C
--- ping statistics ---
10 packets transmitted, 8 received, 20.00% packet loss
rtt min/avg/max = 128.06/138.44/143.44 ms

Getting Started

Step 1

Set up a udp echo server at the host you want to ping.

There are many ways of doing this, my favourite way is:

socat -v UDP-LISTEN:4000,fork PIPE

Now a echo server is listening at port 4000.

Note

If you dont have socat, use apt install socat or yum install socat, you will get it.

Step 2

Ping you server.

Assume 44.55.66.77 is the IP of your server.

./udpping.py 44.55.66.77 4000

Done!

Now UDPping will generate outputs as a normal ping, but the protocol used is UDP instead of ICMP.

Advanced Usage

root@raspberrypi:~# ./udpping.py
 usage:
   this_program <dest_ip> <dest_port>
   this_program <dest_ip> <dest_port> "<options>" 

 options:
   LEN         the length of payload, unit:byte
   INTERVAL    the seconds waited between sending each packet, as well as the timeout for reply packet, unit: ms

 examples:
   ./udpping.py 44.55.66.77 4000
   ./udpping.py 44.55.66.77 4000 "LEN=400;INTERVAL=2000"
   ./udpping.py fe80::5400:ff:aabb:ccdd 4000
   

udpping's People

Contributors

gnattu avatar wangyu- 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  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  avatar

udpping's Issues

客服端执行udpping.py报错

我的理解是VPS运行socat -v UDP-LISTEN:端口,fork PIPE进行监听
客户端运行udpping.py文件替换ICMP为UDP进行丢包测试

但是我在梅林上运行提示
env: can't execute 'python': No such file or directory

PS:其中监听的端口 我的理解是VPN的端口 如果用了udpspeeder加速 那么应该填VPN的数据传输端口还是udpspeeder的服务端口呢

$** + UDPspeeder + udp2raw 下的 iperf3测速

@wangyu- 你好,有个问题想向你请教

问题: 如何在下面这种方案中用 iperf3 测加速后的 udp

$** + UDPspeeder + udp2raw

tcp 用 tinymapper 转发,走BBR,udp 走 UDPspeeder + udp2raw

server端,$**server端口7788

nohup ./speederv2_amd64 -s -l0.0.0.0:4010 -r127.0.0.1:7788 -k "passwd" -f20:10 --mode 0 -i 10 --report 20 > ./speeder.log 2>&1 &
nohup ./udp2raw_amd64 -s -l0.0.0.0:4020 -r127.0.0.1:4010  -a -k "passwd" --raw-mode faketcp --cipher-mode xor > ./udp2raw_udp.log 2>&1 &

client端,$**redir 本地监听端口1080 -> server 127.0.0.1:6010

nohup ./tinymapper_amd64 -l0.0.0.0:6010 -r$server:7788 -t > ./tinymapper.log 2>&1 &
nohup ./speederv2_amd64 -c -l0.0.0.0:6010 -r127.0.0.1:4021 -k "passwd" -f20:10 --mode 0 -i 10  --report 20 > ./speeder.log 2>&1 &
nohup ./udp2raw_amd64 -c -l0.0.0.0:4021 -r$server:4020  -a -k "passwd" --raw-mode faketcp --cipher-mode xor > ./udp2raw_udp.log 2>&1 &

UDPping测加速后的udp延迟,没有问题,引入少量延迟,丢包率降到0

server端

 socat -v UDP-LISTEN:7788,fork PIPE

client端

~/udpping.py 127.0.0.1 1080

目前想要测试加速后的udp速度,用iperf3,版本3.5

3.5版本iperf3不支持在server端设定 -u 选项,改成自适应client端参数,这样导致无法监听 7788/udp 端口,我试过用tinymapper将 7788 映射到 5003 ,然后iperf3 监听 5003

server端

nohup ./tinymapper_amd64 -l0.0.0.0:5003 -r127.0.0.1:7788 -u > ./tinymapper.log 2>&1 &
iperf3 -s -p 5003

client端

iperf3 -c 127.0.0.1 -p 1080 -u -i 1 -b 5M -t 60

提示 iperf3: error - control socket has closed unexpectedly

虽然跟UDPping没关系,但是希望你能够帮忙解答,这两种方式为什么UDPping可以,iperf3不行。

或者有没有其他更好的测试加速后udp性能的方法。

Patch to flush output

udpping writes its response output to stdout with default stdio buffering, which is ok for interactive terminal use, but doesn't work well if udpping is being called from a script, or otherwise has it's output redirected.

Please find attached a patch which adds explicit output flushing.

Tim

udpping_flush_patch.txt

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.