![](https://csdnimg.cn/release/download_crawler_static/9477260/bg1.jpg)
Study and Implementation of
IEEE 802.11 Physical Layer Model in
YANS (Future NS-3) Network Simulator
By
Masood Khosroshahy
A Thesis Presented to
Télécom Paris
(Ecole Nationale Supérieure des Télécommunications)
in Fulfillment of the Thesis Requirement
for the Degree of
Master of Science
Networked Computer Systems
Supervisors:
Philippe Martins [Télécom Paris]
Thierry Turletti [INRIA-Sophia Antipolis]
December 2006
![](https://csdnimg.cn/release/download_crawler_static/9477260/bg2.jpg)
ii
Abstract
Due to known difficulties of researchers in the networking domain
regarding experimentation of their ideas in actual networks, network simulators
have become indispensable tools for investigating and validating various ideas in
all layers of the network. However, most of the wireless network researchers are
not completely familiar with the implications of the assumptions they make for
the physical layer in their scenarios. For the sake of building the case for a good
simulator, it will be demonstrated that unknown assumptions might lead to
wrong conclusions about the performance of the protocols under examination.
Having a feature-rich IEEE 802.11 Physical and MAC in a network
simulator, which has more chance to be a realistic model, is of paramount
interest to both Digital Communications researchers and Networking researchers.
This thesis is an effort to study, design and implement a near-realistic IEEE
802.11a physical layer model, with all the phenomena associated with this layer.
YANS network simulator, a product of INRIA-Planète group and father of
the future NS-3 network simulator, is the simulator whose Physical layer is the
basis of this thesis work. The implementation choices have been made based on
the original architecture and with the intention of causing as little disturbance as
possible to the original mechanics of the simulator.
As the principle objective, this thesis examines what it takes to have a
feature-rich physical layer model, and then as the secondary goal, how these
concepts could be implemented in the network simulator. Not all the explored
concepts are part of the IEEE 802.11a standard, like the propagation models;
nonetheless, they play a key role in having a realistic, and working,
implementation.
We present the related concepts and implementation choices, where
applicable, in a step-by-step approach within this thesis. Different propagation
models, i.e., large-scale path loss models and fading, bit error rate calculation
formulas depending on the type of modulation used and the specific channel type
under examination, forward error correction mechanism employed in IEEE
802.11a and related issues, influence of Viterbi decoder on the bit error rate and,
finally, bit error distribution models are the major issues elaborated in this work.
As a future work, it is envisaged to validate the results of IEEE 802.11
simulations with experiments done in ORBIT and/or Emulab testbeds. The
intention of this work would be measurement-based validation of our models, by
finding a set of physical layer configurations, based on which, a strong correlation
between simulation and experimentation could be achieved.
![](https://csdnimg.cn/release/download_crawler_static/9477260/bg3.jpg)
iii
Acknowledgements
I would like to thank Philippe Martins, my thesis supervisor at Télécom
Paris, for accepting to guide this work. I have come to appreciate his insight on
the field during a course in Mobile Networks that I took with him. I am looking
forward to see our professional relationship lasts in the foreseeable future.
I'd like also to thank Thierry Turletti, my thesis supervisor at INRIA- Planète
group, for his being there for me all along this period. I also acknowledge the help
of Mathieu Lacage regarding YANS issues. Thanks to him, I now have a first-hand
experience about how important it is to properly document a code as an essential
task in any teamwork project.
Diego Dujovne, a cheerful guy from Argentina, with whom I have spent a
memorable period. Our numerous discussions, regardless of their usefulness,
have been very interesting, to say the least. I hereby declare him The Best
Colleague that I have ever had.
I will also greatly miss our life experience sharing with Katia Obraczka who
is currently passing her sabbatical at INRIA, dubbed as "Sabbatical of The
Century". Her joy of life and patience have amazed me.
I also enjoyed the company of Anwar Al Hamra, Thrasyvoulos Spyropolous
(Akis) and Yongho Seok, three Pos-doc researchers at Planète group. Over time,
we have grown friends and I look forward to keeping in touch with them after
leaving INRIA. Many thanks go to Walid Dabbous, head of the group, and Chadi
Barakat, a permanent researcher in Planète, for once-in-a-while interesting
discussions that we have had.
At Télécom Paris, I have had the pleasure of working with Elie Najm,
Philippe Godlewski, Noëmie Simoni and Gérard Pogorel. I would like to
acknowledge the help of these individuals in introducing, and shedding light on,
some of the hard-to-understand and interesting topics of the domain.
Last, but not least, it's Isabelle Demeure, scientific responsible of Networked
Computer Systems Master of Science program at Télécom Paris. Her character is
an interesting, and rare, mixture of professionalism, seriousness and kindness.
Someone who has encouraged me a lot all along the way at Télécom Paris. Her
advices and recommendations have helped me immensely.
I would like to express my deepest gratitude to the individuals named above
and wish them all an even more successful career and a cheerful life in the
future.
Masood Khosroshahy
December 2006 [http://www.m-kh.info]
![](https://csdnimg.cn/release/download_crawler_static/9477260/bg4.jpg)
iv
Table of Contents
ABSTRACT --------------------------------------------------------------------------------------------------------------------------- II
ACKNOWLEDGEMENTS-------------------------------------------------------------------------------------------------------- III
TABLE OF CONTENTS----------------------------------------------------------------------------------------------------------- IV
LIST OF TABLES ------------------------------------------------------------------------------------------------------------------VI
LIST OF FIGURES---------------------------------------------------------------------------------------------------------------- VII
CHAPTER 1 – INTRODUCTION ---------------------------------------------------------------------------------------------- 1
1.1. INTRODUCTION------------------------------------------------------------------------------------------------------------------ 1
1.2. EXISTING PROBLEM ------------------------------------------------------------------------------------------------------------ 2
1.3. THESIS OBJECTIVES AND CONTRIBUTIONS----------------------------------------------------------------------------------- 2
1.4. THESIS ORGANIZATION -------------------------------------------------------------------------------------------------------- 2
CHAPTER 2 – IEEE 802.11 PHY-MAC--------------------------------------------------------------------------------------- 4
2.1. INTRODUCTION------------------------------------------------------------------------------------------------------------------ 4
2.2. INTRODUCTION TO IEEE 802.11 PHY-MAC-------------------------------------------------------------------------------- 4
2.2.1. Introduction --------------------------------------------------------------------------------------------------------------- 4
2.2.2. IEEE 802.11 MAC Layer------------------------------------------------------------------------------------------------ 5
2.2.3. IEEE 802.11 PHY Layer------------------------------------------------------------------------------------------------- 7
2.3. THE IMPORTANCE OF KNOWING ABOUT PHYSICAL LAYER ---------------------------------------------------------------- 7
2.3.1. Introduction --------------------------------------------------------------------------------------------------------------- 7
2.3.2. Digital Communications Researchers --------------------------------------------------------------------------------- 7
2.3.3. Networking Researchers------------------------------------------------------------------------------------------------- 8
2.4. INTRODUCTION TO YANS IEEE 802.11 MODULE -------------------------------------------------------------------------- 9
2.4.1. Introduction --------------------------------------------------------------------------------------------------------------- 9
2.4.2. MAC-----------------------------------------------------------------------------------------------------------------------10
2.4.3. Details of PHY Layer Implementation in YANS ---------------------------------------------------------------------10
CHAPTER 3 – LARGE-SCALE PATH LOSS MODELS – FADING CHANNEL----------------------------------12
3.1. INTRODUCTION-----------------------------------------------------------------------------------------------------------------12
3.2. LARGE-SCALE PATH LOSS MODELS -----------------------------------------------------------------------------------------13
3.2.1. Introduction --------------------------------------------------------------------------------------------------------------13
3.2.2. Free-Space Model-------------------------------------------------------------------------------------------------------13
3.2.3. Two-Ray Model ----------------------------------------------------------------------------------------------------------13
3.2.4. Shadowing Model -------------------------------------------------------------------------------------------------------14
3.3. FADING CHANNEL -------------------------------------------------------------------------------------------------------------15
3.3.1. Introduction --------------------------------------------------------------------------------------------------------------15
3.3.2. Coherence Bandwidth and Delay Spread ----------------------------------------------------------------------------15
3.3.3. Coherence Time and Doppler Spread --------------------------------------------------------------------------------16
3.3.4. Types of Fading Channels----------------------------------------------------------------------------------------------16
3.3.5. Modeling a Flat Frequency-Selective Fading Channel ------------------------------------------------------------17
3.3.6. The Selected Fading Type Implemented in YANS -------------------------------------------------------------------18
3.3.7. Examination of the Generated Fading Processes -------------------------------------------------------------------20
CHAPTER 4 – MODULATION SCHEMES AND FEC DETAILS----------------------------------------------------22
4.1. INTRODUCTION-----------------------------------------------------------------------------------------------------------------22
4.2. CONVOLUTIONAL ENCODER–DECODER-------------------------------------------------------------------------------------22
4.2.1. Encoding------------------------------------------------------------------------------------------------------------------22
4.2.2. Viterbi Decoding --------------------------------------------------------------------------------------------------------25
4.3. MODULATION SCHEMES ------------------------------------------------------------------------------------------------------26
CHAPTER 5 – BIT ERROR RATE, PACKET ERROR RATE AND ERROR MASKS--------------------------28
5.1. INTRODUCTION-----------------------------------------------------------------------------------------------------------------28
![](https://csdnimg.cn/release/download_crawler_static/9477260/bg5.jpg)
v
5.2. BER BEFORE AND AFTER DECODER ----------------------------------------------------------------------------------------28
5.2.1. Introduction --------------------------------------------------------------------------------------------------------------28
5.2.2. BER After Modulator – Before Decoder------------------------------------------------------------------------------29
5.2.3. BER After Viterbi Decoder---------------------------------------------------------------------------------------------32
5.3. PER CALCULATION METHODS AND ERROR MASKS -----------------------------------------------------------------------33
5.3.1. Introduction --------------------------------------------------------------------------------------------------------------33
5.3.2. Uniform Error Distribution --------------------------------------------------------------------------------------------33
5.3.3. Non-Uniform Error Distribution --------------------------------------------------------------------------------------34
CHAPTER 6 – CONCLUDING REMARKS & FUTURE WORK-----------------------------------------------------36
6.1. CONCLUDING REMARKS ------------------------------------------------------------------------------------------------------36
6.2. EMULAB AND ORBIT ---------------------------------------------------------------------------------------------------------36
6.3. FUTURE WORK -----------------------------------------------------------------------------------------------------------------37
ANNEX.1. A BRIEF OVERVIEW OF FADING CHANNEL IMPLEMENTATION IN NS-2---------------------38
A.1.1. IMPLEMENTATION IN NS-2-------------------------------------------------------------------------------------------------38
A.1.2. A NOTE FOR NS-2 DEVELOPERS AND USERS -----------------------------------------------------------------------------39
ANNEX.2. A SIMPLE SIMULATION SCENARIO: 2 NODES COMMUNICATING IN AD-HOC MODE--41
A.2.1. CODE “MAIN-80211-ADHOC.CC”------------------------------------------------------------------------------------------41
A.2.2. TERMINAL OUTPUT ---------------------------------------------------------------------------------------------------------44
A.2.3. GENERATED ERROR MASKS – FOR ONE PACKET-------------------------------------------------------------------------48
ANNEX.3. A BRIEF COMPARATIVE STUDY OF IEEE 802.11 PHY-MAC MODELS IN WELL-KNOWN
OPEN SOURCE NETWORK SIMULATORS---------------------------------------------------------------------------------49
A.3.1. NS2---------------------------------------------------------------------------------------------------------------------------50
A.3.2. OMNET++ ------------------------------------------------------------------------------------------------------------------53
A.3.3. GLOMOSIM------------------------------------------------------------------------------------------------------------------55
A.3.4. J-SIM -------------------------------------------------------------------------------------------------------------------------57
A.3.5. YANS ------------------------------------------------------------------------------------------------------------------------58
ANNEX.4. CODES------------------------------------------------------------------------------------------------------------------60
PROPAGATION-MODEL.H -----------------------------------------------------------------------------------------------------------60
PROPAGATION-MODEL.CC ----------------------------------------------------------------------------------------------------------66
TRANSMISSION-MODE.CC-----------------------------------------------------------------------------------------------------------71
BPSK-MODE.CC ----------------------------------------------------------------------------------------------------------------------77
QAM-MODE.CC-----------------------------------------------------------------------------------------------------------------------81
REFERENCES------------------------------------------------------------------------------------------------------------------------86