-
Notifications
You must be signed in to change notification settings - Fork 0
/
PriorityEtherHost.ned
58 lines (53 loc) · 1.98 KB
/
PriorityEtherHost.ned
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
//
// This program is free software: you can redistribute it and/or modify
// it under the terms of the GNU Lesser General Public License as published by
// the Free Software Foundation, either version 3 of the License, or
// (at your option) any later version.
//
// This program is distributed in the hope that it will be useful,
// but WITHOUT ANY WARRANTY; without even the implied warranty of
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
// GNU Lesser General Public License for more details.
//
// You should have received a copy of the GNU Lesser General Public License
// along with this program. If not, see http://www.gnu.org/licenses/.
//
package backbone;
import inet.linklayer.IEtherMAC;
import inet.linklayer.IOutputQueue;
module PriorityEtherHost
{
parameters:
bool dynamicAPConnections = default(false);
bool csmacdSupport = default(true); // by default use CSMA/CD
bool staticConnections = default(true);
string macType = default(csmacdSupport ? "EtherMAC" : "EtherMACFullDuplex"); // ~EtherMAC or ~EtherMACFullDuplex
string queueType = default("DropTailPriorityQueue");
@node();
@labels(node,ethernet-node);
@display("i=device/pc2");
gates:
inout ethg @labels(EtherFrame-conn);
submodules:
app: PriorityTrafficGenerator {
@display("p=155,59");
}
encap: PriorityFrameEncap {
@display("p=155,146");
}
queue: <queueType> like IOutputQueue {
parameters:
@display("p=87,207;q=l2queue");
}
mac: <macType> like IEtherMAC {
queueModule = (queueType == "" ? "" : "queue");
@display("p=155,272;q=txQueue");
}
connections:
app.out --> encap.upperLayerIn;
app.in <-- encap.upperLayerOut;
encap.lowerLayerOut --> queue.in;
queue.out --> mac.upperLayerIn;
mac.upperLayerOut --> encap.lowerLayerIn;
mac.phys <--> ethg;
}