Download as pdf or txt
Download as pdf or txt
You are on page 1of 84

DEPARTMENT OF COMPUTER SCIENCE &

ENGINEERING

LAB MANUAL OF
WIRELESS COMMUNICATION LAB
ETEC 463

Maharaja Agrasen Institute of Technology, PSP area,


Sector – 22, Rohini, New Delhi – 110086
Affiliated to
{GuruGobindSinghIndraprasthaUniversity, Dwarka New Delhi }

Department of Computer Science and Engineering, MAIT 1


INDEX OF THE CONTENTS

Vision of the Institute ............................................................................................................................ 5


Mission of the Institute .......................................................................................................................... 5
DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING ................................................. 6
Vision of the Department: ..................................................................................................................... 6
Mission of the Department: ................................................................................................................... 6
1. Introduction to Wireless Communication Lab .................................................................................. 7
1.1 Objective ............................................................................................................................................... 7
1.2 Course outcomes................................................................................................................................... 7
2. Lab requirements (details of H/W & S/W to be used) ....................................................................... 8
3.LIST OF EXPERIMENTS ................................................................................................................. 9
(as per GGSIPU Syllabus) ...................................................................................................................... 9
4. LIST OF EXPERIMENTS .............................................................................................................. 10
(Beyond Curricula) ............................................................................................................................... 10
5 FORMAT OF THE LAB RECORD TO BE PREPARED BY THE STUDENTS ................... 11
6. MARKING SCHEME FOR THE PRACTICAL EXAMS .......................................................... 13
7. Steps to Make Basic NS3 Programs ............................................................................................. 50
8. Experiment No 1 .............................................................................................................................. 53
AIM: Write a program in Scilab to Calculate Frequency Reuse Distance ,Co-Channel Interference
reduction factor, Cellular System Capacity, S/I Ratio for a given variables ...................................... 53
1.3 Short Questions ............................................................................................................................ 62
9. Experiment No 2 .......................................................................................................................... 63
AIM:Write a Program in Scilab to calculate maximum traffic intensity and maximum no. of users
accomodated in Erlang B and Erlang C system for given no of channels........................................... 63
9.1 STEPS ........................................................................................................................................... 65
9.2 PROGRAM......................................................................................................................................... 65
9.4 Short Questions .................................................................................................................................. 69
10. Experiment No.3 ............................................................................................................................ 70
AIM:Write a Program in Scilab to calculate Bit Error rate performance of BPSK modulated signal
over only AWGN channel and AWGN and Rayleigh channel both. ................................................... 70
10.1 Steps: ................................................................................................................................................. 75
10.2 Program: ........................................................................................................................................... 76
10.3 Output: .............................................................................................................................................. 79
10.4 Short Questions: ............................................................................................................................... 80
11. Experiment No.4 ............................................................................................................................ 81

Department of Computer Science and Engineering, MAIT 2


AIM: Program in Scilab to Generate Walsh Codes and then spread the user information using it.
11.1 Steps: ................................................................................................................................................. 82
11.2 Program: ........................................................................................................................................... 82
11.4 Short Questions: ............................................................................................................................... 88
12. Experiment No. 5 ........................................................................................................................... 89
AIM:Program in Scilab to Generate PN Sequence for CDMA Systems. ............................................ 91
12.1 Program: ........................................................................................................................................... 91
12.3 Output: .............................................................................................................................................. 95
12.4 Short Questions: ......................................................................................................................... 103
13. Experiment No. 6 ......................................................................................................................... 104
AIM:Write a Program in NS3 to connect WIFI TO BUS (CSMA) Network ................................... 104
13.1 Introduction to LTE: ..................................................................................................................... 104
13.2 STEPS: ............................................................................................................................................ 105
13.3 BASIC Outline ................................................................................................................................ 105
13.4 Complete Program: ........................................................................................................................ 110
13.6 Short Questions: ............................................................................................................................. 111
14. Experiment No. 7 ......................................................................................................................... 112
AIM: Write a Program in NS3 to create WIFI Network in SIMPLE INFRASTUCTURE MODE (of
nodes)....................................................................................................................................................... 112
14.1 STEPS: ............................................................................................................................................ 112
14.2 Program .......................................................................................................................................... 113
14.3 Output ............................................................................................................................................. 116
14.4 Short Questions: ............................................................................................................................. 118
15. Experiment No. 8 ......................................................................................................................... 119
AIM:Write a Program in NS3 to Create a wireless mobile ad-hoc network between three nodes. 119
Short Questions ................................................................................................................................. 124
16. Experiment No. 9 ......................................................................................................................... 125
AIM:Write a program in Scilab to simulate 3G WCDMA transmission and reception. Plot the graph
for each stage. ......................................................................................................................................... 125
16.1 Steps: ............................................................................................................................................... 126
16.2 OUTPUT ......................................................................................................................................... 139
17. Experiment No. 10 ......................................................................................................................... 78
AIM:Write a Program in Scilab to study the variation in channel capacities of 4G MIMO systems
(2x2, 3x3, 4x4 systems) and plot the graph.. ........................................................................................ 150
17.1 Steps: ............................................................................................................................................... 150
17.2 Output: ............................................................................................................................................ 152
17.3 Short Questions: ............................................................................................................................. 153
18. Experiment No. 11 ....................................................................................................................... 145

Department of Computer Science and Engineering, MAIT 3


AIM: To configure routing between wired and wireless Networks. .................................................. 145
18.1 STEPS: ............................................................................................................................................ 145
18.2 Short Questions: ............................................................................................................................. 146
19. Experiment No. 12 ....................................................................................................................... 147
AIM: To configure security in wireless network with and without infrastructure support. .......... 147
19.1 Steps: ............................................................................................................................................... 148
19.2 Short Questions: ............................................................................................................................. 148

Department of Computer Science and Engineering, MAIT 4


MAHARAJA AGRASEN INSTITUTE OF TECHNOLOGY
Vision of the Institute
To nurture young minds in a learning environment of high academic value and imbibe
spiritual and ethical values with technological and management competence.
Mission of the Institute
The Institute shall endeavor to incorporate the following basic missions in the teaching
methodology:
Engineering Hardware – Software Symbiosis
Practical exercises in all Engineering and Management disciplines shall be carried out by
Hardware equipment as well as the related software enabling deeper understanding of basic
concepts and encouraging inquisitive nature.
Life – Long Learning
The Institute strives to match technological advancements and encourage students to keep
updating their knowledge for enhancing their skills and inculcating their habit of continuous
learning.
Liberalization and Globalization
The Institute endeavors to enhance technical and management skills of students so that they
are intellectually capable and competent professionals with Industrial Aptitude to face the
challenges of globalization.
Diversification
The Engineering, Technology and Management disciplines have diverse fields of studies
with different attributes. The aim is to create a synergy of the above attributes by encouraging
analytical thinking.
Digitization of Learning Processes
The Institute provides seamless opportunities for innovative learning in all Engineering and
Management disciplines through digitization of learning processes using analysis, synthesis,
simulation, graphics, tutorials and related tools to create a platform for multi-disciplinary
approach.
Entrepreneurship
The Institute strives to develop potential Engineers and Managers by enhancing their skills
and research capabilities so that they become successful entrepreneurs and responsible
citizens.

Department of Computer Science and Engineering, MAIT 5


DEPARTMENT OF COMPUTER SCIENCE AND ENGINEERING

Vision of theDepartment:
To create the most conducive learning environment for quality education in computer science and
engineering and prepare the students for a globalised technological society and orient them towards
serving the society.

Mission of theDepartment:

• To impart high quality education and training to the students to make them world-class
Engineer with a foresight to the challenges and problems.
• To offer innovative solutions to benefits the nation and world at large.
Department GOALS:
• To build a team of academicians, to attain excellence, to offer programmes in computer science &
engineering at UG level.
• To motivate faculty members for higher education.
• To improve existing labs and develop new labs.
• To inculcate moral values in students.
Program Educational Objective:
PEO1: To train students to have successful careers in computer engineering field or to be able to
successfully pursue advanced degrees.

PEO2: To imbibe in students an ability to provide solutions to challenging problems in their


profession by applying computer Engineering principles.

PEO3: Train students to communicate effectively, work collaboratively and exhibit high levels of
professionalism and ethical responsibility.

PEO4: To motivate graduates to engage in life-long learning and professional development to adapt
to rapidly changing work environment.

Department of Computer Science and Engineering, MAIT 6


1. Introduction to Wireless Communication Lab

