Vous êtes sur la page 1sur 97

IVYearB.Tech.

CSEISemester

CS445INTERNETOFTHINGS

(ELECTIVEIV)

Coursedescriptionandobjectives:

Studentswillbeexploredtotheinterconnectionandintegrationofthephysical
world and the cyber space. They are also able to design & develop IOT
Devices.

CourseOutcomes:

1. AbletounderstandtheapplicationareasofIOT

2. AbletorealizetherevolutionofInternetinMobileDevices,
Cloud&SensorNetworks

3. Able to understand building blocks of Internet of Things and


characteristics.

UnitI

IntroductiontoInternetofThings

Definition: Adynamicglobalnetworkinfrastructurewithselfconfiguring
capabilitiesbasedonstandardandinteroperablecommunicationprotocols
wherephysicalandvirtual"things"haveidentities,physicalattributes,and
virtualpersonalitiesanduseintelligentinterfaces,andareseamlesslyintegrated
intotheinformationnetwork,oftencommunicatedataassociatedwithusers
andtheirenvironments.

CharacteristicsofIoT

1. Dynamicandselfadapting
2. Selfconfiguring

3. Interoperablecommunicationprotocols

4. Uniqueidentity

5. Integratedintoinformationnetwork

PhysicalDesignofIoT

ThingsofIoT

Athing,inthecontextoftheInternetofthings(IoT),isanentityorphysical
objectthathasauniqueidentifier,anembeddedsystemandtheabilityto
transferdataoveranetwork.

IOTProtocols

1. Linklayer

802.3Ethernet

Ethernet,definedunderIEEE802.3,isoneoftoday'smost
widelyuseddatacommunicationsstandards,anditfindsits
majoruseinLocalAreaNetwork(LAN)applications.With
versionsincluding10BaseT,100BaseTandnowGigabit
Ethernet,itoffersawidevarietyofchoicesofspeedsand
capability.Ethernetisalsocheapandeasytoinstall.
AdditionallyEthernet,IEEE802.3offersaconsiderabledegree
offlexibilityintermsofthenetworktopologiesthatareallowed.
FurthermoreasitisinwidespreaduseinLANs,ithasbeen
developedintoarobustsystemthatmeetstheneedstowide
numberofnetworkingrequirements.

802.11WiFi
IEEE802.11isasetofmediaaccesscontrol(MAC)and
physicallayer(PHY)specificationsforimplementingwireless
localareanetwork(WLAN)computercommunicationinthe
900MHzand2.4,3.6,5,and60GHzfrequencybands.They
arecreatedandmaintainedbytheInstituteofElectricaland
ElectronicsEngineers(IEEE)LAN/MANStandardsCommittee
(IEEE802).Thebaseversionofthestandardwasreleasedin
1997,andhashadsubsequentamendments.Thestandardand
amendmentsprovidethebasisforwirelessnetworkproducts
usingtheWiFibrand.Whileeachamendmentisofficially
revokedwhenitisincorporatedinthelatestversionofthe
standard,thecorporateworldtendstomarkettotherevisions
becausetheyconciselydenotecapabilitiesoftheirproducts.Asa
result,inthemarketplace,eachrevisiontendstobecomeitsown
standard.

802.16WiMax

IEEE802.16isaseriesofwirelessbroadbandstandardswritten
bytheInstituteofElectricalandElectronicsEngineers(IEEE).
TheIEEEStandardsBoardestablishedaworkinggroupin1999
todevelopstandardsforbroadbandforwirelessmetropolitan
areanetworks.TheWorkgroupisaunitoftheIEEE802local
areanetworkandmetropolitanareanetworkstandards
committee.

