LonTalk Addressing LONWORKS networks are hierarchically structured, using logical addressing which comprises domains, subnets, and individual devices (aka "nodes"). Domain ID 01 02 03 04 05 06 six-byte length: good for shared media; larger addressing overhead 01 02 03 three-byte length, a size of compromise 01 one-byte length: good for private networks zero-length: network management only LonTalk packet Node ID Subnet ID 2F one byte (1 .. 255) 1 0 1 1 0 1 1 Domain / Subnet / Node IDs seven bits (1..127) Domain A LONWORKS domain is the set of devices that can communicate with each other. A LONWORKS domain has an identifier of 0, 1, 3, or 6 byte length, and is usually in hex notation. Examples: 01 Denotes a domain with a 1-byte identifier of value 0x01 010203 Denotes a domain with a 3-byte identifier of value 0x010203 0C03CB2E010A Denotes a domain with a 6-byte identifier of value 0x0C03CB2E010A The domain with a zero-byte identifier is commonly referred to as the zero-length domain, which should be reserved for network management purposes only. Since the domain identifier is part of every packet on the network, the domain ID's length has an impact on the performance of the network. A 6-byte domain ID takes 40 bits more to transmit than a 1-byte ID. For this reason, a private network would typically use 1byte domain identifiers. Open media networks such as ones using power line or radio frequency channels should use longer domain identifiers even though channel performance is limited by transceiver constraints. This is to ensure that a device that is not part of the same network can never accidentally receive a packet. Consequently, a network using power line channels or long-reach radio frequency channels, for example, should use a 6-byte domain signature despite the limited channel performance. A good, unique value for the domain ID might be the Neuron ID of the network interface (or any other Neuron ID). For a locally operating radio frequency network and similar channel types, a randomly chosen 3-byte domain identifier might be sufficient to avoid domain duplication within the reach of this network1. Subnet ID Each LONWORKS domain can accommodate up to 255 subnets. A subnet is a (possibly empty) set of devices, typically associated with a LONWORKS channel. Each subnet has a numerical identifier 1 to 255, which a network management tool assigns to a LONWORKS device as part of the commissioning process. Since a subnet is associated with a channel, the subnet ID automatically carries information about the location of a device. An addressing mode using the subnet ID as part of the destination address allows for LONWORKS routers to limit the exposure of packets to the network. Packets will only be exposed to channels as required: the channel (subnet) from which the packet originates, the channel (subnet) to which it is targeted, and all channels between source and destination. 1 Note that a LONWORKS device might be member of up to two domains, and therefore able to send and receive messages addressed to either of the two domains. It is subject to the network management tool and some special devices to take advantage of this feature. Today, this feature is not widely used. Note that a subnet typically is associated with one and only channel2, whereas the reverse is not true in general. A given LONWORKS channel can accommodate more than one subnet, allowing a channel to host many devices. Node ID Each LonTalk subnet can accommodate up to 127 devices, where each of these devices will have a numerical node identifier in the range 1-127. This ID is unique within the device's subnet. The sole purpose of the node ID is to uniquely identify a device on a given subnet. The node ID itself has no meaning or impact on routers. Subnet/Node ID Addressing The node ID is only used together with the subnet ID. The related LonTalk addressing mode is called Subnet/Node-ID addressing (short: S/N addressing). The domain ID is always transmitted as part of any LonTalk packet. LonTalk Addressing Modes When a LonTalk packet needs to travel from a source to one or more destination nodes, the packet needs to carry addressing information about the destination node(s) as well as about the initiating node (so that receivers can reply accordingly). Earlier in the class we discussed an addressing mechanism that uses either the Neuron ID of the destination node (aka Neuron ID Addressing) or the subnet/node ID of the destination device (aka Subnet/Node ID Addressing). The disadvantage of these addressing modes is that they are only suitable to address a single destination device. This is what is referred to as a unicast: a packet is due to travel from one device to one other device. For a packet to reach multiple destination devices at a time, which is commonly referred to as a multicast, different addressing mechanisms are required. Group Addressing The LonTalk protocol supports group addressing, which allows for up to 64 devices to be part of up to 127 groups per LONWORKS domain. Most devices can only be a member of up to 15 different groups at a time3. Note that the group membership of each LONWORKS device is maintained in the Neuron chip's address table, a rare resource that is also used for other purposes. Thus, a device will typically be able to join less than 15 groups, subject to the configuration of the device and the network. 2 The case where a subnet spans a router and therefore is associated with more than one channel is an exceptional case rarely used. This exception might occur if the number of required channels exceeds the number of possible subnets per domain (255). See your network management tool's documentation on permanent routers and permanent bridges for more details. 3 LNS host devices based on LNS 3 and the VNI technology can join more groups, however, note that this enhancement is limited to this special type of device. Note that groups can be an unlimited size. This is what is commonly referred to as an open group, and is limited to unacknowledged service types. In other words, you can only use open groups if the destination devices do not need to reply to the sender. Broadcast Addressing The alternative to group addressing is broadcast addressing. A packet using broadcast addressing is sent to all devices in scope, where the broadcast scope can be a subnet, or the entire domain. These addressing mechanisms are usually referred to as domain broadcasts and subnet broadcasts, respectively. Like open groups, broadcast addressing does not allow use of acknowledged service types. In that respect, the two techniques are very similar. The main difference is that becoming a member of a group requires use of one of the few address table entries, while being a target for a packet using broadcast addressing does not require this valuable device resource. When to Use Group Addressing vs. Broadcast Addressing First, do not forget that only group addressing allows for acknowledged multicasts and request/response service types. Open groups and broadcast addressing only allow for unacknowledged services. Also, you should never use domain broadcast addressing with unacknowledged/repeated (UCKD/RPT) service, but only with unacknowledged/unrepeated (UCKD) service. Second, note that group addressed messages can be routed and used even if the destination devices are not on one subnet. Subnet broadcast addressing is an alternative to using groups when all the destination devices are on the same subnet. Subnet broadcast packets can be routed to the destination subnet according to the routers' forwarding tables (assuming a pre-configured router). The routers also maintain routing information for the 127 possible groups. Domain broadcast messages will have to go everywhere and thus flood the network.