1.1 Objective

The objective of the wireless communications lab course is to introduce CSE students to the field
of wireless cellular network planning. It would give them hands-on experience through a set of
experiments using Scilab and NS3 software. It would also give them an understanding of practical
wireless communication systems such as GSM, CDMA, WDCMA, Wifi and Basics of 4G
Technologies. The lab consists of Eleven experiments and each experiment consists of simulations
using Scilab or network simulator:

1.2 Course outcomes

Students will be able to get:

C463.1 Calculate various parameters for cellular wireless systems using Scilab.

C463.2 Understand various concepts, protocols, technologies related to wireless Communication


systems by simulating them using Scilab or NS3.

C463.3 Analyze and apply mathematical models of different wireless networks concepts using
NS3 or Scilab.

463.4 Create and Configure Wifi networks, Plot using 2D/3D graphs generation and reception of
signals in Wireless Cellular networks.

463.5 Compare and analyze data transmission using different modulation techniques and BER
performance of different channels in wireless communication networks.

463.6 Do R and D in Latest Trends in Wireless Communication, document it and publish research
papers in reputed conference or journals

Department of Computer Science and Engineering, MAIT 7


2. Lab requirements (details of H/W & S/W to be used)

Hardware
Requirements:

Intel i3/C2D Processor/2 GB RAM/500GB HDD/MB/Lan Card/

Key Board/ Mouse/CD Drive/15” Color Monitor/ UPS

Software
Requirements: Scilab 6.1.0 and above, Linux(Fedora/Ubuntu), NS3 3.24 and above

Department of Computer Science and Engineering, MAIT 8


3.LIST OF EXPERIMENTS

(as per GGSIPU Syllabus)

1. Write a program in Scilab to Calculate Frequency Reuse Distance, Co-Channel Interference


reduction factor, Cellular System Capacity, S/I Ratio for a given variables.
2. Write a Program in Scilab to calculate maximum traffic intensity and maximum no. of users
accommodated in Erlang B and Erlang C system for given no of channels.
3. Write a Program in Scilab to calculate Bit Error rate performance of BPSK modulated signal over
only AWGN channel and AWGN and Rayleigh channel both.
4. Program in Scilab to Generate Walsh Codes and then spread the user information using it.
5. Program in Scilab to Generate PN Sequence for CDMA Systems.
6. Write a Program in NS3 to connect Wifi to Bus (CSMA) Network.
7. Write a Program in NS3 to create Wifi Network in Simple Infrastructure mode (of nodes).
8. Write a Program in NS3 to Create a wireless mobile ad-hoc network between three nodes.
9. Write a program in Scilab to simulate 3G WCDMA transmission and reception. Plot the graph for
each stage.
10. Write a Program in Scilab to study the variation in channel capacities of 4G MIMO systems (2x2,
3x3, 4x4 systems) and plot the graph.

Department of Computer Science and Engineering, MAIT 9


4. LIST OF EXPERIMENTS

(Beyond Curricula)

1. Configuring Access Point with bridging mode (Point to Point and Point to Multi Point).

2. Configuring Routing between wired and wireless Networks.

3. Configuring Security in wireless network with and without infrastructure support.

4. Write a Review paper on Latest Technologies/ Techniques to be used to implement 5G in India

and how it will support Green Communication in India.

Department of Computer Science and Engineering, MAIT 10


6 FORMAT OF THE LAB RECORD TO BE
PREPARED BY THE STUDENTS

The front page of the lab record prepared by the students should have a cover page as displayed below.

WIRELESS COMMUNICATIONS

ETEC 463
Font should be (Size 20”, italics bold, Times New Roman)

Faculty name Student name

Roll No.:

Semester:

Font should be (12”, Times Roman)

Maharaja Agrasen Institute of Technology, PSP Area,

Sector – 22, Rohini, New Delhi – 110086

Department of Computer Science and Engineering, MAIT 11


Experiments according to the Lab syllabus

Exp. no Date of Date of Marks Signature


Experiment Name
performance checking

1 Write a program in Scilab to Calculate Frequency Reuse Distance, Co-


Channel Interference reduction factor, Cellular System Capacity, S/I Ratio
for a given variables.
2 Write a Program in Scilab to calculate maximum traffic intensity and
maximum no. of users accommodated in Erlang B and Erlang C system
for given no of channels.
3 Write a Program in Scilab to calculate Bit Error rate performance of BPSK
modulated signal over only AWGN channel and AWGN and Rayleigh
channel both.
4 Program in Scilab to Generate Walsh Codes and then spread the user
information using it.
5 Program in Scilab to Generate PN Sequence for CDMA Systems.

6 Write a Program in NS3 to connect Wifi to Bus (CSMA) Network.

7 Write a Program in NS3 to create Wifi Network in Simple Infrastructure


mode (of nodes).
8 Write a Program in NS3 to Create a wireless mobile ad-hoc network
between three nodes.
9 Write a program in Scilab to simulate 3G WCDMA transmission and
reception. Plot the graph for each stage.
10 Write a Program in Scilab to study the variation in channel capacities of
4G MIMO systems (2x2, 3x3, 4x4 systems) and plot the graph.

Department of Computer Science and Engineering, MAIT 12


MARKING SCHEME FOR THE PRACTICAL EXAMS
There will be two practical exams in each semester.

i. Internal Practical Exam


ii. External Practical Exam

INTERNAL PRACTICAL EXAM

It is taken by the respective faculty of the batch.

MARKING SCHEME FOR THIS EXAM IS:

Total Marks: 40

Division of 10 marks per practical is as follows:

Rubrics for : Laboratory (General)

Experiment Grading Rubrics


Max.
Sr No. Component
Marks
(LAC) 2 marks 1 mark

Completeness of practical, exhibits


Practical Incomplete practical, unformatted, lacks
1 2 proficiency in using different types of
Performance comments, Demonstrates no proficiency.
inputs.

Output is free of errors and output is Output contains few logical errors and/or
Output and obtained. Demonstrates excellent no output is obtained. Demonstrates partial
2 2
Validation understanding of the concepts relevant understanding of the concepts relevant to
to the experiment. the experiment.

Attendance 1. Four marks for answering more than 75% questions.


and Viva
3 4 2. Two marks for answering more then 50% questions.
Questions
Answered 3. One mark for answering less then 50% questions.

Timely
4 Submission of 2 On time submission Late submission
Lab Record

Each experiment will be evaluated out of 10 marks. At the end of the semester average of 8 best
performed practical will be considered as marks out of 40.

Department of Computer Science and Engineering, MAIT 13


EXTERNAL PRACTICAL EXAM

It is taken by the concerned faculty of the batch and by an external examiner. In this exam student
needs to perform the experiment allotted at the time of the examination, a sheet will be given to
the student in which some details asked by the examiner needs to be written and at the last viva
will be taken by the external examiner.

MARKING SCHEME FOR THIS EXAM IS:

Total Marks: 60

Division of 60 marks is as follows

1. Sheet filled by the student: 20

2. Viva Voice: 15

3. Experiment performance: 15

4. File submitted: 10

NOTE:

• Internal marks + External marks = Total marks given to the students


(40 marks) (60 marks) (100 marks)

• Experiments given to perform can be from any section of the lab.

Department of Computer Science and Engineering, MAIT 14


Wireless Communication ETEC 463

Steps to Make Basic NS3 Programs


Some of basic steps involved in making programs in NS3 are list below:
Simple client-server communication

1. Create a simple topology of two nodes (Node1, Node2) separated by a point-to-point link.
2. Setup a UdpClient on one Node1 and a UdpServer on Node2. Let it be of a fixed data rate Rate1.
3. Start the client application, and measure end to end throughput whilst varying the latency of the
link.
4. Now add another client application to Node1 and a server instance to Node2. What do you need
to configure to ensure that there is no conflict?
5. Repeat step 3 with the extra client and server application instances. Show screenshots of pcap
traces which indicate that delivery is made to the appropriate server instance.
TCP variants

1. Create a simple dumbbell topology, two client Node1 and Node2 on the left side of the dumbbell
and server nodes Node3 and Node4 on the right side of the dumbbell. Let Node5 and Node6
form the bridge of the dumbbell. Use point to point links.
2. Install a TCP socket instance on Node1 that will connect to Node3.
3. Install a UDP socket instance on Node2 that will connect to Node4.
4. Start the TCP application at time 1s.
5. Start the UDP application at time 20s at rate Rate1 such that it clogs half the dumbbell bridge's
link capacity.
6. Increase the UDP application's rate at time 30s to rate Rate2 such that it clogs the whole of the
dumbbell bridge's capacity.
7. Use the ns-3 tracing mechanism to record changes in congestion window size of the TCP instance
over time. Use gnuplot/matplotlib to visualise plots of cwnd vs time.
8. Mark points of fast recovery and slow start in the graphs.
9. Perform the above experiment for TCP variants Tahoe, Reno and New Reno, all of which are
available with ns-3.

