NET-04 · Educational simulation
TCP vs UDP Communication
Same data, two ways to carry it. TCP opens a connection, numbers every byte, acknowledges it and resends what is lost; UDP just sends. Run both, drop packet 3, and compare.
- 1Application
- 2Handshake
- 3Segments & ACKs
- 4Delivered
ReadyTCPStep 0 / 30
The data is ready at Client-A. Choose a protocol and press “Send data”.
Explanation
Before you start
Client-A will send a 5000-byte file to Server-B over TCP. Press “Send data” to watch the handshake, then the segments and ACKs — or “Step” to advance one event at a time. Try “Drop packet 3” to see TCP recover.
Why does TCP open a connection before sending data?
Keep going — the answer unlocks when the run reaches it.
What are sequence numbers for?
Keep going — the answer unlocks when the run reaches it.
What does ACK 2001 mean?
Keep going — the answer unlocks when the run reaches it.
How does the data arrive in order?
Keep going — the answer unlocks when the run reaches it.
Segment inspector
No packet yet
- Protocol
- —
- Source IP
- —
- Destination IP
- —
- Source port
- —
- Destination port
- —
- TTL
- —
- Status
- —
Protocol state
TCP
- CLOSED
- SYN-SENT
- ESTABLISHED
- LISTEN
- SYN-RECEIVED
- ESTABLISHED
- Connection setup (handshake)
- Sequence numbers
- Acknowledgments
- Retransmission of losses
- In-order delivery
- 20 BHeader size
Event timeline
0 / 30
- Application data prepared
- SYN sent
- Router forwarded SYN
- SYN received by server
- SYN-ACK sent
- Router forwarded SYN-ACK
- SYN-ACK received
- ACK sent
- Router forwarded ACK
- TCP connection established
- Data segmented
- Segments #1 and #2 sent
- Router forwarded segments #1 and #2
- Segments #1 and #2 received in order
- ACK 2001 sent
- Router forwarded ACK 2001
- ACK 2001 received
- Segments #3 and #4 sent
- Router forwarded segments #3 and #4
- Segments #3 and #4 received in order
- ACK 4001 sent
- Router forwarded ACK 4001
- ACK 4001 received
- Segment #5 sent
- Router forwarded segment #5
- Segment #5 received in order
- ACK 5001 sent
- Router forwarded ACK 5001
- ACK 5001 received
- Application data delivered in order
Comparison
TCP vs UDP — same data, no loss
TCP· running
- Packets on the wire
- 11
- Handshake packets
- 3
- ACKs
- 3
- Retransmissions
- 0
- Delivered to the app
- 5/5
- Transport header bytes
- 228 B
- Run time (1×)
- 48.9 s
UDP· reference
- Packets on the wire
- 5
- Handshake packets
- 0
- ACKs
- 0
- Retransmissions
- 0
- Delivered to the app
- 5/5
- Transport header bytes
- 40 B
- Run time (1×)
- 26.8 s