Welcome to the Advanced Topics in Communication Networks Repository! Here you will find the weekly exercises and instructions on how to run these exercises in a virtual environment.
To make your life easier, we provide every one of you with access to one VM where all the necessary tools and software are pre-installed.
To access your VM, you will use SSH. SSH is a UNIX-based command-line interface and protocol for securely getting access to a remote computer. System administrators widely use it to control network devices and servers remotely. An SSH client is available by default on any Linux and MAC installation through the Terminal application. For Windows 10 users, there is SSH functionality available in the Command Prompt. For other Windows users, a good and free SSH client is PuTTY. Once you have installed an SSH client, use the following command to connect yourself to your VM:
ssh -p X [email protected]
Where X = 2000 + your student number for this lecture that we have sent you by email. For instance, if you are Student-7, use the following command:
ssh -p 2007 [email protected]
If you cannot connect to your VM, please report it immediately during the exercise session.
Optional: If you want to simplify the access to your VM, you can use SSH key authentication, but do not change your password. If you want to download an entire directory (e.g., the configs directory) from your VM to the current directory of your own machine, you can use scp:
scp -r -P X [email protected]:~/path to the directory .
Where X = 2000 + your student number. On Windows, you can use WinSCP7 to do that. Note the dot at the end of the command and the capitalized P.
We need to be able to open and edit remote files in our local code editor to have a smooth development cycle. This way, we can work with our code locally and execute it remotely without any friction. Below, we explain how to achieve this for Visual Studio Code as an example:
- Download Visual Studio Code.
- Access VS Code; in the left-side dock enter
Extensions
menu. - Install
Remote - SSH
extension. - In the pop-up prompt: enter your SSH credentials as you did for the VM access.
- Your "Remote Directory" should appear in the Explorer.
- [Optional] Go to Extensions menu again and install
P4 Language Extension
in your remote machine for highlights and syntax check.
For VS Code, you can find further information here. Many other text editors provide similar functionality. For example, Atom has a remote-synch package to upload and download files directly from inside Atom.
If you are already familiar with remote development, feel free to continue with your favorite code editor/setup.
The VM is based on a Ubuntu 18.04.6 LTS, and after building, it contains:
In this section, we provide links to the weekly exercises.
To get the exercises ready in your VM, clone this repository in the p4
user home directory, as illustrated below:
cd /home/p4/
git clone https://gitlab.ethz.ch/nsg/public/adv-net-2022-exercises.git
Update the local repository to get new tasks and solutions. Remember to pull this repository before every exercise session:
cd /home/p4/adv-net-2022-exercises
git pull
If you have questions, you can ask us during the exercise sessions (every Tuesday at 4.15 pm) in person or via Slack in the #exercises
channel. Please do not ask questions by email.
git clone https://github.com/nsg-ethz/p4-utils
cd p4-utils
sudo ./install.sh