Benefits of the B/s architecture:
- The client uses a unified browser (browser). Because of the unity of the browser, it does not require special configuration and network connection, effectively shielding the different service providers to provide users with the difference of service. Another point is that the browser's interactive features make users very easy to use, as long as the use of Internet experience, you can quickly master the use of methods.
- Service-side (server) is based on a unified HTTP protocol. and the traditional C/s architecture using a custom application protocol, b/s architecture uses a unified HTTP protocol, so that developers are using a more standardized development model, which can greatly reduce development costs. In addition, due to the use of a unified protocol, the number of servers can be used, direct use without development such as: Tomcat, Nginx, JBoss and so on.
b/S Network Architecture Overview:
Many actions occur when we enter the URL that needs to be accessed in the browser. First it will request DNS to resolve the domain name to the corresponding IP address, and then according to the IP address on the Internet to find the corresponding server, to the server to send a GET request, the server decided to return the default data resources to the user access.
On the server side, according to the server's business processing logic to determine the processing of the request: The server may have many units, exactly specify which one to handle, which requires a load-balanced device to handle the distribution of the user's request, and whether we need the data resources in the distributed cache or in a static file, or a database When the data is returned to the browser, the browser sends the request again when it processes the data, which is likely to be on the CDN and whether the CDN server will process the user's request, and each of these details will determine whether the request will eventually succeed.
The HTTP protocol adheres to the following principles:
- All resources on the Internet are represented by a URL. URL is a Uniform Resource locator, if you want to publish a service or resources to the Internet, so that others can access, then first you must have a unique URL.
- You must interact with the server based on the HTTP protocol.
- The data presentation must be done in the browser.
DNS Domain name resolution:
1. The browser checks if there is a resolved IP address in the cache that corresponds to the domain name, and if so, the parsing process will end.
2. If the user does not have a browser cache, the browser will look for the DNS resolution results for this domain name in the operating system cache. In fact, the operating system will also have a domain name resolution process in Windows can be set through the C:\Windows\System32\drivers\etc\hosts file, you will be able to resolve any domain name to any access to the IP address.
3. In our network configuration there will be a "DNS server address" column, the operating system will send this domain name to the Ldns set here, that is, the domain name server in the region, that is, local network operators (telecommunications or unicom), is often said that the spa, their server performance is better, Domain name resolution results are generally cached.
4. If the Ldns still does not hit, request resolution directly to the root server domain name server.
5. The primary Domain name server address (GTLD server) that is returned to the local domain name server by the domain name server.
6. The local domain name server then goes up one step back to the gTLD server to send the request.
7. The requested GTLD server finds and returns the name server address for this domain name, which is usually the name server you are registering.
The 8.Name server domain name server queries the stored domain name and the IP Mapping relationship table.
9. Return the IP and TTL values for the domain name, and the Local DNS server caches the domain name and IP correspondence.
10. Return the parsed result to the user, cached in the local system cache based on the TTL value, and the domain name parsing process is complete.
Chapter One deep Web request process