Click here to Skip to main content
13,054,615 members (48,482 online)
Rate this:
Please Sign up or sign in to vote.
I am writing a socket application in c# to talk to a unix device. I am using TCP/IP and my program looks something like the below. The below is just snippets from the whole code..

socket = new Socket(AddressFamily.InterNetwork, SocketType.Stream, ProtocolType.Tcp);

I was able to get an example of 1 command in bytes,using wireshark/ethereal network analyzer, that the unix device is expecting.I found out using wireshark that the unix device is expecting a timestamp(or i think it is a timestap) under the Transmission protrocol level options. If I look under wire shark under the Transmission protocol level heading I see a new thing under options(Timestamps: TSval 18139934, TSecr 533285028 and NOP) as show below-

Transmission Control Protocol, Src Port: 15100 (15100), Dst Port: 33526 (33526), Seq: 1, Ack: 17, Len: 0
    Source port: 15100 (15100)
    Destination port: 33526 (33526)
    [Stream index: 3]
    Sequence number: 1    (relative sequence number)
    Acknowledgement number: 17    (relative ack number)
    Header length: 44 bytes
    Flags: 0x10 (ACK)
        0... .... = Congestion Window Reduced (CWR): Not set
        .0.. .... = ECN-Echo: Not set
        ..0. .... = Urgent: Not set
        ...1 .... = Acknowledgement: Set
        .... 0... = Push: Not set
        .... .0.. = Reset: Not set
        .... ..0. = Syn: Not set
        .... ...0 = Fin: Not set
    Window size: 66560 (scaled)
    Checksum: 0x45eb [validation disabled]
        [Good Checksum: False]
        [Bad Checksum: False]
   <code> Options: (24 bytes)
        Timestamps: TSval 18139934, TSecr 533285028
        SACK: 1-17
            left edge = 1 (relative)
            right edge = 17 (relative)</code>    [SEQ/ACK analysis]
        [This is an ACK to the segment in frame: 25]
        [The RTT to ACK the segment was: 0.201174000 seconds]

The problem is that when I send out my code using socket programming, I dont see the time stamp or options field in wireshark. All 12 bytes are missing. How do i add this? I know there are socketoptions() function but I dont know how to use it. Any help will be appreciated.
Posted 16-Jul-10 15:50pm
Rate this: bad
Please Sign up or sign in to vote.

Solution 1

What you have captured looks like TCP/IP protocol exchange which is managed by the underlying system software on both sides. The message exchange at the socket level has nothing to do with this data. You should agree the protocol exchange between your client and the UNIX system and send messages as appropriate to that protocol.
Rate this: bad
Please Sign up or sign in to vote.

Solution 2

Wow this was crazy. I finally figured out that the server was not setup to connect properly.


This content, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)

  Print Answers RSS
Top Experts
Last 24hrsThis month

Advertise | Privacy | Mobile
Web02 | 2.8.170713.1 | Last Updated 17 Feb 2011
Copyright © CodeProject, 1999-2017
All Rights Reserved. Terms of Service
Layout: fixed | fluid

CodeProject, 503-250 Ferrand Drive Toronto Ontario, M3C 3G8 Canada +1 416-849-8900 x 100