LinuxQuestions.org
Visit Jeremy's Blog.
Home Forums Tutorials Articles Register
Go Back   LinuxQuestions.org > Forums > Linux Forums > Linux - Networking
User Name
Password
Linux - Networking This forum is for any issue related to networks or networking.
Routing, network cards, OSI, etc. Anything is fair game.

Notices


Reply
  Search this Thread
Old 12-19-2002, 04:27 AM   #1
saintt
LQ Newbie
 
Registered: Aug 2001
Location: London
Distribution: SuSE 7.1/7.3
Posts: 25

Rep: Reputation: 15
Time stamping TCP packets at the device driver level


I'm currently doing some latency timings on some code I've written.

I'm trying to determine the time taken from receipt of a packet by the network device driver until the packet is handled by my code.

To do this, I am going to send a stream of known TCP messages to the machine. I will then modify the device driver to add a time-stamp to the data section of all incoming TCP messages. This can then be compared with with the system time when the packet is received by my application.

I have found the location in the device driver where it allocates incoming packets to the sk_buff structure, but I have two problems to overcome before I can implement my proposed solution.

1) When is the transport protocol of an incoming packet determined?
2) How can I determine the transport protocol of an sk_buff structure?

Thanks in advance for any help,


Will
 
Old 12-20-2002, 04:18 AM   #2
unSpawn
Moderator
 
Registered: May 2001
Posts: 29,415
Blog Entries: 55

Rep: Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600Reputation: 3600
1. If I read stuff right, right after the dev driver yanks the data into the buffer it calls netif_rx* which timestamps it and places it in the queue.
2. Dunno.
0, 1, 2, and netfilter doc stuff is what I'm looking at.

Last edited by unSpawn; 12-20-2002 at 04:20 AM.
 
Old 12-20-2002, 05:02 AM   #3
saintt
LQ Newbie
 
Registered: Aug 2001
Location: London
Distribution: SuSE 7.1/7.3
Posts: 25

Original Poster
Rep: Reputation: 15
Can I see this time stamp from the application layer? For example, I'll have an open socket, which will trigger a select statement, which I'll then go to read from.

At that point, how do I get hold of the timestamp put in earlier?


Thanks for your help, this is the first time I've had to look at the Linux low-level networking - and at first it can be slightly daunting!
 
  


Reply



Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is Off
HTML code is Off



Similar Threads
Thread Thread Starter Forum Replies Last Post
Proftpd - Time Stamping Incorrect ]SK[ Linux - Software 0 08-29-2005 04:30 AM
encapsulating TCP packets in UDP packets... yoshi95 Programming 3 06-03-2004 02:53 PM
tcp packets wedgeworth Linux - Software 7 05-10-2004 04:40 PM
how packets handled at kernel level valib4u Programming 5 09-14-2003 03:58 AM
tcp/ip packets lackluster Programming 4 07-07-2002 05:57 PM

LinuxQuestions.org > Forums > Linux Forums > Linux - Networking

All times are GMT -5. The time now is 07:46 AM.

Main Menu
Advertisement
My LQ
Write for LQ
LinuxQuestions.org is looking for people interested in writing Editorials, Articles, Reviews, and more. If you'd like to contribute content, let us know.
Main Menu
Syndicate
RSS1  Latest Threads
RSS1  LQ News
Twitter: @linuxquestions
Open Source Consulting | Domain Registration