第 20 章 Network Traffic

本文涉及的产品
云防火墙,500元 1000GB
简介:

数不清的用户在访问你的服务器

带宽与服务器可以随时增加,但也有限

瓶颈无处不在

	

user -> \                                     /--1G--> | server |
user ->  |--1G--> [Firewal] --1G--> [Switch] ----1G--> | server |
user -> /                                     \--1G--> | server |

	
	

20.1. bandwidth

主流网络设备带宽均为1G,目前来看10G仍不普及,仅在存储领域封闭使用,价格非常昂贵

firewall (1G) - switch (Forwarding bandwidth / 1G) - server (NIC 1G)

20.1.1. firewall

怎么能提高带宽呢?

首先是防火墙,这个设备非常重要。 100M 基本淘汰,10G 防火墙尚未普及,1G带宽如果不够怎么办?答案是买2个,3个...

为什么不买10G的。在下面会谈到会话数,你一看就明白了。10G防火墙会话数不是1G防火墙会话数的十倍。

20.1.2. switch

目前主流交换机 Cisco WS-C2960G-48TC-L,48个RJ45口与2或4个SFP光纤口均为1G带宽

一般中小企业1台交换机足够,再上一个台阶超过40台服务器,就会有出现多台交换机互连问题,使用以太网口与SFP光纤口的带宽是一样的,唯一区别是传输距离。

每个交换机后面都对应几十台服务器,每个服务器1G网卡,如果这些服务器满负荷传输,交换机与交换机间数据传输就会带来瓶颈。

通过端口聚合可以解决交换机间数据传输瓶颈,另种方式是交换机堆叠。

          +----------+                          +----------+
          |          |gi0/0/1            gi0/0/1|          |
          | Switch A +--------------------------+ Switch B |
          |          +--------------------------+          |
          |          |gi0/0/2            gi0/0/2|          |
          +----------+                          +----------+
			

比如你有5个机柜,将交换机放置到3号机柜,处于中间位置,所有交换机放入该机柜,然后堆叠,从中心机柜向两侧分线

cabinet-3750.png

对于不大不小的企业,直接采购IDC箱式交换机

cabinet-4xxx.png

20.1.2.1. 聚合端口

Example 1 : host to host at double speed

          +----------+                          +----------+
          |          |eth0                  eth0|          |
          | Host A   +--------------------------+  Host B  |
          |          +--------------------------+          |
          |          |eth1                  eth1|          |
          +----------+                          +----------+

  On each host :
     # modprobe bonding miimon=100
     # ifconfig bond0 addr
     # ifenslave bond0 eth0 eth1

Example 2 : host to switch at double speed

          +----------+                          +----------+
          |          |eth0                 port1|          |
          | Host A   +--------------------------+  switch  |
          |          +--------------------------+          |
          |          |eth1                 port2|          |
          +----------+                          +----------+

  On host A :                             On the switch :
     # modprobe bonding miimon=100           # set up a trunk on port1
     # ifconfig bond0 addr                     and port2
     # ifenslave bond0 eth0 eth1

Example 3: High Availability in a Multiple Switch Topology
               |                                     |
               |port3                           port3|
         +-----+----+                          +-----+----+
         |          |port2       ISL      port2|          |
         | switch A +--------------------------+ switch B |
         |          |                          |          |
         +-----+----+                          +-----++---+
               |port1                           port1|
               |             +-------+               |
               +-------------+ host1 +---------------+
                        eth0 +-------+ eth1

Example 4: Maximum Throughput in a Multiple Switch Topology

Multiple switches may be utilized to optimize for throughput
when they are configured in parallel as part of an isolated network
between two or more systems, for example:

                      +-----------+
                      |  Host A   |
                      +-+---+---+-+
                        |   |   |
               +--------+   |   +---------+
               |            |             |
        +------+---+  +-----+----+  +-----+----+
        | Switch A |  | Switch B |  | Switch C |
        +------+---+  +-----+----+  +-----+----+
               |            |             |
               +--------+   |   +---------+
                        |   |   |
                      +-+---+---+-+
                      |  Host B   |
                      +-----------+

Example 5: Using multiple host and multiple switches to build a "no single
point of failure" solution.


                |                                     |
                |port3                           port3|
          +-----+----+                          +-----+----+
          |          |port7       ISL      port7|          |
          | switch A +--------------------------+ switch B |
          |          +--------------------------+          |
          |          |port8                port8|          |
          +----++----+                          +-----++---+
          port2||port1                           port1||port2
               ||             +-------+               ||
               |+-------------+ host1 +---------------+|
               |         eth0 +-------+ eth1           |
               |                                       |
               |              +-------+                |
               +--------------+ host2 +----------------+
                         eth0 +-------+ eth1
				

20.1.3. Server

目前主流服务都配备2到4个网口,像IBM / HP / DELL 等品牌服务器你无需关心网卡问题.

这里主要是针对自行安装或使用PC服务器的用户,因为很多PC服务器使用Realtak网卡。那么Realtak与Broadcom的NetXtreme有什么不同?

建议你安装一个windows系统在服务器上,然后看看网卡驱动属性。Realtak 仅仅提供基本网络功能,QOS质量访问服务由驱动程序提供(软QOS)而NetXtreme 提供非常丰富的功能,并且都是硬件实现。

话题回到带宽上,linux 支持 bonding 网卡,可以帮你解决服务器网络通信带宽问题,bonding 还可以解决网卡故障转移,传输流量负载均衡等等。

在我的《Netkiller Linux 手札》中你可以找到具体的设置方法。





原文出处:Netkiller 系列 手札
本文作者:陈景峯
转载请与作者联系,同时请务必标明文章原始出处和作者信息及本声明。

目录
相关文章
|
14天前
|
canal Kubernetes Perl
Network Policy及应用
文章主要介绍了如何在Kubernetes中使用Network Policy进行网络策略配置,包括如何部署Calico网络模型来支持网络策略,以及如何通过设置不同的网络策略来控制不同命名空间下Pods之间的访问权限。
30 4
Network Policy及应用
|
负载均衡 网络协议 网络架构
策略路由(Policy-Based-Route)
定义及运用场景 PBR: Policy-Based-Route,该技术打破了路由表的传统选路规则,可以根据管理员定义的策略条件来选择性的转发数据包。
580 0
策略路由(Policy-Based-Route)
|
网络协议 网络虚拟化
|
网络协议