// // 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/. // package inet.nodes.inet; import inet.networklayer.IManetRouting; import inet.util.ThruputMeter; import inet.util.ThruputMeteringChannel; //teo import inet.linklayer.ieee80211.mac.Ieee80211Mac; //teo // // A wireless host containing routing, mobility and battery components. // Supports only IPv4 protocol, TCP and UDP as transport protocol. // This is a typical mobile node which can participate in adhoc routing // and may have TCP/UDP applications installed. Supports ICMP (ping) too. // // - By default contains a single wireless cards, however it can be configured // by the numRadios parameter. Wirless card type is configured by the // **.wlan.typename parameter. see: inet.linklayer.ieee80211 or other // modules implementing ~IWirelessNic // - Node mobility can be set using **.mobility.typename // see: inet.mobility and ~IMobility // module AdhocHost extends WirelessHost { parameters: @display("i=device/cellphone"); wlan[*].mgmtType = default("Ieee80211MgmtAdhoc"); // use adhoc management string routingProtocol @enum("AODVUU","DYMOUM","DYMO","DSRUU","OLSR","OLSR_ETX","DSDV_2","Batman") = default(""); // used mobile routing protocol. see: inet.networklayer.manetrouting IPForward = default(true); submodules: manetrouting: like IManetRouting if routingProtocol != "" { @display("p=522,307"); } thruputMeter_udp_tx: ThruputMeter { @display("p=389,196"); } thruputMeter_udp_rx: ThruputMeter { @display("p=275,194"); } connections: networkLayer.transportOut++ --> manetrouting.from_ip if routingProtocol != ""; networkLayer.transportIn++ <-- manetrouting.to_ip if routingProtocol != ""; udp.ipOut --> thruputMeter_udp_tx.in; udp.ipIn <-- thruputMeter_udp_rx.out; for i=0..numUdpApps-1 { udpApp[i].udpOut --> udp.appIn++; udpApp[i].udpIn <-- udp.appOut++; } thruputMeter_udp_tx.out --> networkLayer.transportIn++ if hasUdp; thruputMeter_udp_rx.in <-- networkLayer.transportOut++ if hasUdp; //networkLayer.ifOut++ --> thruputMeter_udp_rx.in; //networkLayer.ifIn++ <-- thruputMeter_udp_tx.out; // networkLayer.igmpOut --> thruputMeter_udp_rx.in; // networkLayer.igmpIn <-- thruputMeter_udp_tx.out; }