WEBSOCKETS                                Rodr igo Constantin Ctenas Zaccar a                                             ...
STANDARDIZATION   • Internet              Engineering Task Force        • Protocol   • World Wide Web                 Cons...
PROTOCOLWednesday, November 23, 2011
HANDSHAKE   • HTTP        • Connection: upgrade        • Upgrade: websocket        • Sec-WebSocket-*       headersWednesda...
MESSAGE EXCHANGE                            0                   1                   2                   3                 ...
JAVASCRIPT APIWednesday, November 23, 2011
METHODS   • send   • Callback                  style        • onopen        • onclose        • onerror        • onmessageW...
COMPARISONWednesday, November 23, 2011
HTTP POOLING   • protocol                  overhead: 600 bytes                           users            Traffic (bytes)  ...
WEBSOCKET   • protocol                  overhead: 2 bytes                           users             Traffic (bytes)   Tra...
DEMOWednesday, November 23, 2011
CONCLUSION   • WebSocket                 is the choice for web real time communication   • Very           efficient network...
WEBSOCKETS                                Rodr igo Constantin Ctenas Zaccar a                                             ...
Upcoming SlideShare
Loading in …5
×

WebSockets

1,104 views

Published on

Pequena apresentação de 15 minutos sobre WebSockets na disciplina de "programação para redes de computadores"

Published in: Technology
0 Comments
0 Likes
Statistics
Notes
  • Be the first to comment

  • Be the first to like this

No Downloads
Views
Total views
1,104
On SlideShare
0
From Embeds
0
Number of Embeds
22
Actions
Shares
0
Downloads
8
Comments
0
Likes
0
Embeds 0
No embeds

No notes for slide

WebSockets

  1. 1. WEBSOCKETS Rodr igo Constantin Ctenas Zaccar a 6367629Wednesday, November 23, 2011
  2. 2. STANDARDIZATION • Internet Engineering Task Force • Protocol • World Wide Web Consortium • JavaScript APIWednesday, November 23, 2011
  3. 3. PROTOCOLWednesday, November 23, 2011
  4. 4. HANDSHAKE • HTTP • Connection: upgrade • Upgrade: websocket • Sec-WebSocket-* headersWednesday, November 23, 2011
  5. 5. MESSAGE EXCHANGE 0 1 2 3 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 +-+-+-+-+-------+-+-------------+-------------------------------+ |F|R|R|R| opcode|M| Payload len | Extended payload length | |I|S|S|S| (4) |A| (7) | (16/63) | |N|V|V|V| |S| | (if payload len==126/127) | | |1|2|3| |K| | | +-+-+-+-+-------+-+-------------+ - - - - - - - - - - - - - - - + | Extended payload length continued, if payload len == 127 | + - - - - - - - - - - - - - - - +-------------------------------+ | |Masking-key, if MASK set to 1 | +-------------------------------+-------------------------------+ | Masking-key (continued) | Payload Data | +-------------------------------- - - - - - - - - - - - - - - - + : Payload Data continued ... : + - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - - + | Payload Data continued ... | +---------------------------------------------------------------+Wednesday, November 23, 2011
  6. 6. JAVASCRIPT APIWednesday, November 23, 2011
  7. 7. METHODS • send • Callback style • onopen • onclose • onerror • onmessageWednesday, November 23, 2011
  8. 8. COMPARISONWednesday, November 23, 2011
  9. 9. HTTP POOLING • protocol overhead: 600 bytes users Traffic (bytes) Traffic (Mbps) 1000 600000 4.5 10000 6000000 45 100000 60000000 450Wednesday, November 23, 2011
  10. 10. WEBSOCKET • protocol overhead: 2 bytes users Traffic (bytes) Traffic (Mbps) 1000 2000 0.019 10000 20000 0.19 100000 200000 1.9Wednesday, November 23, 2011
  11. 11. DEMOWednesday, November 23, 2011
  12. 12. CONCLUSION • WebSocket is the choice for web real time communication • Very efficient network traffic • Full duplex (connection always ready for client and server)Wednesday, November 23, 2011
  13. 13. WEBSOCKETS Rodr igo Constantin Ctenas Zaccar a 6367629Wednesday, November 23, 2011

×