Methods of preventing flooding-type denial-of-service attacks in a
computer-based network are described. Connection establishing messages
known as SYN packets are matched with connection terminating messages
(FIN packets) by using a hash algorithm. The hash algorithm or message
digest uses source and destination IP addresses, port numbers, and a
secret key as input parameters. The SYN packets and FIN packets are
mapped to buckets using the hash algorithm and statistics are maintained
for each bucket. A correspondence between SYN packets and FIN packets is
maintained to close a security hole.