Skip to content

Commit

Permalink
update peering.py
Browse files Browse the repository at this point in the history
* add ExperimentController
* add requirements.txt
* add experiment example
* add experiment schema

pairing jsonschema files

add experiment generator

update peering-bgp script

add experiment generator

add experiment generator

update api client scripts

* move experiment-generator
* refactor peering.py
* update announcement_schema

update requirements.txt

add test prefixes to the schema

update README
  • Loading branch information
MarcelHMendes authored and cunha committed Apr 24, 2023
1 parent 01c143f commit df95e84
Show file tree
Hide file tree
Showing 9 changed files with 621 additions and 34 deletions.
32 changes: 31 additions & 1 deletion README.md
Original file line number Diff line number Diff line change
@@ -1,3 +1,4 @@

# PEERING client controller

The PEERING client controller is a set of scripts to ease
Expand All @@ -14,7 +15,7 @@ After cloning [this repository][1], follow the following
instructions to install software dependencies and set up your
PEERING client.

[1]: https://github.com/TransitPortal/client
[1]: https://github.com/TransitPortal/client

### Software dependencies

Expand Down Expand Up @@ -220,6 +221,35 @@ the namespace pointed to by `-n` and routes created through upstream
`-u`, so these parameters must be passed identically to when the
namespace was created.

## Running announcements via Web

PEERING offers a way to make announcements via REST API, without the need for a VPN
connection and prior approval of an experiment on the platform. These announcements are
scheduled and made according to the availability of prefixes. Each sequence of
announcements is considered an experiment, which will run one after the other in a 90-minute interval.

An example of an experiment can be seen at `utils/experiment-examples/experiment-1.json`.
An experiment can be generated by using the following python code `utils/experiment-
generator.py`.

To deploy an experiment we can use the peering script in this directory. Just pass the
experiment as parameter and the URL of the page.

`./peering.py --experiment <experiment.json> --url <api-url>`

Note that you must have the permission token that is available in the user dashboard on the PEERING site. The token must be in the certificate directory `certs/token.json` as follows:

```
{
"access":"<token>"
"refresh": ""
}
```

PS: The refresh token is not required, this functionality is currently disabled

More information on the wiki [page][5]

### Troubleshooting

In case sending traffic out of the namespace does not work, here are a list of things to check:
Expand Down
21 changes: 18 additions & 3 deletions configs/announcement_schema.json
Original file line number Diff line number Diff line change
Expand Up @@ -2,6 +2,9 @@
"title": "PrefixAnnouncement",
"type": "object",
"minProperties": 1,
"propertyNames": {
"$ref": "#/definitions/allocatedPrefix"
},
"additionalProperties": {
"$ref": "#/definitions/prefixAnnouncement"
},
Expand Down Expand Up @@ -53,7 +56,16 @@
},
"peeringASN": {
"$ref": "#/definitions/ASN",
"enum": [47065, 33207, 61574, 61575, 61576, 263842, 263843, 263844]
"enum": [
47065,
33207,
61574,
61575,
61576,
263842,
263843,
263844
]
},
"peeringMux": {
"type": "string",
Expand All @@ -64,7 +76,8 @@
"grnet01",
"isi01",
"neu01",
"phoenix01",
"saopaulo01",
"sbu01",
"seattle01",
"ufmg01",
"ufms01",
Expand Down Expand Up @@ -103,7 +116,9 @@
"$ref": "#/definitions/peeringASN"
}
},
"required": ["muxes"]
"required": [
"muxes"
]
},
"prefixAnnouncement": {
"type": "object",
Expand Down
141 changes: 141 additions & 0 deletions configs/experiment_schema.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,141 @@
{
"title": "Experiment schema",
"type": "object",
"minProperties": 1,
"additionalProperties": false,
"required": [
"description",
"email",
"rounds"
],
"properties": {
"rounds": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/prefixAnnouncement"
}
},
"description": {
"type": "string"
},
"email": {
"type": "string",
"format": "email"
}
},
"definitions": {
"prefix": {
"type": "string",
"pattern": "^[0-9.]+/[0-9]+$|[ABCD]"
},
"ASN": {
"type": "number",
"minimum": 1,
"maximum": 4294967295
},
"allocatedPrefix": {
"$ref": "#/definitions/prefix",
"enum": [
"184.164.224.0/24",
"204.9.168.0/24",
"204.9.169.0/24",
"204.9.170.0/24",
"204.9.171.0/24"
]
},
"peeringASN": {
"$ref": "#/definitions/ASN",
"enum": [
47065,
33207,
61574,
61575,
61576,
263842,
263843,
263844
]
},
"peeringMux": {
"type": "string",
"enum": [
"amsterdam01",
"clemson01",
"gatech01",
"grnet01",
"isi01",
"neu01",
"saopaulo01",
"sbu01",
"seattle01",
"ufmg01",
"ufms01",
"utah01",
"uw01",
"wisc01"
]
},
"announcement": {
"type": "object",
"required": [
"muxes"
],
"properties": {
"muxes": {
"type": "array",
"minItems": 1,
"uniqueItems": true,
"items": {
"$ref": "#/definitions/peeringMux"
}
},
"peers": {
"type": "array",
"uniqueItems": true,
"items": {
"type": "number"
}
},
"prepend": {
"type": "array",
"minItems": 1,
"maxItems": 5,
"items": {
"$ref": "#/definitions/ASN"
}
},
"origin": {
"$ref": "#/definitions/peeringASN"
}
}
},
"prefixAnnouncement": {
"type": "object",
"minProperties": 1,
"propertyNames": {
"$ref": "#/definitions/allocatedPrefix"
},
"patternProperties": {
"^": {
"properties": {
"withdraw": {
"type": "array",
"items": {
"$ref": "#/definitions/peeringMux"
}
},
"announce": {
"type": "array",
"minItems": 1,
"items": {
"$ref": "#/definitions/announcement"
}
}
},
"minProperties": 1
}
}
}
}
}
Loading

0 comments on commit df95e84

Please sign in to comment.