SlideShare a Scribd company logo
1 of 22
Download to read offline
Web of Things: HTML5 for resource constrained
Embedded Systems
Tuesday, April 23, 13
Design  West  2013
Web  of  Things:    HTML5  for  
resource  constrained  
Embedded  Systems
Jonny  Doin,  CEO  -­‐  GridVORTEX
Sergio  Eduardo  Alves  de  Paula,  R&D  Engineer
Tuesday, April 23, 13
Embedded HTML5
Objectives
This class is NOT a tutorial on HTML5, nor it
is about Web Design.
It is about a design approach to implement
a responsive dynamic Web Server in an
Embedded System
The simple techniques shown would allow
you to implement one this weekend, in your
own project.
Tuesday, April 23, 13
Embedded HTML5
Agenda
• Which Embedded Systems?
• Embedded Web Servers
• The TCP/IP Stack
• Socket Layer Backend
• Dynamic Content Handling
• SSE/JSON/AJAX
• Some performance data
Tuesday, April 23, 13
Embedded HTML5
Which Embedded Systems ?
Currently, the class of “Embedded Systems”
includes a wide range of systems:
• dedicated Linux machines, having Gigabytes of
memory and powerful processors;
• medium sized microcontrollers with RTOS, having
Megabytes of memory;
• small control oriented microcontrollers, with very
limited memory and no operating system (bare-
metal);
Tuesday, April 23, 13
Embedded HTML5
Which Embedded Systems ?
We focus on the smaller systems:
• Program memory ranging from 128KB to 2MB;
• SRAM ranging from 32KB to 256KB;
• Usually running with no operating systems, in a
‘bare-metal’ application;
• Frequently found on Industrial instrumentation and
control applications;
Tuesday, April 23, 13
Embedded HTML5
Which Embedded Systems ?
Industrial bare-metal systems
• Often are connected to Fieldbus networks;
• Need deterministic response to field events;
• Usually are sensitive to increased response latency;
• In recent years are connected to TCP/IP networks;
• Integration with IT backend and M2M control;
• Besides M2M, are required to support HMI clients
via web browsers;
Tuesday, April 23, 13
Embedded HTML5
Embedded Web Servers
Current systems are required to do much
more than showing simple static text pages:
• Dynamic monitoring of sensor and process data;
• Interact with the control process to send
commands;
• Responsive and complex configuration interfaces;
• Graphically plot process and sensor data;
Tuesday, April 23, 13
Embedded HTML5
Embedded Web Servers
This set of requirements is formidable, and
traditionally required a LAMP stack (Linux,
Apache, MySql, Perl/Python/PHP).
• The dynamic content usually relies on backend
support (PHP / Server scripts / process database)
• Large RAM space dedicated to network buffers;
• Responsive user interface demands process
bandwidth;
Tuesday, April 23, 13
Embedded HTML5
Embedded Web Servers
In a small embedded system, the toll of a
fast web server can drain system resources.
• Available RAM is reduced for core data processing;
• Most Embedded Web Servers allow limiting RAM
allocation, however:
• Small allocated memory usually leads to
unresponsive interfaces;
• Network buffers for each socket cannot be
eliminated;
Tuesday, April 23, 13
Embedded HTML5
The TCP/IP Stack
In this design we selected a hardware TCP/IP
chip as the network interface.
• Eliminates network buffer RAM from main processor;
• Dedicated hardware protocol, reduces processor
bandwidth for protocol datagrams;
• handles network processing up to the socket layer;
• reduced code footprint on main application;
• simple implementation from the socket layer up;
Tuesday, April 23, 13
Embedded HTML5
Hardware-based TCP/IP
The location of the network interface in a
separate chip brings other advantages:
• Separate processing environment;
• Insulates core app from network protocol attacks;
• Reduces threats from the network toxic environment;
• Network interface can be reset without breaking the
app core;
Tuesday, April 23, 13
Embedded HTML5
Socket Layer Backend
The socket layer on the server side must
implement the HTTP state machine.
• Parsing of HTTP requests;
• Composition of HTTP frames to be sent;
• Handlers for server sent events (SSE);
• Handlers and parser for CGI commands;
Tuesday, April 23, 13
Embedded HTML5
Socket Layer Backend
Several NFR (non-functional requirements) are
important in the implementation of the socket
backend:
• Guarded buffers and overflow detection techniques;
• Strict control of memory allocation;
• Safe state machines;
• Error detection and containment;
• Failures should not reach the app core.
Tuesday, April 23, 13
Embedded HTML5
Dynamic Content Handling
Can be implemented in a number of ways:
• Directly rendering the page, embedding the data in
the page description (printf):
• Poor update rate (page refresh);
• Needs the entire payload to be buffered before
transmission;
• Fixed pages with placeholders for streaming data:
• use CSS to format data;
• use SSE to bind streaming data to fields;
Tuesday, April 23, 13
Embedded HTML5
Dynamic Content Handling
Using fixed pages for dynamic content has a
number of advantages:
• All formatting and placement of the data fields are controlled by
the page script, not by the server;
• Complete concern separation from the server and presentation
layers;
• The payload length is always known when assembling the frame
header, since the frames are always static;
• Fixed payloads allow “windowing” buffering;
• This can be done with less than 200bytes of page buffers per
socket;
Tuesday, April 23, 13
Embedded HTML5
SSE - HTML5 Streaming Data
SSE (Server-Sent Events) is one of the new
HTML5 features that is most appealing to
embedded web servers.
• Allow a stream of server data to be sent to the page without
continuous client request;
• Data update rate can be set individually by each stream;
• Can be implemented cleanly with event generators in the server;
• Data binding and parsing is simple when using JSON;
Tuesday, April 23, 13
Embedded HTML5
JSON - Javascript Object Notation
A simple text format for data interchange.
• Based on name/value pairs description;
• Is powerful while having simple formatting rules;
• can be applied to streaming data pairs;
• values are accessible by javascript in a natural manner;
• helps keeping server-side concerns generalized by having a
standard formatting of data;
• can be completely abstracted by event generator descriptors;
Tuesday, April 23, 13
Embedded HTML5
XML HTTP Requests
Used to send commands and data from the
client to the server.
• Simple standard parsing on the server side;
• When used with SSE cuts bandwidth needs by half, when
compared to AJAX;
• When JSON is used, parsing is very straightforward;
• Javascript has total control over the user interface;
Tuesday, April 23, 13
Embedded HTML5
Putting it all together
Using SSE and XML HTTP Requests need
coordination from the page script.
• SSE streams are continuous until stopped by the page script;
• While the SSE stream is playing, no data can be sent back to the
server;
• The page script stops the SSE stream, sends XML HTTP Requests
and starts the SSE stream again;
• Error detection and browser support detection must be done in
the page script;
Tuesday, April 23, 13
Embedded HTML5
Some Performance Data
Simple web servers for dynamic content can be
realized using HTML5 SSE, JSON and XML HTTP
Requests. Successful use of these features results in
fast and small servers.
• Multiple data stream updates with less than 100ms latency;
• RAM usage on the server side (for the web server) of less than
2KB;
• Server side code footprint of less than 5KB;
• Less than 500 lines of C code;
• Exception handling on the script side and on the server is
simplified;
Tuesday, April 23, 13
Design  West  2013
THANK  YOU
Jonny  Doin  -­‐  GridVORTEX
jonnydoin@gridvortex.com
Tuesday, April 23, 13