Department of Computer Science and Engineering, MAIT 15


Wireless Communication ETEC 463

TCP and router queues

1. Create a simple dumbbell topology, two client Node1 and Node2 on the left side of the dumbbell
and server nodes Node3 and Node4 on the right side of the dumbbell. Let Node5 and Node6
form the bridge of the dumbbell. Use point to point links.
2. Add drop tail queues of size QueueSize5 and QueueSize6 to Node5 and Node6, respectively.
3. Install a TCP socket instance on Node1 that will connect to Node3.
4. Install a TCP socket instance on Node2 that will connect to Node3.
5. Install a TCP socket instance on Node2 that will connect to Node4.
6. Start Node1--Node3 flow at time 1s, then measure it's throughput. How long does it take to fill
link's entire capacity?
7. Start Node2--Node3 and Node2--Node4 flows at time 15s, measure their throughput.
8. Measure packet loss and cwnd size, and plot graphs throughput/time, cwnd/time and packet
loss/time for each of the flows.
9. Plot graph throughput/cwnd and packet loss/cwnd for the first flow. Is there an optimal value for
cwnd?
10. Vary QueueSize5 and QueueSize6.
Routing (Optimised Link State Routing)

1. Create a wireless mobile ad-hoc network with three nodes Node1, Node2 and Node3. Install the
OLSR routing protocol on these nodes.
2. Place them such that Node1 and Node3 are just out of reach of each other.
3. Create a UDP client on Node1 and the corresponding server on Node3.
4. Schedule Node1 to begin sending packets to Node3 at time 1s.
5. Verify whether Node1 is able to send packets to Node3.
6. Make Node2 move between Node1 and Node3 such that Node2 is visible to both A and C. This
should happen at time 20s. Ensure that Node2 stays in that position for another 15s.
7. Verify whether Node1 is able to send packets to Node3.
8. At time 35s, move Node2 out of the region between Node1 and Node3 such that it is out of each
other's transmission ranges again.
9. Verify whether Node1 is able to send packets to Node3.
10. To verify whether data transmissions occur in the above scenarios, use either the tracing
mechanism or a RecvCallback() for Node3's socket.
11. Plot the number of bytes received versus time at Node3.

Department of Computer Science and Engineering, MAIT 16


Wireless Communication ETEC 463

12. Show the pcap traces at Node 2's Wifi interface, and indicate the correlation between Node2's
packet reception timeline and Node2's mobility.

Wifi RTS/CTS

1. Setup a 5x5 wireless adhoc network with a grid. You may use examples/wireless/wifi-simple-
adhoc-grid.cc as a base.
2. Install the OLSR routing protocol.
3. Setup three UDP traffic flows, one along each diagonal and one along the middle (at high rates
of transmission).
4. Setup the ns-3 flow monitor for each of these flows.
5. Now schedule each of the flows at times 1s, 1.5s, and 2s.
6. Now using the flow monitor, observe the throughput of each of the UDP flows. Furthermore,
use the tracing mechanism to monitor the number of packet collisions/drops at intermediary
nodes. Around which nodes are most of the collisions/drops happening?
7. Now repeat the experiment with RTS/CTS enabled on the wifi devices.
8. Show the difference in throughput and packet drops if any.

Wifi Channels

1. Setup a 2-nodes wireless adhoc network. Place the nodes at a fixed distance in a 3d scenario.
2. Install all the relevant network stacks, up to and including UDP.
3. Setup a CBR transmission between the nodes, one acting as a server and one as a client. Take
the iperf[1] behaviour as an example.
4. Setup counters and outputs for packets sent and received.
5. Schedule the simulation to run for enough time to obtain statistically relevant results (suggestion:
analyze some test results and reduce the simulation time accordingly).
6. Repeat the simulation varying the distance between the nodes from a minimum of 1meter to the
point where the nodes can't transmit/receive anymore.
7. Repeat the above varying the channel models and the transmission/receive parameters like node's
position above the ground, transmission power, etc.
8. Show the differences between the various channel models, and comment them. Identify the
channel model that is more appropriate for each case (indoor, outdoor, LoS, NLoS, etc.).

Department of Computer Science and Engineering, MAIT 17


Wireless Communication ETEC 463

8. Experiment No 1
AIM: Write a program in Scilab to Calculate Frequency Reuse
Distance ,Co-Channel Interference reduction factor, Cellular System
Capacity, S/I Ratio for a given variables.
Introduction
Frequency Reuse Distance (D)

• Reusing an identical frequency channel after a certain distance , then the Distance is
called Frequency Reuse Distance.
• The cochannel interference can become a major problem in cellular communication.
• It is desirable to find the minimum frequency reuse distance D in order to reduce this
cochannel interference.
• D=R * sqrt( 3*N)

Frequency Reuse Ratio (q)

The frequency reuse ratio, q is also referred asthe cochannel reuse ratio.

Cluster Size and Cell Capacity

• In a cellular system, the whole geographical service area is divided into a number of clusters
having finite number of cells and the number of Cluster in a cluster cell is called Cluster Size.
• Each cell in the cluster contains J = (N/K) number of channels only
• Therefore, N i.e total number of frequency channels = J x K; where J ≤ N
• The Number of Channels in a cells is called the Cell Capacity.
• Let M be the number of clusters in the system, then overall system capacity, C is given as
• C = M x N → C = M x J x K (N = J x K)
• When K is reduced, J is proportionally increased since N = J x K is constant.

Interference and System Capacity

• Received power at a distance d from the transmitting antenna is approximated by

• Useful signal at the cell boundary is the weakest, given by Pr (R). Interference signal from
the co-channel cell is given to be Pr (D′) .
• D’ is normally approximated by the base station separation between the two cells D, unless
when accuracy is needed. Hence
For the forward link, a very general case,

Department of Computer Science and Engineering, MAIT 18


Wireless Communication ETEC 463

where Diis the distance of the ith interfering cell from the mobile, i0 is the total number of co-
channel cells exist.
n, is the path loss coefficient, n=4 and i0=6

• If only first tier co-channel cells are considered, then i0 = 6.


Unless otherwise stated, normally assuming Di≈ D for all i.

8.1 Steps need to be performed


a) Calculating Frequency Reuse Distance For Different Radii

• Start.
• Accept Value of number of Cells Per Cluster i.e. N from User.
• Create a function that draws a hexagon.
• Draw a Cluster with N hexagon in each Cluster.
• Write appropriate frequencies in each Cluster.
• Stop.

b)Plotting Frequency Reuse Distance vs Radius Graph.


• Start.
• Accept Value of number of Cells Per Cluster i.e. N from User.
• Accept Value of Radii from a range by a incrementation.
• Calculate the Frquency Reuse Distance.
• Plot the Frequency Reuse Distance Vs Radius.
• Stop.

c) Calculating theoretical Ratio(Q) and Actual Ratio(q) of Frequency Reuse Distance(D)and


Radius(R). Then Finding Error between them.
• Start.
• Accept Value of number of Cells Per Cluster, Frequenc Reuse Distance and Radius i.e. Values
of N, D and R from User.
• Calculate the Value of Theoretical Ratio(Q), Actual Ratio(q) and Error using the input Value.
• Stop.
d) Plotting Theoretical Ratio(Q) vs values of N.(Line Plot)
• Start.
• Accept Value of number of Cells Per Cluster i.e. N from User.
• Calculate theTheoretical Ratio(Q).
• Plot the Theoretical Ratio(Q) vs values of N.(Line Plot)

Department of Computer Science and Engineering, MAIT 19


Wireless Communication ETEC 463

• Stop.

e) Plotting Theoretical Ratio(Q) vs values of N. (Scatter Plot)


• Start.
• Accept Value of number of Cells Per Cluster i.e. N from User.
• Calculate theTheoretical Ratio(Q).
• Plot the Theoretical Ratio(Q) vs values of N.(Scatter Plot)
• Stop.

f) Calculating Total Capacity in number of channels clusters.


