Download as pdf or txt
Download as pdf or txt
You are on page 1of 27

TI G3 DC Interface Guide

Version 1.5
July 31, 2015
Copyright  Texas Instruments Incorporated, 2011-2015

The information and/or drawings set forth in this document and all rights in and to
inventions disclosed herein and patents which might be granted thereon disclosing or
employing the materials, methods, techniques, or apparatus described herein are the
exclusive property of Texas Instruments. No disclosure of information or drawings shall
be made to any other person or organization without the prior consent of Texas
Instruments.

Texas Instruments Proprietary Information


Revision History

Revision Status Date Comment


0.1 Draft 3/26/2012 Initial draft
0.2 Draft 6/2/2012 Added events/PIB
0.3 Draft 12/17/2012 Added new command to g3_mgmt_cli
0.4 Draft 3/19/2013 Added new g3_mgmt_cli command, get-dc-dsp-ver
0.5 Draft 9/12/13 Added new cli note for setting GMK
0.6 Draft 1/23/2014 Added new cli, set-phy-tx-params to set PHY TX
gain/attenuation
0.7 Draft 3/15/2014 Added PSK Server.
0.8 Draft 3/31/2014 Updated PSK Server executable names. Updated cfg-dc,
get-mac-node-info.
0.9 Draft 4/14/2014 discover-net, start-net commands added
1.0 5/1/2014 Added short address assignment note to the PSK
Server.
1.1 Draft 5/6/2014 get-route-table, get-neighbor-table commands added.
Added rekey-nwk.
1.2 Draft 5/14/2014 get-device-table command added
1.3 Draft 9/16/2014 Added section on Overloading Type of Service field for
MSDU handle and LQI Indication under IPv6 Application
Interface
1.4 Draft 10/15/2014 Added a section on handling global IPv6 address by TUN
interface under IPv6 Application Interface section.

1.5 Release 07/31/2015 Added note for cfg-dc


Table of Contents

1.0 INTRODUCTION................................................................................................. 5
2.0 TI G3 DC INTERFACES ..................................................................................... 6
3.0 MESSAGE FORMAT .......................................................................................... 7
3.1 MESSAGE HEADER FORMAT.................................................................................. 7
3.2 MESSAGE PAYLOAD FORMAT ............................................................................... 8
4.0 IPV6 APPLICATION INTERFACE .................................................................. 9
4.1 EXAMPLE IPV6 EXTERNAL APPLICATION ............................................................. 10
5.0 MANAGEMENT INTERFACE ........................................................................ 13
5.1 EXAMPLE EXTERNAL MANAGEMENT APPLICATION .............................................. 13
5.1.1 ?................................................................................................................... 14
5.1.2 ctrl-c ............................................................................................................ 14
5.1.3 q................................................................................................................... 14
5.1.4 get-dc-std..................................................................................................... 14
5.1.5 get-dc-ver .................................................................................................... 14
5.1.6 get-dc-dsp-ver ............................................................................................. 16
5.1.7 get-mac-node-info ....................................................................................... 16
5.1.8 detach-node ................................................................................................. 16
5.1.9 discover-path............................................................................................... 16
5.1.10 discover-route ............................................................................................. 16
5.1.11 get-adp-ib .................................................................................................... 17
5.1.12 set-adp-ib .................................................................................................... 17
5.1.13 get-mac-ib ................................................................................................... 17
5.1.14 set-mac-ib .................................................................................................... 17
5.1.15 set-psk ......................................................................................................... 18
5.1.16 set-gmk ........................................................................................................ 18
5.1.17 cfg-dc........................................................................................................... 18
5.1.18 rekey-nwk .................................................................................................... 20
5.1.19 set-phy-tx-params ....................................................................................... 20
5.1.20 discover-net ................................................................................................. 20
5.1.21 start-net ....................................................................................................... 21
5.1.22 get-route-table............................................................................................. 21
5.1.23 get-neighbor-table....................................................................................... 21
5.1.24 get-device-table ........................................................................................... 21
5.2 MANAGEMENT INTERFACE MESSAGE SEQUENCE ................................................ 23
5.2.1 Show active nodes ....................................................................................... 23
5.2.2 Detach Node................................................................................................ 23
6.0 EVENT MESSAGE INTERFACE ................................................................... 24
6.1 EXAMPLE EXTERNAL EVENT MONITOR APPLICATION........................................... 24
7.0 PSK SERVER INTERFACE ............................................................................. 25
7.1 DEFAULT EXAMPLE PSK SERVER........................................................................ 25
7.2 PSK SERVER INTERFACE MESSAGE SEQUENCE................................................... 26
7.2.1 Get PSK from EUI ...................................................................................... 26
REFERENCE .................................................................................................................. 27
1.0 Introduction
The G3 DC allows external applications to communicate with the nodes (meters) in its
network. The G3 DC runs on an IPv4/IPv6 addressable system. The external application
can run anywhere as long as it has TCP/IPv4 connectivity to the G3 DC.

