How to write a packet onto the net (or read from the net) with priority

Discussion in 'Linux Networking' started by Unruh, Nov 7, 2007.

  1. Unruh

    Unruh Guest

    HOw do I write a packet to the net and ensure that it will be written out
    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.)
    Unruh, Nov 7, 2007
    1. Advertisements

  2. 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
    Start with 'man tc' and googling for 'linux tc htb'. Or go to:

    David Schwartz, Nov 7, 2007
    1. Advertisements

Ask a Question

Want to reply to this thread or ask your own question?

You'll need to choose a username for the site, which only take a couple of moments (here). After that, you can post your question and our members will help you out.