Class EspduSender

java.lang.Object
edu.nps.moves.dis7.examples.EspduSender

public class EspduSender extends Object
Creates and sends ESPDUs in IEEE binary format. Adapted from OpenDIS library example package edu.nps.moves.examples
Author:
Don McGregor, Don Brutzman
  • Field Details

  • Constructor Details

    • EspduSender

      public EspduSender()
      Default constructor
  • Method Details

    • main

      public static void main(String[] args)
      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

      public static Set<InetAddress> 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