Bugzilla – Bug 1361
Set TOS from Application level (sockets)
Last modified: 2012-11-20 18:00:49 EST
http://groups.google.com/group/ns-3-users/browse_thread/thread/5be010835c4b5b71 Sockets should have an option like Linux's one: ----- SO_PRIORITY Set the protocol-defined priority for all packets to be sent on this socket. Linux uses this value to order the networking queues: packets with a higher priority may be processed first depending on the selected device queueing discipline. For ip(7), this also sets the IP type-of-service (TOS) field for outgoing packets. Setting a priority outside the range 0 to 6 requires the CAP_NET_ADMIN capability. ----- IPv4 and IPv6 should honor the SO_PRIORITY. Filing the bug with "enhancement" priority as a reminder.
Not sure if anyone is still interested in setting ToS. Setting the ToS field on the socket should not a problem. I'm not sure about IPv4 and IPv6 honoring the ToS field as it seems to me that the support is ambiguous and is OS/device specific.
(In reply to comment #1) > Not sure if anyone is still interested in setting ToS. > > Setting the ToS field on the socket should not a problem. > > I'm not sure about IPv4 and IPv6 honoring the ToS field as it seems to me that > the support is ambiguous and is OS/device specific. I would be interested if someone provided a patch for this. I would suggest first to propose the API, get some agreement, then work on the implementation. We tend to try to align with Linux in the ns-3 IP implementation, so I would suggest to look at how IP_TOS, IP_RECVTOS, IPV6_TCLASS, and IPV6_RECVTCLASS are supported and try to mimic the behavior, as a first step.
I will think about the API for this. How do you want me to propose the API? Directly in here or the code review?
Please refer to: http://codereview.appspot.com/6488134/ I could not find an option to set IP_TCLASS for IPv6 in the Linux kernel. Not sure if I missed it. As far as I know, the current Linux kernel still using IP TOS, not DSCP.
Sorry for the re-post. I made some changes to support IPv6 IPV6_TCLASS option. http://codereview.appspot.com/6543061/
Changeset: 9145:5752b425cdf5