

# Fogbed
Fogbed is a framework and toolset integration for rapid prototyping of fog components in virtualized environments using a desktop or distributed approach. Its design meets the postulated requirements of low cost, flexible setup and compatibility with real world technologies. The components are based on [Mininet](https://github.com/mininet/mininet)/[Containernet](https://github.com/containernet/containernet) network emulator with Docker container instances as fog virtual nodes.
# Install
You can install Fogbed directly from the GitHub repository in a single step by using the following command:
```
wget https://raw.githubusercontent.com/larsid/fogbed/main/install-fogbed.sh && chmod +x install-fogbed.sh && sudo ./install-fogbed.sh
```
The `install-fogbed.sh` script automates the installation of the Fogbed tool and its dependencies on Ubuntu-based Linux systems. This command uses `wget` to retrieve the script from the main branch and saves it to the current directory as `install-fogbed.sh`. Then, it uses chmod (change mode) to add execute permissions to the installation script. The `+x` flag grants execution rights, allowing the script to be run as a program rather than just being read as a text file. Finally, it executes the installation script with superuser privileges using `sudo`, where the `./` prefix indicates that the script is located in the current directory. Administrator privileges are required because the script needs to install system packages, create directories in `/opt`, and configure system services. Below, we detail the steps executed by the installation script.
## Installation Steps
The Fogbed installation script was tested only on Ubuntu 24.04. If you are facing errors while installing on a different system, or if you wish to modify the proposed configuration, you can review the steps performed by the script. The installation process is divided into the following stages:
### 1. System Dependencies Installation
The script begins by updating the system package list and installing essential dependencies through `apt-get`. The installed packages include:
- **Network Tools:** `net-tools`, `iproute2`, `iputils-ping`, `tcpdump`, `iperf`.
- **Development Tools:** `python3`, `python3-pip`, `git`, `curl`, `ansible`.
- **Python Virtual Environment:** The `python3.x-venv` package corresponding to the installed Python version.
### 2. Working Directory Setup
A working directory is created at `/opt/fogbed`. If an existing directory is found, it is removed to ensure a clean installation.
### 3. Containernet Installation
The script clones the [Containernet](https://github.com/containernet/containernet) repository to the `/opt/fogbed/containernet` directory and then uses an Ansible playbook to install Containernet and its system dependencies, which include Docker, Mininet, and Open vSwitch. 
### 4. Fogbed and Containernet Installation in Virtual Environment
Containernet installation as root is no longer possible starting from Ubuntu 24.04, and it is non-functional on Ubuntu 22.04 due to a [setuptools issue](https://github.com/pypa/setuptools/issues/4483). This Containernet limitation also requires that Fogbed be installed inside a Python virtual environment. Therefore, a Python virtual environment is created at `/opt/fogbed/venv`. This environment isolates Fogbed's Python libraries from system libraries, avoiding version conflicts. Inside the virtual environment, the script installs the `fogbed` and `containernet` libraries using `pip`.
### 5. System Commands Configuration
To facilitate the use of the Fogbed, the script performs the following actions:
- Creates a wrapper script at `/usr/local/bin/fogbed` that allows executing Python scripts with Fogbed's virtual environment from any directory.
- Creates a symbolic link to Mininet's `mn` executable at `/usr/local/bin/mn`, making it globally accessible. This can be particularly useful after a Fogbed experiment finishes with an error, allowing you to run the `sudo mn -c` (clean) command from any system path.
### 6. Systemd Service Configuration
By default, the script configures a systemd service called `fogbed-worker.service`. This service turns your machine into a "worker node" that can be remotely controlled by a Fogbed distributed emulation experiment. It ensures that the Fogbed worker process runs as root in the background and is automatically restarted in case of failures. This service is not necessary if you only intend to run local experiments or if your machine is used only to control a distributed experiment (rather than acting as a worker node). The creation of this service can be disabled with the -systemd-disabled flag.
## Fogbed Installation Script Options
The Fogbed installation script accepts the following parameters:
| Parameter | Description |
|---|---|
| (none) | Executes the complete installation process. |
| `-remove` | Removes the Fogbed installation, including the working directory and the `systemd` service. |
| `-systemd-disabled` | Installs Fogbed but skips the `systemd` service configuration step. |
| `-h`, `--help` | Displays a help message with available options. |
## Get Started
After installing Fogbed, you can start an example topology. First, clone the Fogbed repository locally:
```
git clone https://github.com/larsid/fogbed
```
Then, run the example script from the `fogbed/examples/sensors/` directory (e.g., `sensors.py`) with:
```
fogbed run sensors.py
```
Then access the url `http://localhost:3000` on your browser to visualize a React application consuming a REST API what monitor some devices which send health random data.

## Documentation
Project documentation is available at https://larsid.github.io/fogbed/
## Publications
A. Coutinho, U. Damasceno, E. Mascarenhas, A. C. Santos, J. E. B. T. da Silva and F. Greve, "[Rapid-Prototyping of Integrated Edge/Fog and DLT/Blockchain Systems with Fogbed](https://ieeexplore.ieee.org/document/10279234)," ICC 2023 - IEEE International Conference on Communications, Rome, Italy, 2023, pp. 622-627, doi: 10.1109/ICC45041.2023.10279234.
            
         
        Raw data
        
            {
    "_id": null,
    "home_page": null,
    "name": "fogbed",
    "maintainer": null,
    "docs_url": null,
    "requires_python": ">=3.8",
    "maintainer_email": null,
    "keywords": "networking, emulator, protocol, Internet, OpenFlow, SDN, fog, edge",
    "author": "Esa\u00fa Mascarenhas and Antonio Coutinho",
    "author_email": null,
    "download_url": "https://files.pythonhosted.org/packages/47/e5/86fabdd6d4ebfed44694667a8662132ba67079f0b7b8af7aeccdbe82c8ad/fogbed-1.3.0.tar.gz",
    "platform": null,
    "description": "\n\n# Fogbed\n\nFogbed is a framework and toolset integration for rapid prototyping of fog components in virtualized environments using a desktop or distributed approach. Its design meets the postulated requirements of low cost, flexible setup and compatibility with real world technologies. The components are based on [Mininet](https://github.com/mininet/mininet)/[Containernet](https://github.com/containernet/containernet) network emulator with Docker container instances as fog virtual nodes.\n\n# Install\n\nYou can install Fogbed directly from the GitHub repository in a single step by using the following command:\n```\nwget https://raw.githubusercontent.com/larsid/fogbed/main/install-fogbed.sh && chmod +x install-fogbed.sh && sudo ./install-fogbed.sh\n```\nThe `install-fogbed.sh` script automates the installation of the Fogbed tool and its dependencies on Ubuntu-based Linux systems. This command uses `wget` to retrieve the script from the main branch and saves it to the current directory as `install-fogbed.sh`. Then, it uses chmod (change mode) to add execute permissions to the installation script. The `+x` flag grants execution rights, allowing the script to be run as a program rather than just being read as a text file. Finally, it executes the installation script with superuser privileges using `sudo`, where the `./` prefix indicates that the script is located in the current directory. Administrator privileges are required because the script needs to install system packages, create directories in `/opt`, and configure system services. Below, we detail the steps executed by the installation script.\n\n## Installation Steps\n\nThe Fogbed installation script was tested only on Ubuntu 24.04. If you are facing errors while installing on a different system, or if you wish to modify the proposed configuration, you can review the steps performed by the script. The installation process is divided into the following stages:\n\n### 1. System Dependencies Installation\n\nThe script begins by updating the system package list and installing essential dependencies through `apt-get`. The installed packages include:\n\n- **Network Tools:** `net-tools`, `iproute2`, `iputils-ping`, `tcpdump`, `iperf`.\n- **Development Tools:** `python3`, `python3-pip`, `git`, `curl`, `ansible`.\n- **Python Virtual Environment:** The `python3.x-venv` package corresponding to the installed Python version.\n\n### 2. Working Directory Setup\n\nA working directory is created at `/opt/fogbed`. If an existing directory is found, it is removed to ensure a clean installation.\n\n### 3. Containernet Installation\n\nThe script clones the [Containernet](https://github.com/containernet/containernet) repository to the `/opt/fogbed/containernet` directory and then uses an Ansible playbook to install Containernet and its system dependencies, which include Docker, Mininet, and Open vSwitch. \n\n### 4. Fogbed and Containernet Installation in Virtual Environment\n\nContainernet installation as root is no longer possible starting from Ubuntu 24.04, and it is non-functional on Ubuntu 22.04 due to a [setuptools issue](https://github.com/pypa/setuptools/issues/4483). This Containernet limitation also requires that Fogbed be installed inside a Python virtual environment. Therefore, a Python virtual environment is created at `/opt/fogbed/venv`. This environment isolates Fogbed's Python libraries from system libraries, avoiding version conflicts. Inside the virtual environment, the script installs the `fogbed` and `containernet` libraries using `pip`.\n\n### 5. System Commands Configuration\n\nTo facilitate the use of the Fogbed, the script performs the following actions:\n\n- Creates a wrapper script at `/usr/local/bin/fogbed` that allows executing Python scripts with Fogbed's virtual environment from any directory.\n- Creates a symbolic link to Mininet's `mn` executable at `/usr/local/bin/mn`, making it globally accessible. This can be particularly useful after a Fogbed experiment finishes with an error, allowing you to run the `sudo mn -c` (clean) command from any system path.\n\n### 6. Systemd Service Configuration\n\nBy default, the script configures a systemd service called `fogbed-worker.service`. This service turns your machine into a \"worker node\" that can be remotely controlled by a Fogbed distributed emulation experiment. It ensures that the Fogbed worker process runs as root in the background and is automatically restarted in case of failures. This service is not necessary if you only intend to run local experiments or if your machine is used only to control a distributed experiment (rather than acting as a worker node). The creation of this service can be disabled with the -systemd-disabled flag.\n\n## Fogbed Installation Script Options\n\nThe Fogbed installation script accepts the following parameters:\n\n| Parameter | Description |\n|---|---|\n| (none) | Executes the complete installation process. |\n| `-remove` | Removes the Fogbed installation, including the working directory and the `systemd` service. |\n| `-systemd-disabled` | Installs Fogbed but skips the `systemd` service configuration step. |\n| `-h`, `--help` | Displays a help message with available options. |\n\n## Get Started\n\nAfter installing Fogbed, you can start an example topology. First, clone the Fogbed repository locally:\n```\ngit clone https://github.com/larsid/fogbed\n```\nThen, run the example script from the `fogbed/examples/sensors/` directory (e.g., `sensors.py`) with:\n```\nfogbed run sensors.py\n```\nThen access the url `http://localhost:3000` on your browser to visualize a React application consuming a REST API what monitor some devices which send health random data.\n\n\n\n## Documentation\nProject documentation is available at https://larsid.github.io/fogbed/\n\n## Publications\nA. Coutinho, U. Damasceno, E. Mascarenhas, A. C. Santos, J. E. B. T. da Silva and F. Greve, \"[Rapid-Prototyping of Integrated Edge/Fog and DLT/Blockchain Systems with Fogbed](https://ieeexplore.ieee.org/document/10279234),\" ICC 2023 - IEEE International Conference on Communications, Rome, Italy, 2023, pp. 622-627, doi: 10.1109/ICC45041.2023.10279234.\n",
    "bugtrack_url": null,
    "license": "MIT License",
    "summary": "Fog and edge computing emulation platform.",
    "version": "1.3.0",
    "project_urls": {
        "Homepage": "https://larsid.github.io/fogbed"
    },
    "split_keywords": [
        "networking",
        " emulator",
        " protocol",
        " internet",
        " openflow",
        " sdn",
        " fog",
        " edge"
    ],
    "urls": [
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "92d6a6e73020f3eeba6ad77847d1670ea2c94114602cc48b1c4878daeaa28522",
                "md5": "943828f56d3f41767f636a381edf5193",
                "sha256": "fd9ece879838e421d9c608a648871f4b3217631a8fc8fc1aa12cfc72d7d284b6"
            },
            "downloads": -1,
            "filename": "fogbed-1.3.0-py3-none-any.whl",
            "has_sig": false,
            "md5_digest": "943828f56d3f41767f636a381edf5193",
            "packagetype": "bdist_wheel",
            "python_version": "py3",
            "requires_python": ">=3.8",
            "size": 25915,
            "upload_time": "2025-10-22T02:19:37",
            "upload_time_iso_8601": "2025-10-22T02:19:37.956412Z",
            "url": "https://files.pythonhosted.org/packages/92/d6/a6e73020f3eeba6ad77847d1670ea2c94114602cc48b1c4878daeaa28522/fogbed-1.3.0-py3-none-any.whl",
            "yanked": false,
            "yanked_reason": null
        },
        {
            "comment_text": null,
            "digests": {
                "blake2b_256": "47e586fabdd6d4ebfed44694667a8662132ba67079f0b7b8af7aeccdbe82c8ad",
                "md5": "66bf544d2a53708a656c275ca1bd3f89",
                "sha256": "1d2ecc3ae9dd618a35578e05bf4fc95875eba22868d7af22ba474bc1e0b33248"
            },
            "downloads": -1,
            "filename": "fogbed-1.3.0.tar.gz",
            "has_sig": false,
            "md5_digest": "66bf544d2a53708a656c275ca1bd3f89",
            "packagetype": "sdist",
            "python_version": "source",
            "requires_python": ">=3.8",
            "size": 19805,
            "upload_time": "2025-10-22T02:19:39",
            "upload_time_iso_8601": "2025-10-22T02:19:39.350651Z",
            "url": "https://files.pythonhosted.org/packages/47/e5/86fabdd6d4ebfed44694667a8662132ba67079f0b7b8af7aeccdbe82c8ad/fogbed-1.3.0.tar.gz",
            "yanked": false,
            "yanked_reason": null
        }
    ],
    "upload_time": "2025-10-22 02:19:39",
    "github": false,
    "gitlab": false,
    "bitbucket": false,
    "codeberg": false,
    "lcname": "fogbed"
}