Code Monkey home page Code Monkey 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

wangyu- avatar

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.