Choose what this site may use

This site uses strictly necessary cookies to work and to remember your privacy choices. With your permission it would also load content hosted by other services, such as videos, maps and fonts, which then receive your network address and device data. We do not sell or share your personal information and we run no advertising. Choose Accept all, Reject all or Customise. You can change your mind at any time through Privacy choices at the foot of every page.

  • Always on

    Needed for the site to work and to remember your privacy choices. Always on.

  • Remembers settings you choose, such as the light or dark display, in your browser.

  • Loads videos, maps and other content hosted by other services. Those services receive your address and device data.

Menu Close
In this section: Specification
Specification
Functions
Schemas
Registers

TimeQuality

Source schemas/json/time-quality.schema.json

On this page
  1. Properties
  2. Positive fixtures
  3. Negative fixtures
  4. Mappings to open standards
  5. Schema

Time quality a node reports with its observations and receipts (OBSP 0.1 section 5.4): source class, offset bound, holdover and integrity flags. GNSS alone, the system clock or an unknown source can never be trusted; any spoofing, jamming or authentication failure makes the time untrusted.

FieldValue
Identifierurn:obsp:schema:v3.1:timequality
Dialecthttps://json-schema.org/draft/2020-12/schema
Used by functionsTime

Properties

PropertyRequiredTypeDescription
schemaVersionyesreference
apiVersionyesconstant
kindyesconstant
protocolVersionyesconstant
timeQualityUniyesreference
nodeUniyesreference
assessedAtyesreference
sourceClassyesenumeration
referenceSourcenoobject
ptpProfilenoenumeration
offsetBoundyesobjectEstimated bound on the offset from the reference, in nanoseconds. UNKNOWN carries no number, never zero.
holdoveryesobject
integrityyesobject
trustedyesbooleanWhether time-dependent receipts may be signed on this time base
evidenceRefsnoarray
recordedAtyesreference
extensionsnoreference

Positive fixtures

  • time-quality.gnss-holdover-untrusted.valid.json
  • time-quality.valid.json

Negative fixtures

  • time-quality.gnss-only-trusted.json: GNSS alone is never trusted time
  • time-quality.holdover-without-age.json: holdover states its age
  • time-quality.spoofing-suspected-trusted.json: suspected spoofing makes time untrusted
  • time-quality.system-clock-trusted.json: the system clock is never trusted time
  • time-quality.unknown-offset-as-zero.json: an unknown offset carries no number, never zero
  • time-quality.unknown-source-class.json: source class from the controlled vocabulary

Mappings to open standards

A mapping to a standard, never a conformance statement.

  • maps to NS-5 Figures, maps and visualization (relation REL-NS-5)
  • maps to RFC 3339 (date and time) (relation EXT-RFC3339)

Schema

