4 ms·
A TCP connection is a virtual connection. The two sides of the connection maintain state and use this to turn packets into a stream of data. Since IP doesn't
by aidenn0 3y ago
A TCP connection is a virtual connection. The two sides of the connection maintain state and use this to turn packets into a stream of data. Since IP doesn't guarantee delivery at all, much less in-order delivery, this requires some work, and maintaining state on both ends.
UDP is a stateless protocol. If you listen on port 12345, you will get every packet that comes in on port 12345. Some packets sent won't make it, others might arrive twice, others might arrive out-of-order.