Question

The issue I care about here is high throughput, there are a lot of sensors (monitoring devices) which send data to the server at high frequency.

It looks really like that we have to use UDP protocol for such kind of data transfer. However I've never used UDP for high-level logic API programming, a Web API using http would be easier.

Could you please suggest anything suitable for this?

Was it helpful?

Solution

HTTP is a pretty heavy weight protocol.

  • It has a limiting Request/Response style
  • It is designed for the wide-scale and scaleable dissemination of data.
  • It operates within a lossless and guaranteed data deliver protocol TCP (excepting the newer standards which optionally support other underlying mechanisms).
    • TCP is heavy weight as it requires a 3-way handshake prior to delivering any data. Depending on how the connection is managed this could preclude successful data-transfer or ensure a three-fold overhead.
    • TCP also enforces a 64 KB transfer window, if the network has significant round trip latency this will slow overall throughput.

Your particular IoT swarm might be composed of devices with the capacity for sustained HTTP communications. This is not without downsides: chiefly network and energy demands, but also the exclusion of less capable devices.

Additionally UDP packets are not terribly difficult to receive/send. A simple web search with "udp socket tutorial" shows up a number of resources that give high level understanding, and detailed language specific instructions.

There is a lot of flexibility in how you orchestrate a UDP protocol. How you do chose to orchestrate it depends largely on what sort of communication occurs between the device/server/peers. A good plan would be to imagine a sizeable heterogeneous swarm with a non-trivial network and consider how those devices/servers/peers communicate, and what that communication requires in order to be considered effective within the constraints of network and device.

Licensed under: CC-BY-SA with attribution
scroll top