search
HomeWeb Front-endHTML TutorialKnowledge about http, https, http/2

Knowledge about http, https, http/2

Sep 23, 2017 am 09:34 AM
httphttpsKnowledge

Before learning http, https, http/2, first sort out the OSI network model, TCP/IP protocol, TCP and UDP and other contents.

1. A brief review of the OSI seven-layer network model

OSI is an open communication system interconnection reference model and a protocol specification proposed by the International Organization for Standardization. The model from top to bottom is:

  • Application layer (OSI application layer protocols include File Transfer, Access and Management Protocol (FTAM), as well as File Virtual Terminal Protocol (VIP) and Public Management System Information (CMIP))

  • Presentation layer (the presentation layer provides multiple functions for encoding and converting application layer data to ensure that information sent by one system application layer can be used by another A system application layer identification)

  • Session layer (the session layer establishes, manages and terminates communication sessions between the presentation layer and entities)

  • Transport layer (the transport layer provides reliable end-to-end network data flow services to higher layers)

  • Network layer (the network layer is responsible for establishing connections between sources and destinations)

  • Data link layer (data link layer provides data transmission through physical network links. Different data link layers define different network and protocol characteristics, including physical addressing, network topology, Error checking, data frame sequence and flow control)

  • Physical layer (the physical layer is responsible for finally encoding the information into current pulses or other signals for network transmission)

2. TCP/IP protocol

The TCP/IP protocol integrates multiple protocols such as TCP and IP to handle the transmission between the computer and the network. It refers to and integrates the OSI network model. The common TCP/IP protocol is divided into four layers, from top to bottom:

  • Application layer (the application layer corresponds to the application layer and presentation layer of the OSI seven-layer reference model)

  • Transport layer (the transport layer corresponds to the transport layer of the OSI seven-layer reference model, which provides two end-to-end communication services)

  • Network Intermediate layer (this layer includes IP protocol, RIP protocol (Routing Information Protocol, Routing Information Protocol), and is responsible for data packaging, addressing and routing. It also includes the Internet Control Message Protocol (ICMP) for Provide network diagnostic information)

  • Network interface layer (The network interface layer includes protocols for coordinating the transmission of IP data over existing network media)

3. TCP and UDP

TCP (Transmission Control Protocol, Transmission Control Protocol)
is a connection-oriented, reliable, byte stream-based transport layer communication protocol. UDP (User Datagram Protocol) is a simple datagram-oriented transport layer protocol. They are responsible for the processing of the transport layer in the OSI network model.

A simple comparison between TCP and UDP:

TCP UDP
Connection-oriented (three-way handshake, four-way wave) No connection
Uses more resources Reduced resource usage
Ensure data order No data order
Slower transmission speed Transmission Fast speed
Ensure data correctness Easily lose packets
Stream mode Message mode

4. HTTP

http (Hypertext Transfer Protocol) is a protocol commonly used at the application layer. It is based on text transmission content.

Eight request methods

get, post, head, put, delete, trace, options, connect.

http request information structure

  • Request line

  • Request header

  • Blank line

  • Other messages

Status code

  • 1xx Message - The request has been processed by the server Receive, continue processing

  • 2xx Success - the request has been successfully received, understood, and accepted by the server

  • 3xx Redirect - follow-up required operation to complete this request

  • 4xx Request error - the request contains a lexical error or cannot be executed

  • 5xx Server error - the server is in An error occurred while processing a correct request

Common status codes 200 (request successful), 302 (redirected to some url), 304 (read cache), 404 (not found) file or directory), 405 (the method specified in the request is wrong), 500 (server error), 502 (server invalid response)

5. HTTPS

https can be called the http secure version, mainly SSL (Secure Socket Layer) or TSL (Transport Layer Security) is added under http, and SSL or TSL encrypts the data at the transport layer.

Features of https:

  • 1. Ensure the security of transmitted information (encrypted)

  • 2. Need to apply for a certificate

  • 3. Can prevent operator hijacking

  • 4. Due to the added security layer, the access speed is slowed down

  • 5. HTTP websites can access https links, but https websites cannot access http links (except for some browsers that support mixed-content)

6. SPDY

Spdy is Google's open network transmission protocol. It is located between the http and ssl layers and can speed up access.

Features of spdy:

  • 1. Can reduce latency

  • 2. Can set request priority

  • 3. Header compression

  • 4. Ensure transmission security based on https

  • 5. Support server push

7. HTTP/2

http/2 (Hypertext Transfer Protocol Second Edition), he made some upgrades to http, and also referred to spdy-related content (Can be called an evolved version of spdy).

Features of http/2:

  • New binary format

  • Multiplexing

  • Header compression

  • Support server push

The difference between http/2 and spdy:

  • http/2 supports http transmission, spdy only supports https

  • The header compression algorithms of http/2 and spdy are different

Reference article

The difference between TCP and UDP
Some things you should know about HTTP, HTTP2.0, SPDY, HTTPS
In-depth explanation - Seven-layer network model &&network data packet

The above is the detailed content of Knowledge about http, https, http/2. For more information, please follow other related articles on the PHP Chinese website!

Statement
The content of this article is voluntarily contributed by netizens, and the copyright belongs to the original author. This site does not assume corresponding legal responsibility. If you find any content suspected of plagiarism or infringement, please contact admin@php.cn
What are boolean attributes in HTML? Give some examples.What are boolean attributes in HTML? Give some examples.Apr 25, 2025 am 12:01 AM

