Sponsored Content
Top Forums UNIX for Dummies Questions & Answers NS3 with MQTT integration. HELP !!!! Post 302599147 by KishIsrael on Thursday 16th of February 2012 10:35:57 AM
Old 02-16-2012
Data NS3 with MQTT integration. HELP !!!!

Hi, I'm doing my thesis on the NS3 environment. I need to integrate it with mqtt. Mqtt provides a (mosquitto) broker / server, and it expects to have clients connect to it. A client could be a publisher (publishes data on the broker) or a subscriber (receives data from the broker it has subscribed to).

SOOOO, i need to have an NS3 node as a publisher client. I have set everything working (Nodes, WiFi, TAP NET device etc) and i do have a connection made to the broker.

THE PROBLEM IS THAT: as soon as the connection is made, and the broker recognizes my NS3 node using my ID "publisher" , the connection is subsequently disconnected, so fast almost in a flash. Here is the output from the mosquitto broker:


1329401026: New connection from 191.13.13.2.
1329401026: New client connected from 191.13.13.2 as publisher.
1329401026: Socket read error on client publisher, disconnecting.


I have delved into the broker code and the error seems to be coming from the file: - loop.c in function 'loop_handle_reads_writes() at if(mqtt3_net_read(db, i)) line 267'
- or then from mosquitto.c after pselect() at point if(mqtt3_net_read(contexts[i]) line 280.

I DO NOT EXPLICITELY CLOSE my NS3 node socket after opening it. I am using an altered version of bulk-send-application.cc to include capability to also receive data from a server, and then i create a custom mosquitto namespace to add the mosquitto client functions which i will call from the bulk-send-applicaiton.cc.

WHY IS THE BROKER ACCEPTING MY CONNECTION, RECEIVES MY INFORMATION I SEND TO IT, SINCE IT DISPLAYS MY ID ('publisher'), THEN ALMOST IMMEDIATELY DISCONNECTS ME WITH A SOCKET-READ-ERROR WHILE I HAVE NOT EXPLICITELY CLOSED MY NS3 SOCKET ? Smilie Smilie Smilie Smilie Smilie Smilie

Moderator's Comments:
Mod Comment Cross-post. Closed.
 

9 More Discussions You Might Find Interesting

1. IP Networking

about ns3

Command terminated with signal SIGSEGV. Run it under a debugger to get more information (./waf --run <program> --command-template="gdb --args %s <args>"). while running our own program in ns3 we got the above error... what does this error mean?? (1 Reply)
Discussion started by: nivedita
1 Replies

2. IP Networking

ns3

i need materials regarding ns3(related to WiMAX) (1 Reply)
Discussion started by: nivedita
1 Replies

3. IP Networking

help with ns3 code

how to add a relay node in wimax network using ns3 simulator.... (0 Replies)
Discussion started by: nivedita
0 Replies

4. IP Networking

NS3 SendTo

Hi, I am working to implement a basic WiFi infrastructure in NS3. I have placed 16 APs in grid and one client is moving using random walk. Client and AP can communicate through message exchange. However, when I try a message of size more than 30 bytes, it is crashed. Please help me if anyone have... (0 Replies)
Discussion started by: dandapat
0 Replies

5. IP Networking

is that doable in NS3 ??

Dear all, I want to simulate an Wireless Mobile ad hoc network that uses the OLSR routing algorithm. ( i know how to do that now after reading the tutorial) Now, Instead of sending messages, I want the nodes to be able to send a c++ code. consider this scenario: node A, send a c++... (0 Replies)
Discussion started by: knowledgeSeeker
0 Replies

6. Programming

NS3 with MQTT integration. HELP !!!!

Hi, I'm doing my thesis on the NS3 environment. I need to integrate it with mqtt. Mqtt provides a (mosquitto) broker / server, and it expects to have clients connect to it. A client could be a publisher (publishes data on the broker) or a subscriber (receives data from the broker it has subscribed... (4 Replies)
Discussion started by: KishIsrael
4 Replies

7. Infrastructure Monitoring

Using Node-RED and MQTT to Monitor Server and Application Stats

After setting up MQTT and testing some ESP8266 and ESP32 modules, where I noted that testing in Programming ESP32 (ESP-WROOM-32) as an MQTT Client Subscribed to Linux Server Load Average Messages, I was so impressed with MQTT that I installed MQTT on three different computers, instantly and... (2 Replies)
Discussion started by: Neo
2 Replies

8. Programming

Publish and Subscribe to AES-256 Encrypted MQTT Messages to Node-RED from PHP Scripts

Various Node-Red crypto modules do not work with PHP, so to send an encrypted message from a PHP script (in this case from a Ubuntu server) to Node-RED we need our own code. After a few hours of searching, testing various libs, more testing and debugging, I got this PHP to Node-RED code... (0 Replies)
Discussion started by: Neo
0 Replies

9. Programming

Node-RED: Writing MQTT Messages to MySQL DB with UNIX timestamp

First, I want to thank Neo (LOL) for this post from 2018, Node.js and mysql - ER_ACCESS_DENIED_ERROR I could not get the Node-RED mysql module to work and searched Google until all my links were purple! I kept getting ER_ACCESS_DENIED_ERROR with the right credentials. Nothing on the web was... (0 Replies)
Discussion started by: Neo
0 Replies
imqbrokerd(1M)						  System Administration Commands					    imqbrokerd(1M)

NAME
imqbrokerd - start a Message Queue broker instance SYNOPSIS
/usr/bin/imqbrokerd [option...] /usr/bin/imqbrokerd -h DESCRIPTION
imqbrokerd starts an instance of the Message Queue broker. The Message Queue broker is the main component of a Message Queue message server. The broker performs reliable delivery of messages to and from Java Message Service (JMS) clients. imqbrokerd uses command line options to specify broker configuration properties. OPTIONS
The following options are supported: -backup fileName Back up a Master Broker's configuration change record to fileName. This option only applies to broker clusters. -cluster brokerList Specify the list of broker instances which are connected in a cluster. This list is merged with the list in the imq.cluster.brokerlist property. This option only applies to broker clusters. brokerList is a comma-separated list of broker instances, each specified by hostName:port (the host on which the broker instance is running and the port number it is using) If you don't specify a value for hostName, localhost is used. If you don't specify a value for port, the value of 7676 is used. For example: host1:8899,host2,:7878. -dbpassword password Specify the password for a plugged-in JDBC-compliant database used as a Message Queue data store. -dbuser userName Specify the user name for a plugged-in JDBC-compliant data store. -Dproperty-=value Set the specified broker configuration property to the value. The system does not validate either the configuration property or value. Therefore, spelling, formatting, and case is important. Message Queue can not set incorrect values passed using the -D option. -force Perform action without user confirmation. This option only applies when you use the -remove instance option, which normally requires confirmation. -h Display usage help. Execute nothing else on the command line. -javahome path Specify the path to an alternate Java 2-compatible Java Development Kit (JDK) or Java Runtime Environment (JRE) The default is to use the runtime bundled with the operating system. -ldappassword password Specify the password for accessing an LDAP user repository when using an LDAP server (as opposed to a built-in flat-file repository) to authenticate users of a Message Queue message server. -license [name] Specify the license to load, if different from the default for your Message Queue product edition. If you don't specify a license name, this lists all licenses installed on the system. Depending on the installed Message Queue edition, the values for name are pe (Platform Edition-basic features), try (Platform Edition-90-day trial enterprise features), and unl (Enterprise Edition). -loglevel level Specify the logging level. Valid values for level are NONE, ERROR, WARNING, or INFO. The default value is INFO. -metrics int Report metrics at a specific interval. Specify int as the number of seconds. -name brokerName Specify the instance name of this broker and use the corresponding instance configuration file. If you do not specify a broker name, the name of the file is set to imqbroker. If you run more than one instance of a broker on the same host, each must have a unique name. -passfile filename Specify the name of the file from which to read the passwords for the SSL keystore, LDAP user repository, or JDBC-compliant database. -password keypassword Specify the password for the SSL certificate keystore. -port number Specify the broker's Port Mapper port number. By default, this is set to 7676. To run two instances of a broker on the same server, each broker's Port Mapper must have a different port number. JMS clients connect to the broker instance using this port number. -remove instance Remove the broker instance. Delete the instance configuration file, log files, data store, and other files and directories associated with the broker instance. This option requires user confirmation unless you also specify the -force option. -reset store|messages|durables|props Reset the data store (or a subset of the store) or resets the configuration properties of the broker instance when the broker instance is started. The action depends on the argument provided. store Clear all persistent data in the data store, including messages, durable subscriptions, and transaction information store. messages Clear all persistent messages durable. durables Clear all durable subscriptions. props Clear all configuration information in the config.props instance configuration file. All properties assume default values. -restore filename Replace the Master Broker's configuration change record with the specified backup file. This file must have been previously created using the -backup option. This option only applies to broker clusters. -shared Specify that the jms connection service be implemented using the shared threadpool model, in which threads are shared among connections to increase the number of connections supported by a broker instance. -silent Turn off logging to the console. -tty Display all messages be to the console. WARNING and ERROR level messages are displayed on the console by default. -upgrade-store-nobackup Specify that an earlier, incompatible version Message Queue data store is automatically removed when migrating to Message Queue 3.5 format. If you do not use this option, you must manually delete the earlier data store. This applies to both built-in (flat-file) persistence and plugged-in (JDBC-compliant) persistence. Migration of the earlier data store to a Message Queue 3.5 data store takes place the first time you start a Message Queue 3.5 broker instance on an earlier version data store. -version Display the version number of the installed product. -vmargs are [[arg]...] Specify arguments to pass to the Java VM. Separate arguments with spaces. If you want to pass more than one argument or if an argument contains a space, use enclosing quotation marks. For example: imqbrokerd -tty -vmargs " -Xmx128m -Xincgc" ENVIRONMENT VARIABLES
The following environment variables affect the execution of this command: IMQ_JAVAHOME Specify the Java 2 compatible runtime. When this environment variable is not set it defaults to /usr/j2se. EXIT STATUS
The following exit values are returned: 0 Successful completion. >0 An error occurred. FILES
/etc/init.d/imq Shell script for starting imqbrokerd. This file looks at the /etc/imq/imqbrokerd.conf file. /etc/imq/imqbrokerd.conf Configuration file which controls the behavior of the broker startup script. /etc/imq/passwd Flat file user repository for authenticating users. /etc/imq/accesscontrol.properties Controls client access to broker functionality. /etc/imq/passfile.sample Sample passfile used by the -passfile option. /var/imq/instances/brokerName/props/config.properties Broker instance configuration file. ATTRIBUTES
See attributes(5) for descriptions of the following attributes: +-----------------------------+-----------------------------+ | ATTRIBUTE TYPE | ATTRIBUTE VALUE | +-----------------------------+-----------------------------+ |Availability |SUNWiqu | +-----------------------------+-----------------------------+ SEE ALSO
imqadmin(1M), imqcmd(1M), imqdbmgr(1M), imqkeytool(1M), imqobjmgr(1M), imqusermgr(1M), attributes(5) Sun Java System Message Queue Administrator's Guide SunOS 5.11 11 Mar 2004 imqbrokerd(1M)
All times are GMT -4. The time now is 06:21 AM.
Unix & Linux Forums Content Copyright 1993-2022. All Rights Reserved.
Privacy Policy