Search code examples
c#pcap.net

Using pcapdotnet to send raw ethernet packet


I am using pcapdotnet and would like to send a raw ethernet packet. I am working with the sample found here: http://pcapdotnet.codeplex.com/wikipage?title=Pcap.Net%20Tutorial%20-%20Sending%20Packets

I would like to know two things:

  1. In order to modify this to send mac level packets I need to leave only ethernetLayer in the PacketBuilder constructor?
  2. How do I load the packet with the raw bit/byte data I want to send in the ethernet packet?

Thank you!


Solution

  • I believe you need to use 2 layers:

    1. EthernetLayer (for the Ethernet header).
    2. PayloadLayer (for the raw byte data - the Ethernet payload).