Skip to content
Snippets Groups Projects
Commit a83d6df4 authored by Javier Velázquez's avatar Javier Velázquez
Browse files

Added hackfest7 files

parent d57a1a97
No related branches found
No related tags found
No related merge requests found
# 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!
{
"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
{
"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
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment