-
Notifications
You must be signed in to change notification settings - Fork 8
Transmission_Model
Whenever a node transmits a message, the behavior of the transmission channel may be completely different than for any other message transmitted earlier. For instance, cross traffic from other nodes may block the wireless channel or interference may degrade the channel’s quality. To model these transient characteristics inside Shawn, the [Transmission Model](Transmission Model) determines the properties of an individual message transmission. It can arbitrarily delay, drop or alter messages.
This means that a message may not reach its destination even if the [Communication Model](Communication Model) states that two nodes can communicate as a matter of principle and the Edge Model lists these two nodes as neighbors. The code below shows the C++ interface for transmission model implementations in Shawn. The send message()-method accepts a MessageInfo data structure containing the message itself, the time of transmission and the position of the sender.
class TransmissionModel
{
struct MessageInfo
{
Node* src_;
Vec src_pos_;
double time_;
MessageHandle msg_;
};
...
void send_message (MessageInfo&);
...
};
Again, the choice of an implementation strongly depends on the simulation goal. In case that the runtime of an algorithm is not of interest but only its quality, a simple transmission model without delay, loss or message corruption is sufficient. Models that are more sophisticated could take contention, transmission time and errors into account at the cost of performance.
The figure above lists the built-in transmission models of Shawn, covering both abstract and close-to-reality implementations. The delivers all messages immediately, without loss or corruption to all neighboring nodes. The Random Drop Transmission Model is a slight variation in that it discards messages with a given probability but it neither delays nor alters messages. The Statistics Transmission Model implementation does not deliver any message but instead records informational data such as the overall message count, different message types, etc. To make use of such a non-functional transmission model, the Chainable Transmission Model allows a series of transmission models to process a message sequentially. Like that, a message could first be counted, then delayed and may then be dropped by combining several simple transmission models.
Two additional implementations are closer to the real world than the above-mentioned ones. They simulate the effects of the well-known CSMA/CA and (slotted) Aloha medium access schemes. Please note that not the MAC protocol itself is simulated but only the delay and loss characteristics are modeled for performance reasons.
The CSMA Transmission Model implements the Carrier Sense Multiple Access/Collision Avoidance algorithm.
Whenever a node wants to deliver a message it listens if the medium is "idle". If no other node is sending the message will be transmitted. Otherwise the node will wait for the medium to be "idle" for a randomly chosen interval.
The following code snipped shows how to use this model.
transm_model=csma
bandwidth=9600
backoff=0.02
jitter=0.001
jitter_lb=0.0001
- The parameter transm_model defines which model will be chosen.
- Bandwidth defines how many bits per seconds can be transmitted.
- Backoff defines the upper bound of a uniform random variable which is used to specify the amount of time a node will wait for if the medium is in use.
- The parameters jitter and jitter_lb specify another uniform random variable. This is used to avoid that several nodes deliver their messages synchronized at the beginning of a round. Jitter defines the upper bound and jitter_lb the lower bound.