LinuxQuestions.org
Visit the LQ Articles and Editorials section
Go Back   LinuxQuestions.org > Forums > Non-*NIX Forums > Programming
User Name
Password
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.

Notices

Reply
 
Search this Thread
Old 10-15-2008, 05:37 AM   #1
srikantap
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?

Ex:
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
zmanea
Member
 
Registered: Sep 2003
Location: Colorado
Posts: 85

Rep: Reputation: 15
Take a look at tc.

http://linux.die.net/man/8/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
srikantap
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)

Thanks.
 
Old 11-21-2011, 06:12 AM   #4
sonika_singhi
Member
 
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
 
  


Reply

Tags
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


All times are GMT -5. The time now is 07:49 AM.

Main Menu
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
identi.ca: @linuxquestions
Facebook: linuxquestions Google+: linuxquestions
Open Source Consulting | Domain Registration