public void send(Ethernet_Frame ethFrame) {
        for (Map.Entry<MacAddress, PcapHandle> entry : openHandles.entrySet()) {
            PcapHandle handle = entry.getValue();
            WriteBufferByteBased buffer = new WriteBufferByteBased(ethFrame.getLengthInBytes());
            try {
                ethFrame.serialize(buffer);
                Packet packet = EthernetPacket.newPacket(buffer.getBytes(), 0, ethFrame.getLengthInBytes());
                handle.sendPacket(packet);
            } catch (PcapNativeException | NotOpenException | SerializationException | IllegalRawDataException e) {
                throw new RuntimeException(e);
            }
        }
    }
This code is borrowed and stripped down from the Profinet driver
plc4j/drivers/s7/src/main/java/org/apache/plc4x/java/s7/readwrite/discovery/ProfinetChannel.java