• Start.
• Accept Value of number of Cells Per Cluster i.e. N from User.
• Accept Value of number of Channel in a Cluster i.e. from User.
• Accept Value of number of Cluster i.e. from User.
• Calculate the No. of Channels in a Single Cell.
• Calculate the Capacity of System using Input Values.
• Stop.

8.2 Output:

a) Plotting Frequency Reuse Distance vs Radius Graph.


Output

Department of Computer Science and Engineering, MAIT 20


Wireless Communication ETEC 463

b) Calculating theoretical Ratio(Q) and Actual Ratio(q) of Frequency Reuse Distance(D)and


Radius(R). Then Finding Error between them.
Output

c) Plotting Theoretical Ratio(Q) vs values of N.(Line Plot)

Output

Department of Computer Science and Engineering, MAIT 21


Wireless Communication ETEC 463

d) Plotting Theoretical Ratio(Q) vs values of N. (Scatter Plot)


Output

e) Calculating Total Capacity in number of channels clusters.


Output

Department of Computer Science and Engineering, MAIT 22


Wireless Communication ETEC 463

f) Calculating Signal to Noise Ratio for different attenuation factors.


Output

Department of Computer Science and Engineering, MAIT 23


Wireless Communication ETEC 463

8.3 Short Questions

Q.1How do you calculate co channel interference?

Q.2How do you find the frequency reuse factor?

Q.3What is a frequency reuse factor for n number of cells in a system?

Q.4How can co channel interference be reduced?

Department of Computer Science and Engineering, MAIT 24


Wireless Communication ETEC 463

9.Experiment No.2
AIM: Write a Program in Scilab to calculate maximum traffic intensity
and maximum no. of users accomodated in Erlang B and Erlang C
system for given no of channels.

Introduction
Trunking and Grade of Service (GOS)

Trunking:
Trunking is a technique used in data communications transmission systems to provide many users with
access to a network by sharing multiple lines or frequencies. As the name implies, the system is like a
tree with one trunk and many branches. Trunking is commonly used in very-high-frequency (VHF)
radio and telecommunication systems.

Trunking can also be defined as a network that handles multiple signals simultaneously. The data
transmitted through trunking can be audio, video, controlling signals or images.

Estimate traffic distribution?


– Traffic intensity is measured in Erlangs (mathematician AK Erlang)
– One Erlang = completely occupied channel,
– Example: a radio channel occupied for 30 min. per hour carries 0.5 Erlangs
• Traffic intensity per user Au
Au = average call request rate x average holding time = λ x H
• Total traffic intensity = traffic intensity per user x number of users = Au x U
• Example 100 subscribers in a cell
20 make 1 call/hour for 6 min => 20 x 1 x 6/60 = 2E
100 users produce 3.5 E load or 35mE per user

Traffic Measurement (Erlangs)

Department of Computer Science and Engineering, MAIT 25


Wireless Communication ETEC 463

Erlang C Model –Blocked calls cleared


• A different type of trunked system queues blocked calls –Blocked Calls Delayed. This is
known as an Erlang C model.
Procedure:
• Determine Pr[delay> 0] = probability of a delay from the chart.
• Pr[delay > t | delay > 0 ] = probability that the delay is longer than t, given that there is a
delay
Pr[delay > t | delay > 0 ] =exp[-(C-A)t /H ]
• Unconditional Probability of delay > t :
Pr[delay > t ] = Pr[delay > 0] Pr[delay > t | delay > 0 ]
• Average delay time D = Pr[delay > 0] H/ (C-A)

Erlang C Formula
• The likelihood of a call not having immediate access to a channel is determined by Erlang C
formula:

9.1STEPS
• Start
• Set up all the necessary Connections.
• Accept Value of Blocking Probability using ErlangB i.e. From User.
• Accept Value of Call Duration using ErlangB i.e. From User.
• Accept Value of Number Of Channels using ErlangB i.e. From User.
• Calculate the Traffic Intensity per User using ErlangB.
• Calculate the Maximum Traffic Intensity for the input Blocking Probability using ErlangB.
• Repeat the Above Procedure For ErlangC.
• Stop.

Department of Computer Science and Engineering, MAIT 26


Wireless Communication ETEC 463

9.3 Output

Department of Computer Science and Engineering, MAIT 27


Wireless Communication ETEC 463

9.4 Short Questions

Q.1How is Erlang traffic calculated?

Q.2What is Erlang B formula?

Q.3Who developed the fundamentals of trunking theory?

Q.4What is the unit of traffic?

Department of Computer Science and Engineering, MAIT 28


Wireless Communication ETEC 463

10. Experiment No.3


AIM: Write a Program in Scilab to calculate Bit Error rate
performance of BPSK modulated signal over only AWGN channel and
AWGN and Rayleigh channel both.
Introduction:

Phase Shift Keying PSKPSK is the digital modulation technique in which the phase of the carrier
signal is changed by varying the sine and cosine inputs at a particular time. PSK technique is widely
used for wireless LANs, bio-metric, contactless operations, along with RFID and Bluetooth
communications.
PSK is of two types, depending upon the phases the signal gets shifted. They are –
1. Binary Phase Shift Keying(BPSK)
2. Quadrature Phase Shift Keying(QPSK)
Binary Phase Shift Keying BPSK
This is also called as 2-phase PSK or Phase Reversal Keying. In this technique, the sine wave carrier
takes two phase reversals such as 0° and 180°.
BPSK is basically a Double Side Band Suppressed Carrier DSBSCDSBSC modulation scheme, for
message being the digital information.

BPSK Modulator
The block diagram of Binary Phase Shift Keying consists of the balance modulator which has the
carrier sine wave as one input and the binary sequence as the other input. Following is the
diagrammatic representation.

Department of Computer Science and Engineering, MAIT 29


Wireless Communication ETEC 463

The modulation of BPSK is done using a balance modulator, which multiplies the two signals
applied at the input. For a zero binary input, the phase will be 0° and for a high input, the phase
reversal is of 180°.
Following is the diagrammatic representation of BPSK Modulated output wave along with its given
input.

The output sine wave of the modulator will be the direct input carrier or the
inverted 180°phaseshifted180°phaseshifted input carrier, which is a function of the data signal.

BPSK Demodulator
The block diagram of BPSK demodulator consists of a mixer with local oscillator circuit, a bandpass
filter, a two-input detector circuit. The diagram is as follows.

Department of Computer Science and Engineering, MAIT 30


Wireless Communication ETEC 463

By recovering the band-limited message signal, with the help of the mixer circuit and the band pass
filter, the first stage of demodulation gets completed. The base band signal which is band limited is
obtained and this signal is used to regenerate the binary message bit stream.
In the next stage of demodulation, the bit clock rate is needed at the detector circuit to produce the
original binary message signal. If the bit rate is a sub-multiple of the carrier frequency, then the bit
clock regeneration is simplified. To make the circuit easily understandable, a decision-making
circuit may also be inserted at the 2nd stage of detection.

Probability of error given s₁ was transmitted

Probability of error given s₀ was transmitted

Multipath environment

Department of Computer Science and Engineering, MAIT 31


Wireless Communication ETEC 463

In a multipath environment, it is reasonably intuitive to visualize that an impulse transmitted from


transmitter will reach the receiver as a train of impulses.

Assumptions
1. The channel is flat fading – In simple terms, it means that the multipath channel has only one tap.
So, the convolution operation reduces to a simple multiplication.
2. The channel is randomly varying in time – meaning each transmitted symbol gets multiplied by a
randomly varying complex number ɦ . Since ɦ is modeling a Rayleigh channel, the real and imaginary
parts are Gaussian distributed having mean 0 and variance 1/2.

Bit Error Rate for Rayleigh Fading

Department of Computer Science and Engineering, MAIT 32


Wireless Communication ETEC 463

A circularly symmetric complex Gaussian random variable is of the form

Calculation of H
H= Hreal + i*Himaginary where
Hreal = sigma * rand (1,n)
Himaginary =sigma* rand(1,n)
Here sigma = 1/sqrt(2)

10.1 Steps
Steps in Scilab ( for Only AWGN Channel)
• Generation of random BPSK modulated symbols +1′s and -1′s
• Passing them through Additive White Gaussian Noise channel
• Demodulation of the received symbol based on the location in the constellation
Department of Computer Science and Engineering, MAIT 33
Wireless Communication ETEC 463

• Counting the number of errors


• Repeating the same for multiple Eb/No value

Steps in Scilab (AWGN+ Rayleigh Fading Channel)


