{"id":13769510,"url":"https://github.com/di-unipi-socc/FogTorchPI","last_synced_at":"2025-05-11T02:32:42.526Z","repository":{"id":81101623,"uuid":"77220133","full_name":"di-unipi-socc/FogTorchPI","owner":"di-unipi-socc","description":"A probabilistic prototype for deployment of Fog applications.","archived":false,"fork":false,"pushed_at":"2021-05-14T22:55:35.000Z","size":4974,"stargazers_count":24,"open_issues_count":0,"forks_count":17,"subscribers_count":9,"default_branch":"master","last_synced_at":"2024-11-17T05:33:03.838Z","etag":null,"topics":["bandwidth","cloud","cost-estimation","cost-model","deployment","fog","fog-applications","fog-computing","fog-infrastructure","latency","monte-carlo-simulation","qos-assurance","qos-aware"],"latest_commit_sha":null,"homepage":"http://pages.di.unipi.it/throughthefog/","language":"Java","has_issues":true,"has_wiki":null,"has_pages":null,"mirror_url":null,"source_name":null,"license":"mit","status":null,"scm":"git","pull_requests_enabled":true,"icon_url":"https://github.com/di-unipi-socc.png","metadata":{"files":{"readme":"README.md","changelog":null,"contributing":null,"funding":null,"license":"LICENSE.txt","code_of_conduct":null,"threat_model":null,"audit":null,"citation":null,"codeowners":null,"security":null,"support":null,"governance":null}},"created_at":"2016-12-23T11:04:28.000Z","updated_at":"2024-08-29T08:34:54.000Z","dependencies_parsed_at":null,"dependency_job_id":"f4338b33-e445-4ee8-a9ca-bcacd77f55a5","html_url":"https://github.com/di-unipi-socc/FogTorchPI","commit_stats":null,"previous_names":[],"tags_count":0,"template":false,"template_full_name":null,"repository_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di-unipi-socc%2FFogTorchPI","tags_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di-unipi-socc%2FFogTorchPI/tags","releases_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di-unipi-socc%2FFogTorchPI/releases","manifests_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories/di-unipi-socc%2FFogTorchPI/manifests","owner_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners/di-unipi-socc","download_url":"https://codeload.github.com/di-unipi-socc/FogTorchPI/tar.gz/refs/heads/master","host":{"name":"GitHub","url":"https://github.com","kind":"github","repositories_count":253507148,"owners_count":21919158,"icon_url":"https://github.com/github.png","version":null,"created_at":"2022-05-30T11:31:42.601Z","updated_at":"2022-07-04T15:15:14.044Z","host_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub","repositories_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repositories","repository_names_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/repository_names","owners_url":"https://repos.ecosyste.ms/api/v1/hosts/GitHub/owners"}},"keywords":["bandwidth","cloud","cost-estimation","cost-model","deployment","fog","fog-applications","fog-computing","fog-infrastructure","latency","monte-carlo-simulation","qos-assurance","qos-aware"],"created_at":"2024-08-03T17:00:27.462Z","updated_at":"2025-05-11T02:32:42.107Z","avatar_url":"https://github.com/di-unipi-socc.png","language":"Java","funding_links":[],"categories":["Uncategorized"],"sub_categories":["Uncategorized"],"readme":"\u003cimg src=\"https://github.com/di-unipi-socc/FogTorchPI/blob/master/img/logoftpi.PNG\" width=\"300\"\u003e\n\n_A tool for probabilistic QoS-assurance and resource consumption estimation of eligible deployments of Fog applications._\n\n**Note**: the newest and extended version of FogTorchΠ which estimates monthly deployment cost and runs multiple threads to perform the MonteCarlo simulation is available [here](https://github.com/di-unipi-socc/FogTorchPI/tree/multithreaded).\n\nA complete overview of FogTorchΠ and of the usefulness of predictive analysis to perform Fog application deployment can be found here:\n\n\u003e [Antonio Brogi](http://pages.di.unipi.it/brogi), [Stefano Forti](http://pages.di.unipi.it/forti), [Ahmad Ibrahim](http://pages.di.unipi.it/ibrahim) \u003cbr\u003e\n\u003e **[Predictive Analysis to Support Fog Application Deployment](http://pages.di.unipi.it/forti/pdf/chapters/2018/C09_Predictive%20Analysis%20to%20Support%20Fog%20Application%20Deployment_PP.pdf)** \u003cbr\u003e\n\u003e in [Fog and Edge Computing: Principles and Paradigms](https://www.wiley.com/en-it/Fog+and+Edge+Computing:+Principles+and+Paradigms-p-9781119524984), Rajkumar Buyya and Satish N. Srirama (eds.), \u003cbr\u003e\n\u003e Wiley, 2019.\n\nFogTorchΠ is based upon the work described in:\n\n\u003e [Antonio Brogi](http://pages.di.unipi.it/brogi), [Stefano Forti](http://pages.di.unipi.it/forti), [Ahmad Ibrahim](http://pages.di.unipi.it/ibrahim) \u003cbr\u003e\n\u003e **[How to best deploy your Fog applications, probably.](http://pages.di.unipi.it/forti/pdf/conferences/2017/icfec17.pdf)** \u003cbr\u003e\n\u003e in Proceedings of the [1st IEEE International Conference on Fog and Edge Computing (ICFEC’2017)](http://fec-conf.gforge.inria.fr/index.html), \u003cbr\u003e\n\u003e O. Rana, R. Buyya, and A. Anjum, Eds., 2017, May 2017, Madrid, Spain.\n\nThe cost model exploited by the tool is described in\n\n\u003e [Antonio Brogi](http://pages.di.unipi.it/brogi), [Stefano Forti](http://pages.di.unipi.it/forti), [Ahmad Ibrahim](http://pages.di.unipi.it/ibrahim) \u003cbr\u003e\n\u003e **[Deploying Fog applications: How much does it cost, by the way?](http://pages.di.unipi.it/forti/pdf/conferences/2018/closer18.pdf)** \u003cbr\u003e\n\u003e in Proceedings of the [8th International Conference on Cloud Computing and Services Science (CLOSER’18)](http://closer.scitevents.org/), \u003cbr\u003e\n\u003e March 2018, Funchal, Madeira, Portugal.\n\nIf you wish to reuse source code in this repo, please consider citing the above mentioned articles.\n\nMore details about the theoretical model used by FogTorchΠ can be found in:\n\n\u003e Antonio Brogi and Stefano Forti \u003cbr\u003e\n\u003e [**QoS-aware Deployment of IoT Applications Through the Fog.**](http://ieeexplore.ieee.org/document/7919155/) \u003cbr\u003e\n\u003e  in _IEEE Internet of Things Journal_ , vol. 4, no. 5, pp. 1185-1192, Oct. 2017.\n\n### Other FogTorchΠ Projects\n\nFogTorchΠ has been also extended and used to simulate mobile task offloading in the context of Edge, as described in\n\n- Vincenzo De Maio and Ivona Brandic. _\"First Hop Mobile Offloading of DAG Computations.\"_, to appear in CCGRID'18. [Code](https://bitbucket.org/vindem/fogtorchpi-extended).\n\n## Intro\n\n**FogTorchΠ** is an open source prototype, developed in Java, based on a model for Fog computing infrastructures and applications.\n\nIt takes into account non-functional parameters within the model (i.e., hardware, software, latency and bandwidth) to determine, compare and contrast different eligible deployments of a given application over a Fog infrastructure.\n\nIn the case of hardware capabilities, it considers CPU cores, RAM and storage available at a given node or required by a given software component. \n\nSoftware capabilities are represented by a list of software names (operating system, programming languages, frameworks etc).\n\nIt considers latency, and both download and upload bandwidths as QoS attributes. Latency is measured in milliseconds (ms), while bandwidth is given in Megabits per second (Mbps). \n\n## Quick User Guide\nFogTorchΠ can be run by importing the project in any IDE (e.g., NetBeans or Eclipse).\n\nTo start with FogTorchΠ, simply create a main file and declare a new Fog infrastructure and application:\n\n``` java\nInfrastructure I = new Infrastructure();\nApplication A = new Application();\n```\n\nStarting by the infrastructure, one can add Fog and Cloud nodes (which are assumed to have unbounded hardware capabilities) as shown below:\n\n``` java\n// parameters: node_id, software capabilities, latitude, longitude\nI.addCloudDatacentre(\"cloud1\", asList(\"linux\", \"php\", \"mySQL\", \"python\"), 52.195097, 3.0364791);\nI.addCloudDatacentre(\"cloud2\", asList(\"linux\", \"php\", \"mySQL\", \"java\"), 44.123896, -122.781555);\n// parameters: node_id, software capabilities, hardware capabilities latitude, longitude\nI.addFogNode(\"fog1\", asList(\"linux\", \"php\", \"mySQL\"), new Hardware(2, 2, 32), 43.740186, 10.364619);\nI.addFogNode(\"fog2\", asList(\"linux\", \"php\"), new Hardware(2, 2, 32), 43.7464449, 10.4615923);\nI.addFogNode(\"fog3\", asList(\"linux\", \"mySQL\"), new Hardware(4,2,64), 43.7381285, 10.4552213);\n```\n\nCommunication links in the infrastructure are instantiated by specifying (or by sampling) their QoS profile in terms of latency and bandwidth. In the main file, one can specify a sampling function, for instance:\n\n``` java\n//Bernoulli sampling function.\npublic static Random rnd = new Random();\npublic static QoSProfile samplingFunction(double probability, QoSProfile q1, QoSProfile q2) {\n    double rand = rnd.nextDouble();\n    if (probability == 1) {\n        return q1;\n    }\n    if (rand \u003c probability) {\n        return q1;\n    } else {\n        return q2;\n    }\n}\n```\n\nThen, links are added to the infrastructure as shown in the (partial) example below.\n\n``` java\n// QoSprofile(int latency, double bandwidth)\nQoSProfile fogtoCloudDownload = samplingFunction(0.98, new QoSProfile(40, 10.5), new QoSProfile(Integer.MAX_VALUE, 0.0));\nQoSProfile fogtoCloudUpload = samplingFunction(0.98, new QoSProfile(40, 4.5), new QoSProfile(Integer.MAX_VALUE, 0.0));\n// parameters: endpoint1, endpoint2, bandwidth2-\u003e1, bandwidth1-\u003e2\nI.addLink(\"fog1\", \"cloud1\", fogtoCloudDownload, fogtoCloudUpload);\nI.addLink(\"fog1\", \"cloud2\", fogtoCloudDownload, fogtoCloudUpload);\n``` \n\nThings to the infrastructure are added as follows:\n\n``` java\n//parameters: thing_id, type, latitude, longitude, directly connected Fog node\nI.addThing(\"water0\", \"water\", 43.7464449, 10.4615923, \"fog1\");\n            I.addThing(\"video0\", \"video\", 43.7464449, 10.4615923, \"fog1\");\n            I.addThing(\"moisture0\", \"moisture\", 43.7464449, 10.4615923, \"fog1\");\n            I.addThing(\"temperature0\", \"temperature\", 43.7464449, 10.4615923, \"fog3\");\n``` \n\nNow let's go back to the application. Suppose component A requires to exploit some Things in the infrastructure. We specify them as:\n\n``` java\n//parameters: identifier, type, latitude, longitude, directly connected Fog node\nArrayList\u003cThingRequirement\u003e neededThings = new ArrayList\u003c\u003e();\n//parameters: thing_id, needed fog-to-thing QoS, needed thing-to-Fog QoS\nneededThings.add(new ExactThing(\"moisture0\", new QoSProfile(500,0.1), new QoSProfile(500, 0.1))); // 0.5 s and 1 Mbps\nneededThings.add(new ExactThing(\"temperature0\", new QoSProfile(65,0.1), new QoSProfile(65, 0.1))); // 110 ms and 1 Mbps\n``` \nAnd then component A is specified as follows (with other components).\n\n``` java\n//parameters: id, software requirements, hardware requirements, (neededThingsList)*\nA.addComponent(\"A\", asList(\"linux\"), new Hardware(1, 1.2, 8), neededThings);\nA.addComponent(\"B\", asList(\"linux\", \"mySQL\"), new Hardware(1, Bram, Bstorage)); //cores ram storage\nA.addComponent(\"C\", asList(\"linux\", \"php\"), new Hardware(2, 0.7, 4));\n```\n\nLinks in between components are specified as:\n\n``` java\n//parameters: endpoint1, endpoint2, latency, bandwidth2-\u003e1, bandwidth1-\u003e2\nA.addLink(\"A\", \"B\", 160, 0.5, 3.5);\nA.addLink(\"A\", \"C\", 140, 0.4, 1.1);\nA.addLink(\"B\", \"C\", 100, 0.8, 1);\n```\nTo look for eligible deployments of A over I, the class ``` java Search``` is instantiated, adding (if needed) the list of nodes upon which a component can be deployed (i.e., business policies).\n\n``` java\n//parameters: id, software requirements, hardware requirements, (neededThingsList)*\nSearch s = new Search(A, I);\ns.addBusinessPolicies(\"C\", asList(\"cloud2\", \"cloud1\"));\n```\n\nFinally, to start the search:\n\n``` java\ns.findDeployments(true); // true is to perform exhaustive search instead of heuristics\n``` \n\nTo repeat FogTorchΠ execution and perform Monte Carlo simulations, one may simply insert the previous code in the for-loop of our class ``` Main.java```. The output is a CSV file where each line represents an eligible deployment along with its QoS-assurance, average position in the list of returned deployment (\n``` heuristic rank``` ), consumed RAM and storage in the Fog layer, sum of the last two.\n\n``` \nDeployment, QoS-assurance, Heuristic Rank, Consumed RAM, Consumed HDD, Sum Hardware\n[A-\u003efog2][B-\u003ecloud2][C-\u003ecloud1];99.122;54.75732778;0.2;0.0625;0.13125\n[A-\u003efog2][B-\u003ecloud2][C-\u003ecloud2];99.122;59.73526667;0.2;0.0625;0.13125\n[A-\u003efog2][B-\u003ecloud1][C-\u003ecloud2];99.122;44.80145;0.2;0.0625;0.13125\n[A-\u003efog2][B-\u003ecloud1][C-\u003ecloud1];99.122;39.82351111;0.2;0.0625;0.13125\n[A-\u003efog3][B-\u003ecloud1][C-\u003efog2];99.122;94.14406111;0.316666667;0.09375;0.205208333\n[A-\u003efog2][B-\u003ecloud2][C-\u003efog2];99.122;49.77938889;0.316666667;0.09375;0.205208333\n[A-\u003efog3][B-\u003ecloud2][C-\u003efog2];99.122;99.122;0.316666667;0.09375;0.205208333\n[A-\u003efog2][B-\u003ecloud1][C-\u003efog2];99.122;34.84557222;0.316666667;0.09375;0.205208333\n[A-\u003efog1][B-\u003ecloud2][C-\u003efog2];95.191;76.1528;0.316666667;0.09375;0.205208333\n[A-\u003efog1][B-\u003ecloud1][C-\u003efog2];95.191;71.39325;0.316666667;0.09375;0.205208333\n[A-\u003efog2][B-\u003efog3][C-\u003ecloud2];99.122;29.86763333;0.366666667;0.125;0.245833333\n[A-\u003efog2][B-\u003efog3][C-\u003ecloud1];99.122;24.88969444;0.366666667;0.125;0.245833333\n[A-\u003efog2][B-\u003efog3][C-\u003efog1];100;20.35075556;0.483333333;0.15625;0.319791667\n[A-\u003efog1][B-\u003efog3][C-\u003efog2];100;70.34964444;0.483333333;0.15625;0.319791667\n[A-\u003efog1][B-\u003efog3][C-\u003efog1];100;65.26195556;0.483333333;0.15625;0.319791667\n[A-\u003efog2][B-\u003efog3][C-\u003efog2];100;15.26306667;0.483333333;0.15625;0.319791667\n[A-\u003efog2][B-\u003efog1][C-\u003efog1];100;10.17537778;0.483333333;0.15625;0.319791667\n[A-\u003efog2][B-\u003efog1][C-\u003efog2];100;5.087688889;0.483333333;0.15625;0.319791667\n[A-\u003efog3][B-\u003efog1][C-\u003efog2];100;90.04412222;0.483333333;0.15625;0.319791667\n[A-\u003efog3][B-\u003efog1][C-\u003efog1];100;84.95643333;0.483333333;0.15625;0.319791667\n\n``` \n\nTo specify upon which Fog nodes QoS-assurance and resources consumption are evaluated, it is sufficient to add the line:\n\n``` java\ns.addKeepLightNodes(asList(\"fog1\", \"fog2\"));\n``` \n# Example\nA full example is in file [Main.java](https://github.com/di-unipi-socc/FogTorchPI/blob/master/src/main/Main.java) and related results can be found in [resultsplotwithHD.xlsx](https://github.com/di-unipi-socc/FogTorchPI/tree/master/results).\n\n\n","project_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdi-unipi-socc%2FFogTorchPI","html_url":"https://awesome.ecosyste.ms/projects/github.com%2Fdi-unipi-socc%2FFogTorchPI","lists_url":"https://awesome.ecosyste.ms/api/v1/projects/github.com%2Fdi-unipi-socc%2FFogTorchPI/lists"}