r/AskComputerScience • u/Aokayz_ • Jun 03 '26
Does Push Protocol Always Mean Client to Server?
Studying application layer protocols for high school computer science.
According to how I understand it, SMTP (Simple Mail Transfer Protocol) is a push protocol. Unlike a pull protocol (like POP3), an email is sent from client to server, instead of from server to client. Thus, it's a push protocol.
However, I'm reading that it's also about who initiates establishing the connection between server and client? As in, if the server initiates the connection, its push. Otherwise, it's pull.
I'm also reading that it's more about how often the client is connected to the server? As in, if they're always connected, it's push. Otherwise, it's pull.
But I don't understand, which of the 3 is right? Is there some larger idea that connects these ideas together? Also, if the protocol is connectionless, is it neither push nor pull? Lastly, in a peer to peer network, are there push or pull protocols? If so, how?
Note that I'm understanding this mainly off of SMTP, although I would like to know how push protocols function in general.
4
u/AlexTaradov Jun 03 '26 edited Jun 03 '26
You are mixing things up. SMTP is used to send emails. It is always "push" from the client side, since client can always just send the message.
POP3 and IMAP are used to receive mail. POP3 is outdated and is a polling protocol. Client must connect periodically and ask if there is new mail. Your mail can only arrive on periodic intervals. This would be "pull".
IMAP is a more modern version where client maintains a connection to the server, so the server may notify immediately when there is new mail. This is "push" from the server side.
In general, there is no strict definition for push and pull, it depends on the application a lot.
2
u/meditonsin Jun 03 '26
By definition, the side initiating the connection is always the client, and the one listening for incoming connections is always the server. So the server can not initiate connections.
But there are protocols where the client initiates a long lived connection that allows the server to send things through that connection without being prompted by the client.
End of the day, it comes down to this: Regardeless of whether you are a server or client, when you are sending data unprompted (e.g. delivering an email to an STMP server), you are pushing, and when you request data to be sent to you (e.g. requesting a POP3 server to send you the contents of your inbox), you are pulling.
2
u/high_throughput Jun 03 '26
"Pull" means it's up to the client to check periodically to see if anything's new.
"Push" means it's up to the server to notify you when there's something new.
The reason why clients are always connected for push is purely practical and not by definition. We live in a mobile world where people pop in and out of different wifi networks with different firewalls all day long, so it's not feasible for the server to try to reach out.
1
u/Temporary_Pie2733 Jun 03 '26
Push and pull are distinguished by who initiates the transfer. On a push, the sender starts the transfer and the receiver accepts incoming messages. On a pull, the sender waits until the receiver asks for a message.
1
u/kevinossia Jun 05 '26
If the server initiates the connection it’s not a server. It’s a client. Just FYI.
1
u/strange-the-quark Jun 08 '26
If I'm a server and I decide that you need to receive a message, and send it to you, that's a "push".
If instead of actively pushing, I just sit there, and you're constantly like:
then that's a pull-based protocol.