Feeds:
Posts
Comments

I got a email from a user that basically stated that “as a general rule, sending data with BEST_EFFORT Reliability qos (i.e., using nominal UDP semantics) should provide better performance than sending data with RELIABLE Reliability QOS on a stable, clean and thus relatively lossless network”.

Hmm, that sounds reasonable enough….to use a reliable protocol, the delivery protocol would have to send and process additional network packets like heartbeats, ACK/NACK packets thus consuming both network bandwidth and additional CPU cycles.  This additional overhead should make the “performance” of a reliable connection worse than that of a “best effort” connection.  If not “worse”, it certainly shouldn’t make it better…or would it?

Well, we may want to make some definitions first.  What is “performance”?  Is it maximum throughput?  Or the latency of the data (time it takes from sending to receiving)?  Or resources being consumed while sending at a particular data rate (CPU, network bandwidth, memory)?

In general, when sending data slower than the network bandwidth on a “stable, lossless transport”, then with Best Effort, there is no additional overhead in CPU/network bandwidth/memory being consumed.  Of course, if you use the Reliable mode, you’ll get the same throughput performance but at a higher “price” (overhead).

So, no, you do not get better throughput/latency, using Best Effort vs Reliable QOS when sending data below network bandwidth limitations on networks that do not lose data packets.  You’ll get the same throughput/latency performance…just for lower “cost”.

If there is a chance that data packets can be lost on the network no matter what the network load is, then there is an obvious performance difference between Best Effort and Reliable…not necessarily in terms of throughput and latency, but in terms of determinism vs the guaranteed receipt of all data sent in the order sent.

With Best Effort, you may not receive all of the data, but you will receive whatever data that was able to get through with minimal latency (more deterministically), and no additional overhead will be incurred even if there is data loss.

With Reliability, the reliable protocol will be able detect and repair lost packets so that all of data sent will be received in the order sent, at the expense of additional network packets (HB, ACK/NACK) to detect and repair lost packets, not to mention the increased CPU and memory needed as well.  But one could argue that the “performance” of the Reliable connection is better if less deterministic (i.e., there may be unpredictable delays in receiving data while the system repairs missing data).

That’s all good and great when the data rates are well below the network bandwidth…

However, when you send data faster than the system can handle, no matter if the network itself is “lossless”, e.g., shared memory, data still can be lost…by DDS or the OS if not by the network hardware.

It’s easy to send data faster than the network can handle.  Data rates is calculated by (amount of data/time).  You can overwhelm a network by sending small 1-200 byte data too fast.  Or the same can happen by trying to send a MB in a single write() call.

When an application tries to send data faster than the network can handle, data packets are lost.

In Best Effort mode, DDS does not try to detect that it is  being asked to send data faster than the network can handle. And in Best Effort mode, there is no mechanism to stop DDS from pushing data through the network stack even though the network is saturated. So the network stack and/or physical network will throw away data packets exceeding the network bandwidth.

So just because the “network” is lossless, doesn’t imply that from App to App there isn’t a place where data can be thrown out.  The physical network may never see a packet because the OS throws out the data packet when the network reports that it can’t handle any more.  So the packet isn’t lost by the physical network, but intentionally dropped by the OS or device driver layer.

e.g., the send socket buffer is full which causes OS to throw out the data being sent before it reaches the Ethernet card.

Or more likely, since it usually take more CPU to process incoming data then to send outgoing data, Sending apps usually can send much faster than Receiving apps can process, and thus the receive socket buffer (or shared memory buffer) fills up while the CPU is busy processing received packets….then the Ethernet device or the OS shared memory driver has no choice but to drop the data packets it’s received.

So how fast is too fast? Well, assuming a “clean network”, it’s when the sender tries to send more than the total amount of data that can be buffered in the “system” in one go…without any delay between sends. The “system” being a combination of the send network stack, the network itself (including buffers in switches/routers) and the receive network stack. The main places where significant amounts of data can be stpred are the send buffer and the receive buffer.

For RTI’s shared memory driver, there is no independent send buffer versus receive buffer vs network buffer, there is only 1 shared memory buffer. So if you send data > the size of the shared memory buffer in one go, then some part of the data will probably be lost.

