Internet of Things - Linux Usergroup Nijmegen

Embed Size (px)

Citation preview

by Peter Martin
www.db8.nl / @pe7er

Linux Nijmegen

I am Peter Martin from Nijmegen in The Netherlands.

Networking

InternetTCP/IP

OSI

Internet of peopleEmail, WWW

Web 1.0 / v2

Devices

Webservices

Internet of Things (IoT)

Internet of things

My Internet of things

The sandwich

In the next 45 minutes I hope to teach you something about IT. btw: does everybody know what IT means?

IT = Information Technology. And is an integral part of our daily life. Nowadays everybody has at least a couple of computers: a PC, a smart phone, a tablet PC, a car navigation, a modern television.

In this presentation I will start to explain what a Computer is, then I will work my way through different IT subjects and will end this journey with what Joomla is.

My goal of this presentation is not to be 100% accurate. What I hope to accomplish is that in the future youll think about simple daily life concepts when you hear about technical IT terms.

1. Networking

Why Networking?Sharing....

computer power (mainframe)
equipment (printer, storage)
information (documents)

The first and most primitive kind of network is...

Sharing

Computer powerMainframe + Terminals

EquipmentPrinter

Storage

InformationDocuments

Sneakernet

Sneakernet is a sort of network that works by transporting data on removable media.

Anyone know why it's called Sneakernet?

You have to walk a lot from one computer to the other, so you'd better wear sneaker shoes.

Networking

Instead of removable media, you can use a cable to connect one computer with the other.

If you connect more then three, then you'll see the problem.

Every computer has to be connected to the other ones, because if it's not the case and one computer is switched off, the network stops to function.

Four computers and a printer becomes a huge lot of wires and complexity....

Networking

Instead of removable media, you can use a cable to connect one computer with the other.

If you connect more then three, then you'll see the problem.

Every computer has to be connected to the other ones, because if it's not the case and one computer is switched off, the network stops to function.

Four computers and a printer becomes a huge lot of wires and complexity....

Networking

Instead of removable media, you can use a cable to connect one computer with the other.

If you connect more then three, then you'll see the problem.

Every computer has to be connected to the other ones, because if it's not the case and one computer is switched off, the network stops to function.

Four computers and a printer becomes a huge lot of wires and complexity....

Networking

Instead of removable media, you can use a cable to connect one computer with the other.

If you connect more then three, then you'll see the problem.

Every computer has to be connected to the other ones, because if it's not the case and one computer is switched off, the network stops to function.

Four computers and a printer becomes a huge lot of wires and complexity....

Ethernet

So someone, again at Xerox PARC, developed a new network protocol: Ethernet (1973 1976).

All devices, computers, printers, storage devices are connected to one cable.

Every computer has a network card with unique serial number: MAC address (media access control address). Communication from one computer to another will travel past all computers, but only the device addressed to, actually listens.

That is if you don't have a hacker using Network Sniffer software that catches all data in the network that passes their computer.

Connecting...

Hello everyone!
I am new!Hello new one!
I am 192.168.0.1
and your gateway
to the outside worldFrom now on you
are 192.168.0.42You can look up
IP addresses
of domain names
at DNS
with IP 8.8.8.8Let's use
Dynamic Host
Configuration Protocol
(DHCP)Oops...
Internet Protocol
is next item...So what happens if you connect a new computer to the Ethernet network?

You can see that I am already talking about IP addresses, which belong to the part about Internet.

The Internet got so popular that it's protocol is also used on computers in an Ethernet network...

2. Internet

If you read about Internet you read about ARPA net, the basis of what we now know as Internet.

ARPA net was a network between the U.S. Department of Defence for use by its projects at universities and research laboratories in the US.

Definition 1

Internet = Network between connected local networks;

Inter-network

I just talked about Ethernet. If you connect one Ethernet network to some other local area network, then you create a network between networks.

Internet = network between networks, an inter-network

Internet

So if you want to connect two local networks, you can use a long cable. In this case a very long cable.

Expensive

Not reliable because it can break.

So another characteristic of Internet is...

Definition 2

Internet = Packet Switching on TCP/IP

Transmission
ControlProtocolInternetProtocolInternet = Packet Switching on TCP/IP.

Not really helpful is it?

Let me explain....

Packet Switching

All transmitted data is divided into blocks, packets

Those packets can travel using different routes

The destination merges the packets

On the Internet all data is chopped into tiny blocks which are called packets.

Sharing

So if you want to connect two local networks, you can use a long cable. In this case a very long cable.

Expensive

Not reliable because it can break.

So another characteristic of Internet is...

Internet Protocol

Host addressing and identification
who is who

Packet routing
shortest route?

The Internet Protocol handles the addressing, with IP addresses,
and the routing.

