LinuxQuestions.org
Share your knowledge at the LQ Wiki.
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 05-24-2018, 01:24 AM   #1
anant.konchada
LQ Newbie
 
Registered: May 2010
Posts: 10

Rep: Reputation: 0
DSCP Marking for selected TCP packets


Hi, I have a special usecase to mark DSCP for selected packets on a given socket connection. I was able to set DSCP at socket connection (using setsockopt) and this is applied to all packets sent on that connection. But not finding a way to mark DSCP for only required packets. Can some one who already tried (any method) guide me on how to achieve this?
 
Old 05-24-2018, 02:37 PM   #2
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,853

Rep: Reputation: 161Reputation: 161
What's your meaning, required packets?
 
Old 05-24-2018, 11:27 PM   #3
anant.konchada
LQ Newbie
 
Registered: May 2010
Posts: 10

Original Poster
Rep: Reputation: 0
I mean instead of marking all packets sent on a given TCP connection.
I would like to mark DSCP value for some packets based on application content (in that packet) at the time of sending packet on that socket.
I am not finding any way to manage this while sending packet using socket send API. Is there a way using socket APIs or any alternate way?
 
Old 05-25-2018, 02:44 PM   #4
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,853

Rep: Reputation: 161Reputation: 161
you can use raw socket to control any field in IP and TCP header. It request more code.
 
Old 05-26-2018, 02:27 AM   #5
anant.konchada
LQ Newbie
 
Registered: May 2010
Posts: 10

Original Poster
Rep: Reputation: 0
Thanks nini09. Can you direct me to any sample, just for my reference. Thanks in advance.
 
Old 05-30-2018, 03:01 PM   #6
nini09
Senior Member
 
Registered: Apr 2009
Posts: 1,853

Rep: Reputation: 161Reputation: 161
The link has example code of raw socket for UDP and TCP, http://www.tenouk.com/Module43a.html.
 
  


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
Netfilter marking facebook packets as 'invalid' alpha645 Linux - Networking 5 12-29-2012 07:02 AM
Per-packet IP DSCP/TOS Marking srikantap Programming 3 11-21-2011 06:12 AM
Problem with DSCP tagging of DHCP Discovery packets mic.sed Linux - Networking 0 06-21-2010 02:52 AM
marking ARP packets with ebtables problem mgautam Linux - Networking 0 10-19-2009 04:34 AM
TCP packet with RST flag not carrying DSCP Solace Linux - Networking 0 10-08-2009 12:02 PM

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

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