Forwarder module next up previous
Next: THOP communication protocol Up: Implementation details Previous: Dispatcher module

Forwarder module

The forwarder module must intercept client segments belonging to already transferred TCP connections and transmit them to the appropriate Web server. To this purpose, we implemented an efficient hash table of structures representing transferred TCP connections, as described in Section 2.2. The TCP protocol allows port reuse when a connection is in the TIME_WAIT state [23]. Under very bursty traffic conditions, it may happen that a client wants to reuse a TCP connection in the TIME_WAIT state, by sending a SYN packet. In this case, the forwarder delivers the SYN directly to the Web server, instead of performing the three-way handshake. As a consequence, the following client request would have no chance of being parsed by the Web switch. To address this issue, we have implemented a further functionality in the forwarder module. We check every client packet for a FIN or a RST flag, which indicates an intention of closing the TCP connection. If a FIN or a RST is intercepted, the matching element in the table of transferred connections is marked as ''closed''. When the forwarder module receives a subsequent SYN packet from the client, it checks whether the matching element in the table of transferred connections is marked as closed. This event means that a TCP port has been reused. As a consequence, the element is removed from the hash table, to avoid any forwarding towards the previous Web server. Furthermore, the client SYN is passed to the upper layers of the TCP/IP stack. In this way, a three-way handshake is performed and the request is dispatched to another server with no problem. The hash table of transferred connections is implemented through a Linux slab cache [14] of pre-allocated structure elements. This design choice allows for very fast allocation and release operations, which are quite frequent under heavy traffic. We have chosen to implement the forwarding mechanism just under the IP level of the TCP/IP stack. In this way, client packets towards the Web servers must not travel the TCP/IP stack of the switch node, thus avoiding costly checksum (re)computation.
next up previous
Next: THOP communication protocol Up: Implementation details Previous: Dispatcher module
Mauro Andreolini 2003-03-13