Explain like I'm five · Network

What is a Socket?

Socket communication, told as a story about a dedicated mailbox hole made from a house address and a room number.

Happy Villato Happy Villa!several people share one house — a letter arrives, but whose is it?the house address alone can't tell apart who's inside

Several people share one house.The house address alone can't tell apart who's inside.

several programs talking at once get their letters tangled

Several programs talking at once get their letters tangled.The house address alone can't tell which letter belongs to which program's conversation.

IP: 1.2.3.4IP: 5.6.7.8:51234:443a socket = a hole made from a house address (IP) plus a room number (port), one end of a conversationin TCP, one connected socket hole carries that talk to the end

A socket is a dedicated hole made from an address and a room number.In TCP, one connected socket hole carries that conversation from start to finish.

IP addresssays which house it is
Port numbersays which room number
A dedicated holein TCP, a fresh hole for each connection
Open and closemade when talk begins, removed when it ends
Sender socketIP: 1.2.3.4port: 51234Receiver socketIP: 5.6.7.8port: 443

A socket sits at each end.The sender's IP+port and the receiver's IP+port together form the connection.

open a socket for registered envelopes (TCP)or open one for plain envelopes (UDP)a socket is the hole — which envelope it uses is chosen when the hole is made

A socket is the hole — the envelope type is chosen when it's made.When a socket is opened, it's set up for registered envelopes (TCP) or plain ones (UDP).

In one breath

A socket is a dedicated mailbox hole made from an IP address (which house) and a port number (which room), looking after one end of a conversation.

A socket is the endpoint the operating system provides for network communication, identified by the combination of an IP address and a port number (the socket address). A program creates a socket, gives it an address (bind) or links it to the other side (connect), then reads and writes data — a TCP socket behaves connection-oriented, a UDP socket connectionless. Multiple programs on the same host sharing one IP are still told apart as long as their port numbers differ.

When grown-ups say it

Socket
A dedicated hole made from an address and a room number. It marks one end of a connection.
IP address
The house address. Points to which computer it is.
Port number
The room number inside the house. Points to which program it is.
TCP/UDP
The registered envelope and the plain one. Choosing which envelope to send through the socket hole. → the registered envelope and the plain one
bind/connect
The steps that give the hole an address (bind) and link it to the other side (connect). The setup step before a socket can be used.
Port conflict
Trying to use a room number that's already taken. The same room number can't be reused at once.
Firewall
A wall with many doors. Sometimes blocks socket access by keeping only certain ports open. → the wall with many doors
IPv6
The far longer new house-address system. The house part of a socket address is moving to this system. → the new, nearly endless address system
Next story
Finding a Position From Three Signal Towers →
Want another term as a picture book? Request →