Let’s take the case of sending “large data”.  Large data is defined as data that is larger than the MTU (maximum transmission unit) of the physical transport.  The largest user data packet that can be sent by UDP is 64K. So sending 1 MB of data in a single write() call would require some mechanism, either RTI DDS’s builtin large-data fragmentation feature or a user-level software layer, to break up the large data into smaller (MTU-sized) chunks, and sending the fragments individually through the physical network.

And usually sending the data fragments consecutively without any delay…which with today’s CPU speeds..can easily exceed the maximum network bandwidth of most networks.

e.g. sending 1 MB in the 1 ms that takes a CPU to breakup and send 1 MB in 64K chunks through a UDP socket requires a network that can handle 8 Gbps.  A 1 Gbps network would not be able to transmit the data that fast.

With other networks, if the large data being sent is greater than the network can buffer, then data fragments could be lost.

e.g., 1 MB of data. 64K chunks –> 16 data fragments are sent. But if the shared memory buffer only holds 512 KB of data, it’s likely that the send side sends much faster than the receive side can process, so up to 8 data fragments could be “lost” (in the case that the send side sends so fast that all of the fragments is “sent” even before DDS on the receive side has a chance to take one packet from the network).

The situation that I just described is exactly what would happen if you try to send too much data in Best Effort mode. There is no throttle. DDS will push the data to the network as fast as the application sends the data. And if the application gives DDS large data (e.g., 1 MB), DDS will send all of the data in fragments without delay. If the “network” looses data, then you’ll see your effective throughput either be zero (i.e., the network is always loosing the last parts of a large data), or not with high performance (i.e., every now and then you get lucky and all of the fragments of a large data sample does make it through).

So, what can you do? Put in a mechanism to limit the rate that DDS pushes packets onto a network to something that the network can handle. You can do this open loop, i.e., put in arbitrary delays between sending of data at the application layer and/or use the RTI DDS FlowControl mechanism, or closed loop, by using feedback from the receiving side to let the send side know when it’s OK to send more data.

The closed-loop mechanism is basically what you’re getting with the Reliable mode. By using a limited-sized send queue, the reliable mechanism will block DDS from sending any more data when the send queue is full, and only when there is feedback (ACKs) back from the receive side (indicating that it’s able to process more packets) is DDS allowed to send more data. This is also known as “throttling”.

Yes, this will add some amount of overhead…but sending using the Reliable protocol to throttle the send rate and thus not lose any data due to excessive data rates at the cost of receiving/processing HB/ACK is a small price to pay compared to sending data so fast that data is lost and then having to use the same Reliable protocol to repair the lost packets.

So, even when using the Reliable protocol, it’s still better to tune the protocol to never send faster than the end-to-end network can handle.

In short, for large data, you’re almost guaranteeing that DDS will try to send it fast than the network (even shared memory) can handle, and thus data will be lost. If you’re using RTI DDS’s internal large data algorithm, the data rate can be throttled using the Reliable protocol. If your own code is breaking up the large data yourself, you can use arbitrary delays in your send loop.  Another open-loop approach is to use the RTI DDS FlowControl mechanism which can be configured to limit the max send rate for a DataWriter to a specified data rate.  The FlowController can also be used by the RTI DDS internal large data algorithm.

For those of you who have used TCP for transferring MBs and MBs of data without every having to worry about this issue…well TCP internally breaks up data to MTU sized chunks and uses a reliable protocol for data transfer and limited buffer (queue) sizes so that it doesn’t send data faster than the network can handle.  You don’t actually get to choose if you want to send Best Effort or Reliable, it’s always Reliable.  And it’s hard to tune TCP to work under abnormal conditions.  And the MTU size is usually based on the MTU of Ethernet (around 1500 bytes).

So, in conclusion, sending data using Best Effort QOS may not provided the best performance…especially if peak data rates are greater than the network data rate.  You can see this on the highways of California…during rush hour, there are metering lights at the on-ramps that regulate when cars get to get on the highway.  With the metering lights, the network, aka highway, can be run at higher effect throughput. Without this type of regulation, driving in the SF Bay area or LA during rush hour would be more of a mad house than it is.

Micro-processors, throughout their history, have tenaciously delivered on their promise of doing more with less: less time, less space and now less power. The ways to do that, however, have changed profoundly in the last decade or so.  Modern processors are not faster but fatter and denser. Chances are you are reading this post on a dual core if you’re using a handheld or half a dozen cores if you are on a desktop. The web-server that is serving this content probably has cores in the range of high teens, if not more. Soon, 100s of cores will cease to be a novelty – welcome many-cores!

The most visible upshot of the many-core revolution is that tomorrow’s distributed systems will be smaller and will run cooler. Computer systems that use large rooms and industrial chillers today, will use a small office desk and may be a retail window air-conditioning unit. At the heart of these new breed of computer systems are multi- or many-core processors. Leading chip manufacturers are packing more cores on a silicon die than ever before; turning good old micro-processors into a system-on-a-chip – here is the key part – for EVERYBODY!

Every once in a while people rediscover what Uncle Ben said long ago, “With great power comes great responsibility.” It could not be more true in this day and age of many-core computers. The onus of unleashing the massively concurrent computing power of the emerging hardware platforms lies almost exclusively in the hands of us – the programmers. Unfortunately, as many [1] [2] [3] have observed, we’re not able to keep up. The gap between the software and hardware technology is wider than ever. Multi-threading is conclusively hard and most programmers lack mechanical sympathy – the intrinsic understanding of how a program runs on a machine. Think cache misses!

So what does all this mean to data-centric messaging? Is your colossal computing power from edge-to-enterprise churning away digits without melting polar ice caps? Are you, or your team of programmers ready to extract work of dozens of processors from one? And let me ask, within budget and on-time? RTI has set sail to help you do just that.

RTI Research has secured Phase I STTR research funding from Air-Force Research Laboratory to develop Scalable Communication and Scheduling Techniques for Many-core Systems. The research will be a collaboration between RTI and the University of North Carolina (UNC) Real-Time Systems Group. We are very excited to begin research with Prof. James Anderson, an IEEE fellow.

With this research, we’re planning to develop a new infrastructure to help application developers design software that can scale up in performance as the number of cores increases.  To do this, application developers will need to switch their mind-set to becoming developers of “distributed applications” that run on many-cores.  RTI Connext can provide the fast message-passing between the cores.  However, a lot more has to happen before we realize this vision.   We will develop three key technologies:

  • Enhance and tune RTI Connext high-performance messaging specifically to optimize performance on multi- and many-core machines.  The goal is effective concurrency of the middleware both for hyper-fast data exchange between cores, and efficient use of multiple cores to send/receive large amounts of data off-board.
  • Smart resource allocation and scheduling algorithms for many-core computers. This will ensure little or no computing power is wasted. We’ll leverage the pivotal research work done at the UNC Real-time Systems group.
  • Finally, we want to help you build distributed systems that are robust, simpler to develop, and also ship on time within budget. We envision a component framework for developing scalable many-core applications that will package the new software technology in easy to use interfaces and run-times.

While we’re at it, we also want to investigate the role of data-centric messaging in the now-in-vogue concurrency models, such as Actors. Actors are fundamentally based on  asynchronous messaging. Can standardized DDS API serve as a middlware substrate between actors? Can data-centric messaging make actor programming any easier? These are some research questions we’ll explore along the way.

Want to dig deeper what we’re up to? Check out this Design West presentation.

Questions? Feedback? Comments? Write in the comments section below or write us @ manycore@rti.com

 

I’m very pleased to announce that the much-anticipated “Extensible and Dynamic Topic Types for DDS” (DDS-XTypes) specification has finished its finalization process at the Object Management Group (OMG) meeting that just completed in Reston, VA. As the lead author of the spec and chair of the finalization process, I for one am excited by what we’ve accomplished and where we’re going with this technology.

This spec represents RTI’s commitment to open systems: we’ve taken a lot of our longstanding work on XML support and dynamic data typing and pushed it into public documents for anyone else to implement. Portability and interoperability are good for our customers, and they’re good for RTI.

DDS-XTypes represents a broad set of new capabilities, and we’re hard at work implementing it. We’ve got portions already available in our shipping product today. And we’ve got significantly more available in early-access form, which will be released generally later this year.

Today is one of the most significant days in RTI’s history. Today, we are unveiling a new product line, a new corporate strategy, and our vision of a new industry direction.

