beautypg.com

Explicitly controlling subnet allocation – Echelon LNS User Manual

Page 187

background image

LNS Programmer's Guide

173

When LNS discovers a router, it will automatically create a channel for the far side, and

will choose an existing channel for its near side. The far side channel may in fact be a
duplicate of a user-defined channel. Assuming that your LNS application defined a

logical definition of this router and specified the user defined channels, this discrepancy

will be resolved when the router is commissioned, and LNS will delete the channel that it
had created for the router’s far side.

Explicitly Controlling Subnet Allocation

Subnets are the second component of the three-component LonTalk

domain/subnet/device addressing hierarchy. The subnet address is the level at which

routers decide whether or not to forward a packet, so the same subnet cannot appear on
both sides of a configured or learning router. By default, the LNS Object Server creates a

new subnet when a subnet is full, or when a non-permanent router is added to the

system. A subnet is considered full as soon as there are 127 devices assigned to it.

Your application can explicitly create subnets by calling the Add() method on the

system’s Subnets collection, and allocate a device to a specific subnet when the device is
added to the system with the AppDevices collection’s Add() method. Reasons for

controlling subnet assignment include directing the use of subnet broadcasting, and the
anticipation of topology changes.

If your application explicitly controls subnet assignment in this manner, certain

constraints must be observed. Figure 8.2 helps illustrate these concepts:

Channel 1,
Subnet A

Channel 2, Subnet B

Configured
Router

Permanent
Bridge

Channel 3,

Subnet B

Configured

Router

Channel 4,

Subnets C and D

Figure 8.2 Subnets, Channels and Routers

1. Each channel can be assigned to more than one subnet. In figure 8.2,

Channel 4 is assigned to Subnets C and D.

2. Each subnet can only be assigned to a single channel, unless it is

assigned to multiple channels that are connected by permanent bridges

or permanent repeaters. In Figure 8.2, Subnet B spans Channels 2 and 3,