Generate Udp Traffic In Windows

Posted on by
Generate Udp Traffic In Windows Average ratng: 4,4/5 7612 votes
Generate

UDP - Sender/Reciever. Send/Receive allows you to send UDP datagrams and if selected, to listen for a response bound to the port on local host. Receive only listens indefinitely for UDP packets and outputs the result in the log section. Send only allows you to send UDP datagrams to specified host on given port - Outputs the sender (destination).

Hi guys,
I have the following scenario: 2 virtual machines connected through 3 routers in dynamips. My VMs have WinXP installed on them.
My goal is to generate as much traffic as i can by means of iperf, so I can measure the TCP throughput. How can I do that? I know one way is to modify TCP windows size(socket buffer size).
If I use the default setting (default TCP windows size is 8KB), I have the following output:
C:>iperf.exe -c 192.168.40.128 -i 1
------------------------------------------------------------
Client connecting to 192.168.40.128, TCP port 5001
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[1916] local 192.168.30.128 port 1250 connected with 192.168.40.128 port 5001
[ ID] Interval Transfer Bandwidth
[1916] 0.0- 1.0 sec 176 KBytes 1.44 Mbits/sec
[1916] 1.0- 2.0 sec 224 KBytes 1.84 Mbits/sec
[1916] 2.0- 3.0 sec 200 KBytes 1.64 Mbits/sec
[1916] 3.0- 4.0 sec 208 KBytes 1.70 Mbits/sec
[1916] 4.0- 5.0 sec 144 KBytes 1.18 Mbits/sec
[1916] 5.0- 6.0 sec 128 KBytes 1.05 Mbits/sec
[1916] 6.0- 7.0 sec 136 KBytes 1.11 Mbits/sec
[1916] 7.0- 8.0 sec 208 KBytes 1.70 Mbits/sec
[1916] 8.0- 9.0 sec 192 KBytes 1.57 Mbits/sec
[1916] 9.0-10.0 sec 144 KBytes 1.18 Mbits/sec
[1916] 0.0-10.1 sec 1.73 MBytes 1.43 Mbits/sec
C:>iperf.exe -s -i 1 -t 10
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 8.00 KByte (default)
------------------------------------------------------------
[1884] local 192.168.40.128 port 5001 connected with 192.168.30.128 port 1250
[ ID] Interval Transfer Bandwidth
[1884] 0.0- 1.0 sec 184 KBytes 1.51 Mbits/sec
[1884] 1.0- 2.0 sec 216 KBytes 1.77 Mbits/sec
[1884] 2.0- 3.0 sec 200 KBytes 1.64 Mbits/sec
[1884] 3.0- 4.0 sec 208 KBytes 1.70 Mbits/sec
[1884] 4.0- 5.0 sec 152 KBytes 1.25 Mbits/sec
[1884] 5.0- 6.0 sec 120 KBytes 983 Kbits/sec
[1884] 6.0- 7.0 sec 136 KBytes 1.11 Mbits/sec
[1884] 7.0- 8.0 sec 208 KBytes 1.70 Mbits/sec
[1884] 8.0- 9.0 sec 192 KBytes 1.57 Mbits/sec
[1884] 0.0-10.0 sec 1.73 MBytes 1.45 Mbits/sec
which doesn't help me.
Now if I change TCP windows size by following the rule: bandwidth*RTT/8, I get: 100Mbit/s*0.1s/8= 1.25MBytes. Because RTT varies, I chose -w 1.5M.
C:>iperf.exe -c 192.168.40.128 -i 1 -w 1.5M
------------------------------------------------------------
Client connecting to 192.168.40.128, TCP port 5001
TCP window size: 1.50 MByte
------------------------------------------------------------
[1916] local 192.168.30.128 port 1254 connected with 192.168.40.128 port 5001
[ ID] Interval Transfer Bandwidth
[1916] 0.0- 1.0 sec 1.53 MBytes 12.8 Mbits/sec
[1916] 1.0- 2.0 sec 32.0 KBytes 262 Kbits/sec
[1916] 2.0- 3.0 sec 112 KBytes 918 Kbits/sec
[1916] 3.0- 4.0 sec 192 KBytes 1.57 Mbits/sec
[1916] 4.0- 5.0 sec 208 KBytes 1.70 Mbits/sec
[1916] 5.0- 6.0 sec 176 KBytes 1.44 Mbits/sec
[1916] 6.0- 7.0 sec 144 KBytes 1.18 Mbits/sec
[1916] 7.0- 8.0 sec 168 KBytes 1.38 Mbits/sec
[1916] 8.0- 9.0 sec 40.0 KBytes 328 Kbits/sec
[1916] 9.0-10.0 sec 128 KBytes 1.05 Mbits/sec
[1916] 0.0-21.3 sec 2.71 MBytes 1.07 Mbits/sec
C:>iperf.exe -s -i 1 -t 10 -w 1.5M
------------------------------------------------------------
Server listening on TCP port 5001
TCP window size: 1.50 MByte
------------------------------------------------------------
[1884] local 192.168.40.128 port 5001 connected with 192.168.30.128 port 1253
[ ID] Interval Transfer Bandwidth
[1884] 0.0- 1.0 sec 217 KBytes 1.78 Mbits/sec
[1884] 1.0- 2.0 sec 288 KBytes 2.36 Mbits/sec
[1884] 2.0- 3.0 sec 272 KBytes 2.23 Mbits/sec
[1884] 3.0- 4.0 sec 264 KBytes 2.16 Mbits/sec
[1884] 4.0- 5.0 sec 175 KBytes 1.44 Mbits/sec
[1884] 5.0- 6.0 sec 192 KBytes 1.58 Mbits/sec
[1884] 6.0- 7.0 sec 304 KBytes 2.49 Mbits/sec
[1884] 7.0- 8.0 sec 272 KBytes 2.23 Mbits/sec
[1884] 8.0- 9.0 sec 248 KBytes 2.03 Mbits/sec
[1884] 9.0-10.0 sec 279 KBytes 2.29 Mbits/sec
[1884] 10.0-11.0 sec 305 KBytes 2.50 Mbits/sec
[1884] 11.0-12.0 sec 207 KBytes 1.69 Mbits/sec
[1884] 12.0-13.0 sec 168 KBytes 1.38 Mbits/sec
[1884] 13.0-14.0 sec 184 KBytes 1.51 Mbits/sec
[1884] 14.0-15.0 sec 272 KBytes 2.23 Mbits/sec
[1884] 15.0-16.0 sec 336 KBytes 2.76 Mbits/sec
[1884] 0.0-16.2 sec 3.96 MBytes 2.05 Mbits/sec
As you can see, in the first second on the client side, the throughput was 12.8 Mbits/s, but then it dramatically decreased. What could be the cause of bandwidth variations between client side and server side. RTT?
Then, there is a delay on the server side. It counted for 16 seconds, even if I specified -t 10. Why is that?
Do you know other methods that could help me to measure the throughput? What about -l option?
I also read about the default TCP send and receive buffer sizes of 8kBytes on Windows systems. These parameters can be tuned to maximize TCP/IP performance. What do you know about this? Do you think it is necessary in my case?
Thank you!