Every router in the network will sent a packet to the next router in the network. It will choose a router that is closer to the final destination.

TCP

Here's a
packetThanks,
I got it!Here's the
next packetPackets travel from router to router to router to router to router to router to router to destination

Quality Control?
Transmission Control Protocol (TCP)!

Packets will travel from source to destination, using different routes, but how can you be sure that every packet arrives at the destination?

By TCP, the Quality Control of the Internet.

The destination acknowledges the receipt of every packet

If the source does not receive an acknowledgement for a packet within certain time, it will send the packet again...

DNS

What's DNS?173.194.65.139
is your friend!Another thing, I just told you that on Internet every computer works with IP addresses.We humans do not like such IP addresses. We prefer names...

DNS

Google.com?173.194.65.139 !Dear 173.194.65.139,
please give me index page

OSI

LayerTCP/IP protocolsNo.Name7. Application - DNS / FTP / HTTP / DHCP / SMTP6. Presentation- MIME / SSL / TLS5. Session - Sockets (session establishment in TCP / RTP / PPTP)4. Transport - TCP3. Network - IP

3. Internet of People

Why Networking?Sharing....

computer power (mainframe)
equipment (printer, storage)
information (documents)

The first and most primitive kind of network is...

Email

E-mail = text file

E-mail Header: sender, IP address sender, receiver, return address, message ID, all mail servers on route, spam flags, etc.

Peter @ db8.nlPOP3 server (or IMAP) @db8.nl handles e-mail

Stores it in text file for Peter

Or replies with bounce message

E-mail

In the past when people were working on the same mainframe computer, it was possible to send messages to other people who were online. Someone thought it would be practical to send messages to people who were offline, but store them until they came online again.Hence, email was born.E-mail is a text file with a header. When it passes a router, it will add It's IP + time stamp to the header. You can use the header for debugging in case of errors.E-mail will be handled by the server specified behind the at-sign. It will determine if the account name before the at-sign exists

Send E-mail

From: [email protected]
To: [email protected]
Message:

Dear Bill,
Almost 10 years I discovered Linux and now I am not fond of Windows anymore. If I buy a PC for Linux, I still have to pay license fees for Windows.

Could you please refund my money?
Kind regards,
Peter

To explain, I've send the following e-mail to Bill Gates. It will travel in tiny packets to the router of my Internet Provider, to a router in Amsterdam, to London, to New York, Chicago, and finally arrive at a server in Seattle. It will merge all packets into one, which is my e-mail with a header that contains the full route...

By the way, the e-mail is not encrypted. Everyone, or every router on the way, is able to read the message. Think about sending a post card, the mail man can read it before they put it in the mailbox. If you don't want that, you've to use an envelope. And with e-mail, encrypt the message...

Receive E-mail

From: [email protected]
To: [email protected]
Message:

Dear Peter,
How are you doing?

Sorry to hear that you dont like our Operating System any more.
Please keep in mind that our next Windows version will be much better!

Sorry, but we dont have a refund policy.
Yours sincerely,
Bill Gates

PS: I noticed that your website runs on Joomla. Thats awesome!
BTW: Joomla also works on our products Windows IIS + MSSQL!

Knowing Bill, he will reply within a couple of hours.

But only if he is not playing with his latest gadget, the Apple Watch.

He might reply something like

Bounce Message

Undelivered Mail Returned to Sender
This is the mail system at host mail-out.microsoft.com. I'm sorry to have to inform you that your message could not be delivered to one or more recipients. It's attached below.

For further assistance, please send mail to postmaster.

If you do so, please include this problem report. You can delete your own text from the attached returned message.

The mail system
: host microsoft.com[134.170.188.221] said: 550 "Unknown User"
Reporting-MTA: dns; mail-out.s1.byte.nl
X-Postfix-Sender: rfc822;
Arrival-Date: Tue, 9 Sep 2014 11:09:20 +0200 (CEST)

Final-Recipient: rfc822; [email protected]
Original-Recipient: rfc822; [email protected]
Action: failed
Status: 5.0.0
Remote-MTA: dns; microsoft.com
Diagnostic-Code: smtp; 550 "Unknown User"

But I am afraid that his reply will be something like. Which means that the email address did not exist. Note that you will only get such a bounce message if the server is configured to send such messages. The can also just add it to a spam box or just remove it automatically.

WWW

WWW

World Wide Web = HyperText Transfer ProtocolWWW Internet !

WWW = A collection of HTML documentsHyperText Markup LanguageText files with information linked to other text files

Surfing

Browsing on the WWW:

YOU ARE
NOT VISITING
A WEBSITE

HTTP(S)

HTTP (port 80) All traffic = plain text

HTTPS (port 443) All traffic via encrypted connectionprotects your data on route

