当前位置:网站首页>[how to connect the network] Chapter 5 explore the server
[how to connect the network] Chapter 5 explore the server
2022-07-02 17:40:00 【Currybeefer】
1.Web Where the server is deployed
Web Servers can be deployed in the company , It can also be directly placed in the data center managed by the network operator , Or directly rent the server provided by the operator .
Put it in the company , The server can be accessed directly from the Internet . In this case , Network packet through the nearest POP Router in 、 After accessing the network and server-side router , Directly to the server . In the past, such server deployment methods were very common , But now it's not the mainstream way . There are several reasons . The first reason is IP Insufficient address . This approach needs to be for all devices in the company network , Including server and client computers , All assigned their own public addresses . However, now the public address is not enough , Therefore, it is unrealistic to adopt this method .
Put it in the data center directly with NOC Connect , Or the hub with operators , That is to say IX Direct connection . In this way, the access speed will be very fast , Besides , Data centers are generally located in buildings with seismic structures , It also has autonomous power generation equipment , And implement 24 Hourly access control , It can be said that it has higher security than putting it in the company . Besides , The data center not only provides a place for servers , It also provides various additional services , Such as server working state monitoring 、 Firewall configuration and operation 、 Illegal intrusion monitoring , From this point of view , Its security is also higher .
2. Structure and principle of firewall
The basic principle of firewall is to allow only packets sent to specific applications in specific servers to pass , Then shield other packages . To do this , The rules of packet filtering must be set correctly .


The firewall can set the rules of packet filtering according to the items listed in the above figure ,** The firewall of packet filtering can be based on the receiver IP Address 、 The sender IP Address 、 Slogan of receiver 、 Sender's slogan 、 Control bits and other information to determine whether a packet is allowed to pass .** Here's the picture

hypothesis Web The server will cause downtime when receiving a package with specific data . But the firewall only cares about the beginning and end of the package , So even if the package contains specific data , The firewall can't find , So the bag was released . then , When the bag arrives Web Server time , It will cause server downtime .
There are two ways to deal with this situation . The root of the problem lies in Web Of the server program Bug, So fix Bug Preventing downtime is one way .
Another way is to deploy devices or software outside the firewall to check the contents of packages and prevent harmful packages . Of course , Even this method is not perfect , Because whether the contents of the package are risky , By Web Does the server have Bug Decisive , So when there is potential in the server program Bug And has not yet been discovered , We can't judge the risks in the package , Can't stop such a package .
4. How to balance the load of the server
When the number of visits to the server goes up , It is effective to increase the bandwidth of the server line , But not all problems can be solved when the network becomes faster . High speed lines transmit a large number of network packets , This will cause the performance of the server to fall behind .
under these circumstances , Using multiple servers to share the load is more effective . This architecture is collectively referred to as distributed architecture , There are several ways to share the load , The simplest way is to use multiple Web The server , Reduce the number of visits per server . Suppose now we have 3 Servers , Then the traffic of each server will be reduced to one third , The load is reduced . Use this method , There must be a mechanism to allocate the requests sent by the client to each server . There are many specific methods , The simplest one is through DNS Server to assign . When accessing the server , The client needs to report to DNS The server queries the server IP Address , If in DNS Fill in multiple records with the same name in the server , Then every time you query DNS The server will return different IP Address . In this way, each server can be accessed equally .

besides , You can also use a load balancer to achieve load balanced access .. When using a load balancer , First use the load balancer IP Address substitution Web The actual address of the server is registered to DNS Server . Suppose there is a domain name www.lab.glasscom.com, We will match this domain name with IP The address is set to... Of the load balancer IP Address and register to DNS Server . therefore , The client will think of the load balancer as a Web The server , And send it a request , The load balancer then decides which one to forward the request to Web The server . The key points here are self-evident , That is how to determine which one to forward the request to Web The server .

5. Use the cache server to share the load
In addition to using multiple computers with the same function Web The server shares the load , There is another way , It is to divide the whole system into different servers according to functions , Such as Web The server 、 database server . The cache server is a way to share the load by function .
Cache server is a server that caches data through proxy mechanism . The agent is between Web Between server and client , Have right Web Server access for transfer . When transferring , It can be Web The data returned by the server is saved in the disk , And can replace Web The server returns the data in the disk to the client . This kind of saved data is called cache , Cache server refers to such functions .
Web The server needs to check the URL and access rights , And the internal operation process of filling data on the page , Therefore, it takes a long time to return the page data to the client . relatively , The cache server only needs to read the data saved on the disk and send it to the client , So you can compare Web Server returns data faster . Of course, the cache is temporary , Need to follow web Updated by .
The cache server is the same as the load balancer , Need to replace Web Server is registered to DNS Server . Then the client will send to the cache server HTTP The request message . At this time , The cache server will receive the request message , This receive operation and Web The servers are the same . Simply put, create a socket to wait for a connection , Perform connection operation when the client connects , Then receive the request message sent by the client . From the client side , The cache server is equivalent to Web The server . Next , The cache server will check the contents of the request message , See if the requested data has been saved in the cache . If kept , Then return directly , Otherwise, the cache server will send to the target as the client Web Server sends request message . in other words , It will first create a socket , Then connect to Web Socket for server , And send a request message .

边栏推荐
- LeetCode:1380. Lucky number in matrix -- simple
- IDEA2021.1 安装教程
- si446使用记录(二):使用WDS3生成头文件
- 例题 非线性整数规划
- Visibilitychange – refresh the page data when the specified tab is visible
- Alibaba Tianchi SQL learning notes - Day3
- chrome瀏覽器快速訪問stackoverflow
- What are the green field and brown field models in software development - green field development and brown field development
- 微信小程序 —— 上下浮动的箭头
- ROS knowledge points -- the difference between ros:: nodehandle N and NH ("~")
猜你喜欢

LeetCode:1380. Lucky number in matrix -- simple

Win10 system uses pip to install juypter notebook process record (installed on a disk other than the system disk)
![[非线性控制理论]8_三种鲁棒控制器的比较](/img/a8/03ed363659a0a067c2f1934457c106.png)
[非线性控制理论]8_三种鲁棒控制器的比较

【网络是怎样连接的】第六章 请求到达服务器以及响应给客户端(完结)

The construction of scalable distributed database cluster and the partition design of oneproxy sub database

freemarker+poi实现动态生成excel文件及解析excel文件

vector的底层模拟实现

Platform management background and business menu resource management: business permissions and menu resource management design

Easyswoole3.2 restart failed

Win10系统使用pip安装juypter notebook过程记录(安装在系统盘以外的盘)
随机推荐
The beginning of life
Dstat use [easy to understand]
Chapter 3 of hands on deep learning - (1) linear regression is realized from scratch_ Learning thinking and exercise answers
最长无重复子数组
[shutter] dart data type (dynamic data type)
【GAMES101】作业4 Bézier 曲线
Five reasons to choose SAP Spartacus as the implementation framework of SAP commerce cloud storefront
Vscode knowledge points - Common Errors
每日一题——小乐乐改数字
ROS知识点——ros::NodeHandle n 和 nh(“~“)的区别
easyswoole3.2重启不成功
em120.gige.h
维护万星开源向量数据库是什么体验
JDBC
Migrate your accelerator based SAP commerce cloud storefront to Spartacus
线性规划例题 投资的收益与风险
Baobab's gem IPO was terminated: Tang Guangyu once planned to raise 1.8 billion to control 47% of the equity
traceroute命令讲解
Shutter: action feedback
13、Darknet YOLO3