[Notes] [HTTP] Chapter 1 of "Graphic HTTP" to understand the basics of Web and network

foreword

  • Where there is input, there must be output. This note is a summary of the knowledge involved in each chapter after I read "Graphic HTTP"
  • The blog will publish each chapter of the book as an article, and the next blog will be published at an uncertain time
  • Some of the notes in the notes have been sorted out after personal understanding, and there may be deviations. Readers are also kindly requested to help point out, thank you.

disclaimer

  • This blog is my notes after studying "Graphic HTTP", which is intended to facilitate review and review, not for commercial purposes.
  • For the sake of convenience, some pictures on the blog are consistent with those in the book, so I didn’t take screenshots by myself, but quoted the picture addresses of other people’s blogs, and thanked these bloggers for their picture beds.
  • This note is used to record my summary of this knowledge. To facilitate future work and study.
  • The content is not complete with the original book, please read it in conjunction with the original book
  • If there is any infringement, please inform and delete it immediately.

Chapter 1 Understanding the Web and Networking Basics

1.1 Use the HTTP protocol to access the Web

1. Client

  • A web browser, etc. that fetches server resources by sending requests.

2. Agreement

  • refers to the agreement of the rules

    For computers and network devices to communicate with each other, both parties must be based on the same method. For example, rules such as how to detect communication targets, which side initiates communication first, which language to use for communication, and how to end communication all need to be determined in advance. Communication between different hardware, operating systems, all of this requires a rule. And we call this rule a protocol.

    • HTTP protocol:
      1. Hypertext Transfer Protocol
      2. The protocol specification used by the Web completes a series of operation processes from the client to the server. (That is, the Web is built on the HTTP protocol for communication)

1.2 The birth of HTTP

1. HTML1.0

  • Display images of HTML in the form of in-line (inline), etc.
  • This protocol standard is still widely used on the server side

2. HTTP protocol

  1. Mainly to solve the problem of text transmission

1.3 Network Basics TCP/IP

1. TCP/IP protocol family

  • [Protocol](#2.Protocol:) contains a variety of contents ranging from cable specifications to the selection method of IP address, the method of finding remote users, the sequence of establishing communication between the two parties, and the steps that need to be processed on the Web page display ,etc.

    • A collection of protocols related to the Internet like this is collectively referred to as TCP/IP.

2. Hierarchical management of TCP/IP

  • The TCP/IP protocol family is divided into the following four layers according to the level: application layer, transport layer, network layer and data link layer.

    • Benefits of layering:

      layering not used use layering
      If the Internet is governed by only one protocol, when the design needs to be changed somewhere, all parts must be replaced as a whole. Just replace the changed layer.
      • After the interface between the layers is planned, the internal design of each layer can be changed freely.
    • Application layer : determines the communication activities when providing application services to users .

      • TCP/IP 协议族Various common application services are pre-stored in it.
        • FTP: File Transfer Protocol
        • DNS: Domain Name System
      • The HTTP protocol is also at this layer.
    • Transport layer : For the upper application layer, it provides data transmission between two computers in a network connection

      • follow the agreement
        • TCP: Transmission Control Protocol
        • UDP: User Datagram Protocol (User Data Protocol)
    • Network layer (network link layer) : Used to process data packets flowing on the network .

      • Packet : the smallest data unit for network transmission
      • This layer specifies the path (the so-called transmission route) to reach the other party's computer, and transmit the data packet to the other party.
    • Link layer (data link layer | network interface layer) : used to deal with the hardware part of the link network


3. TCP/IP communication transport stream

  • The sender goes down from the application layer , and the receiver goes up .

    • Encapsulation : the practice of packaging data information
      • Encapsulation at the sending end : When data is transmitted between layers, every time a layer passes through, it must be marked with a header information to which the layer belongs .
      • Encapsulation at the receiving end : When data is transmitted between layers, the corresponding header will be erased every time it passes through a layer .

1.4 Protocols closely related to HTTP: IP, TCP and DNS

1. The IP protocol responsible for transmission

  • Located in: network layer

  • IP protocol !== IP address

    • IP protocol:
    • Function: Send various data packets to the other party.
    • Guaranteed to deliver success conditions
      1. IP address
      2. MAC address
    IP address MAC address
    Indicates the address to which the node is assigned Refers to the fixed address to which the network card belongs
    address changeable The address basically does not change.
    • IP address can be paired with MAC address

2. TCP protocol to ensure reliability

  • Located in: transport layer

  • Provide reliable byte stream service

    • **Byte Stream Service (Byte Stream Service)** means that, in order to facilitate transmission, large blocks of data are divided into data packets in units of segments (segments) for management.
  • In order to make it easier to transmit large data, the data is divided, and the TCP protocol can confirm whether the data is finally delivered to the other party .


How do you ensure data reaches its destination?

  • TCP three-way handshake strategy

    how many times to shake hands end Behavior the sign
    1 sender Send a data packet waiting for the SYN flag to the other party Send handshake request
    2 Receiving end After receiving it, return a data packet with the SYN/ACK flag Successful communication
    3 sender After receiving it, return a data packet with ACK flag end of handshake

    Notice】If there is an inexplicable interruption at a certain stage during the handshake process, the TCP protocol will send the same data packets in the same order again


3. DNS service responsible for domain name resolution

  • Located in: the protocol of the application layer

  • Provides resolution services between domain names and IP addresses.

    • The DNS protocol provides the service of looking up an IP address through a domain name, or reversely looking up a domain name from an IP address.

4. The relationship between various protocols and the HTTP protocol


1.7 URI sum URL

1. URI

  • Uniform Resource Identifier

    • Uniform: Unified format

    • Resource: resource

      • resources :
        • anything that can be identified
        • In addition to document files, images or services, etc. can be distinguished from other types.
        • Can be single or a collection of many
    • Identifier: identifier

  • Is the location identifier for a resource identified by a protocol scheme

    • Protocol scheme :
      • The name of the protocol type used to access the resource .
  • Identifies an Internet resource with a string .

  • Format:

    • Absolute URI

      field description express specification
      Protocol scheme name Get the protocol type to specify when accessing resources 1. Letters are not case sensitive.
      2. Attach at the end:
      Login Information (Authentication) Specify the user name and password as the necessary login information when obtaining resources from the server (authentication) optional
      server address The address of the server to be accessed must be specified when using the URI 1. Must be specified
      2. Can be a DNS resolvable address
      3. Can be an IPv4 address name
      4. Can be an IPv6 address name
      server port number Specifies the network port number connected to on the server Optional (default port will be used automatically if omitted)
      Hierarchical file paths Specify a file path on the server to locate a specific resource Similar to the directory structure of the UNIX system
      query string For resources within the specified file path, you can use query strings to pass in any parameters optional
      fragment identifier Marks a subresource within the fetched resource (somewhere within the document) optional
    • Relative URI

      • From the URL specified at the base URI in the browser

2. URL

  • Indicates the location (where it is located on the Internet) of the resource .
  • is a subset of URI.

Guess you like

Origin blog.csdn.net/weixin_45944495/article/details/130572864