No safeguard for data on unsafe server....

HTML

Text file with markup

Markup defines elements:
pagetitle, paragraph, heading,
hyperlink, image, CSS

Hyperlink = created by browser

Image = just reference, loaded by browser

CSS = layout definition interpreted by browser

When you visit a website, you are not really visiting the website and reading something which is stored on that webserver.

Actually the text file with HTML markup was transferred to your computer, temporarily stored in cache memory, so you are reading it on your own computer

Web v1

Till 2004 Few websites

Mostly static HTML

Purpose: display information

Visitors are consumers

Web v2

> 2004 - Change in the way how Web pages are made and usedHuge increase in dynamic websites

Visitors can also create content

CMS, Blogging, Social Media, Youtube, FaceBook, etc

Devices

Devices

Lies, damned lies, and statistics

Devices

4. Webservices

Server vs service

WebserverMostly brower request

page with HTML markup

via http(s)

WebserviceMostly devices / webservers request

formatted data

via http(s)

{ "results" : [
{ "formatted_address" : "Van Broeckhuysenstraat 46, 6511 PK Nijmegen, Netherlands", "geometry" : { "location" : { "lat" : 51.8438169, "lng" : 5.865908399999999 }, "location_type" : "ROOFTOP", "viewport" : { "northeast" : { "lat" : 51.8451658802915, "lng" : 5.867257380291502 }, "southwest" : { "lat" : 51.8424679197085, "lng" : 5.864559419708497 } } }, "place_id" : "ChIJWQeYKkUIx0cRc87ZCaPbj0w", "types" : [ "street_address" ] } ], "status" : "OK"}

Browser:
https://www.google.nl/maps/place/Van+Broeckhuysenstraat+46,+6511+PK+Nijmegen

Webservice:
http://maps.googleapis.com/maps/api/geocode/json?sensor=false&address =Van+Broeckhuysenstraat+46,+6511+PK+Nijmegen

In the next 45 minutes I hope to teach you something about IT. btw: does everybody know what IT means?

IT = Information Technology. And is an integral part of our daily life. Nowadays everybody has at least a couple of computers: a PC, a smart phone, a tablet PC, a car navigation, a modern television.

In this presentation I will start to explain what a Computer is, then I will work my way through different IT subjects and will end this journey with what Joomla is.

My goal of this presentation is not to be 100% accurate. What I hope to accomplish is that in the future youll think about simple daily life concepts when you hear about technical IT terms.

Web services design models

XML RPCXML Remote Procedure Call Protocol

SOAPSimple Object Access Protocol

RESTREpresentational State Transfer

REST

Architectural approach (not a protocol!)

XML or JSON

Via HTTP

CRUD operation: GET, POST, PUT, DELETE

URI design: directory like structure

URI design

URIHTTP
methodAction

/article/GETGet all articles

/article/7GETGet articles with id=7

/article/POSTAdd new article

/article/7PUTEdit article with id=7

/article/6DELETEDelete article with id=6

HTTP Status

Normal http status200 = ok

404 = not found

500 = internal server error

5. Internet of Things

Internet of Things

Devices connected to each other via internet

Collect data

Share data

Autonomously

Possible issues

No universal language or protocol

Privacy issues

Security issues

6. My Internet of Things

ESP8266

ESP8266 versies

Pins

Flashing

NodeMCU

Connect Things EASY - An open-source firmware and development kit that helps you to prototype your IOT product within a few Lua script lineshttp://nodemcu.com/

Lua

Lua (moon in Portuguese)
lightweight multi-paradigm programming language designed as a scripting language with extensible semantics as a primary goalhttp://www.lua.org/

Flashing firmware

Thingspeak.com

48 hours later

7. The sandwich

My coworking place

Me working

My colleague

Sandwich shop

Raspberry Pi

Rpi webservice

Raspberry Pibash script collects MAC via arp-scan

Posts array of MAC addresses to webservice

Joomla WebsiteWebservice receives array with MAC addresses & stores in MySQL database tableSlim Framework - php micro framework http://www.slimframework.com/

Joomla component lists members + online status from MySQL database table

In action

Connected to

Website

WebapplicationJoomla + SLIM framework


Mobile phone App

Conclusion

I hope that this overview on Information Technology gives you an idea about what actually happens when you use IT.

Questions?

Peter Martine-mail: info at db8.nlwebsite: www.db8.nl twitter: @pe7erPresentation: http://www.db8.nl

Used Photos

Title sheet: Internet of Things
http://www.markethings.net/wp-content/uploads/2015/06/IoT-2.png

Sandwich Cheese Pesto Salad
http://www.foody.nl/P60669/614x412/broodje-kip-pesto.jpg 1. Networking

