cosc 4p14
play

COSC 4P14 What else could we discuss? Brock University Brock - PowerPoint PPT Presentation

COSC 4P14 What else could we discuss? Brock University Brock University What else could we discuss? 1 / 28 Theres so much more out there! No matter how much time we spent here, we could never hope to cover every notable networked


  1. COSC 4P14 What else could we discuss? Brock University Brock University What else could we discuss? 1 / 28

  2. There’s so much more out there! No matter how much time we spent here, we could never hope to cover every notable networked technology. However, there’s a small selection of topics that didn’t quite fit into any of the other lectures, that are nevertheless useful to know about, as they can be the lynchpins to broader fields. In particular, let’s discuss things related to integrating the flow of information with meatspace, to spooky information from a distance, and finish up by playing dressup and diving into scary caves. Or, you know, something like that. Brock University What else could we discuss? 2 / 28

  3. The Internet of Things! (Does that not sound like something a 3-year old would make up?) You’ve probably been hearing about the Internet of Things (IoT) quite a bit lately. And, the IoT is... what? Arguably, in a sense, it doesn’t exactly exist. Or, that is, it isn’t a single specific thing Rather, it’s the byproduct of a slowly-growing trend to add internet-connectivity to everything in our lives. Consider some examples that predate the term, but would still have to count: IP cameras for security Weather-forecasting toasters Smart meters for utilities (and, of course, several others) Brock University What else could we discuss? 3 / 28

  4. The Internet of Things! So, that means... ? So then, what is the Internet of Things? There are several possible definitions, but let’s go with: What you get when you use wireless communications, inexpensive sensors, low-power microcontrollers, and often machine learning and batteries, to gather information on, and often make changes to, some environment Of course, there’s obviously great overlap with cloud computing, big data, etc. Brock University What else could we discuss? 4 / 28

  5. The Internet of Things! Perhaps an example? Let’s look at a possible day in a connected world. You wake up, and your coffee is already ready, because you always get up at the same time Mondays It’s sunny today, so the smart glass in your window has frosted You haven’t been downstairs in quite a while, so the climate control has eased off there for efficiency Once you leave the property, your house automatically locks itself While you’re at work, a neighbour’s kid throws a football onto your roof. You’re notified and check in to verify all’s good The home’s empty, so the roomba vacuums; climate control turns off After work, your car takes you out for pizza As you start heading home, your home starts up the heating/cooling again. It’s comfortable by the time you arrive Of course, the lights turn on automatically In the evening, the lights change to warmer tones, to trick your brain into relaxing and helping you get to sleep Brock University What else could we discuss? 5 / 28

  6. The Internet of Things! ...seriously? Of course, the totality of that isn’t really common , but there’s nothing on that list any of you couldn’t do. And even then, that’s a very minimal example. Through better collection of (and processing on) even more data, you can accomplish some pretty nifty things. Where’s there currently space for parking in the area? What route should I take to Brock, considering traffic? What’s a good outdoor activity, considering current UV, allergen, and air pollution readings across the region? Can my phone remind me to grab my umbrella before I go to work, based on the weather forecast? Okay, so this is still just scratching the surface. I haven’t even touched on things like inventory-tracking; targeted sales; anything medical; or even voice control over your television, lights, music, etc. Brock University What else could we discuss? 6 / 28

  7. The Internet of Things! Practical concerns Okay, so what do we need? Power ◮ Some devices are fixed installations (e.g. lighting) ◮ Others need batteries, which means either charging or long-life ◮ When on batteries, it’s common to go into a low-power state (sleep) Computational power ◮ A low-power microcontroller might lack the ability to crunch data, or control other devices. Often sensors can connect to servers to do the “heavy lifting” ◮ Also consider collecting and assembling data Getting connectivity to each device that needs it ◮ Do a dozen climate sensors in a home need a dozen IP addresses? Do you need to access each of those from your phone directly? ◮ Remember personal area networks from earlier in the course: low-power trivial wireless communications protocols (e.g. Zigbee) ⋆ Consider several devices with short-range chatter, and one IP master Brock University What else could we discuss? 7 / 28

  8. Internet of Things! So, how can one do it? Suppose your phone lets your home know to get cozy before you arrive. Option 1: Your thermostat checks in with the smart home server, to see if there are any changes in the needs And then it does again. And then again. And again. And again... Your phone tells the server to get comfy The thermostat finds out on a query, and then needs to keep asking if it’s comfy enough When it’s finally adequately comfy, it resumes asking if there are any changes. And again, and... Keep in mind, if you’re going for RESTful HTTP, each of these also requires the setup and teardown of a TCP session. Brock University What else could we discuss? 8 / 28

  9. Internet of Things! That was bad... what’s the alternative? Option 2, using, say, Message Queue Telemetry Transport (MQTT, a lightweight messaging platform, based on the publish-subscribe model): Establish a TCP connection to server, and leave it open Upon receipt of the phone’s notice, send a short message to the thermostat Maybe also push a notification to phone, to let user know home is comfortizing For each climate reading, send a short message When server receives optimal temperature, tell thermostat to stop Connection stays open until an event triggers further change (Of course, this probably isn’t how you’d really handle climate control; it’s just a hypothetical) Brock University What else could we discuss? 9 / 28

  10. Internet of Things! Don’t read too much into that example Naturally, there are other options, like going to sleep and occasionally waking up, establishing a connection, and checking in. The point was to see some of the design goals: Send as few bytes as possible Save power when possible Only communicate when you actually expect there to be something to say If you wanted to expand the example, say to include multiple climate sensors, not much would change: Most likely, each climate sensor would spend most of its time in rest mode, and occasionally wake up to send new readings to a central smart home server Other devices (e.g. phone) would send requests to said server, which would then make use of the data it’s been receiving If desired, data can be forwarded along to another server for inferring new rules for future climate decisions Brock University What else could we discuss? 10 / 28

  11. Internet of Things! Concerns There are a few things worth noting, before jumping straight into this stuff: Oftentimes, a simple solution is adequate ◮ If your ISP going down means you freeze to death, that’s a bad system How much data is being collected? Who owns it? ◮ Chances are, you probably won’t roll your own complete smart home, smart car, mood-lighting, and coffee-making solution, so your data will likely be sent to external servers ◮ One of the biggest concerns of Big Data is that there’s little transparency in terms of just how much information is being collected Security relies on plugging holes and controlling points of communication through gateways ◮ The IoT relies on continuously sending unprecedented volumes of sensitive data through multiple channels, likely to multiple targets ◮ Can ya see where the conflict might arise? Open vs proprietary standards ◮ Early attempts to build on smart home and smart bulbs were crushed pretty quickly by manufacturers who disagreed on who “owns” what Brock University What else could we discuss? 11 / 28

  12. APIs and Authorization While we’re on the subject of retrieving data from servers, remember that NASA task from your first assignment? Suppose you made an application that used your API key. How hard would it be for someone else to yoink it? ◮ Remember that it was right in the URL For some services, there’s an easy solution: when generating an API key, you can also dictate additional restrictions on the key, such as allowable IP addresses, referrer URLs, etc. But how would you handle accessing an API on behalf of a user? Brock University What else could we discuss? 12 / 28

  13. Authentication vs Authorization You’ve surely seen examples of websites that say things like, Log in with your Google Account! , or Facebook, etc. You might have used services that could retrieve your information, or even perform actions as you . And, clearly, you directly told those sites/services your logins and passwords, right? No? That would be stupid? Then how the heck do they work?!? First, even though this looks like authentication , it’s closer to being authorization Brock University What else could we discuss? 13 / 28

Recommend


More recommend