More Related Content

What's hot

Caching: A Guided Tour - 10/12/2010
Caching: A Guided Tour - 10/12/2010Caching: A Guided Tour - 10/12/2010
Caching: A Guided Tour - 10/12/2010
Jason Ragsdale
 
Tulsa tech fest 2010 - web speed and scalability
Tulsa tech fest 2010  - web speed and scalabilityTulsa tech fest 2010  - web speed and scalability
Tulsa tech fest 2010 - web speed and scalability
Jason Ragsdale
 
Comet: by pushing server data, we push the web forward
Comet: by pushing server data, we push the web forwardComet: by pushing server data, we push the web forward
Comet: by pushing server data, we push the web forward
NOLOH LLC.
 

What's hot (20)

Membase Introduction
Membase IntroductionMembase Introduction
Membase Introduction
 
Google App Engine At A Glance
Google App Engine At A GlanceGoogle App Engine At A Glance
Google App Engine At A Glance
 
Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!Resource loading, prioritization, HTTP/2 - oh my!
Resource loading, prioritization, HTTP/2 - oh my!
 
Web session replication with Hazelcast
Web session replication with HazelcastWeb session replication with Hazelcast
Web session replication with Hazelcast
 
Caching: A Guided Tour - 10/12/2010
Caching: A Guided Tour - 10/12/2010Caching: A Guided Tour - 10/12/2010
Caching: A Guided Tour - 10/12/2010
 
