Send packets to neighboring nodes and use multi-hop routing in Castalia Simulator - omnet++

I want to simulate a WBAN routing protocol in Castalia simulator.
First of all, I want nodes to send broadcast messages to all of their neighbors. In Castalia, as a default manner nodes send Broadcast messages not only to neighbors but also to all nodes in the network. as a result, we don't have any relay node to forward packets.
So, I think that Castalia uses single-hop routing and therefore
multi-hop routing is not defined in it.
How can I implement multi-hop routing in Castalia?

In Castalia, as a default manner nodes send Broadcast messages not only to neighbors but also to all nodes in the network. as a result, we don't have any relay node to forward packets.
[...] So, I think that Castalia uses single-hop routing and therefore multi-hop routing is not defined in it.
I am note sure where you are getting this information, but this is wrong. Castalia is capable of multihop routing, there is even a Routing module called MultipathRingsRouting in the default distribution.
Moreover, your statements seem to be contradictory with each other. How can Castalia send messages to all nodes in the network (not just single-hop neighbours) and yet not support any multihop routing? Can you see how these are contradictory statements? In the same spirit how can Castalia send messages to all nodes in the network and "as a result, we don't have any relay node to forward packets". Can you see how this does not make much sense.
Perhaps you are confused by the BAN simulation examples in Castalia which define networks where all the nodes are a single hop from the BAN hub. This does not mean that Castalia in general cannot support multihop routing. It does.
You mention a WBAN Routing protocol in your question. You should note that the current implementation of the BaselineBANMAC in Castalia does not support multi-hop communication. Just to be clear, I am talking about this specific MAC and not Castalia as a whole. This MAC does not support any routing on top of it because it only allows communication between the hub and the slave nodes. There can only be one hub per network. You can have multiple networks (each having a hub) in your simulation, but these will be logically seperate and can only interfere with each other, not communicate. Perhaps, you wanted to use this MAC in your simulations. You will not be able to explore routing with this MAC.
You can however use other MACs (such as TunableMAC, or TMAC) that allow routing to be used on top of them. To be clear, the MAC does not do any routing, this is done by the routing layer above it (a separate module), but a MAC design can allow a routing layer to operate above it, or not. Make sure you read the manual carefully and have a solid understanding of the basics.

Related

Simple BACnet implementation for PIC Microcontroller

I am designing a Fire Alarm System. Main Panel will act as Master. Manual
Call Point Units will act as Slaves.Hence there will be
only one Master. I want to use RS485. I am not using TCP/IP Data link. My
few doubts/questions are as follows:
For such a small setup can I use BACnet as my communication Protocol?
If yes, I am wondering to use which data link i should be using, because
every subsystem seems to be Multi Master [e.g. MS/TP].
In case if it is decided to use the BACnet for my project. Which files
from sources I should use. Considering minimum services
required. Initially it should be a bare minimum for the sake of
understanding, later i can upgrade the system.
I have gone through the demo examples for PIC microcontrollers. But
unable to understand it .
Please help.
Yes, you can use BACnet for the communication Protocol. Over RS485 it would be BACnet MSTP.
BACnet MSTP is Multi-Master, but you can have slave devices that use MAC address above 127. It gets complex when adding slave devices, lots of gotchas.
I can't help you with the open-source BACnet stacks. The BACnet protocol is quite large, even to support the basics. Look into the BACnet profile for B-SS for the smallest subset of BACnet services.

How to test reliability of my Veins simulations?

I am developing Car2X applications in order to simulate case studies based on Veins framework.
As an Information Systems student, I have been worried mostly about the code of my applications.
Recently I noticed that VEINS has no LLC, NETWORK and TRANSPORT layers in its source code (/src).
My question is: how to assure that my simulation runs would generate data close to reality for Car2X applications when there's none of these layers above in the source code?
P.S.: I am aware of INET framework and its protocols, I was just wondering if I could use just Veins for my case studies :)
The layers you mentioned are not needed for most Car2X simulations. If you download, for example, Veins 4.4, you will find only simulation models for single hop broadcast transmission of frames, the most general use case. If you want to simulate a special protocol, say, for multi-hop transmission of frames, you will need to implement this as a network layer. Then, your simulation will have a network layer model.

ruby scrape with multiple ip addresses

