Why TCP_PAWS_WINDOW is needed?

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

 



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

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) {
    NET_INC_STATS_BH(PAWSPassiveRejected);
    dst_release(dst);
    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.

-
: 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

[Index of Archives]     [Netdev]     [Ethernet Bridging]     [Linux 802.1Q VLAN]     [Linux Wireless]     [Kernel Newbies]     [Security]     [Linux for Hams]     [Netfilter]     [Git]     [Bugtraq]     [Yosemite News and Information]     [MIPS Linux]     [ARM Linux]     [Linux RAID]     [Linux PCI]     [Linux Admin]     [Samba]

  Powered by Linux