title: How to send Ethernet-Frames in Java without TCP/IP Stack
body: <p>My Java application should control an external device (EtherCAT Bus technology) directly connected to the network interface of my computer(Ubuntu and Windows). No other network devices are connected. The communication has do be done on Standard IEEE 802.3 Ethernet Frames without IP stack.</p>
  
  <p><strong>Example for sending data:</strong></p>
  
  <pre><code>int etherType =  0x88A4;  // the EtherType registered by IEEE
  byte[] macBroadcast = new byte[] {0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF};
  byte[] macSource = new byte[] ... ;  // MAC Address of my network interface card
  byte[] buffer = ... // the data to send
  
  device.write(macSource, macBroadcast, etherType, buffer);
  </code></pre>
  
  <p>I tried <strong>JNetPcap</strong>, which uses the <strong>pcap</strong> native library. The given API was fine, but there were multithreading issues on heavy load, which forced me to give up.</p>
  
  <p><strong>netty.io</strong> was also a candidate. I am not sure, but a TCP/IP stack is mandatory. Am I right?</p>
  
  <p>Are there other ideas to communicate with low level Ethernet Frames? I would prefer a pure java library like netty.io, if one exists.</p>
  
  <p>Of course JNA/JNI is an option, too. But I don't want to write C code.</p>
  
  <p>Other alternatives?</p>