diff --git a/src/hackfest7/README.md b/src/hackfest7/README.md new file mode 100644 index 0000000000000000000000000000000000000000..91072fa20906b3e2b3223821cac5751ad126768d --- /dev/null +++ b/src/hackfest7/README.md @@ -0,0 +1,120 @@ +# Teraflow & NSC Hackfest Setup Guide + +This tutorial guides you through importing and configuring a virtual machine in VirtualBox, setting up the Teraflow and NSC environments, and interacting with the respective services via browser and API. + +## 1. Import the Virtual Machine + +1. Open **VirtualBox 7.0**. +2. Double-click the `.ova` file to import the virtual machine. +3. While the VM is being imported, proceed to configure the network. + +## 2. Configure NAT Network + +1. Go to **File → Tools → Network Manager**. +2. Under **NAT Networks**, click **Create**. +3. Set the following: + - **Name**: `TFS-NAT-Net` + - **IPv4 Prefix**: `10.0.2.0/24` + - Leave all other options **unchecked**. +4. Click on **Port Forwarding** and add the following rules: + +| Name | Protocol | Host IP | Host Port | Guest IP | Guest Port | +|-------|----------|-------------|-----------|-------------|------------| +| HTTP | TCP | 127.0.0.1 | 8080 | 10.0.2.10 | 80 | +| SSH | TCP | 127.0.0.1 | 2200 | 10.0.2.10 | 22 | + +## 3. Attach the NAT Network to the VM + +1. Right-click the imported virtual machine → **Settings → Network**. +2. Enable **Adapter 1**. +3. Set: + - **Attached to**: `NAT Network` + - **Name**: `TFS-NAT-Net` + +## 4. Start the Virtual Machine + +- Boot the VM from VirtualBox. + +## 5. Set Up Visual Studio Code + +1. Ensure the **Remote Development** extension is installed. +2. Click the green box in the lower-left corner → **Connect to Host → Configure SSH Hosts**. +3. Add the following to your SSH config: + + ``` + Host TFS-VM + HostName localhost + Port 2200 + User tfs + ``` + +4. Save and click **Connect to Host → TFS-VM**. +5. Enter the password: `tfs123`. + +## 6. Verify Teraflow Deployment + +1. Run: + ```bash + kubectl get pods -n=tfs + ``` + +2. If not running, execute the following: + + ```bash + cd tfs-hackfest7 + source my_deploy.sh + ./deploy/all.sh + ``` + +3. Open [http://localhost:8080/webui/](http://localhost:8080/webui/) in your browser to confirm the Teraflow Web UI is active. + +4. Load the topology: + - File: `network-topology-hackfest.json` + +## 7. Start NSC API + +1. Navigate to the NSC directory: + ```bash + cd nsc-hackfest7 + ``` + +2. Update the repo: + ```bash + git pull + git branch + ``` + +3. If not on the correct branch: + ```bash + git checkout hackfest7 + ``` + +4. Activate the virtual environment: + ```bash + source venv/bin/activate + ``` + +5. Run the app: + ```bash + python3 app.py + ``` + + If it fails: + ```bash + pip install -r requirements.txt + ``` + +6. Access the NSC API at [http://localhost:8085/nsc](http://localhost:8085/nsc). + +## 8. API Testing + +- **Create (POST)**: Send a POST request to create an item. +- **Read (GET)**: Send a GET request to retrieve it. +- **Update**: Modify the resource via PUT/PATCH. +- **Delete**: Remove the resource via DELETE. + +Use tools like `curl`, `Postman`, or your browser’s REST client extensions to interact with the API. + +--- + +Happy Hacking! diff --git a/src/hackfest7/network-topology-hackfest.json b/src/hackfest7/network-topology-hackfest.json new file mode 100644 index 0000000000000000000000000000000000000000..395ca084b97262d345586f6486b8fa5baf54dce0 --- /dev/null +++ b/src/hackfest7/network-topology-hackfest.json @@ -0,0 +1,535 @@ +{ + "contexts": [ + { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + } + } + ], + "topologies": [ + { + "topology_id": { + "context_id": { + "context_uuid": { + "uuid": "admin" + } + }, + "topology_uuid": { + "uuid": "admin" + } + } + } + ], + "devices": [ + { + "device_id": { + "device_uuid": { + "uuid": "1.1.1.1" + } + }, + "name": "1.1.1.1", + "device_type": "emu-packet-router", + "device_operational_status": 1, + "device_drivers": [ + 0 + ], + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "uuid": "mgmt", + "name": "mgmt", + "type": "mgmt" + }, + { + "uuid": "eth0", + "name": "eth0", + "type": "copper" + }, + { + "uuid": "eth1", + "name": "eth1", + "type": "copper" + }, + { + "uuid": "eth2", + "name": "eth2", + "type": "copper" + } + ] + } + } + } + ] + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "2.2.2.2" + } + }, + "name": "2.2.2.2", + "device_type": "emu-packet-router", + "device_operational_status": 1, + "device_drivers": [ + 0 + ], + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "uuid": "mgmt", + "name": "mgmt", + "type": "mgmt" + }, + { + "uuid": "eth0", + "name": "eth0", + "type": "copper" + }, + { + "uuid": "eth1", + "name": "eth0", + "type": "copper" + } + ] + } + } + } + ] + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "3.3.3.3" + } + }, + "name": "3.3.3.3", + "device_type": "emu-packet-router", + "device_operational_status": 1, + "device_drivers": [ + 0 + ], + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "uuid": "mgmt", + "name": "mgmt", + "type": "mgmt" + }, + { + "uuid": "eth0", + "name": "eth0", + "type": "copper" + }, + { + "uuid": "eth1", + "name": "eth1", + "type": "copper" + }, + { + "uuid": "eth2", + "name": "eth2", + "type": "copper" + } + ] + } + } + } + ] + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4.4.4.4" + } + }, + "name": "4.4.4.4", + "device_type": "emu-packet-router", + "device_operational_status": 1, + "device_drivers": [ + 0 + ], + "device_config": { + "config_rules": [ + { + "action": 1, + "custom": { + "resource_key": "_connect/address", + "resource_value": "127.0.0.1" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/port", + "resource_value": "0" + } + }, + { + "action": 1, + "custom": { + "resource_key": "_connect/settings", + "resource_value": { + "endpoints": [ + { + "uuid": "mgmt", + "name": "mgmt", + "type": "mgmt" + }, + { + "uuid": "eth0", + "name": "eth0", + "type": "copper" + }, + { + "uuid": "eth1", + "name": "eth1", + "type": "copper" + } + ] + } + } + } + ] + } + } + ], + "links": [ + { + "link_id": { + "link_uuid": { + "uuid": "1.1.1.1-4.4.4.4" + } + }, + "name": "1.1.1.1-4.4.4.4", + "attributes": { + "total_capacity_gbps": 10, + "used_capacity_gbps": 0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "1.1.1.1" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4.4.4.4" + } + }, + "endpoint_uuid": { + "uuid": "eth0" + } + } + ] + }, + { + "link_id": { + "link_uuid": { + "uuid": "4.4.4.4-1.1.1.1" + } + }, + "name": "4.4.4.4-1.1.1.1", + "attributes": { + "total_capacity_gbps": 10, + "used_capacity_gbps": 0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "4.4.4.4" + } + }, + "endpoint_uuid": { + "uuid": "eth0" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "1.1.1.1" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + } + ] + }, + { + "link_id": { + "link_uuid": { + "uuid": "1.1.1.1-2.2.2.2" + } + }, + "name": "1.1.1.1-2.2.2.2", + "attributes": { + "total_capacity_gbps": 10, + "used_capacity_gbps": 0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "1.1.1.1" + } + }, + "endpoint_uuid": { + "uuid": "eth0" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "2.2.2.2" + } + }, + "endpoint_uuid": { + "uuid": "eth0" + } + } + ] + }, + { + "link_id": { + "link_uuid": { + "uuid": "2.2.2.2-1.1.1.1" + } + }, + "name": "2.2.2.2-1.1.1.1", + "attributes": { + "total_capacity_gbps": 10, + "used_capacity_gbps": 0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "2.2.2.2" + } + }, + "endpoint_uuid": { + "uuid": "eth0" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "1.1.1.1" + } + }, + "endpoint_uuid": { + "uuid": "eth0" + } + } + ] + }, + { + "link_id": { + "link_uuid": { + "uuid": "2.2.2.2-3.3.3.3" + } + }, + "name": "2.2.2.2-3.3.3.3", + "attributes": { + "total_capacity_gbps": 10, + "used_capacity_gbps": 0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "2.2.2.2" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "3.3.3.3" + } + }, + "endpoint_uuid": { + "uuid": "eth0" + } + } + ] + }, + { + "link_id": { + "link_uuid": { + "uuid": "3.3.3.3-2.2.2.2" + } + }, + "name": "3.3.3.3-2.2.2.2", + "attributes": { + "total_capacity_gbps": 10, + "used_capacity_gbps": 0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "3.3.3.3" + } + }, + "endpoint_uuid": { + "uuid": "eth0" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "2.2.2.2" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + } + ] + }, + { + "link_id": { + "link_uuid": { + "uuid": "3.3.3.3-4.4.4.4" + } + }, + "name": "3.3.3.3-4.4.4.4", + "attributes": { + "total_capacity_gbps": 10, + "used_capacity_gbps": 0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "3.3.3.3" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "4.4.4.4" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + } + ] + }, + { + "link_id": { + "link_uuid": { + "uuid": "4.4.4.4-3.3.3.3" + } + }, + "name": "4.4.4.4-3.3.3.3", + "attributes": { + "total_capacity_gbps": 10, + "used_capacity_gbps": 0 + }, + "link_endpoint_ids": [ + { + "device_id": { + "device_uuid": { + "uuid": "4.4.4.4" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + }, + { + "device_id": { + "device_uuid": { + "uuid": "3.3.3.3" + } + }, + "endpoint_uuid": { + "uuid": "eth1" + } + } + ] + } + ] +} \ No newline at end of file diff --git a/src/hackfest7/slice_request.json b/src/hackfest7/slice_request.json new file mode 100644 index 0000000000000000000000000000000000000000..97bb5e187659583c99e3514c8d944e120fd2a71b --- /dev/null +++ b/src/hackfest7/slice_request.json @@ -0,0 +1,158 @@ +{ + "ietf-network-slice-service:network-slice-services": { + "slo-sle-templates": { + "slo-sle-template": [ + { + "id": "A", + "description": "", + "slo-policy": { + "metric-bound": [ + { + "metric-type": "one-way-bandwidth", + "metric-unit": "kbps", + "bound": 2000 + }, + { + "metric-type": "one-way-delay-maximum", + "metric-unit": "milliseconds", + "bound": 5 + } + ] + }, + "sle-policy": { + "security": "", + "isolation": "", + "path-constraints": { + "service-functions": "", + "diversity": { + "diversity": { + "diversity-type": "" + } + } + } + } + } + ] + }, + "slice-service": [ + { + "id": "slice-service-11327140-7361-41b3-aa45-e84a7fb40be9", + "description": "Transport network slice mapped with 3GPP slice NetworkSlice1", + "service-tags": { + "tag-type": { + "tag-type": "", + "value": "" + } + }, + "slo-sle-policy": { + "slo-sle-template": "A" + }, + "status": {}, + "sdps": { + "sdp": [ + { + "id": "01", + "geo-location": "", + "node-id": "CU-N2", + "sdp-ip-address": "10.60.11.3", + "tp-ref": "", + "service-match-criteria": { + "match-criterion": [ + { + "index": 1, + "match-type": "VLAN", + "value": "100", + "target-connection-group-id": "CU-N2_AMF-N2" + } + ] + }, + "incoming-qos-policy": "", + "outgoing-qos-policy": "", + "sdp-peering": { + "peer-sap-id": "", + "protocols": "" + }, + "ac-svc-ref": [], + "attachment-circuits": { + "attachment-circuit": [ + { + "id": "100", + "ac-ipv4-address": "10.60.11.3", + "ac-ipv4-prefix-length": 0, + "sdp-peering": { + "peer-sap-id": "1.1.1.1" + }, + "status": {} + } + ] + }, + "status": {}, + "sdp-monitoring": "" + }, + { + "id": "02", + "geo-location": "", + "node-id": "AMF-N2", + "sdp-ip-address": "10.60.60.105", + "tp-ref": "", + "service-match-criteria": { + "match-criterion": [ + { + "index": 1, + "match-type": "VLAN", + "value": "100", + "target-connection-group-id": "CU-N2_AMF-N2" + } + ] + }, + "incoming-qos-policy": "", + "outgoing-qos-policy": "", + "sdp-peering": { + "peer-sap-id": "", + "protocols": "" + }, + "ac-svc-ref": [], + "attachment-circuits": { + "attachment-circuit": [ + { + "id": "200", + "ac-ipv4-address": "10.60.60.105", + "ac-ipv4-prefix-length": 0, + "sdp-peering": { + "peer-sap-id": "3.3.3.3" + }, + "status": {} + } + ] + }, + "status": {}, + "sdp-monitoring": "" + } + ] + }, + "connection-groups": { + "connection-group": [ + { + "id": "CU-N2_AMF-N2", + "connectivity-type": "ietf-vpn-common:any-to-any", + "connectivity-construct": [ + { + "id": 1, + "a2a-sdp": [ + { + "sdp-id": "01" + }, + { + "sdp-id": "02" + } + ] + } + ], + "status": {} + } + ] + } + } + ] + } + } \ No newline at end of file