为什么80%的码农都做不了架构师?>>>
本文是针对上文中的DNS配置的一些细节方面的讲述,上文配置了一个基本的DNS流量,端口,包模板,流量统计等,而本文会对一些细节进行探讨
1. 一个正常的按照igp值的包间隔值
- yaml 设置
13 cap_info :14 - name: cap2/dns.pcap15 cps : 1.016 ipg : 100000 #包间隔为0.1秒17 rtt : 10000018 w : 1
2. 按照模板中的包间隔值设置igp
- dns 模板
- yaml 设置
13 cap_ipg : true14 #cap_ipg_min : 10015 #cap_override_ipg : 20016 cap_info :17 - name: cap2/dns.pcap18 cps : 1.019 ipg : 10000020 rtt : 10000021 w : 1
3. one server
- yaml 设置
16 cap_info :17 - name: cap2/dns.pcap18 cps : 1.019 ipg : 10000020 rtt : 10000021 w : 122 server_addr : "48.0.0.1" # 指定server ip 23 one_app_server : true # one server
- capture result
4. 减少client个数
- yaml 设置
2 generator :3 distribution : "seq"4 clients_start : "16.0.0.1" # 控制地址范围5 clients_end : "16.0.0.1"6 servers_start : "48.0.0.1"7 servers_end : "48.0.0.1" #控制server范围8 clients_per_gb : 2019 min_clients : 10110 dual_port_mask : "1.0.0.0"11 tcp_aging : 012 udp_aging : 0
- capture result
5. w client与server的可调参数
- yaml 设置
13 cap_info :14 - name: cap2/dns.pcap15 cps : 1.016 ipg : 10000017 rtt : 10000018 w : 2 # 二条连接用的是同一组IP
- capture result
原本在第二秒是第二个连接开始,应该是16.0.0.2,由于用了**'w'**参数,第二次连接依然用第一组IP
6. limit 参数
13 cap_info :14 - name: cap2/dns.pcap15 cps : 1.016 ipg : 10000017 rtt : 10000018 w : 119 limit : 3 # 3 组IP循环
- capture result
原本发生的连接由16.0..0.1~16.0.0.10, 现在是16.0.0.1~16.0.0.3作循环
7. HTTP和DNS混合流设置
- yaml 设置
13 cap_info :14 - name: cap2/dns.pcap # 第一条DNS流15 cps : 1.016 ipg : 1000017 rtt : 1000018 w : 119 20 - name: cap2/http_browsing.pcap # 第二条 HTTP流21 cps : 1.022 ipg : 1000023 rtt : 1000024 w : 1
- capture result
8. Imix YAML
\# Simple IMIX faster test (7x64B, 5x594B, 1x1518B)
\# we duplicate the template to utilize the memory better
\- duration : 3generator : distribution : "seq"clients_start : "16.0.0.1"clients_end : "16.0.0.255"servers_start : "48.0.0.1"servers_end : "48.0.255.255"clients_per_gb : 201min_clients : 101dual_port_mask : "1.0.0.0" tcp_aging : 0udp_aging : 0cap_info : - name: cap2/udp_64B.pcapcps : 90615ipg : 10000rtt : 10000w : 1limit : 199- name: cap2/udp_594B.pcapcps : 64725ipg : 10000rtt : 10000w : 1limit : 199- name: cap2/udp_1518B.pcapcps : 12945ipg : 10000rtt : 10000w : 1limit : 199- name: cap2/udp_64B.pcapcps : 90615ipg : 10000rtt : 10000w : 1limit : 199- name: cap2/udp_594B.pcapcps : 64725ipg : 10000rtt : 10000w : 1limit : 199- name: cap2/udp_1518B.pcapcps : 12945ipg : 10000rtt : 10000w : 1limit : 199
这个文件是跑各字节流量的配置文件
每秒钟发的流数量 : ( 90615+64725+12945)*2=336630
该配置文件发的流数336630*3 = 1009890
发包速率 B/s 90615*2*64+64725*2*594+12945*2*1518 = 127793040
发包速率b/s127793040 *8 = 1022344320
1Gb/s
####参考 https://trex-tgn.cisco.com/trex/doc/trex_manual.html