Althoughthe802.16familyofstandardsisofficiallycalled
WirelessMANinIEEE,ithasbeencommercializedunderthe
name"WiMAX"(from"WorldwideInteroperabilityfor
MicrowaveAccess")bytheWiMAXForumindustryalliance.
TheForumpromotesandcertifiescompatibilityand
interoperabilityofproductsbasedontheIEEE802.16standards.

802.15.4LRWPAN

IEEE 802.15.4 is a standard created and maintained by


consultantswhichspecifiesthephysicallayerandmediaaccess
control for lowrate wireless personal area networks (LR
WPANs).Itismaintainedbythe IEEE802.15 workinggroup,
which has defined it in 2003. It is the basis for the ZigBee,
ISA100.11a,WirelessHART,MiWi,and Thread specifications,
eachofwhichfurtherextendsthestandardbydevelopingthe
upper layers which are not defined in IEEE 802.15.4.
Alternatively, it can be used with 6LoWPAN as Network
AdaptationLayerandstandardInternetprotocolsand/orIETF
RFCsdefiningtheupperlayerswithpropergranularitytobuild
awirelessembeddedInternet.

2G/3G/4GMobileCommunication

2G(or2G)isshortforsecondgenerationwirelesstelephone
technology.Secondgeneration2Gcellulartelecomnetworks
werecommerciallylaunchedontheGSMstandardinFinlandby
Radiolinja(nowpartofElisaOyj)in1991.[1]Threeprimary
benefitsof2Gnetworksovertheirpredecessorswerethatphone
conversationsweredigitallyencrypted;2Gsystemswere
significantlymoreefficientonthespectrumallowingforfar
greatermobilephonepenetrationlevels;and2Gintroduceddata
servicesformobile,startingwithSMStextmessages.2G
technologiesenabledthevariousmobilephonenetworksto
providetheservicessuchastextmessages,picturemessagesand
MMS(multimediamessages).Alltextmessagessentover2G
aredigitallyencrypted,allowingforthetransferofdatainsucha
waythatonlytheintendedreceivercanreceiveandreadit.

3G,shortformofthirdgeneration,isthethirdgenerationof
mobiletelecommunicationstechnology.Thisisbasedonasetof
standardsusedformobiledevicesandmobile
telecommunicationsuseservicesandnetworksthatcomplywith
theInternationalMobileTelecommunications2000(IMT2000)
specificationsbytheInternationalTelecommunicationUnion.
3Gfindsapplicationinwirelessvoicetelephony,mobileInternet
access,fixedwirelessInternetaccess,videocallsandmobile
TV.

3Gtelecommunicationnetworkssupportservicesthatprovidean
informationtransferrateofatleast200kbit/s.Later3Greleases,
oftendenoted3.5Gand3.75G,alsoprovidemobilebroadband
accessofseveralMbit/stosmartphonesandmobilemodemsin
laptopcomputers.Thisensuresitcanbeappliedtowireless
voicetelephony,mobileInternetaccess,fixedwirelessInternet
access,videocallsandmobileTVtechnologies.

4G,shortforfourthgeneration,isthefourthgenerationof
mobiletelecommunicationstechnology,succeeding3G.A4G
systemmustprovidecapabilitiesdefinedbyITUinIMT
Advanced.Potentialandcurrentapplicationsincludeamended
mobilewebaccess,IPtelephony,gamingservices,high
definitionmobileTV,videoconferencing,3Dtelevision,and
cloudcomputing.[citationneeded]

Two4Gcandidatesystemsarecommerciallydeployed:the
MobileWiMAXstandard(firstusedinSouthKoreain2007),
andthefirstreleaseLongTermEvolution(LTE)standard(in
Oslo,Norway,andStockholm,Swedensince2009).Ithas
howeverbeendebatedifthesefirstreleaseversionsshouldbe
consideredtobe4Gornot,asdiscussedinthetechnical
definitionsectionbelow.

2. Network/InternetLayer

IPv4

InternetProtocolversion4(IPv4)isthefourthversionofthe
InternetProtocol(IP).Itisoneofthecoreprotocolsof
standardsbasedinternetworkingmethodsintheInternet,and
wasthefirstversiondeployedforproductionintheARPANET
in1983.ItstillroutesmostInternettraffictoday,despitethe
ongoingdeploymentofasuccessorprotocol,IPv6.IPv4is
describedinIETFpublicationRFC791(September1981),
replacinganearlierdefinition(RFC760,January1980).

IPv4isaconnectionlessprotocolforuseonpacketswitched
networks.Itoperatesonabesteffortdeliverymodel,inthatit
doesnotguaranteedelivery,nordoesitassurepropersequencing
oravoidanceofduplicatedelivery.Theseaspects,includingdata
integrity,areaddressedbyanupperlayertransportprotocol,
suchastheTransmissionControlProtocol(TCP).

IPv6

InternetProtocolversion6(IPv6)isthemostrecentversionof
theInternetProtocol(IP),thecommunicationsprotocolthat
providesanidentificationandlocationsystemforcomputerson
networksandroutestrafficacrosstheInternet.IPv6was
developedbytheInternetEngineeringTaskForce(IETF)todeal
withthelonganticipatedproblemofIPv4addressexhaustion.
IPv6isintendedtoreplaceIPv4.

EverydeviceontheInternetisassignedanIPaddressfor
identificationandlocationdefinition.Withtherapidgrowthof
theInternetaftercommercializationinthe1990s,itbecame
evidentthatfarmoreaddressesthantheIPv4addressspacehas
availablewerenecessarytoconnectnewdevicesinthefuture.
By1998,theInternetEngineeringTaskForce(IETF)had
formalizedthesuccessorprotocol.IPv6usesa128bitaddress,
theoreticallyallowing2128,orapproximately3.41038
addresses.Theactualnumberisslightlysmaller,asmultiple
rangesarereservedforspecialuseorcompletelyexcludedfrom
use.ThetotalnumberofpossibleIPv6addressismorethan
7.91028timesasmanyasIPv4,whichuses32bitaddresses
andprovidesapproximately4.3billionaddresses.Thetwo
protocolsarenotdesignedtobeinteroperable,complicatingthe
transitiontoIPv6.However,severalIPv6transitionmechanisms
havebeendevisedtopermitcommunicationbetweenIPv4and
IPv6hosts.

6LoWPAN

6LoWPANisanacronymofIPv6overLowpowerWireless
PersonalAreaNetworks.6LoWPANisthenameofaconcluded
workinggroupintheInternetareaoftheIETF.

The6LoWPANconceptoriginatedfromtheideathat"the
InternetProtocolcouldandshouldbeappliedeventothe
smallestdevices,"andthatlowpowerdeviceswithlimited
processingcapabilitiesshouldbeabletoparticipateinthe
InternetofThings.
The6LoWPANgrouphasdefinedencapsulationandheader
compressionmechanismsthatallowIPv6packetstobesentand
receivedoverIEEE802.15.4basednetworks.IPv4andIPv6are
theworkhorsesfordatadeliveryforlocalareanetworks,
metropolitanareanetworks,andwideareanetworkssuchasthe
Internet.Likewise,IEEE802.15.4devicesprovidesensing
communicationabilityinthewirelessdomain.Theinherent
naturesofthetwonetworksthough,aredifferent.

3.TransportLayer

TCP

TheTransmissionControlProtocol(TCP)isacoreprotocolof
theInternetprotocolsuite.Itoriginatedintheinitialnetwork
implementationinwhichitcomplementedtheInternetProtocol
(IP).Therefore,theentiresuiteiscommonlyreferredtoas
TCP/IP.TCPprovidesreliable,ordered,anderrorchecked
deliveryofastreamofoctetsbetweenapplicationsrunningon
hostscommunicatingoveranIPnetwork.MajorInternet
applicationssuchastheWorldWideWeb,email,remote
administrationandfiletransferrelyonTCP.Applicationsthatdo
notrequirereliabledatastreamservicemayusetheUser
DatagramProtocol(UDP),whichprovidesaconnectionless
datagramservicethatemphasizesreducedlatencyover
reliability.

UDP

TheUserDatagramProtocol(UDP)isoneofthecoremembers
oftheInternetprotocolsuite.Theprotocolwasdesignedby
DavidP.Reedin1980andformallydefinedinRFC768.
UDPusesasimpleconnectionlesstransmissionmodelwitha
minimumofprotocolmechanism.Ithasnohandshaking
dialogues,andthusexposestheuser'sprogramtoany
unreliabilityoftheunderlyingnetworkprotocol.Thereisno
guaranteeofdelivery,ordering,orduplicateprotection.UDP
provideschecksumsfordataintegrity,andportnumbersfor
addressingdifferentfunctionsatthesourceanddestinationof
thedatagram.

WithUDP,computerapplicationscansendmessages,inthis
casereferredtoasdatagrams,tootherhostsonanInternet
Protocol(IP)networkwithoutpriorcommunicationstosetup
specialtransmissionchannelsordatapaths.UDPissuitablefor
purposeswhereerrorcheckingandcorrectioniseithernot
necessaryorisperformedintheapplication,avoidingthe
overheadofsuchprocessingatthenetworkinterfacelevel.
TimesensitiveapplicationsoftenuseUDPbecausedropping
packetsispreferabletowaitingfordelayedpackets,whichmay
notbeanoptioninarealtimesystem.Iferrorcorrection
facilitiesareneededatthenetworkinterfacelevel,anapplication
mayusetheTransmissionControlProtocol(TCP)orStream
ControlTransmissionProtocol(SCTP)whicharedesignedfor
thispurpose.

4.Applicationlayer

HTTP

TheHypertextTransferProtocol(HTTP)isanapplication
protocolfordistributed,collaborative,hypermediainformation
systems.HTTPisthefoundationofdatacommunicationforthe
WorldWideWeb.
Hypertextisstructuredtextthatuseslogicallinks(hyperlinks)
betweennodescontainingtext.HTTPistheprotocolto
exchangeortransferhypertext.

ThestandardsdevelopmentofHTTPwascoordinatedbythe
InternetEngineeringTaskForce(IETF)andtheWorldWide
WebConsortium(W3C),culminatinginthepublicationofa
seriesofRequestsforComments(RFCs).Thefirstdefinitionof
HTTP/1.1,theversionofHTTPincommonuse,occurredin
RFC2068in1997,althoughthiswasobsoletedbyRFC2616in
1999.

Alaterversion,thesuccessorHTTP/2,wasstandardizedin
2015,thensupportedbymajorwebbrowsersandalready
supportedbymajorwebservers.

CoAP

ConstrainedApplicationProtocol(CoAP)isasoftwareprotocol
intendedtobeusedinverysimpleelectronicsdevicesthat
allowsthemtocommunicateinteractivelyovertheInternet.Itis
particularlytargetedforsmalllowpowersensors,switches,
valvesandsimilarcomponentsthatneedtobecontrolledor
supervisedremotely,throughstandardInternetnetworks.CoAP
isanapplicationlayerprotocolthatisintendedforusein
resourceconstrainedinternetdevices,suchasWSNnodes.
CoAPisdesignedtoeasilytranslatetoHTTPforsimplified
integrationwiththeweb,whilealsomeetingspecialized
requirementssuchasmulticastsupport,verylowoverhead,and
simplicity.Multicast,lowoverhead,andsimplicityareextremely
importantforInternetofThings(IoT)andMachinetoMachine
(M2M)devices,whichtendtobedeeplyembeddedandhave
muchlessmemoryandpowersupplythantraditionalinternet
deviceshave.Therefore,efficiencyisveryimportant.CoAPcan
runonmostdevicesthatsupportUDPoraUDPanalogue.

TheInternetEngineeringTaskForce(IETF)Constrained
RESTfulenvironments(CoRE)WorkingGrouphasdonethe
majorstandardizationworkforthisprotocol.Inordertomake
theprotocolsuitabletoIoTandM2Mapplications,variousnew
functionalitieshavebeenadded.Thecoreoftheprotocolis
specifiedinRFC7252,importantextensionsareinvarious
stagesofthestandardizationprocess.

WebSocket

WebSocketisaprotocolprovidingfullduplexcommunication
channelsoverasingleTCPconnection.TheWebSocketprotocol
wasstandardizedbytheIETFasRFC6455in2011,andthe
WebSocketAPIinWebIDLisbeingstandardizedbytheW3C.

WebSocketisdesignedtobeimplementedinwebbrowsersand
webservers,butitcanbeusedbyanyclientorserver
application.TheWebSocketProtocolisanindependentTCP
basedprotocol.ItsonlyrelationshiptoHTTPisthatits
handshakeisinterpretedbyHTTPserversasanUpgrade
request.TheWebSocketprotocolmakesmoreinteraction
betweenabrowserandawebsitepossible,facilitatingthereal
timedatatransferfromandtotheserver.Thisismadepossible
byprovidingastandardizedwayfortheservertosendcontentto
thebrowserwithoutbeingsolicitedbytheclient,andallowing
formessagestobepassedbackandforthwhilekeepingthe
connectionopen.Inthiswayatwoway(bidirectional)ongoing
conversationcantakeplacebetweenabrowserandtheserver.
ThecommunicationsaredoneoverTCPportnumber80,which
isofbenefitforthoseenvironmentswhichblocknonweb
Internetconnectionsusingafirewall.Similartwowaybrowser
servercommunicationshavebeenachievedinnonstandardized
waysusingstopgaptechnologiessuchasComet.

TheWebSocketprotocoliscurrentlysupportedinmostmajor
browsersincludingGoogleChrome,InternetExplorer,Firefox,
SafariandOpera.WebSocketalsorequireswebapplicationson
theservertosupportit.

MQTT

MQTT(formerlyMessageQueueTelemetryTransport)isan
ISOstandard(ISO/IECPRF20922)publishsubscribebased
"lightweight"messagingprotocolforuseontopoftheTCP/IP
protocol.Itisdesignedforconnectionswithremotelocations
wherea"smallcodefootprint"isrequiredorthenetwork
bandwidthislimited.Thepublishsubscribemessagingpattern
requiresamessagebroker.Thebrokerisresponsiblefor
distributingmessagestointerestedclientsbasedonthetopicofa
message.AndyStanfordClarkandArlenNipperofCirrusLink
Solutionsauthoredthefirstversionoftheprotocolin1999.

Thespecificationdoesnotspecifythemeaningof"smallcode
footprint"orthemeaningof"limitednetworkbandwidth".
Thus,theprotocol'savailabilityforusedependsonthecontext.
In2013,IBMsubmittedMQTTv3.1totheOASISspecification
bodywithacharterthatensuredonlyminorchangestothe
specificationcouldbeaccepted.MQTTSNisavariationofthe
mainprotocolaimedatembeddeddevicesonnonTCP/IP
networks,suchasZigBee.

Historically,the'MQ'in'MQTT'camefromIBM'sMQmessage
queuingproductline.However,queuingperseisnotrequiredto
besupportedasastandardfeatureinallsituations.

AlternativeprotocolsincludetheAdvancedMessageQueuing
Protocol,theIETFConstrainedApplicationProtocolandXMPP.

XMPP

ExtensibleMessagingandPresenceProtocol(XMPP)isa
communicationsprotocolformessageorientedmiddleware
basedonXML(ExtensibleMarkupLanguage).Itenablesthe
nearrealtimeexchangeofstructuredyetextensibledata
betweenanytwoormorenetworkentities.Originallynamed
Jabber,theprotocolwasdevelopedbytheJabberopensource
communityin1999fornearrealtimeinstantmessaging(IM),
presenceinformation,andcontactlistmaintenance.Designedto
beextensible,theprotocolhasbeenusedalsoforpublish
subscribesystems,signallingforVoIP,video,filetransfer,
gaming,InternetofThings(IoT)applicationssuchasthesmart
grid,andsocialnetworkingservices.

Unlikemostinstantmessagingprotocols,XMPPisdefinedinan
openstandardandusesanopensystemsapproachof
developmentandapplication,bywhichanyonemayimplement
anXMPPserviceandinteroperatewithotherorganizations'
implementations.BecauseXMPPisanopenprotocol,
implementationscanbedevelopedusinganysoftwarelicense;
althoughmanyserver,client,andlibraryimplementationsare
distributedasfreeandopensourcesoftware,numerousfreeware
andcommercialsoftwareimplementationsalsoexist.

DDS

TheDataDistributionServiceforRealTimeSystems(DDS)is
anObjectManagementGroup(OMG)machinetomachine
middleware"m2m"standardthataimstoenablescalable,real
time,dependable,highperformanceandinteroperabledata
exchangesbetweenpublishersandsubscribers.DDSaddresses
theneedsofapplicationslikefinancialtrading,airtraffic
control,smartgridmanagement,andotherbigdataapplications.
Thestandardisusedinapplicationssuchassmartphone
operatingsystems,transportationsystemsandvehicles,
softwaredefinedradio,andbyhealthcareproviders.DDSmay
alsobeusedincertainimplementationsoftheInternetofThings.

AMQP

TheAdvancedMessageQueuingProtocol(AMQP)isanopen
standardapplicationlayerprotocolformessageoriented
middleware.ThedefiningfeaturesofAMQParemessage
orientation,queuing,routing(includingpointtopointand
publishandsubscribe),reliabilityandsecurity.

AMQPmandatesthebehaviorofthemessagingproviderand
clienttotheextentthatimplementationsfromdifferentvendors
areinteroperable,inthesamewayasSMTP,HTTP,FTP,etc.
havecreatedinteroperablesystems.Previousstandardizationsof
middlewarehavehappenedattheAPIlevel(e.g.JMS)andwere
focusedonstandardizingprogrammerinteractionwithdifferent
middlewareimplementations,ratherthanonproviding
interoperabilitybetweenmultipleimplementations.UnlikeJMS,
whichdefinesanAPIandasetofbehaviorsthatamessaging
implementationmustprovide,AMQPisawirelevelprotocol.A
wirelevelprotocolisadescriptionoftheformatofthedatathat
issentacrossthenetworkasastreamofoctets.Consequently,
anytoolthatcancreateandinterpretmessagesthatconformto
thisdataformatcaninteroperatewithanyothercomplianttool
irrespectiveofimplementationlanguage.

LogicalDesignofIoT

IoTFunctionalBlocks

Device

ThethingsinIoTarenothingbutthedevicesinIoT.

Services

AnIoTsystemusesvarioustypesofIoTservicessuchas
servicesfordevicemonitoring,devicecontrolservices,data
publishingservicesetc.

Communication

Manycommunicationtechnologiesarewellknownsuchas
WiFi,Bluetooth,ZigBeeand2G/3G/4Gcellular,butthereare
alsoseveralnewemergingnetworkingoptionssuchasThreadas
analternativeforhomeautomationapplications,andWhitespace
TVtechnologiesbeingimplementedinmajorcitiesforwider
areaIoTbasedusecases.Dependingontheapplication,factors
suchasrange,datarequirements,securityandpowerdemands
andbatterylifewilldictatethechoiceofoneorsomeformof
combinationoftechnologies.Thesearesomeofthemajor
communicationtechnologiesonoffertodevelopers.

Management

Managementfunctionalblockprovidesvariousfunctionsto
governtheIoTsystem.

Security

SecurityfunctionalblocksecurestheIoTsystemandby
providingfunctionssuchasauthentication,authorization,
messageandcontentintegrity,anddatasecurity.

Application

IoTapplicationprovideaninterfacethattheuserscanuseto
controlandmonitorvariousaspectsoftheIoTsystem.

IoTCommunicationModel

RequestResponse

Requestresponse,orrequestreply,isoneofthebasicmethods
computersusetocommunicatewitheachother,inwhichthe
firstcomputersendsarequestforsomedataandthesecond
computerrespondstotherequest.Usually,thereisaseriesof
suchinterchangesuntilthecompletemessageissent;browsinga
webpageisanexampleofrequestresponsecommunication.
Requestresponsecanbeseenasatelephonecall,inwhich
someoneiscalledandtheyanswerthecall.
Requestresponseisamessageexchangepatterninwhicha
requestorsendsarequestmessagetoarepliersystemwhich
receivesandprocessestherequest,ultimatelyreturninga
messageinresponse.Thisisasimple,butpowerfulmessaging
patternwhichallowstwoapplicationstohaveatwoway
conversationwithoneanotheroverachannel.Thispatternis
especiallycommoninclientserverarchitectures.

PublishSubscribe

Insoftwarearchitecture,publishsubscribeisamessaging
patternwheresendersofmessages,calledpublishers,donot
programthemessagestobesentdirectlytospecificreceivers,
calledsubscribers,butinsteadcharacterizepublishedmessages
intoclasseswithoutknowledgeofwhichsubscribers,ifany,
theremaybe.Similarly,subscribersexpressinterestinoneor
moreclassesandonlyreceivemessagesthatareofinterest,
withoutknowledgeofwhichpublishers,ifany,thereare.

Pub/subisasiblingofthemessagequeueparadigm,andis
typicallyonepartofalargermessageorientedmiddleware
system.Mostmessagingsystemssupportboththepub/suband
messagequeuemodelsintheirAPI,e.g.JavaMessageService
(JMS).

Thispatternprovidesgreaternetworkscalabilityandamore
dynamicnetworktopology,witharesultingdecreasedflexibility
tomodifythePublisheranditsstructureofthedatapublished.

PushPull
Mostofthebusinesscommunicationtoolsweusetodayare
pushtools,wherethesenderofthemessagedecideswhowill
receiveit.Emailistheclassicexampleofthis;thesenderofthe
messagechooseswhotoputontheToandCclines.The
recipientgetsnochoiceaboutwhethertheyreceivethemessage
ornot,andanyonewhoisnotcopiedonthemessagedoesnt
evenknowofitsexistence.Thesenderisfirmlyincontrol.
Instantmessaging,SMSandevenphonecallsareallexamples
ofpush.

ExclusivePair

Pairedsocketsareverysimilartoregularsockets.

Thecommunicationisbidirectional.

Thereisnospecificstatestoredwithinthesocket

Therecanonlybeoneconnectedpeer.

Theserverlistensonacertainport&aclientconnectsto
it.

IoTCommunicationAPIs

RESTbasedcommunicationAPIs
REST (REpresentational State Transfer) is an architectural
style, andanapproachtocommunicationsthatisoftenusedin
the developmentofWebservices.TheuseofRESTisoften
preferred over the more heavyweight SOAP (Simple
ObjectAccessProtocol) style because REST does not
leverageasmuchbandwidth,which makesitabetterfit
foruseovertheInternet.TheSOAP approach requires
writingorusingaprovidedserverprogram(toservedata)and
aclientprogram(torequestdata).

ClientServer

Theclientservermodelofcomputingisadistributed
applicationstructurethatpartitionstasksorworkloadsbetween
theprovidersofaresourceorservice,calledservers,andservice
requesters,calledclients.Oftenclientsandserverscommunicate
overacomputernetworkonseparatehardware,butbothclient
andservermayresideinthesamesystem.Aserverhostrunsone
ormoreserverprogramswhichsharetheirresourceswith
clients.Aclientdoesnotshareanyofitsresources,butrequests
aserver'scontentorservicefunction.Clientsthereforeinitiate
communicationsessionswithserverswhichawaitincoming
requests.
Stateless

Incomputing,astatelessprotocolisacommunicationsprotocol
thattreatseachrequestasanindependenttransactionthatis
unrelatedtoanypreviousrequestsothatthecommunication
consistsofindependentpairsofrequestandresponse.Astateless
protocoldoesnotrequiretheservertoretainsessioninformation
orstatusabouteachcommunicationspartnerforthedurationof
multiplerequests.Incontrast,aprotocolwhichrequireskeeping
oftheinternalstateontheserverisknownasastatefulprotocol.

ExamplesofstatelessprotocolsincludetheInternetProtocol(IP)
whichisthefoundationfortheInternet,andtheHypertext
TransferProtocol(HTTP)whichisthefoundationofdata
communicationfortheWorldWideWeb.

Cacheable

Acacheablecommunicationsprotocolincludesaccommodating
theabilityforclientsidecachingandasetofspecificationsfor
whenaresponsetoaquerycanbecached.TheHTTP1.1
protocolissuchaprotocolandincludesanentiresectiononthe
rulesoftheroadforcaching

Layeredsystem

Communicationprogramsareoftenlayered.Thereference
modelforcommunicationprograms,OpenSystem
Interconnection(OSI)isalayeredsetofprotocolsinwhichtwo
multilayeredprograms,oneateitherendofacommunications
exchange,useanidenticalsetoflayers.IntheOSImodel,each
multilayerprogramcontainssevenlayers,eachreflectinga
differentfunctionthathastobeperformedinorderforprogram
toprogramcommunicationtotakeplacebetweencomputers.

TCP/IPisanexampleofatwolayer(TCPandIP)setof
programsthatprovidetransportandnetworkaddressfunctions
forInternetcommunication.AsetofTCP/IPandotherlayered
programsissometimesreferredtoasaprotocolstack.

WebSocketbasedcommunicationAPIs

WebSocketisaprotocolprovidingfullduplexcommunicationchannelsovera
singleTCPconnection.TheWebSocketprotocolwasstandardizedbytheIETF
asRFC6455in2011,andtheWebSocketAPIinWebIDLisbeing
standardizedbytheW3C.

WebSocketisdesignedtobeimplementedinwebbrowsersandwebservers,
butitcanbeusedbyanyclientorserverapplication.TheWebSocketProtocol
isanindependentTCPbasedprotocol.ItsonlyrelationshiptoHTTPisthatits
handshakeisinterpretedbyHTTPserversasanUpgraderequest.The
WebSocketprotocolmakesmoreinteractionbetweenabrowserandawebsite
possible,facilitatingtherealtimedatatransferfromandtotheserver.Thisis
madepossiblebyprovidingastandardizedwayfortheservertosendcontentto
thebrowserwithoutbeingsolicitedbytheclient,andallowingformessagesto
bepassedbackandforthwhilekeepingtheconnectionopen.Inthiswayatwo
way(bidirectional)ongoingconversationcantakeplacebetweenabrowser
andtheserver.ThecommunicationsaredoneoverTCPportnumber80,which
isofbenefitforthoseenvironmentswhichblocknonwebInternetconnections
usingafirewall.Similartwowaybrowserservercommunicationshavebeen
achievedinnonstandardizedwaysusingstopgaptechnologiessuchasComet.

IoTEnablingTechnologies

WirelessSensornetworks

Wirelesssensornetworks(WSN),sometimescalledwirelesssensorand
actuatornetworks(WSAN),arespatiallydistributedautonomoussensorsto
monitorphysicalorenvironmentalconditions,suchastemperature,sound,
pressure,etc.andtocooperativelypasstheirdatathroughthenetworktoa
mainlocation.Themoremodernnetworksarebidirectional,alsoenabling
controlofsensoractivity.Thedevelopmentofwirelesssensornetworkswas
motivatedbymilitaryapplicationssuchasbattlefieldsurveillance;todaysuch
networksareusedinmanyindustrialandconsumerapplications,suchas
industrialprocessmonitoringandcontrol,machinehealthmonitoring,andso
on.

TheWSNisbuiltof"nodes"fromafewtoseveralhundredsoreven
thousands,whereeachnodeisconnectedtoone(orsometimesseveral)
sensors.Eachsuchsensornetworknodehastypicallyseveralparts:aradio
transceiverwithaninternalantennaorconnectiontoanexternalantenna,a
microcontroller,anelectroniccircuitforinterfacingwiththesensorsandan
energysource,usuallyabatteryoranembeddedformofenergyharvesting.A
sensornodemightvaryinsizefromthatofashoeboxdowntothesizeofa
grainofdust,althoughfunctioning"motes"ofgenuinemicroscopicdimensions
haveyettobecreated.Thecostofsensornodesissimilarlyvariable,ranging
fromafewtohundredsofdollars,dependingonthecomplexityofthe
individualsensornodes.Sizeandcostconstraintsonsensornodesresultin
correspondingconstraintsonresourcessuchasenergy,memory,computational
speedandcommunicationsbandwidth.ThetopologyoftheWSNscanvary
fromasimplestarnetworktoanadvancedmultihopwirelessmeshnetwork.
Thepropagationtechniquebetweenthehopsofthenetworkcanberoutingor
flooding.

Cloudcomputing

Cloudcomputing,alsoondemandcomputing,isakindofInternetbased
computingthatprovidessharedprocessingresourcesanddatatocomputersand
otherdevicesondemand.Itisamodelforenablingubiquitous,ondemand
accesstoasharedpoolofconfigurablecomputingresources(e.g.,networks,
servers,storage,applicationsandservices),whichcanberapidlyprovisioned
andreleasedwithminimalmanagementeffort.Cloudcomputingandstorage
solutionsprovideusersandenterpriseswithvariouscapabilitiestostoreand
processtheirdatainthirdpartydatacenters.[3]Itreliesonsharingofresources
toachievecoherenceandeconomyofscale,similartoautility(likethe
electricitygrid)overanetwork.

InfrastructureasaService(IaaS)

InthemostbasiccloudservicemodelandaccordingtotheIETF
(InternetEngineeringTaskForce)providersofIaaSoffercomputers
physicalor(moreoften)virtualmachinesandotherresources.
IaaSreferstoonlineservicesthatabstracttheuserfromthedetailsof
infrastructurelikephysicalcomputingresources,location,data
partitioning,scaling,security,backupetc.Ahypervisor,suchasXen,
OracleVirtualBox,OracleVM,KVM,VMwareESX/ESXi,orHyper
Vrunsthevirtualmachinesasguests.Poolsofhypervisorswithinthe
cloudoperationalsystemcansupportlargenumbersofvirtual
machinesandtheabilitytoscaleservicesupanddownaccordingto
customers'varyingrequirements.IaaScloudsoftenofferadditional
resourcessuchasavirtualmachinediskimagelibrary,rawblock
storage,fileorobjectstorage,firewalls,loadbalancers,IPaddresses,
virtuallocalareanetworks(VLANs),andsoftwarebundles.[63]IaaS
cloudproviderssupplytheseresourcesondemandfromtheirlarge
poolsofequipmentinstalledindatacenters.Forwidearea
connectivity,customerscanuseeithertheInternetorcarrierclouds
(dedicatedvirtualprivatenetworks).

PlatformasaService(PaaS)

PaaS vendors offer a development environment to application


developers.Theprovidertypicallydevelopstoolkitandstandardsfor
developmentandchannelsfordistributionandpayment.InthePaaS
models, cloud providers deliver a computing platform, typically
including operating system, programminglanguage execution
environment, database, and web server. Application developers can
developandruntheirsoftwaresolutionsonacloudplatformwithout
the cost and complexity of buying and managing the underlying
hardwareandsoftwarelayers.WithsomePaaSofferslike Microsoft
Azure and GoogleAppEngine,theunderlyingcomputerandstorage
resourcesscaleautomaticallytomatchapplicationdemandsothatthe
clouduserdoesnothavetoallocateresourcesmanually.Thelatterhas
alsobeenproposedbyanarchitectureaimingtofacilitaterealtimein
cloud environments. Even more specific application types can be
providedviaPaaS,suchasmediaencodingasprovidedbyserviceslike
bitcodin.comormedia.io.

SoftwareasaService(SaaS)

In the software as a service (SaaS) model, users gain access to


application software and databases. Cloud providers manage the
infrastructure and platforms that run the applications. SaaS is
sometimesreferredtoas"ondemandsoftware"andisusuallypriced
onapayperusebasisorusingasubscriptionfee.]

