Skip to main content

MeshDB Schema Design

Background


MeshDB is an under-development software application withwhich the goal of replacingreplaces the New Node Responses Google Sheet (the spreadsheet) as the source of truth for NYCMesh member, install, geolocation, device, and connection information via a proper SQL database. It is built in the Django ORM, using Python Model objects to represent underlying database schema structures. The schema used for development up to this point is unable to faithfully represent some edge cases that occur at atypical NYC mesh sites. In this document, we proposesummarize athe modifieddatabase schema and explain eacha variety of edge case,case that occur on the mesh, detailing how the edge case will beis represented under the proposedMeshDB schema

The Schema (Simplified)


The following diagram depicts the proposed schema, showing the relationships between models (SQL tables), and some key attributes of each model. For clarity, non-essential attributes are omitted (see appendix A for a comprehensive diagram).

 

yTvuLjFSnE4i_y7ZXj3wgC42tUVsLUdSL_lgQYnWgQ1GCx0I1lYCRRkRYFkjEu2G6qcVMulAy05RmOe79wH2tgoPO55eb3EqaPtuhSNynoLnReLxKZ92E6ndro1yVdpYBqKzyaYri6xCMGFufmzj_6kMeshDB-Simplified Sept 24.drawio.png

 

We proposehave the following models:

  1. Member - Represents a single NYC Mesh Member (even if they have moved between multiple addresses and therefore have multiple installs or "own" multiple active installs ). Tracks their name, email address, and other contact details
  2. Install - Represents the deployment (or potential deployment) of NYC Mesh connectivity to a single household. This most closely maps to the concept of a row in the spreadsheet. Tracks the unit number (apt. number) of the household, which member or members livelives there, and which building the unit is located within. It isalso keyedcontains byan install number, which corresponds to row number on the spreadsheet. With foreign keys to Member, Building, and Device,Node, it acts as the central model, tying most of the entire schema together. Many objects have a status field, but the install status field maps most closely onto the status tracked in the spreadsheet today. Completed Installs have a foreign key to the device field (via_device) which keeps track of the device they use to connect to the meshspreadsheet.
  3. Building - Represents a location in NYC identified by a single street address (house number and street name). In the case of large physical structures with more than one street address, we will store one Building object for each address that we have received Install requests for. Buildings track a primary network number,node, to represent the way"colloquial network number" used by volunteers to describe the site is referred to colloquially.site. In the case that a building has more than one network number, the primary network numbernode will be set tobased on the onenetwork number that volunteers designate as the “primary”“primary” (usually the first assigned, busiest router, etc.)
