Java Network Traffic Generator: Difference between revisions
Jump to navigation
Jump to search
Line 19: | Line 19: | ||
==Global Arguments== | ==Global Arguments== | ||
<pre> | <pre> | ||
Line 32: | Line 31: | ||
Display verbose information about the network operation in process. | Display verbose information about the network operation in process. | ||
Any -D system properties are propagated verbatim to the JVM: | |||
<pre> | |||
./bin/send -Djava.net.preferIPv4Stack=true ... | |||
</pre> | |||
Line 75: | Line 80: | ||
<tt>send</tt> accepts a payload argument. | <tt>send</tt> accepts a payload argument. | ||
==Usage Examples== | |||
===Sending Multicast on Mac=== |
Revision as of 18:07, 20 March 2017
External
- https://docs.oracle.com/javase/tutorial/networking/datagrams/broadcasting.html
- https://docs.oracle.com/javase/8/docs/api/java/net/MulticastSocket.html
Internal
Overview
A Java program sends multicast socket using DatagramSocket and listens for multicast traffic with MulticastSocket.
GitHub
User Manual
Global Arguments
-d
Start in debug mode.
-v
Display verbose information about the network operation in process.
Any -D system properties are propagated verbatim to the JVM:
./bin/send -Djava.net.preferIPv4Stack=true ...
Common Arguments
--interface
--interface=<interface-name>|<address>
Example:
--interface=eth0
--interface=172.20.1.11
--local-port
Forces the local port.
Listen for multicast:
java -jar multicast.jar listen <network-interface-name> <multicast-address>:<port>
The network interface name is one of those returned by ip addr.
Send multicast:
java -jar multicast.jar send <network-interface-name> <multicast-address>:<port>
The network interface name is one of those returned by ip addr.
Payload
send accepts a payload argument.