Database structure

The mobile_networks.js library is used to talk with the database store.

The database store is a simple JSON file called "networks.json"

Networks collection

This collection is the most important one since this hosts each local server information (IP address, IP range of his managed network, current status, ...)

This collection will be queried allways, if the client give us the MCC-MNC pair, the server will generate a generic network id with the MCC MNC pair splitted by a dash. After that, the service will query this collection to find that network.

If networkId is provided in the query, resolution will be faster since only one query to this collection is needed.

Each register is a JSON formatted string with the following attributes:

  • host:

    URL to send HTTP queries to local nodes.

    Shall follow the standard URI scheme: http(s)://host:port

  • range:

    IP range or ranges accepted into this network.

    Shall follow the standard CIDR scheme: a.b.c.d/n

    An array of ranges is also allowed: [ "a.b.c.d/n", "a.b.c.d/n" ]

  • nework:

    MCC-MNC of this network

    This MCC-MNC can be shared by multiple networks.

  • protocols:

    This is an optional parameter.

    It's an array with all supported wakeup protocols. By default tcp and udp should be declared.

    If this data is declared, will be sent to the clients on the netinfo/v1 query and will be used to validate the proto parameter of wakeup/v1 API.

  • offline:

    Used by the local server checker to inform about a fail in the local nodes

    If this attribute is not available, it's considered as if the local server is working normally.

    Valid values are allways boolean (true or false)

Some examples:

Local host with issues:

"networkLocal": {
  "host": "http://127.0.0.1:9000",
  "range": "10.0.0.0/8",
  "network": "214-07",
  "offline": true
}
        

Local wakeup without any issue:

"networkBTest": {
  "host": "http://127.0.0.1:9000",
  "range": "10.95.0.0/16",
  "network": "002-01",
  "offline": false
}
        

Local wakeup without any issue (or unknown satus):

"networkCTest": {
 "host": "http://127.0.0.1:9000",
 "range": "10.0.0.0/8",
 "network": "214-07"
}