Why TCP_PAWS_WINDOW is needed?

From: Zhaorong Zeng (zrzeng@linuxforum.net)
Date: Thu Jul 31 2003 - 05:48:42 EST

I am reading linux tcp codes, and I encountered some
questions, would somebody there help to explain?

in tcp_ipv4.c, function tcp_v4_conn_request(),
there are statements like:
 } else if (isn == 0) {
  struct inet_peer *peer = NULL;

  /* VJ's idea. We save last timestamp seen
   * from the destination in peer table, when entering
   * state TIME-WAIT, and check against it before
   * accepting new connection request.
   * If "isn" is not zero, this request hit alive
   * timewait bucket, so that all the necessary checks
   * are made in the function processing timewait state.
  if (tp.saw_tstamp &&
      sysctl_tcp_tw_recycle &&
      (dst = tcp_v4_route_req(sk, req)) != NULL &&
      (peer = rt_get_peer((struct rtable*)dst)) != NULL &&
      peer->v4daddr == saddr) {
   if (xtime.tv_sec < peer->tcp_ts_stamp + TCP_PAWS_MSL &&
       (s32)(peer->tcp_ts - req->ts_recent) > TCP_PAWS_WINDOW) {
    goto drop_and_free;
what I donot understand is why TCP_PAWS_WINDOW is needed?

The inner most "if ..." statement seems to mean that
if the saved timestamp in peer is valid and the new connection
request's timestamp is TCP_PAWS_WINDOW ticks before that of peer,
the req is considered as old duplicate segment and is droped.

Why not use (peer->tcp_ts > req->ts_recent) directly? I mean,
why there must be TCP_PAWS_WINDOW differences?

Thanks again.

To unsubscribe from this list: send the line "unsubscribe linux-net" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html

This archive was generated by hypermail 2b29 : Thu Jul 31 2003 - 22:00:02 EST