Learning Question

What transport-level state exists before an application protocol assigns meaning?

Before HTTP or WebSocket meaning exists, the operating system and transport layer maintain endpoints, addresses, ports, buffers, sequence state, and connection state. These objects make communication possible, but they do not decide application message meaning.

Socket as Endpoint

A socket is an operating-system-managed communication endpoint. A process accesses it through a descriptor, handle, or language-level object.

process
-> descriptor or object
-> OS-managed socket
-> transport and network machinery

The socket is not the application protocol. It is the endpoint through which the application protocol’s bytes move.

Ports and Connection Identity

A port is part of a transport endpoint address. It is not the socket by itself.

In TCP, a connection is commonly identified by:

source IP
source port
destination IP
destination port
protocol

This is why two applications on the same host can connect to the same server. They can use different local ephemeral ports, so returning data can be delivered to the right socket.

Server Listening and Accepted Connections

A server often has a listening socket bound to a local address and port:

server listens on 0.0.0.0:443

When a client connection is accepted, the server gets a connected socket for that particular client. The listening socket remains available for more connections.

The port may be the same server-side port, but each accepted connection is a distinct communication endpoint.

Transport State Is Not Message Meaning

TCP sequence numbers place bytes inside one connection’s ordered byte stream. They do not identify HTTP requests or WebSocket messages.

HTTP/2 stream IDs, WebSocket frames, HTTP headers, and SSE event delimiters are higher-level protocol structures. They ride above the lower transport state.

Core Mental Model

Use this boundary:

socket, address, port, TCP connection, sequence number
-> transport and OS communication state
 
HTTP request, HTTP response, SSE event, WebSocket message
-> application protocol meaning

Keeping that boundary clear prevents the mistake of treating an open connection as if it already explains the conversation.