Skip to content

Commit

Permalink
document DB structure
Browse files Browse the repository at this point in the history
  • Loading branch information
juagargi committed Jul 8, 2020
1 parent 890ffd4 commit 3207931
Show file tree
Hide file tree
Showing 2 changed files with 25 additions and 30 deletions.
55 changes: 25 additions & 30 deletions doc/ColibriService.md
Original file line number Diff line number Diff line change
Expand Up @@ -202,33 +202,28 @@ type E2EReservationID uint16

## ReservationDB

```text
Table SegmentResvBase
------------------------------------------
ResvID integer unique index
Path blob unique index
PathType smallint
```

```text
Table SegmentResvs
------------------------------------------
ResvID integer FK, unique_together index_multicol
Index smallint unique_together index_multicol
ExpirationTick integer
BWClass smallint
RLC smallint
Token blob
```

* Records can be found either by reservation ID or by path.
* Path is a serialized byte array from the interface identifier pairs along the reservation path
(16 bytes per pair). The IA (64 bits) of the origin and destination ASes is prepended
and appended to the array. This builds a identifier which should be unique per path.

```text
Table E2EResv
------------------------------------------
ResvID integer unique index
SegmentRsvID integer FK
```
There are two main parts in the DB: the segment reservation entities, and the end to end entities.
To link the end to end reservations to the appropriate segment ones, a table is used.

There are no restrictions of cardinality other than uniqueness and non null-ness for some fields,
but nothing like triggers on insertion are used. E.g. it is technically possible to link more than three
segment reservations with a given end to end one. These cardinality restrictions are enforced by code.

![DB entities overview](fig/colibri_srv/DB.png).

Furthermore, there are some indices created to speed up lookups:

* seg_reservation
* id_as,suffix
* ingress
* egress
* path
* seg_index
* reservation,index_number
* e2e_reservation
* reservation_id
* e2e_index
* reservation,index_number
* e2e_to_seg
* e2e
* seg
Binary file added doc/fig/colibri_srv/DB.png
Loading
Sorry, something went wrong. Reload?
Sorry, we cannot display this file.
Sorry, this file is invalid so it cannot be displayed.

0 comments on commit 3207931

Please sign in to comment.