In the SaaS model, cloud providers install and operate application


softwareinthecloudandcloudusersaccessthesoftwarefromcloud
clients. Cloud users do not manage the cloud infrastructure and
platformwheretheapplicationruns.Thiseliminatestheneedtoinstall
and run the application on the cloud user's own computers, which
simplifies maintenance and support. Cloud applications differ from
other applications in their scalabilitywhich can be achieved by
cloning tasks onto multiple virtual machines at runtime to meet
changingworkdemand.Loadbalancersdistributetheworkovertheset
ofvirtualmachines.Thisprocessistransparenttotheclouduser,who
seesonlyasingleaccesspoint.Toaccommodatealargenumberof
cloudusers,cloudapplicationscanbe multitenant,meaningthatany
machinemayservemorethanoneclouduserorganization.

BigdataAnalytics

Characteristicsofbigdata:volume,velocity,variety

Big data analytics is the process of examining large data sets


containingavarietyofdatatypesi.e.,bigdatatouncoverhidden
patterns, unknown correlations, market trends, customer preferences
andotherusefulbusinessinformation.Theanalyticalfindingscanlead
to more effective marketing, new revenue opportunities, better
customer service, improved operational efficiency, competitive
advantagesoverrivalorganizationsandotherbusinessbenefits.

CommunicationProtocols

Intelecommunications,acommunicationsprotocolisasystemofrulesthat
allowtwoormoreentitiesofacommunicationssystemtotransmitinformation
viaanykindofvariationofaphysicalquantity.Thesearetherulesorstandard
thatdefinesthesyntax,semanticsandsynchronizationofcommunicationand
possibleerrorrecoverymethods.Protocolsmaybeimplementedbyhardware,
software,oracombinationofboth.

Communicatingsystemsusewelldefinedformats(protocol)forexchanging
messages.Eachmessagehasanexactmeaningintendedtoelicitaresponse
fromarangeofpossibleresponsespredeterminedforthatparticularsituation.
Thespecifiedbehavioristypicallyindependentofhowitistobeimplemented.
Communicationsprotocolshavetobeagreeduponbythepartiesinvolved.To
reachagreement,aprotocolmaybedevelopedintoatechnicalstandard.A
programminglanguagedescribesthesameforcomputations,sothereisaclose
analogybetweenprotocolsandprogramminglanguages:protocolsareto
communicationsasprogramminglanguagesaretocomputations.

EmbeddedSystem

Anembeddedsystemisacomputersystemwithadedicatedfunctionwithina
largermechanicalorelectricalsystem,oftenwithrealtimecomputing
constraints.Itisembeddedaspartofacompletedeviceoftenincluding
hardwareandmechanicalparts.Embeddedsystemscontrolmanydevicesin
commonusetoday.98percentofallmicroprocessorsaremanufacturedas
componentsofembeddedsystems.

