Skip to content

scriptdealer/tcp-pow

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

5 Commits
 
 
 
 
 
 
 
 
 
 
 
 

Repository files navigation

Denial of denial

Faraway test to implement protection of a TCP server from DDOS attacks with the Proof of Work pattern

Overview

For this implementation, we'll use the Hashcash algorithm. It's a simple yet effective PoW system that requires the client to find a partial hash collision. This algorithm is suitable because:

  • It's computationally difficult but easy to verify
  • It's adjustable in difficulty
  • It's well-known and widely used

Base idea is to serve maximum number of users by denying only certain IP addresses. This is done by automatically adjusting the difficulty level based on the number of requests made from a particular IP address.

Docker network

To create a common network for the server and client containers:

docker network create tcp-pow-network

Server

docker build -t tcp-pow-server -f test/server/Dockerfile .

then

docker run -p 8080:8080 tcp-pow-server

Client

docker build -t tcp-pow-client -f test/client/Dockerfile .

then

docker run -it tcp-pow-client

About

Proof-of-Work over TCP (Faraway interview)

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published