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
cb5b81f5
Commit
cb5b81f5
authored
Mar 04, 2024
by
Marvin Meiers
Committed by
Antoine Kaufmann
May 08, 2024
Browse files
experiments: further generalize setting of attributes in e2e framework
parent
b94393cf
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
with
45 additions
and
7 deletions
+45
-7
experiments/simbricks/orchestration/e2e_components.py
experiments/simbricks/orchestration/e2e_components.py
+44
-6
sims/external/ns-3
sims/external/ns-3
+1
-1
No files found.
experiments/simbricks/orchestration/e2e_components.py
View file @
cb5b81f5
...
@@ -192,7 +192,9 @@ class E2ESimpleChannel(E2ETopologyChannel):
...
@@ -192,7 +192,9 @@ class E2ESimpleChannel(E2ETopologyChannel):
super
().
__init__
(
idd
)
super
().
__init__
(
idd
)
self
.
type
=
"Simple"
self
.
type
=
"Simple"
self
.
data_rate
=
""
self
.
data_rate
=
""
self
.
queue_type
=
"ns3::DropTailQueue"
self
.
queue_size
=
""
self
.
queue_size
=
""
self
.
channel_type
=
"ns3::SimpleChannel"
self
.
delay
=
""
self
.
delay
=
""
self
.
left_node
:
E2ETopologyNode
self
.
left_node
:
E2ETopologyNode
self
.
right_node
:
E2ETopologyNode
self
.
right_node
:
E2ETopologyNode
...
@@ -201,14 +203,31 @@ class E2ESimpleChannel(E2ETopologyChannel):
...
@@ -201,14 +203,31 @@ class E2ESimpleChannel(E2ETopologyChannel):
if
self
.
left_node
is
None
or
self
.
right_node
is
None
:
if
self
.
left_node
is
None
or
self
.
right_node
is
None
:
raise
AttributeError
(
f
"Not all nodes for channel
{
self
.
id
}
given"
)
raise
AttributeError
(
f
"Not all nodes for channel
{
self
.
id
}
given"
)
self
.
mapping
.
update
({
self
.
mapping
.
update
({
"DataRate"
:
self
.
data_rate
,
"Device-DataRate"
:
self
.
data_rate
,
"QueueSize"
:
self
.
queue_size
,
"QueueType"
:
self
.
queue_type
,
"Delay"
:
self
.
delay
,
"Queue-MaxSize"
:
self
.
queue_size
,
"ChannelType"
:
self
.
channel_type
,
"Channel-Delay"
:
self
.
delay
,
"LeftNode"
:
self
.
left_node
.
id
,
"LeftNode"
:
self
.
left_node
.
id
,
"RightNode"
:
self
.
right_node
.
id
,
"RightNode"
:
self
.
right_node
.
id
,
})
})
return
super
().
ns3_config
()
return
super
().
ns3_config
()
def
add_device_attr
(
self
,
key
:
str
,
value
:
str
)
->
None
:
if
not
key
.
startswith
(
"Device-"
):
key
=
f
"Device-
{
key
}
"
self
.
mapping
.
update
({
key
:
value
})
def
add_queue_attr
(
self
,
key
:
str
,
value
:
str
)
->
None
:
if
not
key
.
startswith
(
"Queue-"
):
key
=
f
"Queue-
{
key
}
"
self
.
mapping
.
update
({
key
:
value
})
def
add_channel_attr
(
self
,
key
:
str
,
value
:
str
)
->
None
:
if
not
key
.
startswith
(
"Channel-"
):
key
=
f
"Channel-
{
key
}
"
self
.
mapping
.
update
({
key
:
value
})
class
E2ENetwork
(
E2EComponent
):
class
E2ENetwork
(
E2EComponent
):
...
@@ -293,7 +312,9 @@ class E2ESimpleNs3Host(E2EHost):
...
@@ -293,7 +312,9 @@ class E2ESimpleNs3Host(E2EHost):
super
().
__init__
(
idd
)
super
().
__init__
(
idd
)
self
.
type
=
"SimpleNs3"
self
.
type
=
"SimpleNs3"
self
.
data_rate
=
""
self
.
data_rate
=
""
self
.
queue_type
=
"ns3::DropTailQueue"
self
.
queue_size
=
""
self
.
queue_size
=
""
self
.
channel_type
=
"ns3::SimpleChannel"
self
.
delay
=
""
self
.
delay
=
""
self
.
congestion_control
:
CongestionControl
=
None
self
.
congestion_control
:
CongestionControl
=
None
self
.
ip
=
""
self
.
ip
=
""
...
@@ -304,14 +325,31 @@ class E2ESimpleNs3Host(E2EHost):
...
@@ -304,14 +325,31 @@ class E2ESimpleNs3Host(E2EHost):
else
:
else
:
cc
=
self
.
congestion_control
.
ns3
cc
=
self
.
congestion_control
.
ns3
self
.
mapping
.
update
({
self
.
mapping
.
update
({
"DataRate"
:
self
.
data_rate
,
"Device-DataRate"
:
self
.
data_rate
,
"QueueSize"
:
self
.
queue_size
,
"QueueType"
:
self
.
queue_type
,
"Delay"
:
self
.
delay
,
"Queue-MaxSize"
:
self
.
queue_size
,
"ChannelType"
:
self
.
channel_type
,
"Channel-Delay"
:
self
.
delay
,
"CongestionControl"
:
cc
,
"CongestionControl"
:
cc
,
"Ip"
:
self
.
ip
,
"Ip"
:
self
.
ip
,
})
})
return
super
().
ns3_config
()
return
super
().
ns3_config
()
def
add_device_attr
(
self
,
key
:
str
,
value
:
str
)
->
None
:
if
not
key
.
startswith
(
"Device-"
):
key
=
f
"Device-
{
key
}
"
self
.
mapping
.
update
({
key
:
value
})
def
add_queue_attr
(
self
,
key
:
str
,
value
:
str
)
->
None
:
if
not
key
.
startswith
(
"Queue-"
):
key
=
f
"Queue-
{
key
}
"
self
.
mapping
.
update
({
key
:
value
})
def
add_channel_attr
(
self
,
key
:
str
,
value
:
str
)
->
None
:
if
not
key
.
startswith
(
"Channel-"
):
key
=
f
"Channel-
{
key
}
"
self
.
mapping
.
update
({
key
:
value
})
class
E2EApplication
(
E2EComponent
):
class
E2EApplication
(
E2EComponent
):
...
...
ns-3
@
bcfb8f13
Compare
968e0ed2
...
bcfb8f13
Subproject commit
968e0ed2b2a1ef5303975e836481298e4ac60295
Subproject commit
bcfb8f13398889473a0965edde8ba1ae13c60496
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