IP_RECVTOS

Michael Tuexen Michael.Tuexen at lurchi.franken.de
Wed Jun 6 10:34:48 UTC 2012


On Jun 6, 2012, at 10:15 AM, Adrian Chadd wrote:

> Well,
> 
> * Is it usable on a TCP socket?
No. The main application (I see) is to access the ECN bits. In the TCP case,
ECN is handled in the kernel, so there is no need to deal with them in
userland.
On the other hand, TCP is byte stream oriented, so I don't see any packet
boundaries. However, the TOS is per packet. Much like the TTL. This is also
limited to SOCK_DGRAM.
> * Is it usable on an outbound TCP socket (ie, where the receive end
> has set the ToS bits on the received ToS), regardless of what you've
> set for the sending ToS?
You can use the IP_TOS socket option for outgoing traffic.
> * Does the receive TOS change during the lifetime of a TCP connection?
The sender can change it.
> If so, can this fetch it?
No. The IP_RECVTOS is similar to the IPV6_RECVTCLASS socket option.
> * Example code? :)
Attached.

Best regards
Michael

-------------- next part --------------
A non-text attachment was scrubbed...
Name: v4test.c
Type: application/octet-stream
Size: 4126 bytes
Desc: not available
Url : http://lists.freebsd.org/pipermail/freebsd-net/attachments/20120606/2ff878aa/v4test.obj
-------------- next part --------------


> 
> 
> 
> Adrian
> 



More information about the freebsd-net mailing list