@Override
    public void onConnect(ConversationContext<Ethernet_Frame> context) {
        InetAddress localIpAddress;
        try {
            RawSocketChannel channel = (RawSocketChannel) context.getChannel();
            String localAddress = channel.getLocalAddress().toString().substring(1).split(":")[0];
            localIpAddress = InetAddress.getByName(localAddress);
            PcapNetworkInterface devByAddress = Pcaps.getDevByAddress(localIpAddress);
            profinetDriverContext.setChannel(new ProfinetChannel(Collections.singletonList(devByAddress), devices));
            profinetDriverContext.getChannel().setConfiguredDevices(devices);
            // Set both the network-interface and the channel for this device
            // TODO: Find out what they are needed for ...
            for (Map.Entry<String, ProfinetDevice> entry : devices.entrySet()) {
                entry.getValue().getDeviceContext().setNetworkInterface(new ProfinetNetworkInterface(devByAddress));
                entry.getValue().getDeviceContext().setChannel(profinetDriverContext.getChannel());
            }
        } catch (PcapNativeException | UnknownHostException e) {
            throw new RuntimeException(e);
        }

        // Resolve missing information such as the remote ethernet mac address using LLDP or DCP auto-discovery.
        try {
            onDeviceDiscovery();
        } catch (PlcException | InterruptedException e) {
            throw new RuntimeException(e);
        }

        try {
            for (Map.Entry<String, ProfinetDevice> device : devices.entrySet()) {
                device.getValue().onConnect();
            }
            context.fireConnected();

        } catch (ExecutionException | InterruptedException | TimeoutException e) {
            throw new RuntimeException(e);
        }
    }
Start a PN or LLDP discovery to find PN devices on the network.
We pass in a driverContext handler, that checks if an incoming response has the information needed for
connecting. It just ignores the rest ...

@throws InterruptedException
@throws PlcConnectionException
plc4j/drivers/profinet/src/main/java/org/apache/plc4x/java/profinet/protocol/ProfinetProtocolLogic.java