Skip to contentSkip to conversation

SCTP and IP_TOS

DISCUSSION Ben Greear 2 participants 3 messages Aug 12, 2013

Subsystems (2)
lore
Share & tools
lore

Ben Greear

author
#0 lore raw

Hello!

I notice that I read 0x2 as IP_TOS getsockopt on an SCTP socket configured for streaming mode.

Looks to me like the reason is that SCTP uses a socket type of SCTP_SOCKET_TCP and the ipv4/ip_sockglue.c code is only masking out ECN for SOCK_STREAM types.

Is this per design, or should the ip_sockglue.c mask out ECN for SCTP_SOCKET_TCP types as well?

Thanks,
Ben

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com
#1 lore raw
Quoted 10 lines · Ben Greear

Hello!

I notice that I read 0x2 as IP_TOS getsockopt on an SCTP socket configured for streaming mode.

Looks to me like the reason is that SCTP uses a socket type of SCTP_SOCKET_TCP
and the ipv4/ip_sockglue.c code is only masking out ECN for SOCK_STREAM types.

Quoted 7 lines

Is this per design, or should the ip_sockglue.c mask out ECN for SCTP_SOCKET_TCP
types as well?

Thanks,
Ben

From the ip_glue perspective, you would see either SOCK_STREAM or SOCK_SEQPACKET.

So you are trying to set tos bits on a SEQPACKET socket, ip_sockglue() wouldn't try preserver current ECN bits as it does for STREAM sockets.

-vlad

author
#2 lore raw
Quoted 19 lines · Vlad Yasevich
Quoted 10 lines · Ben Greear

Hello!

I notice that I read 0x2 as IP_TOS getsockopt on an SCTP socket configured for streaming mode.

Looks to me like the reason is that SCTP uses a socket type of SCTP_SOCKET_TCP
and the ipv4/ip_sockglue.c code is only masking out ECN for SOCK_STREAM types.

Quoted 7 lines

Is this per design, or should the ip_sockglue.c mask out ECN for SCTP_SOCKET_TCP
types as well?

Thanks,
Ben

Quoted 5 lines

From the ip_glue perspective, you would see either SOCK_STREAM or
SOCK_SEQPACKET.

So you are trying to set tos bits on a SEQPACKET socket, ip_sockglue() wouldn't try preserver current ECN bits as it does for STREAM sockets.

Actually, I am just reading the TOS, and should never be setting it at all in this particular test case. TCP connections return 0x0 in this case, but SCTP returns 0x2.

It's a small issue, but it screwed up some sub-standard code in my application, so that is why I noticed it.

It *could* be that my app is somehow to blame. I'll poke around in the kernel with printk when I get a chance.

Thanks,
Ben

Quoted 3 lines

-vlad

Signature · 2 lines
Ben Greear <[email protected]>
Candela Technologies Inc  http://www.candelatech.com