Solved

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

Posted on 2004-04-01
4
246 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

Independent Software Vendors: We Want Your Opinion

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

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 fix the unknown display problem in Linux Mint operating system. After installing the OS if you see Display monitor is not recognized then we can install "MESA" utilities to fix this problem or we can install additio…
Finds all prime numbers in a range requested and places them in a public primes() array. I've demostrated a template size of 30 (2 * 3 * 5) but larger templates can be built such 210  (2 * 3 * 5 * 7) or 2310  (2 * 3 * 5 * 7 * 11). The larger templa…
Are you ready to implement Active Directory best practices without reading 300+ pages? You're in luck. In this webinar hosted by Skyport Systems, you gain insight into Microsoft's latest comprehensive guide, with tips on the best and easiest way…

738 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