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
Simonstrator
PeerfactSim.KOM
Commits
a3354fc8
Commit
a3354fc8
authored
Jan 05, 2016
by
Björn Richerzhagen
Browse files
5G-Topo: Set the Max-BW reported by the MAC layer for application use
parent
66612d42
Changes
1
Hide whitespace changes
Inline
Side-by-side
src/de/tud/kom/p2psim/impl/topology/views/FiveGTopologyView.java
View file @
a3354fc8
...
...
@@ -35,6 +35,7 @@ import de.tud.kom.p2psim.api.topology.waypoints.WaypointModel;
import
de.tud.kom.p2psim.impl.topology.PositionVector
;
import
de.tud.kom.p2psim.impl.topology.views.FiveGTopologyView.CellLink
;
import
de.tud.kom.p2psim.impl.topology.views.fiveg.FiveGTopologyDatabase
;
import
de.tud.kom.p2psim.impl.topology.views.fiveg.FiveGTopologyDatabase.Entry
;
import
de.tudarmstadt.maki.simonstrator.api.Event
;
import
de.tudarmstadt.maki.simonstrator.api.EventHandler
;
import
de.tudarmstadt.maki.simonstrator.api.Host
;
...
...
@@ -230,6 +231,40 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
databaseAccessPoints
.
getEntryFor
(
segId
,
false
)
!=
null
);
}
}
/*
* FIXME the not-so-elegant approach of updating all max-BWs
*/
for
(
MacAddress
mobileClient
:
mobileClientsList
)
{
updateMaxMacBandwidth
(
mobileClient
);
}
}
/**
* FIXME this is currently needed to keep the max upload bandwidth reported
* by MOBILE-mac (UMTS) consistent with the bandwidth of the given cell. It
* always reports the BW that can be achieved when sending via MOBILE to the
* cloud (NOT to cloudlets).
*
* @param macAddr
*/
private
void
updateMaxMacBandwidth
(
MacAddress
macAddr
)
{
// FIXME workaround for MAC bandwidth updates.
// Sets the initial max upload BW to the cloud (not to cloudlets!)
MacLayer
mac
=
getMac
(
macAddr
);
PositionVector
pos
=
mac
.
getHost
().
getTopologyComponent
()
.
getRealPosition
();
int
segId
=
database
.
getSegmentID
(
pos
.
getX
(),
pos
.
getY
());
Entry
usedEntry
=
database
.
getEntryFor
(
segId
,
false
);
if
(
mobileClientsUsingAccessPoints
.
contains
(
macAddr
))
{
int
apSegId
=
databaseAccessPoints
.
getSegmentID
(
pos
.
getX
(),
pos
.
getY
());
Entry
apEntry
=
databaseAccessPoints
.
getEntryFor
(
apSegId
,
false
);
usedEntry
=
(
apEntry
!=
null
?
apEntry
:
usedEntry
);
}
mac
.
getMaxBandwidth
().
setUpBW
(
usedEntry
.
getBandwidth
(
true
));
mac
.
getMaxBandwidth
().
setDownBW
(
usedEntry
.
getBandwidth
(
false
));
}
@Override
...
...
@@ -410,6 +445,10 @@ public class FiveGTopologyView extends AbstractTopologyView<CellLink> {
return
isCloudlet
;
}
public
boolean
isUpload
()
{
return
isUpload
;
}
@Override
public
long
getBandwidth
(
boolean
isBroadcast
)
{
assert
(
apLinkData
!=
null
&&
supportsAccessPoints
)
...
...
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