The G3 DC includes a server which accepts UDP/TCP connections on specified port


numbers. Depending on which port receives the packet, the server will forward it to the
appropriate interface.

This document specifies the format of messages exchanged between G3 DC and an


external application client. All multi-byte fields are sent in network byte order. The
following diagram illustrates the G3 DC components.

OMAP L138 (ARM9)

PSK Server
Buffer Manager

IPv6 Management interface


IPv6 TunX
6LoWPAN Adaptation Layer

Upper MAC
Management
HCT Server

Linux OS

UART Interface
(HCT message)
C2000 (F28069 SOM board)

HCT
Buffer Manager

Lower MAC
PHY

HAL

DSP-BIOS
2.0 TI G3 DC Interfaces
The TI G3 Data Concentrator (DC) software package supports the following interfaces:

 IPv6 Application Interface


o Interface to communicate to an app on a node (meter) within the G3 DC’s
network

 Management Interface
o Network management
 Nodes information
 Route/Path
 Event notifications

 PSK Server
o EUI PSK management
3.0 Message Format
Figure 1 shows the format of messages exchanged by the Mgmt entity and G3 DC. All
multi-byte values are sent in network byte order.

Messages are formatted as: message header + message body

Message
Message Body
Header

Figure 1 Message Format

3.1 Message Header Format


Length bits
Offset Octets 7 6 5 4 3 2 1 0

0 1 Message Type

1 1 DIR SOL STD LFF RESV

2 1 Message Payload Length

3 1 Message Payload Length

4 1 Message Payload Length (When LFF is 1)

5 1 Message Payload Length (When LFF is 1)


Figure 2 Message Header Format

Field Description
Message Type Message Type identifier.

DIR Direction of the message. Client -> DC (1) / DC -> Client (0).

SOL Solicited message (0) / Unsolicited message (1)

Note events notifications are unsolicited message


STD DC standard. PRIME (0) / G3 (1)

LFF Length field flag. If bit is 1, all length fields (message header and body) are 4
bytes in size. If bit is 0, all length fields (message header and body) are 2
bytes in size.

RESV Reserved bits. Set to 0.

Message Payload A 16 bit number representing the length of the message payload.
Length
Figure 3 Message Header Fields Description
3.2 Message Payload Format
The message payload is sent in the TLV (type, length and value) format. The message
payload has a single top level TLV which can contain can have any number of TLVs
each of which can be simple or compound. In other words, each TLV in the payload must
be encapsulated within a parent TLV except for the top level TLV.

Figure 4 shows the layout of TLVs used in the message payload.

Type Length Value


(2 bytes) (2 or 4 bytes) (N bytes)
Figure 4 TLV format

If the LFF bit in the message header is 1, for every TLV included in the message, the
TLV length field value field is 4 bytes in size. If the LFF bit in the message header is 0,
for every TLV included in the message, the TLV length field value field is 2 bytes in
size.

Message payloads in this document are described in a format similar to the one shown
below:

<Optional/Mandatory>
TLV level: 0
TLV type: X0
TLV length field value: Variable/Fixed
TLV count: 1

< Optional / Mandatory >


TLV level: 1
TLV type: X1
TLV length field value: Variable/Fixed
TLV count: Variable/Fixed

<Mandatory>
TLV level: 2
TLV type: X2
TLV length field value: Variable/Fixed
TLV count: Variable/Fixed

