-
Notifications
You must be signed in to change notification settings - Fork 2
/
replication.ned
106 lines (95 loc) · 2.72 KB
/
replication.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
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
package project;
simple Replica
{
parameters:
@display("i=block/buffer2");
int n_client = 4;
bool plot_enabled = default(false);
gates:
inout gate[n_client];
}
simple Client
{
parameters:
@display("i=old/comp");
int n_replica = 5;
int read_quorum = default(3);
int write_quorum = default(4);
bool plot_enabled = default(false);
gates:
inout gate[n_replica];
}
network Replication
{
@display("bgb=680,440");
types:
channel C50 extends ned.DatarateChannel
{
delay = 50ms;
datarate = 100Mbps;
}
channel C500 extends ned.DatarateChannel
{
delay = 500ms;
datarate = 100Mbps;
}
channel C5000 extends ned.DatarateChannel
{
delay = 5000ms;
datarate = 100Mbps;
}
channel CUniform extends ned.DatarateChannel
{
delay = uniform(100ms,500ms);
datarate = 100Mbps;
}
submodules:
r0: Replica {
@display("i=,gold;p=80,80");
}
r1: Replica {
@display("i=,gold;p=200,80");
}
r2: Replica {
@display("i=,gold;p=320,80");
}
r3: Replica {
@display("i=,gold;p=440,80");
}
r4: Replica {
@display("i=,gold;p=560,80");
}
client0: Client {
@display("i=,cyan;p=140,320");
}
client1: Client {
@display("i=,cyan;p=260,320");
}
client2: Client {
@display("i=,cyan;p=380,320");
}
client3: Client {
@display("i=,cyan;p=500,320");
}
connections:
client0.gate[0] <--> C50 <--> r0.gate[0];
client0.gate[1] <--> C50 <--> r1.gate[0];
client0.gate[2] <--> C50 <--> r2.gate[0];
client0.gate[3] <--> C500 <--> r3.gate[0];
client0.gate[4] <--> C500 <--> r4.gate[0];
client1.gate[0] <--> C50 <--> r0.gate[1];
client1.gate[1] <--> C50 <--> r1.gate[1];
client1.gate[2] <--> C50 <--> r2.gate[1];
client1.gate[3] <--> C50 <--> r3.gate[1];
client1.gate[4] <--> C50 <--> r4.gate[1];
client2.gate[0] <--> C50 <--> r0.gate[2];
client2.gate[1] <--> C50 <--> r1.gate[2];
client2.gate[2] <--> C50 <--> r2.gate[2];
client2.gate[3] <--> C500 <--> r3.gate[2];
client2.gate[4] <--> C500 <--> r4.gate[2];
client3.gate[0] <--> C50 <--> r0.gate[3];
client3.gate[1] <--> C50 <--> r1.gate[3];
client3.gate[2] <--> C50 <--> r2.gate[3];
client3.gate[3] <--> C50 <--> r3.gate[3];
client3.gate[4] <--> C50 <--> r4.gate[3];
}