• Generate random binary sequence of +1′s and -1′s.
• Multiply the symbols with the channel and then add white Gaussian noise.
• At the receiver, equalize (divide) the received symbols with the known channel
• Perform hard decision decoding and count the bit errors
• Repeat for multiple values of Eb/No and plotthe simulation

10.3 Output

Department of Computer Science and Engineering, MAIT 34


Wireless Communication ETEC 463

10.4 Short Questions:

Q.1 What is a good bit error rate?

Q.2 What is the difference between probability of error and bit error rate?

Q.3 How to reduce BER?

Q.4 What is AWGN channel?

Q.5 What is the difference between Rayleigh and Rician fading?

Department of Computer Science and Engineering, MAIT 35


Wireless Communication ETEC 463

11. Experiment No.4


AIM: Program in Scilab to Generate Walsh Codes and then spread the
user information using it.
Introduction:

Hadamard-Walsh Code

In code division multiple access (CDMA) communication, the Hadamard code is referred to
as Walsh Code, and is used to define individual communication channels. It is usual in
the CDMA literature to refer to codewords as “codes”. Each user will use a different codeword, or
“code”, to modulate their signal.
Walsh Code is a group of spreading codes having good autocorrelation properties and poor cross
correlation properties. Walsh codes are the backbone of CDMA systems and are used to develop the
individual channels in CDMA.

The four orthogonal sequences in this Walsh code set are taken from the rows of the matrixH4 ; that
is,

W0 = [ 0 0 0 0 ] W1 = [ 0 1 0 1 ] W2 = [ 0 0 1 1 ]
W3 = [ 0 1 1 0 ]

Walsh Codes
• Orthogonal codes
• Length – power of 2 (1,2,4,8,…)
Department of Computer Science and Engineering, MAIT 36
Wireless Communication ETEC 463

• For CDMA :64 Sequences, each 64 chips long


• a chip is a binary digit (0 or 1)
• Each Walsh Code is Orthogonal to all other Walsh Codes
• It is possible to recognize, and therefore extract, a particular Walsh code from a mixture of
other Walsh codes that are “filtered out” in the process
• Two same-length binary strings are orthogonal if the result of XORing them has the same
number of 0s as 1s

Walsh code orthogonality


• Code is given as a row in WC matrix
• To generate a code
• “0” -> “1”
• “1” -> “-1”

• Example: Codes W4,2 and W4,3


• W8,2 : (0,0,1,1,0,0,1,1) -> (1,1,-1,-1,1,1,-1,-1)
• W8,3 : (0,1,1,0,0,1,1,0) -> (1,-1,-1,1,1,-1,-1,1)

When synchronized – codes are orthogonal


W8,2  W8,3 = (1,1,−1,−1,1,1,−1,−1)  (1,−1,−1,1,1,−1,−1,1) = 0
When out of sync – codes are not orthogonal

W8,2  shift (W8,3 ,1) = (1,1,−1,−1,1,1,−1,−1)  (1,1,−1,−1,1,1,−1,−1) = 8

11.1Steps to be Performed
• Start
• Install all the relevant network stacks, up to and including UDP.
• Initialize the Basic Walsh Code Matrix.
• Calculate the Complement of the matrix by using the function for calculation of Matrix
Calculation.
• Accept the value of the data Stream value by the user function .
• Now Calculate the Spread of XOR of user info and the Walsh Code by using the Function.
• And Use the above Function again to Calculate the Spread by XOR of Spread and Walsh
Code.
• Now Accept the Value for the input of Walsh Code Matrix from the User.
• By Varying the number of times the loop run by taking the input of Data Streams, Spread the
data.
• Now Calculate the Spread and Despread of Walsh Code Using the Function.
• Stop.

Department of Computer Science and Engineering, MAIT 37


Wireless Communication ETEC 463

11.3 Output

Department of Computer Science and Engineering, MAIT 38


Wireless Communication ETEC 463

11.4 Short Questions:

Q.1 What is Walsh code in CDMA?

Q.2 What is orthogonal codes in CDMA?

Q.3 What are the properties of Orthogonal Codes?

Q.4 What is Walsh table?

Department of Computer Science and Engineering, MAIT 39


Wireless Communication ETEC 463

12. Experiment No. 5


AIM: Program in Scilab to Generate PN Sequence for CDMA Systems
Introduction
Pseudo noise(PN) Sequence Generators
• Pseudo-Noise (PN) sequences are commonly used to generate noise that is approximately
"white".
• It has applications in scrambling, cryptography, and spread-spectrum communications.
• The qualifier "pseudo" implies that the sequence is not truly random. Actually, it is periodic
with a (possibly large) period, and exhibits some characteristics of a random white sequence
within that period.
• Although not random,but can pass many tests of randomness
• Unless algorithm and seed are known,the sequence is impractical to predict PN Generator
implementation

Department of Computer Science and Engineering, MAIT 40


Wireless Communication ETEC 463

It is not difficult to see that the output xk will be periodic. However, the dependence of the length of
the period (which we would like to be as large as possible) on the constants hj, j=1,2,…n is not
obvious. We can see that the "state" (xk-1 …. xk-n) can assume at most 2 n values.

We note the following:


• If the state of the shift register is all zero at any time, it remains so for all time. We need to
ensure that this never happens (we start with a non-zero value).
• If the state ever remains unchanged from one clock cycle to the next, it remains the same
forever.
• The sequence must be periodic (since there are at most 2n -1 states).
• Since all the all zero state is not allowed, the period of the output sequence can be at most
2n-1. A feed- back shift register that generates a sequence of this period is said to be of maximal
length.

Property of Linear Feedback Shift Register(LFSR)


• Nearly random with long period
• May have max period
• If output satisfy period ,is called max-length sequence or m-sequence
• We define generator polynomial as
• The coefficient to generate m-sequence can always be found

Department of Computer Science and Engineering, MAIT 41


Wireless Communication ETEC 463

Block Diagram
12.1 Steps:
• Start
• Set up the Network.
• Install all the relevant network stacks, up to and including UDP.
• Accept the input value of the number of Flip flop from the user.
• By taking the length of the array , generate the Pn Sequence using the Function.
• Accept the Value of the Data Stream By the user using the Function
• Now Calculate the Spread by Multiplication of User info and the PN Sequence generated by
the function.
• Now Calculate the Despread by reapeating the above procedure.
• Now Calculate the Final Spread by using the function and the values.
• Stop.

Department of Computer Science and Engineering, MAIT 42


Wireless Communication ETEC 463

12.3 Outputs:
Output1:

Department of Computer Science and Engineering, MAIT 43


Wireless Communication ETEC 463

Output 2: Number of flip-flop entered are 4:

Department of Computer Science and Engineering, MAIT 44


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 45


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 46


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 47


Wireless Communication ETEC 463

12.4 Short Questions:

Q.1 What are the properties of PN sequence?

Q.2 Why we use PN sequence?

Q.3 What is direct sequence spread spectrum technology?

Q.4 Is CDMA a spread spectrum?

Q.5 Is CDMA still used?

Department of Computer Science and Engineering, MAIT 48


Wireless Communication ETEC 463

13. Experiment No. 6


AIM: Write a Program in NS3 to connect WIFI TO BUS (CSMA)
Network
Introduction
Network simulator is a tool used for simulating the real world network on one computer by writing
scripts in C++ or Python. Normally if we want to perform experiments, to see how our network works
using various parameters. We don’t have required number of computers and routers for making
different topologies. Even if we have these resources it is very expensive to build such a network for
experiment purposes.
So to overcome these drawbacks we used NS3, which is a discrete event network simulator for Internet.
NS3 helps to create various virtual nodes (i.e., computers in real life) and with the help of various Helper
classes it allows us to install devices, internet stacks, application, etc to our nodes.

When network cards are enabled in the devices, we add different parameters in the channels (i.e., real
world path used to send data) which are data-rate, packet size, etc. Now we use Application to generate
traffic and send the packets using these applications.

Ns3 gives us special features which can be used for real life integrations. Some of these features are:

1. Tracing of the Nodes:


NS3 allows us to trace the routes of the nodes which helps us to know how much data is send
or received. Trace files are generated to monitor these activities.
2. NetAnim:
It stands for Network Animator.It is an animated version of how network will look in real and
how data will be transferred from one node to other.
3. Pcap file:
NS3 helps to generate pcap file which can be used to get all information of the packets (e.g.,
Sequence number, Source IP, destination IP, etc). These pcaps can be seen using a software
tool known as wireshark.
4. gnuPlot:
GnuPlot is used to plot graphs from the data which we get from trace file of NS3. Gnuplot gives

