Comments (16)
SharpPcap doesn't contain any limits to the packet size you can send. That of course doesn't mean that there aren't limits due to wincap or npcap.
Now that npcap is supported by the latest git master would you mind trying npcap (instead of winpcap) and the latest git master to see if it works? If it doesn't then at least we can reach out to the npcap developer to discuss, winpcap is a dead project so we have no path for support there.
from sharppcap.
@russianbullet MTU?
from sharppcap.
abdullah I've modified the mtu of the ethernet card in windows but no luck , anything to do in sharppcap
from sharppcap.
Dear @chmorgan I've uninstalled winpcap and installed npcap , the result is the same , I get this exception when SendPacket
**> An unhandled exception of type 'SharpPcap.PcapException' occurred in SharpPcap.dll
Additional information: Can't send packet: send error: PacketSendPacket failed**
from sharppcap.
from sharppcap.
Thank you Chris
from sharppcap.
The issues page is at Nmap repo here: https://github.com/nmap/nmap/issues
BTW, can you provide an example to reproduce this issue? It only needs to contain the sending packet call with 1600 bytes. And I will test whether it works.
And please provide your DiagReport described in Npcap README. So I can see your adapter info.
from sharppcap.
Hello @hsluoyz
It's a pleasure to be in contact with you, Thx for @chmorgan
Dear @hsluoyz I've made a Demo about this issue, it's written in C#, also I've attached the Report you asked for. DiagReport-20170422-121459.txt
Thank you in advance
using SharpPcap;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.NetworkInformation;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;
namespace DemoSendPacket
{
public partial class frmDemo : Form
{
private SharpPcap.CaptureDeviceList devices;
public frmDemo()
{
InitializeComponent();
}
private static byte[] GetRandomPacket(int size)
{
byte[] packet = new byte[size];
Random rand = new Random();
rand.NextBytes(packet);
return packet;
}
private void frmDemo_Load(object sender, EventArgs e)
{
NetworkInterface[] nics = NetworkInterface.GetAllNetworkInterfaces();
devices = CaptureDeviceList.Instance;
foreach (ICaptureDevice dev in devices)
{
NetworkInterface ni = nics.Where((nic) => dev.Name.EndsWith(nic.Id)).FirstOrDefault();
if (ni == null)
continue;
this.cboNics.Items.Add(ni.Name);
}
}
private void btnSend1_Click(object sender, EventArgs e)
{
byte[] packet1 = GetRandomPacket(1514);
ICaptureDevice device = CaptureDeviceList.New()[this.cboNics.SelectedIndex];
device.Open();
device.SendPacket(packet1);
device.Close();
}
private void btnSend2_Click(object sender, EventArgs e)
{
byte[] packet2 = GetRandomPacket(1600);
ICaptureDevice device = CaptureDeviceList.New()[this.cboNics.SelectedIndex];
device.Open();
device.SendPacket(packet2);
device.Close();
}
}
}
from sharppcap.
Where is this.cboNics
defined? Please upload your whole project as a zip. It's kind of hard for a non C# expert as me to tackle only a piece of code.
And BTW, I found you are running Win8. It's an outdated system and not supported by Microsoft any more. And I don't even have a Win8 VM to reproduce any bugs. (I only have Vista SP1, Win7 SP1, Win8.1, Win10). Please update to at least Win8.1 to avoid potential problems if possible.
from sharppcap.
Hello @hsluoyz , I'm so sorry to be late , I couldn't upload the project here, so I've uploaded it to google drive , this is the link: https://drive.google.com/file/d/0B6TQYhFg8n0mdXhubm5ESDdyYkE/view
from sharppcap.
Hi, I reproduced your issue. It seems that Windows hardcoded the maximum of MTU for Ethernet adapters to be 1500. In fact I never googled out an article that said MTU can be larger than 1500. It's a de-facto standard and it seems that Windows implements this way. In fact, you can get a larger MTU for other type adapters. For example, Npcap Loopback Adapter supports a MTU of 65536.
from sharppcap.
Thank you @hsluoyz , It seems that am going to fragment the ip packet , thank you for your efforts guys , regards
from sharppcap.
@hsluoyz @russianbullet i am quite sure you can change the MTU in windows. Using netsh tool...
from sharppcap.
You can change the MTU
https://support.zen.co.uk/kb/Knowledgebase/Changing-the-MTU-size-in-Windows-Vista-7-or-8
from sharppcap.
@abdullah2993 I've already changed it , but no luck still the same error
from sharppcap.
Closing this as it is a limitation of the OS and/or npcap. @hsluoyz thanks for your help.
from sharppcap.
Related Issues (20)
- How to read voip information HOT 1
- How to capture and parse HTTP protocol packets HOT 1
- Forcing a process to communicate through the proxy HOT 6
- zerotier-one support
- SendPacket latency question HOT 7
- Question: Write to stream instead of file HOT 2
- Are there any examples of monitoring http or https? HOT 1
- Unable to load DLL 'wpcap' or one of its dependencies HOT 3
- IPv4 Length exceeds Packet Length during live device capture HOT 2
- get the packet info not from event HOT 3
- Libpcap 1.10+ rfmon not supported HOT 1
- Unable to get libpcap (and by extension sharppcap) to work on Ubuntu 20.04 HOT 8
- Timeval unchanged between captured packets in Example03 HOT 4
- Integration request. Are you interested? HOT 2
- Unable to load DLL 'wpcap' HOT 1
- wpcap.so: cannot open on linux build HOT 5
- CaptureFileWriterDevice.Write((RawCapture p) ignores PacketLength field HOT 4
- WinPcapDevice still in descriptions HOT 1
- Unable to activate the adapter (NpcapRemoteCapture Example) HOT 14
- New Nuget release
Recommend Projects
-
React
A declarative, efficient, and flexible JavaScript library for building user interfaces.
-
Vue.js
🖖 Vue.js is a progressive, incrementally-adoptable JavaScript framework for building UI on the web.
-
Typescript
TypeScript is a superset of JavaScript that compiles to clean JavaScript output.
-
TensorFlow
An Open Source Machine Learning Framework for Everyone
-
Django
The Web framework for perfectionists with deadlines.
-
Laravel
A PHP framework for web artisans
-
D3
Bring data to life with SVG, Canvas and HTML. 📊📈🎉
-
Recommend Topics
-
javascript
JavaScript (JS) is a lightweight interpreted programming language with first-class functions.
-
web
Some thing interesting about web. New door for the world.
-
server
A server is a program made to process requests and deliver data to clients.
-
Machine learning
Machine learning is a way of modeling and interpreting data that allows a piece of software to respond intelligently.
-
Visualization
Some thing interesting about visualization, use data art
-
Game
Some thing interesting about game, make everyone happy.
Recommend Org
-
Facebook
We are working to build community through open source technology. NB: members must have two-factor auth.
-
Microsoft
Open source projects and samples from Microsoft.
-
Google
Google ❤️ Open Source for everyone.
-
Alibaba
Alibaba Open Source for everyone
-
D3
Data-Driven Documents codes.
-
Tencent
China tencent open source team.
from sharppcap.