topologygenerator 0.0.14 → 0.0.15

Sign up to get free protection for your applications and to get access to all the features.
checksums.yaml CHANGED
@@ -1,7 +1,7 @@
1
1
  ---
2
2
  SHA1:
3
- metadata.gz: aebf02d9e22bc33b8e03d2e2f01e3ace4688921b
4
- data.tar.gz: 900b820d45f14d763911c2f7327989f04e80c390
3
+ metadata.gz: f6079c6feadcbc819158e4425af26a579aa82f7b
4
+ data.tar.gz: e80790da8c02b2916641529e03a418da66215b24
5
5
  SHA512:
6
- metadata.gz: 220e81ed264452e49adbbea34119c16d938a6a21518d545785044784637e10156c37cffefa7a36f21a0cfbe32c60a8d1adf040a9750e7345902e2f7a80e469a3
7
- data.tar.gz: 54f68692e12491fd4f8e5ab19289be0859917ca3e576793ef9a8d1e41565aa281c977a44507635d834f43b4d0ce5aa2d9b0b2a64f03fa973a3b137b08c9e1db6
6
+ metadata.gz: 0587b090cec4763a4a1bb032e0140d20e3c08f96cee444575fdf8c44a2660e55e3371c5ea8fad19ad253cb0d9c589a3f750abe2b30649ea1e3bfb48ae230cb77
7
+ data.tar.gz: 54ea307fe7cdd2913c63d2546c22d7119421ed8d790001e0856def12146a9735021d6a18ac0b85b33dc406e28b42fc8b04d0743176fbb8fe983bd9088ff45e06
data/README.md CHANGED
@@ -30,6 +30,8 @@ https://github.com/andyLaurito92/haikunet
30
30
 
31
31
  ## Installation
32
32
 
33
+ ### As a gem
34
+
33
35
  Add this line to your application's Gemfile:
34
36
 