Department of Computer Science and Engineering, MAIT 49


Wireless Communication ETEC 463

more accurate graph compare to other graph making tools and also it is less complex than other
tools.

13.1 STEPS:
1.Setup a 2-nodes wireless adhoc network. Place the nodes at a fixed distance in a 3d scenario.
2.Install all the relevant network stacks, up to and including UDP.
3.Setup a CBR transmission between the nodes, one acting as a server and one as a client. Take the
iperf[1] behaviour as an example.
4.Setup counters and outputs for packets sent and received.
5.Schedule the simulation to run for enough time to obtain statistically relevant results (suggestion:
analyze some test results and reduce the simulation time accordingly).
6.Repeat the simulation varying the distance between the nodes from a minimum of 1meter to the
point where the nodes can't transmit/receive anymore.
7.Repeat the above varying the channel models and the transmission/receive parameters like node's
position above the ground, transmission power, etc.
8.Show the differences between the various channel models, and comment them. Identify the
channel model that is more appropriate for each case (indoor, outdoor, LoS, NLoS, etc.).

13.3 Output

Department of Computer Science and Engineering, MAIT 50


Wireless Communication ETEC 463

13.4 Short Questions

Q.1 What is an Access Point in Wifi Networks?

Q.2 What are Multiple Access Schemes?

Q.3 What are different types of WLANs?

Q.4 What is the role of Net Device Container in NS3?

Department of Computer Science and Engineering, MAIT 51


Wireless Communication ETEC 463

14.Experiment No. 7
AIM: Write a Program in NS 3 to create WiFi-Simple Infrastructure
Network
Introduction:
This Program configures two nodes on an 802.11b physical layer, with 802.11b NICs in infrastructure
mode, and by default, the station sends one packet of 1000 (application) bytes to the access point.
The physical layer is configured to receive at a fixed RSS (regardless of the distance and transmit
power); therefore, changing position of the nodes has no effect.
There are a number of command-line options available to control the default behavior. The list of
available command-line options can be listed with the following command:
./waf --run "wifi-simple-infra --help" For instance, for this configuration, the physical layer will stop
successfully receiving packets when rss drops below -97 dBm. To see this effect, try running:
./waf --run "wifi-simple-infra --rss=-97 --numPackets=20"
./waf --run "wifi-simple-infra --rss=-98 --numPackets=20"/ ./waf --run "wifi-simple-infra --rss=-99 -
-numPackets=20"
All ns-3 attributes (not just the ones exposed in the below script) can be changed at command line;
see the documentation.
This script can also be helpful to put the Wifi layer into verbose logging mode; this command will
turn on all wifi logging:
./waf --run "wifi-simple-infra --verbose=1"
When you are done, you will notice two pcap trace files in your directory. If you have tcpdump
installed, you can try this:
tcpdump -r wifi-simple-infra-0-0.pcap -nn–tt

14.1 Steps:

• Setup a 2-nodes wireless Infrastructure network. Place the nodes at a fixed distance in a 3d
scenario.
• Install all the relevant network stacks, up to and including UDP.

Department of Computer Science and Engineering, MAIT 52


Wireless Communication ETEC 463

• Setup a CBR transmission between the nodes, one acting as a server and one as a client. Take
the iperf behaviour as an example.
• Setup counters and outputs for packets sent and received.
• Schedule the simulation to run for enough time to obtain statistically relevant results
(suggestion: analyze some test results and reduce the simulation time accordingly).
• Repeat the simulation varying the distance between the nodes from a minimum of 1meter to
the point where the nodes can't transmit/receive anymore.
• Repeat the above varying the channel models and the transmission/receive parameters like
node's position above the ground, transmission power, etc.
• Show the differences between the various channel models, and comment them. Identify the
channel model that is more appropriate for each case (indoor, outdoor, LoS, NLoS, etc.).

14.2 Source Code –

#include "ns3/core-module.h"
#include "ns3/network-module.h"
#include "ns3/mobility-module.h"
#include "ns3/config-store-module.h"
#include "ns3/wifi-module.h"
#include "ns3/internet-module.h"
#include <iostream>
#include <fstream>
#include <vector>
#include <string>

using namespace ns3;


NS_LOG_COMPONENT_DEFINE ("WifiSimpleInfra");
void ReceivePacket (Ptr<Socket> socket)
{
while (socket->Recv ())
{
NS_LOG_UNCOND ("Received one packet!");
}
}
static void GenerateTraffic (Ptr<Socket> socket, uint32_t pktSize, uint32_t pktCount, Time
pktInterval )
{
if (pktCount > 0)
{
socket->Send (Create<Packet> (pktSize));

Department of Computer Science and Engineering, MAIT 53


Wireless Communication ETEC 463

Simulator::Schedule (pktInterval, &GenerateTraffic,


socket, pktSize,pktCount-1, pktInterval);
}
else
{
socket->Close ();
}
}
int main (int argc, char *argv[])
{
std::string phyMode ("DsssRate1Mbps");
double rss = -80; // -dBm
uint32_t packetSize = 1000; // bytes
uint32_t numPackets = 1;
double interval = 1.0; // seconds
bool verbose = false;

CommandLine cmd;

cmd.AddValue ("phyMode", "Wifi Phy mode",phyMode);


cmd.AddValue ("rss", "received signal strength", rss);
cmd.AddValue ("packetSize", "size of application packet sent", packetSize);
cmd.AddValue ("numPackets", "number of packets generated", numPackets);
cmd.AddValue ("interval", "interval (seconds) between packets", interval);
cmd.AddValue ("verbose", "turn on all WifiNetDevice log components", verbose);

cmd.Parse (argc, argv); // Convert to time object

Time interPacketInterval = Seconds (interval);


// disable fragmentation for frames below 2200 bytes

Config::SetDefault ("ns3::WifiRemoteStationManager::FragmentationThreshold", StringValue


("2200"));
// turn off RTS/CTS for frames below 2200 bytes
Config::SetDefault ("ns3::WifiRemoteStationManager::RtsCtsThreshold", StringValue ("2200"));
// Fix non-unicast data rate to be the same as that of unicast
Config::SetDefault ("ns3::WifiRemoteStationManager::NonUnicastMode",
StringValue (phyMode));

NodeContainer c;
c.Create (2);
// The below set of helpers will help us to put together the wifi NICs we want
WifiHelper wifi;
if (verbose)
{
wifi.EnableLogComponents (); // Turn on all Wifi logging
}

Department of Computer Science and Engineering, MAIT 54


Wireless Communication ETEC 463

wifi.SetStandard (WIFI_PHY_STANDARD_80211b);

YansWifiPhyHelper wifiPhy = YansWifiPhyHelper::Default ();


wifiPhy.Set("RxGain",DoubleValue(0));
wifiPhy.SetPcapDataLinkType(YansWifiPhyHelper::DLT_IEEE802_11_RADIO);

YansWifiChannelHelper wifiChannel;
wifiChannel.SetPropagationDelay ("ns3::ConstantSpeedPropagationDelayModel");
wifiChannel.AddPropagationLoss ("ns3::FixedRssLossModel","Rss",DoubleValue (rss));
wifiPhy.SetChannel (wifiChannel.Create ());

WifiMacHelper wifiMac;
wifi.SetRemoteStationManager ("ns3::ConstantRateWifiManager", "DataMode",StringValue
(phyMode), "ControlMode",StringValue (phyMode));

Ssid ssid = Ssid ("wifi-default"); // setup sta.


wifiMac.SetType ("ns3::StaWifiMac", "Ssid", SsidValue (ssid),
"ActiveProbing", BooleanValue (false));

NetDeviceContainer staDevice = wifi.Install (wifiPhy, wifiMac, c.Get (0));


NetDeviceContainer devices = staDevice;
// setup ap.
wifiMac.SetType ("ns3::ApWifiMac", "Ssid", SsidValue (ssid));
NetDeviceContainer apDevice = wifi.Install (wifiPhy, wifiMac, c.Get (1));
devices.Add (apDevice);
//Note that with FixedRssLossModel, the positions below are not
//used for received signal strength.
MobilityHelper mobility;
Ptr<ListPositionAllocator> positionAlloc = CreateObject<ListPositionAllocator> ();
positionAlloc->Add (Vector (0.0, 0.0, 0.0));
positionAlloc->Add (Vector (5.0, 0.0, 0.0)); mobility.SetPositionAllocator (positionAlloc);
mobility.SetMobilityModel ("ns3::ConstantPositionMobilityModel");
mobility.Install (c);

InternetStackHelper internet;
internet.Install (c);

Ipv4AddressHelper ipv4;
NS_LOG_INFO ("Assign IP Addresses.");
ipv4.SetBase ("10.1.1.0", "255.255.255.0");
Ipv4InterfaceContainer i = ipv4.Assign (devices);

TypeId tid = TypeId::LookupByName ("ns3::UdpSocketFactory");


Ptr<Socket> recvSink = Socket::CreateSocket (c.Get (0), tid);
InetSocketAddress local = InetSocketAddress (Ipv4Address::GetAny (), 80);
recvSink->Bind (local);

Department of Computer Science and Engineering, MAIT 55


Wireless Communication ETEC 463

recvSink->SetRecvCallback (MakeCallback (&ReceivePacket));

Ptr<Socket> source = Socket::CreateSocket (c.Get (1), tid);


InetSocketAddress remote = InetSocketAddress (Ipv4Address ("255.255.255.255"), 80);
source->SetAllowBroadcast (true);
source->Connect (remote);
// Tracing
wifiPhy.EnablePcap ("wifi-simple-infra", devices);
// Output what we are doing
NS_LOG_UNCOND ("Testing " << numPackets << " packets sent with receiver rss " << rss );
Simulator::ScheduleWithContext (source->GetNode ()->GetId (),
Seconds (1.0), &GenerateTraffic,
source, packetSize, numPackets, interPacketInterval);
Simulator::Stop (Seconds (30.0));
Simulator::Run ();
Simulator::Destroy ();
return 0;
}
Possible Variation in the Lab Experiments:

