Skip to content

This repository hosts a collection of source code designed to compare the throughput of file transfers using three prominent communication protocols: MQTT, CoAP, and HTTP. Throughput, or data transfer efficiency, is a crucial metric in the context of Internet of Things (IoT) and network applications.

Notifications You must be signed in to change notification settings

sandeshbjain/IoT-Protocol-Throughput-Comparison

Folders and files

NameName
Last commit message
Last commit date

Latest commit

 

History

1 Commit
 
 
 
 
 
 
 
 
 
 

Repository files navigation

The Project compares the throughput and Overhead ratio of transferring files through MQTT, CoAP and HTTP protocols.

Libraries required: numpy, pandas, xlsxwriter, aiocoap

MQTT:

  • MQTT requires a broker, publisher and a subscriber. The publisher and subscriber sourcecodes are in the MQTT directory.
  • The subscriber code can be run in a virtual machine or a computer and should be connected to a MQTT broker. In this case a mosquitto broker has been used with an IP address: 192.56.0.1. This should be modified in your case. It subscribes to the topic "File_topic" on which the publisbher publishes its files
  • The publisher is also connected to the MQTT broker and publishes the files to the topic "File_topic".
  • The files can be accessed in DataFiles and the path to access should be changed based on users location.
  • The files can be run on command line, publisher publishes files using different qos(quality of service): 0,1 and 2.
  • An excel file is generated displaying the total file transfer time.

Command to execute: 1. Update the broker IP address in subscriber and publisher file; 2. Open Command prompt; 3. Run the command: python3 Subscribe.py on subscriber; 4. Run command: python3 Publish.py on publisher

COAP:

  • COAP only requires a server and a client.
  • The path of the DataFiles should be updated in the server file and then it can be run using command line.
  • The client should conenct to the server using the servers ip address and place a GET request for the required file.
  • The client then records the total time taken for file transfer to receive it since the request is placed.
  • The transfer time is exported to an excel sheet which can be useful to analyze in case of several transfers.

Command to execute: 1. Update the server IP address in client file; 2. Open Command prompt; 3. Run the command: python3 CoAP_server.py on server; 4. Run command: python3 CoAP_client.py on the client pc.

HTTP:

  • HTTP protocol also requires a server and a client.
  • The path of the DataFiles should be updated in the server file and then it can be run using command line.
  • The client should conenct to the server using the servers ip address and place a GET request for the required file.
  • The client then records the total time taken for file transfer to receive it since the request is placed.
  • The transfer time is exported to an excel sheet which can be useful to analyze in case of several transfers.

Command to execute: 1. Update the server IP address in client file; 2. Open Command prompt; 3. Run the command: python3 HTTP_Server.py on server; 4. Run command: python3 HTTP_Slient.py on the client pc.

About

This repository hosts a collection of source code designed to compare the throughput of file transfers using three prominent communication protocols: MQTT, CoAP, and HTTP. Throughput, or data transfer efficiency, is a crucial metric in the context of Internet of Things (IoT) and network applications.

Resources

Stars

Watchers

Forks

Releases

No releases published

Packages

No packages published

Languages