From 7286b2518ec8e4398b512ce95def9166a7af2e4a Mon Sep 17 00:00:00 2001 From: Deepak S Date: Thu, 13 Jul 2017 21:26:50 -0700 Subject: Adding PROX(Packet pROcessing eXecution engine) VNF to sampleVNF JIRA: SAMPLEVNF-55 PROX is a DPDK-based application implementing Telco use-cases such as a simplified BRAS/BNG, light-weight AFTR... It also allows configuring finer grained network functions like QoS, Routing, load-balancing... (We are moving PROX version v039 to sampleVNF https://01.org/intel-data-plane-performance-demonstrators/prox-overview) Change-Id: Ia3cb02cf0e49ac5596e922c197ff7e010293d033 Signed-off-by: Deepak S --- VNFs/DPPD-PROX/flow_gen/README | 47 +++++++++ VNFs/DPPD-PROX/flow_gen/bundle_maker.lua | 94 +++++++++++++++++ VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.cfg | 150 ++++++++++++++++++++++++++++ VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.lua | 83 +++++++++++++++ 4 files changed, 374 insertions(+) create mode 100644 VNFs/DPPD-PROX/flow_gen/README create mode 100644 VNFs/DPPD-PROX/flow_gen/bundle_maker.lua create mode 100644 VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.cfg create mode 100644 VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.lua (limited to 'VNFs/DPPD-PROX/flow_gen') diff --git a/VNFs/DPPD-PROX/flow_gen/README b/VNFs/DPPD-PROX/flow_gen/README new file mode 100644 index 00000000..28f5d97c --- /dev/null +++ b/VNFs/DPPD-PROX/flow_gen/README @@ -0,0 +1,47 @@ +## +## Copyright (c) 2010-2017 Intel Corporation +## +## Licensed under the Apache License, Version 2.0 (the "License"); +## you may not use this file except in compliance with the License. +## You may obtain a copy of the License at +## +## http://www.apache.org/licenses/LICENSE-2.0 +## +## Unless required by applicable law or agreed to in writing, software +## distributed under the License is distributed on an "AS IS" BASIS, +## WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +## See the License for the specific language governing permissions and +## limitations under the License. +## + +While it is possible to manually run stateful traffic generation as +described below, it is recommended to use the provided dpi scripts +available in the help-scripts directory.. + +Before running flow based generation, a traffic profile needs to be +extracted and copied into this directory. This is done by running the +flow extract tool. An example of running the tool is shown below. For +more details on the flow extract tool, please read the provided help +by running the tool with the -h argument. + +./build/flowextract2 -s 500000 -i input.pcap -o output_directory + +After the output has been copied to this directory, the configuration +can be launched as shown below: + +./build/prox -f flow_gen/flow_gen_4ports.cfg -e \ + -q max_setup_rate=2000 \ + -q connections=50000 \ + -q ss=19.46 \ + -q test_system_id=0 + +The parameters provided through -q depend on the traffic profile. The +following command can be used to find the maximum value of ss: + +./build/prox -f flow_gen/flow_gen_4ports.cfg -e \ + -q max_ss_and_quit=true \ + -q test_system_id=0 + +This will cause prox to read the traffic profile, calculate the maximum +value and quit immediately. No packets will be sent and the value for +ss will be printed on stdout. diff --git a/VNFs/DPPD-PROX/flow_gen/bundle_maker.lua b/VNFs/DPPD-PROX/flow_gen/bundle_maker.lua new file mode 100644 index 00000000..ca24d4bb --- /dev/null +++ b/VNFs/DPPD-PROX/flow_gen/bundle_maker.lua @@ -0,0 +1,94 @@ +-- +-- Copyright (c) 2010-2017 Intel Corporation +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +function get_client_bundles(bundles) + local client_bundles = {}; + + for i,b in ipairs(bundles) do + client_bundles[i] = {bundle = b, imix_fraction = 1} + end + + return client_bundles; +end + +function get_server_streams(bundles) + local server_streams = {} + n_listen = 0 + for i, bundle in ipairs(bundles) do + for j, stream in ipairs(bundle) do + n_listen = n_listen + 1 + server_streams[n_listen] = stream + end + end + return server_streams; +end + +function setup_bundles(first_ip_byte, speed_scaling) + bundles = dofile("cfg.lua") + + local client_bundles = get_client_bundles(bundles); + local server_streams = get_server_streams(bundles); + + for i,e in ipairs(client_bundles) do + for j,stream in ipairs(e.bundle) do + stream.clients.ip[1] = first_ip_byte + stream.clients.port_mask = 0xffff + end + end + + for i,stream in ipairs(server_streams) do + stream.servers.ip[1] = first_ip_byte + end + + local highest_bps = 0; + for i,e in ipairs(client_bundles) do + for j,s in ipairs(e.bundle) do + if (s.up_bps ~= 1250000000 and s.dn_bps ~= 1250000000) then + if (highest_bps < s.up_bps) then + highest_bps = s.up_bps + end + if (highest_bps < s.dn_bps) then + highest_bps = s.dn_bps + end + end + end + end + + if (highest_bps == 0) then + highest_bps = 1250000000 + end + max_ss = 1250000000/highest_bps + + if (max_ss_and_quit == not nil and max_ss_and_quit == true) then + print("max ss=" .. max_ss .. "") + os.exit(0); + end + + if (speed_scaling > max_ss) then + error("Scaling too high (maximum scaling is " .. max_ss .. ")") + end + + for i,e in ipairs(client_bundles) do + for j,s in ipairs(e.bundle) do + if (s.up_bps ~= 1250000000 and s.dn_bps ~= 1250000000) then + s.up_bps = s.up_bps * speed_scaling; + s.dn_bps = s.dn_bps * speed_scaling; + end + end + end + + return client_bundles, server_streams +end diff --git a/VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.cfg b/VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.cfg new file mode 100644 index 00000000..ccac3eb7 --- /dev/null +++ b/VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.cfg @@ -0,0 +1,150 @@ +;; +;; Copyright (c) 2010-2017 Intel Corporation +;; +;; Licensed under the Apache License, Version 2.0 (the "License"); +;; you may not use this file except in compliance with the License. +;; You may obtain a copy of the License at +;; +;; http://www.apache.org/licenses/LICENSE-2.0 +;; +;; Unless required by applicable law or agreed to in writing, software +;; distributed under the License is distributed on an "AS IS" BASIS, +;; WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +;; See the License for the specific language governing permissions and +;; limitations under the License. +;; + +[eal options] +-n=4 ; force number of memory channels +no-output=no ; disable DPDK debug output + +[port 2] +name=port_a +mac=00:00:00:00:00:03 +rx desc=512 +tx desc=1024 +[port 3] +name=port_b +mac=00:00:00:00:00:04 +rx desc=512 +tx desc=1024 + +[port 4] +name=port_c +mac=00:00:00:00:00:01 +rx desc=512 +tx desc=1024 +[port 5] +name=port_d +mac=00:00:00:00:00:02 +rx desc=512 +tx desc=1024 + +[lua] +dofile("flow_gen_4ports.lua") +[variables] +$drop=no + +[defaults] +mempool size=$mempool_size + +[global] +start time=5 +name=L4 Gen + +[core 0s0] +mode=master + +[core 1s0] +task=0 +mode=lbpos +tx cores=$port_a_clients +rx port=port_a +mempool size=32K +mbuf size=2560 +byte offset=26 +drop=$drop +ring size=16384 + +[core 1s0h] +task=0 +mode=lbpos +tx cores=$port_b_servers +rx port=port_b +mbuf size=2560 +byte offset=26 +drop=$drop +ring size=16384 + +;;;------------------------------ + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[core $port_a_clients] +name=p0 +task=0 +mode=genl4 +tx port=port_a +rx ring=yes +bps=$bps +streams=c_${self} +concur conn=$conn +max setup rate=$msr + +[core $port_b_servers] +name=p0 +task=0 +mode=genl4 +sub mode=server +rx ring=yes +tx port=port_b +bps=$bps +streams=s_${self} +concur conn=$conn + +;;;;;;; socket 1 ;;;;;;;;;;;;;;;;;;;;;;; + +[core 1s1] +name=ld +task=0 +mode=lbpos +tx cores=$port_c_clients +rx port=port_c +mempool size=32K +mbuf size=2560 +byte offset=26 +drop=$drop +ring size=16384 + +[core 1s1h] +name=ld +task=0 +mode=lbpos +tx cores=$port_d_servers +rx port=port_d +mbuf size=2560 +byte offset=26 +drop=$drop +ring size=16384 + +;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;;; +[core $port_c_clients] +name=p0 +task=0 +mode=genl4 +tx port=port_c +rx ring=yes +bps=$bps +streams=c_${self} +concur conn=$conn +max setup rate=$msr + +[core $port_d_servers] +name=p0 +task=0 +mode=genl4 +sub mode=server +rx ring=yes +tx port=port_d +bps=$bps +streams=s_${self} +concur conn=$conn diff --git a/VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.lua b/VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.lua new file mode 100644 index 00000000..ed674ef6 --- /dev/null +++ b/VNFs/DPPD-PROX/flow_gen/flow_gen_4ports.lua @@ -0,0 +1,83 @@ +-- +-- Copyright (c) 2010-2017 Intel Corporation +-- +-- Licensed under the Apache License, Version 2.0 (the "License"); +-- you may not use this file except in compliance with the License. +-- You may obtain a copy of the License at +-- +-- http://www.apache.org/licenses/LICENSE-2.0 +-- +-- Unless required by applicable law or agreed to in writing, software +-- distributed under the License is distributed on an "AS IS" BASIS, +-- WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied. +-- See the License for the specific language governing permissions and +-- limitations under the License. +-- + +dofile("bundle_maker.lua") + +if (test_system_id == nil) then + error("test_system_id not set") +end + +offset = 8 * test_system_id + +c_2s0, s_3s0 = setup_bundles(128 + offset, ss) +c_4s0, s_5s0 = setup_bundles(129 + offset, ss) +c_2s0h, s_3s0h = setup_bundles(130 + offset, ss) +c_4s0h, s_5s0h = setup_bundles(131 + offset, ss) + +c_6s0, s_7s0 = setup_bundles(132 + offset, ss) +c_8s0, s_9s0 = setup_bundles(133 + offset, ss) +c_6s0h, s_7s0h = setup_bundles(134 + offset, ss) +c_8s0h, s_9s0h = setup_bundles(135 + offset, ss) + +---------------- + +c_2s1, s_3s1 = setup_bundles(64 + offset, ss) +c_4s1, s_5s1 = setup_bundles(65 + offset, ss) +c_2s1h, s_3s1h = setup_bundles(66 + offset, ss) +c_4s1h, s_5s1h = setup_bundles(67 + offset, ss) + +c_6s1, s_7s1 = setup_bundles(68 + offset, ss) +c_8s1, s_9s1 = setup_bundles(69 + offset, ss) +c_6s1h, s_7s1h = setup_bundles(70 + offset, ss) +c_8s1h, s_9s1h = setup_bundles(71 + offset, ss) + +if (max_setup_rate == nil) then + error("max_setup_rate not set") +end + +if (connections == nil) then + error("connections not set") +end + +port_a_clients="2s0,4s0,2s0h,4s0h,6s0,8s0,6s0h,8s0h" +port_b_servers="3s0,5s0,3s0h,5s0h,7s0,9s0,7s0h,9s0h" + + +port_c_clients="2s1,4s1,2s1h,4s1h,6s1,8s1,6s1h,8s1h" +port_d_servers="3s1,5s1,3s1h,5s1h,7s1,9s1,7s1h,9s1h" + +all_clients = port_a_clients + .. "," .. port_c_clients + +all_servers = port_b_servers + .. "," .. port_d_servers + +all_workers = all_clients .. "," .. all_servers + +all_ld = "1s0,1s0h,1s1,1s1h" + +client_port_count = 2; + +bps = 1250000000/task_count(port_a_clients) +msr = max_setup_rate/client_port_count/task_count(port_a_clients) +conn = connections/client_port_count/task_count(port_a_clients) + +mempool_size = connections +if (mempool_size > 100000) then + mempool_size = 100000 +elseif (mempool_size < 2048) then + mempool_size = 2048 +end -- cgit 1.2.3-korg