Skip to content
GitLab
Menu
Projects
Groups
Snippets
Loading...
Help
Help
Support
Community forum
Keyboard shortcuts
?
Submit feedback
Contribute to GitLab
Sign in / Register
Toggle navigation
Menu
Open sidebar
ycai
simbricks
Commits
f82b5198
"examples/cpp/llama/start_ids.csv" did not exist on "720fc533da804ac3f46ee938864403e51fcd9fa7"
Commit
f82b5198
authored
Jan 17, 2024
by
Marvin Meiers
Committed by
Antoine Kaufmann
May 08, 2024
Browse files
experiments: add OnOff application to end-to-end framework
parent
1825c338
Changes
2
Show whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
120 additions
and
1 deletion
+120
-1
experiments/simbricks/orchestration/e2e_components.py
experiments/simbricks/orchestration/e2e_components.py
+119
-0
sims/external/ns-3
sims/external/ns-3
+1
-1
No files found.
experiments/simbricks/orchestration/e2e_components.py
View file @
f82b5198
...
@@ -353,6 +353,125 @@ class E2EBulkSendApplication(E2EApplication):
...
@@ -353,6 +353,125 @@ class E2EBulkSendApplication(E2EApplication):
return
super
().
ns3_config
()
return
super
().
ns3_config
()
class
E2ENs3RandomVariable
(
ABC
):
def
__init__
(
self
)
->
None
:
self
.
type_id
=
""
def
get_config
(
self
)
->
str
:
params
=
self
.
get_parameters
()
if
params
:
return
f
"
{
self
.
type_id
}
[
{
params
}
]"
else
:
return
self
.
type_id
@
abstractmethod
def
get_parameters
(
self
)
->
str
:
pass
class
E2ENs3ConstantRandomVariable
(
E2ENs3RandomVariable
):
def
__init__
(
self
)
->
None
:
super
().
__init__
()
self
.
type_id
=
"ns3::ConstantRandomVariable"
self
.
constant
:
tp
.
Optional
[
float
]
=
None
def
get_parameters
(
self
)
->
str
:
params
=
[]
if
self
.
constant
:
params
.
append
(
f
"Constant=
{
self
.
constant
}
"
)
return
"|"
.
join
(
params
)
class
E2ENs3UniformRandomVariable
(
E2ENs3RandomVariable
):
def
__init__
(
self
)
->
None
:
super
().
__init__
()
self
.
type_id
=
"ns3::UniformRandomVariable"
self
.
min
:
tp
.
Optional
[
float
]
=
None
self
.
max
:
tp
.
Optional
[
float
]
=
None
def
get_parameters
(
self
)
->
str
:
params
=
[]
if
self
.
min
:
params
.
append
(
f
"Min=
{
self
.
min
}
"
)
if
self
.
max
:
params
.
append
(
f
"Max=
{
self
.
max
}
"
)
return
"|"
.
join
(
params
)
class
E2ENs3ExponentialRandomVariable
(
E2ENs3RandomVariable
):
def
__init__
(
self
)
->
None
:
super
().
__init__
()
self
.
type_id
=
"ns3::ExponentialRandomVariable"
self
.
mean
:
tp
.
Optional
[
float
]
=
None
self
.
bound
:
tp
.
Optional
[
float
]
=
None
def
get_parameters
(
self
)
->
str
:
params
=
[]
if
self
.
mean
:
params
.
append
(
f
"Mean=
{
self
.
mean
}
"
)
if
self
.
bound
:
params
.
append
(
f
"Bound=
{
self
.
bound
}
"
)
return
"|"
.
join
(
params
)
class
E2ENs3NormalRandomVariable
(
E2ENs3RandomVariable
):
def
__init__
(
self
)
->
None
:
super
().
__init__
()
self
.
type_id
=
"ns3::NormalRandomVariable"
self
.
mean
:
tp
.
Optional
[
float
]
=
None
self
.
variance
:
tp
.
Optional
[
float
]
=
None
self
.
bound
:
tp
.
Optional
[
float
]
=
None
def
get_parameters
(
self
)
->
str
:
params
=
[]
if
self
.
mean
:
params
.
append
(
f
"Mean=
{
self
.
mean
}
"
)
if
self
.
variance
:
params
.
append
(
f
"Variance=
{
self
.
variance
}
"
)
if
self
.
bound
:
params
.
append
(
f
"Bound=
{
self
.
bound
}
"
)
return
"|"
.
join
(
params
)
class
E2EOnOffApplication
(
E2EApplication
):
def
__init__
(
self
,
idd
:
str
)
->
None
:
super
().
__init__
(
idd
)
self
.
type
=
"OnOff"
self
.
protocol
=
"ns3::TcpSocketFactory"
self
.
remote_ip
=
""
self
.
data_rate
=
""
self
.
max_bytes
=
""
self
.
packet_size
=
""
self
.
on_time
:
tp
.
Optional
[
E2ENs3RandomVariable
]
=
None
self
.
off_time
:
tp
.
Optional
[
E2ENs3RandomVariable
]
=
None
def
ns3_config
(
self
)
->
str
:
if
self
.
on_time
:
on
=
self
.
on_time
.
get_config
()
else
:
on
=
""
if
self
.
off_time
:
off
=
self
.
off_time
.
get_config
()
else
:
off
=
""
self
.
mapping
.
update
({
"Protocol"
:
self
.
protocol
,
"Remote"
:
self
.
remote_ip
,
"DataRate"
:
self
.
data_rate
,
"MaxBytes"
:
self
.
max_bytes
,
"PacketSize"
:
self
.
packet_size
,
"OnTime"
:
on
,
"OffTime"
:
off
,
})
return
super
().
ns3_config
()
class
E2EProbe
(
E2EComponent
):
class
E2EProbe
(
E2EComponent
):
def
__init__
(
self
,
idd
:
str
)
->
None
:
def
__init__
(
self
,
idd
:
str
)
->
None
:
...
...
ns-3
@
ae5aebc3
Compare
4d3b44a2
...
ae5aebc3
Subproject commit
4d3b44a2bb0898a5fe54a1ebac8eab4a93e50259
Subproject commit
ae5aebc3b3d373a9fa9adbf94a0e390faf0e49dc
Write
Preview
Markdown
is supported
0%
Try again
or
attach a new file
.
Attach a file
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Cancel
Please
register
or
sign in
to comment