Skip to content
Network Systems

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.

  1. 1Application
  2. 2Handshake
  3. 3Segments & ACKs
  4. 4Delivered
Protocol
Packet loss
  • SYN / SYN-ACK / ACK
  • Data segment
  • ACK
  • Each link has two lanes: out and back

ReadyTCPStep 0 / 30

The data is ready at Client-A. Choose a protocol and press “Send data”.

Speed

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

Client-A
  1. CLOSED
  2. SYN-SENT
  3. ESTABLISHED
Server-B
  1. LISTEN
  2. SYN-RECEIVED
  3. ESTABLISHED
Current operationIdle
  • Connection setup (handshake)
  • Sequence numbers
  • Acknowledgments
  • Retransmission of losses
  • In-order delivery
  • 20 BHeader size

Event timeline

0 / 30

  1. Application data prepared
  2. SYN sent
  3. Router forwarded SYN
  4. SYN received by server
  5. SYN-ACK sent
  6. Router forwarded SYN-ACK
  7. SYN-ACK received
  8. ACK sent
  9. Router forwarded ACK
  10. TCP connection established
  11. Data segmented
  12. Segments #1 and #2 sent
  13. Router forwarded segments #1 and #2
  14. Segments #1 and #2 received in order
  15. ACK 2001 sent
  16. Router forwarded ACK 2001
  17. ACK 2001 received
  18. Segments #3 and #4 sent
  19. Router forwarded segments #3 and #4
  20. Segments #3 and #4 received in order
  21. ACK 4001 sent
  22. Router forwarded ACK 4001
  23. ACK 4001 received
  24. Segment #5 sent
  25. Router forwarded segment #5
  26. Segment #5 received in order
  27. ACK 5001 sent
  28. Router forwarded ACK 5001
  29. ACK 5001 received
  30. Application data delivered in order

Comparison

TCP vs UDP — same data, no loss

TCP· running

Client-ARouterServer-BSYN · seq 0SYN-ACK · ack 1ACK · ack 1#1 · seq 1#2 · seq 1001ACK 2001#3 · seq 2001#4 · seq 3001ACK 4001#5 · seq 4001ACK 5001
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

Client-ARouterServer-BUDP #1UDP #2UDP #3UDP #4UDP #5
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
Designed & Developed by Osama Hasan Yahya

© 2026 OSANET90. All rights reserved.