Is SMTP based on TCP or UDP?

118,401

In theory SMTP can be handled by either TCP, UDP, or some 3rd party protocol.

As defined in RFC 821, RFC 2821, and RFC 5321:

SMTP is independent of the particular transmission subsystem and requires only a reliable ordered data stream channel.

In addition, the Internet Assigned Numbers Authority has allocated port 25 for both TCP and UDP for use by SMTP.

In practice however, most if not all organizations and applications only choose to implement the TCP protocol. For example, in Microsoft's port listing port 25 is only listed for TCP and not UDP.


The big difference between TCP and UDP that makes TCP ideal here is that TCP checks to make sure that every packet is received and re-sends them if they are not whereas UDP will simply send packets and not check for receipt. This makes UDP ideal for things like streaming video where every single packet isn't as important as keeping a continuous flow of packets from the server to the client.

Considering SMTP, it makes more sense to use TCP over UDP. SMTP is a mail transport protocol, and in mail every single packet is important. If you lose several packets in the middle of the message the recipient might not even receive the message and if they do they might be missing key information. This makes TCP more appropriate because it ensures that every packet is delivered.

Share:
118,401
Jerry Cai
Author by

Jerry Cai

Updated on May 28, 2020

Comments

  • Jerry Cai
    Jerry Cai almost 4 years

    Is SMTP based on TCP or UDP ? I really can't confirm it . In my opinion, SMTP should be based on UDP, but someone told me that is must be TCP.

  • Gambit Support
    Gambit Support about 6 years
    SNMP is not SMTP
  • Ehsan Hemmati
    Ehsan Hemmati almost 6 years
    @GambitSupport It was a typo (I'm dealing with both SNMP and SMTP so kind of normal to mix them)! the RFC refers to SMTP, and not SNMP, so the answer is still valid.
  • Ale
    Ale over 3 years
    UDP is NOT a reliable ordered data stream channel. An example of such a channel that SMTP runs over is TLS. Perhaps SMTP could be extended to SCTP or MBTCP one day —that's not on the horizon yet.