Jun 02, 2015

Benchmarks for IoT Edge Nodes

posted by Bryon Moyer

If you’ve been in the market for microprocessor benchmarks, then you’re probably familiar with EEMBC. Their most recent benchmark suite, ULPbench, was designed to compare microcontrollers (MCUs) so that purchasers could get a neutral, apples-to-apples view of which MCUs consume the least energy.

That’s all fine and good, but it also establishes a path towards something similar but more inclusive: Internet-of-Things (IoT) edge nodes. These are the units way at the edge of the IoT that fundamentally do three things: measure something, do some minor computation, and then send the data… somewhere. Usually wirelessly.

Something’s got to power these devices, and they may be far-flung, even inaccessible. It’s expensive, although possible, to change batteries in nodes scattered throughout a large farm. It’s impossible to change the battery on a sensor miles down a borehole (without bringing it up, of course). So energy consumption is of critical importance on these small systems.

These systems tend to have four main components: the sensor, an MCU, a radio subsystem, and power management. ULPbench provides an approach that might be useful in this context, except that its focus is solely on the MCU, and as you can see below, the radio is another major consumer of energy.

 IoT_burst_profile.png

(Image courtesy EEMBC)

Additionally, the work profiles used to characterize the energy consumption for an edge node may differ from those used to characterize MCUs more generally.

So EEMBC has embarked on a program to define a benchmark suite for IoT edge nodes. This would entail conjuring up appropriate work profiles for these kinds of devices, some of which might leverage ULPbench, some not.

They refer to these edge nodes as being “sleepy” – they do a bunch of work and then go to sleep, waking at some time in the future to repeat the process. That wake/sleep pattern figures into the overall rate of energy consumption. But you may notice mentions of the fact that, if the systems sleep for too long, then this benchmark may not apply – which might be confusing.

Here’s what’s going on there. The issue isn’t really how long the system sleeps; it’s just that such long-sleep behavior may be more typical of edge nodes that leverage energy harvesting for power. And it’s the energy harvesting, not the sleep time, that’s the problem. So a battery-powered unit with no energy harvesting that sleeps a long time would still be covered by this new benchmark.

“What’s the problem with energy harvesting?” you might ask. Well, they’re measuring how much energy the unit needs by measuring the inflow of current from the power source. That doesn’t work for a unit that powers itself through harvesting. There may well be a good methodology for handling such nodes, but they’re in the vast minority these days, so it’s not the dominant problem. EEMBC is focused on the much more common case of battery-powered nodes.

You can read more in their announcement.

Tags :    0 comments  
May 28, 2015

Rumors Intel Altera Deal is Close

posted by Kevin Morris

The NY Post reported today that sources told them that an Intel/Altera deal was close, and could be done by the end of next week.

At the same time, we are hearing from multiple Altera customers who are opposed to the deal. The customers are concerned that Intel would shift Altera's focus away from meeting their needs, and that Intel is poorly equipped to run an FPGA business - which is almost more of a software and service business than a "chip" business.

Key concerns surround Altera's highly-capable AE resources who are viewed as essential to customer success with complex FPGA designs.

All of this while a growing group of Altera investors are pressuring Altera management to take a deal.

So, it appears that there may be a situation where Altera's investors are exactly opposed to Altera's customers on the issue.

Tags : Intel, Altera,    1 comment  
May 28, 2015

Is Exactly-Once Delivery Possible with MQTT?

posted by Bryon Moyer

We looked at MQTT, along with various other messaging protocols, not too long ago. Included in the discussion was a brief mention of MQTT having quality-of-service (QoS) features – and one of those is debatable.

MQTT’s optional QoS levels are to guarantee delivery no more than once (in which case you may miss a message), at least once (in which case you might get a duplicate), or exactly once. This latter one is the subject of debate: various threads in various discussions argue why it’s impossible in practice.

This can be discussed on a number of levels. Within the protocol itself, these QoS levels are implemented through acknowledgment sequences.

