Results 1 to 3 of 3
  1. #1
    kirbo is offline Member
    Join Date
    Jun 2016
    Posts
    1
    Rep Power
    0

    Default Accessing Kernel timestamps when reading packets.

    Hi All,

    In my project I am adding timestamps to TCP packets using System.currentTimeMillis(), as soon as I read them from a socket, this is done in linux user space.

    Would you know if it is possible to read kernel timestamps (i.e., timestamps when packets just entered TCP stack). For example in C it is possible by setting SO_TIMESTAMPING socket option and some flags, however, these options are not valid for Java socket.

    Thanks!

  2. #2
    jim829 is offline Senior Member
    Join Date
    Jan 2013
    Location
    Northern Virginia, United States
    Posts
    6,226
    Rep Power
    13

    Default Re: Accessing Kernel timestamps when reading packets.

    I don't know about that particular option. But it is my experience that the provided interfaces for networking are limited. For example, it would be nice to
    have access to a local networking interface on top of which one could provide their own versions of IP and TCP. But this doesn't exist (at least I couldn't
    find it). Many years ago when I programmed on a very small Unix machine, we had what was known as a raw message interface. We could implement other protocols on top of it. You may need to resort to a third party library tailored to your OS.

    Regards,
    Jim
    The JavaTM Tutorials | SSCCE | Java Naming Conventions
    Poor planning on your part does not constitute an emergency on my part

  3. #3
    gozzy is offline Member
    Join Date
    Jan 2017
    Posts
    46
    Rep Power
    0

    Default Re: Accessing Kernel timestamps when reading packets.

    we had what was known as a raw message interface.
    Yes, what is needed will be found if you google "Java raw socket library" - i haven't used one i'm afraid

Similar Threads

  1. making packets of video and then video of packets
    By Sardar Najam in forum Networking
    Replies: 0
    Last Post: 03-05-2013, 11:43 PM
  2. Accessing the Linux kernel directly?
    By StateMachine in forum Android
    Replies: 1
    Last Post: 01-15-2012, 12:20 PM
  3. Sending Packets to IP
    By MrFish in forum Networking
    Replies: 0
    Last Post: 10-17-2010, 03:33 PM
  4. Reading TCP Packets
    By Clive in forum Networking
    Replies: 0
    Last Post: 07-09-2009, 02:02 PM
  5. Reading or changing sequenc number in TCP packets
    By islamfunny in forum Networking
    Replies: 4
    Last Post: 09-23-2008, 01:44 PM

Posting Permissions

  • You may not post new threads
  • You may not post replies
  • You may not post attachments
  • You may not edit your posts
  •