Java Network Traffic Generator: Difference between revisions

From NovaOrdis Knowledge Base
Jump to navigation Jump to search
Line 71: Line 71:


The network interface name is one of those returned by <tt>ip addr</tt>.
The network interface name is one of those returned by <tt>ip addr</tt>.
==Payload==
<tt>send</tt> accepts a payload argument.

Revision as of 16:45, 17 March 2017

External

Internal

Overview

A Java program sends multicast socket using DatagramSocket and listens for multicast traffic with MulticastSocket.

GitHub

https://github.com/NovaOrdis/playground/tree/master/java/network/network-traffic

User Manual

Global Arguments

-d

Start in debug mode.

-v

Display verbose information about the network operation in process.


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.