The “level” information shows the depth of the TLV from the top most TLV in the
payload. Level 0 refers to the top most TLV itself. The “count” information shows the
number of TLVs of the same type allowed at a specific level. For example, there can be
only one top level TLV but there can be any number of
“MGMT_TLV_TYPE_ACTIVE_NODE_INFO” TLVs at level 1 (one for each active
node in the G3 network). Finally, any TLV is optional or mandatory. A TLV is optional
if it may or may not be included when its parent is included in the payload. A TLV is
mandatory if the TLV should always be included when its parent is included in the
payload.
4.0 IPv6 Application Interface
The G3 DC allows external applications (using UDP/IPv6) to communicate with the
nodes (meters) in its network. The G3 DC creates a virtual network device “tun0” on the
OMAP L138 and assigns a link local IPv6 address to it. This link local address is derived
from the G3 PAN Id and DC’s short address (0x0000). All G3 nodes (meters) use the
IPv6 stateless auto-configuration mechanism to self assign a link local address based on
the G3 PAN Identifier and short address (allocated by the DC). This “tun0” interface is
the gateway to the G3 network. External apps can only be run on the OMAP L138 board
since the G3 network uses link local addresses only.

You can look at the “tun0” interface by running the Linux “ifconfig” command. The IPv6
address will look like “fe80::<pan-id>:00ff:ffee:0000. If the PAN Identifier is 0x7455,
the IPv6 address will be “fe80::7455:00ff:ffee:0000.

A node with short address 0x1234 will assign itself the IPv6 address
“fe80::7455:00ff:ffee:1234”.

When an app sends a packet to a node in the G3 network, the packet will be sent by the
IPv6 layer (on the OMAP L138) to the tun0 interface. The tun0 interface will send it to
the G3 DC which in turn will send it over the power line. UDP/IPv6 packets received by
the DC over the power line will be written to the tun0 interface which will forward them
to the IPv6 layer which in turn will send them to application (running on the OMAP
L138) bound to the specified destination UDP port number.

Overloading Type of Service field for MSDU handle and LQI Indication:
The Type service field is used by IPv6 to indication the priority of the IPv6
frames. Two allowed values are: 0x20 (High Priority) and 0x00 (Normal Priority). This
implies that the priority is based on only one of the eight bits.
The remaining 7 bits are overloaded to represent the MSDU handle and LQI value in the
direction towards and away from DC.

The following illustrates the conversion between the MSDU handle to ToS bit in IPv6
packet.
From the 7-bit handle to the 7 bits of TOS:
tosbits = (MSDUHandle & 0x1F) | ((MSDUHandle << 1) & 0xC0);
Note that if no such value is specified, that is all zeros are used for this field like in
regular Ipv6 frames, the MSDU handle shall also be only zero. This would allow the host
to continue to use existing IPv6 applications like PING6.

Similarly, when a IPv6 frame is received from the TUN interface to the application, these
7 bits are overloaded to represent the LQI value (0 to 127). The mapping between the
IPv6 to LQI is as follows:LQI = ((tosbits >> 1) & 0x60) | (tosbits & 0x1F);

Handling Global IP Addresses:


By default, the TUN interface shall be configured to accept any destination IP
address with a source address set to link local address of DC. The filtering based on
prefix table shall be performed by the G3-ADP stack corresponding to the configured
prefix table.

Since the prefix table entry could match multiple source IP addresses based on the length
of the prefix, the application is expected to add a specific source IP addresses depending
on the requirement. This can be achieved by configuring the linux system command:
ip -6 addr add <IP address>/<prefix len> dev tun0

e.g., the following commands would result in an interface as shown below:


ip -6 addr add 1122:3344:5566:7788:7455:00ff:fe00:0000/45 dev tun0
ip -6 addr add 2233:4455:6677:8899:7455:00ff:fe00:0000/48 dev
tun0

As shown in the figure, the default configuration FE80::PANID:00FF:FE00:0000/0


would allow for any destination IP address to be sent via the TUN interface to the G3
Stack with a link local source IP address.

4.1 Example IPv6 external application


The G3 DC package includes an example application “udpIPv6App” which uses
UDP/IPv6 to send data to a specified node within the G3 network. This app can be used
to send unicast, multicast and broadcast packets. Broadcast is achieved by sending to the
all node multicast address (ff02: :01).

The relevant files are:


 udpIPv6App.c
 Makefile

You can compile this application for the OMAP L138 platform by running “make”
without any arguments.

This application “udpIPv6App” takes multiple command line arguments as shown below:

udpIPv6App \
-l <pkt length> \
-s <dest short address (hex)> | -b | -m <13 bit multicast group id> \
-p <pan Id (hex)>] \
[-u <dest UDP port>] \
[-t <response time out in seconds>]
-l <pkt length>
This argument is used to specify the length of the data packet which will
be sent to the specified service node.

-s <dest short address (hex only)>


This argument is used to specify the short address of the service node to
which the application with send data.

-b
This argument is used to request a broadcast transmission using the all
node multicast destination address ff02 :: 01.

-m
This argument is used to request a multicast transmission to the specified
group. The multicast group is identified by a 13 bit group id. Assuming
the 13 bit multicast group id is ‘0xabcd’, the app sends a packet to the
IPv6 multicast address ff02 :: (0x8000 | 0xabcd).

-p <pan id (hex only)>


This argument is used to specify the PAN id. This argument is optional;
default PAN id is 0x7455.

-u <dest UDP port>


This argument is used to specify the destination UDP port. This argument
is optional; default port number is 10000.

-t <response time out in seconds>


This argument is used to specify time (in seconds) for service node to loop
back the data. This argument is optional; default time out value is 5
seconds.

Example:
Prompt>./udpIPv6App -l 32 -s 0x0102
Prompt>./udpIPv6App -l 32 –b
Prompt >./udpIPv6App -l 32 –m 0x5

When the application ‘udpIPv6App” runs, it does the following:

 Parses the specified command line arguments

 Opens an IPv6/UDP socket. Uses the “tun0” virtual network device created by
the G3 DC.

 If user has requested unicast transmission, sends a single data packet of specified
length to specified service node. If user has requested broadcast transmission,
sends a single packet to the all node multicast address ff02 :: 01. If user has
requested multicast transmission, sends a single packet to the multicast address
ff02 :: (0x8000 | 0xabcd) where 0xabcd is the specified 13 bit multicast address.

 Data is a repeating pattern ('a' to 'z')

 Waits specified time (in seconds) for destination to loop back the data.

 When app receives data it checks length and pattern.

 App prints out the round trip time (in milliseconds)

 If a unicast packet was sent, the app will exit at this point. If a multicast or
broadcast packet was sent, app will wait for more packets. You need to use ctrl-c
to kill the app in this case. Note that G3 service nodes in embedded appemu mode
will loop back a multicast / broadcast packet to the unicast address of the source.
This means a network with ‘N’ nodes (in embedded appemu mode ) will in theory
generate ‘N - 1’ unicast responses to a broadcast packet. Similarly a G3 network,
which has ‘M’ members in a multicast group (0xabcd), will generate ‘M - 1’
unicast responses to a multicast packet sent to the group ‘0xabcd’, assuming all
these member nodes are in embedded appemu mode.
5.0 Management Interface
The G3 DC allows external applications “sw\g3_mgmt_cli” to communicate with it.
Some messages are for getting specific information from the DC while others are
commands to be executed by the DC.

The G3 DC runs on an IPv4/IPv6 addressable system. The external application can run
anywhere as long as it has TCP/IPv4 connectivity to the G3 DC.

The G3 DC includes a MGMT server which accepts TCP connections on the default port
number 20000. Use the ‘-m’ option when starting the G3 DC to specify another port
number.

For additional details on the message types and TLV structures used in the Management
interface, please refer to the doc “TI PLCSUITE G3 DC MGMT INTF MSG”.

5.1 Example external management application


The G3 DC package includes an example application “sw\ g3_mgmt_cli” which uses the
management interface services.

You can build this application for the ARM9 platform by running the command “make”.
Then to run, you will have to transfer the executable to the ARM9 filesystem.

To run the CLI client, go to the directory where the g3_mgmt_cli executable resides on
the ARM9 filesystem. Execute the application without any arguments.

target# ./g3_mgmt_cli
Connecting to 127.0.0.1:20000
Connected…
>>
You can use the “?” command to get a list of all implemented commands. You can also
get more help on a specific command using the “?” argument.

For example:
>> discover-route ?
discover-route –da <16-bit short addr>

The commands are described in the following sections.


5.1.1 ?

Parameters: None
Returns: List of all commands
Example:
>> ?
get-dc-std
get-dc-ver
get-dc-dsp-ver
get-mac-node-info
detach-node
discover-path
discover-route
get-adp-ib
set-adp-ib
get-mac-ib
set-psk
set-gmk
cfg-dc
rekey-nwk
set-phy-tx-params
discover-net
start-net

