IoT simulation using NS3 - simulation

how can I use NS3 to simulate IoT, is there some model that should be added?
I'm studying RPL protocol security, and I found that the simulation could be done using NS3, but I don't know is there a model specific to IoT.
thank you

Currently, LR-WPAN (IEEE 802.15.4) module is available in ns3, which is one of the IoT technologies. You can use RPL in Tree or/and mesh typologies due to the RPL nature. Also, LoRaWAN module is available for ns3 (you can find on github), which is also IoT technology. However, LoRaWAN currently supports star of star topology. If you extend it to multi-hop, then you can use RPL as routing protocol in LoRaWAN.

LoRaWAN ns-3 extension can be used to simulate IoT Networks.
This is an ns-3 module that can be used to perform simulations of a LoRaWAN network. This module was developed by Davide Magrin and Martina Capuzzo of the Signet Lab at University of Padova’s Department of Information Engineering, under the supervision of Lorenzo Vangelista, Marco Centenaro, Andrea Zanella and Michele Zorzi.
The following is the NetAnim output of one such simulated mobile IoT scenario.
LoRaWAN Mobile IoT network Simulation:
Simulation and Analysis of IoT LoRaWAN Networks Under ns-3

Related

Is it required to use an OPC Server to Communicate with Controllogix?

I'm wondering if for simply communicating with a PLC, like reading and writing tags, do I need all of the other heavy lifting that comes with an OPC-UA server?
I've tried writing a simple server in Python that talks to the PLC, but I get denied when requesting information from the PLC.
The Controllogix PLC I'm attempting to communicate with uses Ethernet/IP to communicate, so why doesn't a simple server/client script work? What is required exactly to communicate with an Allen Bradley PLC or PLC's in general?
There is quite a bit required to communicate with a PLC.
Each vendor has a driver, there are firmware compatibility considerations. Different protocols to think about.
OPC-UA makes it a bit more generic, but OPC-UA still has a set of things to work around when setting up communications.
Most of the OPC products I've worked with, needs to have their security adjusted to allow anonymous communication. It's generally bad practice to do this. (A network intrusion would be able to read/write to your automation layer) There is certificate signing and some encryption business that needs to be turned off if you're looking for simple communication. (Again, not a good practice but ok for learning)
After all that you have to have a notion of how your PLC is set up on your OPC server, there are channels, devices, namespaces etc. You'll point the OPC client to some opc.tcp://:
If you got this far you're almost done, I'm assuming your OPC server is running and has tags configured at this point. You can use your OPC-UA API to do a read. It can return just the value, or you can get an object back with tag health, timestamp, and a bunch of other data. Depends on the implementation. After that you can do subscriptions, writes...whatever else you need.
TLDR: OPC server not required, but may be the easiest method. Turn off security. (But turn it back on before exposing your control layer to the net)
I am also a little late to this conversation. If you are interested in coding your own solutions and don't want to use any of the commercially available standards, AdvancedHMI is a "mostly" open source solution written in VB.NET which is 100% free and provides communications to many different PLCs including the ControlLogix platform. Since I see you are programming in Python you may also be interested to know that the project does work under Mono on the Linux OS. I have used it to write gateways between EthernetIP and ModbusTCP and to pull data serially from OEM devices and push this data to a CLX PLC.
The forum is full of many helpful hints and is very active and supported.
Just trying to give you another option. DDE, NetDDE, FastDDE, OPC, DCOM, Suitelink.... These are all good, but mostly a pay to play adventure. As a programmer, it seems ridiculous to have to pay such an excessive amount of money just to talk to my hardware, IMHO. Sorry for the rant. Have Fun!
Update - Just wanted to also suggest the following open source project written in python:
https://github.com/dmroeder/pylogix
I have used this to write small programs for communicating with CompactLogix and ControlLogix. (Even to/from a RaspberryPi!)
Depends on several factors, if you want something simple to program you can opt for Modbus/TCP I think some AB PLC supports it without extra hardware.
However if you want something with more security for example for industrial use then OPC UA would be better choice but the programming has a complexity far higher than Modbus, even using the libraries of OPC Foundation or others. There is the option of using a commercial or free (if any) OPC UA server to save work, then you will need to program the client side only.
With Ethernet/IP it should also be possible, but the problem is that there is no clear specification and even different AB models talk different Ethernet/IP dialect ! , it is also far more complex to program than Modbus.
I am a little late to this discussion, but there are a couple commercial tools that make this a bit easier. The one that comes to mind for me when you say you are using python is Cogent's data hub. It is certainly not the cheapest tool out there, but they have already done all of the heavy lifting for PLC/PC communications & security.
If trying to read CLX data using Python, there are several open source implementations that will save you a lot of work. Such as this:
https://github.com/dmroeder/pylogix
If you use .NET and Visual Studio, you can use AdvancedHMI
to be able to read and write OPC Tags to ControlLogix platform is done via its communication Driver RSLinx. RSLinx acts as an OPC Server, it will need to be configured to communicate with the PLC and run on a networked PC on the same LAN. Several flavours of RSLinx are available (for WAN/VLAN also) but essentially this is the communications driver you need to talk to AB PLC's

PL PS communication on the zynq board

