Solved

Is there way to obtain the precise time when a UDP packet *arrives*?

Posted on 2004-04-01
4
252 Views
Last Modified: 2010-04-22
Is there way to obtain the precise time when a UDP packet *arrives*? By arrives I mean the exact time it gets buffered in the receive queue and NOT the time when I do a recv()/recvfrom().
0
Comment
Question by:iemonslice
[X]
Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people just like you are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
  • 3
4 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10738737
You can get it from the sk_buff kernel data structure for the packet that arrived ... the
struct timeval      stamp;
has exactly what you are looking for ...

you can find the struct definition in include/linux/Skbuff.c
0
 

Author Comment

by:iemonslice
ID: 10741037
Kernel data structure? Am I able to access it from user space? If it can be accessed, how would I obtain that value?
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 125 total points
ID: 10741085
No, you cannot access it from user space ... you need to register a kernel module with NF_IP_LOCAL_IN hook provided with netfilter framework

I think tcpdump or ethereal should also provide timestamp information ... try them
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10806040
Hi iemonslice,

I came across this new How-to
http://www.iptables.org/documentation/HOWTO//netfilter-hacking-HOWTO-4.html

It seems that it is possible to do some packet handling in user space using libipq ... There is a section devoted to libipq in this how-to .. I am not sure if it would allow access to skb from user space, but still go through it
0

Featured Post

[Webinar] How Hackers Steal Your Credentials

Do You Know How Hackers Steal Your Credentials? Join us and Skyport Systems to learn how hackers steal your credentials and why Active Directory must be secure to stop them. Thursday, July 13, 2017 10:00 A.M. PDT

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

Have you ever been frustrated by having to click seven times in order to retrieve a small bit of information from the web, always the same seven clicks, scrolling down and down until you reach your target? When you know the benefits of the command l…
The purpose of this article is to demonstrate how we can upgrade Python from version 2.7.6 to Python 2.7.10 on the Linux Mint operating system. I am using an Oracle Virtual Box where I have installed Linux Mint operating system version 17.2. Once yo…
In this video we outline the Physical Segments view of NetCrunch network monitor. By following this brief how-to video, you will be able to learn how NetCrunch visualizes your network, how granular is the information collected, as well as where to f…
Visualize your data even better in Access queries. Given a date and a value, this lesson shows how to compare that value with the previous value, calculate the difference, and display a circle if the value is the same, an up triangle if it increased…

623 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question