Upgrade to Pro — share decks privately, control downloads, hide ads and more …

iFogSim: Introduction

stwn
December 27, 2021

iFogSim: Introduction

stwn

December 27, 2021
Tweet

More Decks by stwn

Other Decks in Technology

Transcript

  1. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 1 Iwan Setiawan

    <stwn at unsoed.ac.id> iFogSim: Introduction
  2. Advanced Computer Networks Tutorials, Spring 2021, CSIE NTUST 2 Iwan

    Setiawan <stwn at unsoed.ac.id> IoT Tutorials: Recall • Temperature monitoring – CPU w/ GPIO Zero – DHT11 w/ Adafruit DHT • Writing data to a CSV file • Displaying the data to a live graph with matplotlib • Actions: LED and buzzer Analog signal Compute Storage Digital signal Stallings, 2016 Communications +Humidity 1 2 4 5 +Notification Cloud Compute Storage Simple * https://components101.com/sensors/dht11-temperature-sensor DHT11* 3 CSV
  3. Advanced Computer Networks Tutorials, Spring 2021, CSIE NTUST 3 Iwan

    Setiawan <stwn at unsoed.ac.id> IoT device IoT Tutorials: Recall • Temperature monitoring – CPU w/ GPIO Zero – DHT11 w/ Adafruit DHT • Writing data to a CSV file • Displaying the data to a live graph with matplotlib • Actions: LED and buzzer +Humidity +Notification Cloud * https://components101.com/sensors/dht11-temperature-sensor Sensor Actuator
  4. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 4 Iwan Setiawan

    <stwn at unsoed.ac.id> Objectives • Learn iFogSim and the components • Learn how to set up iFogSim on IntelliJ IDEA • Learn how to run code examples
  5. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 5 Iwan Setiawan

    <stwn at unsoed.ac.id> Cloud Computing Stallings, 2016 Computing, Storage, Networking
  6. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 6 Iwan Setiawan

    <stwn at unsoed.ac.id> IoT Cloud Platforms Cloud IoT Core IoT Azure IoT Losant ThingsBoard
  7. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 7 Iwan Setiawan

    <stwn at unsoed.ac.id> Limitations of Cloud Computing • Distance: multi-hop, far from the data sources • Latency: uncertainty in the network, needed for real- time and critical services, processing near the sources • Connection: massive and stable connections for IoT devices distributed geographically, network congestion – A huge number of IoT devices connect to the cloud – These devices send data frequently (big volume) – Need network resources, e.g. bandwidth Security and privacy
  8. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 8 Iwan Setiawan

    <stwn at unsoed.ac.id> Diverse resource capabilities Edge/Fog Nodes • Micro data centers (Micro DCs) • Base stations* • Cloudlets • Other types of edge nodes – Vehicles with onboard computers – IoT gateways – Smartphones * Related to multi-access edge computing or mobile edge computing (MEC)
  9. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 9 Iwan Setiawan

    <stwn at unsoed.ac.id> Cloud, Edge, and Fog Chang, Srirama, and Buyya, 2019
  10. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 10 Iwan Setiawan

    <stwn at unsoed.ac.id> Cloud, Edge, and Fog • Edge computing is placed at the edge networks – Outside core network: inner, middle, or outer edges – It does not necessarily connect to the cloud • Edge nodes can be called fog nodes if they extend the cloud* (more likely) – Resource constrained fog nodes – IoT environments: heterogenous, distributed, coordinated – Combined cloud-fog resource management * or connect to/depend on/integrated with the cloud
  11. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 11 Iwan Setiawan

    <stwn at unsoed.ac.id> Cloud, Edge, and Fog Fog Edge Cloud Lower Fog Higher Fog Cloud iFogSim
  12. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 12 Iwan Setiawan

    <stwn at unsoed.ac.id> IoT Applications and Fog-Cloud Chang, Srirama, and Buyya, 2019 Real-time analytics and decision making Real-time requirements
  13. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 13 Iwan Setiawan

    <stwn at unsoed.ac.id> IoT Applications and Fog-Cloud • An application needs to be partitioned – Based on distributed data flow (DDF) model – Modular: application modules, run in distributed manner – Requirements: real-time services, quality of service (QoS) • Application modules needs to be placed – Resources: pool of fog nodes – Coordination: fog-to-cloud resources • Resource management policies – Application module placement in the pool of fog nodes – Scheduling for application modules (Resource allocation)
  14. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 14 Iwan Setiawan

    <stwn at unsoed.ac.id> iFogSim • A toolkit to model and simulate edge/fog computing environments – Simulate IoT devices, fog nodes, cloud DCs, and network links – Using sense-process-actuate and DDF models • Evaluating resource management and scheduling policies across edge/fog and cloud resources • Metrics: latency, network usage, power consumption, operational costs Based on CloudSim
  15. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 15 Iwan Setiawan

    <stwn at unsoed.ac.id> iFogSim Architecture Gupta et al., 2017
  16. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 16 Iwan Setiawan

    <stwn at unsoed.ac.id> FogGUI Fog IoT device IoT device IoT device IoT device
  17. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 18 Iwan Setiawan

    <stwn at unsoed.ac.id> Preparation • Java JDK 8+ • IntelliJ IDEA Community • iFogSim2 – New features: mobility, clustering, microservices – Repo: https://github.com/Cloudslab/iFogSim Internet connection
  18. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 19 Iwan Setiawan

    <stwn at unsoed.ac.id> iFogSim2 Mahmud et al., 2021
  19. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 20 Iwan Setiawan

    <stwn at unsoed.ac.id> How to Set up iFogSim2 • Get it from the GitHub repository – git clone https://github.com/Cloudslab/iFogSim – or, download it from Code menu, and Download ZIP • Choose Import Project, select iFogSim repo dir • Choose Create from existing source • Follow import wizard: source files, libraries (jars), module structure, project SDK
  20. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 21 Iwan Setiawan

    <stwn at unsoed.ac.id> Setting up Project Structure • Choose Modules and select iFogSim-main • Make sure Language level set to “8” or above
  21. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 23 Iwan Setiawan

    <stwn at unsoed.ac.id> Libraries • Make sure required libraries can be accessed – Apache Commons Math – JSON.simple • Add manually if needed – Project Structure-Project Settings-Libraries • Check your Java environment
  22. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 25 Iwan Setiawan

    <stwn at unsoed.ac.id> Project Tree Structure • Libraries – JDK environment (External Libraries) – Needed Java packages in JAR format (jars) • Apache Commons Math • JSON.simple • Source (src) – org/cloudbus.cloudsim* including sdn* – org/fog.* • Other directories: dataset, output, results, topologies
  23. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 27 Iwan Setiawan

    <stwn at unsoed.ac.id> iFogSim components Mahmud and Buyya, 2019 Infrastructure Services Policies
  24. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 28 Iwan Setiawan

    <stwn at unsoed.ac.id> Fundamental Classes Gupta et al., 2017 * Learn about iFogSim Entities: https://cloudsimtutorials.online/ifogsim-entities/
  25. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 29 Iwan Setiawan

    <stwn at unsoed.ac.id> Physical Components • Fog devices or nodes – Act like DCs in cloud computing: task processing by hosting application modules – Interconnected and orchestrated in hierarchical order: higher and lower devices – Attributes: processing rate, power consumption • Sensors – Generate tuples or tasks (similar to cloudlet in CloudSim) – Tuples creation is event-driven, relate to specific sensor and actuator – Two tuples generation interval follows deterministic distribution • Actuators – Defining the effect of actuation and network connection properties – Each actuator is associated with corresponding sensor IoT data streams
  26. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 30 Iwan Setiawan

    <stwn at unsoed.ac.id> Logical Components • Application modules (AppModules) – Applications: a collection of interdependent AppModules (DDF model) – Can be mapped with virtual machines (VMs) in cloud computing – Each AppModule handles a particular type of tuples coming from the previous AppModule of the dataflow • Application edges (AppEdges) – Dependency between two modules or AppModules (Logical dataflow) – Tuple forwarding between two AppModules can be periodic or event-based – Upon receiving a specific type of tuple, whether a module triggers another tuple of different type to the next module is determined by fractional selectivity model * Selectivity models: bursty and fractional. See org.fog.application.selectivity
  27. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 31 Iwan Setiawan

    <stwn at unsoed.ac.id> Management Components • Module Mapping object – Identifying available resources in the fog devices and place them based on modules or AppModules’ requirements – By default: hierarchical module placement – If module reqs. cannot be met by a fog device, it will be sent to higher level fog • Controller object – Launching AppModules on their assigned fog devices following the placement information provided by Module Mapping object – Managing the resources of fog devices periodically – Gathering results of cost, network usage, and energy consumption
  28. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 32 Iwan Setiawan

    <stwn at unsoed.ac.id> Sequence Diagram Gupta et al., 2017
  29. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 33 Iwan Setiawan

    <stwn at unsoed.ac.id> Building a Simulation: Physical • Create physical components (fog devices, sensors, actuators) with config. params. – Processing capability in MIPS – RAM in megabytes – Cost per million instruction processing – Uplink and downlink bandwidth – Busy and idle power – Hierarchical level of fog devices • Value in the transmitDistribution object is set when creating IoT sensors, and associated with sensing interval (transmit rate) – Sensor and actuators are created with the ref. of application ID and broker ID • Workload: tuples and resources required to process them
  30. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 34 Iwan Setiawan

    <stwn at unsoed.ac.id> Building a Simulation: Logical • Create logical components, with directed acyclic graph (DAG) – AppModule, with configuration – AppEdge • Include the types of tuples, directions, CPU and networking (N/W) lengths, with the reference of source and destination modules • Different types of tuples are created based on the given specifications on AppEdge objects – AppLoop • Additional class for specifying process-control loops • Control loops can be used to measure end-to-end latency • The instance is basically list of AppModules with the start and end of the loop
  31. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 35 Iwan Setiawan

    <stwn at unsoed.ac.id> Building a Simulation: Management • Create management components – AppModule placement and scheduling policies • Module mapping or placement • Controller – Considerations: service/processing latency, power consumption, throughput, operational cost, device constraints/heterogeneity – The requirements of an AppModule must be aligned with: • specifications of corresponding tuple type • satisfied by the available fog resources – After mapping of AppModule and fog devices, the physical and logical components information is sent to the controller object – The controller object will send the whole system to CloudSim engine
  32. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 36 Iwan Setiawan

    <stwn at unsoed.ac.id> Code Examples • VRGameFog: /src/org/fog/test/perfeval/VRGameFog.Java • DCNSFog: /src/org/fog/test/perfeval/DCNSFog.Java
  33. Cloud Computing Tutorials, Fall 2021, CSIE NTUST 37 Iwan Setiawan

    <stwn at unsoed.ac.id> References [1] C. Chang, S. N. Srirama, and R. Buyya, “Internet of things (IoT) and new computing paradigms,” in Fog and Edge Computing: Principles and Paradigms, 1st ed. Wiley, 2019. [2] R. Mahmud and R. Buyya, “Modeling and simulation of fog and edge computing environments using iFogSim toolkit,” in Fog and Edge Computing: Principles and Paradigms, 1st ed. Wiley, 2019. [3] H. Gupta, A. Vahid Dastjerdi, S.K. Ghosh, and R. Buyya, “iFogSim: A toolkit for modeling and simulation of resource management techniques in the internet of things, edge and fog computing environments,” Software: Practice and Experience, vol. 47, no. 9, pp. 1275-1296, 2017. [4] A. Singh, “iFogsim project structure: a beginners guide,” 2021. [Online]. Available: https://cloudsimtutorials.online/ifogsim-project-structure-a-beginners-guide/