/
UDPBroadcastNetwork.ned
56 lines (52 loc) · 1.45 KB
/
UDPBroadcastNetwork.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
package inet.examples.inet.broadcast;
import inet.networklayer.configurator.ipv4.IPv4NetworkConfigurator;
import inet.node.ethernet.EtherSwitch;
import inet.node.inet.Router;
import inet.node.inet.StandardHost;
import ned.DatarateChannel;
network UDPBroadcastNetwork
{
parameters:
int numTargets;
types:
channel C extends DatarateChannel
{
datarate = 10Mbps;
delay = 0.1us;
}
submodules:
target[numTargets]: StandardHost {
parameters:
@display("i=device/pc3;p=514,115");
}
client: StandardHost {
parameters:
@display("p=62,115;i=device/pc2");
}
R1: Router {
parameters:
@display("p=180,115");
}
R2: Router {
@display("p=279,115");
}
configurator: IPv4NetworkConfigurator {
parameters:
config = xmldoc("config.xml");
@display("p=62,31");
}
switch: EtherSwitch {
@display("p=389,114");
}
nonTarget: StandardHost {
@display("p=389,31");
}
connections:
client.pppg++ <--> C <--> R1.pppg++;
R1.pppg++ <--> C <--> R2.pppg++;
R2.pppg++ <--> C <--> nonTarget.pppg++;
R2.ethg++ <--> C <--> switch.ethg++;
for i=0..numTargets-1 {
switch.ethg++ <--> C <--> target[i].ethg++;
}
}