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 |
Welcome to LinuxQuestions.org, a friendly and active Linux Community.
You are currently viewing LQ as a guest. By joining our community you will have the ability to post topics, receive our newsletter, use the advanced search, subscribe to threads and access many other special features. Registration is quick, simple and absolutely free. Join our community today!
Note that registered members see fewer ads, and ContentLink is completely disabled once you log in.
Are you new to LinuxQuestions.org? Visit the following links:
Site Howto |
Site FAQ |
Sitemap |
Register Now
If you have any problems with the registration process or your account login, please contact us. If you need to reset your password, click here.
Having a problem logging in? Please visit this page to clear all LQ-related cookies.
Get a virtual cloud desktop with the Linux distro that you want in less than five minutes with Shells! With over 10 pre-installed distros to choose from, the worry-free installation life is here! Whether you are a digital nomad or just looking for flexibility, Shells can put your Linux machine on the device that you want to use.
Exclusive for LQ members, get up to 45% off per month. Click here for more info.
|
 |
10-15-2008, 05:37 AM
|
#1
|
LQ Newbie
Registered: Oct 2008
Posts: 2
Rep:
|
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.
|
|
|
10-15-2008, 10:39 PM
|
#2
|
Member
Registered: Sep 2003
Location: Colorado
Posts: 85
Rep:
|
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.
|
|
|
10-17-2008, 11:43 AM
|
#3
|
LQ Newbie
Registered: Oct 2008
Posts: 2
Original Poster
Rep:
|
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.
|
|
|
11-21-2011, 06:12 AM
|
#4
|
Member
Registered: Oct 2004
Location: india
Distribution: fedora core
Posts: 34
Rep:
|
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
|
|
|
All times are GMT -5. The time now is 09:27 AM.
|
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.
|
Latest Threads
LQ News
|
|