acsicuib / YAFS

Yet Another Fog Simulator (YAFS)
MIT License
101 stars 73 forks source link
cloud-computing fog-computing orcid-0000-0002-2826-5970 orcid-0000-0003-2969-0597 ordcot python simulator tin2017-88547-p

YAFS logo

YAFS (Yet Another Fog Simulator) is a simulator tool based on Python of architectures such as: Fog Computing ecosystems for several analysis regarding with the placement of resources, cost deployment, network design, ... IoT environments are the most evident fact of this type of architecture. YAFS is published at IEEE.

The highlights points of YAFS are:

YAFS is released under the MIT License. However, we would like to know in which project or publication have you used or mentioned YAFS.

Please consider use this cite when you use YAFS:

    Isaac Lera, Carlos Guerrero and Carlos Juiz. YAFS: A simulator for IoT scenarios in fog computing. IEEE Access. Vol. 7(1), pages 91745-91758,
    10.1109/ACCESS.2019.2927895, Jul 10 2019. 

Bibtex:

    @ARTICLE{8758823,
    author={I. {Lera} and C. {Guerrero} and C. {Juiz}},
    journal={IEEE Access},
    title={YAFS: A Simulator for IoT Scenarios in Fog Computing},
    year={2019},
    volume={7},
    number={},
    pages={91745-91758},
    keywords={Relays;Large scale integration;Wireless communication;OFDM;Interference cancellation;Channel estimation;Real-time systems;Complex networks;fog computing;Internet of Things;simulator},
    doi={10.1109/ACCESS.2019.2927895},
    ISSN={2169-3536},
    month={},
    }

Resources

YAFS tutorial (https://yafs.readthedocs.io/en/latest/introduction/index.html) and user guide (https://www.slideshare.net/wisaaco/yet-another-fog-simulator-yafs-user-guide) are a good starting point for you. You can also try out some of the Examples (https://yafs.readthedocs.io/en/latest/examples/index.html) shipped with YAFS but in any case you have to understand the main concepts of Cloud Computing and other related architectures to design and modelling your own model.

Installation

YAFS3 (the branch) supports Python 3.6+ (last compability check on Python 3.9.7)

  1. Clone the project in your local folder:
git clone --branch YAFS3 https://github.com/acsicuib/YAFS
  1. Install dependencies.
cd YAFS/
pip install -r requirements.txt

Getting started

To run tutorial or example projects from a terminal, run the following code (please update the paths according with your system). Alternativaly, you can use a python editor such as: Pycharm, Visual Studio, etc.

export PYTHONPATH=$PYTHONPATH:~/YAFS/src/
cd YAFS/tutorial_scenarios/01_basicExample
python main.py

The tutorial scenarios are in the folder:

tutorial_scenarios
├── 01_basicExample
├── 02_serviceMovement
├── 03_topologyChanges
└── 04_userMovement

More complex examples or published projects are in the folder examples: Note: they are working with python 3.10.8

examples
├── ConquestService                 # tested. Published at [6]
├── DynamicAllocation               # tested. Published at [1]
├── DynamicFailuresOnNodes          # tested. Published at [1]
├── DynamicWorkload                 # tested. Published at [1]
├── FogCentrality                   # works on YAFS2 (aka. master branch). Published at [2]
├── FogTorchPI-Integration          # works on YAFS2. An integration with: https://github.com/di-unipi-socc/FogTorchPI
├── MCDA                            # works on YAFS2. Published at [5]
├── MapReduceModel                  # works on YAFS2. Published at [3]
├── PartitionILPPlacement           # works on YAFS2. Published at [4]
├── RuleBasedDistributedModel       # works on YAFS2. Project to analyze the feasibility of a more complex proposal: [7,8]
├── TestJsons                       # works on YAFS2. A basic project to check JSON formats. NM.
├── Tutorial                        # works on YAFS2. iFogSim examples but in YAFS [1]
├── Tutorial_JSONModelling          # works on YAFS2. Examples in yafs' readthedocs.
├── VRGameFog-IFogSim-WL            # works on YAFS2. EGG_GAME by IFogSim implementation [1]
└── mobileTutorial                  # works on YAFS2. An unpublished extension to incorporate general functions on dynamic connections.

The YAFS tutorial is a good starting point for you. You can also try out some of the Examples shipped with YAFS but in any case you have to understand the main concepts of Cloud Computing and other related architectures to design and modelling your own model.

Graph animations

As you can implement events (custom strategies), you can generate plots of your network in each event. Thus, you can store png files and at the end of your simulation, you generate a video with the combination all of them using ffmpeg command.

You can find some examples in the following src/examples: DynamicWorkloads, ConquestService, and mobileTutorial. From DynamicWorkload folder and ConquestService, we have generate the following animations:

ffmpeg -r 1 -i net_%03d.png -c:v libx264 -vf fps=1 -pix_fmt yuv420p out.mp4
ffmpeg -i out.mp4 -pix_fmt rgb24  out.gif

Documentation and Help

The documentation contains a tutorial, the architecture design explaining key concepts, a number of examples and the API reference.

For more help, contact with the authors or You must dig through the source code

Changelog

Acknowledgment

REFERENCES

YAFS is used in the following projects:

Please, send us your reference to publish it! and of course, feel free to add your references or works using YAFS!