Raw TCP packets - Programmer

This is a discussion on Raw TCP packets - Programmer ; Hello, I wish to send a raw tcp packet (totally generated by my app). Would i use the winsock sendto() function on a connectionless socket for this? or do I need to go lower level? For example, I wish to ...

+ Reply to Thread
Results 1 to 5 of 5

Thread: Raw TCP packets

  1. Raw TCP packets

    Hello,

    I wish to send a raw tcp packet (totally generated by my app).
    Would i use the winsock sendto() function on a connectionless
    socket for this? or do I need to go lower level?

    For example, I wish to send a 62 byte SYN packet manually (i do
    not wish this to be abstracted by winsock's connect() function).

    I apologize if i posted to an inappropriate newsgroup, I am just
    unsure how low level I need to go.

    caustik



  2. Re: Raw TCP packets

    c> I wish to send a raw tcp packet (totally generated by my app).

    there are different possibilities to do this.
    one way is to create a raw socket and set the IP_HDRINCL option.



  3. Re: Raw TCP packets

    > I wish to send a raw tcp packet (totally generated by my app).
    > Would i use the winsock sendto() function on a connectionless
    > socket for this? or do I need to go lower level?


    Yes, but IIRC this requires admin rights on the machine.
    Use socket(AF_INET, SOCK_RAW...).

    You can even set the IP_HDRINCL socket option, which will allow you to specify
    the IP header of your own.

    Max



  4. Re: Raw TCP packets

    Depends on whether you want to use WinSock or not. There are other
    approaches but they introduce different APIs. NDISUIO or NDISPROT
    (samples included in the DDK - http://www.microsoft.com/whdc/ddk) are
    examples.

    Stephan
    ---
    On Tue, 29 Jul 2003 14:11:58 -0700, "caustik"
    wrote:

    >Hello,
    >
    >I wish to send a raw tcp packet (totally generated by my app).
    >Would i use the winsock sendto() function on a connectionless
    >socket for this? or do I need to go lower level?
    >
    >For example, I wish to send a 62 byte SYN packet manually (i do
    >not wish this to be abstracted by winsock's connect() function).
    >
    >I apologize if i posted to an inappropriate newsgroup, I am just
    >unsure how low level I need to go.
    >
    >caustik


  5. Re: Raw TCP packets

    You could use UDP for packets smaller that 1500 bytes (for standard
    Ethernet) it will send packet directly as one message unit.
    But if you want to write your network protocol. You can use NDISUIO for user
    mode applications, this is as low as you can go in user mode, but program
    must be executed under administrator credentials.
    Or other solution is to write your own NDIS protocol, everything is well
    documented in DDK.

    Best regards,
    Slobodan

    "caustik" wrote in message
    news:bg6nv1$95l$1@eeyore.INS.cwru.edu...
    > Hello,
    >
    > I wish to send a raw tcp packet (totally generated by my app).
    > Would i use the winsock sendto() function on a connectionless
    > socket for this? or do I need to go lower level?
    >
    > For example, I wish to send a 62 byte SYN packet manually (i do
    > not wish this to be abstracted by winsock's connect() function).
    >
    > I apologize if i posted to an inappropriate newsgroup, I am just
    > unsure how low level I need to go.
    >
    > caustik
    >
    >




+ Reply to Thread