Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Schema proposal for aggregated and timeseries IXP statistics #1

Open
wants to merge 9 commits into
base: master
Choose a base branch
from
Open
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
87 changes: 86 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,2 +1,87 @@
# json-traffic
JSON schema for sharing traffic data
JSON schema for sharing traffic data.

The following document describes schemata for
aggregated and timeseries data.

## Timeseries Data

Timeseries data of traffic is a list of samples with a timestamp.
The sampled data is aggregated over a given window (`aggregate_interval` seconds).
Knowing the interval, we can check the integrity of the series.

The sources should be identified by their ixf_ixid and should be unique.

The samples arn n-tuples of

- `timestamp` (ISO 8601)
- `packets_in`
- `packets_out`
- `octets_in`
- `octets_out`


### Example
{
"version": "1.0",
"created_at": "2001-10-23T23:30:12Z",
"next_update_at": "2001-10-23T23:45:12Z",
"sources": {
"<ixf_ixid>": {
"url": "https://...",
"title": "IX LAN 1",
"aggregate_interval": 300,
},
},
"samples": {
"<ixf_ixid>": [
["2001-10-23T23:42:10Z", 23, 42, 12897, 481],
]
}
}

### Schema

[schema/json-traffic-timeseries-v1.json](schema/json-traffic-timeseries-v1.json)

## Aggregate Data

This is a schema for aggregated data for the ixp. It should should be serverd separatly
from the timeseries data.


### Example
{
"version": "1.0",
"created_at": "2001-10-23T23:30:12Z",
"next_update_at": "2001-10-23T23:45:12Z",
"sources": {
"<ixf_ixid>": {
"url": "https://...",
"title": "IXP LAN 1 (1 Day)",
"aggregate_interval": 86400,
},
},
"statistics": {
"<ixf_ixid>": {
"current_packets_in": 1730224,
"current_packets_out": 17456,
"current_octets_in": 1734882240,
"current_octets_out": 173220,
"average_packets_in": 18470161,
"average_packets_out": 305805818,
"average_octets_in": 18470161,
"average_octets_out": 305805818,
"maximum_packets_in": 431179242464,
"maximum_packets_out": 431870526584,
"maximum_octets_in": 431179242464,
"maximum_octets_out": 431870526584,
"maximum_in_at": "2020-05-07T14:40:00Z",
"maximum_out_at": "2020-05-07T14:40:00Z"
}
}

### Schema

[schema/json-traffic-aggregated-v1.json](schema/json-traffic-aggregated-v1.json)

148 changes: 148 additions & 0 deletions schema/json-traffic-aggregated-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,148 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "IXP Statistics Aggregated Schema",
"description": "A JSON schema representing the aggregated traffic at an IXP",
"type": "object",
"required": [
"version",
"created_at",
"next_update_at",
"sources",
"aggregated"
],
"properties": {
"version": {
"title": "Schema Version",
"description": "Version number of the schema; this is not the version of the file within an IXP; but the schema version",
"type": "string"
},
"created_at": {
"title": "Datetime of export",
"description": "Datetime (ISO 8601) of when the data was exported",
"type": "string",
"format": "date-time"
},
"next_update_at": {
"title": "Datetime of next export",
"description": "Datetime (ISO 8601) of the next time when the data will be exported",
"type": "string",
"format": "date-time"
},
"sources": {
"title": "Statistic Sources",
"description": "A hash of sources, with ixf_ixid as the key",
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"required": [
"title",
"url",
"aggregate_interval"
],
"properties": {
"url": {
"type": "string",
"title": "URL of the IXP's statistics page",
"description": "Url of the IXP's own statistics page"
},
"title": {
"type": "string",
"title": "Title / Display name",
"description": "The title or display name of the IXP",
"example": "MY-IXP LAN-1"
},
"aggregate_interval": {
"type": "integer",
"title": "Aggregate Interval",
"description": "Width of the aggregate window in seconds.",
"example": 86400
}
}
}
},
"statistics": {
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"required": [
"current_packets_in",
"current_packets_out",
"current_octets_in",
"current_octets_out",
"average_packets_in",
"average_packets_out",
"average_octets_in",
"average_octets_out",
"maximum_packets_in",
"maximum_packets_out",
"maximum_octets_in",
"maximum_octets_out",
"maximum_in_at",
"maximum_out_at"
],
"properties": {
"current_packets_in": {
"type": "integer",
"description": "The current number of packets going in"
},
"current_packets_out": {
"type": "integer",
"description": "The current number of packets going out"
},
"current_octets_in": {
"type": "integer",
"description": "The current number of octets going in"
},
"current_octets_out": {
"type": "integer",
"description": "The current number of octets going out"
},
"average_packets_in": {
"type": "integer",
"description": "The average number of packets going in"
},
"average_packets_out": {
"type": "integer",
"description": "The average number of packets going out"
},
"average_octets_in": {
"type": "integer",
"description": "The average number of octets going in"
},
"average_octets_out": {
"type": "integer",
"description": "The average number of octets going out"
},
"maximum_packets_in": {
"type": "integer",
"description": "The maximum number of packets going in"
},
"maximum_packets_out": {
"type": "integer",
"description": "The maximum number of packets going out"
},
"maximum_octets_in": {
"type": "integer",
"description": "The maximum number of octets going in"
},
"maximum_octets_out": {
"type": "integer",
"description": "The maximum number of octets going out"
},
"maximum_in_at": {
"type": "string",
"description": "The datetime of the peak",
"format": "date-time"
},
"maximum_out_at": {
"type": "string",
"description": "The datetime of the peak",
"format": "date-time"
}
}
}
}
}
}
94 changes: 94 additions & 0 deletions schema/json-traffic-timeseries-v1.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,94 @@
{
"$schema": "http://json-schema.org/draft-07/schema",
"title": "IXP Statistics Timeseries Schema",
"description": "A JSON schema representing the timeseries traffic at an IXP",
"type": "object",
"required": [
"version",
"created_at",
"next_update_at",
"sources",
"samples"
],
"properties": {
"version": {
"title": "Schema Version",
"description": "Version number of the schema; this is not the version of the file within an IXP; but the schema version",
"type": "string"
},
"created_at": {
"title": "Datetime of export",
"description": "Datetime (ISO 8601) of when the data was exported",
"type": "string",
"format": "date-time"
},
"next_update_at": {
"title": "Datetime of next export",
"description": "Datetime (ISO 8601) of the next time when the data will be exported",
"type": "string",
"format": "date-time"
},
"sources": {
"title": "Statistic Sources",
"description": "A hash of sources, with ixf_ixid as the key",
"type": "object",
"properties": {},
"additionalProperties": {
"type": "object",
"required": [
"title",
"url",
"aggregate_interval"
],
"properties": {
"url": {
"type": "string",
"title": "URL of the IXP's statistics page",
"description": "Url of the IXP's own statistics page"
},
"title": {
"type": "string",
"title": "Title / Display name",
"description": "The title or display name of the series"
},
"aggregate_interval": {
"type": "integer",
"title": "Aggregate Interval",
"description": "Width of the aggregate window between samples in seconds."
}
}
}
},
"samples": {
"description": "A collection of samples",
"type": "object",
"properties": {},
"additionalProperties": {
"type": "array",
"items": [
{
"description": "Datetime of the sample",
"type": "string",
"format": "date-time"
},
{
"description": "Packets in",
"type": "integer"
},
{
"description": "Packets out",
"type": "integer"
},
{
"description": "Octets in",
"type": "integer"
},
{
"description": "Octets out",
"type": "integer"
}
]
}
}
}
}