network SmallNetwork
{
    parameters:
        @signal[flood](type="long");
        @statistic[flood](title="number_of_messages"; source="flood"; record= vector,last);
        
        @signal[packet_size](type="long");
        @statistic[throughput](title="total_number_of_packets"; source="packet_size"; record=vector,last);
        
        @signal[hop_count](type="long");
        @statistic[latency](title="latency"; source="hop_count"; record= vector,last);  
        
        @signal[number_replies](type="long");
        @statistic[successRate](title="total_number_of_replies"; source="number_replies"; record=vector,last);  
    types:
       channel Channel extends ned.DelayChannel {
            delay = 100ms;
        }
    submodules:
        CSE_in[3]: CSE;
        CSE_mn[6]: CSE;
        AE [12]: AE;
    connections allowunconnected :     
        for i=0..2 {
            CSE_in[i].sibling++ <--> Channel <--> CSE_in[(i+1)%3].sibling++;
        }
        for j=0..1 {
            CSE_mn[j].provider++ <--> Channel <--> CSE_in[0].customer++;
        }
        for j=2..3 {
            CSE_mn[j].provider++ <--> Channel <--> CSE_in[1].customer++;
        }
        for j=4..5 {
            CSE_mn[j].provider++<--> Channel <--> CSE_in[2].customer++;
        }
        for j=0..1 {
            CSE_mn[0].ae++ <--> Channel <--> AE[j].cse++;
        }
        for j=2..3 {
            CSE_mn[1].ae++ <--> Channel <--> AE[j].cse++;
        }
        for j=4..5 {
            CSE_mn[2].ae++ <--> Channel <--> AE[j].cse++;
        }
        for j=6..7 {
            CSE_mn[3].ae++ <--> Channel <--> AE[j].cse++;
        }
        for j=8..9 {
            CSE_mn[4].ae++ <--> Channel <--> AE[j].cse++;
        }
        for j=10..11 {
            CSE_mn[5].ae++ <--> Channel <--> AE[j].cse++;
        } 
}