Boolean attributes are special attributes in HTML that are activated without a value. 1. The Boolean attribute controls the behavior of the element by whether it exists or not, such as disabled disable the input box. 2.Their working principle is to change element behavior according to the existence of attributes when the browser parses. 3. The basic usage is to directly add attributes, and the advanced usage can be dynamically controlled through JavaScript. 4. Common mistakes are mistakenly thinking that values ​​need to be set, and the correct writing method should be concise. 5. The best practice is to keep the code concise and use Boolean properties reasonably to optimize web page performance and user experience.

How can you validate your HTML code?How can you validate your HTML code?Apr 24, 2025 am 12:04 AM

HTML code can be cleaner with online validators, integrated tools and automated processes. 1) Use W3CMarkupValidationService to verify HTML code online. 2) Install and configure HTMLHint extension in VisualStudioCode for real-time verification. 3) Use HTMLTidy to automatically verify and clean HTML files in the construction process.

HTML vs. CSS and JavaScript: Comparing Web TechnologiesHTML vs. CSS and JavaScript: Comparing Web TechnologiesApr 23, 2025 am 12:05 AM

HTML, CSS and JavaScript are the core technologies for building modern web pages: 1. HTML defines the web page structure, 2. CSS is responsible for the appearance of the web page, 3. JavaScript provides web page dynamics and interactivity, and they work together to create a website with a good user experience.

HTML as a Markup Language: Its Function and PurposeHTML as a Markup Language: Its Function and PurposeApr 22, 2025 am 12:02 AM

The function of HTML is to define the structure and content of a web page, and its purpose is to provide a standardized way to display information. 1) HTML organizes various parts of the web page through tags and attributes, such as titles and paragraphs. 2) It supports the separation of content and performance and improves maintenance efficiency. 3) HTML is extensible, allowing custom tags to enhance SEO.

The Future of HTML, CSS, and JavaScript: Web Development TrendsThe Future of HTML, CSS, and JavaScript: Web Development TrendsApr 19, 2025 am 12:02 AM

The future trends of HTML are semantics and web components, the future trends of CSS are CSS-in-JS and CSSHoudini, and the future trends of JavaScript are WebAssembly and Serverless. 1. HTML semantics improve accessibility and SEO effects, and Web components improve development efficiency, but attention should be paid to browser compatibility. 2. CSS-in-JS enhances style management flexibility but may increase file size. CSSHoudini allows direct operation of CSS rendering. 3.WebAssembly optimizes browser application performance but has a steep learning curve, and Serverless simplifies development but requires optimization of cold start problems.

HTML: The Structure, CSS: The Style, JavaScript: The BehaviorHTML: The Structure, CSS: The Style, JavaScript: The BehaviorApr 18, 2025 am 12:09 AM

The roles of HTML, CSS and JavaScript in web development are: 1. HTML defines the web page structure, 2. CSS controls the web page style, and 3. JavaScript adds dynamic behavior. Together, they build the framework, aesthetics and interactivity of modern websites.

The Future of HTML: Evolution and Trends in Web DesignThe Future of HTML: Evolution and Trends in Web DesignApr 17, 2025 am 12:12 AM

The future of HTML is full of infinite possibilities. 1) New features and standards will include more semantic tags and the popularity of WebComponents. 2) The web design trend will continue to develop towards responsive and accessible design. 3) Performance optimization will improve the user experience through responsive image loading and lazy loading technologies.

HTML vs. CSS vs. JavaScript: A Comparative OverviewHTML vs. CSS vs. JavaScript: A Comparative OverviewApr 16, 2025 am 12:04 AM

The roles of HTML, CSS and JavaScript in web development are: HTML is responsible for content structure, CSS is responsible for style, and JavaScript is responsible for dynamic behavior. 1. HTML defines the web page structure and content through tags to ensure semantics. 2. CSS controls the web page style through selectors and attributes to make it beautiful and easy to read. 3. JavaScript controls web page behavior through scripts to achieve dynamic and interactive functions.

See all articles

Hot AI Tools

Undresser.AI Undress

Undresser.AI Undress

AI-powered app for creating realistic nude photos

AI Clothes Remover

AI Clothes Remover

Online AI tool for removing clothes from photos.

Undress AI Tool

Undress AI Tool

Undress images for free

Clothoff.io

Clothoff.io

AI clothes remover

Video Face Swap

Video Face Swap

Swap faces in any video effortlessly with our completely free AI face swap tool!

Hot Tools

SecLists

SecLists

SecLists is the ultimate security tester's companion. It is a collection of various types of lists that are frequently used during security assessments, all in one place. SecLists helps make security testing more efficient and productive by conveniently providing all the lists a security tester might need. List types include usernames, passwords, URLs, fuzzing payloads, sensitive data patterns, web shells, and more. The tester can simply pull this repository onto a new test machine and he will have access to every type of list he needs.

PhpStorm Mac version

PhpStorm Mac version

The latest (2018.2.1) professional PHP integrated development tool

SublimeText3 Chinese version

SublimeText3 Chinese version

Chinese version, very easy to use

MantisBT

MantisBT

Mantis is an easy-to-deploy web-based defect tracking tool designed to aid in product defect tracking. It requires PHP, MySQL and a web server. Check out our demo and hosting services.

Atom editor mac version download

Atom editor mac version download

The most popular open source editor