How to set TOS bits for a grpc client stream?

300 views
Skip to first unread message

Steven Jiang

unread,
Mar 3, 2017, 2:43:15 PM3/3/17
to grpc.io
Hi,
I'd like to set TOS bits for a grpc client stream.  The stream is created by calling grpc.Dial.  grpc.Dial calls net.DialTCP  -> dialTCP -> internetSocket -> socket.  I don't find any chance to set TOS between fd creation and fd.dial which calls connect().  I tried calling SetsockoptInt to change TOS after socket get connected, but this change was ignored by the socket.  TOS value remains 0 in the ip header. 

Could anyone tell me how to set TOS bits for a grpc client stream? Is it supported now?


Thanks
Steven

mmu...@google.com

unread,
Mar 7, 2017, 7:10:39 PM3/7/17
to grpc.io
Which language is your client in?
We support setting GTOS values in google3. 

Steven Jiang

unread,
Mar 7, 2017, 11:19:41 PM3/7/17
to grpc.io, mmu...@google.com
Client is also written in GO.  I can't access this DialConfig https://cs.corp.google.com/piper///depot/google3/net/grpc/go/client.go?l=44.  We are using GO 1.6.2 (grpcgo 1.0).  Do you mean it's not supported in GO 1.6.2?

Thanks
Steven

mmu...@google.com

unread,
Mar 16, 2017, 1:54:54 PM3/16/17
to grpc.io, mmu...@google.com
Hey Steven,
First of all, apologies for a late response.
I reckon you're building gRPC from github then. If so, please ignore the last message.
To set a TOS value you can provide a custom dialer in the dial options using WithDIaler(). Now how you use this dialer to create a net.Conn object is entirely your discretion. At this point it's more about what golang than gRPC. The following link might help with setting socket options on the fd(both before and after calling Connect):  

Best,
Mak

vlatko...@gmail.com

unread,
Jun 25, 2018, 11:58:29 AM6/25/18
to grpc.io
This thread is a bit old, but I was wondering if setting TOS bits is possible when using the Python grpc API? 

Srini Polavarapu

unread,
Jul 6, 2018, 5:04:40 PM7/6/18
to grpc.io
Setting TOS is not available in Python API. Please open an issue on github so we can track it as an enhancement.
Reply all
Reply to author
Forward
0 new messages