Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
G
GNS3_unikernel_testbed
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
Artifacts
Deploy
Releases
Package registry
Container registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
NGUYEN Do Duc Anh
GNS3_unikernel_testbed
Commits
01415d04
Commit
01415d04
authored
3 weeks ago
by
NGUYEN Do Duc Anh
Browse files
Options
Downloads
Patches
Plain Diff
test udp traffic
parent
693fedcf
Branches
Branches containing commit
Tags
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
window/tcp_crash_listener.py
+5
-5
5 additions, 5 deletions
window/tcp_crash_listener.py
with
5 additions
and
5 deletions
window/tcp_crash_listener.py
+
5
−
5
View file @
01415d04
...
@@ -5,8 +5,7 @@ import queue
...
@@ -5,8 +5,7 @@ import queue
import
subprocess
import
subprocess
import
os
import
os
import
json
import
json
import
numpy
as
np
# import numpy as np
# import matplotlib.pyplot as plt
# import matplotlib.pyplot as plt
os
.
environ
[
"
LD_LIBRARY_PATH
"
]
=
"
/home/osboxes/D-ITG-2.8.1-r1023-src/D-ITG-2.8.1-r1023/bin:
"
+
os
.
environ
.
get
(
"
LD_LIBRARY_PATH
"
,
""
)
os
.
environ
[
"
LD_LIBRARY_PATH
"
]
=
"
/home/osboxes/D-ITG-2.8.1-r1023-src/D-ITG-2.8.1-r1023/bin:
"
+
os
.
environ
.
get
(
"
LD_LIBRARY_PATH
"
,
""
)
...
@@ -46,7 +45,7 @@ def generate_and_send_traffic_matrix():
...
@@ -46,7 +45,7 @@ def generate_and_send_traffic_matrix():
mean_rate
=
1000
mean_rate
=
1000
else
:
else
:
mean_rate
=
round
((
f
*
A
[
i
]
*
P_values
[
j
])
/
sum
(
P_values
)
+
((
1
-
f
)
*
A
[
j
]
*
P_values
[
i
])
/
sum
(
P_values
))
mean_rate
=
round
((
f
*
A
[
i
]
*
P_values
[
j
])
/
sum
(
P_values
)
+
((
1
-
f
)
*
A
[
j
]
*
P_values
[
i
])
/
sum
(
P_values
))
print
(
f
"
{
i
}
->
{
j
}
"
,
"
mean_rate
"
,
mean_rate
,
"
Ai
"
,
A
[
i
],
"
P_values j
"
,
P_values
[
j
],
"
P_values i
"
,
P_values
[
i
],
"
Aj
"
,
A
[
j
],
"
f
"
,
f
)
#
print(f"{i}->{j}", "mean_rate", mean_rate, "Ai", A[i], "P_values j", P_values[j], "P_values i", P_values[i], "Aj", A[j], "f", f)
traffic_matrix
[
point_ip_send
][
point_ip_recv
]
=
mean_rate
traffic_matrix
[
point_ip_send
][
point_ip_recv
]
=
mean_rate
...
@@ -56,9 +55,10 @@ def generate_and_send_traffic_matrix():
...
@@ -56,9 +55,10 @@ def generate_and_send_traffic_matrix():
if
src_ip
!=
dest_ip
:
if
src_ip
!=
dest_ip
:
with
open
(
file_path
,
"
w
"
)
as
file
:
with
open
(
file_path
,
"
w
"
)
as
file
:
dest_port
=
listen_port_map
[
dest_ip
]
dest_port
=
listen_port_map
[
dest_ip
]
command
=
f
"
-T UDP -a
{
dest_ip
}
-rp
{
dest_port
}
-O
{
mean_rate
}
-t
12
0000
"
command
=
f
"
-T UDP -a
{
dest_ip
}
-rp
{
dest_port
}
-O
{
mean_rate
}
-t
360
0000
"
listen_port_map
[
dest_ip
]
+=
1
listen_port_map
[
dest_ip
]
+=
1
file
.
write
(
f
"
{
src_ip
}
{
command
}
\n
"
)
file
.
write
(
f
"
{
src_ip
}
{
command
}
\n
"
)
print
(
command
)
if
dest_ip
not
in
trace_receive
:
if
dest_ip
not
in
trace_receive
:
trace_receive
[
dest_ip
]
=
0
trace_receive
[
dest_ip
]
=
0
...
@@ -162,7 +162,7 @@ def main():
...
@@ -162,7 +162,7 @@ def main():
A
[
i
]
+=
rate
A
[
i
]
+=
rate
A
[
j
]
+=
rate
A
[
j
]
+=
rate
scale_factor
=
5
0
00
/
max
(
A
)
scale_factor
=
6
500
/
max
(
A
)
for
i
in
range
(
len
(
A
)):
for
i
in
range
(
len
(
A
)):
A
[
i
]
*=
scale_factor
A
[
i
]
*=
scale_factor
print
(
f
"
A[
{
i
}
]
"
,
A
[
i
])
print
(
f
"
A[
{
i
}
]
"
,
A
[
i
])
...
...
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment