An introduction to the learning notes of the "Illustrated HTTP"

Source: Internet
Author: User
Tags ack file transfer protocol

Before you learn HTTP, it's important to understand the basics of Web networking.

TCP/IP protocol family

1. Application Layer : The application layer determines the communication activities when the application service is provided to the user, such as FTP (File Transfer Protocol), DNS (domain Name System), HTTP (Hypertext Transfer Protocol)

The application layer is like a destination

2, Transport layer : The transport layer to the upper layer of the application layer to provide processing network connection between the two computers data transmission, there are two protocol TCP (Transmission Control Protocol), UDP (User Data Protocol)

The transport layer is like the rules on the road.

In the TCP protocol, a three-time handshake is required to establish a reliable connection.

First handshake: When a connection is established, the client sends a SYN packet (SYN=J) to the server and enters the Syn_send state, waiting for the server to confirm;
Second handshake: The server receives the SYN packet, it must confirm the customer's SYN (ACK=J+1), and also send itself a SYN packet (syn=k), that is, the Syn+ack packet, when the server enters the SYN_RECV state;
Third handshake: The client receives the server's Syn+ack packet, sends the acknowledgment packet ack (ACK=K+1) to the server, the packet is sent, the client and the server enter the established state, and the handshake is completed three times.

The difference between UDP and TCP

The most essential difference is that TCP is connection-oriented, and UDP is non-connection-oriented.

What do you mean, connection-oriented? In advance for the data sent to open up a connected channel, and then send data, like a phone call, only two people, the third person to play the busy display

Non-oriented connection: refers to the communication between the two parties do not need to establish a communication line, but each with the destination address of the packet (packet) sent to the line, by the system to select the route for transmission, like a letter, no matter how busy the other party, put the letter to the mailbox, on their own no relationship.

TCP supports services such as FTP, SMTP, and so on, while UDP supports DNS, SNMP, QQ, etc.

3. Network layer : The network layer is used to process packets flowing on the network. Include the IP protocol.

The network layer is like a car on the road, which specifies the route of the data transmission.

The IP address indicates that the node is assigned the address, MAC address refers to the network card all the inherent address, the popular understanding of IP address like the end of the courier address, and MAC address is like the courier to the end of the address between the intermittent address.

4, Link layer : Some hardware parts, including drivers, network cards and optical fiber, etc.

The link layer is like a road.

Responsibilities of each agreement

DNS is for domain name resolution.

HTTP is intended to generate HTTP request messages (information that interacts with HTTP) against the target Web server, and to determine which message

TCP is to facilitate communication, the HTTP request message is cut into a message segment, each message segment is reliably passed to each other, and in order to reorganize the received message segment.

IP is to search the other side of the address, while the relay side transfer.

HTTP method that informs the server of intent

Get: Get Resources

POST: Transport Entity Topic

PUT: Transferring files

HEAD: Get message header

Delete: Deleting files

Options: Ask a supported method

Trace: Trace Path

CONNECT: Require a tunneling protocol to link an agent

For a detailed example, refer to http://www.cnblogs.com/six-moon/p/5151562.html

Durable connections Save traffic, and persistent connections are connected as long as either party does not make a disconnect. Persistent connections make it possible for most requests to be routed in a pipelined manner, which is to wait and receive a response from the sending request before the next request can be sent.

HTTP is a stateless protocol that requires cookies for state management, such as your own login status, which allows you to control your client state using cookies.

HTTP encoding

Sometimes when we use Baidu cloud download file, the link is sometimes encoded is sometimes not encoded, encoding can improve the transmission rate.

HTTP Common Status Codes

HTTP Communication Data Forwarding program

Proxy: Receives a request sent by the client and forwards it to the server

Gateways: Secure Communications

Tunneling: Securing client and Server communications

Secure HTTPS

HTTP disadvantage: Communication unencrypted content will be tapped

Not verifying the identity of the communicating party, encountering a disguise

Cannot prove registration integrity, may be tampered with

So the introduction of HTTPS

http+ Encryption + authentication + integrity Protection =https

encryption: used in combination with SSL (Secure Sockets Layer) or TLS (Secure transport Protocol) to encrypt the communication content of HTTP

HTTPS is encrypted using a hybrid encryption mechanism, shared secret key + public secret key

Certification:

HTTP feature-based append protocol

What is the bottleneck of http: The updated content can only be displayed on the client

Workaround: Ajax and Spyd

But Spyd also can't really eliminate bottlenecks, because some of the computer's hardware problems exist, such as NIC and CPU

A complete solution to the problem isWebSocket, the full-duplex communication standard between the Web browser and the Web server.

The advantage is that the data is sent directly, without waiting for the client to request, keep the connection state, and the first information is less, the traffic is reduced.

Use cookies to manage session

The client places login information such as IE and password into the entity part of the message and sends it to the server by post.

The server authenticates, generates SessionID, joins the Set-cookie, and returns to the client.

After the client receives the SessionID, it adds the cookie, and the browser automatically sends the cookie the next time the request is received.


Specific content you can see the "graphic http" This book, speak really good.

An introduction to the learning notes of the "Illustrated HTTP"

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.