network NetDoubleStack
{
@display("bgb=676,413");
types:
channel ethline extends DatarateChannel
{
delay = 50ns;
datarate = 100Mbps;
}
submodules:
channelControl: ChannelControl {
parameters:
@display("p=60,50;i=misc/sun");
}
configurator: FlatNetworkConfigurator6 {
parameters:
@display("p=60,120");
}
LMN: HostIPv6over802154 {
parameters:
@display("p=185,140;i=device/pc3");
}
R1: Router6_802154v4 {
parameters:
@display("p=211,211");
}
CN1: StandardHost6v2 {
@display("p=416,198");
}
connections:
CN1.ethg++ <--> ethline <--> R1.ethg++;
}
module NodeBase6_802154v4
{
parameters:
@display("bgb=623,479");
@node;
@labels(node,ethernet-node,wireless-node);
int numRadios = default(0); // the number of radios in the router. by default no wireless
int numPcapRecorders = default(0); // no of PcapRecorders.
string mobilityType = default("StationaryMobility");
xml routingTable = default(xml("<routingTable/>"));
bool IPForward = default(true);
gates:
input radioIn6low @directIn;
inout ethg[] @labels(EtherFrame-conn);
submodules:
notificationBoard: NotificationBoard {
parameters:
@display("p=53,155;is=s");
}
// optional mobility module. Required only if wireless cards are present
mobility: <mobilityType> like IMobility if mobilityType != "" && numRadios > 0 {
parameters:
@display("p=53,111");
}
// network layer
networkLayer: NetworkLayer6v5 {
parameters:
@display("p=329,287;q=queue");
gates:
ifIn[sizeof(ethg)+1];
ifOut[sizeof(ethg)+1];
}
routingTable6: RoutingTable6 {
parameters:
@display("p=53,225;is=s");
isRouter = IPForward;
routingTable = routingTable;
}
// linklayer
interfaceTable: InterfaceTable {
parameters:
@display("p=53,287;is=s");
}
pcapRecorder[numPcapRecorders]: PcapRecorder {
@display("p=53,338,r,10");
}
eth[sizeof(ethg)]: <default("EthernetInterface")> like IWiredNic {
parameters:
@display("p=282,406,row,90;q=txQueue");
}
lrwpan: Ieee802154csmaNic {
parameters:
@display("p=494,406;q=queue;i=block/ifcard");
}
sixlowpan: _6lowpan {
@display("p=464,307;is=s");
gates:
fromIPv6[1];
toIPv6[1];
fromMac[1];
toMac[1];
}
connections allowunconnected:
for i=0..sizeof(ethg)-1 {
ethg[i] <--> eth[i].phys;
eth[i].upperLayerOut --> networkLayer.ifIn[i];
eth[i].upperLayerIn <-- networkLayer.ifOut[i];
}
//802.15.4 connection
radioIn6low --> lrwpan.radioIn6low;
lrwpan.upperLayerOut --> sixlowpan.fromMac[0];
lrwpan.upperLayerIn <-- sixlowpan.toMac[0];
sixlowpan.toIPv6[0] --> networkLayer.ifIn++;
sixlowpan.fromIPv6[0] <-- networkLayer.ifOut++;
}
No gate index specified when accessing vector gate `queueOut'.