I am working on an application that turns on a Zynq board.
I develop the C code that should runs on the ARM host and implement and synthesized the code for the PL. I have data transfer between the PL and the PS.
But, I don’t have the board. And I want to test my programs and to evaluate my system (resources, throughput and latency, …).
Is there any way to have this? Any simulator? How could I see the value of the data that transit between the PL and the PS.
I only have the vivado environment with sdk.
Thanks
I want to say that I didn't try it yet, but the answer can be in using AXI Bus Functional Model (BFM):
Xilinx provides AXI BFM to verify functionality of AXI masters and AXI slaves with AXI3, AXI4, AXI4-Lite, and AXI4-Stream interface
The AXI Bus Functional Models (BFMs), developed for Xilinx by Cadence Design Systems, support the simulation of customer-designed AXI-based IP. AXI BFMs support all versions of AXI (AXI3, AXI4, AXI4-Lite and AXI4-Stream). The BFMs are delivered as encrypted Verilog modules. BFM operation is controlled via a sequence of Verilog tasks contained in a Verilog-syntax text file. The API for the Verilog tasks is described in the AXI BFM User Guide.
The AXI BFM can be used to verify connectivity and basic functionality of AXI masters and AXI slaves with the custom RTL design flow. The AXI BFM provides example test benches and tests that demonstrate the abilities of AXI3, AXI4, AXI4-Lite and AXI4-Stream Master/Slave BFM pair. These examples can be used as a starting point to create tests for custom RTL design with AXI3, AXI4, AXI4-Lite and AXI4-Stream interface. The examples can be accessed from CORE Generator or standalone web download.
The AXI BFM can also be used for embedded designs using Xilinx Platform Studio (XPS). The AXI BFM is available as part of the CIP wizard to create an AXI-based IP with AXI BFM solution. The AXI BFM is also provided as separate pcores that can be accessed from the XPS IP catalog.
There are no evaluation licenses for AXI BFM IP.
Key Features & Benefits
Supports all protocol data widths and address widths, transfer types and responses
Transaction level protocol checking (burst type, length, size, lock type, cache type)
Behavioral Verilog Syntax
Verilog Task-based API
Delivered in ISE, enabled by a Xilinx-generated license
Verilog and VHDL example designs and test benches delivered standalone or through CORE Generator for RTL design
Integrated with XPS as a pcore or as an option with CIP wizard
Supported Simulators: Aldec Riviera-PRO, Cadence Incisive Enterprise Simulator, ISE Simulator, Mentor Graphics ModelSim and Synopsys VCS
I hope this helps.

Real time communication PC with PLC (protocol?)

Basically, I would like to creat my own piece of software something a la communication protocl between PC and PLC.
I would like to read real time values from PLC and display them in a table for example Data Base, OPC table, Excel and write to PLC from PC in real time mode as well.
The whole point is I would like to access this data via ethernet port. How I can do it ? I do not want to use 3rd party software. I want to create something my own.
Choose any programming languages like C#,VB.NET and use opcdaauto.dll ,it is free dll for OPC Foundation members
You can easily get the live data from the OPC
or use dll provided by the OPC Server which you are using
As already mentioned, OPC-UA is probably more preferable, otherwise, there are commercial libraries such as InGear and open projects on GitHub.
If you actually want to implement your own low level drivers, they will depend on the PLC manufacturer. For example:
If you are working with Allen-Bradley, you will have to implement Common Industrial Protocol (CIP).
If you are working with Siemens, you will have to implement S7 Communication (S7comm or S7 for short).
If you search GitHub for various search terms related to Allen Bradley CIP and Siemens S7, you will find many starting points for communicating directly with these controllers.

implement the wireless m-bus protocol on an STM32/CC1120

I'm trying to implement the wireless m-bus protocol on an STM32/CC1120 system, but I can't find any useful documentation about the wmbus working principles or any implementation examples.
Can anybody, please, help me find some tutorials/docs/specs ?
Thanks :)
The wireless M-Bus protocol is a part of the european norm EN 13757.
There is a whole series of documents describing the different aspects of M-Bus. Part 4 is for wireless M-Bus.
You can buy the documents at beuth. You'll certainly need part 4 for wireless m-bus and part 3 for detailed decoding of the contained m-bus records:
EN 13757-4 (W-Mbus)
EN 13757-3 (Application Layer)
If you don't want to directly invest money, but learn about the basics, you may also want to have a look at the OMS (open metering system) specification which is for free and based on the wireless-m-bus protocol. Keep in mind that not every wireless m-bus meter is necessarily a OMS meter but it could still help getting you started into the subject.
http://en.wikipedia.org/wiki/Meter-Bus
I also found the description of M-Bus proto in docs for ODIN OD4110 energy meter. But the sources are hard to find. I also need one just to communicate and log the consumption.
There are several libraries available:
jMBus: supports wireless and is based in Java
Mbus4J: based on Java
libmbus: don't support wireless, only wires, based on C
Using one of these helps coming around knowing the full M-Bus communication protocol or buying the documents.

Software framework for internet-wide peer-to-peer applications

Is there any known effort to build a generic software framework/library for building distributed/P2P systems on the wider internet[1]? Something that ideally should provide basic services such as peer autodiscovery, autoconfiguration (wrt NAT/firewall issues, bootstrapping), fault-tolerance (churn-resistance, adaptivity, replication), differentiated transports (reliable, unreliable, unicast, anycast, multicast, broadcast), basic storage (DHT-like) and events notification (pubsub).
So, basically something like Hazelcast but not limited to walled-garden server-to-server applications. This would be tremendously useful to easily build distributed applications.
[1] with "wider internet" I mean the public internet, including mobile, residential, eventually connected and possibly byzantine endpoints
you will find different option and technologies depending on the framework you want to use.
For instance for Java based applications you might want to have a look at the JXTA technology.