Reflect TOS from thrift server
Summary: There are efforts as part of the OlympicQos initiative to ensure QOS configuration for all network transfers. As part of these efforts, one of the requirements is the ensure TOS marking for server-->client traffic. Since the server does not have a way of knowing the priority of the response, the server needs to reflect the TOS settings from the client. The idea is the cache the client's SYN, derive the TOS from the same and set hte same TOS for the responses. Made changes to 1) setsockopt(TCP_SAVE_SYN) in AsyncServerSocket() for all listen sockets 2) Upon an accepted connection, getsockopt(TCP_SAVED_SYN) to get the TOS from IPv6 header and setsockopt to set TOS on the connected socket. Do this conditionallly (based on tosReflect_ setting and only for family IPv6) 3) Added API setTosReflect() to enable the feature and included flag on thrift server to control the same Reviewed By: yfeldblum Differential Revision: D9566136 fbshipit-source-id: ad61fed4e205893e2b7c5654e1b4f21ed5472c06
Showing
Please register or sign in to comment