35
37
  ```ruby
@@ -44,6 +46,14 @@ Or install it yourself as:
44
46
 
45
47
  $ gem install topologygenerator
46
48
 
49
+ ### As a binary
50
+
51
+ Run the following command in your command line
52
+
53
+ ```bash
54
+ \curl -sSL https://raw.githubusercontent.com/andyLaurito92/topologygenerator/master/install_topologygenerator.sh | bash
55
+ ```
56
+
47
57
  ## Usage
48
58
 
49
59
  For using the topologygenerator gem, you will need to write your output builder, and specify the uri from where the initial topology information will be get.
@@ -0,0 +1,19 @@
1
+ #!/bin/bah
2
+
3
+ WGET_INSTALLED=$(which wget)
4
+ if [ -z "${WGET_INSTALLED// }" ]
5
+ then
6
+ apt-get install wget
7
+ fi
8
+
9
+ wget -L https://github.com/andyLaurito92/topologygenerator/archive/master.tar.gz ; mkdir -p topologygenerator && tar xf master.tar.gz -C topologygenerator --strip-components=1
10
+ rm master.tar.gz
11
+ rm master.tar.gz.1
12
+
13
+ cd topologygenerator
14
+
15
+ #Add directory to $PATH
16
+ TOPOLOGYGENERATOR_DIRECTORY=$(pwd)
17
+ echo "export PATH=\"$PATH:$TOPOLOGYGENERATOR_DIRECTORY/lib\" # Adding Topologygenerator's directory to your PATH variable" >> ~/.bashrc
18
+
19
+ source ~/.bashrc
@@ -4,7 +4,7 @@ require_relative 'command_line/command_line_arguments.rb'
4
4
  require_relative "topologygenerator.rb"
5
5
  require 'colorize'
6
6
 
7
- #begin
7
+ begin
8
8
  my_command_line_arguments = CommandLineArguments.new
9
9
  my_command_line_arguments.run
10
10
 
@@ -15,7 +15,7 @@ require 'colorize'
15
15
  "uri_resource" => my_command_line_arguments.uri_resource
16
16
  })
17
17
  topo_gen.generate
18
- #rescue Exception => ex
19
- # puts "#{ex.class}".red
20
- # puts "#{ex.message}".blue
21
- #end
18
+ rescue Exception => ex
19
+ puts "#{ex.class}".red
20
+ puts "#{ex.message}".blue
21
+ end
@@ -8,8 +8,8 @@ module FlowConcreteBuilder
8
8
  def build_scilab_definition
9
9
  scilab_flows_definition = ''
10
10
  scilab_flows_definition += "\n"
11
- scilab_flows_definition += build_parameter_flow_distribution 'periodDistribution', distribution_rate
12
- scilab_flows_definition += build_parameter_flow_distribution 'packetSizeDistribution', distribution_size
11
+ scilab_flows_definition += build_parameter_flow_distribution 'period', distribution_rate
12
+ scilab_flows_definition += build_parameter_flow_distribution 'packetSize', distribution_size
13
13
  scilab_flows_definition
14
14
  end
15
15
 
@@ -35,20 +35,51 @@ module FlowConcreteBuilder
35
35
  scilab_flow_parameter_distribution = "flow#{@id}.#{distribution_name} = DISTRIBUTION_SPLIT;\n"
36
36
  scilab_flow_parameter_distribution += "flow#{@id}.#{distribution_name}_shape = #{distribution_variable.shape}; \n"
37
37
  scilab_flow_parameter_distribution += "flow#{@id}.#{distribution_name}_scale = #{distribution_variable.scale}; \n"
38
+ when FelixDistribution
39
+ scilab_flow_parameter_distribution = "flow#{@id}.#{distribution_name} = DISTRIBUTION_FELIX;\n"
40
+ scilab_flow_parameter_distribution += get_string_parameters_from (build_parameter_flow_distribution '', distribution_variable.period), "flow#{@id}.#{distribution_name}_period"
41
+ scilab_flow_parameter_distribution += "flow#{@id}.#{distribution_name}_mode = #{distribution_variable.mode}; \n"
42
+ if distribution_variable.mode == FelixDistribution::FELIX_MODE_HIGH_THROUGHOUT
43
+ scilab_flow_parameter_distribution += get_string_parameters_from (build_parameter_flow_distribution '', distribution_variable.size_bytes), "flow#{@id}.#{distribution_name}_size_bytes"
44
+ scilab_flow_parameter_distribution += "flow#{@id}.#{distribution_name}_buffer_bytes = #{distribution_variable.buffer_bytes}; \n"
45
+ scilab_flow_parameter_distribution += "flow#{@id}.#{distribution_name}_timeout = #{distribution_variable.timeout}; \n"
46
+ scilab_flow_parameter_distribution += "flow#{@id}.#{distribution_name}_out_size_bytes = #{distribution_variable.out_size_bytes}; \n"
47
+ end
38
48
  else
39
49
  raise "Distribution provided has a class which was unexpected. Class was: #{distribution_variable.class}"
40
50
  end
41
51
  scilab_flow_parameter_distribution
42
52
  end
43
53
 
54
+ def get_string_parameters_from(flow_definition_string, name_of_flow)
55
+ output = ''
56
+ flow_definition_lines = flow_definition_string.split "\n"
57
+ distribution_line = flow_definition_lines.shift
58
+ distribution_name = (distribution_line.split "=").last.gsub /\s+/, ""
59
+ distribution_name.gsub! ';', ''
60
+ output += "#{name_of_flow} = #{distribution_name};\n"
61
+ flow_definition_lines.each do |flow_definition_line|
62
+ flow_definition_line.gsub( /\s+/, "" )
63
+ flow_definition_line.gsub! 'flow.', ''
64
+ flow_definition_line.gsub! '\n', ''
65
+ flow_definition_line.gsub! '_', ''
66
+ flow_definition_line.gsub! ';', ''
67
+ flow_definition_line.gsub! /\/\/.*/,'' #Remove comment from line
68
+ key_and_value = flow_definition_line.split '='
69
+ key_and_value.first.gsub! /.*\./, ''
70
+ output += "#{name_of_flow}_#{key_and_value.first} = #{key_and_value.last};\n"
71
+ end
72
+ output
73
+ end
74
+
44
75
  def build_cplusplus_definition
45
76
  start_time_of_flow = 0
46
77
  # flow
47
78
  cplusplus_flows_definition = "\n"
48
79
  cplusplus_flows_definition += "\t ///// definition of flow #{@id} \n"
49
- cplusplus_flows_definition += "\t auto flow#{@id}PeriodDistribution = readDistributionParameter(\"flow#{@id}.periodDistribution\"); \n"
50
- cplusplus_flows_definition += "\t auto flow#{@id}PacketSizeDistribution = readDistributionParameter(\"flow#{@id}.packetSizeDistribution\"); \n"
51
- cplusplus_flows_definition += "\t auto flow#{@id} = std::make_shared<Flow>(\"#{@id}\", #{start_time_of_flow} /*startTime*/, #{priority} /*typeOfService*/, flow#{@id}PeriodDistribution, flow#{@id}PacketSizeDistribution); \n"
80
+ cplusplus_flows_definition += "\t auto flow#{@id}Period = readDistributionParameter(\"flow#{@id}.period\"); \n"
81
+ cplusplus_flows_definition += "\t auto flow#{@id}PacketSize = readDistributionParameter(\"flow#{@id}.packetSize\"); \n"
82
+ cplusplus_flows_definition += "\t auto flow#{@id} = std::make_shared<Flow>(\"#{@id}\", #{start_time_of_flow} /*startTime*/, #{priority} /*typeOfService*/, flow#{@id}Period, flow#{@id}PacketSize); \n"
52
83
 
53
84
  #routes
54
85
  cplusplus_flows_definition += "\t // routes for flow #{@id} \n"
@@ -148,7 +148,7 @@ module OutputConcreteBuilder
148
148
  }
149
149
  Parameters
150
150
  {
151
- Run at Init = Str; exec('#{File.absolute_path(@output_directory)}/Scilab/model.scilabParams', 0) ; Scilab Job at Init
151
+ Run at Init = Str; exec('../examples/PhaseI_topologies/lar_with_hlt/model.scilabParams', 0) ; Scilab Job at Init
152
152
  Run at External = Str; ; Scilab Job when receive event
153
153
  Run at Exit = Str; ; Scilab Job at Exit
154
154
  }
@@ -216,9 +216,9 @@ module OutputConcreteBuilder
216
216
  }
217
217
  Parameters
218
218
  {
219
- initSimulationCommandName = Str; #{File.absolute_path(@output_directory)}/Scilab/firstSimulation.sce ;
220
- eachSimulationCommandName = Str; #{File.absolute_path(@output_directory)}/Scilab/eachSimulation.sce ;
221
- lastSimulationCommandName = Str; #{File.absolute_path(@output_directory)}/Scilab/lastSimulation.sce ;
219
+ initSimulationCommandName = Str; ../examples/PhaseI_topologies/lar_with_hlt/firstSimulation.sce ;
220
+ eachSimulationCommandName = Str; ../examples/PhaseI_topologies/lar_with_hlt/eachSimulation.sce ;
221
+ lastSimulationCommandName = Str; ../examples/PhaseI_topologies/lar_with_hlt/lastSimulation.sce ;
222
222
  }
223
223
  }
224
224
  }
@@ -10,22 +10,22 @@ class CommandLineArguments
10
10
  def run
11
11
  program :name, 'Create PowerDevs topology'
12
12
  program :version, '0.0.1'
13
- program :description, 'Script for creating PowerDevs topology. The output will be a .pdm file'
13
+ program :description, 'Tool for retrieving topologies from a specific target and serialize it into a specific output format'
14
14
  program :help, 'Author', 'Andrés Laurito && Matias Bonaventura'
15
15
 
16
16
  my_command_line_argument = self
17
17
 
18
18
  my_command = command :source do |c|
19
- c.syntax = 'createTopology source [OPTIONS]'
20
- c.summary = 'Specify data source for retrieving the topology'
19
+ c.syntax = 'Topologygenerator source [OPTIONS]'
20
+ c.summary = 'Specify the name of the source from where to retrieve the topology, the output directory,
21
+ the URI used to get the topology and the directory of where the builders are located.'
21
22
  c.description = 'Specify the data source from where the topology should be retrieved
22
- An example of use: createTopology source ONOS
23
- By default, the option is set in CUSTOM.
24
- You can also set the output file with the -f option. For example, createTopology source ONOS -f topology
25
- By default, the output will be written in a file called my_topology'
26
- c.example 'Set ONOS as source', 'createTopology source -n ONOS'
27
- c.example 'Set CUSTOM as source', 'createTopology source -n CUSTOM'
28
- c.example 'Set CUSTOM as source and called the output file my_file', 'createTopology source -n MOCK -f my_file'
23
+ An example of use: Topologygenerator source -n ONOS -o output -u http://127.0.0.1:8181/onos/v1/ -d builders_examples/ruby_builders
24
+ By default, the option is set in CUSTOM.
25
+ By default, the output will be written in a file called my_topology'
26
+ c.example 'Set ONOS as source', 'Topologygenerator source -n ONOS'
27
+ c.example 'Set CUSTOM as source', 'Topologygenerator source -n CUSTOM'
28
+ c.example 'Set CUSTOM as source and called the output file my_file', 'Topologygenerator source -n MOCK -o my_file.txt'
29
29
  c.option '-n', '--name NAME', String, 'Specify the source name'
30
30
  c.option '-o', '--outDir NAME', String, 'Specify the output directory path'
31
31
  c.option '-u', '--uri NAME', String, 'Specify the uri for the source'
@@ -0,0 +1,17 @@
1
+ require_relative 'normal_distribution.rb'
2
+
3
+ class FelixDistribution
4
+ FELIX_MODE_HIGH_THROUGHOUT = "FELIX_MODE_HIGH_THROUGHOUT"
5
+ FELIX_MODE_LOW_LATENCY = "FELIX_MODE_LOW_LATENCY"
6
+
7
+ attr_reader :period, :mode, :size_bytes, :buffer_bytes, :timeout, :out_size_bytes
8
+
9
+ def initialize(period, mode, size_bytes = nil, buffer_bytes = nil, timeout = nil, out_size_bytes = nil)
10
+ @period = period #its the distribution of the message period arriving at the GBT link
11
+ @mode = mode #Its either FELIX_MODE_LOW_LATENCY or FELIX_MODE_HIGH_THROUGHPUT
12
+ @size_bytes = size_bytes || (NormalDistribution.new "4*k", "1*k") #Its a distribution of the message size arriving at the GBT link
13
+ @buffer_bytes = buffer_bytes || "1 * M"
14
+ @timeout = timeout || 1
15
+ @out_size_bytes = out_size_bytes || "TCP_MTU_bytes"
16
+ end
17
+ end
@@ -4,6 +4,7 @@ require_relative '../../flows_distributions/exponential_distribution.rb'
4
4
  require_relative '../../flows_distributions/normal_distribution.rb'
5
5
  require_relative '../../flows_distributions/pareto_distribution.rb'
6
6
  require_relative '../../flows_distributions/split_distribution.rb'
7
+ require_relative '../../flows_distributions/felix_distribution.rb'
7
8
 
8
9
  class Flow
9
10
  include SerializeBehavior
@@ -15,8 +16,8 @@ class Flow
15
16
  raise "Invalid 'paths' argument received. 'paths' must be an instance of Arry class, however the path received has class #{paths.class}" unless paths.is_a? Array
16
17
  raise "Invalid 'distribution_rate' received. Distribution rate cannot be nil" unless distribution_rate
17
18
  raise "Invalid 'distribution_size' received. Distribution size cannot be nil" unless distribution_size
18
- raise "Invalid 'distribution_rate' #{distribution_rate}. It is expected that the rate is an instance of a distribution" unless [ConstantDistribution, ExponentialDistribution, NormalDistribution, ParetoDistribution, SplitDistribution].include? distribution_rate.class
19
- raise "Invalid 'distribution_size' #{distribution_size}. It is expected that the size is an instance of a distribution" unless [ConstantDistribution, ExponentialDistribution, NormalDistribution, ParetoDistribution, SplitDistribution].include? distribution_size.class
19
+ raise "Invalid 'distribution_rate' #{distribution_rate}. It is expected that the rate is an instance of a distribution" unless [ConstantDistribution, ExponentialDistribution, NormalDistribution, ParetoDistribution, SplitDistribution, FelixDistribution].include? distribution_rate.class
20
+ raise "Invalid 'distribution_size' #{distribution_size}. It is expected that the size is an instance of a distribution" unless [ConstantDistribution, ExponentialDistribution, NormalDistribution, ParetoDistribution, SplitDistribution, FelixDistribution].include? distribution_size.class
20
21
 
21
22
  @id = id
22
23
  @priority = priority
@@ -0,0 +1,138 @@
1
+ # topology plotted here: https://docs.google.com/presentation/d/1N5GnG82JvsASUJ6sl-gmuMBRjMWG6OWtybIjOMikb-M/edit#slide=id.p
2
+
3
+ module NetworkTopology
4
+ # constants
5
+ K = 1000 # Kilo=10³
6
+ M = 1000 * K # Megas=10⁶
7
+ G = 1000 * M # Megas=10⁶
8
+
9
+ TCP_MTU_bytes = 1500 # (in bytes)
10
+
11
+ # parameters
12
+ NUMBER_OF_FELIX_SERVERS = 13 # this generates 1:1 connections with sw_rod, so NUMBER_OF_FELIX_SERVERS=numberOfSWRODServers
13
+ #NUMBER_OF_FELIX_SERVERS = 3 # this generates 1:1 connections with sw_rod, so NUMBER_OF_FELIX_SERVERS=numberOfSWRODServers
14
+ NUMBER_OF_MONITORING_SERVERS = 5
15
+ LINK_BW_40G_BITS_S = 40 * G # 40 Gbps
16
+ LINK_BW_10G_BITS_S = 1 * G # 10 Gbps
17
+ FELIX_FLOW_PRIORITY = 0
18
+ FELIX_GBT_ELINKS = 10 # #GBT e-links in each felix server. There will be one flow created per e-link (because there will be 1 thread, one connection per e-link)
19
+
20
+ # felix data-flow distributions (one per GBT)
21
+ FELIX_GBT_PERIOD_sec = ExponentialDistribution.new 1.0 / (100*K) # distribution period in seconds
22
+ #FELIX_GBT_PERIOD_sec = ExponentialDistribution.new 1.0 / (100) #TODO: this is just for testing quick simulations. Normal rate should be 100*k
23
+ FELIX_GBT_SIZE_bytes = NormalDistribution.new 4.0*K, 1.0*K # (in bytes)
24
+ FELIX_GBT_BUFFER_bytes = 1*M # (in bytes)
25
+ FELIX_GBT_TIME_OUT_sec = 2 # (in seconds)
26
+ FELIX_GBT_OUT_SIZE_bytes = TCP_MTU_bytes # (in bytes)
27
+
28
+ #FELIX_GENERATION_PERIOD = ExponentialDistribution.new (1.0 * FELIX_GBT_ELINKS) / (70*M) # distribution period in seconds
29
+ #FELIX_GENERATION_PERIOD = ExponentialDistribution.new (1.0 * FELIX_GBT_ELINKS) / (1*M) # distribution period in seconds
30
+ #FELIX_GENERATION_SIZE = ConstantDistribution.new 1.0*K #distribution size in bits
31
+ FELIX_GENERATION_PERIOD = FelixDistribution.new FELIX_GBT_PERIOD_sec,
32
+ FelixDistribution::FELIX_MODE_HIGH_THROUGHOUT,
33
+ FELIX_GBT_SIZE_bytes,
34
+ FELIX_GBT_BUFFER_bytes,
35
+ FELIX_GBT_TIME_OUT_sec,
36
+ FELIX_GBT_OUT_SIZE_bytes
37
+ FELIX_GENERATION_SIZE = ConstantDistribution.new TCP_MTU_bytes*8 #distribution size in bits
38
+
39
+ # monitoring flows (one per GBT)
40
+ FELIX_MONITORING_PRIORITY = 0
41
+ MONITORING_SIZE_bits = (TCP_MTU_bytes - 300)*8
42
+ TOTAL_MONITORING_PER_SERVER_bits = 0.8 * G
43
+ MONITORING_GENERATION_PERIOD = ExponentialDistribution.new 1.0 / (TOTAL_MONITORING_PER_SERVER_bits / (MONITORING_SIZE_bits * FELIX_GBT_ELINKS))
44
+ MONITORING_GENERATION_SIZE = NormalDistribution.new MONITORING_SIZE_bits, 300*8 #distribution size in bits
45
+
46
+ def get_topology
47
+ return @topology.topology_elements if @topology.topology_elements.size != 0
48
+
49
+ @felix_servers = []
50
+ @sw_rod_servers = []
51
+ @routers = []
52
+ @links = []
53
+ @monitoring_servers = []
54
+
55
+
56
+ # switches & routers
57
+ @routers.push @topology.add_router "lar_switch_01", [1]
58
+ @routers.push @topology.add_router "lar_switch_02", [1]
59
+ @routers.push @topology.add_router "felix_core_01", [1] # core_01 router in the felix network (connection out of USA15)
60
+ @routers.push @topology.add_router "felix_core_02", [1] # core_01 router in the felix network (connection out of USA15)
61
+ @routers.push @topology.add_router "hlt_core_01", [1] # core_01 router in the HLT network (connection into of SDX1)
62
+ @routers.push @topology.add_router "hlt_core_02", [1] # core_02 router in the HLT network (connection into of SDX1)
63
+
64
+ # Felix servers
65
+ for i in 0..NUMBER_OF_FELIX_SERVERS-1
66
+ @felix_servers.push @topology.add_host "lar_felix_#{i}"
67
+
68
+ # connected to both switches
69
+ @links.push @topology.add_link "link_felix#{i}_switch1", @felix_servers[i], 0, @routers[0], i+1, LINK_BW_40G_BITS_S # lar_felix_{i} --> lar_switch_01
70
+ @links.push @topology.add_link "link_felix#{i}_switch2", @felix_servers[i], 1, @routers[1], i+1, LINK_BW_40G_BITS_S # lar_felix_{i} --> lar_switch_02
71
+ end
72
+
73
+ # SWROD servers
74
+ for i in 0..NUMBER_OF_FELIX_SERVERS-1
75
+ @sw_rod_servers.push @topology.add_host "lar_swrod_#{i}"
76
+
77
+ # connected to both switches
78
+ @links.push @topology.add_link "link_switch1_swrod#{i}", @routers[0], i+1, @sw_rod_servers[i], 0, LINK_BW_40G_BITS_S # lar_switch_01 --> lar_swrod_{i}
79
+ @links.push @topology.add_link "link_switch2_swrod#{i}", @routers[1], i+1, @sw_rod_servers[i], 1, LINK_BW_40G_BITS_S # lar_switch_02 --> lar_swrod_{i}
80
+ end
81
+
82
+ # links between the switches and routers (only 1 link as they will be active-backup: there will be physically 2 links but only one active)
83
+ @links.push @topology.add_link "link_sw1_core1", @routers[0], 0, @routers[2], 0, LINK_BW_40G_BITS_S # lar_switch_1 --> lar_core_1
84
+ @links.push @topology.add_link "link_sw2_core2", @routers[1], 0, @routers[3], 0, LINK_BW_40G_BITS_S # lar_switch_2 --> lar_core_2
85
+ @links.push @topology.add_link "link_core1_hltcore1", @routers[2], 0, @routers[4], 0, LINK_BW_40G_BITS_S # lar_core_1 --> hlt_core_1
86
+ @links.push @topology.add_link "link_core2_hltcore2", @routers[3], 0, @routers[5], 0, LINK_BW_40G_BITS_S # lar_core_2 --> hlt_core_2
87
+
88
+ # Monitoring servers
89
+ for i in 0..NUMBER_OF_MONITORING_SERVERS-1
90
+ @monitoring_servers.push @topology.add_host "lar_mon_#{i}"
91
+
92
+ # connected to 1 hlt_core (the other link will be backup (inactive) )
93
+ #if i % 2 == 0 then hlt_core_index = 1 else hlt_core_index = 2 end # half the monitoring servers will be connected to one core (hltcore_1), the others will be connected to the other (hltcore_2)
94
+ #TODO: we add both links, but only 1 will be used (see flow definitions)
95
+ @links.push @topology.add_link "link_htlcore1_mon#{i}", @routers[4], i, @monitoring_servers[i], 0, LINK_BW_10G_BITS_S # hlt_core1 --> mon_{i}
96
+ @links.push @topology.add_link "link_htlcore2_mon#{i}", @routers[5], i, @monitoring_servers[i], 1, LINK_BW_10G_BITS_S # hlt_core2 --> mon_{i}
97
+ end
98
+
99
+
100
+ # flow 1Felix:1ROD
101
+ add_flows_oneFelix_to_oneSWROD
102
+
103
+ print ("finished the topology specification \n")
104
+ @topology.topology_elements
105
+ end
106
+
107
+ def add_flows_oneFelix_to_oneSWROD
108
+ # data-flow Flows for each felix server
109
+ @felix_servers.each_with_index do |felix,index|
110
+ # NFelix:1mon: A group of N felix servers will always talk with the same mon server. N=#felix/#mon
111
+ monServer_index = index % NUMBER_OF_MONITORING_SERVERS # first N will all go to different mon. Then, with n+1, it starts again.
112
+
113
+ # each felix will have 1 data-flow and 1 monitoring-flow per e-link
114
+ for eLinkIndex in 0..FELIX_GBT_ELINKS-1
115
+ # Data-Flow path
116
+ path = Path.new felix, @sw_rod_servers[index]
117
+ if eLinkIndex % 2 == 0 then switchIndex = 1 else switchIndex = 2 end # half the flows with go one path (switch_1), the other will go the other path (switch_2)
118
+ path.add_link @topology.get_element_by_id "link_felix#{index}_switch#{switchIndex}" # felix{i} -> switch_{1/2}
119
+ path.add_link @topology.get_element_by_id "link_switch#{switchIndex}_swrod#{index}" # switch_1 --> lar_swrod{i}
120
+
121
+ @topology.add_flow "Flow#{index}_#{eLinkIndex}", FELIX_FLOW_PRIORITY, [path], FELIX_GENERATION_PERIOD, FELIX_GENERATION_SIZE
122
+
123
+ # Monitoring-flow path will go always to same monServer, but half by switch_1 and half by switch_2
124
+ path = Path.new felix, @sw_rod_servers[index]
125
+ path.add_link @topology.get_element_by_id "link_felix#{index}_switch#{switchIndex}" # felix{i} -> switch_{1/2}
126
+ path.add_link @topology.get_element_by_id "link_sw#{switchIndex}_core#{switchIndex}" # switch_{1/2} --> lar_core{1/2}
127
+ path.add_link @topology.get_element_by_id "link_core#{switchIndex}_hltcore#{switchIndex}" # lar_core{1/2} --> hlt_core{1/2}
128
+ path.add_link @topology.get_element_by_id "link_htlcore#{switchIndex}_mon#{monServer_index}" # hlt_core{1/2} --> mon{monServer_index}
129
+
130
+ @topology.add_flow "FlowMon#{index}_#{eLinkIndex}", FELIX_MONITORING_PRIORITY, [path], MONITORING_GENERATION_PERIOD, MONITORING_GENERATION_SIZE
131
+ end
132
+ end
133
+ end
134
+
135
+ def get_path_between(source, destination)
136
+ raise NotImplementedError, "NetworkTopology: This method is not implemented (¿does it ever get called?)"
137
+ end
138
+ end
@@ -5,7 +5,7 @@ module NetworkTopology
5
5
  G = 1000 * M # Megas=10⁶
6
6
 
7
7
  # parameters
8
- NUMBER_OF_FELIX_SERVERS = 2 # this generates 1:1 connections with sw_rod, so NUMBER_OF_FELIX_SERVERS=numberOfSWRODServers
8
+ NUMBER_OF_FELIX_SERVERS = 13 # this generates 1:1 connections with sw_rod, so NUMBER_OF_FELIX_SERVERS=numberOfSWRODServers
9
9
  LINK_BW_BITS_S = 40 * G # 40 Gbps
10
10
  FELIX_GENERATION_PERIOD = ExponentialDistribution.new 1/10.0 # distribution period in seconds
11
11
  FELIX_GENERATION_SIZE = ConstantDistribution.new 1.0*K #distribution size in bits
@@ -0,0 +1,25 @@
1
+ module NetworkTopology
2
+ def get_topology
3
+ return @topology.topology_elements unless @topology.topology_elements.size == 0
4
+ hosts = []
5
+ router = @topology.add_router "Router1"
6
+ for i in 0..2
7
+ host = @topology.add_host "Host#{i}"
8
+ hosts.push host
9
+ end
10
+ bwith = 500*1000*1000
11
+ @topology.add_full_duplex_link "Link1", hosts[0], 0, router, 0, bwith
12
+ @topology.add_full_duplex_link "Link2", hosts[1], 0, router, 1, bwith
13
+ @topology.add_full_duplex_link "Link3", hosts[2], 0, router, 2, bwith
14
+ link1 = @topology.get_element_by_id "Link1_up"
15
+ link2 = @topology.get_element_by_id "Link3_down"
16
+ flow_1_path = Path.new hosts[0], hosts[2]
17
+ flow_1_path.add_link link1
18
+ flow_1_path.add_link link2
19
+ @topology.add_flow "Flow1", 10,
20
+ [flow_1_path],
21
+ (ExponentialDistribution.new 1.0/6875),
22
+ (ConstantDistribution.new 1000*8)
23
+ @topology.topology_elements
24
+ end
25
+ end
@@ -96,7 +96,7 @@ module NetworkTopology
96
96
 
97
97
  path = Path.new(source,destination)
98
98
  path.add_link first_link
99
- path.add_link second_link
99
+ path.add_link second_link unless first_link.dst_element == destination
100
100
  path
101
101
  end
102
102
  end
@@ -88,7 +88,8 @@ This is who it looks like the xml received by the opendaylight api
88
88
  if node['node-id'].include? 'openflow'
89
89
  @topology.add_router node['node-id']
90
90
  else
91
- @topology.add_host node['node-id'], node['ip'], node['mac']
91
+ node_info = node["host-tracker-service:addresses"].first
92
+ @topology.add_host node['node-id'], [node_info['ip']], node_info['mac']
92
93
  end
93
94
  end
94
95
 
@@ -1,3 +1,3 @@
1
1
  class Topologygenerator
2
- VERSION = "0.0.14"
2
+ VERSION = "0.0.15"
3
3
  end
metadata CHANGED
@@ -1,14 +1,14 @@
1
1
  --- !ruby/object:Gem::Specification
2
2
  name: topologygenerator
3
3
  version: !ruby/object:Gem::Version
4
- version: 0.0.14
4
+ version: 0.0.15
5
5
  platform: ruby
6
6
  authors:
7
7
  - Andrés Laurito
8
8
  autorequire:
9
9
  bindir: exe
10
10
  cert_chain: []
11
- date: 2016-12-12 00:00:00.000000000 Z
11
+ date: 2017-10-22 00:00:00.000000000 Z
12
12
  dependencies:
13
13
  - !ruby/object:Gem::Dependency
14
14
  name: bundler
@@ -108,6 +108,8 @@ files:
108
108
  - bin/console
109
109
  - bin/setup
110
110
  - images/topologygenerator.png
111
+ - install_topologygenerator.sh
112
+ - lib/Topologygenerator
111
113
  - lib/behaviors/serialize_behavior.rb
112
114
  - lib/builders_examples/pdm_builders/PhaseI/Flow_concrete_builder.rb
113
115
  - lib/builders_examples/pdm_builders/PhaseI/Host_concrete_builder.rb
@@ -126,9 +128,9 @@ files:
126
128
  - lib/builders_examples/ruby_builders/Router_concrete_builder.rb
127
129
  - lib/builders_examples/ruby_builders/output_concrete_builder.rb
128
130
  - lib/command_line/command_line_arguments.rb
129
- - lib/createTopology.rb
130
131
  - lib/flows_distributions/constant_distribution.rb
131
132
  - lib/flows_distributions/exponential_distribution.rb
133
+ - lib/flows_distributions/felix_distribution.rb
132
134
  - lib/flows_distributions/normal_distribution.rb
133
135
  - lib/flows_distributions/pareto_distribution.rb
134
136
  - lib/flows_distributions/split_distribution.rb
@@ -139,8 +141,10 @@ files:
139
141
  - lib/network_entities/physical/link.rb
140
142
  - lib/network_entities/physical/router.rb
141
143
  - lib/network_entities/topology.rb
144
+ - lib/network_topologies_examples/PhaseI_LAr_MonitoringHLT.rb
142
145
  - lib/network_topologies_examples/PhaseI_onlyLAr_1FelixTo1SWROD.rb
143
146
  - lib/network_topologies_examples/octopus_topology.rb
147
+ - lib/network_topologies_examples/paper_example.rb
144
148
  - lib/network_topologies_examples/phase1_topology_mininet/tdaq
145
149
  - lib/network_topologies_examples/phase1_topology_mininet/tdaq.py
146
150
  - lib/network_topologies_examples/sofisticated_octopus_topology.rb