From 569ca4f3a4fe533f067d0c21c0624269b9c36c31 Mon Sep 17 00:00:00 2001 From: Wenxian Li Date: Tue, 8 Sep 2015 17:23:15 -0400 Subject: tuple generator phase 3.1, support random, support per template client/server generator, Dynamic sellection of client type Signed-off-by: Wenxian Li --- scripts/cap2/per_template_gen1.yaml | 31 +++++++++++++++++++++++++++++++ scripts/cap2/per_template_gen2.yaml | 33 +++++++++++++++++++++++++++++++++ 2 files changed, 64 insertions(+) create mode 100644 scripts/cap2/per_template_gen1.yaml create mode 100644 scripts/cap2/per_template_gen2.yaml (limited to 'scripts/cap2') diff --git a/scripts/cap2/per_template_gen1.yaml b/scripts/cap2/per_template_gen1.yaml new file mode 100644 index 00000000..22b2ba64 --- /dev/null +++ b/scripts/cap2/per_template_gen1.yaml @@ -0,0 +1,31 @@ +- duration : 1.0 + generator : + 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 : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 0 + udp_aging : 0 + generator_clients : + - name : "c1" + distribution : "seq" + ip_start : "38.0.0.1" + ip_end : "38.0.1.255" + generator_servers : + - name : "s1" + distribution : "seq" + ip_start : "38.0.0.1" + ip_end : "38.0.1.255" + track_ports : false + mac : [0x0,0x0,0x0,0x1,0x0,0x00] + cap_info : + - name: cap2/http_get.pcap + cps : 1.0 + ipg : 100 + rtt : 10000 + w : 1 + diff --git a/scripts/cap2/per_template_gen2.yaml b/scripts/cap2/per_template_gen2.yaml new file mode 100644 index 00000000..5edc3e49 --- /dev/null +++ b/scripts/cap2/per_template_gen2.yaml @@ -0,0 +1,33 @@ +- duration : 1.0 + generator : + distribution : "seq" + clients_start : "20.0.0.1" + clients_end : "20.0.0.255" + servers_start : "90.0.0.1" + servers_end : "90.0.255.255" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 0 + udp_aging : 0 + generator_clients : + - name : "c1" + distribution : "seq" + ip_start : "16.0.0.1" + ip_end : "16.0.0.255" + generator_servers : + - name : "s1" + distribution : "seq" + ip_start : "48.0.0.1" + ip_end : "48.0.255.255" + track_ports: true + mac : [0x0,0x0,0x0,0x1,0x0,0x00] + cap_info : + - name: cap2/http_get.pcap + client_pool: "c1" + server_pool: "s1" + cps : 1.0 + ipg : 100 + rtt : 10000 + w : 1 + -- cgit 1.2.3-korg From 9a524989d331f04abecd3faa72d98157a8651739 Mon Sep 17 00:00:00 2001 From: Wenxian Li Date: Tue, 8 Sep 2015 17:45:43 -0400 Subject: Add more yaml example for per template tuple generator --- scripts/cap2/per_template_gen1.yaml | 13 ++++++++++-- scripts/cap2/per_template_gen2.yaml | 20 ++++++++++++------ scripts/cap2/per_template_gen3.yaml | 41 +++++++++++++++++++++++++++++++++++++ scripts/cap2/per_template_gen4.yaml | 41 +++++++++++++++++++++++++++++++++++++ 4 files changed, 107 insertions(+), 8 deletions(-) create mode 100644 scripts/cap2/per_template_gen3.yaml create mode 100644 scripts/cap2/per_template_gen4.yaml (limited to 'scripts/cap2') diff --git a/scripts/cap2/per_template_gen1.yaml b/scripts/cap2/per_template_gen1.yaml index 22b2ba64..41332518 100644 --- a/scripts/cap2/per_template_gen1.yaml +++ b/scripts/cap2/per_template_gen1.yaml @@ -13,10 +13,19 @@ generator_clients : - name : "c1" distribution : "seq" - ip_start : "38.0.0.1" - ip_end : "38.0.1.255" + ip_start : "26.0.0.1" + ip_end : "26.0.1.255" + - name : "c2" + distribution : "seq" + ip_start : "36.0.0.1" + ip_end : "36.0.1.255" generator_servers : - name : "s1" + distribution : "seq" + ip_start : "28.0.0.1" + ip_end : "28.0.1.255" + track_ports : false + - name : "s2" distribution : "seq" ip_start : "38.0.0.1" ip_end : "38.0.1.255" diff --git a/scripts/cap2/per_template_gen2.yaml b/scripts/cap2/per_template_gen2.yaml index 5edc3e49..269e4958 100644 --- a/scripts/cap2/per_template_gen2.yaml +++ b/scripts/cap2/per_template_gen2.yaml @@ -13,14 +13,23 @@ generator_clients : - name : "c1" distribution : "seq" - ip_start : "16.0.0.1" - ip_end : "16.0.0.255" + ip_start : "26.0.0.1" + ip_end : "26.0.1.255" + - name : "c2" + distribution : "seq" + ip_start : "36.0.0.1" + ip_end : "36.0.1.255" generator_servers : - name : "s1" distribution : "seq" - ip_start : "48.0.0.1" - ip_end : "48.0.255.255" - track_ports: true + ip_start : "28.0.0.1" + ip_end : "28.0.1.255" + track_ports : false + - name : "s2" + distribution : "seq" + ip_start : "38.0.0.1" + ip_end : "38.0.1.255" + track_ports : false mac : [0x0,0x0,0x0,0x1,0x0,0x00] cap_info : - name: cap2/http_get.pcap @@ -30,4 +39,3 @@ ipg : 100 rtt : 10000 w : 1 - diff --git a/scripts/cap2/per_template_gen3.yaml b/scripts/cap2/per_template_gen3.yaml new file mode 100644 index 00000000..2bf428d0 --- /dev/null +++ b/scripts/cap2/per_template_gen3.yaml @@ -0,0 +1,41 @@ +- duration : 1.0 + generator : + distribution : "seq" + clients_start : "20.0.0.1" + clients_end : "20.0.0.255" + servers_start : "90.0.0.1" + servers_end : "90.0.255.255" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 0 + udp_aging : 0 + generator_clients : + - name : "c1" + distribution : "seq" + ip_start : "26.0.0.1" + ip_end : "26.0.1.255" + - name : "c2" + distribution : "seq" + ip_start : "36.0.0.1" + ip_end : "36.0.1.255" + generator_servers : + - name : "s1" + distribution : "seq" + ip_start : "28.0.0.1" + ip_end : "28.0.1.255" + track_ports : false + - name : "s2" + distribution : "seq" + ip_start : "38.0.0.1" + ip_end : "38.0.1.255" + track_ports : false + mac : [0x0,0x0,0x0,0x1,0x0,0x00] + cap_info : + - name: cap2/http_get.pcap + client_pool: "c2" + server_pool: "s2" + cps : 1.0 + ipg : 100 + rtt : 10000 + w : 1 diff --git a/scripts/cap2/per_template_gen4.yaml b/scripts/cap2/per_template_gen4.yaml new file mode 100644 index 00000000..8a8a61b9 --- /dev/null +++ b/scripts/cap2/per_template_gen4.yaml @@ -0,0 +1,41 @@ +- duration : 1.0 + generator : + distribution : "seq" + clients_start : "20.0.0.1" + clients_end : "20.0.0.255" + servers_start : "90.0.0.1" + servers_end : "90.0.255.255" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 0 + udp_aging : 0 + generator_clients : + - name : "c1" + distribution : "seq" + ip_start : "26.0.0.1" + ip_end : "26.0.1.255" + - name : "c2" + distribution : "seq" + ip_start : "36.0.0.1" + ip_end : "36.0.1.255" + generator_servers : + - name : "s1" + distribution : "seq" + ip_start : "28.0.0.1" + ip_end : "28.0.1.255" + track_ports : false + - name : "s2" + distribution : "seq" + ip_start : "38.0.0.1" + ip_end : "38.0.1.255" + track_ports : false + mac : [0x0,0x0,0x0,0x1,0x0,0x00] + cap_info : + - name: cap2/http_get.pcap + client_pool: "c2" + server_pool: "s1" + cps : 1.0 + ipg : 100 + rtt : 10000 + w : 1 -- cgit 1.2.3-korg From 2e5fdf7cc07549de848ef3396c9301c7a317f966 Mon Sep 17 00:00:00 2001 From: Wenxian Li Date: Tue, 8 Sep 2015 23:58:04 -0400 Subject: fix some errors after pull request --- scripts/cap2/per_template_gen2.yaml | 8 ++++---- src/bp_sim.h | 8 ++++---- 2 files changed, 8 insertions(+), 8 deletions(-) (limited to 'scripts/cap2') diff --git a/scripts/cap2/per_template_gen2.yaml b/scripts/cap2/per_template_gen2.yaml index 269e4958..3349087c 100644 --- a/scripts/cap2/per_template_gen2.yaml +++ b/scripts/cap2/per_template_gen2.yaml @@ -13,8 +13,8 @@ generator_clients : - name : "c1" distribution : "seq" - ip_start : "26.0.0.1" - ip_end : "26.0.1.255" + ip_start : "16.0.0.1" + ip_end : "16.0.1.255" - name : "c2" distribution : "seq" ip_start : "36.0.0.1" @@ -22,8 +22,8 @@ generator_servers : - name : "s1" distribution : "seq" - ip_start : "28.0.0.1" - ip_end : "28.0.1.255" + ip_start : "48.0.0.1" + ip_end : "48.0.1.255" track_ports : false - name : "s2" distribution : "seq" diff --git a/src/bp_sim.h b/src/bp_sim.h index 804c936a..29b9a724 100755 --- a/src/bp_sim.h +++ b/src/bp_sim.h @@ -1376,17 +1376,17 @@ public: //private: + CTupleGeneratorSmart *m_tuple_gen; // cache line 1 - 64bytes waste of space ! uint32_t m_nat_external_ipv4; /* client */ uint32_t m_nat_external_ipv4_server; uint16_t m_nat_external_port; - uint16_t m_nat_pad; + uint16_t m_nat_pad[3]; mac_addr_align_t m_src_mac; - CTupleGeneratorSmart *m_tuple_gen; uint32_t m_src_idx; uint32_t m_dest_idx; - uint32_t m_end_of_cache_line[10]; + uint32_t m_end_of_cache_line[6]; public: bool operator <(const CGenNode * rsh ) const { @@ -1592,7 +1592,7 @@ public: #if __x86_64__ /* size of 64 bytes */ - #define DEFER_CLIENTS_NUM (18) + #define DEFER_CLIENTS_NUM (16) #else #define DEFER_CLIENTS_NUM (16) #endif -- cgit 1.2.3-korg From f885ac59cebcf1e87b97b0e6ef6e9eb032f9f733 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Thu, 17 Sep 2015 21:44:53 +0300 Subject: fix some pcap load issues --- VERSION | 2 +- scripts/cap2/jumbo.pcap | Bin 0 -> 17791 bytes scripts/cap2/jumbo.yaml | 23 +++++++++++++++++++++++ scripts/cap2/wrong_ip.pcap | Bin 0 -> 1530 bytes scripts/cap2/wrong_ip.yaml | 23 +++++++++++++++++++++++ src/bp_sim.cpp | 16 +++++++++------- src/common/pcap.cpp | 3 ++- 7 files changed, 58 insertions(+), 9 deletions(-) create mode 100644 scripts/cap2/jumbo.pcap create mode 100644 scripts/cap2/jumbo.yaml create mode 100644 scripts/cap2/wrong_ip.pcap create mode 100644 scripts/cap2/wrong_ip.yaml (limited to 'scripts/cap2') diff --git a/VERSION b/VERSION index 917f0173..fe509dde 100755 --- a/VERSION +++ b/VERSION @@ -1,4 +1,4 @@ -v1.75 +v1.76 diff --git a/scripts/cap2/jumbo.pcap b/scripts/cap2/jumbo.pcap new file mode 100644 index 00000000..2a7f7bde Binary files /dev/null and b/scripts/cap2/jumbo.pcap differ diff --git a/scripts/cap2/jumbo.yaml b/scripts/cap2/jumbo.yaml new file mode 100644 index 00000000..b45a6ca3 --- /dev/null +++ b/scripts/cap2/jumbo.yaml @@ -0,0 +1,23 @@ +- duration : 10.0 + generator : + distribution : "seq" + clients_start : "16.0.0.1" + clients_end : "16.0.1.255" + servers_start : "48.0.0.1" + servers_end : "48.0.0.255" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 1 + udp_aging : 1 + mac : [0x00,0x00,0x00,0x01,0x00,0x00] + #vlan : { enable : 1 , vlan0 : 100 , vlan1 : 200 } + #mac_override_by_ip : true + cap_info : + - name: cap2/jumbo.pcap + cps : 1.0 + ipg : 10000 + rtt : 10000 + w : 1 + + diff --git a/scripts/cap2/wrong_ip.pcap b/scripts/cap2/wrong_ip.pcap new file mode 100644 index 00000000..08cf8de8 Binary files /dev/null and b/scripts/cap2/wrong_ip.pcap differ diff --git a/scripts/cap2/wrong_ip.yaml b/scripts/cap2/wrong_ip.yaml new file mode 100644 index 00000000..7de3b82d --- /dev/null +++ b/scripts/cap2/wrong_ip.yaml @@ -0,0 +1,23 @@ +- duration : 10.0 + generator : + distribution : "seq" + clients_start : "16.0.0.1" + clients_end : "16.0.1.255" + servers_start : "48.0.0.1" + servers_end : "48.0.0.255" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 1 + udp_aging : 1 + mac : [0x00,0x00,0x00,0x01,0x00,0x00] + #vlan : { enable : 1 , vlan0 : 100 , vlan1 : 200 } + #mac_override_by_ip : true + cap_info : + - name: cap2/wrong_ip.pcap + cps : 1.0 + ipg : 10000 + rtt : 10000 + w : 1 + + diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index 555696f1..8a8bc5f9 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -1148,13 +1148,6 @@ void CPacketIndication::ProcessIpPacket(CPacketParser *parser, } offset += ip_header_length; - if (!l3.m_ipv4->isChecksumOK() ){ - m_cnt->m_ip_checksum_error++; - } - if( l3.m_ipv4->isMulticast() ){ - m_cnt->m_ip_multicast_error++; - return; - } if( l3.m_ipv4->getTimeToLive() ==0 ){ m_cnt->m_ip_ttl_is_zero_error++; @@ -1177,10 +1170,19 @@ void CPacketIndication::ProcessIpPacket(CPacketParser *parser, return; } + if ( m_packet->pkt_len > MAX_BUF_SIZE -FIRST_PKT_SIZE ){ + m_cnt->m_tcp_udp_pkt_length_error++; + printf("ERROR packet is too big, not supported jumbo packets that larger than %d \n",MAX_BUF_SIZE); + return; + } + // Set packet length and include padding if needed m_packet->pkt_len = l3.m_ipv4->getTotalLength() + getIpOffset(); if (m_packet->pkt_len < 60) { m_packet->pkt_len = 60; } + + + m_cnt->m_valid_udp_tcp++; m_payload_len = l3.m_ipv4->getTotalLength() - (payload_offset_from_ip); m_payload = (uint8_t *)(packetBase +offset); diff --git a/src/common/pcap.cpp b/src/common/pcap.cpp index 6dd54514..9b360a3e 100755 --- a/src/common/pcap.cpp +++ b/src/common/pcap.cpp @@ -156,7 +156,8 @@ bool LibPCapReader::ReadPacket(CCapPktRaw *lpPacket) } if (pkt_header.len > READER_MAX_PACKET_SIZE) { /* cannot read this packet */ - assert(0); + printf("ERROR packet is too big, bigger than %d \n",READER_MAX_PACKET_SIZE); + exit(-1); return false; } -- cgit 1.2.3-korg From 588bb20e9c8f8438db4eb3e8db85111f41bd7306 Mon Sep 17 00:00:00 2001 From: Hanoh Haim Date: Sun, 20 Sep 2015 17:33:56 +0300 Subject: fix tuple generator servers count sanity check --- scripts/avl/sfr_branch_profile_delay_10.yaml | 2 +- scripts/avl/sfr_delay_10.yaml | 2 +- scripts/avl/sfr_delay_10_1g.yaml | 2 +- scripts/cap2/per_template_gen5.yaml | 51 ++++++++++++++++++++++++++++ src/bp_sim.cpp | 32 +++++++++++++++++ src/tuple_gen.cpp | 1 + 6 files changed, 87 insertions(+), 3 deletions(-) create mode 100755 scripts/cap2/per_template_gen5.yaml (limited to 'scripts/cap2') diff --git a/scripts/avl/sfr_branch_profile_delay_10.yaml b/scripts/avl/sfr_branch_profile_delay_10.yaml index 71e69212..04671b3e 100755 --- a/scripts/avl/sfr_branch_profile_delay_10.yaml +++ b/scripts/avl/sfr_branch_profile_delay_10.yaml @@ -4,7 +4,7 @@ clients_start : "16.0.0.1" clients_end : "16.0.1.255" servers_start : "48.0.0.1" - servers_end : "48.0.62.255" + servers_end : "48.0.63.224" clients_per_gb : 201 min_clients : 101 dual_port_mask : "1.0.0.0" diff --git a/scripts/avl/sfr_delay_10.yaml b/scripts/avl/sfr_delay_10.yaml index 1a3f82c3..2bb70fe4 100755 --- a/scripts/avl/sfr_delay_10.yaml +++ b/scripts/avl/sfr_delay_10.yaml @@ -4,7 +4,7 @@ clients_start : "16.0.0.1" clients_end : "16.0.1.255" servers_start : "48.0.0.1" - servers_end : "48.0.20.255" + servers_end : "48.0.21.245" clients_per_gb : 201 min_clients : 101 dual_port_mask : "1.0.0.0" diff --git a/scripts/avl/sfr_delay_10_1g.yaml b/scripts/avl/sfr_delay_10_1g.yaml index 925531fd..065fe855 100755 --- a/scripts/avl/sfr_delay_10_1g.yaml +++ b/scripts/avl/sfr_delay_10_1g.yaml @@ -4,7 +4,7 @@ clients_start : "16.0.0.1" clients_end : "16.0.1.255" servers_start : "48.0.0.1" - servers_end : "48.0.20.255" + servers_end : "48.0.21.245" clients_per_gb : 201 min_clients : 101 dual_port_mask : "1.0.0.0" diff --git a/scripts/cap2/per_template_gen5.yaml b/scripts/cap2/per_template_gen5.yaml new file mode 100755 index 00000000..e29a2bfc --- /dev/null +++ b/scripts/cap2/per_template_gen5.yaml @@ -0,0 +1,51 @@ +- duration : 1.0 + generator : + distribution : "seq" + clients_start : "20.0.0.1" + clients_end : "20.0.0.255" + servers_start : "90.0.0.1" + servers_end : "90.0.255.255" + clients_per_gb : 201 + min_clients : 101 + dual_port_mask : "1.0.0.0" + tcp_aging : 0 + udp_aging : 0 + generator_clients : + - name : "c1" + distribution : "seq" + ip_start : "26.0.0.1" + ip_end : "26.0.1.255" + - name : "c2" + distribution : "seq" + ip_start : "36.0.0.1" + ip_end : "36.0.1.254" + generator_servers : + - name : "s1" + distribution : "seq" + ip_start : "28.0.0.1" + ip_end : "28.0.1.255" + track_ports : false + - name : "s2" + distribution : "seq" + ip_start : "38.0.0.1" + ip_end : "38.0.3.255" + track_ports : false + mac : [0x0,0x0,0x0,0x1,0x0,0x00] + cap_info : + - name: cap2/http_get.pcap + client_pool: "c2" + server_pool: "s1" + cps : 1.0 + ipg : 100 + rtt : 10000 + w : 1 + - name: avl/delay_10_rtp_160k_full.pcap + client_pool: "c1" + server_pool: "s2" + cps : 0.7 + ipg : 10000 + rtt : 10000 + w : 1 + one_app_server : false + plugin_id : 1 + diff --git a/src/bp_sim.cpp b/src/bp_sim.cpp index 47047831..fca517cf 100755 --- a/src/bp_sim.cpp +++ b/src/bp_sim.cpp @@ -2716,6 +2716,38 @@ bool CFlowsYamlInfo::verify_correctness(uint32_t num_threads) { if ( !m_tuple_gen.is_valid(num_threads,is_any_plugin_configured()) ){ return (false); } + /* patch defect trex-54 */ + if ( is_any_plugin_configured() ){ + /*Plugin is configured. in that case due to a limitation ( defect trex-54 ) + the number of servers should be bigger than number of clients */ + + int i; + for (i=0; i<(int)m_vec.size(); i++) { + CFlowYamlInfo * lp=&m_vec[i]; + if ( lp->m_plugin_id ){ + uint8_t c_idx = lp->m_client_pool_idx; + uint8_t s_idx = lp->m_server_pool_idx; + uint32_t total_clients = m_tuple_gen.m_client_pool[c_idx].getTotalIps(); + uint32_t total_servers = m_tuple_gen.m_server_pool[s_idx].getTotalIps(); + if ( total_servers < total_clients ){ + printf(" Plugin is configured. in that case due to a limitation ( defect trex-54 ) \n"); + printf(" the number of servers should be bigger than number of clients \n"); + printf(" client_pool_name : %s \n", lp->m_client_pool_name.c_str()); + printf(" server_pool_name : %s \n", lp->m_server_pool_name.c_str()); + return (false); + } + uint32_t mul = total_servers / total_clients; + uint32_t new_server_num = mul * total_clients; + if ( new_server_num != total_servers ) { + printf(" Plugin is configured. in that case due to a limitation ( defect trex-54 ) \n"); + printf(" the number of servers should be exact multiplication of the number of clients \n"); + printf(" client_pool_name : %s clients %d \n", lp->m_client_pool_name.c_str(),total_clients); + printf(" server_pool_name : %s servers %d should be %d \n", lp->m_server_pool_name.c_str(),total_servers,new_server_num); + return (false); + } + } + } + } return(true); } diff --git a/src/tuple_gen.cpp b/src/tuple_gen.cpp index 3d285845..e408f275 100755 --- a/src/tuple_gen.cpp +++ b/src/tuple_gen.cpp @@ -359,6 +359,7 @@ bool CTupleGenYamlInfo::is_valid(uint32_t num_threads,bool is_plugins){ if (m_server_pool[i].is_valid(num_threads, is_plugins)==false) return false; } + return true; } -- cgit 1.2.3-korg