0
0
Computer Networksknowledge~5 mins

WebSockets for real-time communication in Computer Networks - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a WebSocket?
A WebSocket is a communication protocol that provides a full-duplex, persistent connection between a client and a server, allowing real-time data exchange.
Click to reveal answer
beginner
How does WebSocket differ from HTTP?
Unlike HTTP, which is request-response and stateless, WebSocket creates a continuous connection allowing both client and server to send data anytime without repeated handshakes.
Click to reveal answer
beginner
What is the main advantage of using WebSockets for real-time communication?
WebSockets reduce latency and overhead by keeping the connection open, enabling instant data transfer which is ideal for chat apps, live updates, and games.
Click to reveal answer
intermediate
What does 'full-duplex' mean in the context of WebSockets?
Full-duplex means data can be sent and received simultaneously between client and server over the same connection.
Click to reveal answer
intermediate
What is the initial step to establish a WebSocket connection?
The client sends a WebSocket handshake request to the server over HTTP, which the server upgrades to a WebSocket connection if accepted.
Click to reveal answer
Which protocol does WebSocket start with before upgrading the connection?
ASMTP
BHTTP
CFTP
DTCP only
What type of communication does WebSocket provide?
ABroadcast only
BHalf-duplex
CSimplex
DFull-duplex
Which of these is a common use case for WebSockets?
ALive chat applications
BStatic web pages
CEmail sending
DFile storage
What happens if a WebSocket connection is closed?
AConnection switches to HTTP automatically
BData continues to flow automatically
CClient and server must re-establish connection to communicate again
DServer sends data without client request
Which layer of the internet protocol stack does WebSocket operate on?
AApplication layer
BTransport layer
CNetwork layer
DData link layer
Explain how WebSockets enable real-time communication between a client and a server.
Think about how WebSocket keeps the connection open and allows both sides to send data anytime.
You got /4 concepts.
    Describe a real-life example where WebSockets improve user experience compared to traditional HTTP.
    Consider apps like messaging or live sports scores.
    You got /4 concepts.