Package edu.nps.moves.dis7.examples
Class EspduSender
java.lang.Object
edu.nps.moves.dis7.examples.EspduSender
Creates and sends ESPDUs in IEEE binary format. Adapted from OpenDIS library
example package edu.nps.moves.examples
- Author:
- Don McGregor, Don Brutzman
-
Nested Class Summary
Nested ClassesModifier and TypeClassDescriptionstatic enum -
Field Summary
FieldsModifier and TypeFieldDescriptionstatic final StringDefault multicast group address we send on.static final intDefault multicast port used, matches Wireshark DIS capture defaultstatic final intNumber of complete loops to perform. -
Constructor Summary
Constructors -
Method Summary
Modifier and TypeMethodDescriptionstatic Set<InetAddress> A number of sites get all snippy about using 255.255.255.255 for a broadcast address; it trips their security software and they kick you off their network.static voidPossible system properties, passed in via -Dattr=val networkMode: unicast, broadcast, multicast destinationIp: where to send the packet.
-
Field Details
-
SEND_LOOPS_TO_PERFORM
public static final int SEND_LOOPS_TO_PERFORMNumber of complete loops to perform. Putting any upper limit on # packets sent avoids possibility of non-terminating infinite loops that continue sending packets.- See Also:
-
DEFAULT_MULTICAST_ADDRESS
Default multicast group address we send on.- See Also:
-
DEFAULT_MULTICAST_PORT
public static final int DEFAULT_MULTICAST_PORTDefault multicast port used, matches Wireshark DIS capture default- See Also:
-
-
Constructor Details
-
EspduSender
public EspduSender()Default constructor
-
-
Method Details
-
main
Possible system properties, passed in via -Dattr=val networkMode: unicast, broadcast, multicast destinationIp: where to send the packet. If in multicast mode, this can be multicast. To determine broadcast destination IP, use an online broadcast address calculator, for example http://www.remotemonitoringsystems.ca/broadcast.php If in multicast mode, a join() will be done on the multicast address. port: port used for both source and destination.- Parameters:
args- command-line arguments
-
getBroadcastAddresses
A number of sites get all snippy about using 255.255.255.255 for a broadcast address; it trips their security software and they kick you off their network. (Comcast, NPS, etc.) This determines the broadcast address for all connected interfaces, based on the IP and subnet mask. If you have a dual-homed host it will return a broadcast address for both. If you have some VMs running on your host this will pick up the addresses for those as well--e.g. running VMWare on your laptop with a local IP this will also pick up a 192.168 address assigned to the VM by the host OS.- Returns:
- set of all broadcast addresses
-