Our new products target the challenging problem of building connected systems that will work together as never before.  The RTI Connext product line spans the gap from deeply-embedded devices, through high-performance real-time systems, all the way to enterprise IT integration.  It really is the first edge-to-enterprise “real-time SOA” platform.  We’ve been working on the base technology for decades; it’s truly exciting to bring the vision together—and the capability to market—for the first time.

Our new strategy is to leverage our “operational” technology into a unified system-wide infrastructure.  Our software is the key nervous system for over 500 major mission-critical projects in several industries including defense, industrial automation, automotive, and healthcare.  Our new products expand upon this footprint, both down into smaller devices, and up into system-of-systems integration.  We can now assemble large networks of mixed devices and applications into working systems, and hook those (and other) systems together into a connected whole.

Critically, we can also now connect operational systems to the enterprise IT infrastructure. Why is that valuable?  Because it enables a new way to run and control systems.  This is an important trend across many industries.  As networks become more powerful, and as technologies like ours make interconnection more possible, the worlds of IT and OT (operational technology) can, for the first time, interact. RTI Connext builds operational systems, but with our new Integrator product, it can also connect those systems with enterprise technologies in real time.  Since business intelligence and resource management are so well developed for the enterprise, this makes it possible to feed back smart directions to the operational system.  And that makes everything more efficient.

Thus, we let you use, control, and optimize all your systems as a holistic entity.  Our new tag line sums it up nicely: Your Systems. Working as One.

This is a big, complex vision.  Implementing it fully will take years.  But today’s launch represents a culmination of what we’ve learned addressing the needs of mission-critical applications for so many years. Our base technology has the performance, 24×7 reliability, and scale to succeed as the core transport for demanding real-time systems.  We are now adding IT-like technologies: central console administration, multiple messaging patterns, and a true service bus.  The result is a unique approach that enables a new level of system function.  We’re excited both by the current breakthrough and its implications for the future.

It’s great to kick off 2012 with such big news! Today’s announcement is the first step towards our goal of making all your systems work together as one. I’d like to offer my congratulations to the RTI family, as well as the customers and partners who made this day possible.

As a lot of you know, the DDS-RTPS interoperability protocol for DDS most frequently runs on top of UDP/IP. DDS implementations, RTI Data Distribution Service included, provide support for a number of other lower-level transport protocols. But UDP provides the greatest flexibility in terms of both reliability and timing, and it’s the transport that the OMG mandates that vendors support in order to claim interoperability.

In some cases — like traversing wide-area networks — TCP support is really important. Network routers may not forward UDP packets at all, they may perform address translation, and/or they may require that “connections” be initiated first on one side of the network. That’s why RTI has been shipping TCP transport support for a while now, both as a native transport for application-to-application communication and with RTI Routing Service as a means to federate DDS systems (which internally may be using another transport such as UDP or shared memory). Today, that layering of RTPS on top of TCP is RTI-specific.

At the OMG technical meeting just concluded in Arlington, VA, RTI and others provided initial proposals for standardization of an interoperable TCP transport for DDS. RTI’s presentation in the OMG’s MARS group is available for OMG members. This will be an exciting extension of DDS interoperability — which now includes five implementations with proven records; look for another post on this — to the wide-area network. It’s still early — an RFP or RFC is yet to be issued — but expect to hear more in a couple of months.

Today, we held the first of our DDS Road Show events in Boston.  The room was filled with over 30 attendees, which exceeded our goal.  Representative companies included Raytheon, Red Hat, GE Intelligence Solutions, MIT, Schneider Industrial Automation, Mitre and BAE.  I’m particularly excited to see more and more interest in DDS outside the Defense sector, which has historically demonstrated the most interest in DDS.  Recently, we’ve achieved design wins in smart energy, mining equipment, factory automation, automotive, and transportation.  Along with the diversified attendance at the Road Show, this makes me very optimistic about the prospects DDS going forward.  Next stop on the road show is this Thursday in Huntsville, AL, where I expect to see a more Defense-oriented audience, given the heavy presence of the Army there.

A data-centric approach simplifies integration significantly, and this video provides a great case in point. RTI’s “Shapes Demo” application currently runs on Linux, Windows, and also in a web browser through RTI’s Web Integration Service (available as a preview release). This demo shows how a native Android application can integrate with all of these existing Shapes applications without modifying any existing code!

Follow

Get every new post delivered to your Inbox.