Examplesofpropertiesoftypicallyembeddedcomputerswhencomparedwith
generalpurposecounterpartsarelowpowerconsumption,smallsize,rugged
operatingranges,andlowperunitcost.Thiscomesatthepriceoflimited
processingresources,whichmakethemsignificantlymoredifficulttoprogram
andtointeractwith.However,bybuildingintelligencemechanismsontopof
thehardware,takingadvantageofpossibleexistingsensorsandtheexistenceof
anetworkofembeddedunits,onecanbothoptimallymanageavailable
resourcesattheunitandnetworklevelsaswellasprovideaugmented
functions,wellbeyondthoseavailable.Forexample,intelligenttechniquescan
bedesignedtomanagepowerconsumptionofembeddedsystems.

IoTLevels

IoTSystemcomprisesofthefollowingcomponents:

Device

Resource

ControllerService

Database

WebService

Stateless/Stateful

Unidirectional/Bidirectional

RequestResponse/FullDuplex

TCPconnection

Headeroverhead

Scalability

Analysiscomponent

Application
IoTLevel1

Locationtechnologiescanbeusedtoprovideacontexttoanapplication.The
applicationcanusethelocationtopresenttheuserwithappropriatedataand
actionsthatarerelevanttotheminthatlocation.Therearethreekeypiecesof
thepuzzlehere.Firstly,whoistheuser?Isitanengineer,aloyalcustomeror
anotherstakeholder?Secondly,whatisthecontext?Isitaspecificlocationina
building,oraspecificpieceofequipmentorthing?Whereisthedatacoming
from,isitopendatafeedsordatafeedsthatthecompanyhascontroloraccess
to?Thirdly,whatinformationisimportantatthattime?Whatdoestheuser
needandhowareyougoingtogetthatdataandpresentittothem,tohelpthem
orhelpthebusiness?

Atthislevel,themostbasiclevel,thingsaregivencontextandtheabilityto
maketheirawarenessknown,connectingdigitalandphysicalthingstogether.

IoTLevel2

Atthesecondlevel,environmentalawareness,drivenbyvariousdifferent
sensorsisadded.Ourphonesalreadyhavethiscapability,toanextent,butat
thislevel,theenvironmentisalsotalkingtothephoneandtellingitaboutits
status.Thismayalsobetakentoanotherlevel,wheretheuserdoesntneedto
bephysicallythere,butthespacecanstillsendinformationbacktoabackend
system.Forexample,acompanyisabletomonitortheirentireinfrastructure
remotely,withoutemployeesbeingthere.Thisisoneofthemostcommon
formsofInternetofThings,especiallywithinlargemanufacturing,engineering
orutilityfirms.

Thisisalreadylargelyusedwithweathersystems,totrackchangesinthe
weatherandislargelyusedthroughouttheagricultureindustry.
IoTLevel3

ThethirdlevelofIoTislinkedwithremotecontrolofenvironmentandthings,
whethersomeoneisinaphysicalspaceorsittinginanoffice5,000milesaway.
Thisisbeingseenincreasinglyintheautomotiveandsmarthomeindustry,
wherepeoplecanmonitorthestatusoftheircarsorhomes,turnonheating,or
controlthelightingandotherelements.

Thisisalsoseeninlargescalemodernfactoriesandevenofficesthathave
smartheatingsystems,smartprintersandsecuritysystems.Thethirdlevelis
alsoaboutalevelofintelligencewithinremotesystemsandthings;wherethey
cantellauserorabackendsystemwhentheyaredevelopinganissueand
whentheyneedhelp.Atthislevel,itgoesbeyondawareness,from
communicationtoinsight,mixedwithcontrol.

TogetstartedwithIoTconsiderthelevels.Whatlevelareyoutryingto
achieveandisitlogicaltoworkthroughlevelonetothreeinalinearfashion?
Orisitaboutexperimentingandlearningasyougo?Thereisanargumentfor
jumpingstraightinatleveltwoandthree,butthiswilldependonthecurrent
infrastructureandcapability.

Whatisinterestingtonoteisthattogetstartedisrelativelystraightforward.
Therearewaysandmeanstoproveconcepts,technologiesanduser
experienceswithoutspendingafortune.Experimentingandaimingtoproveor
disproveacaseisgreatwaytostartexploringthepossible.

IoTLevel4

Alevel4IoTsystemhasmultiplenodesthatperformlocalanalysis.Level4
containslocalandcloudbasedobservernodeswhichcansubscribetoand
receiveinformationcollectedinthecloudfromIoTdevices.

IoTLevel5
Alevel5IoTsystemhasmultipleendnodesandonecoordinatornode.The
endnodeperformsensingand/oractuation.Coordinatornodecollectsdata
fromtheendnodesandsendstothecloud.

IoTLevel6

Alevel6IoTsystemhasmultipleindependentendnodesthatperformsensing
and/oractuationandsenddatatothecloud.

Questions

1. Describe an example of an IoT system in which information and


knowledgeareinferredfromdata.

2. WhydoIoTsystemshavetobeselfadaptingandselfconfiguring?

3. WhatistheroleofthingsandInternetinIoT?

4. What is the functioon ofcommunication functional block in an IoT


system?

5. Describe an example of IoT service that uses publishsubscribe


communicationmodel.

6. Describe an example of IoT service that uses WebSocketbased


communication.

7. WhatarethearchitecturalconstraintsofREST?

8. Whatistheroleofacoordinatorinwirelesssensornetwork?

9. WhatistheroleofcontrollerserviceinanIoTsystem
UnitII

DomainSpecificIOTs:

HomeAutomation
Homeautomationistheuseandcontrolofhomeappliancesremotelyor
automatically.Earlyhomeautomationbeganwithlaboursavingmachineslike
washingmachines.Somehomeautomationappliancesarestandaloneanddo
notcommunicate,suchasaprogrammablelightswitch,whileothersarepartof
theinternetofthingsandarenetworkedforremotecontrolanddatatransfer.
Hardwaredevicescanincludesensors(likecamerasandthermometers),
controllers,actuators(todothings),andcommunicationsystems.Remote
controlcanrangefromasimpleremotecontroltoasmartphonewith
Bluetooth,toacomputerontheothersideoftheworldconnectedbyinternet.
Homeautomationsystemsareavailablewhichconsistofasuiteofproducts
designedtoworktogether.ThesetypicallyconnectedthroughWiFiorpower
linecommunicationtoahubwhichisthenaccessedwithasoftware
application.Popularapplicationsincludethermostats,securitysystems,blinds,
lighting,smoke/COdetectors,anddoorlocks.[1]Popularsuitesofproducts
includeX10,ZWave,andZigbeeallofwhichareincompatiblewitheach
other.Homeautomationisthedomesticapplicationofbuildingautomation

SmartLighting

SmartAppliances

Intrusiondetection

Smoke/Gasdetectors
Cities

Asmartcityisanurbandevelopmentvisiontointegratemultipleinformation
andcommunicationtechnology(ICT)solutionsinasecurefashiontomanagea
citysassetsthecitysassetsinclude,butnotlimitedto,localdepartments
informationsystems,schools,libraries,transportationsystems,hospitals,power
plants,watersupplynetworks,wastemanagement,lawenforcement,andother
communityservices.Thegoalofbuildingasmartcityistoimprovequalityof
lifebyusingtechnologytoimprovetheefficiencyofservicesandmeet
residentsneeds.ICTallowscityofficialstointeractdirectlywiththe
communityandthecityinfrastructureandtomonitorwhatishappeninginthe
city,howthecityisevolving,andhowtoenableabetterqualityoflife.
Throughtheuseofsensorsintegratedwithrealtimemonitoringsystems,data
arecollectedfromcitizensanddevicesthenprocessedandanalyzed.The
informationandknowledgegatheredarekeystotacklinginefficiency.
ICTisusedtoenhancequality,performanceandinteractivityofurbanservices,
toreducecostsandresourceconsumptionandtoimprovecontactbetween
citizensandgovernment.Smartcityapplicationsaredevelopedwiththegoalof
improvingthemanagementofurbanflowsandallowingforrealtimeresponses
tochallenges.Asmartcitymaythereforebemorepreparedtorespondto
challengesthanonewithasimple'transactional'relationshipwithitscitizens.
Yet,thetermitselfremainsuncleartoitsspecificsandtherefore,opentomany
interpretationsandsubject

Smartparking

SmartLighting

Smartroads

Structuralhealthmonitoring

Surveillance

EmergencyResponse

Environment

Theconceptofsmartenvironmentsevolvesfromthedefinitionofubiquitous
computingthat,accordingtoMarkWeiser,promotestheideasof"aphysical
worldthatisrichlyandinvisiblyinterwovenwithsensors,actuators,displays,
andcomputationalelements,embeddedseamlesslyintheeverydayobjectsof
ourlives,andconnectedthroughacontinuousnetwork."[1]

Smartenvironmentsareenvisionedasthebyproductofpervasivecomputing
andtheavailabilityofcheapcomputingpower,makinghumaninteractionwith
thesystemapleasantexperience.

Smartenvironmentsarebroadlyclassifiedtohavethefollowingfeatures
1 Remotecontrolofdevices,likepowerlinecommunicationsystemsto
controldevices.

2 DeviceCommunication,usingmiddleware,andWireless
communicationtoformapictureofconnectedenvironments.

3 InformationAcquisition/Disseminationfromsensornetworks

4 EnhancedServicesbyIntelligentDevices

5 PredictiveandDecisionMakingcapabilities

WeatherMonitoring

AirpollutionMonitoring

NoisepollutionMonitoring

ForestFiredetection

RiverFloodsDetection

Energy

SmartGrids

Asmartgridisanelectricalgridwhichincludesavarietyof
operationalandenergymeasuresincludingsmartmeters,smart
appliances,renewableenergyresources,andenergyefficiency
resources.Electronicpowerconditioningandcontroloftheproduction
anddistributionofelectricityareimportantaspectsofthesmartgrid.
SmartgridpolicyisorganizedinEuropeasSmartGridEuropean
TechnologyPlatform.

Rolloutofsmartgridtechnologyalsoimpliesafundamentalre
engineeringoftheelectricityservicesindustry,althoughtypicalusage
ofthetermisfocusedonthetechnicalinfrastructure.

RenewableEnergySystems

Prognostics

Retail

IoThascaughttheimaginationoftechnologyenthusiastsandtherearemany
predictionsofhowitmightrevolutionizeindustriesandpracticesasweknow
themtoday.Theretailindustryhasalreadyundergoneawaveofdisruption
withtheonsetofecommerceandonlineretail.ThereiseverychancethatIoT
heraldsthenextwaveofdisruptionalongthefollowingareasinretail:
SupplyChainManagement
Inventory&WarehouseManagement
Marketing
InStoreExperience

Inventorymanagement

Smartpayments

Smartvendingmachines

Logistics
RouteGeneration&Scheduling

Fleettracking

ShipmentMonitoring

RemoteVehicleDiagnostics

Agriculture
AgriculturehasbeenevolvingwithnewtechnologysuchastheInternetof
Things(IoT).Forexample,greenhousesareconnectedtoeachother,andtheir
environmentsarecontrolledautomaticallyandoptimizedforthebestqualityof
agriculturalproducts.Inaddition,theadvancedcattleshedsarebuiltbasedon
theIoTtechnologies.Theseeffortsenhancethequalityandsafetyof
agriculturalproductsandmitigateinformationasymmetrybetweenproducers
andconsumers.

SmartIrrigation

GreenHousecontrol

Industry
MachineDiagnosisandprognosis

Indoorairqualitymonitoring
Health&LifeStyle
Health&Fittnessmonitoring

Wearableelectronics

Questions

1. DeterminetheIoTlevelsfordesigninghomeautomationIoTsystems
includingsmartleghtingandintrusiondetection.

2. DeterminetheIoTlevelsfordesigningstructuralhealthmonitoring
system.

3. Determinevariouscommunicationmodelsthatcanbeusedforweather
monitoringsystem.Whatismoreappropriatemodelforthissystem.
Describetheprosandcons.

4. Determinethetypeofdatageneratedbyaforestfiredetectionsystem?
Describealternativeapproachesforstoringthedata.Whattypeof
analysisisrequiredforforestfiredetectionfromthedatacollected.
UnitIII

M2M&SystemManagementwithNETCONFYANG:

M2M
TheaptlynamedIoTsubsetM2Minitiallyrepresentedclosed,pointtopoint
communicationbetweenphysicalfirstobjects.Theexplosionofmobile
devicesandIPbasedconnectivitymechanismshasenableddatatransmission
acrossasystemofnetworks.M2Mismorerecentlyreferredtotechnologies
thatenablecommunicationbetweenmachineswithouthumanintervention.
Examplesincludetelemetry,trafficcontrol,robotics,andotherapplications
involvingdevicetodevicecommunications.
DifferencebetweenIOTandM2M
1. Communicationprotocols

