问题描述
根据 AWS,
网络负载均衡器将流量路由到 Amazon Virtual 中的目标私有云 (Amazon VPC),能够处理数百万每秒请求数,同时保持超低延迟
此外,NLB 支持静态/弹性 IP 地址.我的印象是 AWS 通常不推荐 IP 地址,而是要求客户端使用 DNS 名称,以便底层硬件可以扩展(并且 IP 地址可以更改).在 NLB 的情况下,IP 可以保持静态并仍可扩展,但 ALB 上没有提供相同的功能,这怎么可能?- AWS 在 NLB 中改进是 ALB 的设计限制吗?或者在 ALB 的情况下保留静态 IP 的任何技术挑战?
Also, NLB supports static / Elastic IP addresses. I am under the impression that AWS generally does not recommend IP addresses but instead asks clients to use DNS names so that the underlying hardware can scale (and IP addresses can change). How is this possible in the case of NLB where IP can remain static and still scale but the same functionality is not offered on ALB? - Is it a design limitation of ALB that AWS improved in NLB? Or any technical challenges to retain static IP in case of ALB?
推荐答案
不知道这是否是 AWS 在 ALB 和 NLB 中使用 IP 地址的完整解释,但我认为这是因为 ALB 在 OSI 模型的应用层(第 7 层).
Don't know if this is full explanation behind AWS use of IP addresses in ALB and NLB, but I think that this is because ALB works at application layer (layer 7) of the OSI model.
在第 7 层,除了 HTTP、HTTPS 和 FTP,您还有 DNS.因此,您使用 DNS 作为与 ALB 通信的主要方式,而这正是 AWS 告诉您要做的.
At layer 7, apart form HTTP, HTTPS, FTP you also have DNS. Thus, you use DNS as the primary way of communicating with ALB and this is what AWS tells you to do.
NLB 工作在 OSI 模型的传输层(第 4 层).这里没有 DNS,而是例如 TCP 或 UDP.因此,当您想与 NLB 通信时,您需要使用 IP 地址,因为技术上没有 DNS 或 URL.
NLB works at transport layer (layer 4) of the OSI model. Here there is no DNS, but TCP or UDP for instance. Thus when you want to communicate with NLB, you need to use IP address, as technically there is no DNS nor URLs.
AWS 为 NLB 提供 DNS 的事实仅适用于使用 NLB 并在第 7 层上运行的应用程序,例如当您使用 NLB 对 HTTPS/HTTP 流量进行负载平衡时,或通过 NLB ssh 到实例时.但是 NLB 可用于仅在第 4 层运行的应用程序,或使用自定义/专有的更高级别协议,因此它们必须使用 IP 地址,因为 DNS 在第 4 层不可用.因此显然 NLB 的 IP 地址必须是静态的,否则这样的应用程序会崩溃.
The fact that AWS provides DNS for NLB is only usable for applications that use NLB and operate on layer 7, such as when you use NLB to load balance HTTPS/HTTP traffic, or ssh to an instance through NLB. But NLB can be used for application that only operate at layer 4, or use custom/proprietary higher level protocols, thus they must use IP address, as DNS is not available at layer 4. So obviously the IP addresses of NLB must be static, otherwise such applications would break.
这篇关于在 AWS 中,为什么 NLB 可以提供静态 IP 地址而 ALB 不能?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持!