Skip to content

Commit

Permalink
Update: v1.3.1 to 1.4 Thread version; and 1.4 OT bumped to recent commit
Browse files Browse the repository at this point in the history
  • Loading branch information
EskoDijk authored Jun 5, 2024
1 parent f594f10 commit 32f992b
Show file tree
Hide file tree
Showing 10 changed files with 21 additions and 23 deletions.
4 changes: 2 additions & 2 deletions GUIDE.md
Original file line number Diff line number Diff line change
Expand Up @@ -61,7 +61,7 @@ The OT nodes required for running a simulation are not yet installed at this poi
```

This checks for availability of prebuilt OT nodes, and builds any OT nodes not yet present. This includes a standard
set of nodes like FTD, MTD, Border Router (BR) and different Thread versions (1.1, 1.2, 1.3.0, 1.3.1). This build
set of nodes like FTD, MTD, Border Router (BR) and different Thread versions (1.1, 1.2, 1.3.0, 1.4). This build
can take a long time. During the build specific commits of the `openthread` Git repo submodule will be checked out in
order to access older OpenThread codebases. In case the build stops unexpectedly and the script is aborted, it may be
the case that an older OT commit is checked out in the `./openthread` subdirectory. This can be manually restored
Expand All @@ -75,7 +75,7 @@ a node. Type `help add` in OTNS to see this.
This fork of OTNS uses POSIX simulation to simulate Thread nodes, with a specific platform `ot-rfsim` located in the
`ot-rfsim` directory.
The simulator uses node executables such as `ot-cli-ftd`. By default, the `install-nodes` script will build
a common set of OpenThread nodes of different version (v1.1, v1.2, v1.3.0, v1.3.1, and "latest") that
a common set of OpenThread nodes of different version (v1.1, v1.2, v1.3.0, and "latest" v1.4) that
are used in the various examples and unit-tests of OTNS.

To build or rebuild yourself an executable with platform `ot-rfsim` for OTNS, see the example build below.
Expand Down
8 changes: 4 additions & 4 deletions cli/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -55,7 +55,7 @@ triple backtick marked code segments.
Add a node to the simulation and get the node ID.

```shell
add <type> [x <x>] [y <y>] [rr <radio-range>] [id <node-id>] [restore] [exe <path>] [v11|v12|v13|v131]
add <type> [x <x>] [y <y>] [rr <radio-range>] [id <node-id>] [restore] [exe <path>] [v11|v12|v13|v14]
```

The `<type>` can be `router`, `fed`, `med`, `sed`, `ssed`, `br` (Border Router), or `wifi` (for a Wi-Fi interferer node).
Expand All @@ -65,7 +65,7 @@ one. If the `restore` option is specified, the node restores its network configu
The (advanced) `exe` option can be used to specify a node executable for the new node; either a name only which is
then located in the default search paths, or a full abs or rel pathname pointing to the executable to use.

The options `v11`, `v12`, `v13` and `v131` are a quick way to add a Thread v1.x node. This uses the binaries
The options `v11`, `v12`, `v13` and `v14` are a quick way to add a Thread v1.x node. This uses the binaries
prebuilt for these nodes the `ot-rfsim` submodule, `ot-versions` directory.
See [GUIDE.md](../GUIDE.md) for details on this.

Expand Down Expand Up @@ -285,14 +285,14 @@ Done
#### exe: Set OT executable for all node types

```shell
exe (default | v11 | v12 | v13 | v131)
exe (default | v11 | v12 | v13 | v14)
```

Set all OpenThread (OT) executables, or shell scripts, for all node types to particular defaults. Value `default` will
use the OTNS default executables: this is typically a recent OT development build. Values starting with `v` will use
the pre-built binary of the specific indicated Thread version, e.g. `v12` denotes Thread v1.2.x.

NOTE: in the current commit of OTNS, `v131` equals the most recent OT development build. This may change in the future.
NOTE: in the current commit of OTNS, `v14` equals the most recent OT development build. This may change in the future.

NOTE: the 'br' node type is currently not adapted to other versions.

Expand Down
2 changes: 1 addition & 1 deletion cli/ast.go
Original file line number Diff line number Diff line change
Expand Up @@ -331,7 +331,7 @@ type RestoreFlag struct {

// noinspection GoVetStructTag
type ThreadVersion struct {
Val string `@("v11"|"v12"|"v13"|"v131")` //nolint
Val string `@("v11"|"v12"|"v13"|"v14")` //nolint
}

// noinspection GoVetStructTag
Expand Down
2 changes: 1 addition & 1 deletion openthread
Submodule openthread updated 1321 files
5 changes: 1 addition & 4 deletions ot-rfsim/ot-versions/README.md
Original file line number Diff line number Diff line change
Expand Up @@ -14,11 +14,8 @@ Versions:
- v13 - A Thread v1.3 codebase compiled with v1.3 version flag; tag
[thread-reference-20230119](https://github.com/openthread/openthread/tree/thread-reference-20230119).

- v131 - A Thread v1.3.1 codebase compiled with v1.3.1 version flag, with a recent `main` branch code as for
version 'latest'.

- latest - A recent OpenThread `main` branch commit that's the default `openthread` submodule. The version is selected
with v1.3.1 version flag, currently. If in the future the Thread version increases, this build will track that.
with v1.4 version flag, currently. If in the future the Thread version increases, this build will track that.

Build scripts: the build scripts to build all of the versions are `../script/build_*`. Each of these specific build
scripts invokes the general `build` script.
2 changes: 1 addition & 1 deletion pylibs/otns/cli/OTNS.py
Original file line number Diff line number Diff line change
Expand Up @@ -432,7 +432,7 @@ def add(self, type: str, x: float = None, y: float = None, id=None, radio_range=
:param executable: specify the executable for the new node, or use default executable if None
:param restore: whether the node restores network configuration from persistent storage
:param txpower: Tx power in dBm of node, or None for OT node default
:param version: optional OT node version string like 'v11', 'v12', 'v13', or 'v131', etc.
:param version: optional OT node version string like 'v11', 'v12', 'v13', or 'v14', etc.
:param script: optional OT node init script as a single string.
:return: added node ID
"""
Expand Down
6 changes: 3 additions & 3 deletions pylibs/unittests/test_exe_versions.py
Original file line number Diff line number Diff line change
Expand Up @@ -83,7 +83,7 @@ def testExe(self):
self.assertEqual( 4, ns.get_thread_version(nid))
ns.go(10)

ns.cmd("exe v131")
ns.cmd("exe v14")
nid = ns.add('router')
self.assertEqual( 5, ns.get_thread_version(nid))
ns.go(10)
Expand All @@ -96,7 +96,7 @@ def testAddVersionNodes(self):
ns: OTNS = self.ns
ns.add('router', x=250, y=250)
ns.go(10)
nid = ns.add('router', version='v131')
nid = ns.add('router', version='v14')
self.assertEqual( 5, ns.get_thread_version(nid))
ns.go(10)
nid = ns.add('router', version='v13')
Expand All @@ -118,7 +118,7 @@ def testSsedVersions(self):
ns.go(10)
nodeid = ns.add("ssed", version="v12")
nodeid = ns.add("ssed", version="v13")
nodeid = ns.add("ssed", version="v131")
nodeid = ns.add("ssed", version="v14")
nodeid = ns.add("ssed")
ns.go(10)
self.assertFormPartitions(1)
Expand Down
5 changes: 3 additions & 2 deletions simulation/node_config.go
Original file line number Diff line number Diff line change
Expand Up @@ -44,6 +44,7 @@ const (
defaultRadioRange = 220
wifiCcaThreshold = 20.0 // in dBm above the noise floor
defaultWiFiTxInterfererPercentage = 10
versionLatestTag = "v14"
)

// defaultNodeInitScript is an array of commands, sent to a new node by default (unless changed).
Expand Down Expand Up @@ -200,7 +201,7 @@ func (cfg *ExecutableConfig) SearchPathsString() string {
// The given defaultConfig is used as a base to derive the versioned executables from.
func (cfg *ExecutableConfig) SetVersion(version string, defaultConfig *ExecutableConfig) {
logger.AssertTrue(strings.HasPrefix(version, "v1") && len(version) >= 3 && len(version) <= 4)
if version == "v131" { // latest node version - has no _v<version> suffix
if version == versionLatestTag { // latest node version - has no _v<version> suffix
cfg.Ftd = defaultConfig.Ftd
cfg.Mtd = defaultConfig.Mtd
} else {
Expand Down Expand Up @@ -248,7 +249,7 @@ func (cfg *ExecutableConfig) FindExecutableBasedOnConfig(nodeCfg *NodeConfig) st
}
if nodeCfg.IsBorderRouter {
exeName = cfg.Br
} else if len(nodeCfg.Version) > 0 && nodeCfg.Version != "v131" {
} else if len(nodeCfg.Version) > 0 && nodeCfg.Version != versionLatestTag {
exeName += "_" + nodeCfg.Version
}

Expand Down
2 changes: 1 addition & 1 deletion web/site/bindata.go

Large diffs are not rendered by default.

8 changes: 4 additions & 4 deletions web/site/js/vis/format_text.js
Original file line number Diff line number Diff line change
Expand Up @@ -85,13 +85,13 @@ export function threadVersionToString(ver) {
case 3:
return "1.2.x";
case 4:
return "1.3.0";
return "1.3.x";
case 5:
return "1.3.1";
return "1.4.x";
case 6:
return "1.4.x?";
case 7:
return "1.5.x?";
case 7:
return "1.6.x?";
default:
return "UNKNOWN";
}
Expand Down

0 comments on commit 32f992b

Please sign in to comment.