Review your favorite Linux distribution.
Go Back > Forums > Non-*NIX Forums > Programming
User Name
Programming This forum is for all programming questions.
The question does not have to be directly related to Linux and any language is fair game.


  Search this Thread
Old 10-15-2008, 05:37 AM   #1
LQ Newbie
Registered: Oct 2008
Posts: 2

Rep: Reputation: 0
Per-packet IP DSCP/TOS Marking

It is interesting to know whether there is a way to conditionally mark *each* outgoing IP packet with a *different* DSCP/TOS marking?

Basically: If I have a TCP socket which is used by 2 different applications, each of which generates a particular kind of data; Is it possible to mark some flag using socket API's (or otherwise), which informs IP layer to perform DSCP marking based on the flag set?

I write a program to do the following:
==> Open socket.
==> If data is from application A, set flag abc.
Or if data is from application B, set flag xyz.
==> Send.

And, when it reaches IP, it:
==> Marks DSCP field of the packet with 11 if flag abc is set;
==> Marks DSCP field of the packet with 22 if flag xyz is set.

Thanks for any pointers or suggestions.
Old 10-15-2008, 10:39 PM   #2
Registered: Sep 2003
Location: Colorado
Posts: 85

Rep: Reputation: 15
Take a look at tc.

I do not know of a way to tag the traffic based on the socket but there should be some other way to identify the traffic based on ports, protocol, destination, etc.
Old 10-17-2008, 11:43 AM   #3
LQ Newbie
Registered: Oct 2008
Posts: 2

Original Poster
Rep: Reputation: 0
Thanks Zmanea. But I was interested in knowing whether packets can be marked differently within a application which generates 2 types of data.
(In the example I wrote, I didn't actually mean 2 different applications (with different port numbers), but used it to imply two different types of data, sent on a single socket)

Old 11-21-2011, 06:12 AM   #4
Registered: Oct 2004
Location: india
Distribution: fedora core
Posts: 34

Rep: Reputation: 15
Hello Srikant,

Did you find any solution to your requirement.
Please share it, i am too stuck up @ the same point.

Thanks in anticipation
Regards, Sonika


flag, ip, mark, outgoing, target

Thread Tools Search this Thread
Search this Thread:

Advanced Search

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
iptables+DSCP abakali Linux - Networking 2 10-12-2007 06:03 AM
iptables packet marking and hfsc xanax Linux - Networking 0 02-18-2007 11:43 PM
ipables - difference between dscp and tos? Infernal211283 Linux - Networking 2 01-10-2006 11:59 PM
iptables packet marking meks Linux - Networking 0 09-21-2004 05:14 PM
iptables - dscp not matches brabard Linux - Networking 9 10-16-2003 12:08 PM > Forums > Non-*NIX Forums > Programming

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

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