LinuxQuestions.org
Help answer threads with 0 replies.
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-02-2016, 02:17 PM   #1
varunchari
LQ Newbie
 
Registered: Dec 2016
Posts: 2

Rep: Reputation: Disabled
Unable to prioritize TCP traffic using ToS fields


Hello,
I am trying to prioritize TCP traffic using ToS field in IP header.
I am saturating the interface(ethernet) by sending 1GB data through iperf with ToS field set to 0x10 (Minimize-Delay).
I then start another TCP client with default ToS (0).

Expectation :
My TCP client should not send data till iperf completes sending its data.

Result:
The data from my client is sent even tough iperf is sending packets with higher priority.

I also tried to create the same scenario by creating 2 separate clients and allocating 0x10 and 0x08 ToS to respective clients using iptables.
I used :
iptables -A PREROUTING -t mangle -p tcp --sport 5000 -j TOS --set-tos Minimize-Delay

I am still not able to prioritize one client over other.
Altough I can see the packets marked with ToS in wireshark.

I am using Ubuntu (14.04) with iptables version 1.4.21

Can someone kindly help me solve the issue?

Thanks
Varun
 
Old 12-04-2016, 11:25 AM   #2
Ser Olmy
Senior Member
 
Registered: Jan 2012
Distribution: Slackware
Posts: 3,339

Rep: Reputation: Disabled
How are you enforcing the ToS values?

Setting the ToS field by itself does nothing unless you also configure traffic shaping and map ToS values to queues with different priorities.
 
Old 12-05-2016, 09:31 AM   #3
varunchari
LQ Newbie
 
Registered: Dec 2016
Posts: 2

Original Poster
Rep: Reputation: Disabled
Hi Ser Olmy,
Thanks for the suggestion.
I am not enforcing the ToS.
I am under the understanding that the Linux kernel by itself uses the HTB to prioritize the packets if marked with ToS.
Can you kindly clarify if I am wrong.

Also I tried using : sudo tc qdisc add dev eth0 root handle 1:0 htb
but there was still no effect.

Thanks
Varun
 
Old 12-05-2016, 01:27 PM   #4
sundialsvcs
LQ Guru
 
Registered: Feb 2004
Location: SE Tennessee, USA
Distribution: Gentoo, LFS
Posts: 10,659
Blog Entries: 4

Rep: Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939Reputation: 3939
Well, let us also never quite forget that: "CPUs work with nanoseconds, while networks still work with "milliseconds, at best."

"What? This packet arrived one millisecond later than that one?" Good grief! "Why, that's millions of nanoseconds!"

And so it goes.

The bottom line is that (I think ...) your objective cannot(!) be achieved through traffic shaping of any kind:
Quote:
"My TCP client should not send data till iperf completes sending its data."
At least to my way of thinking, the only possible way to achieve any such objective is to have the two programs in question actually talk to one another. They both must, first of all, be aware of each other. Your "TCP client" must be waiting for the receipt of some message from "iperf" ... a message that "iperf" knows to send after it has, in its judgment, "completed sending its data."

This entire interaction will occur across a timeframe of milliseconds ... or seconds ... or minutes ... or ...
 
  


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
LXer: How TCP Offload Engines scale up the TCP traffic bandwidth by up to 8x on existing Ethernet Ne LXer Syndicated Linux News 0 02-16-2012 10:01 PM
Snort/Base reporting no traffic, Ntop not showing any TCP traffic. a2brute Linux - Security 1 08-10-2009 12:21 PM
Incoming traffic prioritize dorian33 Linux - Networking 8 10-26-2008 05:44 AM
Traffic shaping (limiting outgoing bandwidth of all TCP-traffic except FTP/HTTP) ffkodd Linux - Networking 3 10-25-2008 12:09 AM
prioritize (inversely) P2P traffic. eantoranz Linux - Networking 0 08-11-2005 09:26 AM

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

All times are GMT -5. The time now is 01:27 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