socket is a common low-level network communication protocol, on this basis, there are many other network communication protocols for the implementation of client-server network interconnection, the following are a brief introduction to these protocols.
1. File Transfer
FTP: File Transfer Protocol. can upload or download files, using the concept of UNIX multi-user, users must enter a valid user name and password to use, but also support anonymous login. In the underlying implementation, FTP uses only TCP instead of UDP, active mode using two sockets, respectively, control command port and data port, passive mode using a socket, for the control command interface. The client workflow is: Connect-Login-Transfer-end. Python-related modules are ftplib, and you need to instantiate a ftplib when used. The FTP class object. Typical FTP clients are: command-line client programs, GUI client programs, Web browsers, and programs developed by themselves.
HTTP: Hypertext Transfer Protocol for Web pages. HTTP is mainly used for Web page file download and access to Web services, it generally does not require the user to enter a login password to access the server files and services.
SCP/rsync: Requires the user to log on to the server, or the file cannot be uploaded or downloaded.
rcp: Remote file replication protocol.
UUCP: Replication protocol.
2, Network news
Usenet The news system is a global archive of electronic bulletin boards, various topics of news, the entire system is a large number of computers composed of a large global network, Computers share posts on Usenet, and each system has a list of newsgroups it has subscribed to, which only receives posts from newsgroups that it is interested in.
NNTP : Network News Transfer Protocol. For users to download or post in newsgroups, use only one standard port, 119 , to communicate. Similar to the Ftp,python related module is nntplib, instantiated nntplib when used. The NNTP class object.
3. e-mail
e-mail system has many components, the most important component is the message transfer agent MTA, which is a server program running on the Mail exchange host, which is responsible for the routing, queuing, and sending of messages, which is the springboard from the source host to the destination host.
SMTP: Simple Mail Transfer Protocol. The most common MTS used for message exchange between the MTA on the Internet, which is used by the MTA to transfer e-mail from one host to another, must be connected to an external SMTP server when e-mail is sent, and the sending mail program is an SMTP client. The SMTP server has thus become the first springboard for the message. Python-related modules are smtpliband instantiated smtplib when used. The SMTP class object. When communicating, just one port .
In addition to SMTP, there are open-source MTA such as SendMail, Postfix, and commercial MTA such as Microsoft Exchange.
Mail user agent MUA The message from the server, the first protocol used to download the message is called the Post Office Protocol POP, which is intended to allow the user's workstation to access the Mail on the mailbox server, which can be sent from the workstation via SMTP to the mail server. The Python module associated with pop is poplib, which instantiates poplib when used. The POP3 class object. Several years later, there was another protocol, the interactive Mail Access Protocol IMAP, which is more complex than pop.
Python Network protocol