Node - Represents the abstract concept of a an NYC Mesh "site". Most closely corresponds to a dot on the map. Most concretely, this refers to a collection of NYC Mesh devices with the same network number. Each node has a single network number. A node can be assigned to multiple "building" objects, in the case that a single physical structure has more than one street address. Device - Represents a networking device (router, AP, P2P antenna, etc.). Most closely corresponds to a “dot” on the map. Not comprehensive of all devices on the mesh, only those that need a map dot. For big hub sites, this may be only the core router. Contains a mandatory fieldforeign forkey “networkto number” (NN)node, which will be set tobased on the NN of the device, or of the ““first hop”hop” router used by this device (for devices like APs which have no NN assigned). It contains optional lat/lon override fields, which can be used to refine the exact location of this device (e.g. for map display). When no lat/lon are provided for a device, is it assumed to reside at the lat/lon of the building it is associated with (via the Install model). Devices can optionally track which install delivers them power, via a powered_by_install foreign key to the Install model, which tells us which unit has the PoE injector.
    Sector - A special type of device (using Django Model Inheritance to inherit all fields from device) which adds additional fields related to the display of sector coverage information on the map (azimuth, width, and radius)   Access Point - A special type of device (using Django Model Inheritance to inherit all fields from device) which adds additional fields related to the display of APs on the map. It contains lat/lon override fields, which can be used to refine the exact location of this device for map display Link - A connection between devices, which represents a cable or wireless link, whether directly between the devices or via other antennas not represented with their own device objects
    LOS - Identifies a pair of building objects which can see each other. Renders as a "potential" link on the map display (if not superseded by an active Link object connecting the same dots). This can be populated manually by volunteers, or in the future, automatically by analysis tools


    Example 1 - NN492 - Typical Multi-Tenant Install


    Q_7eQIyBy8xClOrJiWr5WizfZElZIhLplc-tKXhKEv41jg_wTUavg9Yg75N66jpmVll_7ufrxd2eA8r6ksX6CKcIRsybkMlHCnD9jOtx1pJtjF2aADYJjf_gFOFHvYbdYFx5neBvBc5KAEURekf2kS0


    In this simple example, we have two tenants in a single building with a single address, both connected via cables directly to an omni on their shared roof. They are connected to the rest of the mesh via an LBE to Saratoga. The database tables for this scenario look like this:

    Installs

    Install Number

    Via Device

    Building

    13134

    1

    1

    13276

    1

    1

    Buildings

    ID

    Primary NN

    Address

    BIN

    1

    492

    216 Schaefer Street

    3079532

    Devices

    ID

    Network Number

    lat/lon overrides

    1

    492

    -


    Example 2 - NN 4734 - Cross-Building Installs

    1_ci4WKvvwYaHMcEkCXFDRPTy4lS-ISig5mM5CDBH3SaVe1QDb9ObpQt6KzKG4Ao6Jrx4JJdC6FwTMn4LU1pmSzHE-QDzFhYElkA29YSgTYIJ7X6cQKBbkdL2RZbBZgRvbauBgbGfRSPAnxt7fISg9o


    In this example, members in 3 adjacent buildings, each with their own address, are connected via a single omni, with cable runs across the roofs directly to the member’member’s apartments. They are connected to the rest of the mesh via an mant 802.11 sector at 4507. The database tables for this scenario look like this:

    Installs

    Install Number

    Via Device

    Building

    4734

    2

    2

    6972

    2

    3

    13663

    2

    4

    Buildings

    ID

    Primary NN

    Address

    BIN

    2

    4734

    31 Clarkson Ave

    3115982

    3

    4734

    25 Clarkson Ave

    3115985

    4

    4734

    27 Clarkson Ave

    3115984

    Devices

    ID

    Network Number

    lat/lon overrides

    2

    4734

    -

    Example 3 - 7th Street (NN 731) - Multiple Omnis on one building

    OWm_fuFTE6LM8NVCWjm0u7VO9X6utAqXRXEHihHK86lP7BefMqQQsu8SK7xM7MUgdd-8_p0lyA1km12PuYka9E4bCJnCra8H2F2lxmllpNHuyBOnewVxrfUCLOIvKb9QeZVhvaDmLO6_yUmF9JDG6hI

    In this example, we have one regular tenant in a single building with a single address. However there is also a rooftop office with its own omni, connected wirelessly to the primary one. They are connected to the rest of the mesh via a GBELR to Grand. The database tables for this scenario look like this:

    Installs

    Install Number

    Via Device

    Building

    731

    3

    5

    12985

    4

    5

    Buildings

    ID

    Primary NN

    Address

    BIN

    5

    731

    190 East 7th Street

    1086499

    Devices

    ID

    Network Number

    lat/lon overrides

    3

    731

    -

    4

    311

    x, y

    Example 4 - Vernon (NN 5916) - Courtyard APs


    L4cDJNx6b5gF7FzZp93xnezGq-L-NsMYNdNBX-Ualhmtr8EPdsRcdMtanT1a-97lLTk_kZv3AC-qw7TdgaELqI8AVdzhjXHMkTz1114EXPFC4YqE5Kfv-o-w1Q5t8xnFaVpkCWQUZwPk8jW5FAtgOMM


    In this example, we have a core hub site in a single building with a single address. However, there are many Access Points (APs) on light poles in the building’building’s courtyard. These light-poles are unquestionably associated with the same building/address as the core router of this hub, but need to be shown separately on the map. 


    In this scenario, we treat the light poles as if they are “apartments”“apartments” in the Vernon building. They each get their own install #, but imagining a tenant living in the light pole, we say that this imaginary install is ““connected via”via” a device object representing the AP. The network number for these APs is set to 5916, reflecting their first hop router (and the fact they are not themselves assigned NNs). Links between the courtyard APs and the core router are included so that they are rendered on the map  


    The database tables for this scenario look like this:

    Installs

    Install Number

    Via Device

    Building

    5916

    5

    6

    6345

    -

    6

    11875

    6

    6

    11876

    7

    6

    11877

    8

    6

    11878

    9

    6

    11879

    10

    6

    11880

    11

    6

    Buildings

    ID

    Primary NN

    Address

    BIN

    6

    5916

    303 Vernon Avenue

    3042881

    Devices

    ID

    Network Number

    lat/lon overrides

    5

    5916

    -

    6

    5916

    x, y

    7

    5916

    x, y

    8

    5916

    x, y

    9

    5916

    x, y

    10

    5916

    x, y

    11

    5916

    x, y

    Example 5 - Prospect Heights (NN 3461) - Multiple NNs for one building


    4T5lSwNF9bx2F0D48zGGggZVoeWV7A3EBaafgfdFwsC_OHh6TkS9oB8tKFwt1e_89phI7Yj496zEvK61pz1DQxWVdBSU-Bw9Gch1NFI2B-FE8kPDKoNNfFqB2SuBTvfQrDnRBIqU_VAmY5YbC6Nzeh4


    In this example, we have a core hub site in a single building with a single address. The primary NN 3461, also serves a member’member’s apartment as install #3461. However, there is another apartment which could not due to practical considerations be connected via a cable, and had to be connected via an antenna in their window to a sector on the roof. This antenna needed an NN for configen and naming, and so this building received multiple NNs.


    The database tables for this scenario look like this:

     

    Installs

    Install Number

    Via Device

    Building

    3461

    3461

    7

    3921

    -

    7

    6723

    -

    7

    11024

    377

    7

    14399

    -

    7

    14960

    -

    7

    Buildings

    ID

    Primary NN

    Address

    BIN

    7

    3461

    135 Eastern Parkway

    3029628

    Devices

    ID

    Network Number

    lat/lon overrides

    12

    3461

    -

    13

    377

    x, y

    Example 6 - Jefferson (NN 3606) - Multiple NNs for multiple buildings

    YXeqqAsldECrjWLNABBYGQonSWV5_Ix5bHf-PbEo2RofOssrf-gg4248jrIySm060w2dnZqKWIobZCp-ppWFUYiIv1RnwdF_PEHzz-QNrRtFRcdp_h6BxXmX0fihl7JjTU-G1CZrrZCQv5nTGA6OBEg


    In this example, we have a building with 4 addresses and 3 omnis on the roof, each with its own network number. There is no clean mapping between NNs and addresses, since each omni serves installs in multiple buildings. The omni of the primary NN, 3606, provides the uplink to Hex House (NN 1417). 


    The database tables for this scenario look like this:

    Installs (omitting abandoned & potential for brevity)

    Install Number

    Via Device

    Building

    3606

    14

    8

    5933

    15

    8

    7177

    15

    8

    8152

    16

    8

    8274

    14

    9

    8085

    16

    11

    Buildings

    ID

    Primary NN

    Address

    BIN

    8

    3606

    476 Jefferson Street

    3819572

    9

    3606

    488 Jefferson Street

    3819572

    10

    3606

    28 Scott Avenue

    3819572

    11

    3606

    16 Cypress Avenue

    3819572

    Devices

    ID

    Network Number

    lat/lon overrides

    14

    3606

    x, y

    15

    5933

    x, y

    16

    169

    x, y

    Appendix A - Full Schema Diagram

    The following is a complete schema diagram, showing all fields. New additions from the current implementation are shown in yellow, and removed fields are shown in red


    kO0jJmTLk1kM7omkY3fUO0lYq1Dc4HnqR3mNIbN1P0j9o-XrA498sDTSJoHHE8rd6CvtJ5RVxRvaeSROuSfsKWNt2FEKTzDwZvTPxuRb3shvkX1dsEEfXOWCptYrxEWRuRehS9oODbR4XokPSM-dRU4