Skip to content

Commit

Permalink
Docs
Browse files Browse the repository at this point in the history
  • Loading branch information
ikvict07 committed Nov 23, 2024
1 parent 5d4e71f commit bb179fe
Show file tree
Hide file tree
Showing 5 changed files with 71 additions and 7 deletions.
1 change: 0 additions & 1 deletion .gitignore
Original file line number Diff line number Diff line change
@@ -1,4 +1,3 @@
HELP.md
.gradle
build/
!gradle/wrapper/gradle-wrapper.jar
Expand Down
77 changes: 71 additions & 6 deletions README.MD
Original file line number Diff line number Diff line change
Expand Up @@ -2,8 +2,26 @@

I created a program that uses my own protocol over udp.

[Github](https://github.com/ikvict07/p2p_pks.git)

The program supports two modes: CLI and GUI [see How to run](#how-to-run)

---

## Table of content

- [Connection creating](#connection-creating)
- [Message sending](#message-sending)
- [Keep-Alive](#keep-alive)
- [Corrupted message](#sending-a-corrupted-message)
- [Closing connection](#closing-the-connection)
- [How to run](#how-to-run)
- [How to use](#how-to-use)
- [Protocol](#protocol)
- [Speed](#speed)

---

## Connection creating

| ![Syn](static/Syn.png) |
Expand All @@ -22,6 +40,8 @@ The program supports two modes: CLI and GUI [see How to run](#how-to-run)
Connection established
</p>

---

## Message sending

| ![Message](static/SendMessageUI.png) |
Expand All @@ -40,6 +60,8 @@ The program supports two modes: CLI and GUI [see How to run](#how-to-run)
|:----------------------------------------------:|
| *Message received* |

---

## Keep-alive

| ![KeepAliveSent](static/KeepAliveSent.png) |
Expand All @@ -50,6 +72,8 @@ The program supports two modes: CLI and GUI [see How to run](#how-to-run)
|:----------------------------------------------------:|
| *Keep-alive confirmed* |

---

## Sending a corrupted message

| ![Message](static/SendingCorrupted.png) |
Expand All @@ -72,6 +96,8 @@ The program supports two modes: CLI and GUI [see How to run](#how-to-run)
|:------------------------------------------------:|
| *Message received* |

---

## Closing the connection

| ![U1_1](static/User1Close.png) |
Expand Down Expand Up @@ -102,15 +128,17 @@ The program supports two modes: CLI and GUI [see How to run](#how-to-run)
Connection closed
</p>

---

## How to run

#### From console run

`java -jar pks-1.0.0.jar`

#### How to configure
---

#### How to configure

`java -jar /path/to/jar/pks-1.0.0.jar --key=value --key2=value2`

Expand All @@ -136,13 +164,17 @@ Where key can be any of:

`ui.enabled` (`true`, `false`)

---

They aren't mandatory as they have default values,
However, I recommend changing these:

`general.file-save-location`
and
`ui.enabled`

---

## How to use

### CLI mode
Expand All @@ -166,12 +198,11 @@ The Console will ask you:
Now the program is configured and you can use it

- Choose `ip:port` from the list of available connections
- or `change` – to configure packet fragment size
- or `change` – to configure packet fragment size
- Select a type of message you want to send (`message`, `file`, `corrupted`)
- or `close` if you want to close this connection
- or `close` if you want to close this connection
- Write a message
- or file path

- or file path

### GUI mode

Expand All @@ -180,4 +211,38 @@ the program will run in GUI mode

All the configuration now will be done using GUI

Sending and reading messages will be done using GUI as well
Sending and reading messages will be done using GUI as well

---

## Protocol

![Header](static/ProtHeader-1.png)

### Keep-Alive

Every `N` seconds node sends an empty packet with a keep-alive flag

If this node doesn't receive packet Ack keep-alive within `x` seconds `y` times

It will automatically disconnect

*`N`, `x`, `y` – are configuration params*

### Receiving confirmation

After Node2 receives a message from Node1, it must send an empty packet with `SequenceNumber` set to the same value as
a received packet and with `ack` flag

If Node1 doesn't receive this ack packet within a time interval that is configurable, the message is considered as non
received and will be resented.

### Closing connection

The Connection will be closed when both side receive FIN packet

---

## Speed

It takes ~20s to read, send and store 100 mb file
Binary file added documentation.pdf
Binary file not shown.
Binary file added static/ProtHeader-1.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.
Binary file added static/ProtHeader.pdf
Binary file not shown.

0 comments on commit bb179fe

Please sign in to comment.