https://github.com/soyum2222/sharpshooter
reliability network protocol useing UDP
https://github.com/soyum2222/sharpshooter
network reliability-network-protocol sharpshooter tcp transfer udp
Last synced: 5 months ago
JSON representation
reliability network protocol useing UDP
- Host: GitHub
- URL: https://github.com/soyum2222/sharpshooter
- Owner: soyum2222
- License: mit
- Created: 2020-05-17T06:34:11.000Z (about 6 years ago)
- Default Branch: master
- Last Pushed: 2024-08-22T08:25:14.000Z (almost 2 years ago)
- Last Synced: 2024-08-22T10:57:48.141Z (almost 2 years ago)
- Topics: network, reliability-network-protocol, sharpshooter, tcp, transfer, udp
- Language: Go
- Homepage:
- Size: 325 KB
- Stars: 8
- Watchers: 1
- Forks: 2
- Open Issues: 0
-
Metadata Files:
- Readme: Readme.md
- License: LICENSE
Awesome Lists containing this project
README
## Sharpshooter
 
Sharpshooter is a reliability network protocol using UDP.
It is a connection-oriented protocol just like TCP.
It doesn't have packet characteristics,You can try it to bypassing some protocol characteristics detection,and base for P2P application transport protocol.
About instructions , you can see example dir, I provided tow simple example.
If want TCP to sharpshooter convert , can try https://github.com/soyum2222/sharpshooter-tunel .
## Specification
`| SIZE(4byte) | SQE(4byte) | CMD(2byte) | CONTENT(.......) |`
SIZE:
contain SQE CMD CONTENT byte size . but not contain itself byte size .
SQE
sequence number, continuous data package, SQE is continuous.
CMD
0:ack
1:NORMAL
2:first handshack
3:second handshack(response first handshack)
4:third handshack
5:close connction(FIN)
6:response close
7:health check
8:response health
ACK package
| SIZE(4byte) | SQE(4byte) | CMD(2byte) | ackSQE1(4byte)| ackSQE2(4byte) | ackSQE3(4byte) | ... |
The package max length can't over DEFAULT_INIT_PACKSIZE or Sniper.packageSize
When receive ack like :
| SIZE(4byte) | SQE(4byte) | CMD(2byte) | ackSQE1(4byte)| ackSQE2(4byte) | ackSQE3(4byte) |
if ackSQE1 == ackSQE2 and ackSQE1 < ackSQE3 this situation means ackSQE1 to ackSQE3 is continuous number .
eg: receive data : |0|0|0|1|1|10| , this means other party sent ack 1 to 10.
## Use
#### Ping pong
[ping.go](https://github.com/soyum2222/sharpshooter/blob/master/example/ping.go)
[pong.go](https://github.com/soyum2222/sharpshooter/blob/master/example/pong.go)
#### File transfer
[send_file.go](https://github.com/soyum2222/sharpshooter/blob/master/example/send_file.go)
[receive_file.go](https://github.com/soyum2222/sharpshooter/blob/master/example/send_file.go)
## Network utilization
try transfer 100M file


utilization depends on network status and send window size