Q.1 Modify the program by changing the number of access points to 4?

Q.2 Make a program to create a infrastructure mode Wifi network with different topology?

14.3Output:
ani@ani-VirtualBox:~/ns-allinone-3.26/ns-3.26$ ./waf --run "wifisimpleinfra"

Waf: Entering directory `/home/ani/ns-allinone-3.26/ns-3.26/build'

Waf: Leaving directory `/home/ani/ns-allinone-3.26/ns-3.26/build'

Build commands will be stored in build/compile_commands.json

'build' finished successfully (2.516s)

Department of Computer Science and Engineering, MAIT 56


Wireless Communication ETEC 463

14.4 Short Questions:

Q.No.1. What are the advantages of using Infrastructure type Wifi Networks?

Q.No.2 What is DSSS and FHSS?

Q.No.3 What are protocols used in MAC layer of Wifi?

Q.No.4 Which method is used to detect errors in Wifi Networks?

Department of Computer Science and Engineering, MAIT 57


Wireless Communication ETEC 463

15. Experiment No. 8


AIM: Create a wireless mobile ad-hoc network with three nodes Node0,
Node1 and Node2
Introduction:
A mobile ad hoc network (MANET) is a self-configuring wireless network in which each node could
act as a router, as well as a data source or sink. Its application areas include battlefields and vehicular
and disaster areas. Many techniques applied to infrastructure-based networks are less effective in
MANETs, with routing being a particular challenge.

15.1 Steps

• Create a wireless mobile ad-hoc network with three nodes Node0, Node1 and Node2. Install
the OLSR routing protocol on these nodes.

• Place them such that Node0 and Node2 are just out of reach of each other.
• Create a UDP client on Node0 and the corresponding server on Node2.

• Schedule Node0 to begin sending packets to Node2 at time 1s.

• Verify whether Node0 is able to send packets to Node2.

• Make Node1 move between Node0 and Node2 such that Node1 is visible to both 0 and 2.
This should happen at time 20s. Ensure that Node1 stays in that position for another 15s.

• Verify whether Node0 is able to send packets to Node1.

• At time 35s, move Node1 out of the region between Node0 and Node2such that it is out of
each other's transmission ranges again.

• Verify whether Node0 is able to send packets to Node2.


• To verify whether data transmissions occur in the above scenarios,use either the tracing
mechanism or a RecvCallback() for Node2's socket.

• Plot the number of bytes received versus time at Node2.

• Show the pcap traces at Node 1's Wifi interface, and indicate the correlationbetween Node2's
packet reception timeline and Node1's mobility.

Possible Variation in the Lab Experiments:

Q.1 Make a Program in NS3 to solve hidden and exposed terminal problem in Adhoc networks?

Department of Computer Science and Engineering, MAIT 58


Wireless Communication ETEC 463

15.3 Output

Department of Computer Science and Engineering, MAIT 59


Wireless Communication ETEC 463

15.4 Short Questions:

Q.No.1. What are the advantages of using Adhoc type Wifi Networks?

Q.No.2 List out the Routing algorithms using in Adhoc Networks?

Q.No.3 How Power management is done in Adhoc Networks?

Q.No.4 Which method is used to detect errors in Wifi Networks?

Department of Computer Science and Engineering, MAIT 60


Wireless Communication ETEC 463

16. Experiment No. 9


Aim: Write a program in Scilab to simulate 3G WCDMA transmission
and reception. Plot the graph for each stage.
Introduction:
WCDMA
• Wideband Direct Sequence Code Division Multiple Access
• Does not assign a specific frequency to each user. Instead every channel uses the full available
spectrum. Individual conversations are encoded with a pseudo-random digital sequence
• Narrowband option for TDD.
• Wideband Direct Sequence Code Division Multiple Access
• Does not assign a specific frequency to each user. Instead every channel uses the full available
spectrum. Individual conversations are encoded with a pseudo-random digital sequence
• Narrowband option for TDD.

WCDMA Parameters
Channel B.W 5 MHz

Forward RF Channel Structure Direct Spread

Chip Rate 3.84 Mcps

Frame Length 10 ms (38400 chips)

No. of slots/frame 15

No. of chips/slot 2560chips (Max. 2560 bits)

Power Control Open and fast close loop (1.6


KHz)
Uplink SF 4 to 256

Downlink SF 4 to 512

Department of Computer Science and Engineering, MAIT 61


Wireless Communication ETEC 463

Spreading Operation
• Spreading means increasing the signal bandwidth
• Strictly speaking, spreading includes two operations:
(1) Channelisation (increases signal bandwidth)
- using orthogonal codes
(2) Scrambling (does not affect the signal bandwidth)
- using pseudo noise codes

16.1 Steps

Steps: for Transmission:


• There are two different message signals of same length, each corresponding to anindividual
user.
• Now, converting each message signal into NRZ format.
• Converting NRZ message signal of user 1 to rate code i.e. each signal bit is repeated 8 times.
• Generation of PN sequences for both user, this PN sequence will act as a key for
bothtransmitting and receiving end.
• Now, again converting PN sequences into NRZ format.
• Spreading of rate coded message signal1 (user 1) by PN code1.
• Spreading of rate coded user1 message signal is done by the Direct Sequence spreading.
• Spreading of rate coded message signal2 (user 2) by PN code2.
• Spreading of rate coded user2 message signal is done by the Direct Sequence spreading.
• Addition of the both spread signals to form total spread signal.
• BPSK modulation of total spread signal is done.
• Transmitting BPSK modulated signal using an AWGN channel.

Steps: for Reception


• At receiver side, Despreading of received signal for the user 1 by using PN code of user 1.
• This PN code works as key for the message signal of user 1.
• BPSK Demodulation of despreaded signal of user1.
• Synchronization of data of user1 i.e., Summation of each row of the BPSK demodulated data
of user 1.
• Converting each analog data into digital data.
• These converted data is similar to the original message signal of user1.
• Despreading of received signal for the user 2 by using PN code of user 2.
• This PN code works as key for the message signal of user 2.
• BPSK Demodulation of despreaded signal of user2.
• Synchronization of data of user2 i.e., Summation of each row of the BPSK demodulated data
of user 2.
• Converting each analog data into digital data.
• These converted data is similar to the original message signal of user2.

Department of Computer Science and Engineering, MAIT 62


Wireless Communication ETEC 463

16.3Output (Console):

Department of Computer Science and Engineering, MAIT 63


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 64


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 65


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 66


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 67


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 68


Wireless Communication ETEC 463

Output (Graph)

Department of Computer Science and Engineering, MAIT 69


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 70


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 71


Wireless Communication ETEC 463

Department of Computer Science and Engineering, MAIT 72


Wireless Communication ETEC 463

16.5 Short questions:

Q.no1 What is compressed mode in WCDMA?