2. MachinesinM2MvsThingsinIoT

3. HardwarevsSoftwareEmphasis

4. DataCollection&Analysis

5. Applications
SDNandNFVforIOT

SoftwaredefinedNetworking(SDN)

SoftwareDefinedNetworking(SDN)isanemergingarchitecturethatis
dynamic,manageable,costeffective,andadaptable,makingitidealforthe
highbandwidth,dynamicnatureoftoday'sapplications.Thisarchitecture
decouplesthenetworkcontrolandforwardingfunctionsenablingthenetwork
controltobecomedirectlyprogrammableandtheunderlyinginfrastructureto
beabstractedforapplicationsandnetworkservices.TheOpenFlowprotocol
isafoundationalelementforbuildingSDNsolutions.TheSDNarchitectureis:

Directlyprogrammable:Networkcontrolisdirectlyprogrammable
becauseitisdecoupledfromforwardingfunctions.

Agile:Abstractingcontrolfromforwardingletsadministrators
dynamicallyadjustnetworkwidetrafficflowtomeetchangingneeds.

Centrallymanaged:Networkintelligenceis(logically)centralizedin
softwarebasedSDNcontrollersthatmaintainaglobalviewofthe
network,whichappearstoapplicationsandpolicyenginesasasingle,
logicalswitch.

Programmaticallyconfigured:SDNletsnetworkmanagersconfigure,
manage,secure,andoptimizenetworkresourcesveryquicklyvia
dynamic,automatedSDNprograms,whichtheycanwritethemselves
becausetheprogramsdonotdependonproprietarysoftware.

Openstandardsbasedandvendorneutral:Whenimplemented
throughopenstandards,SDNsimplifiesnetworkdesignandoperation
becauseinstructionsareprovidedbySDNcontrollersinsteadof
multiple,vendorspecificdevicesandprotocols.

Limitationsoftheconventionalnetworkarchitectures:

ComplexNetworkDevices

managementOverhead
LimitedScalability

KeyelementsofSDN

CentralizednetworkController

ProgrammableOpenAPIs

StandardCommunicationInterface(OpenFlow)

NetworkFunctionVirtualization(NFV)

Networkfunctionvirtualization(NFV)isanetworkarchitectureconceptthat
usesthetechnologiesofITvirtualizationtovirtualizeentireclassesofnetwork
nodefunctionsintobuildingblocksthatmayconnect,orchaintogether,to
createcommunicationservices.

NFVreliesupon,butdiffersfrom,traditionalservervirtualizationtechniques,
suchasthoseusedinenterpriseIT.Avirtualizednetworkfunction,orVNF,
mayconsistofoneormorevirtualmachinesrunningdifferentsoftwareand
processes,ontopofstandardhighvolumeservers,switchesandstorage,or
evencloudcomputinginfrastructure,insteadofhavingcustomhardware
appliancesforeachnetworkfunction.

Forexample,avirtualsessionbordercontrollercouldbedeployedtoprotecta
networkwithoutthetypicalcostandcomplexityofobtainingandinstalling
physicalunits.OtherexamplesofNFVincludevirtualizedloadbalancers,
firewalls,intrusiondetectiondevicesandWANaccelerators.
KeyelementsofNFVarchitecture

VirtualizedNetworkFunction(VNF)

NFVInfrastructure(NFVI)

NFVManagementandOrchestration

NeedforIOTSystemsManagement

AutomatingConfiguration

MonitoringOperational&statisticaldata

ImprovedReliablity

SystemWideConfiguration

MultipleSystemConfiguration

Retrievingandreusingconfiguration

SimpleNetworkManagementProtocol(SNMP)
SimpleNetworkManagementProtocol(SNMP)isanInternetstandard
protocolforcollectingandorganizinginformationaboutmanageddeviceson
IPnetworksandformodifyingthatinformationtochangedevicebehavior.
DevicesthattypicallysupportSNMPincluderouters,switches,servers,
workstations,printers,modemracksandmore.

SNMPiswidelyusedinnetworkmanagementsystemstomonitornetwork
attacheddevicesforconditionsthatwarrantadministrativeattention.SNMP
exposesmanagementdataintheformofvariablesonthemanagedsystems,
whichdescribethesystemconfiguration.Thesevariablescanthenbequeried
(andsometimesset)bymanagingapplications.

LimitationsofSNMP

SNMPisstateless

SNMPisconnectionless,sounreliable

SNMPcanbeusedonlyfordevicemonitoringandstatuspolling.

Itisdifficulttodifferentiatebetweenconfigurationandststedatain
MIBs.

SNMPdoesnotsupporteasyretrievalandplaybackofconfigurations.

SNMP latest version have security addede at the cost of increased


complexity.

NetworkOperatorRequirements

Easeofuse

Distinctionbetweenconfigurationandstatedata.
Fetchandstatedataseperately

configurationofthenetworkasawhole

configurationtransactionsacrossdevices

configurationdeltas

Dumpandrestoreconfigurations

configurationvalidation

configurationdatabaseschemas

Comparingconfigurations

Rolebasedaccesscontrollists

Multipleconfigurationsets

Supportforbothdataorientedandtaskorientedaccesscontrol

NETCONF

TheNetworkConfigurationProtocol(NETCONF)isanetworkmanagement
protocoldevelopedandstandardizedbytheIETF.Itwasdevelopedinthe
NETCONFworkinggroupandpublishedinDecember2006asRFC4741and
laterrevisedinJune2011andpublishedasRFC6241.TheNETCONF
protocolspecificationisanInternetStandardsTrackdocument.

NETCONFprovidesmechanismstoinstall,manipulate,anddeletethe
configurationofnetworkdevices.Itsoperationsarerealizedontopofasimple
remoteprocedurecall(RPC)layer.TheNETCONFprotocolusesanExtensible
MarkupLanguage(XML)baseddataencodingfortheconfigurationdataas
wellastheprotocolmessages.Theprotocolmessagesareexchangedontopof
asecuretransportprotocol.
TheNETCONFprotocolcanbeconceptuallypartitionedintofourlayers:

1. TheContentlayerconsistsofconfigurationdataandnotificationdata.

2. TheOperationslayerdefinesasetofbaseprotocoloperationsto
retrieveandedittheconfigurationdata.

3. TheMessageslayerprovidesamechanismforencodingremote
procedurecalls(RPCs)andnotifications.

4. TheSecureTransportlayerprovidesasecureandreliabletransportof
messagesbetweenaclientandaserver.

TheNETCONFprotocolhasbeenimplementedinnetworkdevicessuchas
routersandswitchesbysomemajorequipmentvendors.Oneparticular
strengthofNETCONFisitssupportforrobustconfigurationchange
transactionsinvolvinganumberofdevices.
YANG

YANGisadatamodelinglanguagefortheNETCONFnetworkconfiguration
protocol.Thenameisanacronymfor"YetAnotherNextGeneration".The
YANGdatamodelinglanguagewasdevelopedbytheNETMODworking
groupintheInternetEngineeringTaskForce(IETF)andwaspublishedasRFC
6020inOctober2010.Thedatamodelinglanguagecanbeusedtomodelboth
configurationdataaswellasstatedataofnetworkelements.Furthermore,
YANGcanbeusedtodefinetheformatofeventnotificationsemittedby
networkelementsanditallowsdatamodelerstodefinethesignatureofremote
procedurecallsthatcanbeinvokedonnetworkelementsviatheNETCONF
protocol.

YANGisamodularlanguagerepresentingdatastructuresinanXMLtree
format.Thedatamodelinglanguagecomeswithanumberofbuiltindatatypes.
Additionalapplicationspecificdatatypescanbederivedfromthebuiltindata
types.Morecomplexreusabledatastructurescanberepresentedasgroupings.
YANGdatamodelscanuseXPATHexpressionstodefineconstraintsonthe
elementsofaYANGdatamodel.

IoTSystemsmanagementwithNETCONFYANG.

ManagementSystem

ManagementAPI

TransactionManager

RollbackManager

DataModelManager

ConfigurationValidator

ConfigurationDatabase

ConfigurationAPI

DataProviderAPI

NETOPEER

NetopeerserveristheleadingopensourceNETCONFreference
implementation.Ithasmanyfeaturesbutsometimesitmayprovetobea
challengingtasktogatherallpiecesandgetitinstalledsuccessfullyonyour
Linuxbox.

TheNetofeertoolsinclude

Netopeerserver

Netopeeragent

Netopeercli

Netopeermanager

Netopeerconfigurator
Questions:

1. WhichcommunicationprotocolsareusedforM2Mlocalarea
networks?

2. WhatarethedifferencesbetweenMachinesinM2MandThingsin
IoT?

3. HowdodatacollectionandanalysisapproachesdifferinM2Mand
IoT?

4. WhatarethedifferencesbetweenSDNandNFV?

5. DescribehowSDNcanbeusedforvariouslevelsofIoT?

6. WhatisthefunctionofacentralizednetworkcontrollerinSDN?

7. DescribehowNFVcanbeusedforvirtualizingIoTdevices?

8. WhyisnetworkwideconfigurationimportantforIoTsystemswith
multiplenodes?

9. WhichlimitationmakeSNMPunsuitableforIoTsystems?

10. Whatisthedifferencebetweenconfigurationandstatedata?

11. WhatistheroleofaNETCONFserver?

12. Whatisthefunctionofadatamodelmanager?

13. DescribetherolesofYANGandTransAPImodulesindevice
management.

UnitIV

DevelopingInternetofThings&LogicalDesignusingPython:

IOTDesignMethodology
Step1:Purpose&RequirementsSpecification

Step2:Processspecification

Step3:DomainModelSpecification

Step4:InformationModelSpecification

Step5:ServiceSpecifications

Step6:IoTLevelSpecification

Step7:FunctionalViewSpecification

Step8:OperationalViewSpecification

Step9:DeviceandComponentIntegration

Step10:ApplicationDevelopment

FeaturesofPython

Simple

Pythonisasimpleandminimalisticlanguage.ReadingagoodPythonprogram
feelsalmostlikereadingEnglish,althoughverystrictEnglish!Thispseudo
codenatureofPythonisoneofitsgreateststrengths.Itallowsyouto
concentrateonthesolutiontotheproblemratherthanthelanguageitself.

EasytoLearn

Asyouwillsee,Pythonisextremelyeasytogetstartedwith.Pythonhasan
extraordinarilysimplesyntax,asalreadymentioned.

FreeandOpenSource

PythonisanexampleofaFLOSS(Free/LibrandOpenSourceSoftware).
Insimpleterms,youcanfreelydistributecopiesofthissoftware,readit's
sourcecode,makechangestoit,usepiecesofitinnewfreeprograms,andthat
youknowyoucandothesethings.FLOSSisbasedontheconceptofa
communitywhichsharesknowledge.ThisisoneofthereasonswhyPythonis
sogoodithasbeencreatedandisconstantlyimprovedbyacommunitywho
justwanttoseeabetterPython.

HighlevelLanguage

WhenyouwriteprogramsinPython,youneverneedtobotheraboutthelow
leveldetailssuchasmanagingthememoryusedbyyourprogram,etc.

Portable

Duetoitsopensourcenature,Pythonhasbeenported(i.e.changedtomakeit
workon)tomanyplatforms.AllyourPythonprogramscanworkonanyof
theseplatformswithoutrequiringanychangesatallifyouarecarefulenough
toavoidanysystemdependentfeatures.

YoucanusePythononLinux,Windows,FreeBSD,Macintosh,Solaris,OS/2,
Amiga,AROS,AS/400,BeOS,OS/390,z/OS,PalmOS,QNX,VMS,Psion,
AcornRISCOS,VxWorks,PlayStation,SharpZaurus,WindowsCEandeven
PocketPC!

Interpreted

Thisrequiresabitofexplanation.

AprogramwritteninacompiledlanguagelikeCorC++isconvertedfromthe
sourcelanguagei.e.CorC++intoalanguagethatisspokenbyyourcomputer
(binarycodei.e.0sand1s)usingacompilerwithvariousflagsandoptions.
Whenyouruntheprogram,thelinker/loadersoftwarecopiestheprogramfrom
harddisktomemoryandstartsrunningit.
Python,ontheotherhand,doesnotneedcompilationtobinary.Youjustrun
theprogramdirectlyfromthesourcecode.Internally,Pythonconvertsthe
sourcecodeintoanintermediateformcalledbytecodesandthentranslatesthis
intothenativelanguageofyourcomputerandthenrunsit.Allthis,actually,
makesusingPythonmucheasiersinceyoudon'thavetoworryaboutcompiling
theprogram,makingsurethattheproperlibrariesarelinkedandloaded,etc,
etc.ThisalsomakesyourPythonprogramsmuchmoreportable,sinceyoucan
justcopyyourPythonprogramontoanothercomputeranditjustworks!

