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
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
<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
<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)
<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
<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)
<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
<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
<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
<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
<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
<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
<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
<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
<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
<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
<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/