Database failover from client perspective
Database failover from client perspectiveDatabase failover from client perspective
Database failover from client perspective
 
On Metal - The Future Of Hybrid Cloud
On Metal - The Future Of Hybrid CloudOn Metal - The Future Of Hybrid Cloud
On Metal - The Future Of Hybrid Cloud
 
Http2 in practice
Http2 in practiceHttp2 in practice
Http2 in practice
 
Infinspan: In-memory data grid meets NoSQL
Infinspan: In-memory data grid meets NoSQLInfinspan: In-memory data grid meets NoSQL
Infinspan: In-memory data grid meets NoSQL
 
Proxysql use case scenarios hl++ 2017
Proxysql use case scenarios    hl++ 2017 Proxysql use case scenarios    hl++ 2017
Proxysql use case scenarios hl++ 2017
 
Tulsa tech fest 2010 - web speed and scalability
Tulsa tech fest 2010  - web speed and scalabilityTulsa tech fest 2010  - web speed and scalability
Tulsa tech fest 2010 - web speed and scalability
 
Introduction to MemSQL
Introduction to MemSQLIntroduction to MemSQL
Introduction to MemSQL
 
Redis vs NCache - A detailed feture level comparison
Redis vs NCache - A detailed feture level comparisonRedis vs NCache - A detailed feture level comparison
Redis vs NCache - A detailed feture level comparison
 
Application Scalability in Server Farms - NCache
Application Scalability in Server Farms - NCacheApplication Scalability in Server Farms - NCache
Application Scalability in Server Farms - NCache
 
(ATS6-PLAT07) Managing AEP in an enterprise environment
(ATS6-PLAT07) Managing AEP in an enterprise environment(ATS6-PLAT07) Managing AEP in an enterprise environment
(ATS6-PLAT07) Managing AEP in an enterprise environment
 
NCache Architecture
NCache ArchitectureNCache Architecture
NCache Architecture
 
Intro to MySQL Part I
Intro to MySQL Part IIntro to MySQL Part I
Intro to MySQL Part I
 
Comet: by pushing server data, we push the web forward
Comet: by pushing server data, we push the web forwardComet: by pushing server data, we push the web forward
Comet: by pushing server data, we push the web forward
 
Handling Relational Data in a Distributed Cache
Handling Relational Data in a Distributed CacheHandling Relational Data in a Distributed Cache
Handling Relational Data in a Distributed Cache
 
Time to Make the Move to In-Memory Data Grids
Time to Make the Move to In-Memory Data GridsTime to Make the Move to In-Memory Data Grids
Time to Make the Move to In-Memory Data Grids
 

Viewers also liked

Gm report nylex consumer 2008 06
Gm report nylex consumer 2008 06Gm report nylex consumer 2008 06
Gm report nylex consumer 2008 06
Tom Evans
 
Case study r4 sg_051914_m
Case study r4 sg_051914_mCase study r4 sg_051914_m
Case study r4 sg_051914_m
James Gill
 
Jim Jones Resume _rev5
Jim Jones Resume _rev5Jim Jones Resume _rev5
Jim Jones Resume _rev5
Jim Jones
 
Research-Daisy Spilker
Research-Daisy SpilkerResearch-Daisy Spilker
Research-Daisy Spilker
Daisy Spilker
 

Viewers also liked (20)

рушники
рушникирушники
рушники
 
Canela imagen corporativa Cinthya Caterine Botero
Canela imagen corporativa Cinthya Caterine BoteroCanela imagen corporativa Cinthya Caterine Botero
Canela imagen corporativa Cinthya Caterine Botero
 
¡Aprender!
¡Aprender!¡Aprender!
¡Aprender!
 
Gm report nylex consumer 2008 06
Gm report nylex consumer 2008 06Gm report nylex consumer 2008 06
Gm report nylex consumer 2008 06
 
Case study r4 sg_051914_m
Case study r4 sg_051914_mCase study r4 sg_051914_m
Case study r4 sg_051914_m
 
Ejay Villalobos CV
Ejay Villalobos CVEjay Villalobos CV
Ejay Villalobos CV
 
What Is A Wiki
What Is A WikiWhat Is A Wiki
What Is A Wiki
 
Camii
CamiiCamii
Camii
 