ObjectOriented

Pythonsupportsprocedureorientedprogrammingaswellasobjectoriented
programming.Inprocedureorientedlanguages,theprogramisbuiltaround
proceduresorfunctionswhicharenothingbutreusablepiecesofprograms.In
objectorientedlanguages,theprogramisbuiltaroundobjectswhichcombine
dataandfunctionality.Pythonhasaverypowerfulbutsimplisticwayofdoing
OOP,especiallywhencomparedtobiglanguageslikeC++orJava.

Extensible

Ifyouneedacriticalpieceofcodetorunveryfastorwanttohavesomepiece
ofalgorithmnottobeopen,youcancodethatpartofyourprograminCorC+
+andthenusethemfromyourPythonprogram.

Embeddable

YoucanembedPythonwithinyourC/C++programstogive'scripting'
capabilitiesforyourprogram'susers.

ExtensiveLibraries

ThePythonStandardLibraryishugeindeed.Itcanhelpyoudovariousthings
involvingregularexpressions,documentationgeneration,unittesting,
threading,databases,webbrowsers,CGI,ftp,email,XML,XMLRPC,HTML,
WAVfiles,cryptography,GUI(graphicaluserinterfaces),Tk,andother
systemdependentstuff.Remember,allthisisalwaysavailablewherever
Pythonisinstalled.Thisiscalledthe'BatteriesIncluded'philosophyofPython.

Besides,thestandardlibrary,therearevariousotherhighqualitylibrariessuch
aswxPython,Twisted,PythonImagingLibraryandmanymore.

PythonDataTypes&DataStructures

Numbers

Numberdatatypesstorenumericvalues.Theyareimmutabledata
types,meansthatchangingthevalueofanumberdatatyperesultsina
newlyallocatedobject.

Pythonsupportsdifferentnumericaltypes

int(signedintegers):Theyareoftencalledjustintegersorints,are
positiveornegativewholenumberswithnodecimalpoint.Integersin
Python3areofunlimitedsize.Python2hastwointegertypesintand
long.Thereisno'longinteger'inPython3anymore.

float(floatingpointrealvalues):Alsocalledfloats,theyrepresentreal
numbersandarewrittenwithadecimalpointdividingtheintegerand
fractionalparts.Floatsmayalsobeinscientificnotation,withEore
indicatingthepowerof10(2.5e2=2.5x102=250).

complex(complexnumbers):areoftheforma+bJ,whereaandbare
floatsandJ(orj)representsthesquarerootof1(whichisanimaginary
number).Therealpartofthenumberisa,andtheimaginarypartisb.
ComplexnumbersarenotusedmuchinPythonprogramming.
Strings

StringsareamongstthemostpopulartypesinPython.Wecancreate
themsimplybyenclosingcharactersinquotes.Pythontreatssingle
quotesthesameasdoublequotes.Creatingstringsisassimpleas
assigningavaluetoavariable.

#!/usr/bin/python3

var1='HelloWorld!'

var2="PythonProgramming"

print("var1[0]:",var1[0])print("var2[1:5]:",var2[1:5])

Lists

ThelistisamostversatiledatatypeavailableinPythonwhichcanbe
writtenasalistofcommaseparatedvalues(items)betweensquare
brackets.Importantthingaboutalististhatitemsinalistneednotbe
ofthesametype.

Creatingalistisassimpleasputtingdifferentcommaseparatedvalues
betweensquarebrackets.Forexample

list1=['physics','chemistry',1997,2000];

list2=[1,2,3,4,5];

list3=["a","b","c","d"]

Tuples

AtupleisasequenceofimmutablePythonobjects.Tuplesare
sequences,justlikelists.Thedifferencesbetweentuplesandlistsare,
thetuplescannotbechangedunlikelistsandtuplesuseparentheses,
whereaslistsusesquarebrackets.

Creatingatupleisassimpleasputtingdifferentcommaseparated
values.Optionallyyoucanputthesecommaseparatedvaluesbetween
parenthesesalso.Forexample

tup1=('physics','chemistry',1997,2000);

tup2=(1,2,3,4,5);

tup3="a","b","c","d";

Theemptytupleiswrittenastwoparenthesescontainingnothing

tup1=();

Towriteatuplecontainingasinglevalueyouhavetoincludea
comma,eventhoughthereisonlyonevalue

tup1=(50,);

Likestringindices,tupleindicesstartat0,andtheycanbesliced,
concatenated,andsoon.

Dictionaries

Eachkeyisseparatedfromitsvaluebyacolon(:),theitemsare
separatedbycommas,andthewholethingisenclosedincurlybraces.
Anemptydictionarywithoutanyitemsiswrittenwithjusttwocurly
braces,likethis:{}.

Keysareuniquewithinadictionarywhilevaluesmaynotbe.The
valuesofadictionarycanbeofanytype,butthekeysmustbeofan
immutabledatatypesuchasstrings,numbers,ortuples.

Toaccessdictionaryelements,youcanusethefamiliarsquarebrackets
alongwiththekeytoobtainitsvalue.Followingisasimpleexample

#!/usr/bin/python

dict={'Name':'Zara','Age':7,'Class':'First'}

print"dict['Name']:",dict['Name']print"dict['Age']:",dict['Age']

Whentheabovecodeisexecuted,itproducesthefollowingresult

dict['Name']:Zara

dict['Age']:7

Typeconversion

BelowisatableoftheconversionfunctionsinPythonandtheir
examples.

Function Convertingwhattowhat Example

>>>int('2014')2014>>>
string,floatingpoint
int() int(3.141592)3
integer

string,integerfloating >>>float('1.99')1.99>>>float(5)5.0
float()
pointnumber

>>>str(3.141592)'3.141592'>>>
integer,float,list,tuple,
str() str([1,2,3,4])'[1,2,3,4]'
dictionarystring

>>>list('Mary')#listofcharacters
in'Mary'['M','a','r','y']>>>
list() string,tuple,dictionarylist list((1,2,3,4))#(1,2,3,4)isa
tuple[1,2,3,4]

>>>tuple('Mary')('M','a','r','y')>>>
tuple([1,2,3,4])#[]forlist,()for
tuple() string,listtuple
tuple(1,2,3,4)

ControlFlow

ifstatement
Pythonprovidevarioustoolsforflowcontrol.Someofthemareif,
if..elif..else,if..else,while,for,switch,pass,range,break,else,
continue,functionetc.InthisarticleIllbecoveringonlyifelseand
loops.

ififthisisthecasethendothis

Thiscontrolstatementindicatethatifsomethinghappensthendothis.
Itsagoodwayofhandlingsomeshortconditions.Anifblockcanbe
followedbyzerooranynumberofelseblock.

if(condition):

statements

Note:Useofcolon(":")inpythonissameasweusebracketsinjava
orC++.Pythonusescolonandindentationfordefiningthescopeor
codeblock.Soifyouaregettinganerrorlikethefollowingpicture
thencorrectyourcodeindentation.

ifelse

Itslikeifhavemoneythenspendelsewaitforsalary.Ihopeitsclear
fromthepreviouslinewhatthisstatementmeans.Itslikeifthe
conditionsofifblockisevaluatedtotruethenexecutethatblockelse
executetheelseblock.Theelseblockisoptionalandoneifcanhave
anynumberofelseblocks.

Syntax:

if(condition):

statements
else:

defaultstatements

ifelifelse

Itslikecheckingmultipleconditions.LetsTakeanexampleif
pocketMoneygreaterthen90TthenOkayelseifpocketmoneyis
equalto50TandLessthen90Tthenitsaverageelseitsnotenough.
Basicallythatstatementcanreplaceswitchstatement.Youcanputany
numberofelifblocksafterifandelseblockisoptional.

Syntax:

if(option1condition):

option1statements

elif(option2condition):

option2statements

elif(option3condition):

option3statements

else:

defaultoptionstatements

for

Itisusedforloopingoverasequence.Pythondoesntsupportsoldfor
looporcstyleforloop.Intraditionalstyleforloopwehaveone
variablewhichiteratesoverasequenceandwecanchangethevalueof
sequenceandvariableaswellbutinmodernforloopwehaveiteration
variablethatiteratesoverafixedsequence.Wecannotchangethe
sequenceaswellasiterationvariableduringiteration.

Syntax:

foriterator_nameiniterating_sequence:

statements

while

AwhileloopstatementinPythonprogramminglanguagerepeatedly
executesatargetstatementaslongasagivenconditionistrue.

Syntax

ThesyntaxofawhileloopinPythonprogramminglanguageis

whileexpression:

statement(s)

Here,statement(s)maybeasinglestatementorablockofstatements.
Theconditionmaybeanyexpression,andtrueisanynonzerovalue.
Theloopiterateswhiletheconditionistrue.

Whentheconditionbecomesfalse,programcontrolpassestotheline
immediatelyfollowingtheloop.

InPython,allthestatementsindentedbythesamenumberofcharacter
spacesafteraprogrammingconstructareconsideredtobepartofa
singleblockofcode.Pythonusesindentationasitsmethodofgrouping
statements.

range

Sometimesitisrequiredthatwejustwanttoiterateovernumber
sequencelike1,2,3,4,Tosolvethispurposepythonprovidesrange
functionwhichgeneratethearithmeticprogressionwithnumberof
termsequaltotheparameterpassedinit.Wehave3variationsof
range()function.Onetakeonly

Syntax:

1 foriterator_nameinrange(10):

statements

2 foriterator_nameinrange(start,end):

statements

3 foriterator_nameinrange(start,stop,increment):

statements

break/continue

Breakisusedforterminatingtheloopabnormally.i.ethateventhe
sequenceisnotcompletedbutloopisexited.

Continueisusedforcontinuingtonextiterationofloopwithoutdoing
anythinginsidetheloop.

Elseisintroducedinpythonanditisplacedinloopwithoutif.Itwill
executeonlyiftheloopisterminatedwithoutbreak.

Note:therearetwomoreelsestatement,oneisforifthatIalready
explainedandotheriswithtry.Thedifferencebetweentryelseblock
andloopelseistryelseblockexecuteswhennocodeisexecutedand
loopelseexecuteswhennobreakisexecuted.

pass

Passstatementisusedwhenyoudontwanttodoanythingbutitis
requiredforthesakeofsyntacticalcorrectness.Passhastwocommon
uses.

1 Itisusedforcreatingminimalclasses.

2 Itisusedasplaceholder.Forexampleconsiderthefollowing
snippet

Functions

Afunctionisablockoforganized,reusablecodethatisusedtoperforma
single,relatedaction.Functionsprovidebettermodularityforyourapplication
andahighdegreeofcodereusing.

Asyoualreadyknow,Pythongivesyoumanybuiltinfunctionslikeprint(),
etc.butyoucanalsocreateyourownfunctions.Thesefunctionsarecalled
userdefinedfunctions.

DefiningaFunction

Youcandefinefunctionstoprovidetherequiredfunctionality.Herearesimple
rulestodefineafunctioninPython.

Functionblocksbeginwiththekeyworddeffollowedbythefunction
nameandparentheses(()).

Anyinputparametersorargumentsshouldbeplacedwithinthese
parentheses.Youcanalsodefineparametersinsidetheseparentheses.

Thefirststatementofafunctioncanbeanoptionalstatementthe
documentationstringofthefunctionordocstring.

Thecodeblockwithineveryfunctionstartswithacolon(:)andis
indented.

Thestatementreturn[expression]exitsafunction,optionallypassingback
anexpressiontothecaller.Areturnstatementwithnoargumentsisthe
sameasreturnNone.

Syntax

deffunctionname(parameters):

"function_docstring"

function_suite

return[expression]
Bydefault,parametershaveapositionalbehaviorandyouneedtoinformthem
inthesameorderthattheyweredefined.

Modules

AmoduleallowsyoutologicallyorganizeyourPythoncode.Groupingrelated
codeintoamodulemakesthecodeeasiertounderstandanduse.Amoduleisa
Pythonobjectwitharbitrarilynamedattributesthatyoucanbindandreference.

Simply,amoduleisafileconsistingofPythoncode.Amodulecandefine
functions,classesandvariables.Amodulecanalsoincluderunnablecode.

Example

ThePythoncodeforamodulenamedanamenormallyresidesinafilenamed
aname.py.Here'sanexampleofasimplemodule,support.py

defprint_func(par):

print"Hello:",par

return

TheimportStatement

YoucanuseanyPythonsourcefileasamodulebyexecutinganimport
statementinsomeotherPythonsourcefile.Theimporthasthefollowing
syntax:

