项目作者: mohamedmahmoud97

项目描述 :
A reliable data transfer service on top of the UDP protocol.
高级语言: Go
项目地址: git://github.com/mohamedmahmoud97/Zuper-UDP.git
创建时间: 2018-03-24T20:14:42Z
项目社区:https://github.com/mohamedmahmoud97/Zuper-UDP

开源协议:MIT License

下载


Zuper-UDP

Build Status
Go Report Card
HitCount
License

A library for reliable data transfer service on top of the UDP protocol that supports loadbalancing and reverse proxy features which loadbalances client requests on the servers and also caches the files at the proxy to decrease response time to the clients and reduces the load on the backend servers. The loadbalancer also works with the reliable data transfer service on top of the UDP. The library simulates packet loss and packet corruption and handles these issues for reliability.



Installation

You can use go get to install to your $GOPATH, assuming that you have a github.com parent folder already created under src:

  1. $ go get -t github.com/mohamedmahmoud97/Zuper-UDP

Usage

  1. $ go run examples/loadbalancer/loadbalancer.go sr
  2. _ _ _ _ _ ___ _ __
  3. |_ _ | _ _ _ __ ___ _ __ | | | |._ \ | ._ \
  4. / /| | | | ._ \ / _ \| '__|| | | || \ || |_) |
  5. / /_| |_| | |_) | |_)/| | | |__| ||_/ || .__/
  6. /_ _ _|_ _ _| .__/ \_ _ |_| |_ __ _|___/ |_| v1.0 LOADBALANCER
  7. |_|
  8. A server-side loadbalancer with udp reliable data transfer protocol
  9. #####################################################################

Test it

You can test the server-client library with running any of the bash files: gbn.sh for testing GoBackN algorithm, sr.sh for SelectiveRepeat, and sw.sh for Stop-and-Wait. You can also change the parameters for the client, the server, and the loadbalancer in device_info/client.in and device_info/server.in, and device_info/loadbalancer.in. If you want to neglect the simulation probability packet loss just change last attribute in server.in to 0.

You can also test the loadbalancer by running go run examples/loadbalancer/loadbalancer.go and run some servers by running go run examples/server/server.go sr and run client to request files by running go run examples/client/client.go sr, but don’t fforget to change the server address attribute for all clients is the address of the loadbalancer.

For Client

  1. 127.0.0.1 IP address of server
  2. 10066 Well-known port number of server.
  3. 127.0.0.1 IP address of client.
  4. 10044 Port number of client.
  5. test.pdf Filename to be transferred.
  6. 5 Initial receiving sliding-window size (in datagram units).

For Server

  1. 127.0.0.1 The IP address of server
  2. 10066 Well-known port number for server.
  3. 5 Maximum sending sliding-window size (in datagram units).
  4. 5 Random generator seedvalue.
  5. 0.3 Probability p of datagram loss (real number in the range [ 0.0 , 1.0 ]).

For Loadbalancer

  1. 127.0.0.1:10000 The IP address of loadbalancer
  2. 127.0.0.1:10001 The IP address of first server
  3. 127.0.0.1:10101 The IP address of second server
  4. 127.0.0.1:10201 The IP address of third server
  5. 127.0.0.1:10301 The IP address of fourth server
  6. 127.0.0.1:10401 The IP address of fifth server

test run of server

asciicast

test run of client

asciicast

Contributing

Feel free to contribute to this project. Either for adding features, found a bug, .. etc.