Run on nodes
Program type client
Communicates with Certificate Server, Registration Server
Description Program for nodes to request for registration with the control center.

Flow description

The registration client constructs the registration request, then sends it to the server. It gets the created node’s ID and saves it locally.

  1. Connect to the certificate server. Send a 4-byte packet containing the certificate magic number.
  2. Read the response from the certificate server as the public encryption certificate.
  3. Generate the registration request.
    1. If there is valid persisted node information, use the stored node ID.
    2. Prompt the user for the network ID and network registration key.
    3. Randomly generate a 32-byte key to be used for AES encryption.
  4. Using the public certificate, encrypt the registration request.
  5. Connect to the registration server. Send the encrypted packet.
  6. Get the response from the server. Read the first two bytes as the status. If the status is not 200, print the error that follows.
  7. Otherwise, use the generated node encryption key and decrypt the packet as per the node encryption protocol. Save the 16 byte node ID in local non-volatile storage.

Sequence diagram

Schema description

See the certificate server and the registration server schema.