Wm2005-hackday-guerilla-networking, Andrew Lih, 2005
http://commons.wikimedia.org/wiki/File:Wm2005-hackday-guerilla-networking.JPG

IBM Electronic Data Processing Machine - GPN-2000-001881, NASA, 1957
http://upload.wikimedia.org/wikipedia/commons/2/20/IBM_Electronic_Data_Processing_Machine_-_GPN-2000-001881.jpg

Floppy disk 2009 G1, George Chernilevsky, 2009http://en.wikipedia.org/wiki/File:Floppy_disk_2009_G1.jpg

SanDisk Cruzer Micro, Evan-Amos, 2011http://en.wikipedia.org/wiki/File:SanDisk_Cruzer_Micro.png

CD-R Front, Stefan Khn, 2003http://commons.wikimedia.org/wiki/File:CD-R_Front.jpg

Harddisk in USB external box, Vojtch Brzek, 2011
http://commons.wikimedia.org/wiki/File:Harddisk_in_USB_external_box.jpg

Used Photos

2. InternetARPANET as of Jun 30, 1982 - BBN map - DSC00123, BBN Technologies, Cambridge, Massachusetts, 2013
http://commons.wikimedia.org/wiki/File:ARPANET_as_of_Jun_30,_1982_-_BBN_map_-_DSC00123.JPG

Old Phonebooks at Salton Sea - Gentle, 2010
http://commons.wikimedia.org/wiki/File:Old_Phonebooks_at_Salton_Sea.jpg

OSIModel.jpg - MrsValdry, 2011
https://commons.wikimedia.org/wiki/File:OSIModel.jpg3. Internet of People

IoT-Graphic-540x247.png
http://numrush.nl/2015/03/13/amazon-neemt-startup-om-internet-things-platform-uit-te-bouwen/

Pigeon Messengers (Harper's Engraving), Harper's New Monthly Magazine, No. 275, April, 1873.
http://commons.wikimedia.org/wiki/File:Pigeon_Messengers_(Harper's_Engraving).png

HypertextEditingSystemConsoleBrownUniv1969, Greg Lloyd, 1969
http://commons.wikimedia.org/wiki/File:HypertextEditingSystemConsoleBrownUniv1969.jpg

tricorderunbox4, Bobbie Johnson, 2009
https://www.flickr.com/photos/bojo/4078685614/in/photostream/

Mobile-stats-vs-desktop-users-global-550x405.png
http://www.smartinsights.com/mobile-marketing/mobile-marketing-analytics/mobile-marketing-statistics/

Mobile-Internet-Trends-Mary-Meeker-2015-1-550x417.png
http://www.smartinsights.com/mobile-marketing/mobile-marketing-analytics/mobile-marketing-statistics/

Used Photos

4. WebservicesWaiter pouring Zardetto sparkling Prosecco, Jeff Kubina, 2009
http://commons.wikimedia.org/wiki/File:Waiter_pouring_Zardetto_sparkling_Prosecco.jpg5. Internet of Things

ioe_plaatje.jpg
http://hanswisbrun.nl/2015/09/21/verborgen-anonieme-zaken-in-amsterdam/ioe_plaatje/6. My Internet of Things

ESP8266
http://www.seeedstudio.com/depot/WiFi-Serial-Transceiver-Module-w-ESP8266-p-1994.html

ESP8266 overview
http://www.esp8266.com/viewtopic.php?f=5&t=3876

ESP8266 Datasheet
http://www.electroschematics.com/11276/esp8266-datasheet/

Flashing ESP8266
https://importhack.wordpress.com/2014/11/22/how-to-use-ep8266-esp-01-as-a-sensor-web-client/

Used Photos

7. The sandwichSandwich Cheese Pesto Salad
http://www.foody.nl/P60669/614x412/broodje-kip-pesto.jpg

Login screen
http://www.getyourwebpage.com/login-members.html

Card Swipe
http://www.multitechreps.com/line-card/kantech/

Harry Fain, coal loader, checks out in the afternoon after cleaning up after work. Inland Steel Company, Wheelwright... - NARA - 541444 - U.S. National Archives and Records Administration, 1946
https://upload.wikimedia.org/wikipedia/commons/8/8c/Harry_Fain,_coal_loader,_checks_out_in_the_afternoon_after_cleaning_up_after_work._Inland_Steel_Company,_Wheelwright..._-_NARA_-_541444.jpg

Still from 1984
http://www.dagelijksestandaard.nl/2015/03/google-claimt-waarheidsmonopolie/Conclusion

EquinoxeJuniorHighPac-Man - Equinoxe, 2012
http://www.c64-wiki.com/index.php/File:EquinoxeJuniorHighPac-Man.png

Linux Nijmegen

Joomladagen 2015