public override async Task PacketReceived(object sender, DataMessageEventArgs eventArgs) { if (!initialized) { return; } var ipv4Packet = IPv4Packet.Parse(eventArgs.Data); ipv4Packet.SourceAddress = GetIpFromPhysicalAddress(GetPhysicalAddressFromId(eventArgs.SourceId)); ipv4Packet.DestinationAddress = IPAddress.Broadcast; var ethernetPacket = new EthernetPacket(GetPhysicalAddressFromId(eventArgs.SourceId), new PhysicalAddress(new byte[] { 0xFF, 0xFF, 0xFF, 0xFF, 0xFF, 0xFF }), ipv4Packet, EthernetPacket.PacketType.IpV4); if (!eventArgs.IsBroadcast) { ipv4Packet.DestinationAddress = GetIpFromPhysicalAddress(tapInterface.GetPhysicalAddress()); ethernetPacket.DestinationAddress = tapInterface.GetPhysicalAddress(); } var packetData = ethernetPacket.ToBytes(); tapStream.Write(packetData, 0, packetData.Length); await Task.Delay(0); }