manual de project
manual de projectmanual de project
manual de project
 
Jornadas Pedagógicas - Educação Especial - Agrupamento de Escolas Vasco Santana
Jornadas Pedagógicas - Educação Especial - Agrupamento de Escolas Vasco SantanaJornadas Pedagógicas - Educação Especial - Agrupamento de Escolas Vasco Santana
Jornadas Pedagógicas - Educação Especial - Agrupamento de Escolas Vasco Santana
 
Para el producto final de curso
Para el producto final de cursoPara el producto final de curso
Para el producto final de curso
 
Algas
Algas Algas
Algas
 
Jim Jones Resume _rev5
Jim Jones Resume _rev5Jim Jones Resume _rev5
Jim Jones Resume _rev5
 
Directorio virtual
Directorio virtualDirectorio virtual
Directorio virtual
 
Igreja inclusiva
Igreja inclusiva  Igreja inclusiva
Igreja inclusiva
 
Clases sociales en el mundo contemporáneo.
Clases sociales en el mundo contemporáneo.Clases sociales en el mundo contemporáneo.
Clases sociales en el mundo contemporáneo.
 
Procesos administrativos
Procesos administrativosProcesos administrativos
Procesos administrativos
 
7ma actividad ley de violencia mujer
7ma actividad ley de violencia mujer7ma actividad ley de violencia mujer
7ma actividad ley de violencia mujer
 
Research-Daisy Spilker
Research-Daisy SpilkerResearch-Daisy Spilker
Research-Daisy Spilker
 
Tecnología Scolari - Lombardi - Dabove
Tecnología Scolari - Lombardi - DaboveTecnología Scolari - Lombardi - Dabove
Tecnología Scolari - Lombardi - Dabove
 

Similar to Esc 209 slides-doin

2013_protect_presentation
2013_protect_presentation2013_protect_presentation
2013_protect_presentation
Jeff Holland
 
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Cloudera, Inc.
 

Similar to Esc 209 slides-doin (20)

Esc 209 paper_doin
Esc 209 paper_doinEsc 209 paper_doin
Esc 209 paper_doin
 
Web Performance Optimization
Web Performance OptimizationWeb Performance Optimization
Web Performance Optimization
 
Web Speed And Scalability
Web Speed And ScalabilityWeb Speed And Scalability
Web Speed And Scalability
 
Hpc lunch and learn
Hpc lunch and learnHpc lunch and learn
Hpc lunch and learn
 
Mini-Training: To cache or not to cache
Mini-Training: To cache or not to cacheMini-Training: To cache or not to cache
Mini-Training: To cache or not to cache
 
Realtime traffic analyser
Realtime traffic analyserRealtime traffic analyser
Realtime traffic analyser
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
 
Big Data on Cloud Native Platform
Big Data on Cloud Native PlatformBig Data on Cloud Native Platform
Big Data on Cloud Native Platform
 
2013_protect_presentation
2013_protect_presentation2013_protect_presentation
2013_protect_presentation
 
Zero Downtime JEE Architectures
Zero Downtime JEE ArchitecturesZero Downtime JEE Architectures
Zero Downtime JEE Architectures
 
Design Choices for Cloud Data Platforms
Design Choices for Cloud Data PlatformsDesign Choices for Cloud Data Platforms
Design Choices for Cloud Data Platforms
 
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
Migrate from Oracle to Aurora PostgreSQL: Best Practices, Design Patterns, & ...
 
SQL PASS Taiwan 七月份聚會-1
SQL PASS Taiwan 七月份聚會-1SQL PASS Taiwan 七月份聚會-1
SQL PASS Taiwan 七月份聚會-1
 
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
Simplifying Hadoop with RecordService, A Secure and Unified Data Access Path ...
 
Adding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded SystemAdding Support for Networking and Web Technologies to an Embedded System
Adding Support for Networking and Web Technologies to an Embedded System
 
Introduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptxIntroduction and Basics to web technology .pptx
Introduction and Basics to web technology .pptx
 
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
AWS re:Invent 2016: Amazon CloudFront Flash Talks: Best Practices on Configur...
 
Deploy secure, scalable, and highly available web apps with Azure Front Door ...
Deploy secure, scalable, and highly available web apps with Azure Front Door ...Deploy secure, scalable, and highly available web apps with Azure Front Door ...
Deploy secure, scalable, and highly available web apps with Azure Front Door ...
 
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015MySQL's NoSQL  -- Texas Linuxfest August 22nd 2015
MySQL's NoSQL -- Texas Linuxfest August 22nd 2015
 
