Skip to content

CAN Frame Transfer Standard doesn't define behavior for AMR without data. #84

@Poikilos

Description

@Poikilos

python-openlcb clears the alias anyway (see testAmdAmrSequence), but the OpenLCB CAN Frame Transfer Standard (July 22, 2024
Adopted) says to send NodeID in data area of CAN Frame when AMR is sent. No other usage of AMR is defined.

6.2.4 Transition to Inhibited State

To transition from the Permitted state to the Inhibited state, a node shall successfully transmit an Alias
Map Reset frame with the node's reserved Node ID alias and Node ID.

If a node receives an Alias Map Reset (AMR) frame referencing an alias for another node, the
receiving node shall stop using that alias to refer to the AMR-sending node within 100 milliseconds.

  • testAmdAmrSequence therefore is exhibiting undefined behavior

    • and python-openlcb (handleReceivedAMR) allows it (which also may be undefined behavior since it does more alias deleting than the Standard seems to indicate--However, the "sending node" may technically be identified by the alias)
  • change the test to only do defined behavior (create a separate NodeID for the mock sender, for which deletion of the alias from the map can be tested) (done in Delegate state to link and flow to port (Fix #62) #67).

  • For now, change python-openlcb to prevent the "bad" AMR from resetting the alias (done in Delegate state to link and flow to port (Fix #62) #67).

    • Some node that doesn't state its own NodeID probably shouldn't be allowed to reset an alias (?). One drawback is that we rely on our own aliasToNodeID map to determine which key to delete from our nodeIdToAlias map (unless we search by value (slower)), so there is less defense against the other node doing something wrong.
      • On the other hand, sending an AMR indicates it holds the alias (since Standard says only CID/RID/AMD can be sent while Inhibited), so it is not certain the behavior is wrong, just less explicit.
    • wait for clarification from @bakerstu

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions