4 Topology Discovery Example
Figure 4-1 shows the control and process flows of the relevant nodes on the network for one complete distance measurement in automatic mode. The example below describes how to use the registers and bit-fields that are defined in the OPEN Alliance 10BASE‑T1S Topology Discovery specification to perform the measurement using the Automatic mode as defined in the standard.
The example proceeds as shown in Figure 4-1 and assumes that a control unit exists which configures all of the participating nodes. This control unit may be on the mixing segment or may be elsewhere in the network. It will use an appropriate protocol to identify and configure the reference and measured nodes before the measurement begins. In addition, the controller and control protocol will also need to be able to control the PLCA coordinator, which may be any node on the mixing segment.
Topology Discovery Start
The process begins by identifying the nodes involved in the topology discovery process and setting the measurement duration. The process shown in Figure 4-1 assumes that the requesting node begins the process by sending Topology Discovery Start messages which identify the reference and measured nodes and the duration of the measurement.
The PLCA coordinator must wait until all nodes have received their configuration information, then disable PLCA to ensure that beacons are not transmitted. A simple way to disable PLCA for the coordinator is to temporarily set its node ID to 254 until the topology discovery measurement is over. After disabling PLCA, the coordinator begins an internal delay timer after which it will restart PLCA. This delay must be longer than three times the measurement duration because two internal delays and one distance measurement are performed during the procedure. An additional timing margin is recommended to account for additional delays in either the reference node or measured node before and between measurements.
All nodes not involved in the topology discovery procedure must ensure that they do not transmit during the entire measurement. In the simplest case, nodes that remain in PLCA mode cannot transmit without a beacon. However, if the beacon is disabled for more than 13 ms, a node will fallback into CSMA/CD mode. If the MAC has packets to send, a node will begin transmitting in CSMA/CD mode after this timeout. If the total time for the topology discovery process exceeds this limit, then it is necessary to use additional methods to prevent transmission. Microchip devices, including the LAN8670/1/2, provide a proprietary method of disabling the CSMA/CD fallback. The PLCA Reconciliation Sublayer Control 1 (PRSCTL1) contains a Fallback Enable (PRSCTL1.FBEN) bit, which is enabled by default. At the start of topology discovery, this bit should be cleared so that the device remains in PLCA mode regardless of the presence of a beacon.
Both the Reference Node and Measured Node need to ensure that the PLCA beacon is disabled. A simple delay timer will often be sufficient.
After PLCA Disabled - Measurement Nodes
Once the PLCA beacon has been disabled, the reference and measured nodes need to be configured by writing to the Topology Discovery Control Register (TD_CTRL) to begin operation. It is important that the measured node is configured first so that it can detect the internal delay measurement of the reference node. The measured node uses the end of the internal delay measurement of the reference node to trigger the start of its own internal delay measurement.
A node configures itself as a measured node or reference node by setting TD_CTRL.REFN to ‘0’ or ‘1’ respectively. The node then configures the measurement duration for both internal measurements and distance measurements by writing a value from 0 to 15 into TD_CTRL.DM_DUR[3:0], resulting in a measurement duration range between 1 to 16 ms, with a longer duration increasing the accuracy of the result. It then writes a ‘1’ into the TD_CTRL.AUTO_START and TD_CTRL.TD_EN bits to enable topology discovery in automatic mode.
Internal Delay Measurements
The reference node first waits a small amount of time before configuring itself and activating topology discovery in automatic mode to assure that the measured node is also in topology discovery mode before beginning the procedure. The reference node first conducts its own internal delay measurement and records the result in the TD_DLY_RES_LOW and TD_DLY_RES_HIGH registers.
The measured node monitors the mixing segment to detect that the reference node has completed its internal delay measurement. Once the network has gone silent, the measured node begins its own internal delay measurement.
The reference node listens in on the internal delay measurement of the measured node and counts the number of pulses it receives. The duration of this measurement is recorded in the TD_MNDLY_DUR register. The total number of pulses counted is recorded in the TD_MNDLY_RES_LOW and TD_MNDLY_RES_HIGH registers. This allows the reference node the calculate the internal delay of the measured node and therefore the total distance between the two nodes without needing to request this information from the measured node later.
Distance Measurement
Once the internal delay measurements are completed, the distance measurement between the measured node and reference node is started. The reference node counts how many times it receives a pulse from the measured node. This count is recorded in the TD_DIST_RES_LOW and TD_DIST_RES_HIGH registers. Once the measurement is completed, the distance between the nodes is calculated. The status of the measurements is shown in the Topology Discovery Status (TD_STAT) register. If all measurements have finished successfully, it is indicated by a ‘1’ when reading the TD_STAT.DLYM_DONE and TD_STAT.DM_DONE bits.
Completion
At the completion of the measurement, the TD_CTRL.TD_EN bit for both the reference and measured node should be cleared to ‘0’, ending topology discovery mode. If the proprietary PRSCTL1.FBEN bit has been cleared, it can be re‑set to assure compliance with standard operation.
Once the internal delay of the coordinator is complete, it should be configured to once again send PLCA BEACONs. The reference node is now able to transmit its results to the external device in a Topology Discovery Response message.
