Commit a3457956 authored by Lluis Gifre Renom's avatar Lluis Gifre Renom
Browse files

DataPlane in a box:

- Added management scripts
- Added ContainerLab scenario descriptor
- Added README.md
- Added example TFS descriptors
- Added links.txt
parent 3e1df037
Loading
Loading
Loading
Loading
+2 −0
Original line number Diff line number Diff line
clab-arista/
.arista.clab.yml.bak
+121 −0
Original line number Diff line number Diff line
# DataPlane-in-a-Box - Control an Emulated DataPlane through TeraFlowSDN

## Emulated DataPlane Deployment
- ContainerLab
- Scenario
- Descriptor

## TeraFlowSDN Deployment
```bash
cd ~/tfs-ctrl
source dataplane-in-a-box/deploy_specs.sh
./deploy/all.sh
```

# ContainerLab - Arista cEOS - Commands

## Download and install ContainerLab
```bash
sudo bash -c "$(curl -sL https://get.containerlab.dev)" -- -v 0.48.4
```

## Deploy scenario
```bash
cd ~/tfs-ctrl/dataplane-in-a-box
sudo containerlab deploy --topo arista.clab.yml
```

## Inspect scenario
```bash
cd ~/tfs-ctrl/dataplane-in-a-box
sudo containerlab inspect --topo arista.clab.yml
```

## Destroy scenario
```bash
cd ~/tfs-ctrl/dataplane-in-a-box
sudo containerlab destroy --topo arista.clab.yml
sudo rm -rf clab-arista/ .arista.clab.yml.bak
```

## Access cEOS Bash
```bash
docker exec -it clab-arista-wan1 bash
```

## Access cEOS CLI
```bash
docker exec -it clab-arista-wan1 Cli
```

## Configure ContainerLab clients
```bash
docker exec -it clab-arista-client1 bash
    ip address add 192.168.1.10/24 dev eth1
    ip route add 192.168.2.0/24 via 192.168.1.1
    ip route add 192.168.3.0/24 via 192.168.1.1
    ping 192.168.2.10
    ping 192.168.3.10

docker exec -it clab-arista-client2 bash
    ip address add 192.168.2.10/24 dev eth1
    ip route add 192.168.1.0/24 via 192.168.2.1
    ip route add 192.168.3.0/24 via 192.168.2.1
    ping 192.168.1.10
    ping 192.168.3.10

docker exec -it clab-arista-client3 bash
    ip address add 192.168.3.10/24 dev eth1
    ip route add 192.168.2.0/24 via 192.168.3.1
    ip route add 192.168.3.0/24 via 192.168.3.1
    ping 192.168.2.10
    ping 192.168.3.10
```

## Install gNMIc
```bash
sudo bash -c "$(curl -sL https://get-gnmic.kmrd.dev)"
```

## gNMI Capabilities request
```bash
gnmic --address clab-arista-wan1 --port 6030 --username admin --password admin --insecure capabilities
```

## gNMI Get request
```bash
gnmic --address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path / > wan1.json
gnmic --address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path /interfaces/interface > wan1-ifaces.json
```

## gNMI Set request
```bash
#gnmic --address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --update-path /system/config/hostname --update-value srl11
#gnmic --address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path /system/config/hostname
```

## Subscribe request
```bash
gnmic --address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf subscribe --path /interfaces/interface[name=Management0]/state/

# In another terminal, you can generate traffic opening SSH connection
ssh admin@clab-arista-wan1
```

# Check configurations done:
```bash
gnmic --address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path '/network-instances' > wan1-nis.json
gnmic --address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf get --path '/interfaces' > wan1-ifs.json
```

# Delete elements:
```bash
--address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/network-instances/network-instance[name=b19229e8]'
--address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/interfaces/interface[name=ethernet-1/1]/subinterfaces/subinterface[index=0]'
--address clab-arista-wan1 --port 6030 --username admin --password admin --insecure --encoding json_ietf set --delete '/interfaces/interface[name=ethernet-1/2]/subinterfaces/subinterface[index=0]'
```

# Run gNMI Driver in standalone mode (advanced)
```bash
PYTHONPATH=./src python -m src.device.tests.test_gnmi
```
+54 −0
Original line number Diff line number Diff line
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#     http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

# TFS - Arista devices + Linux clients

name: arista

mgmt:
  network: mgmt-net
  ipv4-subnet: 172.20.20.0/24

topology:
  kinds:
    arista_ceos:
      kind: arista_ceos
      image: ceos:4.30.4M
    linux:
      kind: linux
      image: ghcr.io/hellt/network-multitool:latest

  nodes:
    wan1:
      kind: arista_ceos
      mgmt-ipv4: 172.20.20.101
      ports: [6001:6030]
    wan2:
      kind: arista_ceos
      mgmt-ipv4: 172.20.20.102
      ports: [6002:6030]

    client1:
      kind: linux
      mgmt-ipv4: 172.20.20.201
      ports: [2201:22]
    client2:
      kind: linux
      mgmt-ipv4: 172.20.20.202
      ports: [2202:22]

  links:
    - endpoints: ["wan1:eth1", "wan2:eth1"]
    - endpoints: ["client1:eth1", "wan1:eth10"]
    - endpoints: ["client2:eth1", "wan2:eth10"]
+17 −0
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cd /home/tfs/tfs-ctrl/dataplane-in-a-box
sudo containerlab deploy --topo arista.clab.yml
+18 −0
Original line number Diff line number Diff line
#!/bin/bash
# Copyright 2022-2023 ETSI TeraFlowSDN - TFS OSG (https://tfs.etsi.org/)
#
# Licensed under the Apache License, Version 2.0 (the "License");
# you may not use this file except in compliance with the License.
# You may obtain a copy of the License at
#
#      http://www.apache.org/licenses/LICENSE-2.0
#
# Unless required by applicable law or agreed to in writing, software
# distributed under the License is distributed on an "AS IS" BASIS,
# WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
# See the License for the specific language governing permissions and
# limitations under the License.

cd /home/tfs/tfs-ctrl/dataplane-in-a-box
sudo containerlab destroy --topo arista.clab.yml
sudo rm -rf clab-arista/ .arista.clab.yml.bak
Loading