Anda di halaman 1dari 6

Department of Electrical Engineering

Sharif University of Technology

Asynchronous ReservationBased MAC Protocol


Goals
1. To understand how to implement different layers in OPNET
2. To understand how to implement a simple protocol in OPNET
3. To get familiar with an attractive real time MAC protocol

Part I: Introduction

In this project, you will be using various OPNET Tools in order to create your own agents with
their customized protocol stack and packet format. In order to do this project you should learn to
work with process editor, node model editor, link editor and packet format editor, in addition to the
network model editor that you may have become familiar with before. Each of these editors will
help you develop a part of your nodes, while process editor helps you to define the state machine
for each layer in the protocol stack and the things that need to be performed in each state.
Transmitting real time traffic over a WLAN has been a challenging problem because of two main
reasons. 1) The need for a distributed medium access control protocol, being practically implemented
1
in WLAN. 2) The need for having a framing over time and allocating a specific time slot to each RT
packet stream. Usually, reservation based protocols require some degree of synchronization which
impede distributed implementation.
In this project you become familiar with a simple and attractive real time MAC protocol, named as
2
MACA-PR . This protocol is an asynchronous reservation-based MAC protocol which is simply
3
implemented in a distributed way. The base of this protocol is very similar to CSMA-CA (IEEE
802.11) protocol. This protocol supports transmission of both data and RT packet streams.
Transmission of data packets is basically the same as CSMA-CA. Specifically; each wireless station
having a data packet to send, tries to find a free window (subsequently defined), senses the channel
and, takes the channel through RTS/CTS exchange cycle, sends the packet and receives its
corresponding acknowledge.

Real Time
Medium Access Collision Avoidance with Piggyback Reservation
3
Carrier Sense Multiple Access Collision Avoidance
1
2

Department of Electrical Engineering


Sharif University of Technology
RTS CTS

Packet

Packet

Figure 1: The mechanism of sending control packets and reserving the channel in MACA_PR protocol

The same procedure takes place for the first packet of a RT packet stream, through which a time slot
of the channel is reserved for subsequent intervals (Figure 1). Specifically, each wireless station upon
receiving the first packet of a RT packet stream sends an RTS signal to its neighbor nodes. The
addressed neighbor node replies through CTS. Next, the sender sends the first packet of stream. In
addition to the sender and receiver nodes, each neighbor node hearing CTS or the first packet, logs
the instant of ending reception of CTS or the instant of starting reception of the first packet as the start
point of a slot.
Assuming fixed slot duration, , and fixed framing interval, , each station only logs the start point of
each reserved slot in a table known as reservation table. An example of a sample network and the
corresponding reservation table formed in some nodes, are shown in Figure 2. On this basis, each
station which is about to send an RT packet stream to one of its neighbors, could recognize a free
window, a time interval during which both of the sender and receiver are free. Length of the free
window should be at least as long as duration of a contention phase (
).

Figure 2: A sample network topology and the corresponding reservation table of some nodes

Department of Electrical Engineering


Sharif University of Technology

The Main Scenario


Here we are going to implement MACA-PR protocol in a fixed nodes wireless network. Consider a
network topology as depicted in Error! Reference source not found.. It is assumed that there
exists a Unique Identifier (UID) for each node, each node knows its neighbors in advance (the
network topology is assumed to be fixed), idle nodes continuously listen to the channel, and radio
transmission power of nodes is set at the level letting adjacent nodes communicate with each other.

Figure 3: A sample network topology

Consider four single-hop RT traffic streams. The first two streams initiating from nodes 2 and 3 are
destined for node 1. The second two streams initiating from nodes 6 and 7 are destined for node 5.
The first two streams and also the second of two streams become backlogged simultaneously.

Node Model Definition


The Node Model Editor is used to create models of nodes. The node models are then used to
create node instances within networks in the Project Editor. OPNET node models have a modular
structure. You define a node by connecting various modules with packet streams and statistic
wires. The connections between modules allow packets and status information to be exchanged
between modules. Each module placed in a node serves a specific purpose, such as generating
packets, queuing packets, processing packets, or transmitting and receiving packets.
The node model that you should use for this project mainly consists of three layers. The highest
layer is application layer. This layer generates RT packet streams to some neighbor nodes. This
task can possibly be implemented by the existing process model simple_source. The packets
format will be defined in the OPNET packet format editor as will be explained later. Specify the
packet inter-arrival time as constant and set its mean value as 0.1.
The second layer after the application layer is the MAC layer. For this layer, you should develop a
process model and its corresponding state machine. This process sends and receives packets to
and from the physical and the application layer. The process should also keep the
reservation table and manage medium access according to MACA-PR protocol.
3

Department of Electrical Engineering


Sharif University of Technology
The physical layer is composed of a pair of wireless radio transmitter and wireless radio receiver
modules. The attributes of these modules could be set according to the details shown in Figure 4.

Figure 4: The attributes of wireless radio receiver

Some attributes could be promoted, so that you can see them in higher hierarchy level (Project
Editor in this case). You can refer to OPNET documentation for further help.
Some useful Hints:
Setting radio transmission power of wireless nodes as 0.1 mw, provides a radio range of
about 1.5 km which is desired in this project.
Altitude of each wireless node should be set any value greater than zero. For this purpose,
choose Edit Attributes (Advanced), and set altitude as 0.003.

Department of Electrical Engineering


Sharif University of Technology

The Packet Format Editor


By making use of this editor it is possible to define the internal structure of a packet as a set of fields. A
packet format contains one or more fields, represented in the editor as colored rectangular boxes. The size
of the box is proportional to the number of bits specified as the fields size. In this project, you should define
two different packet formats: one for control packets and the other for data packets. You will name these
packet formats and later use their names to create a packet of one of these types. Specifically, you can use
the function op_pk_create() to create a packet in your state machines.
Each packet (either control packet or data packet) has a fixed length header similar to Figure 5. Assume
the length of the header as 56 bits and length of the payload for RT packets as 240 bits.

Source
MAC_Address

Destination
MAC_Address

Source
UID

Destination
UID

Packet Type/
Payload info

CRC

Payload

Figure 5: A sample format for data packets.

The Process Model Editor


To create process models which control the underlying functionality o f m o d u l e s in the Node
M o d e l Editor one can use the Process Editor. Processes are defined by finite state machines
(FSMs) which are composed of states and edges that represent transitions between states.
Operations performed in the states are described in embedded C or C++ code blocks. You have
access to a number of library functions that help you to do several network related operations.
These functions are known as Kernel Procedures . Refer to OPNET Help in Process Model
Editor for a list of Essential Kernel Procedures.
Some Useful Hints:
In carrier sending, it is necessary to check the strength of the input signal to the receiver. This can
be performed using the Kernel Procedure op_stat_local_read().
Correct reception of a packet could be assessed by checking the interference level. This can be
performed by the following piece of code:
#define rx_power_threshold
0.000000000000001
if ( op_td_get_dbl (pkptr, OPC_TDA_RA_NOISE_ACCUM) > rx_power_threshold )
packet_reception_failure = OPC_TRUE;

Experiment Report
After developing your agents in the process editor and compiling them, make node models out of
them to do simulation. In order for nodes to be able to collect the simulation results, you should
define a number of statistics such as number of received packets, e n d t o e n d delay,
startup time, etc. Define a number of statistics for nodes in the Node Model Editor. Then you
should update those statistics using a class of Kernel Procedures starting with op_stat keyword.
So, you are able to see the results after running the simulation.
5

Department of Electrical Engineering


Sharif University of Technology
Run the simulation and record startup time of protocol for each stream, number of received packets
in destination nodes, number of contentions which take place for each stream, and end to end delay
of each RT packet stream. What are the main advantages and disadvantages of this protocol? Are
there any scenarios which disturb the correct operation of the protocol?

Project Report
Write a proper report using MS Word or Latex and include the results and discussions of your results.
You should then pack this report with the project (and other necessary files to run your project as a
standalone program) in a folder named as yourname_yourUID_Project, and then zip this folder and
upload this one file to the courseware. You should include the followings in your report

1. Explain all the steps in creating your agents. Use snapshots from the OPNET editors if
required.
2. Include the state machines and codes from OPNET process editors.
3. Justify your results from the experimental part.
4. Optional (added mark): A simple and fixed topology was assumed in the main scenario.
Enhance your implementation to support any arbitrary topology, possibly changing dynamically.
Indeed, you should advise a supplementary protocol for identifying neighbors of a node.
Evaluate your implementation when applying movement for one or two nodes.

Anda mungkin juga menyukai