Help with Raw Socket

Are there any example of how to construct a raw icmp packet



Answer this question

Help with Raw Socket

  • Joe Albrecht

    yea but, what do i put int he code and type and all that stuff


  • mrotoloni

    Here is the format of ICMP Packet:

    Type

    1 byte

    Byte

    Code

    1 byte

    Byte

    Checksum

    2 bytes

    Unsigned 16-bit integer

    Message

    multibyte

    Byte array

    So seeing this you can write something like this:

    class ICMPPacket
    {
              private byte type;
              privtae byte code;
              privtae UInt16 checkSum;
              private int messageSize;
              private byte[] message = new byte[1024];

        public ICMPPacket() //Default Constructor
        {

        }
    }

    Best Regards,



  • vdv_phuong

    Mariya Atanasova - MSFT wrote:

    If you're just looking for Ping, there is a Ping class already in the System.Net namespace.

    http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx

    Mariya

    No hes looking to Learn ICMP



  • m_umair_85

    try searching Ping Application in C# ;-)

  • CodeSweatAndBeers

    It depends with which system you are going to communicate! Like Ping.... Search it on internet what system supports ICMP and their specification and try to write program to communicate with them. To start with it try writing a Ping application. There are examples avaialable on internet.

    Best of Luck ;-)



  • Alexnaldo Santos

    Tell me your email, I send you a great eBook on Network programming in C#! I hope you'll convert code in VB.Net easily.

    Cheers ;-)



  • JoshKorn

    Josh.Rules@gmail.com

  • zoki977

    The mail is on the way, Its about 6.5 MB and will take time to upload, You'll probably get with within next 15 minutes,

    Best Regards,

    Rizwan



  • Matthew Bailey

    I have searched though 30 pages yesturday. Never found what i wanted.


  • ricochett

    Yes, but that isn;t using a raw icmp packet so i cant do what i want with it.


  • Winson

    im looking for vb.net


  • Stephen Chiu

    Can you help me find one that does everything


    Sends the raw tcp/ip packet also. with the source ip addres and reciving ip address


  • Dave12356

    If you're just looking for Ping, there is a Ping class already in the System.Net namespace.

    http://msdn2.microsoft.com/en-us/library/system.net.networkinformation.ping.aspx

    Mariya


  • nancy77

    Whatever, It'll be converted even if you fin one in C#

  • Help with Raw Socket