5.1.2 ctrl-c

Parameters: None
Description: Exit the CLI

5.1.3 q

Parameters: None
Description: Exit the CLI

5.1.4 get-dc-std

Parameters: None
Description: Get the DC type (PRIME or G3)

5.1.5 get-dc-ver
Parameters: None
Description: Get the DC software version
5.1.6 get-dc-dsp-ver

Parameters: None
Description: Get the DC DSP software version

5.1.7 get-mac-node-info

Parameters: None
Description: G3 DC PAN ID and list of attached nodes. Each node is identified by its
short address and extended.
Example:

5.1.8 detach-node

Parameters: -da <16-bit short address>


Description: Detaches specified node from network. The short address can be in
hexadecimal format or decimal format.
Example:
>> detach-node –da 0x101
Request sent ..

5.1.9 discover-path

Parameters: -da <16-bit short address>


Description: Initiates a path discovery for the specified node. The short address can be
in hexadecimal format or decimal format.
Example:
>> discover-path –da 234
Request sent ..

5.1.10 discover-route

Parameters: -da <16-bit short address>


Description: Initiates a route discovery for the specified node. The short address can be
in hexadecimal format or decimal format.
Example:
>> discover-route –da 35
Request sent ..

5.1.11 get-adp-ib

Parameters: -a <attribute id in hex>


Description: Get the specified ADP attribute. If the specified attribute is a list attribute,
this command will retrieve all valid entries in the corresponding list.
Example:
>> get-adp-ib –a 0x1f
Attr value length : 2
Attr value : 257

5.1.12 set-adp-ib

Parameters: -a <attribute id in hex> -v <value in hex> -i <attribute index in hex>


Description: Get the specified ADP information base attribute. The attribute index
parameter is mandatory for list attributes
Example:
>> set-adp-ib –a 0x5 -v 0xa
Attribute value updated

>> set-adp-ib –a 0xe -v 0x1234 -i 0x2


Attribute value updated

5.1.13 get-mac-ib

Parameters: -a <attribute id in hex>


Description: Get the specified MAC information base attribute
Example:
>> get-mac-ib –a 0x2000101
Attr value length : 2
Attr value : 15

5.1.14 set-mac-ib

Parameters: -a <attribute id in hex> -v <attribute value> [ -i <attribute index in hex> ]


Description: Set the specified MAC information base attribute
Example:
>> set-mac-ib –a 0x2000101 –v 1
Attribute ID: 0x02000101
Attribute Length: 4
Attribute value: 1 / 0x1

5.1.15 set-psk

Parameters: -v <value (byte string of 16 bytes) in hex>


Description: Set the PSK key
Example:
>> set-psk –v
0x12:0x34:0x56:0x78:0x12:0x34:0x56:0x78:0x12:0x34:0x56:0x78:0x12:0x34:0x56:0x7
8
Attribute value updated …

5.1.16 set-gmk

Parameters: -v <value (byte string of 16 bytes) in hex>


Description: Set the GMK key
Example:
>> set-gmk –v
0x12:0x34:0x56:0x78:0x12:0x34:0x56:0x78:0x12:0x34:0x56:0x78:0x12:0x34:0x56:0x7
8
Attribute value updated …

Note: To activate this key in MAC use set-adp-ib command in management cli to set
GMK index. (ADP PIB id 0x90)

Note: This will not be supported from 4.2 version. New GMK Keys can be set along with
their Ids using the rekey command.

5.1.17 cfg-dc

Parameters: -srf <enable or disable silent reboot, default is disable>


-mfcth <mac frame counter threshold (decimal)>
-smfc <saved mac frame counter (decimal)>
-snth <load-ng sequence number threshold (decimal)>
-ssn <saved load-ng sequence number (decimal)>
-snal <node address list file name (string)>
Description: Configure the DC
Example:
To run G3 DC without silent reboot functionality
>> cfg-dc –srf dis
Success

To run G3 DC (in non-AES mode) with silent reboot functionality


>> cfg-dc –srf ena
Success

To run G3 DC (in non-AES mode) with silent reboot functionality and node list recovery
>> cfg-dc –srf ena –snal /tmp/nl
Success

To run G3 DC (in AES mode) with silent reboot functionality


>> cfg-dc –srf ena –mfcth 25
Success

