Introduction of the URL

You can’t mention urls without mentioning Tim Berners-Lee, the inventor of the World Wide Web, He invented the World Wide Web(WWW), which consists of Uniform Resource Locator(URL)+HyperText Transfer Protocol(HTTP)+Hyper Text Markup Language(HTML) consists of three parts. In the World Wide Web(WWW), Uniform Resource Locator(URL) is a Uniform Resource Locator, which refers to a network address.

The composition of the URL

URL format

The standard format of a UNIFIED resource locator is as follows: Protocol type :// Server address: port number/Resource level UNIX file path File name? Query string # anchor point

The full format of a UNIFIED resource locator is as follows: Protocol type :// Credentials required to access resources @ Server address: port number/Resource level UNIX file path File name? URL= Protocol + domain name or IP+ port number + path + query string + anchor

Random page https://zh.wikipedia.org:80/w/index.php?title=Special: as an example# anchor
Copy the code
  • Protocol:https://
  • Domain name:zh.wikipedia.org
  • Port:80
  • Path:/w/index.php
  • Query parameters:? Title =Special: random page
  • Anchor:# anchor

The URL key

agreement

  • Represents the web page used byHTTPThe agreement. inInternetCan use a variety of protocols, such asHTTP.FTPAnd so on. inHTTPThe following “//” is the delimiter

IP

  • IPWhat’s the address?
  • IPAddress (English:IP AddressThe full name:Internet Protocol AddressInternet Protocol address Internet Protocol address When the device is connected to the network, the device is assigned an IP address for identification. With IP addresses, devices can communicate with each other. Without IP addresses, we have no way of knowing which device is the sender and which is the receiver.
  • The IP addressDivided intoIntranetandThe network
    • The networkThe IP addressGet: As long as the router is connected to telecom’s server, the router will have oneIP networks outsideThis is your address on the Internet. But if you reboot the router, then you havemayWas reassigned an “extranet IP”, which means the router does not have oneFixed external IP address
    • IntranetThe IP addressGet: The router creates an Intranet in your home, and devices within the Intranet use the IntranetIPThe format for the IP address is 192.168.xx.xxxo.
    • IntranetandThe networkThe difference between:Network IPIt’s fixed, mobile wireless and computer wired IP addresses are different, andIntranetandThe networkIsolated from each other, they are connected to each other through routers, in the life of people in the home computer mobile phone (Intranet) need to go throughCat (Modem)To convert the signal of the line into a signal that the computer can understand and passThe routerThe IP address of the extranet is used to transmit network information.
    • Special IP
    127.0.0.1 indicates that you are 127.0.0.1/XXX. The file content can be directly accessed on the web page. Localhost You can specify your localhost/XXX through hosts. Files can be directly accessed from web pages. You can modify IP addresses through hosts. A customized IP address is 0.0.0.0, not 0.0.0.0, for any deviceCopy the code

The router

  • The routerfunction
    • A router has two IP addresses, an external IP address and an internal IP address
    • Devices on the Intranet can access each other, but cannot directly access the Internet
    • If an Intranet device wants to access the Internet, it must go through a router
    • Devices on the extranet can access each other, but not your internal network
    • If an extranet device wants to send content to the Intranet, it must also go through a router
    • That is to say, the Intranet and the extranet are like two isolated Spaces, unable to communicate with each other, and the only connection is the router
    • So routers are sometimes called gateways.

The domain name

  • A domain name is an alternate name for an IP address, which is used to identify the computer’s electronic location (different locations across the country) as data is transmitted.
  • The domain name system has layers
    • The first level is the top-level domain, which includes the generic top-level domain, for example.comand.netand.orgAnd the country and region top-level domains, for example.usand.cnand.tk.
    • A second-level domain is a domain under a top-level domain name in the Internet DNS hierarchy. Example:www.xiedaimala.com
    • www.xiedaimala.comIs a three-level domain, commonly known as the second level domain name
    • Secondary domains and tertiary domains are parent-child relationships
  • usepingThe command
    • inCmderThe use ofpingCommand to query the domain nameIP
    • Can also be used inip138.comIn the query

IPandThe domain nameRelationships (NDS)

  • IPandThe domain nameIs through theDNScorrespondNDSAs a distributed database that maps domain names and IP addresses to each other, it makes it easier for people to access the Internet.
  • Processes, such asbaidun.com
    • The browser will ask the DNS eyetracker provided by Telecom or Unicombaidun.comWhat the correspondingIP
    • Telecom yan tong will answer oneIP
    • Then the browser will want to correspondIPthe80/443Port send request
    • The request is to viewbaidun.comThe front page of
  • Note:
    • The service is used80Port to providehttpservice
    • The service is used443Port to providehttpsservice
  • nslookupThe queryDNS
    • nslookupCommands are used to queryNDSTo check whether domain name resolution is normal and diagnose network problems when network faults occur
# nslookup + domain name nslookup domain [dns-server] ``` ``` nslookup xmasuhai.xyz ' 'Copy the code

portport

  • A computer provides different services, each linked to a port
  • A computer has a total of 65535 ports
    • The HTTP service uses port 80
    • 443 is best used for HTTPS services
    • Port 21 is recommended for the FTP service
    • Wikipedia query port list of services corresponding to the port
  • Port rules: Ports 0 to 1023 are reserved for use by the system. You can use these ports only after you have administrator rights. Other ports can be used by common users.
  • IPandportOne is indispensable, and the problem must lie in between.

The path

  • /w/index.phpThe path of a resource on a network server. The path indicates which web page to visit

Query string

  • ? Title =Special: random pageRepresents the page display content, section, chapter, page, or query keywords, through# anchorQuery the word you want to look up.
  • Important note
    • An anchor represents a “bookmark” in a resource that gives the browser the direction of the content at that “bookmarked” location.
    • On the HTML document, the browser will scroll to the bit that defines the anchor point on the video or audio document, and the browser will try to go to the time represented by the anchor
    • The fragment is never sent to the server, the anchor is eaten by the browser, the anchor is only relevant to the browser, there is no need to send it to the server

URL page request

  • How do I request different pages

    • With path
    https://developer.mozilla.org/zh-CN/docs/Web/HTML
    https://developer.mozilla.org/zh-CN/docs/Web/CSS
    Copy the code
    • tool
      • Use the Chrome Developer Tools Network panel to see the difference
  • Same page, different content

    • Use query parameters
    https://xxx.com/s?wd=hello
    https://www.baidu.com/s?wd=hi
    https://www.baidu.com/s?wd=hello
    Copy the code
  • Same content (page), different location

    • With the anchor
    https://developer.mozilla.org/zh-CN/docs/Web/CSS# reference books
    https://developer.mozilla.org/zh-CN/docs/Web/CSS# tutorial
    Copy the code
    • An anchor is a location within a document
  • Note:

    • The anchor appears to have Chinese, but does not support Chinese
    • #The reference books will become#%E5%8F%82%E8%80%83%E4%B9%A6
    • The anchor point is not transmitted to the server, so it is not availableNetworkI saw it on the panel

This article refers to the internal curriculum of Hungry Man Valley