TCP/IP, HTTP, socket, persistent connection, short connection -- Summary.

Source: Internet
Author: User

Thomescai http://blog.csdn.net/thomescai (reprinted please keep)

Summary:

I was a little confused about these concepts. I checked some materials and summarized their differences. If any error occurs, take a picture ~~~

First look at the figure:


What is TCP/IP?

TCP/IP is a protocol group, which can be divided into three layers: network layer, transport layer and application layer.
The IP protocol, ICMP protocol, ARP protocol, RARP protocol, and BOOTP protocol are available at the network layer.
There are TCP and UDP protocols in the transport layer.
The application layer includes FTP, HTTP, telnet, SMTP, DNS, and other protocols.

What is socket?

Socket is an intermediate software abstraction layer for communications between the application layer and TCP/IP protocol families. It is a set of interfaces that hide complex TCP/IP protocol families behind the socket interface.

So HTTP isTCP/IP application layer protocol.Socket is their software abstraction layer.

Transient connection:
Connection> data transmission> close connection
HTTP is stateless. the browser and server establish a connection every time they perform an HTTP operation, but the connection is interrupted when the task ends.
It can also be said that a short connection means that the connection is closed immediately after the socket connection is sent and the data is received.
Persistent connection:
Connection> data transmission> keep connection> data transmission>... -> Close the connection.
Persistent connection means that the connection is established regardless of whether the connection is used or not, but the security is poor.
HTTP persistent connection:
HTTP can also establish persistent connections by using connection: keep-alive. HTTP 1.1 performs persistent connections by default. The biggest difference between http1.1 and http1.0 is that it supports persistent connections (appearance
Similar to the specified keep-alive that can be displayed in the latest http1.0), but it is still stateless, or Untrusted.





References:

Bytes

Bytes

Bytes

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.