Caching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session ICaching for Microservices Architectures: Session I
Caching for Microservices Architectures: Session I
 

More from Jonny Doin

ParallelLogicToEventDrivenFirmware_Doin
ParallelLogicToEventDrivenFirmware_DoinParallelLogicToEventDrivenFirmware_Doin
ParallelLogicToEventDrivenFirmware_Doin
Jonny Doin
 
SiliconFailsafeForIoT_Doin
SiliconFailsafeForIoT_DoinSiliconFailsafeForIoT_Doin
SiliconFailsafeForIoT_Doin
Jonny Doin
 
ImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_DoinImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_Doin
Jonny Doin
 

More from Jonny Doin (11)

Jonny doin safe io t- lt_spice failsafe
Jonny doin safe io t- lt_spice failsafeJonny doin safe io t- lt_spice failsafe
Jonny doin safe io t- lt_spice failsafe
 
Impacto metrologialegal jonnydoin
Impacto metrologialegal jonnydoinImpacto metrologialegal jonnydoin
Impacto metrologialegal jonnydoin
 
Jonny doin lt spice servo_dac
Jonny doin lt spice servo_dacJonny doin lt spice servo_dac
Jonny doin lt spice servo_dac
 
Sts 401 slides-doin
Sts 401 slides-doinSts 401 slides-doin
Sts 401 slides-doin
 
Network insecuritysimplehackscortexm jonnydoin
Network insecuritysimplehackscortexm jonnydoinNetwork insecuritysimplehackscortexm jonnydoin
Network insecuritysimplehackscortexm jonnydoin
 
Io t hurdles_i_pv6_slides_doin
Io t hurdles_i_pv6_slides_doinIo t hurdles_i_pv6_slides_doin
Io t hurdles_i_pv6_slides_doin
 
Implementing lora smartcity doin
Implementing lora smartcity doinImplementing lora smartcity doin
Implementing lora smartcity doin
 
Csc jonny doin_painel1_sm
Csc jonny doin_painel1_smCsc jonny doin_painel1_sm
Csc jonny doin_painel1_sm
 
ParallelLogicToEventDrivenFirmware_Doin
ParallelLogicToEventDrivenFirmware_DoinParallelLogicToEventDrivenFirmware_Doin
ParallelLogicToEventDrivenFirmware_Doin
 
SiliconFailsafeForIoT_Doin
SiliconFailsafeForIoT_DoinSiliconFailsafeForIoT_Doin
SiliconFailsafeForIoT_Doin
 
ImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_DoinImplementingCryptoSecurityARMCortex_Doin
ImplementingCryptoSecurityARMCortex_Doin
 

Recently uploaded

Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Chandigarh Call girls 9053900678 Call girls in Chandigarh
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
@Chandigarh #call #Girls 9053900678 @Call #Girls in @Punjab 9053900678
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
Call Girls In Delhi Whatsup 9873940964 Enjoy Unlimited Pleasure
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
dharasingh5698
 

Recently uploaded (20)

Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
Low Sexy Call Girls In Mohali 9053900678 🥵Have Save And Good Place 🥵
 