For at-least-once service, the sender has to keep a copy of the message until it receives a PUBACK from the receiver. In the absence of a PUBACK, the message must be resent. There are two possible causes for a resend: the original message may indeed not have been received, or the PUBACK may not have been received. In the latter case, the original was received and sent on for processing, but the sender doesn’t know that. So it sends a duplicate, but the receiver will have no record that this is a duplicate message; to it this is simply a new message. So it will process it just as it did the first one.

 Figure_1.png

Figure 1. At-least-once delivery. Note that in the third scenario, the message is sent for processing (the dashed arrow) twice.

Exactly-once is slightly more involved. And there are a couple choices the receiver has in how it handles the message once received, and I don’t want to get lost in that, so I’ll abstract the receiver behavior (and the drawing picks one option). As above, the sender sends the message and keeps a copy. When the receiver gets the message, it sends a PUBREC back to the sender, but it keeps a record of the receipt for the moment. Once the sender gets the PUBREC, it can delete its copy of the message, but it keeps a record of the PUBREC for the moment and sends a PUBREL back to the receiver, letting it know that it knows that the receiver got its copy. Once the receiver gets the PUBREL, then it sends back a PUBCOMP and discards its record of the message; when the sender gets the PUBCOMP, then it discards its record of the PUBREC and the exchange terminates.

 Figure_2.png

Figure 2, Exactly-once delivery. One message processing option shown. Note that in no scenario is the message sent for processing (dashed arrow) more than once.

The basic idea is that both sender and receiver keep a record of the state until they’re both convinced that the message was delivered. If, during the process, one of the ACKs gets lost and a duplicate message is sent, the receiver is still tracking that message, so it can ignore the duplicate.

That’s all well and good from the limited standpoint of message delivery, but messages have a purpose; presumably their intent is that something happen as a result of the message. These are quaintly referred to as “side effects” in the discussions, which they are in a computer science sense, but they may really be the “main effect” desired as a result of the message.

If the message instructs an oven to change its temperature, then, from a message-sending standpoint, the fact that the temperature changed after the message is a side effect. But from a system standpoint, it’s the main effect; that’s the purpose of the message. So there’s a question of liability here: if the message doesn’t arrive, then clearly there’s a messaging problem. But if the message arrives, but then something goes wrong in the process of changing the temperature, who’s responsible?

MQTT washes its hands of the issue as soon as the receiving end confirms that it got the message. If the process of sending the message further on in the receiving system breaks down, or if some other system element fails, then, in reality, you still need a message resend. But if a “reduce by 10 degrees” message is received and processed, but something in an internal acknowledgment loop fails, then the message might be processed twice with the net result of reducing the temperature by 20 degrees.

The basic problem is that there are many steps along the way where failure can occur. Even in cases of redundancy or failover, there are typically delays either in detecting that there’s a problem or in performing a switch, and things can go wrong in those timing gaps.

The solution here comes back to “idempotence”: to quote Wikipedia, this “is the property of certain operations in mathematics and computer science, that can be applied multiple times without changing the result beyond the initial application.” You have to do some work on the receiving side to make this happen.

Essentially, the receiving side has to take full ownership of state; it can’t count on the sender to share in storage of the state in case state changes get lost between sender and receiver. This is the principle behind the REST architecture, and it may be familiar in how the HTTP protocol works.

You could also argue that, instead of sending the instruction, “reduce by 10 degrees,” the message should say, “Set to this new temperature” (which happens to be 10 degrees lower). But that shifts state responsibility to the sender. If the receiver’s true state changed and the sender didn’t find out, then the state is effectively undefined.

Bringing things back to MQTT, the problem is that the protocol considers itself successful simply when it delivers its message exactly once. That’s a parochial viewpoint. If reliability is important enough to use that QoS level, then you can’t count on the QoS, because it gives only message, not system, guarantees.

(At least, that's my take on the whole debate...)

Tags :    1 comment  
Get this feed  

Login Required

In order to view this resource, you must log in to our site. Please sign in now.

If you don't already have an acount with us, registering is free and quick. Register now.

Sign In    Register