Reputation: 11
I'm trying to send more than 2000 bytes of data using SharpPcap and PacketDotNet. But, the MTU (1500 bytes) is less than the size of the data. I tried to set MTU (to 5000) using https://support.zen.co.uk/kb/Knowledgebase/Changing-the-MTU-size-in-Windows-Vista-7-or-8, but still it is throwing error as follows :
SharpPcap.PcapException: Can't send packet: send error: PacketSendPacket failed
at SharpPcap.LibPcap.LibPcapLiveDevice.SendPacket(Byte[] p, Int32 size)
at SharpPcap.LibPcap.PcapDevice.SendPacket(Byte[] p)
at SharpPcap.LibPcap.PcapDevice.SendPacket(Packet p)
Can anyone help me out here...
Upvotes: 1
Views: 751
Reputation: 1021
You need 2 things in order to send Ethernet packets larger than 1500 bytes in Windows:
netsh interface ipv4 set subinterface "Your Interface Name" mtu=2000 store=persistent
Note that this has to be done on both the device sending the packet, and the device receiving it.
Upvotes: 1