Design (Code) ~ Attempt 1
Cedric Adjih edited this page Nov 2, 2018
·
7 revisions
The idea is to start from a first design, see advantages/issues, and improve on it with next iteration
Starting from Laurent's class design, one would get:
-
RuleManager
- Description: Rule manager manage a list of rules both for compression/decompression and Fragmentation/Reassembly
-
addRule(rule)
: Take a JSON rule and store it -
findRuleFromID(id)
: return the JSON structure corresponding to the ID -
findRuleFromHeader(HdR)
: return ruleID corresponding to an header description -
findRuleFromFrag(mode, length)
: return fragmentation ruleID from characteristics (mode: no reliable, reliable) packet size
-
Parser
- Description: take a binary structure and return a list of field.name and values (should contain a field descriptions)
-
parser(packet, direction)
: direction can be "up" or "down"
-
Compressor
- Description: apply compression rules, return compression residue
apply(header_description, ruleID, direction)
- CA:
CA_not_sent
,CA_value_sent
,CA_matching_sent
,CA_LSB
-
Decompressor
- Description: construct original header from residue and ruleID
apply(residue, ruleID, direction)
- DA:
DA_not_sent
,DA_value_sent
,DA_matching_sent
,DA_LSB
-
Fragmentation
- Description: cut a buffer of bits regarding a ruleID and run teh state machine for the specific fragmentation behavior. Must specify tiles side
apply(bitbuffer, ruleID)
-
Defragmentation
- Description: state machine that regroups several fragments to form a SCHC packet
-
Packet Sniffer
,Packet Sender
,Orchestrator
,LPWAN send
,LPWAN receive
,bitbuffer
, ... : TBD
The sequence diagram for this design will correspond to what follows.
- Configuration is ignored
-
SCHC
corresponds to an orchestrator
(best viewed at 3840x2160 on 43")
-
One important missing part are the classes related to the Layer2, and the interaction with Layer2:
- Layer2 packet size
- Possible explicit feedback on lost packets (transmissions opportunities, e.g. LoRa ??)
- Q: should one use object composition for Layer2, or inheritance (e.g. http.server subclass of socketserver.TCPServer in Python) ?
-
...