当前位置:网站首页>网络设备硬核技术内幕 防火墙与安全网关篇 (八) 虚拟化神器 (中)
网络设备硬核技术内幕 防火墙与安全网关篇 (八) 虚拟化神器 (中)
2022-07-27 22:04:00 【用户8289326】
令狐冲通过批量部署了虚拟化服务器,对华山派的网站进行了大规模扩容,果然,对外访问流畅了许多。然而,一切都源于一只万恶的蝙蝠…
由于抗击疫情的需要,华山派也开启了网上直播教学,通过互联网向全球弟子传授武功。由于华山派武功有一定的保密性,岳不群要求,只有加入会员才能观看直播。
负责互联网业务开发的弟子们很快就开发出了互联网直播业务,三天内以迅雷不及掩耳盗铃之势上线了。
没想到,很快用户投诉就塞爆了华山派的客服邮箱——基本上都是在报告,登录了华山派官网以后,点开直播页面发现,提示没有登录,需要再次登录,还不一定能够成功。
原来,这和令狐冲开发的负载均衡设备的机制有关。
如图,用户在访问网络视频直播业务时,会向服务器(VM)发起多个连接。由于基于NAT的LB设备感知不到用户信息,会将来自同一个用户的访问转发到多个VM上。
假设图中的用户的IP是123.118.110.85,通过TCP向73.81.6.112的80端口发起HTTP连接。第一个连接的源端口是41318,并在这个HTTP连接上登录。LB将这个连接发放到了虚拟机 10.152.13.16。
随即,用户点开播放视频的链接,浏览器通过TCP向73.81.6.112的80端口又发起了一个连接,这个连接使用了41320作为源端口,LB将这个连接发放到虚拟机 10.152.13.17。
由于虚拟机10.152.13.17并不知道这个用户的登录状态,它判断用户登录信息无效,拒绝发送视频流。
因此,基于NAT的负载均衡,对于有状态服务,存在着天然的缺陷——
令狐冲决定在LB上开发另一种负载均衡工作模式——反向代理模式。
什么是反向代理模式呢?
我们知道,NAT工作在四层,它不关心TCP/UDP内部封装的内容,只是简单地将内网IP/端口与外网IP/端口进行映射。这也就是基于NAT的负载均衡难以正确处理有状态服务的根本原因所在。
而反向代理工作在七层。
它本身终结HTTP请求,识别HTTP用户,并构建新的HTTP请求发送到服务器/VM集群,如下图所示:
图中的LB设备工作在反向代理模式。来自互联网的User A访问到LB对外发布的虚拟IP (Virtual IP, 缩写为VIP) 73.81.6.112,LB设备对HTTP请求进行解析,获取到用户信息,将User A分配到虚拟机10.152.13.16,并向这个虚拟机发起HTTP请求。那么,当另一个用户对73.81.6.112发起请求时,LB设备也会将这个用户的HTTP解析后,将用户在虚拟机池中固定分配到另一个虚拟机。
这样,就可以实现有状态服务了。
实现了有状态服务的LB,已经从防火墙跨越到了新的一个层次——应用安全网关。这是一个全新的领域,容我们以后再讲述。
支持反向代理模式上线以后,华山派的直播业务果然大放异彩,又一次赢得了江湖的盛誉。
没想到,家庭宽带网关的一场风暴,又带来了新的挑战——
敬请期待下期。
边栏推荐
- View the construction details of Yongzhou dioxin Laboratory
- How does JMeter solve the problem of garbled code?
- 一文读懂CMake
- C event related exercise code.
- numpy没有unsqueeze函数
- Strong collaboration and common development! Intel and Taiyi IOT held a seminar on AI computing box aggregation services
- ҈ straight ҈ Broadcast ҈ Pre ҈ Report ҈ |҈ In hot summer, let's cross the high temperature and "bake" with nono!
- Firefox 103, the Firefox browser, has been released to improve performance under high refresh rate displays
- Impact of privilege changes on existing connections
- 公司7月来了个软件测试工程师,一副毛头小子的样儿,哪想到是新一代卷王...
猜你喜欢

数据分析:拆解方法(详情整理)
![[meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development](/img/17/15c759aadafc335028d37380903ee7.jpg)
[meetup preview] openmldb + ONEFLOW: link feature engineering to model training to accelerate machine learning model development

几行代码轻松实现对于PaddleOCR的实时推理,快来get!

Annual comprehensive analysis of China's online video market in 2022

Is it amazing to extract text from pictures? Try three steps to realize OCR!

OpenVINO整合TensorFlow实现推理加速

数据可视化-《白蛇2:青蛇劫起》(3)

Promoting cloud network integration and building a digital economy: Intel unveiled the 5th Digital China Construction Summit - cloud ecosystem Conference

英特尔发布开源AI参考套件

一文读懂CMake
随机推荐
Intel AI practice day issue 56 | explore new trends in industry development
Leetcode 415. string addition and 43. string multiplication
In the third week of July, the list of feigua data station B up main ranking list was released!
[leetcode] 547. Number of provinces (medium)
Basic operations of MySQL database (2) --- Based on data table
Recurrence of fastjson historical vulnerabilities
网络设备硬核技术内幕 防火墙与安全网关篇 (小结)
ASML launched the first generation HMI multi beam detector: the speed is increased by 600%, which is suitable for 5nm and more advanced processes
Y79. Chapter IV Prometheus' monitoring system and practice -- Prometheus' service discovery mechanism (10)
Basic operations of MySQL database (3) --- Based on fields
几行代码轻松实现对于PaddleOCR的实时推理,快来get!
View the construction details of Yongzhou dioxin Laboratory
A few lines of code can easily realize the real-time reasoning of paddleocr. Come and get!
leetcode 452. Minimum Number of Arrows to Burst Balloons 用最少数量的箭引爆气球(中等)
Annual comprehensive analysis of China's online video market in 2022
How does JMeter solve the problem of garbled code?
LED, nixie tube and key of single chip microcomputer
Build Release Blogs
Matlab | matlab terrain generation: rectangular iteration method, inverse Fourier transform method, fractal Berlin noise method
FFT 采样频率和采样点数的选取