Trump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts SweatshirtTrump Diapers Over Dems t shirts Sweatshirt
Trump Diapers Over Dems t shirts Sweatshirt
 
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
VVIP Pune Call Girls Sinhagad WhatSapp Number 8005736733 With Elite Staff And...
 
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
VVVIP Call Girls In Connaught Place ➡️ Delhi ➡️ 9999965857 🚀 No Advance 24HRS...
 
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...Russian Call Girls Pune  (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
Russian Call Girls Pune (Adult Only) 8005736733 Escort Service 24x7 Cash Pay...
 
Real Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirtReal Men Wear Diapers T Shirts sweatshirt
Real Men Wear Diapers T Shirts sweatshirt
 
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting  High Prof...
VIP Model Call Girls Hadapsar ( Pune ) Call ON 9905417584 Starting High Prof...
 
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Sarai Rohilla Escort Service Delhi N.C.R.
 
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort ServiceBusty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
Busty Desi⚡Call Girls in Vasundhara Ghaziabad >༒8448380779 Escort Service
 
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
6.High Profile Call Girls In Punjab +919053900678 Punjab Call GirlHigh Profil...
 
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
Hire↠Young Call Girls in Tilak nagar (Delhi) ☎️ 9205541914 ☎️ Independent Esc...
 
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
Russian Call Girls in %(+971524965298  )#  Call Girls in DubaiRussian Call Girls in %(+971524965298  )#  Call Girls in Dubai
Russian Call Girls in %(+971524965298 )# Call Girls in Dubai
 
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...(+971568250507  ))#  Young Call Girls  in Ajman  By Pakistani Call Girls  in ...
(+971568250507 ))# Young Call Girls in Ajman By Pakistani Call Girls in ...
 
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
valsad Escorts Service ☎️ 6378878445 ( Sakshi Sinha ) High Profile Call Girls...
 
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
Call Now ☎ 8264348440 !! Call Girls in Green Park Escort Service Delhi N.C.R.
 
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort ServiceEnjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
Enjoy Night⚡Call Girls Samalka Delhi >༒8448380779 Escort Service
 
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...Katraj ( Call Girls ) Pune  6297143586  Hot Model With Sexy Bhabi Ready For S...
Katraj ( Call Girls ) Pune 6297143586 Hot Model With Sexy Bhabi Ready For S...
 
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
All Time Service Available Call Girls Mg Road 👌 ⏭️ 6378878445
 
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 BookingVIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
VIP Call Girls Himatnagar 7001035870 Whatsapp Number, 24/07 Booking
 
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
2nd Solid Symposium: Solid Pods vs Personal Knowledge Graphs
 

