Http/socket. etc protocols implements in C #

Source: Internet
Author: User
Tags file transfer protocol

HTTP vs TCP/IP

the TCP (transmission Control Protocol) and UDP (User Datagram Protocol) protocols belong toTransport Layeragreement. Where TCP provides data in an IP environmentReliable transmission, it provides services that includeData flowtransmission, reliability, effective flow control, full-duplex operation, and multiplexing. Through connection-oriented, end-to-end, and reliableData packagesent. Popularly said, it is to send the data in advance to create a connected channel, and then send data, and UDP does not provide the IP reliability, flow control or error recovery function. In general, TCP corresponds to the application of high reliability requirements, and UDP corresponding to the requirements of low reliability, transmission economy applications. TCP-supported application protocols are: Telnet, FTP, SMTP, etc., supported by UDP .Application LayerThe main protocols are: NFS (Network File system), SNMP (Simple Network Management Protocol), DNS (primary Domain Name System), TFTP (CommonFile Transfer Protocol) and so on .


TPC/IP protocol is a Transport layer protocol, which mainly solves how data is transmitted in the network, and HTTP is the application layer protocol, which mainly solves how to wrap the data. Regarding the relationship between TCP/IP and HTTP protocol, the network has a relatively easy to understand: "When we transmit data, we can only use the (Transport Layer) TCP/IP protocol, but in that case, if there is no application layer, it will not be able to identify the data content, if you want to make the transmitted data meaningful, You must use the Application layer protocol, there are many application layer protocols, such as HTTP, FTP, Telnet, etc., you can also define the application layer protocol. The web uses the HTTP protocol as an application-layer protocol to encapsulate HTTP text information and then send it to the network using TCP/IP as the Transport layer protocol. ”
HTTP vs Socket
HTTP: Hypertext Transfer Protocol, first it is a protocol, and is based on the TCP/IP protocol on the basis of the application layer protocol. TCP/IP protocol is the Transport Layer protocol, which mainly solves how data is transmitted in the network, and HTTP is the application layer protocol, which mainly solves how to wrap the data. The HTTP protocol details the rules for communication between the browser and the server, and is the basis for the World Wide Web exchange of information. HTTP is based on the request-response form and is a short connection, and is a stateless protocol. For its stateless characteristics, in the actual application needs to have the form of the state, so generally through the Session/cookie technology to solve this problem.

Socket:socket is not a protocol category, but a calling interface (API), socket is the encapsulation of the TCP/IP protocol, by calling the socket, the TCP/IP protocol can be used. The socket connection is a long connection, in theory the client and server side will not actively disconnect this connection once the connection is established. The socket connection is a request-response form, and the server can proactively push messages to the client.






Http/socket. etc protocols implements in C #

Contact Us

The content source of this page is from Internet, which doesn't represent Alibaba Cloud's opinion; products and services mentioned on that page don't have any relationship with Alibaba Cloud. If the content of the page makes you feel confusing, please write us an email, we will handle the problem within 5 days after receiving your email.

If you find any instances of plagiarism from the community, please send an email to: info-contact@alibabacloud.com and provide relevant evidence. A staff member will contact you within 5 working days.

A Free Trial That Lets You Build Big!

Start building with 50+ products and up to 12 months usage for Elastic Compute Service

  • Sales Support

    1 on 1 presale consultation

  • After-Sales Support

    24/7 Technical Support 6 Free Tickets per Quarter Faster Response

  • Alibaba Cloud offers highly flexible support services tailored to meet your exact needs.