Switch to unified view

a b/src/CS/DC_Server.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
// Author: Kewin Rausch <kewin.rausch@create-net.org>
17
//
18
// NOTES:
19
// This module describes a single server in the DataCenter use-case.
20
// Servers can be reached by multiple Tenants.
21
//
22
// Colors of the IPC reflect the use case layers.
23
// Link: https://wiki.ict-pristine.eu/wp2/d21/D21-Datnet-RINA
24
25
package rina.CS;
26
27
import rina.Common.Test;
28
import rina.DAF.ApplicationProcess;
29
import rina.DAF.DA.DIFAllocator;
30
import rina.DIF.IPCProcess;
31
32
module DC_Server
33
{
34
    parameters:
35
        @display("i=device/server;bgb=294,396");
36
        @node;
37
38
        int nofVM = default(1);
39
40
    gates:
41
        // Two gates out:
42
        // - 0 is TOR side medium.
43
        // - 1 to N are VM side mediums.
44
        inout medium[nofVM + 1];
45
46
    submodules:
47
        difAllocator: DIFAllocator {
48
            @display("p=148,44;i=,grey");
49
        }
50
51
        TenantIPC: IPCProcess {
52
            @display("p=148,121;i=,#0080FF");
53
        }
54
55
        VMShimIPC[nofVM]: IPCProcess {
56
            @display("p=73,213;i=,#800000");
57
        }
58
59
        ShimIPC: IPCProcess {
60
            @display("p=214,313;i=,#800000");
61
        }
62
63
        DCIPC: IPCProcess {
64
            @display("p=214,213;i=,#008000");
65
        }
66
67
    connections allowunconnected:
68
69
        for i=0..nofVM-1 {
70
            VMShimIPC[i].northIo++ <--> TenantIPC.southIo++;
71
            VMShimIPC[i].southIo++ <--> medium[i + 1];
72
        }
73
74
        // Static configuration for the connections.
75
        //
76
        DCIPC.northIo++ <--> TenantIPC.southIo++;
77
        DCIPC.southIo++ <--> ShimIPC.northIo++;
78
        ShimIPC.southIo++ <--> medium[0];
79
}