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

Use Case touch up #17

Merged
merged 7 commits into from
Jun 10, 2024
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
11 changes: 6 additions & 5 deletions protocol/02_use_cases.md
Original file line number Diff line number Diff line change
Expand Up @@ -2,24 +2,25 @@
<img src="./images/UseCase.png" width="806" height="806">

### 1. Start New Connection
Client A establishes a connection to another Client B using TCP. Client A sends a new_connection message to Client B which responds with its routing table, updating Client A's routing table. Both Clients add information about the connection to their routing tables.
Client A establishes a connection to another Client B using TCP. Client A sends a CR message inculding its routing table to Client B which responds with a CRR containing its routing table. Both Clients update their routing tables and add information about their new connection to their routing tables.

### 2. Forward Message
Client A receives a message and checks its destination address. If Client A is not the destination, it checks its routing table for the destination address and sends the message to the destination, if directly connected or to the next address on the route, if one is available.
Client A receives a message and checks its destination address. If Client A is not the destination, Client A checks its routing table for the destination address and sends the message to the destination, if directly connected or to the next address on the route, if one is available.

### 3. Update Routing Table
Every X (mili)seconds Client A requests all directly connected Clients to send a routing_table_update containing all information in their routing table besides the routing information it got from Client A. When receiving routing_table_update, Client A will update its routing table with any new information from it. If a Client does not answer this request, they will treated as unavailable.
Every 10 seconds Client A requests all directly connected Clients to send a SCCR containing all information in their routing table besides the routing information it got from Client A. When receiving SCCR, Client A will update its routing table with any new information from it. If a Client does not answer this request, they will be marked as unavailable in the routing table.

### 4. Send Routing Table
When requested Client A sends a routing_table_update to the requesting Client containing all information in Client A's routing table besides the information it got from the requesting Client.
When requested Client A sends a SCCR to the requesting Client containing all information in Client A's routing table besides the information it got from the requesting Client.

### 5. Quit Client
Client A sends a quit_message to all directly connected Clients. Afterwards the program ends itself.
Client A marks all connections through itself as unreachable and sends a STU to all directly connected Clients. Afterwards the program ends itself.

### 6. source is unavailable
Client A marks all routes in its routing table reachable through the source including the source itself as unreachable and sends a routing table update.

#### Client specific
Client specific use cases are use cases whos details are up to the implementing clients, these include:
- send message
- receive message
- display message
Expand Down
2 changes: 1 addition & 1 deletion protocol/04_routing_protocol.md
Original file line number Diff line number Diff line change
Expand Up @@ -36,7 +36,7 @@ See "Shared Header" section
{
"target_ip": "10.0.0.5",
"target_port": 1234,
"next": "10.0.0.3",
"next_ip": "10.0.0.3",
"next_port": 1234,
"hop_count": 4
},
Expand Down