Active2 years, 8 months ago

I want to generate UDP packet to test a program,something equivalent to using telnet to test TCP port (Can telnet generate UDP packet?)

Generating Traffic With Iperf Basic Usage Iperf is a traffic generation tool that allows the user to experiment with different TCP and UDP parameters to see how they affect network performance. Ostinato is a packet generator and network traffic generator with a friendly GUI. Also a powerful Python API for network test automation. Craft and send packets of several streams with different protocols at different rates. UDP - Sender/Reciever. Send/Receive allows you to send UDP datagrams and if selected, to listen for a response bound to the port on local host. Receive only listens indefinitely for UDP packets and outputs the result in the log section. Send only allows you to send UDP datagrams to specified host on given port - Outputs the sender (destination). How to open a port for incoming traffic in Windows Firewall. Type a port number. (In this case, we will open port 1707.) Click Next. Click Allow the connection. Click any network types you'd like to allow the connection over. Type a name for the rule. Click Finish. Purpose of the Packet Generator Tool. The purpose of this tool is to create a TCP, UDP, ICMP, ARP, CDP or RAW format packet or set of packets to send to a target, then observe the target's response with a packet capturing tool like Packet Capture or Wireshark. The tool can also playback previously captured packet files.

How can I do this?

quack quixote
36.1k11 gold badges90 silver badges123 bronze badges

Windows Udp Client

Don ChDon Ch
2,4998 gold badges25 silver badges34 bronze badges

5 Answers

One word: Netcat

Netcat is the go-to tool for this sort of thing.

You can thrash whatever port you choose with UDP packets with something like:

(53 is your port number)

Or you can send an actual file, or tell it to bind that port and listen as a service, or whatever you like.

SatanicpuppySatanicpuppy
6,0241 gold badge17 silver badges17 bronze badges

If you want to merely send one UDP packet with some specified data, as opposed to Satanicpuppy's answer which continuously sends random data, you can do: 5.1 surround sound test download.

Community
jamisjamis

This one is good if you are trying to work with large packets. netcat uses 1024 bytes in UDP mode.

UDP mode, to port 2090 at address, with a packet length of 1550 bytes.

This is from the nmap package, or is sometimes packaged as nping separately.

Generate Udp Traffic Windows

Further info is at https://nmap.org/book/nping-man-general-operation.html

CriggieCriggie

If you're using Bash, you can use its /dev/udp virtual filesystem, like this:

Shamelessly re-used from this answer to 'How to send only one UDP packet with netcat?'

Toby Speight
3,9151 gold badge16 silver badges33 bronze badges
jacknadjacknad

Udp Traffic Firewall

You can always use UDP terminal programs. Most of them can also send/receive TCP also. For example Docklight scripting terminal has that possibility. And then you send data same way as you would send it to serial port.

Generate Udp Traffic In Windows 9

UserUser

Not the answer you're looking for? Browse other questions tagged networkingtcpiptelnetudp or ask your own question.