Showing posts with label smart grid. Show all posts
Showing posts with label smart grid. Show all posts
Friday, 20 December 2019
A few 10-Year Challenges for Distributed Systems and IoT
A newspaper column on "next decade" predictions got me thinking about crystal ball prognoses. Tempting as it is to toss in my views on climate change, surveillance in China and self-driving cars, I'll focus this particular blog on computer systems topics in my area.
1. AI Sys and RT ML. These terms relate to computer systems created to support AI/ML applications, and that often involve addressing real-time constraints. There is a second meaning that centers on using AI tools in networks and operating systems and database platforms. I'm open-minded but, so far, haven't seen convincing demonstrations that this will yield big advances. I'll focus on the first meaning here.
Although AI Sys terminology is trendy, the fact is that we are still at the very earliest stages of incorporating sensing devices into applications that leverage cloud-scale data and machine learning. As this style of system deployment accelerates in coming years, we'll start to see genuinely smart power grids (existing grids often proclaim themselves to be "smart" but honestly, not much use is being made of ML as of yet), smart homes and offices, smart cities and highways, smart farms.... The long-term potential is enormous, but to really embrace it we need to rethink the cloud, and especially, the cloud edge where much of the reactive logic needs to run. This is why the first of my predictions centers on the IoT edge: we'll see a new and trustworthy edge IoT architecture emerge and mature, in support of systems that combine sensors, cloud intelligence and big data.
Getting there will require more than just redesigning today's cloud edge components, but the good news is that an area begging for disruptive change can be an ideal setting for a researcher to tackle. To give just one example: in today's IoT hub services, we use a database model to track the code revision level and parameter settings for sensors, connected and accessible or not. The IoT hub manages secure connectivity to the sensors, pushes updates to them, and filters incoming event notifications, handing off to the function service for lightweight processing. I really like the hub concept, and I think it represents a huge advance relative to the free-for-all that currently is seen when sensors are connected to the cloud. Moreover, companies like Microsoft are offering strong quality of service guarantees (delay, bandwidth, and even VPN security) for connectivity to the edge. They implement the software, then contract with ISPs and teleco's to obtain the needed properties. From the customer's perspective what matters is that the sensors are managed in a trustworthy, robust and secure manner.
The puzzle relates to the reactive path, which is very far from satisfactory right now. When a sensor sends some form of event to the cloud, the IoT hub operates like a windowing environment handling mouse movements or clicks: it functions as the main loop for a set of handlers that can be customized and even standardized (thus, a Canon camera could eventually have standard cloud connectivity with standard events such as "focused", or "low power mode", or "image acquired."). Like with a GUI, the incoming events that need user-defined processing are passed to these user-defined functions, which can customize what will happen next.
The core problem is with the implementation. First, we split the path: sensor-to-cloud uploads of large objects like photos are videos follow one path, and end up with the data automatically stoed into a binary large objects (BLOB) store, replicated for fault-tolerance.
Meanwhile, other kinds of events, like the ones just mentioned, are handled by small fragments of logic: cloud functions. But these aren't just lambdas written in C++ or Scala -- they are typically full programs coded in Linux and then handed to the cloud as containers, perhaps with configuration files and even their own virtualized network mapping. As a result, the IoT Hub can't just perform the requested action -- it needs to launch the container and pass the event into it.
The IoT hub accomplishes these goals using the "function service", which manages a pool of machines, picks one on which to launch this container for this particular Canon photo acquisition event, and then the program will load that event's meta-data and can decide what to do. In effect, we launch a Linux command.
Normally, launching a Linux command has an overhead of a few milliseconds. Doing so through the IoT hub is much slower: Today, this process takes as much as two seconds. The issues are several: first, because the IoT Hub is built on a database like SQL server or Oracle, we have overheads associated with the way databases talk to services like the function service. Next the function service itself turns out to do a mediocre job of warm-starting functions -- here the delay would center on caching, binding the function to any microservices it will need to talk to ahead of time (off the critical path), dealing with any synchronization the function may require.
I can't conceive of a sensible realtime use case where we can tolerate two seconds of delay -- even web page interactions are down in the 10-50ms range today, well below the 100ms level at which alpha-beta tests show that click-through drops. So I would anticipate a complete redesign of the IoT hub and function layer to warm-start commonly needed functions, allow them to pre-bind to any helper microservices they will interact with (binding is a potentially slow step but can occur out of the critical path), and otherwise maintain a shorter critical path from sensor to user-mediated action. I think we could reasonably target sub-1ms delays... and need to do so!
There are many other unnecessarily long delays in today's IoT infrastructures, impacting everything from photo and video upload to ML computation on incoming objects. But none of this is inevitable, and from a commercial perspective, the value of reengineering it (in a mostly or fully compatible way) would be huge.
2. Cost-efficient sharable hardware accelerators for IoT Edge. In prior blog postings, I've written about the puzzle of hardware for the IoT Edge (many people take that to mean "outside" the cloud, but I also mean "in the outermost tier of a data center supporting the cloud, like Azure IoT). Here, the central question involves costs: modern ML and especially model training is cost-effective only because we can leverage hardware accelerators like GPU, TPU and custom FPGA to offload the computationally parallel steps into ultra-efficient hardware. To this, add RDMA and NVM.
The current generation of hardware components evolved in backed back-end systems, and it is no surprise to realize that they are heavily optimized for batched, offline computing. And this leads to the key puzzle: today's ML accelerators are expensive devices that are cost effective only when they can be kept busy. The big batches of work seen in the back-end enable today's accelerators to run in support of very long tasks, which keeps them busy and makes them cost-effective. If the same devices were mostly idle, this style of accelerated ML would become extremely expensive.
In some sense, today's ML accelerators could have been at home in the old-styled batch computing systems of the 1970's. As we migrate toward a more event-driven IoT edge, we also will need to migrate machine learning (model training) and inference into real-time contexts, and this means that we'll be using hardware accelerators in settings that lack the batched pipelining that dominates in the big-data HPC-style settings were those currently reside. To be cost-effective we will either need completely new hardware (sharable between events or between users), or novel ways to repurpose our existing hardware for use in edge settings.
It isn't obvious how to get to that point, making it a fascinating research puzzle. As noted, edge systems are event-dominated, although we do see streams of image and video data (image-processing tasks on photo or video streams can be handled fairly well with existing GPU hardware, so that particular case can be solved cost-effectively now). The much harder case involves singleton events: "classify this speech utterance," or "decide whether or not to retain a copy of that photo." So the problem is to do snap analysis of an event. And while my examples involve photos and videos, any event could require an intelligent response. We may only have milliseconds to react, and part of that reaction may entail retraining or incrementally adjusting the ML models -- dynamic learning.
The hardware available today isn't easily sharable across scaled out event-driven systems where the events may originate in very different privacy domains, or from different users. We lack ways to protect data inside accelerators (Intel's new SIMD instruction set offers standard protections, but a GPU or TPU or FPGA is typically operated as a single security context: it is wide-open if a task runs on behalf of me immediately after one that ran on behalf of you: the kernel I've invoked could just reach over and extract any data left behind after your task was finished).
So why not use Intel's SIMD solutions? For classification tasks, this may be the best option, but for training, which is substantially more expensive from a computational point of view, the Intel SIMD options are currently far slower than GPU or TPU (FPGA is the cheapest of all the options, but would typically be somewhere in between the SIMD instructions and a GPU on the performance scale).
It will be interesting to watch this one play out, because we can see the end goal easily, and the market pressure is already there. How will the hardware vendors respond? And how will those responses force us to reshape the IoT edge software environment?
3. Solutions for the problem blockchain was supposed to solve. I'm pretty negative about cryptocurrencies but for me, blockchain is a puzzle. Inside the data center we've had append-only logs for ages, and the idea of securing them against tampering using entangled cryptographic signatures wasn't particularly novel back when the blockchain for Bitcoin was first proposed. So why is a tamper-proof append-only log like Microsoft's Corfu system not a blockchain?
There are several aspects in which blockchain departs from that familiar, well-supported option. I'll touch on them in an unusual order: from practical uses first to more esoteric (almost, "religious") considerations, which I'll tackle last. Then I want to argue that the use cases do point to a game changing opportunity, but that the whole story is confused by the religious zealotry around some of these secondary and actually, much less important aspects.
First among the novel new stories is the concept of a smart contract, which treats the blockchain as a database and permits the developer to place executable objects into Blockchain records, with the potential of representing complex transactions like the mortgage-backed securities that triggered the 2008 meltdown. The story goes that if we can capture the full description of the security (or whatever the contract describes), including the underlying data that should be used to value it, we end up with a tamper roof and self-validating way to price such things, and our transactions will be far more transparent.
I see the value in the concept of a smart contract, but worry that the technology has gotten ahead of the semantics: as of the end of 2019 you can find a dozen tools for implementing smart contracts (Ethereum is the leader, but Hyperledger is popular too). Less clear is the question of precisely how these are supposed to operate. Today's options are a bit like the early C or Java programming languages: both omitted specifications for all sorts of things that actually turned out to matter, leaving it to the compiler-writer to make a choice. We ended up with ambiguities that gave us today's security problems with C programs.
With blockchain and smart contracts you have even nastier risks because some blockchain implementations are prone to rollback (abort), and yet smart contracts create dependency graphs in which record A can depend on a future record B. A smart contract won't seem so smart if this kind of ambiguity is allowed to persist... I predict that 2020 will start a decade when smart contracts with strong semantics will emerge. But I'll go out on a limb and also predict that by the time we have such an option, there will be utter chaos in the whole domain because of these early but inadequate stories. Smart contracts, the real kind that will be robust with strong semantics? I bet we won't have them for another fifteen years -- and when we do get them, it will be because a company like Oracle or Microsoft steps in with a grown-up product that was thought through from bottom to top. We saw that dynamic with Java and CORBA giving way to C# and LINQ and .NET, which in turn fed back into languages like C++. And we will see it again, but it will take just as long!
But if you talk to people enamored with blockchain, it turns out that in fact, smart contracts are often seen as a cool curiosity. I might have a narrow understanding of the field, but among people I'm in touch with, there is little interest in cryptocurrency and even less interest in smart contracts. More common, as far as I can tell, is a focus on the auditability of a tamperproof ledger.
I'll offer one example that I run into frequently here at Cornell, in the context of smart farming. You see variants of it in medical centers (especially ones with partner institutions that run their own electronic health systems), human resource management, supply chains, airports that need to track airplane maintenance, and the list goes on. At any rate, consider farm to table cold-chain shipment for produce or agricultural products like cheese or processed meats. A cup of yoghurt will start with the cow being milked, and even at that stage we might wish to track which cow we milked, how much milk she produced, the fat content, document that she was properly washed before the milking machine kicked in, that we tested for milk safety and checked her health, that the milk was promptly chilled and then stored at the proper temperature. Later the milk is aggregated into a big batch, transported, tested again, pasteurized, homogenized, graded by fat content, cultured (and that whole list kicks in again: in properly sterile conditions, at the right temperature...).|
So here's the challenge: Could we use a blockchain to capture records of these kinds in a secure and tamperproof manner, and then be in a position to audit that blockchain for various tasks such as to confirm that the required safety steps were preserved, or to look for optimization opportunities? Could we run today's ML tools on it, treating the records as an ordered collection and mapping that collection into an event Tensor Flow or Spark/Databricks could ingest and analyze? I see this a fantastic challenge problem for the coming decade.
The task is fascinating and hard, for a lot of reasons. One is that the domain is partly disconnected (my colleagues have created a system, Vegvisir, focused on this aspect). A second question you can ask concerns integrity of our data capture infrastructure: can I trust that this temperature record is from the proper thermometer, correctly calibrated, etc? Do I have fault-tolerant redundancy? How can we abstract from the chain of records to a trustworthy database, and what do trust-preserving queries look like? How does one do machine learning on a trusted blockchain, and what trust properties would the model then carry? Can a model be self-certifying, too? What would the trust certificate look like (at a minimum, it would need to say that "if you trust X and Y and Z, you can trust me for purpose A under assumption B..."). I'm reminded of the question of self-certifying code... perhaps those ideas could be applied in this domain.
I commented that this is the problem blockchain really should be addressing. I say this because as far as I can tell, the whole area is bogged down on really debates that have more to do with religion than with rigorous technical arguments. To me this is at least in part because of the flawed belief that anonymity and permissionless mining are key properties that every blockchain should offer. The former is of obvious value if you plan to do money laundering, but I'm pretty sure we wouldn't even want this property in an auditing setting. As for the permissionless mining model, the intent was to spread the blockchain mining revenue fairly, but this has never really been true in any of the main blockchain systems: they are all quite unfair, and all the revenue goes to shadowy organizations that operate huge block-mining systems. As such, the insistence on permissionless mining with anonymity really incarnates a kind of political opinion, much like the "copyleft" clause built into GNU licenses, which incarnated a view that software shouldn't be monetized. Permissionless blockchain incarnates the view that blockchains are for cybercurrency, that cybercurrency transactions shouldn't be taxed or regulated, and that management of this infrastructure is a communal opportunity, but also a communal revenue source.
Turning to permissionless blockchain as it exists today, we have aspects of this dreamed-of technology, but the solutions aren't fair, and in fact demand a profoundly harmful mining model that squanders energy in the form of hugely expensive proof-of-work certifications. My colleague, Robbert van Renesse, has become active in the area and has been doing a survey recently to also look at some of the other ideas people have floated: proof of stake (a model in which the rich get richer, but the compute load is much reduced, so they spend less to earn their profits...), proof of elapsed time (a lovely acronym, PoET, but in fact a problematic model because the model can be subverted using today's Intel SGX hardware), and all sorts of one-way functions that are slow to compute and easy to verify (the parallelizable ones can be used for proof-of-work but the sequential ones simply reward whoever has the fastest computer, which causes them to fail on a different aspect of the permissionless blockchain mantra: they are "undemocratic", meaning that they fail to distribute the income for mining blocks in a fair manner). The bottom line, according to Robbert, is that for now, permissionless blockchain demands computational cycles and those cycles make this pretty much the least-green technology on earth. There is some irony here, because those who promote this model generally seem to have rather green politics in other ways. I suppose this says something about the corrupting influence of potentially vast wealth.
Meanwhile, more or less betting on the buzz, we have a whole ecosystem of companies convinced that what people really want are blockchain curation products for existing blockchain models. These might include tools that build the blockchain for you using the more-or-less standard protocols, that back it up, clean up any garbage, index it for quick access, integrate it with databases and AI/ML. We also have companies promoting some exceptionally complex protocols, many of which seem to have the force of standards simply because people are becoming familiar with their names. It will take many years to even understand whether or not some of these are correct -- I have serious doubts about a few of the most famous ones!
But here's my bet for the coming decade: in 2029, we'll be seeing this market morph into a new generation of WAN database consumers, purchasing products from today's database companies. Those customers won't really be particularly focused on whether they use blockchain or some other technology (and certainly won't insist on permissive models with pervasive anonymity and proof of work). They will be more interested in tamperproof audits and ML on the temporally-ordered event set.
Proof of work per-se will have long since died from resource exhaustion: the world simply doesn't have enough electrical power and cooling to support that dreadful model much longer (don't blame the inventors: the blame here falls squarely on the zealots in the cybercoin community, who took a perfectly good idea and twisted it into something harmful as part of their quest to become billionaires off the back of a pie-in-the-sky economic model).
The future WAN databases that emerge from the rubble will have sophisticated protection against tampering and the concept of trust in a record will have been elevated to a notion of a trustworthy query result, that can be checked efficiently by the skeptical end-user. And this, I predict, will be a huge market opportunity for the first players to pull it off. It would surprise me if those players don't turn out to include today's big database companies.
4. Leave-nothing-sensitive behind privacy. The role of the cloud in smart settings -- the ones listed above, or others you may be thinking about -- is deeply enshrined by now: very few smart application systems can avoid a cloud-centric computing model in which the big data and the machine intelligence is at least partly cloud-hosted. However, for IoT uses, we also encounter privacy and security considerations that the cloud isn't terribly good at right now, with some better examples (Azure, on the whole, is excellent) and some particularly poor ones (I won't point a finger but I will comment that companies incented to place a lot of advertising often find it hard to avoid viewing every single user interaction as an invaluable asset that must be captured in perpetuity and then mined endlessly for every possible nugget of insight).
The upshot of this is that the cloud is split today between smart systems that are trying their best to spy on us, and smart systems that are just doing smart stuff to benefit us. But I suspect that the spying will eventually need to end, at least if we hope to preserve our Western democracies. How then can we build privacy-preserving IoT clouds?
I've written about this in the past, but in a nutshell, I favor a partnership: a style of IoT application that tries to "leave no trace behind" coupled to a cloud vendor infrastructure that promises not to deliberately spy on the end-user. Thus for example when a voice command is given to my smart apartment, it may well need to be resolved up on the cloud, but shouldn't somehow be used to update databases about me, my private life, my friends...
I like the mental imagery of camping in a wilderness where there are some bears roaming around. The cloud needs a model under which it can transiently step in to assist in making sense of my accent and choice of expressions, perhaps even contextualized by knowledge of me and my apartment, and yet when the task finishes, there shouldn't be anything left behind that can leak to third party apps that will rush into my empty campsite, hungry to gobble up any private data for advertising purposes (or worse, in countries like China, where the use of the Internet to spy on the population is a serious threat to personal liberties). We need to learn to enjoy the benefits of a smart IoT edge without risk.
Can this be done? I think so, if the cloud partner itself is cooperative. Conversely, the problem is almost certainly not solvable if the cloud partner will see its revenue model break without all that intrusive information, and hence is hugely incented to cheat. We should tackle the technical aspects now, and once we've enabled such a model, I might even favor asking legislative bodies to mandate privacy-preservation as a legally binding obligation on cloud vendor models. I think this could be done in Europe, but the key is to first create the technology so that we don't end up with an unfunded and infeasible mandate. Let's strike a blow against all those companies that want to spy on us! Here's a chance to do that by publishing papers in top-rated venues... a win-win for researchers!
5. Applications that prioritize real-time. Many IoT systems confront deadlines, and really have no choice except to take actions at the scheduled time. Yet if we want to also offer guarantees, this poses a puzzle: how do we implemented solutions that are always sure to provide the desired timing properties, yet are also "as consistent" as possible, or perhaps "as accurate as possible", given those constraints?
To me this is quite an appealing question because it is easy to rattle off a number of ways one might tackle such questions. For example, consider an ML algorithm that iterates until it converges, which typically involves minimizing some sort of error estimate. Could we replace the fixed estimate by adopting a model that permits somewhat more error if the deadline is approaching?
Or here's an idea: What about simply skipping some actions because it is clear we can't meet the deadline for them? I'm reminded of work Bart Selman, a colleague of mine, did fifteen years ago. Bart was looking at situations in which an AI system confronted an NP complete question, but in a streaming context where variations on that question would be encountered every few seconds (he was thinking about robot motion planning but similar issues arise in many AI tasks). What he noticed was that heuristics for solving these constrained optimization problems sometimes converge rapidly but in other situations diverge and compute endlessly. So his idea, very clever, was to take the quick answers but to just pull the plug on computations that take too long. In effect, Bart argued that if the robot is faced with a motion-planning task it won't be able to solve before its next step occurs, take the previously-planned step and then try again. Sooner or later the computation will converge quickly, and the overall path will be both of high quality, and fast.
We could do similar things in many IoT edge settings, like the smart-things cases enumerated earlier. You might do better to have a smart grid that finds an optimized configuration setting once every few seconds, but then coasts along using old settings, than to pause to solve a very hard configuration problem 20 times per second if in doing so, you'll miss the deadline for actually using the solution. The same is true for management of traffic flow on a highway or in a dense city.
For safety purposes, we will sometimes still want to maintain some form of risk envelope. If I'm controlling a smart car in a decision-loop that runs 20 times per second, I might not run a big risk if I toss up my hands even 4 or 5 times in a role. But we would not want to abandon active control entirely for 30 seconds, so there has to be a safety mechanism too, one that kicks in long before the car could cause an accident (or miss the next turn), forcing it into a safe mode. I don't see any reason we couldn't do this: a self-driving car (or a self-managed smart highway) would need some form of safety monitor in any case, to deal with all sorts of possible mishaps, so having it play the role of making sure the vehicle has fresh guidance data seems like a fairly basic capability. Then in the event of a problem, we would somehow put that car into a safe shutdown mode (it might use secondary logic to pull itself into a safety lane and halt, for example).
I could probably go on indefinitely, but every crystal ball eventually fogs over, so perhaps we'll call it quits here. Have a great holiday and see you in the next decade!
Wednesday, 22 August 2018
Inventing the intelligent, active, edge
At the recent Microsoft faculty research summit, I was thrilled (and also somewhat relieved) to see that the company decided to run a whole workshop emphasizing systems (including networking), and the ways that systems can support machine learning. It seemed clear that Microsoft has decided to become a major player in what they call "intelligent edge" computing and is urging all of us to jump on board.
These terms may be new, so I thought I might summarize the trend, based on my current understanding of it. A good place to start is with a little mini-tutorial on what cloud computing infrastructures have been doing up to now, because the intelligent active edge really builds on the current architecture (over time, it will be more and more differentiated, but today, the overlap is substantial).
So: Today, we have a cloud dominated by a style of computing that prevailed in the 2000-2010 web server and services period. In a first draft of this essay I wrote a page or so about this topic but it got heavy on jargon and I felt that it was taking too long to get to the point. So I'll get there very quickly:
These terms may be new, so I thought I might summarize the trend, based on my current understanding of it. A good place to start is with a little mini-tutorial on what cloud computing infrastructures have been doing up to now, because the intelligent active edge really builds on the current architecture (over time, it will be more and more differentiated, but today, the overlap is substantial).
So: Today, we have a cloud dominated by a style of computing that prevailed in the 2000-2010 web server and services period. In a first draft of this essay I wrote a page or so about this topic but it got heavy on jargon and I felt that it was taking too long to get to the point. So I'll get there very quickly:
- Many people think of the cloud as a way to rent Linux containers, but the bigger and more exciting trend focuses on elastic platforms that are event driven, connected by various ways to pass objects from layer to layer, and customizable by providing little event handlers: "functions".
- Examples of platforms like this include Amazon Lambda, Microsoft Azure Functions, Google Tensor Flow, Spark/DataBricks RDDs.
- The connections tend to be via some form of queuing service (Amazon SQS, Apache Kafka, Azure Service Queues, IBM's MQSeries, OpenSplice, etc). Big objects are often just stored into a large file system (S3, Google GFS, Hadoop HDFS, etc).
- Everything is sharded from start to finish. Data shows up on HTTP connections (web requests to web services), but programmable edge routers (like Amazon Route 53) extract keys and use standard distributed hashing schemes to vector the requests into "shards", within which they may additionally load-balance.
- We cache everything in sight, using DHTs like Amazon Dynamo, Cassandra, Microsoft FaRM.
- The long-term storage layers are increasingly smart, like Azure Cosmos-DB. They may do things like deduplication, compression, image segmentation and tagging, creation of secondary objects, etc. Often they are backed by massive long-term storage layers like Azure Pelican.
- Then of course we also have standard ways to talk to databases, pre-computed files, other kinds of servers and services, back-end systems that can run MapReduce (Hadoop) or do big-data tasks, etc.
- The heavy lifting is hardware accelerated using GPU, TPU, FPGA and similar technologies, and as much as possible, we move data using RDMA and store it into memory-mapped non-volatile memory units (SSD or the newer 3D-XPoint NVMs like Optane).
Whew! I hope you are still with me...
The nice thing about this complex but rather "standard" structure is that the developer simply writes a few event handlers for new web requests and most of the rest is automated by the AWS Lambda, Google Tensor Flow or Azure Functions environment. Learning to work in this model is a bit of a challenge because there is a near total lack of textbooks (my friend Kishore Kumar is thinking of writing one), and because the technologies are still evolving at an insane pace.
The big players have done what they can to make these things a little easier to use. One common approach is to publish a whole suite of case-study "demos" with nice little pictures showing the approach, like you would find here for Azure, or here for AWS. In the best cut-and-paste fashion, the developer just selects a design template similar to what he or she has in mind, downloads the prebuilt demo, then customizes it to solve their own special problem by replacing the little functions with new event handlers of his or her own design, coded in any language that feels right (Python is popular, but you typically get a choice of as many as 40 popular options including JavaScript), and that will run in a little containerized VM with very fast startup -- often 1ms or less to launch for a new request.
This is the opposite of what we teach in our undergraduate classes, but for the modern cloud is probably the only feasible way to master the enormous complexity of the infrastructures.
So... with this out of the way, what's the excitement about the intelligent edge (aka active edge, reactive edge, IoT edge...)?
The key insight to start with is that the standard cloud isn't a great fit for the emerging world of live machine-learning solutions like support for self-driving cars, smart homes and power grids and farms, you name it. First, if you own a huge number of IoT devices, it can be an enormous headache to register them and set them up (provisioning), securely monitor them, capture data privately (and repel attacks, which can happen at many layers). Next, there is an intense real-time puzzle here: to control self-driving cars or drones or power grids, we need millisecond reaction times plus accurate, consistent data. The existing cloud is more focused on end-to-end web page stuff where consistency can be weak and hence the fast reactions can use stale data. So CAP is out the window here. Next, we run into issues of how to program all of this. And if you solve all of this in the cloud, you run into the question of what to do if your farmer happens to have poor connectivity back to the cloud.
So the exciting story about Azure IoT Edge was that Microsoft seems to have tackled all of this, and has a really coherent end-to-end vision that touches on every element of the puzzle. This would be endless if I shared everything I learned, but I'll summarize a few big points:
- They have a clean security and provisioning solution, and a concept of IoT life cycle with monitoring, visualization of "broken stuff", ways to push updates, etc.
- They work with ISPs to arrange for proper connectivity and adequate bandwidth, so that applications can safely assume that the first-hop networking won't be a huge barrier to success.
- They have a concept of an Azure IoT "hub" that can run as a kind of point-of-presence. Apparently it will eventually even be able to have a disconnected mode. Many companies operate huge numbers of PoP clusters and a smaller number of cloud data centers, so here Azure IoT Edge is taking that to the next level and helping customers set those up wherever they like. You could imagine a van driving to a farm somewhere with a small rack of computers in it and running Azure IoT "hub" in the van, with a connection while the van is back at the home office, but temporarily disconnected for the couple of hours the company is working at that particular farm.
- Then the outer level of Azure itself would also run the Azure IoT edge framework (same APIs) but now with proper connectivity to the full cloud. And the framework has a strong emphasis o topics dear to me like real-time, ways of offering consistency, replication for parallelism or fault-tolerance, etc. I'm looking at porting Derecho into this setting so that we can be part of this story, as a 3rd party (open source!) add-on. They have a plan to offer a "marketplace" for such solutions.
As a big believer in moving machine learning to the edge, this is the kind of enabler I've been hoping someone would build - right now, we've lacked anything even close, although people are cobbling solutions together on top of Amazon AWS Lambda (which perhaps actually is close, although to me has less of a good story around the IoT devices themselves), or Google Tensor Flow (which is more of a back-end story, but has some of the same features). As much as I love Spark/Databricks RDDs, I can't see how that could be an IoT story anytime soon.
So I plan to dive deep on this stuff, and will share what I learn in the coming year or so! Stay tuned...
Monday, 11 December 2017
Fog computing and cloud-hosted data concentrators
When a cloud touches the ground, we get fog, an image that inspires a new buzzword: "fog computing." If you are interested in cloud integration with edge devices you work in the fog!
Internet of Things is going to a big deal, and this suggests that as a research topic, fog computing deserves close scrutiny. Today's most interest question is more of a meta-question: figuring out which system elements should play which roles (once this question is resolved, a series of more technical follow-on questions would arise).
The question isn't really so new: At least since the 1980's, researchers have speculated about the challenges of computing systems that might reach very broadly into the physical world through a variety of sensing modalities (still and video imaging, radar and lidar and IR motion detectors, temperature and humidity sensors, microphones, etc), use machine-learned techniques to make sense of those inputs, and then perhaps take action. But the game changer relative to those early days is the contemporary appreciation of how cloud computing can drive costs down, and enable a new form of nimble startup -- the kind of company that builds a cool new technology and then can scale it to support millions of users almost overnight. Past versions of edge systems mired in issues of cost and suffered market failures: the users who might have benefitted didn't want to pay, and because the costs were genuinely steep, the technology simply didn't take off.
Today, we can at least identify a strong market pull. In any technology media publication you read about smart homes and office complexes and cities, smart highways and power grids, smart healthcare technologies. Clearly there is a wave of interest for this form of deeply integrated machine intelligence. Moreover, and this points to a social shift relative to the 1980's, the dominant tone isn't really a worry about privacy, although you do see some articles that fret about the risks (and they are quite real; we need to acknowledge and engage on that front). But the more dominant tone looks at upside, drawing analogies to our cell phones.
For example, I have an advisory role in a company called Caspar.ai. It was founded by Ashutosh Saxena, a friend who was a Cornell faculty member until he left to do the startup, and David Cheriton, who you may know of as the first outside investor in Google (he was a Stanford professor but also a very successful entrepreneur, and when Larry and Sergie knocked on his door with their idea and an early proof of concept, Dave jumped to help them get established). They view the apartment or condominium as the next platform, and Ashutosh actually gives talks in which he shows you the architecture diagram of an iPhone and then a nearly identical one for a condo in Santa Rosa. The Caspar.ai system is like the iPhone O/S and could host apps, and because Caspar works with the developer who built the entire development, the technology can orient itself: it is in such-and-such a room listening to the apartment owner giving instructions about music for the party tonight, etc.
The example highlights one of the puzzles we'll want to think about: Caspar has orientation because it is built right into the condominium or home. But most fog computing devices today are just small gadgets that individuals buy and install by hand. How would they know where they are, which way they are pointing, etc? And even if a very geeky technology person could configure such a thing, could her grandfather do it, or would he need to call his granddaughter to come and set the device up? Part of the fog computing puzzle is visible right in this example, and in the contrast with Caspar.ai: how will these systems orient themselves, and how will the devices be told what roles to play?
It isn't just about smart homes. One of the more exciting ideas I heard about most recently centers on smart agriculture: I attended a workshop on digital agriculture at Cornell a few weeks ago, and completely coincidentally, was invited to attend a second one on the concept of a smart soil "macroscope" at Chicago almost immediate afterward.
So how would the fog impact agriculture or dive into the soil? Researchers spoke about tracking produce from farm to table, literally step by step, and using that knowledge to reduce loss due to fresh produce sitting on the shelf for too long, to improve the efficiency of the produce supply chain, prevent accidental contamination by E-Coli or other bacteria, redirect shipments to match demand more closely, etc. A researcher at Microsoft showed that with a new kind of white-fi communications, drones could fly over fields and map out insect infestations in real-time, enabling the farmer to stamp out the pests with spot applications of insecticides, reducing unnecessary pesticides by a factor of 1000x. You could do the same with fertilizer, or when watering. One person talked about underground WiFi: it turns out to work surprisingly well, if you have enough power! Who would have imagined an underground WiFi network? But if the need ever becomes real enough, it can be done! The one caveat is that they need fairly well-drained soil; pooled water can block the signals.
Who needs this? I found one answer out in Napa. I happen to love great wines, and I'm friendly with some growers who own or manage insanely expensive vineyards. They would love to be able to visualize and track the subsurface biome, the movement of nutrients and water, and the conversion of surface materials into soil. This might help a grower identify particularly promising spots to place the next great winery. Of course, they are also quick to point out that no technology is a complete answer to any question, and that going from data to "useful insights" is quite a complicated matter. But in a world of constant climatic change, they are keenly interested in knowing what is going on down there. In fact I'm thinking I should start a little company to work on this topic, if for no other reason than as an excuse to visit and taste some of those wines! A lot of them are way to expensive for me to actually buy and drink on a routine basis.
Getting technical again: what questions can we identify from this set of examples, and how do they shape the likely form a fog computing system might take?
Part of the puzzle centers on the limitations of sensing devices. Devices are gaining in potential compute power, but you need to ask whether computing on the device itself is a smart move, given that more and more sensing devices are designed to operate on batteries, or with minimal power draw. Computing at the edge isn't a very power-efficient model, and relaying data back to a data center has overwhelmingly dominated when you look at actual deployed IoT products.
In fact there is much to be said for viewing sensors as dumb devices that might store a few hours or days of data, but don't compute very much. First, if you want to understand an image or a spoken command, the size of database you would use to do that is huge -- deep neural networks and Bayesian networks generate models that can be terabytes or even petabytes in size when used for tasks of this kind. Keeping the neural network models and precomputed data back in your local cloud where they can be shared among a number of users is far more cost-effective than shipping those petabytes to the devices, and then needing to keep those updated as the runtime conditions and goals evolve.
The proper way to process data might also depend on things the sensor is unlikely to have access to, such as the best estimate of its location and orientation, knowledge of which people are in the home or office, context associated with their prior commands to the system that were given in a different location, and captured by some other device. As we saw, while Caspar.ai might actually have this kind of orientation at hand, most devices lack that sort of context information (think of an Alexa camera/microphone/speaker that people shift around much like a flower vase: it isn't in the same place from day to day, and that camera could easily end up pointing at a wall, or a stack of books!) All of this might argue for a sensor model in which sensors capture everything in the vicinity, store a copy locally, but then just blindly relay the acquired data to the cloud. The sensor could still do some very basic stuff: for example, perhaps it can figure out that absolutely nothing is happening at all, and skip the upload in that case, or upload a tiny marker saying "no change." This really limited form of local computing is something that even very simple, disoriented devices can perform.
However, arguing in the other direction, there are sensing options that only make sense if deployed at the edge. For example, you can't easily correct for focus on vibration of a video after capturing it, so that form of dynamic adjustment should be performed right on the camera. A subsurface sensor used to track humidity in the soil may need to dynamically vary the way it operates its sensing components, because the best options for measuring moisture vary enormously depending on the depth of the water table, how far from fully saturated the soil is, etc. So for cases like these, a dumb sensor might end up generating endless streams of low-quality data that can't be patched up later.
Broadly, I think we'll need to do both, but that the sensors will be used mostly in pretty dumb ways (like to hold video, and to discard empty content), but then will relay most of the potentially interesting stuff back to the cloud.
So this starts to answer the meta question. Given this model, we can see what the technical need might be: the model argues that we should create a new technology base focused on cloud-hosted data concentrators that are integrated deeply into cloud storage systems: I'm fond of the term "smart memory" for this functionality. A single instance of a concentrator, on some single mid-range compute server within the cloud, might handle some large but not unbounded number of sensors: perhaps, 10,000 smart homes in some community, or 100 video cameras. If you need more capacity, you would just spread your incoming data streams over more data concentrators.
Notice that I'm not working within a standard 3-tier cloud model in this example. A standard cloud has a first tier that generates web content, often using cached data and other second-tier services. The third tier covers everything at the back end. A concentrator is an example of a new kind of first-tier: one that is stateful and smart, perhaps with real-time guarantees and consistency promises. This is not today's most common cloud model -- although it is close enough to it that today's cloud could definitely evolve to fit this picture, and in fact it might not even be a major reach to pull it off!
Within the data concentrator we would have a machine-learning model, dynamically updated and accurate, that could be used to immediately "understand" the data. Thus if a person in an apartment utters a remark that only makes sense in context, we could create a dynamic machine-learned utterance model that is accurate to the second and expresses the system knowledge of recent past; even if the speaker is moving from room to room, that model would evolve to reflect the system understanding of his or her request. For example, "Caspar, can you adjust the shade to get rid of that glare?" can be understood only by a system that knows the position of the sun, the locations of the windows and shades and the TV, and the options for adjusting that kind of window shade, but with that data, it can be done -- and that data would most likely live in a cloud-style concentrator or a smart-home "brain unit" if we put the concentrator right in the home (appealing as a response to privacy worries). Tell Alexa or Siri to do this, and because those technologies are kind of a free-standing autonomous edge, the best you can hope for is a response like "I'm sorry, Ken, I don't know how to do that."
The other argument for cloud models leads to a data storage and update insight. In particular, it isn't just the massive databases used for vision and speech understanding that would probably need to live on the cloud. There is also a question of the smaller knowledge models used to make sense of edge events, and to adapt as they occur.
A smart highway might have an evolving understanding of the situation on such-and-such a segment of the freeway, and a smart farming system might build up a model of the insect infestation in a field, adapting the drone's flight plan to focus on areas that are at highest risk, while spending less time scanning areas that seem to be unaffected by the bugs.
The argument for smart storage would simply be that as we capture and make sense of these data streams, we're in a unique position to decide what to keep and what to discard, which data to route to back-end systems for further evaluation using offline techniques, etc. The back-end systems would view the entire smart memory as a big storage cluster containing read-only files, reflecting the knowledge acquired by the smart analytic layer, and indexed by time. Of course they could write files too, for example to update parameters of the knowledge model in use on the front end.
As an example, if a smart highway were to observe that some car is a few cm to the side relative to predictions, the system would probably just tweak the model parameters at the edge. But if a car changes lanes unexpectedly, that would be a big event, and might be better handled by forwarding the information to a back-end system running Hadoop (Spark/Databricks), where we could recompute the entire set of expected vehicle trajectories for that segment of highway.
In other blog entries, I've shifted to a pitch for Derecho around this point, but this blog is getting long and perhaps I'll just wrap up. In fact, it isn't just Derecho that I've omitted: I haven't even touched on the need for specialized hardware (FPGA, GPU clusters and TPU clusters seem like the most promising technologies for really understanding speech and video at scale), privacy, security, or data consistency: all could be topics for future blogs. But those argue for a cloud model too. Overall, it does strike me as a very promising area for study. My one qualm, really, centers on the buzzword: fog computing isn't my favorite term; it sounds way too much like marketing drivel, and we've all heard a lot of that sort of thing. What was wrong with plain old IoT? Or "smart edge"?
Internet of Things is going to a big deal, and this suggests that as a research topic, fog computing deserves close scrutiny. Today's most interest question is more of a meta-question: figuring out which system elements should play which roles (once this question is resolved, a series of more technical follow-on questions would arise).
The question isn't really so new: At least since the 1980's, researchers have speculated about the challenges of computing systems that might reach very broadly into the physical world through a variety of sensing modalities (still and video imaging, radar and lidar and IR motion detectors, temperature and humidity sensors, microphones, etc), use machine-learned techniques to make sense of those inputs, and then perhaps take action. But the game changer relative to those early days is the contemporary appreciation of how cloud computing can drive costs down, and enable a new form of nimble startup -- the kind of company that builds a cool new technology and then can scale it to support millions of users almost overnight. Past versions of edge systems mired in issues of cost and suffered market failures: the users who might have benefitted didn't want to pay, and because the costs were genuinely steep, the technology simply didn't take off.
Today, we can at least identify a strong market pull. In any technology media publication you read about smart homes and office complexes and cities, smart highways and power grids, smart healthcare technologies. Clearly there is a wave of interest for this form of deeply integrated machine intelligence. Moreover, and this points to a social shift relative to the 1980's, the dominant tone isn't really a worry about privacy, although you do see some articles that fret about the risks (and they are quite real; we need to acknowledge and engage on that front). But the more dominant tone looks at upside, drawing analogies to our cell phones.
For example, I have an advisory role in a company called Caspar.ai. It was founded by Ashutosh Saxena, a friend who was a Cornell faculty member until he left to do the startup, and David Cheriton, who you may know of as the first outside investor in Google (he was a Stanford professor but also a very successful entrepreneur, and when Larry and Sergie knocked on his door with their idea and an early proof of concept, Dave jumped to help them get established). They view the apartment or condominium as the next platform, and Ashutosh actually gives talks in which he shows you the architecture diagram of an iPhone and then a nearly identical one for a condo in Santa Rosa. The Caspar.ai system is like the iPhone O/S and could host apps, and because Caspar works with the developer who built the entire development, the technology can orient itself: it is in such-and-such a room listening to the apartment owner giving instructions about music for the party tonight, etc.
The example highlights one of the puzzles we'll want to think about: Caspar has orientation because it is built right into the condominium or home. But most fog computing devices today are just small gadgets that individuals buy and install by hand. How would they know where they are, which way they are pointing, etc? And even if a very geeky technology person could configure such a thing, could her grandfather do it, or would he need to call his granddaughter to come and set the device up? Part of the fog computing puzzle is visible right in this example, and in the contrast with Caspar.ai: how will these systems orient themselves, and how will the devices be told what roles to play?
It isn't just about smart homes. One of the more exciting ideas I heard about most recently centers on smart agriculture: I attended a workshop on digital agriculture at Cornell a few weeks ago, and completely coincidentally, was invited to attend a second one on the concept of a smart soil "macroscope" at Chicago almost immediate afterward.
So how would the fog impact agriculture or dive into the soil? Researchers spoke about tracking produce from farm to table, literally step by step, and using that knowledge to reduce loss due to fresh produce sitting on the shelf for too long, to improve the efficiency of the produce supply chain, prevent accidental contamination by E-Coli or other bacteria, redirect shipments to match demand more closely, etc. A researcher at Microsoft showed that with a new kind of white-fi communications, drones could fly over fields and map out insect infestations in real-time, enabling the farmer to stamp out the pests with spot applications of insecticides, reducing unnecessary pesticides by a factor of 1000x. You could do the same with fertilizer, or when watering. One person talked about underground WiFi: it turns out to work surprisingly well, if you have enough power! Who would have imagined an underground WiFi network? But if the need ever becomes real enough, it can be done! The one caveat is that they need fairly well-drained soil; pooled water can block the signals.
Who needs this? I found one answer out in Napa. I happen to love great wines, and I'm friendly with some growers who own or manage insanely expensive vineyards. They would love to be able to visualize and track the subsurface biome, the movement of nutrients and water, and the conversion of surface materials into soil. This might help a grower identify particularly promising spots to place the next great winery. Of course, they are also quick to point out that no technology is a complete answer to any question, and that going from data to "useful insights" is quite a complicated matter. But in a world of constant climatic change, they are keenly interested in knowing what is going on down there. In fact I'm thinking I should start a little company to work on this topic, if for no other reason than as an excuse to visit and taste some of those wines! A lot of them are way to expensive for me to actually buy and drink on a routine basis.
Getting technical again: what questions can we identify from this set of examples, and how do they shape the likely form a fog computing system might take?
Part of the puzzle centers on the limitations of sensing devices. Devices are gaining in potential compute power, but you need to ask whether computing on the device itself is a smart move, given that more and more sensing devices are designed to operate on batteries, or with minimal power draw. Computing at the edge isn't a very power-efficient model, and relaying data back to a data center has overwhelmingly dominated when you look at actual deployed IoT products.
In fact there is much to be said for viewing sensors as dumb devices that might store a few hours or days of data, but don't compute very much. First, if you want to understand an image or a spoken command, the size of database you would use to do that is huge -- deep neural networks and Bayesian networks generate models that can be terabytes or even petabytes in size when used for tasks of this kind. Keeping the neural network models and precomputed data back in your local cloud where they can be shared among a number of users is far more cost-effective than shipping those petabytes to the devices, and then needing to keep those updated as the runtime conditions and goals evolve.
The proper way to process data might also depend on things the sensor is unlikely to have access to, such as the best estimate of its location and orientation, knowledge of which people are in the home or office, context associated with their prior commands to the system that were given in a different location, and captured by some other device. As we saw, while Caspar.ai might actually have this kind of orientation at hand, most devices lack that sort of context information (think of an Alexa camera/microphone/speaker that people shift around much like a flower vase: it isn't in the same place from day to day, and that camera could easily end up pointing at a wall, or a stack of books!) All of this might argue for a sensor model in which sensors capture everything in the vicinity, store a copy locally, but then just blindly relay the acquired data to the cloud. The sensor could still do some very basic stuff: for example, perhaps it can figure out that absolutely nothing is happening at all, and skip the upload in that case, or upload a tiny marker saying "no change." This really limited form of local computing is something that even very simple, disoriented devices can perform.
However, arguing in the other direction, there are sensing options that only make sense if deployed at the edge. For example, you can't easily correct for focus on vibration of a video after capturing it, so that form of dynamic adjustment should be performed right on the camera. A subsurface sensor used to track humidity in the soil may need to dynamically vary the way it operates its sensing components, because the best options for measuring moisture vary enormously depending on the depth of the water table, how far from fully saturated the soil is, etc. So for cases like these, a dumb sensor might end up generating endless streams of low-quality data that can't be patched up later.
Broadly, I think we'll need to do both, but that the sensors will be used mostly in pretty dumb ways (like to hold video, and to discard empty content), but then will relay most of the potentially interesting stuff back to the cloud.
So this starts to answer the meta question. Given this model, we can see what the technical need might be: the model argues that we should create a new technology base focused on cloud-hosted data concentrators that are integrated deeply into cloud storage systems: I'm fond of the term "smart memory" for this functionality. A single instance of a concentrator, on some single mid-range compute server within the cloud, might handle some large but not unbounded number of sensors: perhaps, 10,000 smart homes in some community, or 100 video cameras. If you need more capacity, you would just spread your incoming data streams over more data concentrators.
Notice that I'm not working within a standard 3-tier cloud model in this example. A standard cloud has a first tier that generates web content, often using cached data and other second-tier services. The third tier covers everything at the back end. A concentrator is an example of a new kind of first-tier: one that is stateful and smart, perhaps with real-time guarantees and consistency promises. This is not today's most common cloud model -- although it is close enough to it that today's cloud could definitely evolve to fit this picture, and in fact it might not even be a major reach to pull it off!
Within the data concentrator we would have a machine-learning model, dynamically updated and accurate, that could be used to immediately "understand" the data. Thus if a person in an apartment utters a remark that only makes sense in context, we could create a dynamic machine-learned utterance model that is accurate to the second and expresses the system knowledge of recent past; even if the speaker is moving from room to room, that model would evolve to reflect the system understanding of his or her request. For example, "Caspar, can you adjust the shade to get rid of that glare?" can be understood only by a system that knows the position of the sun, the locations of the windows and shades and the TV, and the options for adjusting that kind of window shade, but with that data, it can be done -- and that data would most likely live in a cloud-style concentrator or a smart-home "brain unit" if we put the concentrator right in the home (appealing as a response to privacy worries). Tell Alexa or Siri to do this, and because those technologies are kind of a free-standing autonomous edge, the best you can hope for is a response like "I'm sorry, Ken, I don't know how to do that."
The other argument for cloud models leads to a data storage and update insight. In particular, it isn't just the massive databases used for vision and speech understanding that would probably need to live on the cloud. There is also a question of the smaller knowledge models used to make sense of edge events, and to adapt as they occur.
A smart highway might have an evolving understanding of the situation on such-and-such a segment of the freeway, and a smart farming system might build up a model of the insect infestation in a field, adapting the drone's flight plan to focus on areas that are at highest risk, while spending less time scanning areas that seem to be unaffected by the bugs.
The argument for smart storage would simply be that as we capture and make sense of these data streams, we're in a unique position to decide what to keep and what to discard, which data to route to back-end systems for further evaluation using offline techniques, etc. The back-end systems would view the entire smart memory as a big storage cluster containing read-only files, reflecting the knowledge acquired by the smart analytic layer, and indexed by time. Of course they could write files too, for example to update parameters of the knowledge model in use on the front end.
As an example, if a smart highway were to observe that some car is a few cm to the side relative to predictions, the system would probably just tweak the model parameters at the edge. But if a car changes lanes unexpectedly, that would be a big event, and might be better handled by forwarding the information to a back-end system running Hadoop (Spark/Databricks), where we could recompute the entire set of expected vehicle trajectories for that segment of highway.
In other blog entries, I've shifted to a pitch for Derecho around this point, but this blog is getting long and perhaps I'll just wrap up. In fact, it isn't just Derecho that I've omitted: I haven't even touched on the need for specialized hardware (FPGA, GPU clusters and TPU clusters seem like the most promising technologies for really understanding speech and video at scale), privacy, security, or data consistency: all could be topics for future blogs. But those argue for a cloud model too. Overall, it does strike me as a very promising area for study. My one qualm, really, centers on the buzzword: fog computing isn't my favorite term; it sounds way too much like marketing drivel, and we've all heard a lot of that sort of thing. What was wrong with plain old IoT? Or "smart edge"?
Sunday, 11 June 2017
Moving AI to the edge
In today's data centers, a dominant paradigm shapes machine learning and AI systems: massive amounts of data are collected, cleaned, and stored into some form of database or collection of files. Then machine learning tools are used to train a model on the observed data, and finally the resulting model is used for a while in the edge application. All of this takes time, so the edge applications operate using stale data, at least to some degree.
In online AI/Ml systems, like smart highways controlling smart cars, smart homes, or the smart power grid, a pervasive need for instant responsiveness based on the most current data is a distinguishing characteristic: today's standard cloud systems can definitely react to new events extremely rapidly (100ms or less is the usual goal), but because the edge runs on cached data -- in this situation, cached models -- and these platforms can't update their models promptly, they will continue to use a stale model long after something fundamental has changed, invalidating it.
So why would we care about stale models? The term model, as used by the ML community, refers to any concise representation of knowledge. For example, on a highway, knowledge of a particular truck's behavior (its apparent route, history of speeds and lane changes, perhaps any observations of risks such as a tire that could be shredding, or a piece of cargo that might not be properly tied down) are all part of the model. In a continuous learning setting, the model shapes behavior for all the smart cars in the vicinity. In a smart power grid, the model is our estimate of the state of the grid; if the grid starts to show an oscillatory imbalance or signs of a shortage of power, the model can evolve in milliseconds, and the grid control algorithms need to adjust accordingly. Yesterday's model, or even the one from ten seconds ago, might not be acceptable.
What will it take to move AI to the edge?
In online AI/Ml systems, like smart highways controlling smart cars, smart homes, or the smart power grid, a pervasive need for instant responsiveness based on the most current data is a distinguishing characteristic: today's standard cloud systems can definitely react to new events extremely rapidly (100ms or less is the usual goal), but because the edge runs on cached data -- in this situation, cached models -- and these platforms can't update their models promptly, they will continue to use a stale model long after something fundamental has changed, invalidating it.
So why would we care about stale models? The term model, as used by the ML community, refers to any concise representation of knowledge. For example, on a highway, knowledge of a particular truck's behavior (its apparent route, history of speeds and lane changes, perhaps any observations of risks such as a tire that could be shredding, or a piece of cargo that might not be properly tied down) are all part of the model. In a continuous learning setting, the model shapes behavior for all the smart cars in the vicinity. In a smart power grid, the model is our estimate of the state of the grid; if the grid starts to show an oscillatory imbalance or signs of a shortage of power, the model can evolve in milliseconds, and the grid control algorithms need to adjust accordingly. Yesterday's model, or even the one from ten seconds ago, might not be acceptable.
What will it take to move AI to the edge?
- The AI/ML community will need to figure out what aspects of their problems really need to run on the edge, and are incorrectly situated on the standard backend today. Coding at the edge won't be the same as coding for the backend, so work will be required. This suggests that many applications will need to be split into online and offline aspects, with the online parts kept as slim as possible. The offline components will be easier to implement because they run in a more standard way.
- We need programming tools and platforms for edge-oriented AI/ML tools. I'm betting that Derecho can be the basis of such a solution, but I also think it will take a while to reach that point. We'll need to understand what edge-hosted AI/ML tools will actually look like: how will they represent, store, and access machine-learned models? How big are these models, and what data rates arise? Where are the low-latency paths, and how low does latency need to be?
- We may need to integrate hardware accelerators into the infrastructure: if a system does vision, it probably wants to use GPU accelerators for image segmentation, tagging and for operations such as rotation, alignment, debluring, 3-D scene reconstruction, etc. FPGA components offer a second rapid model, more focused on searching HTML text or other "byte stream" objects. FPGA accelerators are also useful for doing quick cryptographic operations. There could easily be other kinds of ASICs too: DFFT units, quantum thinkers, you name it.
- All of these pieces need to synchronize properly and be easy to program in a "correct" way...
I'm fascinated by this whole area. If it interests you too, send me a note: perhaps we can find ways to team up!
Sunday, 29 January 2017
In 2015, Russia hacked the Ukraine power grid. How we can protect our grid? (Part 3 of 3)
The first two of my postings on this topic looked at what happened in 2015/2016, and then asked whether a similar attack could be successful here, concluding that in fact there is little doubt that a limited but highly disruptive event would be feasible: limited, because of the innate diversity of technologies in use by the nation's 10 RTO and ISO control centers, and the 15 or so TOs that do bulk transmission, but disruptive even so because an attack successful against even just one of these could be tremendously harmful to the US economy, to national confidence in the power grid, and could even result in substantial loss of life and damage to equipment.
There are two broad ways to think about cybersecurity. One focuses on how good the procedures are that we use to install patches, monitor our systems, audit the logs later to catch previously unnoticed events, and so forth. The US sets a global standard in these respects: we treat power systems as nationally critical infrastructures, and are employing security policies that couldn't be better if these were sensitive military assets. Honestly, if there is a known cybersecurity protection concept, someone in the government regulatory agencies that oversee the grid has thought about applying it to the grid, and if the conclusion was that doing so would be beneficial, it has been done.
The problem is that Ukraine wasn't so terrible -- the cybersecurity posture of that country may not have been quite a sophisticated as ours, but it wasn't sloppy, not by a long shot. So we have a situation here where we are a little better than Ukraine, but shouldn't assume that a little better really represents absolute protection. Quite the contrary: the right conclusion is that this is a good posture, and reassuring, but not enough.
This leads to the second point of view: where cybersecurity threats are concerned, one must also accept that extremely large, complex computing systems are so fundamentally insecure, by their very nature, that security is just not achievable. In the case of the power grid, while we have long lists of the people authorized to access the systems in our control centers, one wouldn't want to assume that those lists aren't accessible to Russia or China, and that there isn't a single one of those people with a gambling issue or a serious financial problem that might make them vulnerable. We bring new hardware into these centers continuously: things like new printers, and new telephones, and new routers, and new advanced digital relays (this last is a reference to building-sized computer-operated systems that do power transformations from high to low tension, or from DC to AC and back, and are controlled by banks of built-in computers). My guess is that in a single day, a typical RTO deploys 1000 or more computing devices into their infrastructure. Would anyone in their right mind really be ready to bet that not one of those has a vulnerability?
So as a practical matter, one really could imagine the kinds of exploits seen in Ukraine, or similar ones, succeeding in the US.
We have to open our eyes to the serious possibility of waking up some morning with the power out, and with the SCADA systems needed to restore power so badly compromised that we can't trust them while restoring and operating the grid for the months that it might take to rip them all out and replace them! Worse, the news might well be reporting that a nuclear power control system has also been disabled, and that all the nuclear reactions made by such-and-such a vendor have been shut down worldwide, as a precautionary measure.
Fortunately, there really are steps we could take right now so that the morning this all happens, our situation would be stronger. As of today, the biggest worry I would express is simply that the morning after, we'll be blind as well as knocked down: knocked down in the sense that the grid would be out, but blind because we wouldn't trust our standard control solutions, or they might have been so badly damaged in a physical sense that we just can't restart them (like a car after someone dumps sugar into the gas tank: until you've cleaned the engine, you won't get it started even if you try really, really hard).
But this issue of blindness is one we can tackle. At Cornell my group has been working with the New England Independent Service Operator (ISO NE), the New York Power Authority (NYPA) and has had a great dialog with a number of other ISOs and RTOs and similar organizations. We've been prototyping systems that could offer a survivable monitoring and data mining capability that would be an option to which power operators might turn the morning of the day after.
Our GridCloud system is a hardened technology that uses ideas from secure cloud computing to create a powerful data collection and archiving framework. Right now GridCloud captures data mostly from what are called synchrophasor measurement units, or PMUs, but the plan is to also begin to track network models, SCADA system outputs (so-called EMS data), data from ADRs, etc. In fact there is a great deal of telemetry in the modern grid, and we really think one could stream all of it into such a system, and archive everything, cloud-style. It would be a big-data system, but the cloud teaches that big-data shouldn't scare us. In fact, GridCloud actually runs on today's commercial clouds: we support AWS from Amazon (in its virtually private cloud mode, of course), and are about to add Microsoft's Azure container environment as a second option, also in a secured mode of operation. You encrypt all the communication connections, send all the data in triplicate, and run the entire cloud system mirrored -- our software can handle this -- and voila.
Internally, GridCloud includes a self-management component called CM (we used to think of this as standing for CloudMake, because the solution mimics the Linux makefile model, but lately we are finding that CloudManage might be more evocative for users). CM keeps the GridCloud wired together, helping restart failed elements and telling each component which connections to restore.
Another component of GridCloud is our Freeze Frame File System, mentioned here previously. FFFS is exciting because it incorporates a very flexible and powerfile temporal data retrieval option, where you can pull up data from any time you like, with millisecond precision. The retrieved data looks like a snapshot of the file system, although in fact we materialize it only when needed and retain it only as long as applications are actively reading the files. These snapshots are very fast to extract, look just like normal file system contents, and are also tamper-proof: if Tom Cruise zip-lines into one of our systems and changes something, he won't get away undetected. FFFS will noticed instantly and will pinpoint the change he made.
Then we have tools for analysis of the data. A very useful one simply reconstructs the power system state from the captured data (this is called a linear state estimation problem), and we use a version developed by researchers at Washington State University for this purpose. Their solution could run at the scale of the entire country, in real-time, with delays from when data enters to when we visualize the output that can be as small as 100 to 200ms including network transmission latency.
Our current push is to add more analysis flexibility and power, in the form of simple ways of dynamically extracting data from the power system archives we create (for example, time-varying matrices or tensors that contain data sampled directly from the input we captured and stored into FFFS), and then allowing our users to define computations over these little data objects.
We have a dialog with Internet 2 to figure out ways to run on their networking technology even if the entire Internet itself was disabled (they have a special deal that lets them run on isolated network links and to use clusters of computers on military bases or in places like hospitals as their operating nodes). So we could get a minimal computing functionality running this way, firewall it against new attacks by the bad guys, and bootstrap GridCloud inside, all with very strong security.
The idea is that the morning after, rather than waking up blind, a GridCloud operator would have an option: to use GridCloud itself as a backup SCADA solution. The system experts could data mine to understand what the bad guys just did, and to inventory the damage and identify healthy aspects of the system. Maybe the exploit against the nuclear reactor left a recognizable signature in the power grid itself: if so, GridCloud would have seen it prior to the crash, and archived it. Moreover, since terrorists really do engage in repeated dry runs, maybe they tried out the same idea in the past: we can data mine to see when and how they did it, and perhaps even to figure out who within the ISO staff might have helped them. Plus, we can then look for evidence of similar dry runs at other nuclear plants -- finding them would validate keeping those plants offline, but not seeing signs of trouble could reassure the owners enough to restart the ones that haven't been compromised.
All in all, this kind of active response would give us a day-after capability that might get power back up and running far more quickly than without such a tool: maybe hours instead of days, or days instead of weeks. We would reduce the risk of the whole event escalating into a war, because politicians with more knowledge of the facts are less likely to act reflexively on the basis of incomplete data or theories, and are far less likely to be tricked into blaming the wrong parties.
Could our backup solution be compromised, too? Sure, but my belief is that each separate exploit that the attacker would need to successfully carry out diminishes the chance of a real success. Tom Cruise can zipline into one control room, use his magic knock-out gas to incapacitate a few guards, and maybe plant one of his team members in the group that services the control room computers too. But could he mount an exploit 20x more difficult, simply by virtue of needing to compromise more and more distinct systems, all watching one-another, all sensing divergences in view? I doubt it.
So while GridCloud may sound like just one more layer of monitoring tool, actually having one more layer may be exactly what the doctor ordered.
There are two broad ways to think about cybersecurity. One focuses on how good the procedures are that we use to install patches, monitor our systems, audit the logs later to catch previously unnoticed events, and so forth. The US sets a global standard in these respects: we treat power systems as nationally critical infrastructures, and are employing security policies that couldn't be better if these were sensitive military assets. Honestly, if there is a known cybersecurity protection concept, someone in the government regulatory agencies that oversee the grid has thought about applying it to the grid, and if the conclusion was that doing so would be beneficial, it has been done.
The problem is that Ukraine wasn't so terrible -- the cybersecurity posture of that country may not have been quite a sophisticated as ours, but it wasn't sloppy, not by a long shot. So we have a situation here where we are a little better than Ukraine, but shouldn't assume that a little better really represents absolute protection. Quite the contrary: the right conclusion is that this is a good posture, and reassuring, but not enough.
This leads to the second point of view: where cybersecurity threats are concerned, one must also accept that extremely large, complex computing systems are so fundamentally insecure, by their very nature, that security is just not achievable. In the case of the power grid, while we have long lists of the people authorized to access the systems in our control centers, one wouldn't want to assume that those lists aren't accessible to Russia or China, and that there isn't a single one of those people with a gambling issue or a serious financial problem that might make them vulnerable. We bring new hardware into these centers continuously: things like new printers, and new telephones, and new routers, and new advanced digital relays (this last is a reference to building-sized computer-operated systems that do power transformations from high to low tension, or from DC to AC and back, and are controlled by banks of built-in computers). My guess is that in a single day, a typical RTO deploys 1000 or more computing devices into their infrastructure. Would anyone in their right mind really be ready to bet that not one of those has a vulnerability?
So as a practical matter, one really could imagine the kinds of exploits seen in Ukraine, or similar ones, succeeding in the US.
We have to open our eyes to the serious possibility of waking up some morning with the power out, and with the SCADA systems needed to restore power so badly compromised that we can't trust them while restoring and operating the grid for the months that it might take to rip them all out and replace them! Worse, the news might well be reporting that a nuclear power control system has also been disabled, and that all the nuclear reactions made by such-and-such a vendor have been shut down worldwide, as a precautionary measure.
Fortunately, there really are steps we could take right now so that the morning this all happens, our situation would be stronger. As of today, the biggest worry I would express is simply that the morning after, we'll be blind as well as knocked down: knocked down in the sense that the grid would be out, but blind because we wouldn't trust our standard control solutions, or they might have been so badly damaged in a physical sense that we just can't restart them (like a car after someone dumps sugar into the gas tank: until you've cleaned the engine, you won't get it started even if you try really, really hard).
But this issue of blindness is one we can tackle. At Cornell my group has been working with the New England Independent Service Operator (ISO NE), the New York Power Authority (NYPA) and has had a great dialog with a number of other ISOs and RTOs and similar organizations. We've been prototyping systems that could offer a survivable monitoring and data mining capability that would be an option to which power operators might turn the morning of the day after.
Our GridCloud system is a hardened technology that uses ideas from secure cloud computing to create a powerful data collection and archiving framework. Right now GridCloud captures data mostly from what are called synchrophasor measurement units, or PMUs, but the plan is to also begin to track network models, SCADA system outputs (so-called EMS data), data from ADRs, etc. In fact there is a great deal of telemetry in the modern grid, and we really think one could stream all of it into such a system, and archive everything, cloud-style. It would be a big-data system, but the cloud teaches that big-data shouldn't scare us. In fact, GridCloud actually runs on today's commercial clouds: we support AWS from Amazon (in its virtually private cloud mode, of course), and are about to add Microsoft's Azure container environment as a second option, also in a secured mode of operation. You encrypt all the communication connections, send all the data in triplicate, and run the entire cloud system mirrored -- our software can handle this -- and voila.
Internally, GridCloud includes a self-management component called CM (we used to think of this as standing for CloudMake, because the solution mimics the Linux makefile model, but lately we are finding that CloudManage might be more evocative for users). CM keeps the GridCloud wired together, helping restart failed elements and telling each component which connections to restore.
Another component of GridCloud is our Freeze Frame File System, mentioned here previously. FFFS is exciting because it incorporates a very flexible and powerfile temporal data retrieval option, where you can pull up data from any time you like, with millisecond precision. The retrieved data looks like a snapshot of the file system, although in fact we materialize it only when needed and retain it only as long as applications are actively reading the files. These snapshots are very fast to extract, look just like normal file system contents, and are also tamper-proof: if Tom Cruise zip-lines into one of our systems and changes something, he won't get away undetected. FFFS will noticed instantly and will pinpoint the change he made.
Then we have tools for analysis of the data. A very useful one simply reconstructs the power system state from the captured data (this is called a linear state estimation problem), and we use a version developed by researchers at Washington State University for this purpose. Their solution could run at the scale of the entire country, in real-time, with delays from when data enters to when we visualize the output that can be as small as 100 to 200ms including network transmission latency.
Our current push is to add more analysis flexibility and power, in the form of simple ways of dynamically extracting data from the power system archives we create (for example, time-varying matrices or tensors that contain data sampled directly from the input we captured and stored into FFFS), and then allowing our users to define computations over these little data objects.
We have a dialog with Internet 2 to figure out ways to run on their networking technology even if the entire Internet itself was disabled (they have a special deal that lets them run on isolated network links and to use clusters of computers on military bases or in places like hospitals as their operating nodes). So we could get a minimal computing functionality running this way, firewall it against new attacks by the bad guys, and bootstrap GridCloud inside, all with very strong security.
The idea is that the morning after, rather than waking up blind, a GridCloud operator would have an option: to use GridCloud itself as a backup SCADA solution. The system experts could data mine to understand what the bad guys just did, and to inventory the damage and identify healthy aspects of the system. Maybe the exploit against the nuclear reactor left a recognizable signature in the power grid itself: if so, GridCloud would have seen it prior to the crash, and archived it. Moreover, since terrorists really do engage in repeated dry runs, maybe they tried out the same idea in the past: we can data mine to see when and how they did it, and perhaps even to figure out who within the ISO staff might have helped them. Plus, we can then look for evidence of similar dry runs at other nuclear plants -- finding them would validate keeping those plants offline, but not seeing signs of trouble could reassure the owners enough to restart the ones that haven't been compromised.
All in all, this kind of active response would give us a day-after capability that might get power back up and running far more quickly than without such a tool: maybe hours instead of days, or days instead of weeks. We would reduce the risk of the whole event escalating into a war, because politicians with more knowledge of the facts are less likely to act reflexively on the basis of incomplete data or theories, and are far less likely to be tricked into blaming the wrong parties.
Could our backup solution be compromised, too? Sure, but my belief is that each separate exploit that the attacker would need to successfully carry out diminishes the chance of a real success. Tom Cruise can zipline into one control room, use his magic knock-out gas to incapacitate a few guards, and maybe plant one of his team members in the group that services the control room computers too. But could he mount an exploit 20x more difficult, simply by virtue of needing to compromise more and more distinct systems, all watching one-another, all sensing divergences in view? I doubt it.
So while GridCloud may sound like just one more layer of monitoring tool, actually having one more layer may be exactly what the doctor ordered.
Friday, 27 January 2017
In 2015, Russia hacked the Ukraine power grid. How big is the risk here? (Part 2 of 3)
If you've read part 1, hopefully I've convinced you that we do face a genuine risk.
But suppose someone set out to attack us. How
damaging could an attack really be?
Let's
imagine that an attacker invests the needed resources (and let's not fool
ourselves: the country that attacked Ukraine must have been Russia, but Russia
isn't the only country able to prepare and carry off such exploits: at a
minimum, China can too, and North Korea may have found ways to hire the needed
expertise on the black market. So there are at least three possible
nation-state actors to consider. Beyond that, there is probably at least one and perhaps more than one free-lance group out there with very high skill sets, working for organized criminals who use their skills for theft, blackmail and so forth. And then there are friendly countries with deep hacking skills, like the UK, the rest of Europe, Israel. So there are a bunch of potential bad actors.
For the sake of argument, let's not rehash part 1: assume that some bad actor has already done his homework. So Russia, or China, or whatever has penetrated,
perhaps, a handful of US RTO and ISO organizations. How much harm would they be able to do, if they were inclined to attack
With
control over a SCADA system, there are a few styles of attack that become
feasible. First and easiest is to just disable the SCADA control system itself.
With modern computers, if you reformat the disks and reflash the PROMs
used for booting, you can render the machine pretty much useless, at least
without a lot of hassle. You can also cause some nasty crashes simultaneous with a blackout, and toss in additional barriers to block restarts, even using clean computers: In Ukraine, the uninterruptible power supplies that were supposed to guarantee power for the grid operations center were hacked too: not only did they not supply clean power, but they were reprogrammed to actually cause power
surges rather than to protect against them. So that's easy. Given
years during which the attack was being planned, you could probably also
compromise backup systems and hide some backdoor options, so that even after
being discovered, there might be a way back in.
This alone is probably enough to cause a week or two of total chaos, similar to what Ukraine experienced right after the attack. They ended up cobbling together a power grid and running it with purely human operations for a while.
But in fact you could do far more.
Having broken in, you don't necessarily have to start by destroying the SCADA system. Another option is to subvert the SCADA system to attack some of the technology components
used in the grid itself. A power grid has all sorts of elements:
switching stations of the kind usually stuck in obscure locations out in the
woods, dams and coal burning generators and nuclear reactors, wind farms, etc.
Some of these could be damaged by power surges, and others would probably be vulnerable to bizarre and incorrect control commands. In fact, one thing you could take advantage of is that because SCADA systems
are presumed to be secure, they usually have special direct ways to communicate into the
control centers that operate such components.
So you could explore ways
of logging into the control center for a nuclear reactor and messing with its protections against core meltdown, or maybe look into
the possibility of opening drainage in a series of dams in succession to
generate a massive downstream flood. Perhaps you could trick wind turbines into tearing themselves apart by deliberately configuring the wind-vanes to put them under as much stress as possible.
Now we have to start to imagine an attack that could destabilize nuclear plants, flood entire cities, and leave wind farms in shreds: attacks with very real physical consequences! And that kind of damage could take months to repair, or even years.
Of course, such attacks wouldn't be so easy to prepare: installing and debugging the exploit becomes the hardest step. No way that you could do this to 10 RTO/ISO control systems simultaneously, and to their associated TOs, and to a large number of nuclear plants and dams and wind farms. And keep in mind: a nuclear plant control room may accept requests (to increase or cut power production) from the local RTO, but this isn't the same, at all, as being wide-open to massive intrusion through the connection used to send those commands. By and large, you'll be blocked at every step by firewalls, multi-factor authentication requirements, monitoring systems of varying levels of sophistication, you name it. Try to deploy an intrusion capable of doing damage at the scale of the whole US and you'll be detected long before you can launch the attack.
But maybe you could set a smaller goal and succeed.
With
years to prepare, and unlimited national backing, my guess is that a really professional team would
overcome the barriers at least in some settings. In Ukraine, an attack focused mostly on SCADA compromise was already enough wreak utter havoc: their system was down for weeks. One
might assume that in the US the impact would be more limited and shorter, but
my guess is exactly the converse: I think that a cleverly planned exploit could
be far more harmful here, even if pretty narrow in scope, simply because we depend so strongly on
electrically powered technologies. Moreover, you could take advantage of our tendency to panic: in the US, we tend to overreact in extreme ways
to certain types of fears.
For
example, suppose that one icy cold winter morning we awoke with the power out
for the northern 20% of the US: just a mundane blackout, but even so, lots of houses would suddenly feel very cold. Worse, suppose that as the government was taking stock of the situation, several large hydroelectric
generators suddenly malfunction in ways that indicated serious damage: perhaps, two massive transformers took
irreparable hits and will take a year or more to replace. And then suddenly in comes a report that a nuclear reactor
control system may have been compromised too: a particular reactor shut down into a
fail-safe mode, and every nuclear reactor from that same vendor in the whole US
has been taken offline too, as a precautionary measure, expanding our regional problem into a massive nation-wide power shortage. And just to enliven things, perhaps a few other mishaps occur at the same time: A jet landing at JFK collided with a
plane on the runway, killing 500 passengers. Two more near-miss
events of the same kind have been reported at Denver and Atlanta airports, and nationwide
air traffic control is also shutting down. A train carrying toxic chemicals has derailed in downtown Atlanta. A huge explosion has been reported in the new Keystone oil pipeline, and it has shut down. Things like that.
Well, we know what would very likely happen next.
But let's not even go there. Instead, in part 3, I'll offer some thoughts on how to make things better.
In 2015, Russia hacked the Ukraine power grid. Are we next? (Part 1 of 3)
In a widely publicized episode, the electric power grid
in Ukraine was attacked during late 2015 and 2016, using computer viruses that
destabilized the supervisory control and data acquisition (SCADA) system. Experts are about as certain as one can be that the Russian government was behind the episode.
Could this occur in the United States, and if
so, what could we do about it? If it happens, should we assume that the attack originated in Russia, like the Ukrainian event?
To answer such a question, we really need to break it down. Here, I'll start with the basics: what do we really know about the Ukraine attack? My sources, though, are unclassified (in fact there is one Wired article that had such detail that I'm tending to trust it heavily). I mention this because we do live in an era of fake news, and there could be a deeper layer of insights, not be available to me. For a question of national aggression -- literally an act of war by one country against another -- one needs to go deep and not trust the superficial!
But I'm just a regular guy without a clearance, and if I knocked on doors at the CIA and NSA, I wouldn't get very far. Here's what I've learned from public materials.
First, in the wake of the event there were a series of very reputable groups that flew to Ukraine and participated in really careful studies of the precise
modality of the attack. The can be little doubt that the attack was extremely sophisticated and carefully planned, that Ukraine was not some sort of banana republic with an incompetent management of its national grid (it turns out that Ukraine was highly professional and pretty close to the state of the art). From this, we'll have little choice but to acknowledge that the US grid is probably vulnerable, too.
Ukraine built its grid during a period when it was fairly wealthy, and was in a position to buy cutting edge technologies. The system was a relatively standard high-quality SCADA solution, obtained from the same vendors who sell
such systems here in the US. Moreover, the country knew of the threat from outside, and managed its system quite
professionally, using a "military" security standard. However, Ukraine wasn't the most paranoid you could imagine. In particular, it did allow operators to use computers attached to its network to receive
email with links and attachments, and they could access Internet web sites from their
office computers.
Apparently, this was
the first portal the attackers leveraged: they sent some form of normal looking
work-related email, but it lured operators to a poisoned web site, which
downloaded a virus that connected back to the attacker control system. The trick being: the web site did whatever it was nominally supposed to do, so the operators never realized they had been compromised.
For example, think of the first time you visited the real-time market feed data site provided by your bank or retirement fund: you probably agreed to install some form of web browser plug-in to see the animated graphs of market activity. The first step of the Ukraine attack was a bit like that, but that plug-in (in addition to doing what it promised), did a bit more.
Before assuming that this first step already rules out such an attack in the US, and that this could never happen here, one has to
pause and realize that many of us receive emails from the HR organizations of
our employers that require clicking links. Many of us work for companies that use plug-ins to offer all sorts of functionality through browser extensions. In fact, I work for such a company: Cornell University does this too. If you were familiar with Cornell's web page layouts and logos, and knew how to compose a professional looking email with the right content, even a security-conscious person like me might follow the link without much thought.
The core insight is that because of the so-so state of security on our computer operating systems, web browsers and other technologies, even normal news
sites and other mundane web sites can potentially be a launch-point for
attacks. So this first step of the Ukraine attack could be
successful in the US too, today. In fact I know of very similar events that led to intrusions right into top-secret DoD systems and ones used within the White House, and that's without even having access to the classified version of the picture. This definitely could happen in the US, even in highly sensitive systems.
Ok, but in fact, Ukraine's office computers weren't
actually connected to the SCADA systems.
In fact the vast majority of the state-operated power grid company employees had mundane jobs, like taking new
orders, billing, scheduling repair crews.
Breaking into their computers wouldn't lead anywhere. So what happened
next?
The initial exploit gave the attackers a toehold: it left them with hooks they could use to (in effect) log into a few computers, inside the Ukraine power grid operations center, but not ones concerned with actual power grid operations. Those systems were much better protected. So, our hackers needed to break through a second firewall.
As I understand it, this required finding
systems used by operators who actually had permissions to log into the SCADA
network. Apparently, the Ukraine system masked the roles of the computers, and figuring this out wasn't simple and took months. Nonetheless, step by step, the
intruders managed to identify several such systems.
In their next step, it seems that the hackers used so-called root kits to
attack these computers from inside the Ukraine power system corporate network. A root kit is a package of software, collected by hackers over decades, that takes advantage of subtle software bugs to sneak into a computer and grant the attacker superuser control, unnoticed by the owner of the machine. There are a surprisingly large number of such systems -- you can download dozens from the web. And then beyond that are specialized ones created by national intelligence services: they often use vulnerabilities that their designers discovered, and that nobody else was even aware of.
Software has bugs, and older software systems are worst of all. Don't fool yourself: any system you can buy or use today has vulnerabilities. Some are child's play to break into, and some are much more resilient, but none is foolproof.
So, our intruders laid low, figured out which machines to attack, and then finally after months of effort, managed to compromise a machine with VPN access to the SCADA platform. But VPN software expects passwords and often more: two-factor systems that use RDA keychain dongles, fingerprints, special cards -- all such things are common. I take it that Ukraine was using such a system.
To circumvent those issues, the trick is to modify the operating system itself, so that the next time a legitimate operator logs into the VPN, you can ride along with him or her, sneaking in for a little while and then ultimately, if luck is on your side, to leave a subtle open doorway, perhaps in the form of a legitimate-looking data feed that actually is carrying your covert traffic.
So, after waiting for someone to activate
the VPN from that machine, our attackers eventually managed to leapfrog into the secured
environment, at some instant when the VPN connection was open. Moreover, once in, even more steps were
needed to actually penetrate and ultimately, incapacitate the SCADA platform,
and those had to occur without site security systems noticing the intrusion. They apparently had further layers of passwords to crack (here, access to a supercomputer can be helpful), and all of this had to occur without tripping the monitoring systems.
So who was behind this? President Trump talks often about the 300lb pimply kid sitting in his bedroom. Was it him?
Notice that the first steps required fluency
in written Ukranian, and detailed knowledge of HR emails and other corporate
emails within the organization.
Subsequent steps required knowing the software systems and versions and
their vulnerabilities, and there may even have been a step at which a
supercomputer was used to break a password by brute force. Step by step, one would have to understand what monitoring tools were in use and how to avoid detection by it. Military-quality root kits aren't so easy to come by.
The bottom line? It is unquestionable that Russia was behind this attack. And Russia happened to benefit from it too, enormously. They had the means, the motive, and the timing coincided with a major flare-up in military tensions between Russia and Ukraine over Crimea, which Russia had just annexed.
The imaginary fat kid could never have managed this. What we see here is how very sophisticated exploit that
took years to prepare was carried out very slowly and deliberately. Without getting even more detailed, investigators were able to show that the intruders had debugged the exploit over an extended period, using all
sorts of pre-exploit testing and trial runs of aspects of the ultimate
attack. Even attack software needs to be debugged!
Ukraine was victim of a
genuinely sophisticated team of expert attackers, backed by a country or
organization with massive national resources, and the patience to chip away at
the system for literally years, entirely undetected. And that country was Russia.
The US media has tended to portray Ukraine as a backwoods
country that set itself up for trouble, but as I read the story, that
interpretation is totally invalid. Most
of what I've described definitely could occur in the US. Our power grid operators may have plugged the specific holes that have now been identified in the products deployed in Ukraine, and may be better at
monitoring the system and applying patches, but honestly, I wouldn't bet too
heavily on that sort of thing.
I once was invited to an unclassified NSA briefing in which the question of breaking into systems came up. Their expert said that well, he couldn't get specific, but that honestly, it was impossible to build a system today that his people couldn't break into. He said that modern computers have millions of lines of code, not to mention devices of many kinds that themselves include computers (routers, printers, even network interface cards). NSA had made a science out of finding back doors in.
He said that we should imagine a little village where the houses all had bowls of jewels on the main dining room table. And all the doors and windows are wide open. Even if they weren't, most of the windows have no latches and the doors have locks that share a single key. And even if you fixed the doors and windows, the walls themselves are made of plywood screwed into wood beams, and with a screwdriver and a few minutes, you could make a new door just for yourself. To say nothing of using a ladder to try breaking in upstairs, where the air conditioners turn out to not actually be attached and can just be pushed out of their slots.
What the US NSA can do, the Russian intelligence service can do as well. Plus, they have tons of people who are fluent in Ukrainian human resources memo-writing.
So could the same thing happen to us? Sure, without question.
Oddly, our main strength isn't that we operate our
systems better or that we monitor them better. We don't, and it isn't for lack of trying: these kinds of systems can't be defended against that sort of attack.
Our real advantage (a small one) is that to compromise our entire national grid, all at once, you
would need to pull off at least 10 and perhaps more like 25 Ukraine-style
attacks, because there are roughly 10 large scale regional transmission
operators and independent system operators (RTOs and ISOs), and they work with
an additional smaller 15 or so transmission operating entities. Each makes its own technical choices,
although there are some popular technologies that are near monopolies in their
particular roles. Thus what worked in
Ukraine probably could work here, but might "only" knock out some
subset of the overall national grid.
(But this is plenty for one blog entry, so lets pause for a quick coffee and then we can resume...)
Subscribe to:
Posts (Atom)