(CTTC) Consume optical spectrum pre-reservation in flex-grid optical connectivity services
# Proposers
- Lluis Gifre (CTTC)
# Description
TeraFlowSDN currently computes and provisions optical connectivity services, but flex-grid lightpath services do not provide a complete controller-level contract for explicit spectrum selection and later verification of the effective allocation.
The optical controller already computes path, selected band, selected slots, frequency, bandwidth, flow identifier, and path information for wavelength/flex-grid lightpaths, and the multi-granular optical-band path already has partial support for an explicit `optical-spectrum-reservation` input.
However, the `flexi_grid` optical service path currently uses the regular lightpath workflow, which does not consume the explicit spectrum reservation constraint, and the public TFS API does not expose a normalized effective allocation for an active optical connectivity service.
The proposed enhancement is to make `SERVICETYPE_OPTICAL_CONNECTIVITY` with `type=flexi_grid` support optional explicit spectrum constraints and expose the effective allocation after provisioning.
If no explicit spectrum is supplied, the current first-fit behavior should remain unchanged.
If explicit spectrum is supplied, the optical controller should validate that the requested band and slot interval can satisfy the required channel width on every optical link of the selected path, then either provision using that spectrum or reject the request with a clear error.
After successful provisioning, TFS should persist and expose the effective allocation associated with the service, including service UUID, service state, flow ID, band, selected slot list or slot range, frequency, bandwidth, path nodes, path endpoints, and path optical links.
The exposed allocation must represent what the optical controller actually selected, not merely the requested constraint.
The feature should align the flex-grid lightpath path with the reservation-aware slot selection already present in the optical controller helper logic.
The expected implementation is to extend the regular lightpath workflow to accept the same normalized reservation input used by the flex-lightpath workflow, pass it into slot selection, persist the resulting allocation in service or connection state, and add a TFS API resource to retrieve allocation evidence by service UUID.
This avoids requiring callers to inspect internal optical-controller diagnostic endpoints and makes TFS itself the authoritative source for service allocation verification.
# Demo or definition of done
The enhancement is complete when the following high-level conditions are met.
- A `SERVICETYPE_OPTICAL_CONNECTIVITY` service with custom constraint `type=flexi_grid` can be created without explicit spectrum constraints and keeps the existing first-fit behavior.
- A `type=flexi_grid` service can be created with explicit spectrum constraints such as `optical-spectrum-reservation=<band>:<start>-<end>` or equivalent split fields, and the selected slots are within the requested interval.
- If the requested spectrum interval is unavailable or too narrow for the required channel width, service update fails with a deterministic error and does not leave an active partial service.
- Once the service reaches `SERVICESTATUS_ACTIVE`, a TFS API GET operation can retrieve the effective allocation by service UUID.
- The allocation response includes at least service UUID, service status, flow ID, band, selected slots, frequency, bandwidth, path nodes, path endpoints, and path optical links.
- The allocation response is derived from persisted TFS service or connection state, or from controller state that is synchronized into such persisted state during provisioning.
- Deleting the service releases the selected slots on the involved optical links, and subsequent allocation retrieval reports a deleted/not-found service or a non-active allocation state.
- Unit tests cover reservation parsing, flex-grid slot selection with and without explicit spectrum, rejection of unavailable spectrum, persisted allocation fields, TFS API allocation retrieval, and slot release after deletion.
- A small integration test can create a flex-grid optical service between two optical endpoints, request a non-default slot range, verify that the exposed effective slots match the controller-selected slots, delete the service, and verify release.
## Acknowledgements
This work is funded by the European Commission through the HORIZON-JU-SNS-2023 PROTEUS-6G project with Grant Agreement number 101139134.
issue