Skip to content

Alonza0314/dp-tcp

Repository files navigation

dp-tcp

Dual Path TCP: An application for dual path TCP

Dual-Path at here means the packet will be ensure by double transmit.

Description

descp

As the dp-tcp started, it will create a network interface for proxy real data packet. At the above image, packet from blue network interface to green network interface is doing packet duplication, and the packet from green network interface to blue network interface is doing packet elimination.

For duplication, it just duplicates the packet read from blue network interface and write to both TCP links.

For elimination, dp-tcp used a hashmap to store packet record. This map is efficient and safe for doing concurent map read/write. The record stored in the map is not the original raw packet since it may be very large. dp-tcp used xxhash, a quick hash function, for hashing the packet into an uint64 value, which makes it easy stored.

With using hashmap and xxhash, this dp-tcp is achieve a very efficient way to manage packets and connection reliable.

Usage

git clone [email protected]:Alonza0314/dp-tcp.git
cd dp-tcp
make
  • Server

    sudo ./build/dp-tcp server -c config/server.yaml
  • Client

    sudo ./build/dp-tcp client -c config/client.yaml

After starting, user can used the created network interface to do your own application. But dp-tcp will not set the IP route rule. This can be customizd by your own.

Quickstart

  1. Clone and make

    git clone [email protected]:Alonza0314/dp-tcp.git
    cd dp-tcp
    make
  2. Start and enter namespace

    • Start

      ./namespace.sh up
    • Server-ns

      ./namespace.sh server-ns
      
      # after enter namespace
      ./build/dp-tcp server -c config/server.yaml
    • Client-ns

      ./namespace.sh client-ns
      
      # after enter namespace
      ./build/dp-tcp client -c config/client.yaml
    • Demo

      dp-tcp

  3. ncat test

    • Server

      ncat -u -l 10.0.0.1 9999
    • Client

      ncat -u --source 10.0.0.2 10.0.0.1 9999
    • Demo

      ncat

Appendix

  • "github.com/songgao/water": used to bring up network device.
  • "github.com/cornelk/hashmap": safe concurrent map.
  • "github.com/cespare/xxhash/v2": quick hash for operating packet hashing

About

Dual Path TCP: An application for dual path TCP

Topics

Resources

License

Stars

Watchers

Forks

Packages

No packages published

Contributors 2

  •  
  •