Commands and responses to the SMTP protocol
From the previous communication model, you can see that the SMTP protocol's session between sending SMTP and receiving SMTP is done by sending SMTP commands and receiving an answer to SMTP feedback. After the communication link is established, Send SMTP send mail command message sender, if receive SMTP at this time can receive mail then make OK answer, and then send SMTP continue to Issue RCPT command to confirm whether the message received, if received on the answer to OK, otherwise issued a refusal to receive answers, However, this does not affect the entire message operation. The two sides have been repeated so many times until the message is processed. The SMTP protocol contains a total of 10 SMTP commands, which are listed below:
SMTP Command Command description
Hello Identifies the sender to a Hello command to receive SMTP
Mailfrom: is the sender's address. This command tells the receiver the beginning of a new mail delivery and initializes all States and buffers. This command begins a message transfer process that ultimately completes the delivery of the message data to one or more mailboxes.
Rcptto: Identifies the addresses of individual message recipients
DATA
Receiving SMTP will treat the behavior that follows as mail data to . to identify the end of the data.
REST exit/Reset the current message transfer
NOOP requires the receive SMTP to do only the OK answer. (For testing)
QUIT requires that receive SMTP return an OK answer and turn off the transmission.
VRFY verifies that the specified mailbox exists, and because of security factors, the server suppresses this command more than once.
EXPN verifies that a given mailbox list exists, and that expanding the list of mailboxes is often prohibited.
Help What command does the query server support?
Note: The returns, wraps, and ASCII codes are 13, 10 (decimal), respectively.
Each command of the SMTP protocol returns an answer code, each of which has a specific meaning, such as the first digit of 2, the command succeeds, the 5 table fails, and the 3 table is not completed. Some of the more complex mail programs use this feature, first check the answer code first number, and based on its value to determine the next move. The following list of SMTP answer codes is as follows:
Answer Code Description
501 Parameter Format error
502 Command not implemented
503 Wrong sequence of commands
504 Command parameter not implemented
211 System State or system help response
214 Help information
Service Ready
221 Service shutdown
421 Service not ready, turn off transport channel
250 required mail operation completed
251 The user is not local and will forward to
450 The requested mail operation was not completed and the mailbox is not available
550 The requested mail operation was not completed and the mailbox is not available
451 abort the required operation; error occurred during processing
551 user is not local, try
452 system storage insufficient, required operation not performed
552 Excess storage allocation, required operation not performed
553 The mailbox name is not available and the requested operation is not performed
354 start the message input to "." End
554 operation failed
Several basic features of UDP protocol
(1) UDP is a connectionless protocol to transmit data before the source and terminal do not establish a connection, when it wants to transfer simply to crawl data from the application, and as quickly as possible to throw it on the network. At the sender, the speed at which UDP transmits data is limited by the speed of data generated by the application, the ability of the computer, and the bandwidth of the transmission; at the receiving end, UDP places each message segment in the queue, and the application reads a message segment from the queue each time.
(2) because the transmission data does not establish the connection, therefore also does not need to maintain the connection state, including the sending and receiving status and so on, therefore one server machine can transmit the same message to multiple clients at the same time.
(3) The header of the UDP packet is very short, only 8 bytes, and the additional overhead for TCP's 20-byte packets is small.
(4) Throughput is not regulated by congestion control algorithms and is limited only by the rate of data generated by the application software, transmission bandwidth, source-end and terminal host performance.