Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

26
GDAYx MOROCCO

description

Introduction à SPDY, ma presentation lors de mon atelier "Next Generation Netwoking Protocols" pendant Google Day X Morocco 2014

Transcript of Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Page 1: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

GDAYx MOROCCO

Page 2: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

GDayX Morocco 2014

Par Mohammed CHERIFI

Consultant [email protected]

@mcherifi

Next Generation

Networking Protocols

Page 3: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Qui?

• IETF HTTPbis Working Group

• Akamai

• Canon

• Chromium

• Firefox

• Google

• Microsoft

• Twitter

Page 4: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Pourquoi?

On compte 2.4 billion d’internautes dans le monde (3 billions vers la fin d’année selon les nations unies).

Notre utilisation d’internet a changé :• Les terminaux mobiles sont devenus plus puissants• Le web est devenu plus social• Les applications riches sont devenus plus

gourmandes en termes de ressources

Une revue des performances, de la sécurité et de l’interopérabilité s’impose!

Page 5: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Les limitations d’HTTP

• Mode Transactionnel : Une seule requête par connexion

• Le serveur délaie la connexion de 500ms pour empêcher l’usage du canal TCP

• Depuis 2008 les navigateurs sont passés de 2 connexions à 6 par serveur

• Unidirectionnel : Seul le client peut initier une requête (unidirectionnel), absence d’un mécanisme qui permet au serveur d’informer le client de l’absence d’une ressource et la servir

• Les entêtes HTTP sont envoyées en plaintext

• La compression des données est optionnelle (gzip)

• Redondance des valeurs des entêtes HTTP (notamment User-Agent, Host, Accept etc..)

• Les spécifications actuelles datent de 1999

Page 6: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Les requêtes HTTP

• Ouverture de la connexion

• Le client envoie la requête HTTP

• Le serveur envoie la réponse

• OK

Page 7: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

TCP 3-Way Handshake (SYN,SYN-ACK,ACK)

• Host A sends a TCP

SYNchronize packet to Host B

• Host B receives As SYN

• Host B sends a SYNchronize-

ACKnowledgement

• Host A receives Bs SYN-ACK

• Host A sends ACKnowledge

• Host B receives ACK.

Avec un ping de 50ms, ce

mécanisme nécessite au

minimum 150ms

Page 8: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Internet Mobile est lente

Connexions 4G :• Entre 3 à 6Mbps, upload > 1.5Mbps• Pas largement adopté• Latence moyenne: 150ms par connexion

3G :• Entre 600kbps à 1.4Mbps, upload entre 350kbps et

500bps• Largement adopté mais les débits sont encore modeste• Latence moyenne: 400ms

EDGE : • No way

Page 9: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Le Web est devenu plus interactif

Les requêtes HTTP sont devenus plus gourmandes en

termes de ressources (notamment les entêtes HTTP)

Des techniques d’optimisation ont déjà été mise en place

pour réduire le temps de réponse:

• Mécanismes de Cache (Navigateurs/Servers)

• Domain Sharding

• Keep Alive (Connexions dédiées)

• Pipelining

• Compression gzip

Page 10: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Les entêtes HTTP sont bavardes

Avec 4 requêtes nous auront :

2,596 bytes au total

1,797 bytes redondants

Page 11: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Mesures d’optimisation

Sharding

Le cas de Youtube :

Page 12: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Mesures d’optimisation

Concaténation

Page 13: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

SPDY?

• Protocol conçu pour de transport du contenu web

• N’est pas un remplacement d’HTTP.

• Respecte la sémantique d’HTTP 1.x

• Définit comment interagir avec HTTP1.x

• Développé par Google en 2012

Page 14: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Pourquoi SPDY?

• Permettre plusieurs requêtes HTTP pendant une seule session

TCP.

• Économiser la bande passante en compressant les entêtes HTTP

et en éliminant les les entêtes redondantes.

• SSL par défaut pour le transport des données, utilisation de

l’extension SSL NPN pour une meilleurs sécurité.

• Permettre au serveur d’initier des communications avec le client à

travers un canal TCP unique quand c’est nécessaire seulement.

Page 15: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Optimisation des entêtes HTTP

Entête HTTP2.0

Page 16: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Compression des entêtes HTTP

• Toutes les données sont compressées y compris les

entêtes HTTP!

• Les données redondantes sont supprimées.

• Gzip est utilisé pour la compression par défaut dans les

deux directions (Client/Serveur)

Page 17: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Test Case – Compression

Comparatif des bytes échangés avec et sans compression des entêtes HTTP

Page 18: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Sécurité – SPDY & TLS

• SSL doit être toujours activé

• L’extension SSL NPN permettra de renforcer le

chiffrement entre le client/serveur

• Strict Transport Security par défaut

• L’entête Public-Key-Pinning pour la validation des

certificats (contre-mesure pour les attaques Man In

The Middle)

Page 19: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Avantages de SPDY

• Multiplexage (permettre plusieurs requêtes à travers une seule

connexion TCP)

• Priorisation (indiquer au serveur quelle ressource est plus

importante qu’une autre?)

• Compression (toujours activée, extension aux entêtes HTTP)

• Serveur Push (permettre au serveur d’envoyer des données au

client à travers le même canal TCP)

• Recommandation du chiffrement (obligatoire dans les

implémentations actuelles)

Page 20: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Push Notifications

Push à travers TCP HTTP1.x vs SPDY

• La connexion n’est pas

fermée après l’envoi de

la requête HTTP.

• Le fichier style.css est

servi sur le même canal

TCP.

• Le serveur peut

communiquer avec le

client à travers le même

canal à travers des

notifications Push et

Hint

Page 21: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Support de SPDY

• Chrome, depuis la v11

• Ice Cream Sandwich

• Firefox

- Expérimental à la v 11

- Activé par défaut depuis la v12/v13

• Amazon Silk

• Apache mod_spdy

• Erlang-spdy

• Node-spdy

• Netty 3.3.1 (JBoss)

• Tomcat SPDY Connector

• Jetty 7.6.2

Clients: Serveurs :

Page 22: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Demo SPDY vs HTTP

mod_spdy World Flags Demo

Voir sur Youtube : http://www.youtube.com/watch?v=vEYKRhETy4A

Page 23: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Conclusion

• SPDY est plus rapide

• SPDY est plus sécurisé

• SPDY est plus interactif

• SPDY est déjà implémenté par plusieurs organisations et a fait

ses preuves

La transition vers HTTP2.0 se fera progressivement après la validation

finale des spécifications (4ans environ)

Page 24: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

Adoption par HTTbis-WG

SPDY a été Adopté par l’IETF HTTPbis

Working Group comme base pour la

définition des spécifications d’HTTP2.0

Page 25: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Google

Student

Ambassadors

A community organize event with a format inspired by the

Google g|days

En savoir plus

Internet Engeeniring Task Force (IETF)

https://www.ieft.org

Mark Nottingham:

https://www.mnot.net/talks/http2-challenges/#/

HTTP2.0 Working Group (Draft IETF)

https://datatracker.ietf.org/wg/httpbis/

GITHUB :

https://github.com/http2/http2-spec

Page 26: Introduction à SPDY, Next Generation Networking Protocols - Google Day X Morocco 2014

Merci de votre

attention!