18. Address resolution
An ADDRESS_RESOLUTION service provider is responsible for address allocation and resolution. The size of the address space is detemined by the
parameter of the NODE_INFO service (
18.2. Usage and notes
Shell usage of this service via the
command is described in
. In this section, we show examples of how address allocation and address resolution can be implemented directly by sending messages.
Address allocation is typically required at startup, and usually initiated by the agent providing the NODE_INFO service to populate the
parameter of that service. To ask the ADDRESS_RESOLUTION service provider to allocate an address, an agent sends it a
. The allocation may depend on the node name, and so the request must contain the node name.
We can start the 2-node network, and manually test this on the shell of node A:
> a = agentForService(org.arl.unet.Services.ADDRESS_RESOLUTION); > a << new AddressAllocReq(name: 'A') AddressAllocRsp:INFORM[address:232]
Address resolution is performed via the
command sends this message on your behalf, and shows you the response:
> a << new AddressResolutionReq(name: 'A') AddressResolutionRsp:INFORM[address:232 name:A] > ans.address 232 > host('A') 232
While the address allocation and resolution processes may seem very similar, there is a conceptual difference between the two. Address allocation is performed for a new node without an address. The address allocation process associates it with an address. Address resolution is performed to find the address that was assigned to a node.
|The default ADDRESS_RESOLUTION service provider uses a hashing function to map node names to addresses. This enables it to allocate and resolve addresses without generating network traffic, as the hashing function generates the same address for a given name on each node. Because the hashing maps a large name space to a small address space, there is always the chance that two names map to the same address; we require that the network architect check this manually, and assign node names such that there are no address conflicts.|
|Network designers and protocol developers should not rely on the ADDRESS_RESOLUTION service provider being based on a hashing function for correct operation of the network.|
|<<< [Node information]||[Medium access control] >>>|