Take the 2-minute tour ×
Super User is a question and answer site for computer enthusiasts and power users. It's 100% free, no registration required.

How much time does it take, from the time the data is received by the network card, until it is time stamped by the Linux kernel? Is it in microseconds? nanoseconds?

How I can improve this latency? Would a real-time kernel reduce this latency?

Thanks anyone for helping out!

share|improve this question
1  
A real time kernel is likely to cause MORE problems. . . –  surfasb Aug 1 '11 at 21:33
    
Can you please elaborate on why? –  user92538 Aug 2 '11 at 19:12
    
Easy. A RTOS has to execute a set of instructions between interrupts. If it can't, it will start dropping less critical process, which MAY include recording the time stamps. But that doesn't answer the pressing question. "What level of precision and accuracy do you REALLY need?" –  surfasb Aug 2 '11 at 21:39
    
The time stamping accuracy should be in the nanosecond range. I heard that this can be achieved by timestamping in the hardware adapter level. However I can't find adapters supporting that yet. –  user92538 Aug 3 '11 at 15:58
    
FYI: Latency does not normally include processing overhead but is more a measure of delay added by the network itself. This makes sense because machine loads and application logic varies greatly. –  Matt H Feb 8 '12 at 18:59

1 Answer 1

A real-time kernel means it is "deterministic" which means that it makes a hard guarantee to answer an interrupt in a given timeframe. Also, packets are different lengths, so the time it takes to process each will vary. But of course, the interrupt can be answered sooner. So it won't help you.

As a rough estimate I would think on today's CPU's it'd be less than a microsecond and shouldn't adversely affect your ping time for gaming or whatnot. But you can bypass the CPU somewhat if your network card supports "TCP Offland Engine" or TOE.

share|improve this answer
    
Can the time from when the frame is received by the network adapter, till the time it was timestamped, be measured in some way? –  user92538 Aug 3 '11 at 15:59
    
Sorry to take so long to answer. It can but you run into problems. Most modern CPUs have a timestamp counter that increments once per CPU cycle. However, the time a CPU cycle consumes may vary on modern processors because they can change their speed according to power management. So with careful assembly level programming, it is possible. I don't know what the capabilites of all the current NIC drivers are. You are probably looking at writing your own CPU-specific custom NIC driver to get a very accurate measurement. –  ultrasawblade Feb 9 '12 at 1:25

Your Answer

 
discard

By posting your answer, you agree to the privacy policy and terms of service.