How to write a packet onto the net (or read from the net) with priority - Networking
This is a discussion on How to write a packet onto the net (or read from the net) with priority - Networking ; HOw do I write a packet to the net and ensure that it will be written out
"immediately"?
I am having trouble with an ntp program (chrony) in that if I write out a
packet onto the net, it may ...
-
How to write a packet onto the net (or read from the net) with priority
HOw do I write a packet to the net and ensure that it will be written out
"immediately"?
I am having trouble with an ntp program (chrony) in that if I write out a
packet onto the net, it may take up to a second before it actually gets
sent. Thus the timestamp in the packet which is created just before the
packet is sent is up to a second before the timestamp I get on the tcpdump
output for that packet. -- this is only true sometimes.
That this seems to be a problem in the network layer, is that if I run
tcpdump with the -x ( which dumps the packet contents) that occasional one
second delay disappears.
HOw can I write that packet so that it will actually be sent immediately.
Is there someway I can tell the system that this packet has priority?
(Note I sometimes get the same problem on reading as well-- ie the system
uses select to wait for the something to be read from the port, and at
times I can get 10ms delays between when it arrives according to tcpdump
and when the program actually reads the packet.)
-
Re: How to write a packet onto the net (or read from the net) with priority
On Nov 6, 5:10 pm, Unruh wrote:
> HOw do I write a packet to the net and ensure that it will be written out
> "immediately"?
> I am having trouble with an ntp program (chrony) in that if I write out a
> packet onto the net, it may take up to a second before it actually gets
> sent. Thus the timestamp in the packet which is created just before the
> packet is sent is up to a second before the timestamp I get on the tcpdump
> output for that packet. -- this is only true sometimes.
> That this seems to be a problem in the network layer, is that if I run
> tcpdump with the -x ( which dumps the packet contents) that occasional one
> second delay disappears.
NTP is specifically designed to handle this problem. When it decides
which timestamps to use, it will pick the ones with the lowest round-
trip time specifically to cancel out the effect of unpredictable
asymmetric latency.
That said, you can definitely use tools like htb to prioritize network
traffic.
Start with 'man tc' and googling for 'linux tc htb'. Or go to:
http://trekweb.com/~jasonb/articles/traffic_shaping/
DS