Re: Improving qos_flows mark feature - obtaining mark later

From: Alex Rousskov <rousskov_at_measurement-factory.com>
Date: Mon, 17 Oct 2011 10:34:44 -0600

On 10/16/2011 04:23 PM, Andrew Beverley wrote:

> I've been using the qos_flows feature for preserving a netfilter mark,
> but have run into some problems.
>
> Currently, the netfilter mark for the connection is obtained in
> forward.cc, during the stages of opening a connection to the remote
> server. The problem with this is that the connection mark may change
> once the reply is received.
>
> So, I would like to move Ip::Qos::getNfmarkFromServer() from
> FwdState::dispatch to a function that is called during the server reply
> stage. However, I can't work out where it should go.

Could you define "server reply stage" more precisely, please? If you
want that function to be called once per [HTTP] response, then the
definition should be that of a single response "state change" and not a
continuous "reply stage". If you want that function to be called once
per connection, then the definition should be based on
connection-specific state changes and not on the response state change. Etc.

> I've looked at moving it to client_side_reply.cc, but I can't find a way
> to retrieve the remote server connection information. I've also looked
> at comm_read() in comm.cc, but I can't find the client connection
> information and it looks like the wrong place anyway.

client_side_reply.cc is dealing with receiving responses from Store.
Such responses may have no connection associated with them. If you must
have access to the server connection, then you should look on the server
side (forward.cc, Server.cc, http.cc, ftp.cc, etc. with tunnel.cc being
a special case). See Amos' email for more details.

BTW, code common to HTTP and FTP handling should go into Server.cc to
the extent possible.

> Where is the best place to move it to, where it has access to both the
> client and server side connection, but where it is late enough to read
> the mark value if it changes during the server reply?

Please note that "during the server reply" may take an hour. Do you want
to do something once per reply, every time there are new bytes read from
the origin server, or every time a new piece of response body is given
to the client side, for example?

Thank you,

Alex.
Received on Mon Oct 17 2011 - 16:35:11 MDT

This archive was generated by hypermail 2.2.0 : Tue Nov 01 2011 - 12:00:10 MDT