encapsulating user info inside tcp ip header - TCP-IP

This is a discussion on encapsulating user info inside tcp ip header - TCP-IP ; is there a way to encapsulate user info inside tcp/ip header(perhaps using socket options or using unused fields). because I 'd like to get information before rceiving on the socket. on the client side ============== SOCKET s; initializaion of the ...

+ Reply to Thread
Results 1 to 7 of 7

Thread: encapsulating user info inside tcp ip header

  1. encapsulating user info inside tcp ip header

    is there a way to encapsulate user info inside tcp/ip header(perhaps
    using socket options or using unused fields).

    because I 'd like to get information before rceiving on the socket.
    on the client side
    ==============
    SOCKET s;
    initializaion of the socket.

    setSocketOption(s,key,"hello");

    on the sever side
    ===============
    SOCKET c =accept(serversocket..);
    char str[32];
    getSocketOption(c,key,&str);

    thanks.

    Kat.


  2. Re: encapsulating user info inside tcp ip header

    No.
    A TCP socket is just a byte-stream.

    Are you thinking in terms of OSI connection-data ? Does not
    exist, you have to accept() the incoming connection and
    then read() or close()


  3. Re: encapsulating user info inside tcp ip header

    In article <1147940674.420290.68040@u72g2000cwu.googlegroups.c om>,
    blackstreetcat@hotmail.com wrote:

    > is there a way to encapsulate user info inside tcp/ip header(perhaps
    > using socket options or using unused fields).


    TCP does have an options field in the header, but I don't think any
    common APIs provide a way to put custom data there. Why don't you just
    include this as part of your application protocol?

    --
    Barry Margolin, barmar@alum.mit.edu
    Arlington, MA
    *** PLEASE post questions in newsgroups, not directly to me ***
    *** PLEASE don't copy me on replies, I'll read them in the group ***

  4. Re: encapsulating user info inside tcp ip header

    Howdy,

    Look into IPSec, it bumps the stack and has several portable options
    for authentication/encryption before the transport layer.

    -Matt


  5. Re: encapsulating user info inside tcp ip header

    Thanks guys for the replys.

    I tried to google "ipsec" and I could not find any code that will help
    me use this protocol.

    does anyone has a code snippet I can use?

    thanks.

    Kat.


  6. Re: encapsulating user info inside tcp ip header

    Thanks guys for the replys.

    I tried to google "ipsec" and I could not find any code that will help
    me use this protocol.

    does anyone has a code snippet I can use?

    thanks.

    Kat.


  7. Re: encapsulating user info inside tcp ip header

    blackstreetcat@hotmail.com writes:

    > Thanks guys for the replys.
    >
    > I tried to google "ipsec" and I could not find any code that will help
    > me use this protocol.


    Perhaps
    http://ipsec-tools.sourceforge.net/

    / Kari Hurtta

+ Reply to Thread