ProgrammingThis 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.
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.
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.
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.
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)
LinuxQuestions.org is looking for people interested in writing
Editorials, Articles, Reviews, and more. If you'd like to contribute
content, let us know.