Esc 209 slides-doin

  • 1. Web of Things: HTML5 for resource constrained Embedded Systems Tuesday, April 23, 13
  • 2. Design  West  2013 Web  of  Things:    HTML5  for   resource  constrained   Embedded  Systems Jonny  Doin,  CEO  -­‐  GridVORTEX Sergio  Eduardo  Alves  de  Paula,  R&D  Engineer Tuesday, April 23, 13
  • 3. Embedded HTML5 Objectives This class is NOT a tutorial on HTML5, nor it is about Web Design. It is about a design approach to implement a responsive dynamic Web Server in an Embedded System The simple techniques shown would allow you to implement one this weekend, in your own project. Tuesday, April 23, 13
  • 4. Embedded HTML5 Agenda • Which Embedded Systems? • Embedded Web Servers • The TCP/IP Stack • Socket Layer Backend • Dynamic Content Handling • SSE/JSON/AJAX • Some performance data Tuesday, April 23, 13
  • 5. Embedded HTML5 Which Embedded Systems ? Currently, the class of “Embedded Systems” includes a wide range of systems: • dedicated Linux machines, having Gigabytes of memory and powerful processors; • medium sized microcontrollers with RTOS, having Megabytes of memory; • small control oriented microcontrollers, with very limited memory and no operating system (bare- metal); Tuesday, April 23, 13
  • 6. Embedded HTML5 Which Embedded Systems ? We focus on the smaller systems: • Program memory ranging from 128KB to 2MB; • SRAM ranging from 32KB to 256KB; • Usually running with no operating systems, in a ‘bare-metal’ application; • Frequently found on Industrial instrumentation and control applications; Tuesday, April 23, 13
  • 7. Embedded HTML5 Which Embedded Systems ? Industrial bare-metal systems • Often are connected to Fieldbus networks; • Need deterministic response to field events; • Usually are sensitive to increased response latency; • In recent years are connected to TCP/IP networks; • Integration with IT backend and M2M control; • Besides M2M, are required to support HMI clients via web browsers; Tuesday, April 23, 13
  • 8. Embedded HTML5 Embedded Web Servers Current systems are required to do much more than showing simple static text pages: • Dynamic monitoring of sensor and process data; • Interact with the control process to send commands; • Responsive and complex configuration interfaces; • Graphically plot process and sensor data; Tuesday, April 23, 13
  • 9. Embedded HTML5 Embedded Web Servers This set of requirements is formidable, and traditionally required a LAMP stack (Linux, Apache, MySql, Perl/Python/PHP). • The dynamic content usually relies on backend support (PHP / Server scripts / process database) • Large RAM space dedicated to network buffers; • Responsive user interface demands process bandwidth; Tuesday, April 23, 13
  • 10. Embedded HTML5 Embedded Web Servers In a small embedded system, the toll of a fast web server can drain system resources. • Available RAM is reduced for core data processing; • Most Embedded Web Servers allow limiting RAM allocation, however: • Small allocated memory usually leads to unresponsive interfaces; • Network buffers for each socket cannot be eliminated; Tuesday, April 23, 13
  • 11. Embedded HTML5 The TCP/IP Stack In this design we selected a hardware TCP/IP chip as the network interface. • Eliminates network buffer RAM from main processor; • Dedicated hardware protocol, reduces processor bandwidth for protocol datagrams; • handles network processing up to the socket layer; • reduced code footprint on main application; • simple implementation from the socket layer up; Tuesday, April 23, 13
  • 12. Embedded HTML5 Hardware-based TCP/IP The location of the network interface in a separate chip brings other advantages: • Separate processing environment; • Insulates core app from network protocol attacks; • Reduces threats from the network toxic environment; • Network interface can be reset without breaking the app core; Tuesday, April 23, 13
  • 13. Embedded HTML5 Socket Layer Backend The socket layer on the server side must implement the HTTP state machine. • Parsing of HTTP requests; • Composition of HTTP frames to be sent; • Handlers for server sent events (SSE); • Handlers and parser for CGI commands; Tuesday, April 23, 13
  • 14. Embedded HTML5 Socket Layer Backend Several NFR (non-functional requirements) are important in the implementation of the socket backend: • Guarded buffers and overflow detection techniques; • Strict control of memory allocation; • Safe state machines; • Error detection and containment; • Failures should not reach the app core. Tuesday, April 23, 13
  • 15. Embedded HTML5 Dynamic Content Handling Can be implemented in a number of ways: • Directly rendering the page, embedding the data in the page description (printf): • Poor update rate (page refresh); • Needs the entire payload to be buffered before transmission; • Fixed pages with placeholders for streaming data: • use CSS to format data; • use SSE to bind streaming data to fields; Tuesday, April 23, 13
  • 16. Embedded HTML5 Dynamic Content Handling Using fixed pages for dynamic content has a number of advantages: • All formatting and placement of the data fields are controlled by the page script, not by the server; • Complete concern separation from the server and presentation layers; • The payload length is always known when assembling the frame header, since the frames are always static; • Fixed payloads allow “windowing” buffering; • This can be done with less than 200bytes of page buffers per socket; Tuesday, April 23, 13
  • 17. Embedded HTML5 SSE - HTML5 Streaming Data SSE (Server-Sent Events) is one of the new HTML5 features that is most appealing to embedded web servers. • Allow a stream of server data to be sent to the page without continuous client request; • Data update rate can be set individually by each stream; • Can be implemented cleanly with event generators in the server; • Data binding and parsing is simple when using JSON; Tuesday, April 23, 13
  • 18. Embedded HTML5 JSON - Javascript Object Notation A simple text format for data interchange. • Based on name/value pairs description; • Is powerful while having simple formatting rules; • can be applied to streaming data pairs; • values are accessible by javascript in a natural manner; • helps keeping server-side concerns generalized by having a standard formatting of data; • can be completely abstracted by event generator descriptors; Tuesday, April 23, 13
  • 19. Embedded HTML5 XML HTTP Requests Used to send commands and data from the client to the server. • Simple standard parsing on the server side; • When used with SSE cuts bandwidth needs by half, when compared to AJAX; • When JSON is used, parsing is very straightforward; • Javascript has total control over the user interface; Tuesday, April 23, 13
  • 20. Embedded HTML5 Putting it all together Using SSE and XML HTTP Requests need coordination from the page script. • SSE streams are continuous until stopped by the page script; • While the SSE stream is playing, no data can be sent back to the server; • The page script stops the SSE stream, sends XML HTTP Requests and starts the SSE stream again; • Error detection and browser support detection must be done in the page script; Tuesday, April 23, 13
  • 21. Embedded HTML5 Some Performance Data Simple web servers for dynamic content can be realized using HTML5 SSE, JSON and XML HTTP Requests. Successful use of these features results in fast and small servers. • Multiple data stream updates with less than 100ms latency; • RAM usage on the server side (for the web server) of less than 2KB; • Server side code footprint of less than 5KB; • Less than 500 lines of C code; • Exception handling on the script side and on the server is simplified; Tuesday, April 23, 13
  • 22. Design  West  2013 THANK  YOU Jonny  Doin  -­‐  GridVORTEX jonnydoin@gridvortex.com Tuesday, April 23, 13