importmodule1[,module2[,...moduleN]

Whentheinterpreterencountersanimportstatement,itimportsthemoduleif
themoduleispresentinthesearchpath.Asearchpathisalistofdirectories
thattheinterpretersearchesbeforeimportingamodule.
Packages

Packagesarenamespaceswhichcontainmultiplepackagesandmodules
themselves.Theyaresimplydirectories,butwithatwist.

EachpackageinPythonisadirectorywhichMUSTcontainaspecialfile
called__init__.py.Thisfilecanbeempty,anditindicatesthatthedirectoryit
containsisaPythonpackage,soitcanbeimportedthesamewayamodulecan
beimported.

Ifwecreateadirectorycalledfoo,whichmarksthepackagename,wecanthen
createamoduleinsidethatpackagecalledbar.Wealsomustnotforgettoadd
the__init__.pyfileinsidethefoodirectory.

Tousethemodulebar,wecanimportitintwoways:

importfoo.bar

FileHandling

OpeningandClosingFiles

Untilnow,youhavebeenreadingandwritingtothestandardinputandoutput.
Now,wewillseehowtouseactualdatafiles.

Pythonprovidesbasicfunctionsandmethodsnecessarytomanipulatefilesby
default.Youcandomostofthefilemanipulationusingafileobject.

TheopenFunction

Beforeyoucanreadorwriteafile,youhavetoopenitusingPython'sbuiltin
open()function.Thisfunctioncreatesafileobject,whichwouldbeutilizedto
callothersupportmethodsassociatedwithit.

Syntax

fileobject=open(file_name[,access_mode][,buffering])

Hereareparameterdetails:

file_name:Thefile_nameargumentisastringvaluethatcontainsthe
nameofthefilethatyouwanttoaccess.

access_mode:Theaccess_modedeterminesthemodeinwhichthefile
hastobeopened,i.e.,read,write,append,etc.Acompletelistof
possiblevaluesisgivenbelowinthetable.Thisisoptionalparameter
andthedefaultfileaccessmodeisread(r).

buffering:Ifthebufferingvalueissetto0,nobufferingtakesplace.If
thebufferingvalueis1,linebufferingisperformedwhileaccessinga
file.Ifyouspecifythebufferingvalueasanintegergreaterthan1,then
bufferingactionisperformedwiththeindicatedbuffersize.Ifnegative,
thebuffersizeisthesystemdefault(defaultbehavior).

Hereisalistofthedifferentmodesofopeningafile

Modes Description

Opensafileforreadingonly.Thefilepointerisplacedatthebeginning
r
ofthefile.Thisisthedefaultmode.

Opensafileforreadingonlyinbinaryformat.Thefilepointerisplaced
rb
atthebeginningofthefile.Thisisthedefaultmode.

Opensafileforbothreadingandwriting.Thefilepointerplacedatthe
r+
beginningofthefile.

rb+ Opensafileforbothreadingandwritinginbinaryformat.Thefile
pointerplacedatthebeginningofthefile.
Opensafileforwritingonly.Overwritesthefileifthefileexists.Ifthe
w
filedoesnotexist,createsanewfileforwriting.
Opensafileforwritingonlyinbinaryformat.Overwritesthefileifthe
wb
fileexists.Ifthefiledoesnotexist,createsanewfileforwriting.
Opensafileforbothwritingandreading.Overwritestheexistingfileif
w+ thefileexists.Ifthefiledoesnotexist,createsanewfileforreading
andwriting.

Opensafileforbothwritingandreadinginbinaryformat.Overwrites
wb+ theexistingfileifthefileexists.Ifthefiledoesnotexist,createsanew
fileforreadingandwriting.
Opensafileforappending.Thefilepointerisattheendofthefileif
a thefileexists.Thatis,thefileisintheappendmode.Ifthefiledoesnot
exist,itcreatesanewfileforwriting.

Opensafileforappendinginbinaryformat.Thefilepointerisatthe
ab endofthefileifthefileexists.Thatis,thefileisintheappendmode.If
thefiledoesnotexist,itcreatesanewfileforwriting.
Opensafileforbothappendingandreading.Thefilepointerisatthe
a+ endofthefileifthefileexists.Thefileopensintheappendmode.If
thefiledoesnotexist,itcreatesanewfileforreadingandwriting.

Opensafileforbothappendingandreadinginbinaryformat.Thefile
pointerisattheendofthefileifthefileexists.Thefileopensinthe
ab+
appendmode.Ifthefiledoesnotexist,itcreatesanewfileforreading
andwriting.

Date/TimeOperations

Timeintervalsarefloatingpointnumbersinunitsofseconds.Particular
instantsintimeareexpressedinsecondssince12:00am,January1,
1970(epoch).

ThereisapopulartimemoduleavailableinPythonwhichprovidesfunctions
forworkingwithtimes,andforconvertingbetweenrepresentations.The
functiontime.time()returnsthecurrentsystemtimeintickssince12:00am,
January1,1970(epoch).

Example

#!/usr/bin/pythonimporttime;#Thisisrequiredtoincludetimemodule.

ticks=time.time()

print"Numberoftickssince12:00am,January1,1970:",ticks

Classes

Class:Auserdefinedprototypeforanobjectthatdefinesasetof
attributesthatcharacterizeanyobjectoftheclass.Theattributesaredata
members(classvariablesandinstancevariables)andmethods,accessed
viadotnotation.

Instance/Object:Anindividualobjectofacertainclass.Anobjectobj
thatbelongstoaclassCircle,forexample,isaninstanceoftheclass
Circle.

Inheritance:Thetransferofthecharacteristicsofaclasstootherclasses
thatarederivedfromit.

FunctionOverloading:Theassignmentofmorethanonebehaviortoa
particularfunction.Theoperationperformedvariesbythetypesof
objectsorargumentsinvolved.

OperatorOverloading:Theassignmentofmorethanonefunctiontoa
particularoperator.
PythonPackagesofInterestforIoT

JSON(JavaScriptObjectNotation)

JSONorJavaScriptObjectNotationisalightweighttextbasedopen
standarddesignedforhumanreadabledatainterchange.TheJSON
formatwasoriginallyspecifiedbyDouglasCrockford,andisdescribed
inRFC4627.TheofficialInternetmediatypeforJSONis
application/json.TheJSONfilenameextensionis.json.Thistutorial
willhelpyouunderstandJSONanditsusewithinvarious
programminglanguagessuchasPHP,PERL,Python,Ruby,Java,etc.

BeforeyoustartwithencodinganddecodingJSONusingPython,you
needtoinstallanyoftheJSONmodulesavailable.Forthistutorialwe
havedownloadedandinstalledDemjsonasfollows

$tarxvfzdemjson1.6.tar.gz

$cddemjson1.6

$pythonsetup.pyinstall

JSONFunctions

EncodingJSONinPython(encode)
Function Libraries
Python
EncodesthePythonobjectintoaJSONstring
encode encode()
representation.
function
DecodesaJSONendodedstringintoaPython encodes
decode
object. thePython
objectintoaJSONstringrepresentation.

Syntax

demjson.encode(self,obj,nest_level=0)
Example

ThefollowingexampleshowsarraysunderJSONwithPython.

#!/usr/bin/pythonimportdemjson

data=[{'a':1,'b':2,'c':3,'d':4,'e':5}]

json=demjson.encode(data)

printjson

Whileexecuting,thiswillproducethefollowingresult

[{"a":1,"b":2,"c":3,"d":4,"e":5}]

DecodingJSONinPython(decode)

Pythoncanusedemjson.decode()functionfordecodingJSON.This
functionreturnsthevaluedecodedfromjsontoanappropriatePython
type.

Syntax

demjson.decode(self,txt)

Example

ThefollowingexampleshowshowPythoncanbeusedtodecode
JSONobjects.

#!/usr/bin/pythonimportdemjson

json='{"a":1,"b":2,"c":3,"d":4,"e":5}';

text=demjson.decode(json)

printtext
Onexecuting,itwillproducethefollowingresult

{u'a':1,u'c':3,u'b':2,u'e':5,u'd':4}

XML

XMLisaportable,opensourcelanguagethatallowsprogrammersto
developapplicationsthatcanbereadbyotherapplications,regardless
ofoperatingsystemand/ordevelopmentallanguage.

WhatisXML?

TheExtensibleMarkupLanguage(XML)isamarkuplanguagemuch
likeHTMLorSGML.ThisisrecommendedbytheWorldWideWeb
Consortiumandavailableasanopenstandard.

XMLisextremelyusefulforkeepingtrackofsmalltomedium
amountsofdatawithoutrequiringaSQLbasedbackbone.

XMLParserArchitecturesandAPIs

ThePythonstandardlibraryprovidesaminimalbutusefulsetof
interfacestoworkwithXML.

ThetwomostbasicandbroadlyusedAPIstoXMLdataaretheSAX
andDOMinterfaces.

SimpleAPIforXML(SAX):Here,youregistercallbacksforevents
ofinterestandthenlettheparserproceedthroughthedocument.This
isusefulwhenyourdocumentsarelargeoryouhavememory
limitations,itparsesthefileasitreadsitfromdiskandtheentirefileis
neverstoredinmemory.

DocumentObjectModel(DOM)API:ThisisaWorldWideWeb
Consortiumrecommendationwhereintheentirefileisreadinto
memoryandstoredinahierarchical(treebased)formtorepresentall
thefeaturesofanXMLdocument.

SAXobviouslycannotprocessinformationasfastasDOMcanwhen
workingwithlargefiles.Ontheotherhand,usingDOMexclusively
canreallykillyourresources,especiallyifusedonalotofsmallfiles.

SAXisreadonly,whileDOMallowschangestotheXMLfile.Since
thesetwodifferentAPIsliterallycomplementeachother,thereisno
reasonwhyyoucannotusethembothforlargeprojects.

HTTPLib&URLLib

Thehttplibmodulehasbeenrenamedtohttp.clientinPython3.The
2to3toolwillautomaticallyadaptimportswhenconvertingyour
sourcestoPython3.

Thismoduledefinesclasseswhichimplementtheclientsideofthe
HTTPandHTTPSprotocols.Itisnormallynotuseddirectlythe
moduleurllibusesittohandleURLsthatuseHTTPandHTTPS.

Hereisanexamplesessionthatusesthe"GET"method:

>>>importhttplib

>>>conn=httplib.HTTPConnection("www.python.org")

>>>conn.request("GET","/index.html")

>>>r1=conn.getresponse()

>>>printr1.status,r1.reason

200OK

>>>data1=r1.read()
>>>conn.request("GET","/parrot.spam")

>>>r2=conn.getresponse()

>>>printr2.status,r2.reason

404NotFound

>>>data2=r2.read()

>>>conn.close()

Hereisanexamplesessionthatshowshowto"POST"requests:

>>>importhttplib,urllib

>>>params=urllib.urlencode({'spam':1,'eggs':2,'bacon':0})

>>>headers={"Contenttype":"application/xwwwform
urlencoded",

..."Accept":"text/plain"}

>>>conn=httplib.HTTPConnection("musical.mojam.com:80")

>>>conn.request("POST","/cgibin/query",params,headers)

>>>response=conn.getresponse()

>>>printresponse.status,response.reason

200OK

>>>data=response.read()

>>>conn.close()

TheurllibmoduleinPython3allowsyouaccesswebsitesviayour
program.Thisopensupasmanydoorsforyourprogramsasthe
internetopensupforyou.urllibinPython3isslightlydifferentthan
urllib2inPython2,buttheyaremostlythesame.Throughurllib,you
canaccesswebsites,downloaddata,parsedata,modifyyourheaders,
anddoanyGETandPOSTrequestsyoumightneedtodo.

Somewebsitesdonotappreciateprogramsaccessingtheirdataand
placingweightontheirservers.Whentheyfindoutthataprogramis
visitingthem,theymaysometimeschoosetoblockyouout,orserve
youdifferentdatathataregularusermightsee.Thiscanbeannoying
atfirst,butcanbeovercomewithsomesimplecode.Todothis,you
justneedtomodifytheuseragent,whichisavariablewithinyour
headerthatyousendin.Headersarebitsofdatathatyousharewith
serverstoletthemknowabitaboutyou.ThisiswherePython,by
default,tellsthewebsitethatyouarevisitingwithPython'surlliband
yourPythonversion.Wecan,however,modifythis,andactasifwe
arealowlyInternetExploreruser,aChromeuser,oranythingelse
really!

Iwouldnotrecommendjustblindlydoingthis,however,ifawebsiteis
blockingyouout.Websiteswillalsoemployothertacticsaswell,but
usuallytheyaredoingitbecausetheyalsoofferanAPIthatis
specificallymademoreprogramstoaccess.Programsareusuallyjust
interestedinthedata,anddonotneedtobeservedfancyHTMLor
CSSdata,nordataforadvertisements,etc.

SMTPLib

SimpleMailTransferProtocol(SMTP)isaprotocol,whichhandles
sendingemailandroutingemailbetweenmailservers.

Pythonprovidessmtplibmodule,whichdefinesanSMTPclient
sessionobjectthatcanbeusedtosendmailtoanyInternetmachine
withanSMTPorESMTPlistenerdaemon.
HereisasimplesyntaxtocreateoneSMTPobject,whichcanlaterbe
usedtosendanemail

importsmtplib

smtpObj=smtplib.SMTP([host[,port[,local_hostname]]])

Hereisthedetailoftheparameters:

host:ThisisthehostrunningyourSMTPserver.YoucanspecifiyIP
addressofthehostoradomainnameliketutorialspoint.com.Thisis
optionalargument.

port:Ifyouareprovidinghostargument,thenyouneedtospecifya
port,whereSMTPserverislistening.Usuallythisportwouldbe25.

local_hostname:IfyourSMTPserverisrunningonyourlocal
machine,thenyoucanspecifyjustlocalhostasofthisoption.

AnSMTPobjecthasaninstancemethodcalledsendmail,whichis
typicallyusedtodotheworkofmailingamessage.Ittakesthree
parameters

ThesenderAstringwiththeaddressofthesender.

ThereceiversAlistofstrings,oneforeachrecipient.

ThemessageAmessageasastringformattedasspecifiedinthe
variousRFCs.

Questions:

1. Whatisthedifferencebetweenaphysicalandvirtualentity?

2. WhatisanIoTdevice?
3. Whatisthepurposeofinformationmodel?

4. Whatarethevariousservicetypes?

5. Whatistheneedforacontrollerservice?

6. Whatisthedifferencebetweenprocedureorientedprogrammingand
objectorientedprogramming?

7. Whatisaninterpretedlanguage?

8. DescribeausecaseofPythondictionary.

9. WhatisthekeywordargumentinPython?

10. Whatarevariablelengtharguments?

11. WhatisthedifferencebetweenaPythonmoduleandapackage?

12. HowisfunctionoverridingimplementedinPython?

UnitV

IoTPhysicalDevices&Endpoints:

WhatisanIoTDevice

TheInternetofThings(IoT)isthenetworkofphysicalobjectsdevices,
vehicles,buildingsandotheritemsembeddedwithelectronics,software,
sensors,andnetworkconnectivitythatenablestheseobjectstocollectand
exchangedata.
Sensing

IoTdevicesandsystemsincludesensorsthattrackandmeasure
activityintheworld.OneexampleisSmartthings'openandclose
sensorsthatdetectwhetherornotadrawer,window,ordoorinyour
homeisopenorclosed.

Actuation

Actuationisnothingbutrespondingbacktotheenvironmentbasedon
theprocessingofcollecteddataatasensordevice

Communication

Oncetheembeddedsensorshavegathereddata,theyaretaskedwith
transmittingthisdatatoanidentifieddestination.Thistransferencecan
utilizedifferentconnectivitymethodologies,dependingonthe
requirementsofthecorrespondingdevice,butwillmostoftenuse
wired/wirelessorPAN/BAN/LANcommunicationlinks.Regardlessof
themethodused,thelinkswillgenerallyonlyneedtotransmitsmall
kilobytesofdata,unlesshigherbandwidthsarerequired.

Analysis&Processing

Therelianceoncommunicationtocreatecohesionbetweenthe
physicalandthetechnologicalrealmsplacesimportanceonthe
microprocessorsthatenablethisconnectiontooccur.Whetherthese
microprocessorsallowobjectstosensetheirsurroundings,exchange
datawithothercomponents,orinteractwiththecloud,their
incorporationintotheoverallschemaoftheIoTisintegraltothe
engagementofthevariedsystemsthatmustcooperatewithone
another.Giventhechangingnatureofthelandscape,microprocessors
thatarelowpower,costeffectiveandleaveasmallerimprintwillbe
thosethatarefavoredwithintheIoT.

ExemplaryDevice:RaspberryPi

TheRaspberryPiisalowcost,creditcardsizedcomputerthatplugsintoa
computermonitororTV,andusesastandardkeyboardandmouse.Itisa
capablelittledevicethatenablespeopleofallagestoexplorecomputing,and
tolearnhowtoprograminlanguageslikeScratchandPython.Itscapableof
doingeverythingyoudexpectadesktopcomputertodo,frombrowsingthe
internetandplayinghighdefinitionvideo,tomakingspreadsheets,word
processing,andplayinggames.
AbouttheBoard

ProcessorandRAM

Thesystemonachip(SoC)usedinthefirstgenerationRaspberryPiis
somewhatequivalenttothechipusedinoldersmartphones(suchasiPhone,
3G,3GS).TheRaspberryPiisbasedontheBroadcomBCM2835SoC,which
includesan700MHzARM1176JZFSprocessor,VideoCoreIVgraphics
processingunit(GPU),andRAM.IthasaLevel1cacheof16KBandaLevel
2cacheof128KB.TheLevel2cacheisusedprimarilybytheGPU.TheSoC
isstackedunderneaththeRAMchip,soonlyitsedgeisvisible.

OntheolderbetamodelBboards,128MBwasallocatedbydefaulttothe
GPU,leaving128MBfortheCPU.[25]Onthefirst256MBreleasemodelB
(andmodelA),threedifferentsplitswerepossible.Thedefaultsplitwas
192MB(RAMforCPU),whichshouldbesufficientforstandalone1080p
videodecoding,orforsimple3D,butprobablynotforbothtogether.224MB
wasforLinuxonly,withonlya1080pframebuffer,andwaslikelytofailfor
anyvideoor3D.128MBwasforheavy3D,possiblyalsowithvideodecoding
(e.g.XBMC).
USBPorts

TheRaspberryPi3sharesthesameSMSCLAN9514chipasitspredecessor,
theRaspberryPi2,adding10/100EthernetconnectivityandfourUSB
channelstotheboard.

Asbefore,theSMSCchipconnectstotheSoCviaasingleUSBchannel,
actingasaUSBtoEthernetadaptorandUSBhub.

ThoughthemodelAandA+andZerodonothavean8P8C("RJ45")Ethernet
port,theycanbeconnectedtoanetworkusinganexternalusersuppliedUSB
EthernetorWiFiadapter.

OnthemodelBandB+theEthernetportisprovidedbyabuiltinUSB
Ethernetadapter.

TheRaspberryPi3isequippedwith2.4GHzWiFi802.11nandBluetooth4.1
inadditiontothe10/100Ethernetport.

EthernetPorts

ThoughthemodelAandA+andZerodonothavean8P8C("RJ45")
Ethernetport,theycanbeconnectedtoanetworkusinganexternaluser
suppliedUSBEthernetorWiFiadapter.

OnthemodelBandB+theEthernetportisprovidedbyabuiltinUSB
Ethernetadapter.

TheRaspberryPi3isequippedwith2.4GHzWiFi802.11nandBluetooth
4.1inadditiontothe10/100Ethernetport.

HMDIOutputandCompositeVideoOutput
ThevideocontrolleriscapableofstandardmodernTVresolutions,suchas
HDandFullHD,andhigherorlowermonitorresolutionsandolder
standardCRTTVresolutions.

Asshipped(i.e.withoutcustomoverclocking)itiscapableofthe
following:640350EGA;640480VGA;800600SVGA;1024768
XGA;1280720720pHDTV;1280768WXGAvariant;1280800
WXGAvariant;12801024SXGA;1366768WXGAvariant;
14001050SXGA+;16001200UXGA;16801050WXGA+;
192010801080pHDTV;19201200WUXGA.

GPIOPins

TheRaspberryPi3featuresthesame40pingeneralpurposeinputoutput
(GPIO)headerasallthePisgoingbacktotheModelB+andModelA+.

AnyexistingGPIOhardwarewillworkwithoutmodification;theonly
changeisaswitchtowhichUARTisexposedontheGPIOspins,but
thatshandledinternallybytheoperatingsystem.
LinuxonRaspberryPi

RaspberryPisupportsvariousflavorsofLinuxincluding

Raspbian

Arch

Pidora

RaspBMC

OpenELEC

RISCOS
RaspberryPiInterfaces

Serial

SPI:Thereare5pinsonRaspberryPiforSPIinterface

MISO(MasterInSlaveOut)

MOSI(MasterOutSlaveIn)

SCK(SerialClock)
CE0(ChipEnable0)

CE0(ChipEnable1)

I2C

ProgrammingRaspberryPiwithPython

ControllingLEDwithRaspberryPi

InterfacinganLEDandswitchwithRaspberryPi

InterfacinganLightSensor(LDR)withRaspberryPi

OtherIOTDevices

pcDuino

ThebeautyofthepcDuinoliesinitsextraordinarilywellexposedhardware
peripherals.However,usingtheseperipheralsismorecomplexthanusingthem
on,say,anArduinocompatibleboard.

Thistutorialwillhelpyousortoutthevariousperipherals,whattheycando,
andhowtousethem.

Beforewegetstarted,thereareafewthingsyoushouldbecertainyoure
familiarwith,togetthemostoutofthistutorial:

pcDuinosomefamiliaritywiththebasicsofthepcDuinoisneededbefore
youjumpintothis.PleasereviewourGettingStartedwithpcDuinotutorial
beforegoinganyfurther.

LinuxthebiggestthingyoushouldbefamiliarwithittheLinuxOS.
Remember,pcDuinoisnotanArduinoitisamodernmicrocomputer
runningafullyfunctional,ifcompact,operatingsystem.
SPIasynchronous(clocked)serialperipheralinterfaceusedfor
communicationsbetweenchipsataboardlevel.Requiresaminimumof
fourwires(clock,masteroutslaveindata,masterinslaveoutdata,and
slavechipselect),andeachadditionalchipaddedtothebusrequiresone
extrachipselectline.

I2CalsoknownasIIC(interintegratedcircuit),SMBus,orTWI(two
wireinterface),I2Cusesonlytwowires(bidirectionaldataandclocklines)
tocommunicatewithmultipledevices.

SerialCommunicationanasynchronous(notransmittedclock)data
interfacewithatleasttwowires(datatransmitanddatareceive;
sometimes,additionalsignalsareaddedtoindicatewhenadeviceisready
tosendorreceive).

PulseWidthModulationadigitaltoanalogconversiontechniqueusinga
fixedfrequencysquarewaveofvaryingdutycycle,whichcanbeeasily
convertedtoananalogsignalbetween0Vandthefullamplitudeofthe
digitalICdrivingthesignal.

AnalogtoDigitalConversionmeasurementofananalogvoltageand
conversionofthatvoltageintoadigitalvalue.

Allofthecodeinthistutorialcanbefoundonline,inourpcDuinoGithub
repository.Itsnotabadideatocheckthereforanyupdatestothecodesince
thistutorialwaswritten.
BeagleBoneBlack
TheBeagleBoardisalowpoweropensourcehardwaresingleboardcomputer
producedbyTexasInstrumentsinassociationwithDigiKeyandNewark
element14.TheBeagleBoardwasalsodesignedwithopensourcesoftware
developmentinmind,andasawayofdemonstratingtheTexasInstrument's
OMAP3530systemonachip.[8]Theboardwasdevelopedbyasmallteamof
engineersasaneducationalboardthatcouldbeusedincollegesaroundthe
worldtoteachopensourcehardwareandsoftwarecapabilities.Itisalsosoldto
thepublicundertheCreativeCommonssharealikelicense.Theboardwas
designedusingCadenceOrCADforschematicsandCadenceAllegroforPCB
manufacturing;nosimulationsoftwarewasused.

Cubieboard
Cubieboardisasingleboardcomputer,madeinZhuhai,Guangdong,China.
ThefirstshortrunofprototypeboardsweresoldinternationallyinSeptember
2012,andtheproductionversionstartedtobesoldinOctober2012.Itcanrun
Android4ICS,Ubuntu12.04desktop,Fedora19ARMRemixdesktop,Arch
LinuxARM,aDebianbasedCubiandistribution,orOpenBSD.

ItusestheAllWinnerA10SoC,popularoncheaptablets,phonesandmedia
PCs.ThisSoCisusedbydevelopersofthelimadriver,anopensourcedriver
fortheARMMaliGPU.Itwasable,atthe2013FOSDEMdemo,torun
ioquake3at47fpsin1024600.

TheCubieboardteammanagedtorunanApacheHadoopcomputercluster
usingtheLubuntuLinuxdistribution.
Questions:

1. HowisRaspberryPidifferentfromadesktopcomputer?

2. WhatistheuseofGPIOpins?

3. WhatistheuseofSPIandI2CinterfacesonRaspberryPi?

TextBook:VijayMadisetti,ArshdeepBahga,InternetofThingsAHands
OnApproach,2014,ISBN:9780996025515

Vous aimerez peut-être aussi