Compound Module P2PNetwork

File: networks/p2p/P2PNetwork.ned

A network only consisting of basic modules

The P2PNetwork does not contain any real functionality. It should be the basis for all other simulations build with our framework and is mainly to help to understand the concept and for all programmers as a reference for their own implementations.

You should use the P2PNetwork if sophisticated interference models are not of interest and you prefere a faster simulation. Collisions and interference is modeled into the bit error rate for these kinds of networks. The advantage is that interference doesn't has to be explicitly modeled and thus messages are not braodcasted but sent directly to the specified next hop.

P2PHost is a vector of size numHosts (which specifies the number of hosts present in the network)

Author: Daniel Willkomm

channelcontrol: ChannelControl host: P2PHost

Usage diagram:

The following diagram shows usage relationships between modules, networks and channels. Unresolved module (and channel) types are missing from the diagram. Click here to see the full picture.

Contains the following modules:

If a module type shows up more than once, that means it has been defined in more than one NED file.

P2PHost

The P2PHost is a compound module that implements a very simple peer to peer host. Instead of an "snrEval" and "decider" module it just contains a simple "phy" module that sends unicast messages

ChannelControl (unknown -- not in documented files)

Networks:

p2pSim

example simulation using the P2PHost

Parameters:

Name Type Description
playgroundSizeX numeric const

x size of the area the nodes are in (in meters)

playgroundSizeY numeric const

y size of the area the nodes are in (in meters)

numHosts numeric const

total number of hosts in the network

Unassigned submodule parameters:

Name Type Description
host[*].applLayer string

application layer type

host[*].blackboard.coreDebug numeric const

debug switch for core framework

host[*].mobility.coreDebug numeric const

debug switch for the core framework

host[*].mobility.x numeric const

x coordinate of the nodes' position (-1 = random)

host[*].mobility.y numeric const

y coordinate of the nodes' position (-1 = random)

host[*].arp.debug bool
host[*].appl.debug bool

debug switch

host[*].appl.headerLength numeric const

length of the application message header (in bits)

host[*].net.debug numeric const

debug switch for the core framework

host[*].net.headerLength numeric const

length of the network packet header (in bits)

host[*].nic.mac.debug bool

debug switch

host[*].nic.mac.headerLength numeric const

level at which we consider medium busy

host[*].nic.mac.queueLength numeric const

length of the MAC queue

host[*].nic.mac.bitrate numeric const

bit rate in bit/s

host[*].nic.mac.defaultChannel numeric const

default channel

host[*].nic.phy.coreDebug numeric const

debug switch for the core framework

host[*].nic.phy.pBit numeric const

bit error rate

host[*].nic.phy.bitrate numeric const

bitrate (in bits/sec)

host[*].nic.phy.transmitterPower numeric const

power used to transmit messages (in mW)

host[*].nic.phy.headerLength numeric const

length (in bits) of the AirFrame header

host[*].nic.radio.debug bool
host[*].nic.radio.swSleep numeric const

time parameters, how long does it take to switch to sleep mode

host[*].nic.radio.swSend numeric const

switch to send mode

host[*].nic.radio.swRecv numeric const

switch to recv mode

Source code:

module P2PNetwork
    parameters:
        playgroundSizeX : numeric const, // x size of the area the nodes are in (in meters)
        playgroundSizeY : numeric const, // y size of the area the nodes are in (in meters)
        numHosts : numeric const; // total number of hosts in the network

    submodules:
        channelcontrol: ChannelControl;
            parameters:
                playgroundSizeX = playgroundSizeX,
                playgroundSizeY = playgroundSizeY;
            display: "p=60,30;i=eye14";
        host: P2PHost[numHosts];
            display: "p=50,50;i=laptop";

    connections nocheck:
    // all connections and gates are to be generated dynamically

    display: "p=10,10;b=$playgroundSizeX,$playgroundSizeY,rect;o=white";
endmodule