Top Banner
Department of Electrical Engineering Sharif University of Technology 1 Asynchronous Reservation- Based MAC Protocol  Goals 1. To understand how to implement d ifferent 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 in WLAN. 2) The need for having a framing over time and allocating a specific time slot to each RT 1  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 MACA-PR 2 . This protocol is an asynchronous reservation-based MAC protocol which is simply implemented in a distributed way. The base of this protocol is very similar to CSMA-CA 3  (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. 1  Real Time 2  Medium Access Collision Avoidance with Piggyback Reservation 3  Carrier Sense Multiple Access  Collision Avoidance
6

Data Netwoorks Opnet Project

Apr 13, 2018

Download

Documents

PArk100
Welcome message from author
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
Transcript
Page 1: Data Netwoorks Opnet Project

7/26/2019 Data Netwoorks Opnet Project

http://slidepdf.com/reader/full/data-netwoorks-opnet-project 1/6

Department of Electrical Engineering

Sharif University of Technology

Asynchronous Reservation-

Based MAC Protocol 

Goals 

1. To understand how to implement different layers in OPNET2. To understand how to implement a simple protocol in OPNET3. 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 willhelp 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

in WLAN. 2) The need for having a framing over time and allocating a specific time slot to each RT1 

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

MACA-PR2. This protocol is an asynchronous reservation-based MAC protocol which is simply

implemented in a distributed way. The base of this protocol is very similar to CSMA-CA3  (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.

1 Real Time

2 Medium Access Collision Avoidance with Piggyback Reservation

3 Carrier Sense Multiple Access – Collision Avoidance

Page 2: Data Netwoorks Opnet Project

7/26/2019 Data Netwoorks Opnet Project

http://slidepdf.com/reader/full/data-netwoorks-opnet-project 2/6

Department of Electrical Engineering

Sharif University of Technology

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 ofeach 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 

RTS CTS Packet Packet

  

 

 

Page 3: Data Netwoorks Opnet Project

7/26/2019 Data Netwoorks Opnet Project

http://slidepdf.com/reader/full/data-netwoorks-opnet-project 3/6

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 anetwork topology as depicted in Error! Reference source not found.. It is assumed that thereexists a Unique Identifier (UID) for each node, each node knows its neighbors in advance (thenetwork topology is assumed to be fixed), idle nodes continuously listen to the channel, and radiotransmission power of nodes is set at the level letting adjacent nodes communicate with each other.

Consider four single-hop RT traffic streams. The first two streams initiating from nodes 2 and 3 aredestined 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 generatingpackets, 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 highestlayer is application layer. This layer generates RT packet streams to some neighbor nodes. Thistask can possibly be implemented by the existing process model “simple_source”. The packetsformat 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.

Figure 3: A sample network topology 

Page 4: Data Netwoorks Opnet Project

7/26/2019 Data Netwoorks Opnet Project

http://slidepdf.com/reader/full/data-netwoorks-opnet-project 4/6

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 (ProjectEditor 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 ofabout 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. 

Page 5: Data Netwoorks Opnet Project

7/26/2019 Data Netwoorks Opnet Project

http://slidepdf.com/reader/full/data-netwoorks-opnet-project 5/6

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. Apacket format contains one or more fields, represented in the editor as colored rectangular boxes. The sizeof the box is proportional to the number of bits specified as the field‟s size. In this project, you should definetwo different packet formats: one for control packets and the other for data packets. You will name thesepacket formats and later use their names to create a packet of one of these types. Specifically, you can usethe 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.

Figure 5: A sample format for data packets.

The Process Model Editor  

To create process models which control the underlying functionality of modules in the NodeMode 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 haveaccess 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 ModelEditor 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 canbe performed using the Kernel Procedure “op_stat_local_read()”. Correct reception of a packet could be assessed by checking the interference level. This can beperformed by the following piece of code:

Experiment Report

 After developing your agents in the process editor and compiling them, make node models out ofthem 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 youshould 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.

Payload CRC Packet Type/Payload info 

DestinationUID 

SourceUID 

DestinationMAC_Address 

SourceMAC_Address 

#define rx_power_threshold 0.000000000000001if ( op_td_get_dbl (pkptr , OPC_TDA_RA_NOISE_ACCUM) > rx_power_threshold ) 

packet_reception_failure = OPC_TRUE; 

Page 6: Data Netwoorks Opnet Project

7/26/2019 Data Netwoorks Opnet Project

http://slidepdf.com/reader/full/data-netwoorks-opnet-project 6/6

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.