Javascript is required
Home / Information /IP address, URL, and website address combined

IP address, URL, and website address combined

Read volume:1730
Release time:-

Today, let's talk about the combination of IP address, URL, and website address to perform IP address query work:

1. How does IP address work in network communication?

2. What is the difference between website address and URL?

3. The composition structure of URL is related.

How does IP address work in network communication?

How does IP address work in the network? First, suppose host A wants to access a server located far away (host B). Host A first performs a logical AND operation on the IP address of the target server and its own subnet mask to determine whether the target server is in the same subnet as itself. Now there will be the following two situations:

①If the conclusion is that they are in the same subnet, host A will directly look up the MAC address of host B in the local network and send data to host B through the MAC address;

②If they are not in the same subnet, host A will send the data to its default gateway (usually a router), and the router will forward the data to the target network according to the routing table, and finally deliver it to host B.

This is the simplest workflow.

What is the difference between website address and URL?

URL is the address to access a web page. Common domain names and IP addresses (domain names like "google.com" are more common), which are convenient for users to remember and use. URL (Uniform Resource Locator) is more precise, including protocol, domain name or IP address, port number, path, query parameters and anchor points, which are used to accurately locate resources on the Internet. It can not only point to web pages, but also point to specific resources within web pages or specify server communication methods, etc. The two have different focuses (in fact, they are subpages in every large website).

URL composition structure related

A complete URL usually consists of the following parts:

Protocol part: such as http:// or https://, which specifies the protocol used for communication between the client and the server. http is the hypertext transfer protocol, which is used to transmit ordinary web page content; while https is a secure hypertext transfer protocol based on SSL/TLS encryption, which is often used for web pages involving sensitive information (such as login, payment, etc.) to ensure the security of data transmission.

Domain name or IP address part: This part determines the server location where the resource is located, such as www.google.com or 220.181.38.148.

Port number part (optional): By default, the http protocol uses port 80 and the https protocol uses port 443. However, in some cases, the server may use other port numbers to provide specific services. In this case, the port number needs to be explicitly specified in the URL, such as http://www.example.com:8080, where 8080 is the port number.

Path part: used to specify the specific location of the resource on the server, for example, /index.html represents the index.html file in the root directory of the server. If a dynamic web page or a specific resource path is accessed, the path part will be more complicated, such as /blog/article?id=123.

Query parameter part (optional): used to pass additional information to the server, usually in the form of key-value pairs, with multiple parameters separated by &. For example, in http://www.example.com/search?q=keyword&page=2, q=keyword and page=2 are query parameters, indicating that the search keyword is keyword and the search results of the second page are displayed respectively.

Anchor part (optional): used to locate a specific position within the page. For example, #section2 means jumping to the element position with the id section2 in the page.