To run G3 DC (in AES mode) with silent reboot functionality and node list recover
>> cfg-dc –srf ena –mfcth 25 –smfc 103 –snal /tmp/nl
Success

To use silent restart option with cfg-dc command, the following parameters need to be
configured:
1) SN address table: input by txt file
a. DC needs to maintain SN table (for long-address and short-address) based on
ATTACH/DETACH events.
b. As an example, the txt file includes the following formatted context:

<00.00.00.00.00.00.00.06:0002>
<00.00.00.00.00.00.00.01:0005>
….

2) LOADNG sequence number


3) LOADNG sequence number threshold
4) MAC frame count
5) MAC frame count threshold

Here is an example of parameters to be set when using silent restart option with cfg-dc
command.
Initial After restarting

Enable/disable Enable Enable

LOADNG sequence number 0 Latest update for LOADNG


sequence number+LOADNG
sequence number threshold
LOADNG sequence number 20 20
threshold

MAC frame count 0 Latest update for MAC frame


count+MAC frame count
threshold

MAC frame count threshold 2000 2000

SN address table Empty txt Address table txt file

NOTE: Please note in case of Silent DC reboot ,if the CoordShortAddress( LBS) short
address was non – zero before restart , the CoordShortAddress PIB (0x01000107) would
need to be explicitly set on the DC restart after the cfg-dc command .

5.1.18 rekey-nwk

Parameters: -i <key-idx (0 - 255 in decimal)> -k <key (16 bytes hex string)>


Parameters: -a <abort>
Description: Starts a network rekey or optionally attempts to abort a rekey currently in
progress.
Example:
>> rekey-nwk -i 1 -k ab:cd:01:02:09:ff:de:af:ff:fc:bd:55:91:78:89:00
>> rekey-nwk -a

5.1.19 set-phy-tx-params

Parameters: set-phy-tx-params -ga <TX gain/attenuation> -pgaa <TX PGA attenuation>


Description: Set the values of PHY TX gain/attenuation and TX PGA attenuation on
lower MAC.
Allowed range for TX gain/attenuation: -60 ~ 30, represents -6dB to 3dB in 0.1dB steps.
For example, -22 represent -2.2dB.
Allowed values for TX PGA attenuation: 0 = 0dB, 1 = -3dB, 2 = -6dB.
Example:
>> set-phy-tx-params -ga -5 -pgaa 2
Request sent to DC ...

5.1.20 discover-net

Parameters: <16-bit scan duration>


Description: Initiate the network discover operation. This command can include a single
decimal number parameter specifying the scan duration in seconds. If the scan duration
parameter is not present or the value is 0, the default duration of 12 seconds is used.
Example 1 (default scan duration):
>> discover-net
Network Discovery in progress: 12 seconds
...

Example 2 (explicit scan duration):


>> discover-net 15
Network Discovery in progress: 15 seconds

5.1.21 start-net

Parameters: <16-bit PAN ID>


Description: Start a new network (PAN). This command can include a single decimal
number parameter specifying the PAN ID of the new network. If the PAN ID parameter
is not present, the default PAN ID of 0x7455 is used.
Example 1 (default PAN ID):
>> start-net
Network start in progress (0x7455) ...
...

Example 2 (explicit PAN ID):


>> start-net 0x1234
Network start in progress (0x1234) ...

5.1.22 get-route-table

Parameters: None
Description: Get the route table.
Example:
>> get-route-table

5.1.23 get-neighbor-table

Parameters: None
Description: Get the neighbor table. Example:
>> get-neighbor-table

5.1.24 get-device-table
Parameters: None
Description: Get the RX device table.
Example:
>> get-device-table
5.2 Management Interface Message Sequence

The diagram below shows the message sequence between the Management interface and
TI G3 DC.

5.2.1 Show active nodes

Mgmt CLI TI G3 DC

G3_SHOW_ACTIVE_NODES

MGMT_TLV_TYPE_ACTIVE_
NODE_INFO_LIST

5.2.2 Detach Node

Mgmt CLI TI G3 DC

G3_DETACH_NODE

Un-register node
G3_DETACH_NODE
confirmation
6.0 Event message interface
The G3 DC generates events messages in response to G3 network events such as node
attach and node detach. If an external app establishes a connection to TCP port 45000,
the DC will send event messages to this external app over the TCP connection. Note that
events will be sent to only one external app. For additional details on the message types
and TLV structures used over the events interface, please refer to the doc “TI PLCSUITE
G3 DC MGMT INTF MSG”.

