|
a |
|
b/examples/SmallNetwork2/SmallNetwork2.ned |
|
|
1 |
//
|
|
|
2 |
// This program is free software: you can redistribute it and/or modify
|
|
|
3 |
// it under the terms of the GNU Lesser General Public License as published by
|
|
|
4 |
// the Free Software Foundation, either version 3 of the License, or
|
|
|
5 |
// (at your option) any later version.
|
|
|
6 |
//
|
|
|
7 |
// This program is distributed in the hope that it will be useful,
|
|
|
8 |
// but WITHOUT ANY WARRANTY; without even the implied warranty of
|
|
|
9 |
// MERCHANTABILITY or FITNESS FOR A PARTICULAR PURPOSE. See the
|
|
|
10 |
// GNU Lesser General Public License for more details.
|
|
|
11 |
//
|
|
|
12 |
// You should have received a copy of the GNU Lesser General Public License
|
|
|
13 |
// along with this program. If not, see http://www.gnu.org/licenses/.
|
|
|
14 |
//
|
|
|
15 |
|
|
|
16 |
package rina.examples.SmallNetwork2;
|
|
|
17 |
import ned.DatarateChannel;
|
|
|
18 |
import rina.CS.*;
|
|
|
19 |
|
|
|
20 |
|
|
|
21 |
network SmallNetwork2
|
|
|
22 |
{
|
|
|
23 |
@display("bgb=586,372");
|
|
|
24 |
submodules:
|
|
|
25 |
host1: Host1AP {
|
|
|
26 |
@display("p=92,83");
|
|
|
27 |
}
|
|
|
28 |
host2: Host1AP {
|
|
|
29 |
@display("p=92,252");
|
|
|
30 |
}
|
|
|
31 |
// host3: Host1AP {
|
|
|
32 |
// @display("p=275,83");
|
|
|
33 |
// }
|
|
|
34 |
host4: Host1AP {
|
|
|
35 |
@display("p=473,83");
|
|
|
36 |
}
|
|
|
37 |
host5: Host1AP {
|
|
|
38 |
@display("p=473,252");
|
|
|
39 |
}
|
|
|
40 |
router1: InteriorRouter3Int {
|
|
|
41 |
@display("p=166,165");
|
|
|
42 |
}
|
|
|
43 |
router2: InteriorRouter2Int {
|
|
|
44 |
@display("p=275,165");
|
|
|
45 |
}
|
|
|
46 |
router3: InteriorRouter3Int {
|
|
|
47 |
@display("p=388,165");
|
|
|
48 |
}
|
|
|
49 |
|
|
|
50 |
connections:
|
|
|
51 |
// router1.medium[0] <--> host1.medium;
|
|
|
52 |
// router1.medium[1] <--> host2.medium;
|
|
|
53 |
// router1.medium[2] <--> router2.medium[0];
|
|
|
54 |
// router2.medium[1] <--> router3.medium[0];
|
|
|
55 |
//// router2.medium[2] <--> host3.medium;
|
|
|
56 |
// router3.medium[1] <--> host4.medium;
|
|
|
57 |
// router3.medium[2] <--> host5.medium;
|
|
|
58 |
|
|
|
59 |
router1.medium[0] <--> NormalPath <--> host1.medium;
|
|
|
60 |
router1.medium[1] <--> NormalPath <--> host2.medium;
|
|
|
61 |
router1.medium[2] <--> NormalPath <--> router2.medium[0];
|
|
|
62 |
router2.medium[1] <--> NormalPath <--> router3.medium[0];
|
|
|
63 |
// router2.medium[2] <--> host3.medium;
|
|
|
64 |
router3.medium[1] <--> NormalPath <--> host4.medium;
|
|
|
65 |
router3.medium[2] <--> ErroneousPath <--> host5.medium;
|
|
|
66 |
}
|
|
|
67 |
|
|
|
68 |
channel NormalPath extends DatarateChannel
|
|
|
69 |
{
|
|
|
70 |
parameters:
|
|
|
71 |
datarate = 1Mbps;
|
|
|
72 |
delay = 1us; // 10m
|
|
|
73 |
per = 0;
|
|
|
74 |
ber = 0;
|
|
|
75 |
}
|
|
|
76 |
|
|
|
77 |
channel LongPath extends DatarateChannel
|
|
|
78 |
{
|
|
|
79 |
parameters:
|
|
|
80 |
datarate = 1Mbps;
|
|
|
81 |
delay = 0.0565us; // 10m
|
|
|
82 |
per = 0;
|
|
|
83 |
ber = 0;
|
|
|
84 |
}
|
|
|
85 |
|
|
|
86 |
channel ErroneousPath extends DatarateChannel
|
|
|
87 |
{
|
|
|
88 |
parameters:
|
|
|
89 |
datarate = 1Mbps;
|
|
|
90 |
delay = 1us; // 10m
|
|
|
91 |
per = 0.00;
|
|
|
92 |
ber = 0.0;
|
|
|
93 |
}
|