Q.no2 Explain WCDMA frame structure.

Q.no3 What is the full form of WCDMA?

Q.no4What are the physical, transport and logical channels in WCDMA? Explain function of
each.

Department of Computer Science and Engineering, MAIT 73


Wireless Communication ETEC 463

17. Experiment No. 9


Aim: Program in Scilab to Implement MIMO (Multiple Input
Multiple Output) Communications.
Introduction:
MIMO is an acronym that stands for Multiple Input Multiple Output.
• It is an antenna technology that is used both in transmission and receiver equipment for wireless
radio communication.
• There can be various MIMO configurations. For example, a 2x2 MIMO configuration is 2
antennas to transmit signals (from base station) and 2 antennas to receive signals (mobile terminal).

17.1Steps:
• Setup a 2-nodes wireless Infrastructure network. Place the nodes at a fixed distance in a 3d
scenario.
• Install all the relevant network stacks, up to and including UDP.
• Calculate the Shannon Capacity.
• Calculate the Capacity of MIMO link with input value NR and NT.
• Generate a single random value between 0 and 1 from the standard normal distribution and
plot the graph of Capacity vs SNR.
• Stop.

17.2 Output:

Department of Computer Science and Engineering, MAIT 74


Wireless Communication ETEC 463

17.3 Short Question

Question 1: In MIMO, which factor has the greatest influence on data rates?

Question 2: MIMO technology makes advantage of a natural radio wave phenomenon called?

Question 3: Which of the following technology does not use MIMO?

Question4: What is an additional open-loop MIMO technique considered by the WiMAX vendors.

Department of Computer Science and Engineering, MAIT 75


Wireless Communication ETEC 463

16. Experiment No. 9


(Beyond Curricula)
AIM:To set up wireless network with and without infrastructure support.
16.1 Steps:

1. Adhoc mode:
a. Ad-hoc mode is also known as “peer-to-peer” mode. Ad-hoc networks don’t require a
centralized access point. Instead, devices on the wireless network connect directly to
each other. If you set up the two laptops in ad-hoc wireless mode, they’d connect
directly to each other without the need for a centralized access point.

2. Infrastructure mode:
a. Installing the router
i. Acquire a router
ii. Connect router to modem
iii. Connect computer via Ethernet cable
b. Configure the router
i. Install router software
ii. Open router’s configuration page
iii. Enter your internet connection information
iv. Set your wireless settings
v. Apply your settings
vi. Place your router
c. Connecting to the router
i. Connect a device to network
ii. Enter the Password
iii. Test your Connection

16.3 Short Questions:


Department of Computer Science and Engineering, MAIT 76
Wireless Communication ETEC 463

Q.No1How do we archive our network?

Q.No2When would we use a crosslink cable?

Q.No3What is a VLAN?

Q.No 4What is the difference between a workgroup and a domain?

Department of Computer Science and Engineering, MAIT 77


Wireless Communication ETEC 463

17. Experiment No. 10


(Beyond Curricula)
AIM:To configure Access Point with bridging mode.
17.1 Steps:

1. Connect to the router via Winbox.


2. Setup Wireless interface
• necessary configuration options are:
i. mode=ap-bridge
ii. band=ap_operated_band
iii. frequency=ap_operated_frequency
iv. ssid=<any broadcast id>

3. These settings are enough to establish wireless connection, additionally you need to add IP
address for the wireless interface for IP routing, optionally add security and other settings
4.
5. 17.2 Output:

Department of Computer Science and Engineering, MAIT 78


Wireless Communication ETEC 463

17.3 Short Questions:

Q.NoIn WLAN, what messages are exchanged between AP and STA and what are the functions of
both?

Q.No2What is CAPWAP (Control and Provisioning of Wireless Access Points)?

Q.No3What is the key advantage of using switches?

Q.No 4 Does a bridge divide a network into smaller segments?

Department of Computer Science and Engineering, MAIT 79


Wireless Communication ETEC 463

18. Experiment No. 11


(Beyond Curricula)
AIM: To configure routing between wired and wireless Networks.
18.1 STEPS:

1. Connect to the router via Winbox.


2. Create interfaces.
3. Add addresses to the interfaces.
4. Create routes between various interfaces using GUI or command line.
5. Using command line, follow the steps as:
6. [admin@MikroTik] ip route> print
a. Flags: X − disabled, I − invalid, D − dynamic, J − rejected,
C − connect, S − static, R − rip, O − ospf, B − bgp
# DST−ADDRESS G GATEWAY DISTANCE INTERFACE
0 DC 192.168.0.0/24 r 0.0.0.0 0 Local
b. 1 DC 10.0.0.0/24 r 0.0.0.0 0 Public
c. [admin@MikroTik] ip route> print detail
d. Flags: X − disabled, I − invalid, D − dynamic, J − rejected,
e. C − connect, S − static, R − rip, O − ospf, B − bgp
f. 0 DC dst−address=192.168.0.0/24 preferred−source=192.168.0.254
g. gateway=0.0.0.0 gateway−state=reachable distance=0 interface=Local
h. 1 DC dst−address=10.0.0.0/24 preferred−source=10.0.0.217 gateway=0.0.0.0
i. gateway−state=reachable distance=0 interface=Public

7. These routes show, that IP packets with destination to 10.0.0.0/24 would be sent through the
interface
8. Public, whereas IP packets with destination to 192.168.0.0/24 would be sent through the
interface Local.
9. However, you need to specify where the router should forward packets, which have
destination other than
10. networks connected directly to the router. This is done by adding the
11. default route
12. (destination 0.0.0.0,
13. netmask 0.0.0.0). In this case it is the ISP's gateway 10.0.0.1, which can be reached through
the interface
14. Public:
a. [admin@MikroTik] ip route> add gateway=10.0.0.1
b. [admin@MikroTik] ip route> print
c. Flags: X − disabled, I − invalid, D − dynamic, J − rejected,
d. C − connect, S − static, R − rip, O − ospf, B − bgp
e. # DST−ADDRESS G GATEWAY DISTANCE INTERFACE
f. 0 S 0.0.0.0/0 r 10.0.0.1 1 Public
g. 1 DC 192.168.0.0/24 r 0.0.0.0 0 Local

Department of Computer Science and Engineering, MAIT 80


Wireless Communication ETEC 463

h. 2 DC 10.0.0.0/24 r 0.0.0.0 0 Public

15. Here, the default route is listed under #0. As we see, the gateway 10.0.0.1 can be reached
through the interface 'Public'. If the gateway was specified incorrectly, the value for the
argument 'interface' would be unknown. Note, that we cannot add two routes to the same
destination, i.e., destination−address/netmask!
It applies to the default routes as well. Instead, we can enter multiple gateways for one
destination.

Department of Computer Science and Engineering, MAIT 81


Wireless Communication ETEC 463

18.2 Short Questions:

Q.No1 In WLAN, what messages are exchanged between AP and STA and what are the functions
of both?

Q.No2What is CAPWAP (Control and Provisioning of Wireless Access Points)?

Q.No3What is the key advantage of using switches?

Q.No 4 Does a bridge divide a network into smaller segments?

Department of Computer Science and Engineering, MAIT 82


Wireless Communication ETEC 463

19. Experiment No. 12


AIM: To configure security in wireless network with and without infrastructure support.

19.1 Steps:
For Infrastructure Support:

1. Use an Ethernet cable to connect a computer to any one of the four LAN ports of the router
or connect wirelessly.
2. Log in to your router by browsing to

http://192.168.1.1 or http://192.168.0.1
3. Enter the username (admin) and password.
4. Select Wireless from the Setup menu in the left-hand navigation bar.
5. Under Wireless Network, enter your desired network name in the Name (SSID) box.
6. Under Security Options, select WPA2-PSK [AES].
7. Under Security Options (WPA2-PSK), enter your desired network password into the
Passphrase box.

8. Click Apply to save the settings.

For Adhoc:

1. Physical Security
2. Key Management
a. Trust model
b. Cryptosystems
c. Key Creation
d. Key Storage
e. Key Distribution

Department of Computer Science and Engineering, MAIT 83


Wireless Communication ETEC 463

19.2 Short Questions:

Q.No1 What is MTU?

Q.No 2 How do we configure a Cisco router to route IPX?

Q.No 3 In configuring a router, what command must be used if you want to delete the
configuration data that is stored in the NVRAM?

Q.No 4 Does a bridge divide a network into smaller segments?

Department of Computer Science and Engineering, MAIT 84

You might also like