{
  "$schema": "https://json-schema.org/draft/2020-12/schema",
  "$id": "urn:obsp:schema:v3.1:timequality",
  "title": "TimeQuality",
  "description": "Time quality a node reports with its observations and receipts (OBSP 0.1 section 5.4): source class, offset bound, holdover and integrity flags. GNSS alone, the system clock or an unknown source can never be trusted; any spoofing, jamming or authentication failure makes the time untrusted.",
  "type": "object",
  "required": [
    "schemaVersion",
    "apiVersion",
    "kind",
    "protocolVersion",
    "timeQualityUni",
    "nodeUni",
    "assessedAt",
    "sourceClass",
    "offsetBound",
    "holdover",
    "integrity",
    "trusted",
    "recordedAt"
  ],
  "properties": {
    "schemaVersion": {
      "$ref": "#/$defs/SchemaVersion"
    },
    "apiVersion": {
      "const": "obsp/time-quality/v3.1"
    },
    "kind": {
      "const": "TimeQuality"
    },
    "protocolVersion": {
      "const": "obsp/0.1"
    },
    "timeQualityUni": {
      "$ref": "#/$defs/Uni"
    },
    "nodeUni": {
      "$ref": "#/$defs/Uni"
    },
    "assessedAt": {
      "$ref": "#/$defs/Timestamp"
    },
    "sourceClass": {
      "enum": [
        "AUTHENTICATED_PNT",
        "PTP",
        "NTS",
        "GNSS_ONLY",
        "SYSTEM_CLOCK",
        "UNKNOWN"
      ]
    },
    "referenceSource": {
      "type": "object",
      "required": [
        "sourceKind",
        "uni"
      ],
      "properties": {
        "sourceKind": {
          "enum": [
            "NTS_SERVER",
            "PTP_GRANDMASTER",
            "GNSS_RECEIVER",
            "AUTHENTICATED_PNT_SERVICE",
            "LOCAL_OSCILLATOR"
          ]
        },
        "uni": {
          "$ref": "#/$defs/Uni"
        }
      },
      "additionalProperties": false
    },
    "ptpProfile": {
      "enum": [
        "IEEE_1588_DEFAULT",
        "ITU_T_G8275_1",
        "ITU_T_G8275_2",
        "IEEE_802_1AS"
      ]
    },
    "offsetBound": {
      "type": "object",
      "required": [
        "state"
      ],
      "properties": {
        "state": {
          "enum": [
            "BOUNDED",
            "ESTIMATED",
            "UNKNOWN"
          ]
        },
        "ns": {
          "type": "integer",
          "minimum": 0
        }
      },
      "additionalProperties": false,
      "if": {
        "properties": {
          "state": {
            "const": "UNKNOWN"
          }
        },
        "required": [
          "state"
        ]
      },
      "then": {
        "not": {
          "required": [
            "ns"
          ]
        }
      },
      "else": {
        "required": [
          "ns"
        ]
      },
      "description": "Estimated bound on the offset from the reference, in nanoseconds. UNKNOWN carries no number, never zero."
    },
    "holdover": {
      "type": "object",
      "required": [
        "state"
      ],
      "properties": {
        "state": {
          "enum": [
            "LOCKED",
            "HOLDOVER",
            "FREE_RUNNING",
            "UNKNOWN"
          ]
        },
        "ageSeconds": {
          "type": "number",
          "minimum": 0
        }
      },
      "additionalProperties": false,
      "if": {
        "properties": {
          "state": {
            "enum": [
              "HOLDOVER",
              "FREE_RUNNING"
            ]
          }
        },
        "required": [
          "state"
        ]
      },
      "then": {
        "required": [
          "ageSeconds"
        ]
      },
      "else": {
        "not": {
          "required": [
            "ageSeconds"
          ]
        }
      }
    },
    "integrity": {
      "type": "object",
      "required": [
        "spoofingSuspected",
        "jammingSuspected",
        "authenticationFailed"
      ],
      "properties": {
        "spoofingSuspected": {
          "type": "boolean"
        },
        "jammingSuspected": {
          "type": "boolean"
        },
        "authenticationFailed": {
          "type": "boolean"
        },
        "stepDetected": {
          "type": "boolean"
        },
        "leapSecondPending": {
          "type": "boolean"
        }
      },
      "additionalProperties": false
    },
    "trusted": {
      "type": "boolean",
      "description": "Whether time-dependent receipts may be signed on this time base"
    },
    "evidenceRefs": {
      "type": "array",
      "items": {
        "$ref": "#/$defs/EvidenceRef"
      }
    },
    "recordedAt": {
      "$ref": "#/$defs/Timestamp"
    },
    "extensions": {
      "$ref": "#/$defs/Extensions"
    }
  },
  "allOf": [
    {
      "if": {
        "properties": {
          "sourceClass": {
            "enum": [
              "GNSS_ONLY",
              "SYSTEM_CLOCK",
              "UNKNOWN"
            ]
          }
        },
        "required": [
          "sourceClass"
        ]
      },
      "then": {
        "properties": {
          "trusted": {
            "const": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "integrity": {
            "anyOf": [
              {
                "properties": {
                  "spoofingSuspected": {
                    "const": true
                  }
                },
                "required": [
                  "spoofingSuspected"
                ]
              },
              {
                "properties": {
                  "jammingSuspected": {
                    "const": true
                  }
                },
                "required": [
                  "jammingSuspected"
                ]
              },
              {
                "properties": {
                  "authenticationFailed": {
                    "const": true
                  }
                },
                "required": [
                  "authenticationFailed"
                ]
              }
            ]
          }
        },
        "required": [
          "integrity"
        ]
      },
      "then": {
        "properties": {
          "trusted": {
            "const": false
          }
        }
      }
    },
    {
      "if": {
        "properties": {
          "trusted": {
            "const": true
          }
        },
        "required": [
          "trusted"
        ]
      },
      "then": {
        "properties": {
          "offsetBound": {
            "properties": {
              "state": {
                "const": "BOUNDED"
              }
            }
          },
          "holdover": {
            "properties": {
              "state": {
                "enum": [
                  "LOCKED",
                  "HOLDOVER"
                ]
              }
            }
          }
        },
        "required": [
          "referenceSource"
        ]
      }
    },
    {
      "if": {
        "properties": {
          "sourceClass": {
            "const": "PTP"
          }
        },
        "required": [
          "sourceClass"
        ]
      },
      "then": {
        "required": [
          "ptpProfile"
        ]
      },
      "else": {
        "not": {
          "required": [
            "ptpProfile"
          ]
        }
      }
    }
  ],
  "$defs": {
    "SchemaVersion": {
      "type": "string",
      "const": "3.1.0"
    },
    "Uni": {
      "type": "string",
      "minLength": 8,
      "maxLength": 256,
      "pattern": "^[A-Za-z0-9][A-Za-z0-9:._/@-]{7,255}$",
      "description": "Durable UNI or typed unresolved identifier according to authority rules"
    },
    "Digest": {
      "type": "string",
      "pattern": "^[a-z0-9][a-z0-9._-]{1,31}:[A-Fa-f0-9]{32,128}$",
      "description": "Algorithm-prefixed hexadecimal digest"
    },
    "NonEmptyString": {
      "type": "string",
      "minLength": 1,
      "maxLength": 2048
    },
    "Timestamp": {
      "type": "string",
      "format": "date-time"
    },
    "RecordVersion": {
      "type": "string",
      "pattern": "^[0-9]+(\\.[0-9]+){0,2}$"
    },
    "Extensions": {
      "type": "object",
      "description": "Namespaced extension bag; unknown top-level fields remain forbidden.",
      "propertyNames": {
        "pattern": "^[a-z][a-z0-9]*(\\.[a-z][a-z0-9]*)+$"
      },
      "additionalProperties": true
    },
    "EvidenceRef": {
      "type": "object",
      "required": [
        "uri",
        "digest"
      ],
      "properties": {
        "uri": {
          "type": "string",
          "minLength": 1,
          "maxLength": 4096
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        },
        "kind": {
          "type": "string",
          "minLength": 1,
          "maxLength": 128
        },
        "recordedAt": {
          "$ref": "#/$defs/Timestamp"
        }
      },
      "additionalProperties": false
    },
    "ProtocolRole": {
      "enum": [
        "NODE",
        "SITE_CELL",
        "CLUSTER",
        "FED_PEER",
        "GRID_OPERATOR",
        "PROVIDER",
        "VERIFIER",
        "CONSUMER",
        "STEWARD"
      ],
      "description": "OBSP 0.1 participant role (specification section 3). Roles, never company names."
    },
    "RecordRef": {
      "type": "object",
      "required": [
        "uni",
        "digest"
      ],
      "properties": {
        "uni": {
          "$ref": "#/$defs/Uni"
        },
        "version": {
          "$ref": "#/$defs/RecordVersion"
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "VersionedRecordRef": {
      "type": "object",
      "required": [
        "uni",
        "version",
        "digest"
      ],
      "properties": {
        "uni": {
          "$ref": "#/$defs/Uni"
        },
        "version": {
          "$ref": "#/$defs/RecordVersion"
        },
        "digest": {
          "$ref": "#/$defs/Digest"
        }
      },
      "additionalProperties": false
    },
    "CorrectionState": {
      "enum": [
        "CURRENT",
        "DISPUTED",
        "SUPERSEDED",
        "WITHDRAWN",
        "RECALLED"
      ]
    }
  },
  "additionalProperties": false
}