Skip to content
This repository has been archived by the owner on Dec 13, 2024. It is now read-only.

Commit

Permalink
Merge pull request #14 from HAW-RN/unify
Browse files Browse the repository at this point in the history
Unify
  • Loading branch information
AnnsAnns authored Jun 7, 2024
2 parents 2bff906 + d76e16b commit e3b9aad
Show file tree
Hide file tree
Showing 3 changed files with 17 additions and 15 deletions.
2 changes: 1 addition & 1 deletion protocol/01_introduction.md
Original file line number Diff line number Diff line change
Expand Up @@ -10,4 +10,4 @@ The purpose of this document is to provide a detailed description of the SWAG pr

The SWAG protocol is designed to be easy to use and easy to implement. It is built on top of the TCP protocol and uses JSON for data serialization. The protocol is designed to be extensible, so that new features can be added in the future by appending new fields to the JSON messages.

Individuals don't require a direct connection to each other to communicate. Instead, they are able to forward messages via other participants. The clients are responsible for routing messages between clients and maintaining the state of the chat room with no central server.
Individuals don't require a direct connection to each other to communicate. Instead, they are able to forward messages via other participants. The clients are responsible for routing messages between clients and maintaining the state of the chat room with no central server.
28 changes: 15 additions & 13 deletions protocol/04_routing_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -21,32 +21,34 @@ Participants must be able to forward Messages
See "Shared Header" section

### Table
| Target | Next | Hop-Count |
|---|---|---|
| IP:Port | IP:Port | Integer |
| 192.168.101.12:1234 | 192.168.101.13:1243 | 2 |
| | | |
| target_ip | target_port | next_ip | next_port | hop_count |
|---|---|---|--|---|
| 192.168.101.12 | 1234 | 192.168.101.13 | 1243 | 2 |
| 10.0.0.5 | 1234 | 10.0.0.3 | 1234 | 4 |
| 10.0.0.11 | 1234 | 10.0.0.6 | 1234 | 2 |

### Example Data

```json
{
"header": {[...]}, // SEE SHARED HEADER
"data": "Participant A",
"table": [
{
"target": "10.0.0.5",
"target_ip": "10.0.0.5",
"target_port": 1234,
"next": "10.0.0.3",
"hop_count": "4"
"next_port": 1234,
"hop_count": 4
},
{
"target": "10.0.0.11",
"next": "10.0.0.6",
"hop_count": "2"
"target_ip": "10.0.0.11",
"target_port": 1234,
"next_ip": "10.0.0.6",
"next_port": 1234,
"hop_count": 2
}
]
}

```

## Packet Types
Expand All @@ -73,4 +75,4 @@ Defined within the `type_id` field of the common header.
8. Participant A resets Timer to 30 seconds

## Example
![Logo](./images/Routing_Protokoll_Sequenz_Diagram.png)
![Logo](./images/Routing_Protokoll_Sequenz_Diagram.png)
2 changes: 1 addition & 1 deletion protocol/05_routed_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -17,4 +17,4 @@ The task of the routed protocol is to transfer chat messages from one client to
"nickname": "Max Mustermann",
"message": "Hello World!"
}
```
```

0 comments on commit e3b9aad

Please sign in to comment.