So we know that UDP is message-oriented and TCP is stream-oriented. Why is the SMTP using TCP instead of UDP?
2 Answers
Why is the SMTP using TCP instead of UDP?
Mainly because TCP is reliable and UDP is not, i.e. with UDP the application would need to care about lost, duplicated or reordered data.
Also, a mail is not the same as a "message" in UDP. This UDP message just means a datagram with a specific length and no predefined inner structure. A mail has some inner structure though. The length of a mail can also easily exceed the maximum size of a UDP message (64k).

- 114,247
- 10
- 131
- 172
The usual rules for deciding whether to use TCP or UDP is as follows:
If you need all the features TCP provides that UDP doesn't, use TCP. You're not going to make a better TCP.
If there are features TCP provides that have high cost in your application that you can avoid by using UDP, use UDP.
So let's apply that logic to SMTP for the features TCP provides that UDP doesn't:
Connection oriented: Well, you need that for SMTP. You want to start a connection to deliver mail. You can't make an email a single chunk of data because they can several megabytes.
Slow start: Well, you need that for SMTP. You can't just send a bunch of emails at full speed, you'll get packet loss. You need to start sending data slowly and asses available network bandwidth.
Reordering, duplicate detection, and lost datagram retransmission: Well, you need that for SMTP. You need to retransmit dropped datagrams and you need to fix any parts of an email received out of order.
Send and receive windows: Well, you need that for SMTP. It's hard to transfer large amounts of data efficiently without that.
So if SMTP was build over UDP, SMTP itself would need to implement the majority of the feature set of TCP because SMTP needs it. TCP was designed by top experts, is heavily optimized on all popular platforms, and network engineers optimize networks for its performance. You're not going to beat that with something designed specifically for SMTP and it wouldn't make sense for every top layer protocol to implement its own version of all those features.

- 179,497
- 17
- 214
- 278