Which OSI layer does WebSocket Protocol lay on?

Kit Ho picture Kit Ho · Jan 3, 2013 · Viewed 13.1k times · Source

I was wondering if it is layer 7 for websocket as the application is actually the browser.

Answer

shawnzhu picture shawnzhu · Jun 24, 2013

Websocket depends on TCP (OSI#4) and only the handshake phase is initialized by HTTP (OSI#7) 1. Although it uses TCP port 80 only.

According to the runtime behavior, I have to say WebSocket should be a special OSI#7 protocol. Then we can put SSL/TLS into OSI#6 (see wikipedia), and the implementation inside browser into OSI#5.