NETWORK LAB / TCP SOCKETS
01 · SOCKET PROGRAMMINGA FIRST CLICK MOMENT
One robot.
Two sockets.
A real TCP conversation.
Explore how an autonomous mobile robot application connects to a fleet server, sends a message, and gets an application-level confirmation.
Interactive browser simulation · Actual runnable TCP source code included
TransportTCP
Host127.0.0.1
Server port12000
App framingJSON + \n
Make the connection
STEP 1 OF 2AMR-01
TCP client process
127.0.0.1:ephemeral
Not connected
Fleet server
TCP server process
127.0.0.1:12000
Press Connect to visualize the OS-managed three-way TCP handshake.
Event timeline
READY · Server listening
The server has called bind() and listen(). No client is connected yet.
Application messages
CLIENT → SERVER
{
"type": "robot_status",
"robot_id": "AMR-01",
"status": "mission_complete"
}
SERVER → CLIENT
{
"type": "status_ack",
"accepted": true
}
The response labeled status_ack is an application message, not the TCP protocol's acknowledgement packet.
What you're actually learning
The socket API connects application processes to transport services. The operating system manages TCP connection establishment, sequence numbers, and acknowledgments. Your application chooses the message format and when a message has been processed.
Important: This browser page simulates events for visualization. It does not open a TCP socket. The companion client.py and server.py actually communicate using TCP on localhost.