-
Notifications
You must be signed in to change notification settings - Fork 2
/
Switch.ned
99 lines (98 loc) · 4.31 KB
/
Switch.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
//
// 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/.
//
// @author Faisal Saleem
// @date April 03, 2019
//
module Switch
{
// Quatnum Key Distribution switch
// Uses BB84 protocol to transfer quantum states between clients.
parameters:
// Display Paremeters (Color, Grid, Image etc)
@display("bgb=441,711,#ECFFEC;i=abstract/switch;is=n;i2=status/green;bgtt=Quantum Key Distribution Switch");
gates:
inout fe01; // FastEthernet 01
inout fe02; // FastEthernet 02;
inout fe03; // FastEthernet 03;
inout fe04; // FastEthernet 04;
inout qu01; // QuantumInterface 01;
inout qu02; // QuantumInterface 02;
inout qu03; // QuantumInterface 03;
inout qu04; // QuantumInterface 04;
submodules:
processor: Processor {
// Processor
@display("p=71,342;is=l");
}
f01: SwitchPublicInterface {
// FastEthernet01 Interface
@display("p=51,657;is=n");
}
f02: SwitchPublicInterface {
@display("p=169,657;is=n");
}
f03: SwitchPublicInterface {
@display("p=278,657;is=n");
}
f04: SwitchPublicInterface {
@display("p=388,657;is=n");
}
q01: SwitchQuantumInterface {
@display("p=43,93;is=n");
}
q02: SwitchQuantumInterface {
@display("p=122,42;is=n");
}
q03: SwitchQuantumInterface {
@display("p=297,40;is=n");
}
q04: SwitchQuantumInterface {
@display("p=400,93;is=n");
}
processingQueue: ProcessingQueue {
@display("p=210,501");
}
quantumStatesProcessor: QuantumStatesQueue {
@display("p=217,137");
}
switchMemory: SwitchMemory {
@display("p=332,340");
}
connections:
fe01 <--> {delay=100ms;} <--> f01.publicChannelCommunication;
fe02 <--> {delay=100ms;} <--> f02.publicChannelCommunication;
fe03 <--> {delay=100ms;} <--> f03.publicChannelCommunication;
fe04 <--> {delay=100ms;} <--> f04.publicChannelCommunication;
qu01 <--> {delay=100ms;} <--> q01.quantumChannelCommunication;
qu02 <--> {delay=100ms;} <--> q02.quantumChannelCommunication;
qu03 <--> {delay=100ms;} <--> q03.quantumChannelCommunication;
qu04 <--> {delay=100ms;} <--> q04.quantumChannelCommunication;
processor.quantumInterfaceCommunication <--> {delay=100ms;} <--> quantumStatesProcessor.inFromProcessor;
processingQueue.processorCommunication <--> {delay=100ms;} <--> processor.publicInterfaceCommunication;
f01.processorCommuniation <--> {delay=100ms;} <--> processingQueue.f01;
f02.processorCommuniation <--> {delay=100ms;} <--> processingQueue.f02;
f03.processorCommuniation <--> {delay=100ms;} <--> processingQueue.f03;
f04.processorCommuniation <--> {delay=100ms;} <--> processingQueue.f04;
q01.subInterface1 <--> {delay=100ms;} <--> quantumStatesProcessor.interface01;
q02.subInterface2 <--> {delay=100ms;} <--> quantumStatesProcessor.interface02;
q03.subInterface3 <--> {delay=100ms;} <--> quantumStatesProcessor.interface03;
q04.subInterface4 <--> {delay=100ms;} <--> quantumStatesProcessor.interface04;
q01.subInterface2 <--> {delay=100ms;} <--> q02.subInterface1;
q02.subInterface3 <--> {delay=100ms;} <--> q03.subInterface2;
q03.subInterface4 <--> {delay=100ms;} <--> q04.subInterface3;
q01.subInterface4 <--> {delay=100ms;} <--> q04.subInterface1;
q02.subInterface4 <--> {delay=100ms;} <--> q04.subInterface2;
q03.subInterface1 <--> {delay=100ms;} <--> q01.subInterface3;
}