Skip to content

Commit

Permalink
pb ethernet receiving docs
Browse files Browse the repository at this point in the history
  • Loading branch information
RCMast3r committed Apr 30, 2024
1 parent 9d2b83b commit 1b1d620
Showing 1 changed file with 17 additions and 0 deletions.
17 changes: 17 additions & 0 deletions ETHERNET.md
Original file line number Diff line number Diff line change
@@ -0,0 +1,17 @@
```mermaid
flowchart TD
ethernet[ethernet port] --> qnethernet[encoded ethernet data packets]
qnethernet --> port[protobuf union msgs port]
port --> ht_eth[HT ethernet interface]
ht_eth --> union_dec[union msgs splitter]
union_dec --> int1[interface 1 message buffer]
union_dec --> int2[interface 2 message buffer]
union_dec --> intN[interface N message buffer]
```

## explanation

### receiving
Packets stream over ethernet and hit the ethernet port itself. The ethernet library has an internal queue for the UDP packets received. We know that a specific port id (say 4521) all messages will be a protobuf union msg that can contain only one of the types of messages that we will be sending (config control, TCU status, CASE msgs, etc.) and the union decoder method in the ethernet interface itself will handle this. The ethernet shall be able to receive multiple messages in one loop (of a limited number) and in between iterations of the loop the ethernet driver will hold the un-parsed messages in it's queue.

The union message decoder will handle parsing of all of the messages in the queue and will be able to determine what message the union pb packet holds. If all messages of a specific type are needed, The message decoder will then add the decoded particular protobuf message struct to the message queue in the respective interface that way if multiple messages of the same type appear in one loop iteration they can all be processed by the underlying system / interface. If the interface just needs the latest version of a message each loop, the decoder will just update the message instance in its respective interface.

0 comments on commit 1b1d620

Please sign in to comment.