17. Node information

org.arl.unet.Services.NODE_INFO

The NODE_INFO service provides a single place to collate node-related information that is commonly needed by many agents. It is a special service, in the sense that each node must be configured to have one and only one agent providing this service.

17.1. Overview

An agent implementing the NODE_INFO service not only exposes a set of parameters, as described in this section, but also provides some special handling for specific parameters.

17.1.1. Parameters

An agent offering the NODE_INFO service supports several parameters:

  • nodeName — node name

  • address — node address

  • addressSize — address size in bits (valid values are 8 or 16)

  • time — node time (read-only)

  • canForward — true if the node will forward datagrams to other nodes (routing)

  • origin — origin as (latitude, longitude)

  • location — location as (x, y, z) in meters if origin set, otherwise (latitude, longitude, z)

  • mobility — true if the node is mobile, false if it is fixed

  • speed — speed in m/s, if mobile node

  • heading — heading in degrees, 0 is North, measured clockwise, if mobile node

  • turnRate — turn rate in degrees/s, measured clockwise, if mobile node

  • diveRate — dive rate in m/s, if mobile node

Any changes to parameters nodeName , address , addressSize , origin or location are published as ParamChangeNtf to the agent’s topic (in addition to the PARAMCHANGE topic that all parameter changes are automatically published to — see Chapter 24 ). This is to facilitate monitoring of changes to these important parameters by other agents, simply by subscribing to the NODE_INFO service provider’s topic.

Additionally, if time stability or location accuracy information is available, the following parameters are populated:

17.1.2. Notes

  • See Section 4.1 for a discussion on nodeName , address and addressSize .

  • See Section 5.6 for a discussion on origin , location and coordinate systems.

  • If node mobility is enabled, the agent may automatically update location based on motion parameters such as speed , heading , etc.

17.2. Example

If you start the mission2013 network simulation ( bin/unet samples/mission2013-network.groovy ), connect to node 21’s shell and type node , you’ll see the NODE_INFO parameters for the node in this network:

> node
<<< NodeInfo >>>

[org.arl.unet.nodeinfo.NodeInfoParam]
  address = 21
  addressSize = 8
  canForward = true
  diveRate = 0
  heading = 0
  location = [-512.0, 248.8, -6.0]
  mobility = false
  nodeName = 21
  origin = [1.217, 103.743]
  speed = 0
  time = Sun Sep 15 20:31:49 SGT 2019
  turnRate = 0
<<< [Ranging and synchronization] [Address resolution] >>>