6.1 Example external event monitor application


The G3 DC package includes an example application “sw\g3_evt_mon” which connects
to the G3 DC through TCP port number 45000. This application connects to the G3 DC
and waits for event messages from the DC. It prints out a description of each event
message received from the G3 DC.

You can build this application for the ARM9 platform by running the command “make”.
Then to run, you will have to transfer the executable to the ARM9 file system.

To run the event client, go to the directory where the g3_evt_mon executable resides on
the ARM9 filesystem. Execute the application without any arguments.

target# ./g3_evt_mon
Connecting to 127.0.0.1:45000
Connected…
>>
7.0 PSK Server interface
The G3 DC generates a request for a PSK for each EUI joining the network. The request
is sent to a PSK Server, which maintains a EUI/PSK pair. The default PSK Server
(psksvr_omap for the OMAP_L138 platform, psksvr_AM335X for the AM335X
platform or psksvr for the X86 platform) is loaded automatically by the G3 DC provided
another PSK Server IP Address has not been provided to the G3 DC.

When the server node is attempting to join the network, the G3 DC will ask the PSK
Server to supply the PSK for the service node by supplying the service node EUI address
to the PSK Server. The PSK Server will respond to the G3 DC supplying the requested
PSK. Additionally, the PSK Server can reject the request by responding to the G3 DC's
request with an unsuccessful status code.

Optionally, the PSK Server can assign the short address and return the short address to
the DC with the PSK. If the DC is to assign the short address as it has in prior releases,
then the PSK Server will not return a short address when returning the EUI/PSK pair.

For additional details on the message types and TLV structures used over the PSK Server
interface, please refer to the doc “TI PLCSUITE G3 DC MGMT INTF MSG”.

7.1 Default example PSK Server


The G3 DC package includes a default TI PSK Server which the G3 DC will load
automatically provided another PSK Server's IP Address is not given to the G3 DC. The
PSK Server executable must be located in the same directory as the G3 DC for this to
occur. The default PSK Server supplied by TI provides the same processing the G3 DC
had previously done, with some additional features added.

The TI PSK Server listens for connections through TCP port number 30001 and accepts
any connection request. After the G3 DC connects to the PSK Server, the PSK Server
can be queried for the PSK of the given service node EUI address. The PSK Server
always returns a status code indicating the status of the request. The status code value 0
(zero) indicates the PSK is given for the EUI, otherwise the PSK is not returned and the
status code indicates the reason, which can be error, EUI not found in the white list, etc.

The TI PSK Server can either supply the TI default PSK for all EUI nodes, which is the
prior G3 DC operation, or can read a file containing EUI/PSK pairs and return
individualized PSK for each service node. The EUI/PSK whitelist file is named
pskeuilist. The pskeuilist file contains records of EUI/PSK pairs, one pair per line, each
line terminated with a new line character '\n'. The EUI/PSK pair contains the EUI and
PSK in hexadecimal, each octet separated with a hyphen '-'. The following is an example
pskeuilist file:
80-00-00-00-00-00-00-01 00-11-22-33-44-55-66-77-88-99-aa-bb-cc-dd-ee-ff
80-00-00-00-00-00-00-02 00-11-22-33-44-55-66-77-88-99-aa-bb-cc-dd-ee-10
80-00-00-00-00-00-00-03 00-11-22-33-44-55-66-77-88-99-aa-bb-cc-dd-ee-10

If the EUI/PSK whitelist file pskeuilist does not exist in the same directory as the TI PSK
Server, the default PSK will be used for each EUI request.

The TI PSK Server does not optionally assign the short address.

You can build this application for the ARM9 platform by running the command “make”.
Then to run, you will have to transfer the executable to the ARM9 file system.

7.2 PSK Server Interface Message Sequence

The diagram below shows the message sequence between the PSK Server interface and
TI G3 DC.

7.2.1 Get PSK from EUI

PSK SVR TI G3 DC

G3_GET_PSK_FROM_EUI

G3_GET_PSK_FROM_EUI
response
Reference
[1]. TI PLC Kit-V3: http://focus.ti.com/docs/toolsw/folders/print/tmdsplckit-v3.html
[2]. PLC G3 MAC Layer Specification
[3]. PLC G3 PHY Layer Specification

You might also like