I would like to know if it is possible for a Ruby program to possess multiple IP addresses? I am trying to download a lot of data from a site, but it is very slow with only 1 connection at a time.
I intend to multi-thread my program with each thread using its own IP address, but I do not know if it is possible in the first place, any help or hints would be greatly appreciated.
It is definitely possible for a machine or a program to have multiple IP addresses. You can even have multiple network adapters, and tie each of them to different physical connections.
However, it can get really hairy to maintain. The challenge for that is partly in the code, partly in the system maintenance, and partly in the networking required to make that happen.
A better approach that you can take is to design your program so that it can run distributed. As such, you can have several copies of it synchronized and doing the work in parallel. You can then scale it horizontally (build more copies) as required, and over different machines and connections if required.
EDIT: You mentioned that you cannot scale horizontally, and that you prefer to use multiple connections from the same machine.
It's very likely that for this you'll have to go a little bit lower in the network stack, developing yourself the connection through sockets in order to use specific network interfaces.
Check out an introduction to Ruby sockets.
Also, check out these related questions:
How does a socket know which network interface controller to use?
Binding to networking interfaces in ruby
Ruby: Binding a listening socket to a specific interface
Can I make ruby send network traffic over a specific iface?

OIDs expected by NMS to draw the topology

I am writing a SNMP Agent for an Ethernet switch.
The agent is able to run and reply to provide SysDescr. It has been written in a modular design, such that, one can add OIDs very easily.
Now, my intention is to create a topology (say ring) of the switches and discover the topology using a common Network Management System like HP-NNMi or OpenNMS (I am testing on OpenNMS btw).
I just want to know, what oids are queried by an NMS, to gather enough information to draw the topology?
[EDIT] I can know, what is the MAC of the remote switches connected to any port of a switch, through MAC learning.
The answer depends on what type of topology you want to capture through your ethernet switch. Usually for a layer two switch (which appears to be the case) LLDP MIB (This is an IEEE std implemented by many switches) is quite useful. From what you described above that is you have information about MACs on a port it appears you probably can go this route. There are some other Physical topology MIBs (like RFC2292) that you may want to look at.
You can have a look at the OpenNMS Enhanced Linkd documentation. It will give you some hints which OID's are used to build a Layer-2 topology based on LLDP, CDP and the Bridge MIB. To build it a topology based on the Bridge MIB, OpenNMS has implemented the algorithm described in Topology Discovery for Large Ethernet Networks. You'll find also hints what information is used to build an OSPF and IS-IS topology.
Every NMS uses their proprietary topology discovery.
Depending on what your switch supports, you'll want to consider at least
RFC1213-MIB ipAddrTable, ipRouteTable
IF-MIB ifTable
IP-FORWARD-MIB inetCidrRouteTable
BRIDGE-MIB dot1dTpFdbTable, dot1dStpPortTable
Q-BRIDGE-MIB dot1qTpFdbTable
LLDP-MIB lldpLocPortTable, lldpRemTable
OSPF-MIB
BGP4-MIB
and if you support VLANs, you'll want to describe those.
We have seen other MIBs queried by NMS applications.

Existing Event Driven Network Protocols

I am building a set of programs that consist of multiple clients and a single server.
The clients are frequently pushing small packets of data to the server, which will validate the information (returning an error if the data is invalid), and process the received information. The information may then incur the firing of events, which clients will be subscribed to, allowing for clients to be instantly (or as close as possible) notified (along with a small amount of data).
I have some ideas about how to do this, but I am trying to avoid creating a protocol of my own, mainly as I'm sure it would take forever and I would probably make a few errors. So I was wondering if there are any existing protocols that I could implement into my system that would provide such functionality.
The number of clients will initially be quite small, but will be growing over time to potentially include 1000's of clients (with their own subscriptions), and several front end servers (each one handling a subset of subscriptions) parsing the information back and forth with back end servers for improved capability.
So, if anyone knows of any existing protocols that implement these requirements and functionality, that would be fantastic.
EDIT
I am currently looking at the XMPP protocol, and the JXTA protocol suite (for reference, and implement with another language). Both seem quite good and provide the necessary connectivity, but I have not had the opportunity to test each of them out in my environment, or if they are even suitable for what I am attempting.
Additionally, some of the network clients will be outside of the local network and operating over WAN. Security is not so much of an issue, but I need to take into account the increase latency of this, and firewall rules (local to the connection that is hosting the application and ISP firewalls) that could be blocking certain ports or transport protocols (I have read some text that said that some ISPs where blocking UDP packets, but not sure of how wide this goes. I can do it at home, the office, mobile, friends houses, etc and have yet to experience it myself).
I'm sorry if the following is not exactly what you're after but I am slightly confused by your use of the word 'protocol'. I understand a protocol to be a 'communication specification' only, where the implementation is left entirely to you. If that is the case I always find the the following graphic usefull, link.
If on the other hand you are looking for a solution which allows you to easily implement the networking side of your application, helping save time, then checkout the following network libraries, which implement their own custom protocol:
NetworkComms.Net
Lidgren
ZeroMQ
Disclaimer: I'm a developer for NetworkComms.Net

Resources