new network simulation ns-3 (2) (1)

18
8/10/2019 New Network Simulation Ns-3 (2) (1) http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 1/18 NETWORK SIMULATION LAB Instructor: Marco Porsch LAB No.2 NS3-WiFi Task 2.1 a) Study the simulation script file found in the ‘scratch’ directory and describe the simulated network topology and the expected behavior as implemented in the simulation file. IEEE 802.11 group has described two types of topology in wireless. 1) Network Infrastructure Mode (Point to multi point communication) uses Access Point (AP) for connecting two networks. 2) Peer-to-Peer Communication (Ad-Hoc) without using Access Point (AP) In this simulation, we use Network Infrastructure Mode. Means, we are have two nodes or computer with specific Ip address and Mac address and in between them we have Access point .This Access Point behave like a hub and data frame can be exchange between the two computer. NODE 1 ACCESS POINT NODE 2 We use Eclipse to run the simulation file “1_ApSim.cc”.When simulation run successfully we get this result: Waf: Entering directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build' Waf: Leaving directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build' 'build' finished successfully (1.525s) PING 192.168.1.2 56(84) bytes of data. 64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0 ms 64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0 ms --- 192.168.1.2 ping statistics --- 2 packets transmitted, 2 received, 0% packet loss, time 189ms rtt min/avg/max/mdev = 0/0/0/0 ms written capture of AP --> ApSim-2-0.pcap 

Upload: adam-fowler

Post on 02-Jun-2018

217 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 1/18

NETWORK SIMULATION LAB

Instructor: Marco Porsch

LAB No.2 NS3-WiFi

Task 2.1

a) Study the simulation script file found in the ‘scratch’ directory and describe the simulated

network topology and the expected behavior as implemented in the simulation file.

IEEE 802.11 group has described two types of topology in wireless.

1) Network Infrastructure Mode (Point to multi point communication) uses Access Point (AP) for

connecting two networks.

2) Peer-to-Peer Communication (Ad-Hoc) without using Access Point (AP)

In this simulation, we use Network Infrastructure Mode. Means, we are have two nodes or

computer with specific Ip address and Mac address and in between them we have Access point .This

Access Point behave like a hub and data frame can be exchange between the two computer.

NODE 1 ACCESS POINT NODE 2

We use Eclipse to run the simulation file “1_ApSim.cc”.When simulation run successfully we get this

result:

Waf: Entering directory ̀ /home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'Waf: Leaving directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

'build' finished successfully (1.525s) 

PING 192.168.1.2 56(84) bytes of data.

64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0 ms

64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0 ms

--- 192.168.1.2 ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 189ms

rtt min/avg/max/mdev = 0/0/0/0 ms

written capture of AP --> ApSim-2-0.pcap 

Page 2: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 2/18

  According to the simulation result, two packets are transmitted and two packets received.

That means there is no loss of any packet.

Wireshark:

Page 3: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 3/18

 

  When the simulation is run using wireshark. The total number of packet transfer is 3

Page 4: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 4/18

PACKET

Phy Channel Phy Channel

  When we use verbose=1, we get the detailed information about how the packet is been

transmitted from one node to the other (as shown in the picture above).

TO DS FROM DS ADDRESS 1 ADDRESS 2 ADDRESS 3 ADDRESS 4

0 0 RA=DA TA=SA BSSID N/A

0 1 RA=DA TA=BSSID SA N/A

1 0 RA=BSSID TA=SA DA N/A

1 1 RA SA DA SA

c) Illustrate the relevant frame exchange incl. ACK frames in a flow diagram and explain the

observation.

Computer

1

Computer

2

Access Point

PACKET

Page 5: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 5/18

  Node1 Access Point Node 2

Packet 1

ACK

Packet 1

ACK

ACK

Packet2

ACK Packet 2

ACK

ACK

In the simulation file, the Wi-Fi network is operated at 192.168.1.0 -255.255.255.0 address. Clients

get there Ip address respectively from it.

From the above flow diagram, we can say that Access point behave like a hub between both the two

clients. Client 1 wants to send a packet to client 2 but the packet will not been send directly to client

2. Packet will be send to Access point then access point send an ACK message to the source and

forward the packet to the destination IP address after then the destination point(client 2) send the

ACK to the Access point and then Access point will send the last ACK to the source point of packet

that packet have been send successfully.

1s 0 Phy sent packet #35 DATA ToDs=1 FromDs=0 Addr1=00:00:00:00:00:03Addr2=00:00:00:00:00:01 Addr3=00:00:00:00:00:02

1.00006s 2 Phy sent packet #37 CTL_ACK ToDs=0 FromDs=0 Addr1=00:00:00:00:00:01Addr2=00:00:00:00:00:00 Addr3=00:00:00:00:00:00

1.00013s 2 Phy sent packet #35 DATA ToDs=0 FromDs=1 Addr1=00:00:00:00:00:02Addr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:01

1.00019s 1 Phy sent packet #39 CTL_ACK ToDs=0 FromDs=0 Addr1=00:00:00:00:00:03Addr2=00:00:00:00:00:00 Addr3=00:00:00:00:00:00

Page 6: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 6/18

1.00027s 1 Phy sent packet #38 DATA ToDs=1 FromDs=0 Addr1=00:00:00:00:00:03Addr2=00:00:00:00:00:02 Addr3=00:00:00:00:00:01

1.00032s 2 Phy sent packet #40 CTL_ACK ToDs=0 FromDs=0 Addr1=00:00:00:00:00:02Addr2=00:00:00:00:00:00 Addr3=00:00:00:00:00:00

1.00051s 2 Phy sent packet #38 DATA ToDs=0 FromDs=1 Addr1=00:00:00:00:00:01Addr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:02

1.00057s 0 Phy sent packet #41 CTL_ACK ToDs=0 FromDs=0 Addr1=00:00:00:00:00:03Addr2=00:00:00:00:00:00 Addr3=00:00:00:00:00:00

1.024s 2 Phy sent packet #42 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

1.1s 0 Phy sent packet #43 DATA ToDs=1 FromDs=0 Addr1=00:00:00:00:00:03Addr2=00:00:00:00:00:01 Addr3=00:00:00:00:00:02

1.10006s 2 Phy sent packet #45 CTL_ACK ToDs=0 FromDs=0 Addr1=00:00:00:00:00:01

Addr2=00:00:00:00:00:00 Addr3=00:00:00:00:00:00

1.10013s 2 Phy sent packet #43 DATA ToDs=0 FromDs=1 Addr1=00:00:00:00:00:02Addr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:01

1.10019s 1 Phy sent packet #47 CTL_ACK ToDs=0 FromDs=0 Addr1=00:00:00:00:00:03Addr2=00:00:00:00:00:00 Addr3=00:00:00:00:00:00

1.10027s 1 Phy sent packet #46 DATA ToDs=1 FromDs=0 Addr1=00:00:00:00:00:03Addr2=00:00:00:00:00:02 Addr3=00:00:00:00:00:01

1.10032s 2 Phy sent packet #48 CTL_ACK ToDs=0 FromDs=0 Addr1=00:00:00:00:00:02Addr2=00:00:00:00:00:00 Addr3=00:00:00:00:00:00

1.10052s 2 Phy sent packet #46 DATA ToDs=0 FromDs=1 Addr1=00:00:00:00:00:01Addr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:02

1.10058s 0 Phy sent packet #49 CTL_ACK ToDs=0 FromDs=0 Addr1=00:00:00:00:00:03Addr2=00:00:00:00:00:00 Addr3=00:00:00:00:00:00

1.1264s 2 Phy sent packet #50 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

1.2288s 2 Phy sent packet #51 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

1.3312s 2 Phy sent packet #52 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

1.4336s 2 Phy sent packet #53 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

1.536s 2 Phy sent packet #54 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

1.6384s 2 Phy sent packet #55 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

1.7408s 2 Phy sent packet #56 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

Page 7: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 7/18

1.8432s 2 Phy sent packet #57 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

1.9456s 2 Phy sent packet #58 MGT_BEACON ToDs=0 FromDs=0 Addr1=ff:ff:ff:ff:ff:ffAddr2=00:00:00:00:00:03 Addr3=00:00:00:00:00:03

PING 192.168.1.2 56(84) bytes of data.

64 bytes from 192.168.1.2: icmp_seq=0 ttl=64 time=0 ms

64 bytes from 192.168.1.2: icmp_seq=1 ttl=64 time=0 ms

--- 192.168.1.2 ping statistics ---

2 packets transmitted, 2 received, 0% packet loss, time 189ms

rtt min/avg/max/mdev = 0/0/0/0 ms

written capture of AP --> ApSim-2-0.pcap

Address of client node 1 is 00:00:00:00:00:01, Address of client node 2 is 00:00:00:00:00:02 and

Address of access point node is 00:00:00:00:00:03

Refer above table,

1)  ToDs=1 FromDs=0 (Packet No #35)

In this case Addr1 (00:00:00:00:00:03) is the RA (receiver address), which equal to BSSID (Access

point). Addr2 (00:00:00:00:00:01) is the TA (transmitter address) which is equal to source

address(SA) and Addr3 (00:00:00:00:00:02) is the DA (destination address). In this case the packets

are sent from client node 1 to Access point as a receiving address with client node 2 as the

destination node.

2)  ToDs=0 FromDs=0 (Packet No #37)

In this case, Addr1 (00:00:00:00:00:01) is the RA (receiver address) which is equal to DA (destination

address). Client node 1 receives acknowledgement (ACK) from access point node.

3)  ToDs=0 FromDs=1 (Packet No #35)

In this case, Addr1 (00:00:00:00:00:02) is the RA (receiver address) which is equal to ( destination

address), which is the client node 2 address. Addr2 (00:00:00:00:00:03) is the TA ( transmitter

address) which is access point node address and Addr3 (00:00:00:00:00:01) is the SA( source

address). So, the packets are sent from access point to client node 2 with client node 1 as the source

address.

4)  ToDs=0 FromDs=0 (Packet No #39)

Page 8: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 8/18

 In this case, Addr1 (00:00:00:00:00:03) is the RA (receiver address) is equal to DA ( destination

address), which is the access point node address. Client node 2 sends acknowledgement (ACK) to

access point node.

d) Modify the simulation such that the former client STAs operate in ad-hoc mode. Illustrate the

frame exchange in a flow diagram and compare the observed results with the previous

simulation.

If we modify the simulation in ad-hoc mode then Access Point will not be used in the transfer of

packs. The network will become Peer-to-Peer connection between node 1 and node 2.

Physical layer

Node 1 Node 2

Packet 1

ACK

Packet 2

ACK

As you can see that in the flow diagram there is no access point so in this case the packet will besend directly from client 1 to client 2.

Data Frame

Page 9: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 9/18

 

And if you run the adhoc mode in the verbose=1 in that case you can see at time=1 ,address 1 and

address 2 are same which means the Ap address and transmitting address are same of client 1.Thats

mean there is no Access point and both the node is connected with Peer-to-Peer mode,

Task 2.2

a)  Run the simulation. Describe the experienced effects compared to the behavior you would

expect from the simulation file. Explain the technical backgrounds regarding CSMA

channel access. Mind that this is not a hidden node scenario.

After running the simulation we get the following result:

There are two wireless networks

1) Home Network

2) Neighbour Network

Page 10: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 10/18

We know that, when a medium is shared between more than one network then the total

throughput of all the network will be decrease. In the simulation the medium is shared between two

Wi-Fi networks and the throughput of both the network decreases because of collision and

interference between both of them. In wireless transmission it is impossible to detect a direct

collision because in it a network device cannot simultaneously send and receive packet. A collision

may only be indirectly detected by not receiving a positive acknowledgment packet (ACK) from theintended receiver immediately after the successful reception (CSMA/CA).On the other hand in wired

transmission we can detect the detect collision of the packets using this technique CSMA/CD and

retransmit the packet.

b)  Think of multiple possibilities (≥ 3) to avoid this situation, i.e. get the full data rate for the

home network. Implement and test these in the simulation. The solutions of this task do

not need to be applicable to real life. This is a simulation where you can change all

parameters. Be creative with your solutions!

There are some mechanisms to avoid the collision in WLANs by which we can gain maximum

throughput for home network but cannot be applied to real life.

1) Changing the data rate of Neighbour: If we change the data rate of Neighbour then the total

throughput of HomeNet will be increase. As, we make the data rate of Neighbour .001Mbps then the

throughput will be maximum of Homenet.

2) Changing Starting/Stopping time for both nets: When we provide separate time period to both

the nodes for transmitting data. (i.e HomeNet from 5 to 10 and NeighbourNet 10 to 11) then boththe nodes can send data with maximum throughput and no interference will take place

3) Increase the distance between the two net: If we increases the distance between the HomeNet

and NeighbourNet then the interference between the two nets will be decrease due to will the total

throughput will increase for both the nets.

Task 2.3

a) Study the simulation script file. Describe the implemented movement and the resulting

distance over time between the nodes in this simulation. Based on what you read about

rate control algorithms in section 1.2.2, what do you expect to happen in this scenario.

From the simulation script file, we observed that there are two Wi-Fi nodes connected with

adhoc mode (Peer to peer). The distance between two nodes is 125 on X axis (Delta,

DoubleValue (125.0)). At t=0, initial point when two nodes are at distance of 125 the data

modulation rate in Mbps between the two nodes will be very less. As the Node n1 is moving

and n2 is stationary the modulation data rate increases with time as it is moving closer

towards n2. When n1 come very close to n2 the modulation data rate will be maximum.

After words then node 1 passes n2 and start moving far in opposite direction the modulation

of data rate start decreasing again which meand delay time will also increases.

Page 11: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 11/18

 

b)  Run the simulation using the different rate control algorithms AarfWifiManager,

MinstrelWifiManager and IdealWifiManager. Based on the plot visualizing the modulation

data rate, interpret the behavior of these algorithms. Consult the API documentation [4]

or web sources for additional information.

After runningsimulation we find this graphs:

1)AarfWifiManager:-

.

 

Waf: Leaving directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

'build' finished successfully (10.465s)

Datastream 0->1 (1, 0) : packets lost 23038 ; packets successful 24399 ; average delay 360846us

to plot the results, run './plot_RateControlSim.sh'

In Aarf Wifimanager transmits packet with higher data rate after getting a threshold value of successful datatransmission at the current data rate. If the transmitted data fails it adjusts the current bit rate at which number ofconsecutive packets was successfully transmitted and If the packet is send successfully it will set the bit rate atwhich packet was sent successfully . If more than one packets fails during transmission it sets the upcomingpacket with the next lower bit rate. 

Page 12: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 12/18

 

2)MinistrelWifiManager:-

Waf: Leaving directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

'build' finished successfully (13.653s)

Datastream 0->1 (1, 0) : packets lost 22710 ; packets successful 24727 ; average delay 356122us

to plot the results, run './plot_RateControlSim.sh' 

In Minstrel algorithm through radio interface collects statistics of all data packets. These Statistics

provide sufficient information to make decision about successful packets transmission than others.

Page 13: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 13/18

 

3) IdealWifiManager:-

Waf: Leaving directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

'build' finished successfully (13.653s)

Datastream 0->1 (1, 0) : packets lost 22710 ; packets successful 24727 ; average delay 356122us

to plot the results, run './plot_RateControlSim.sh'

Ideal WifiManager uses a technique called out of band. The receiving side keeps the information of SNR of each

packet received and sends this SNR back to the transmission side this technique is called out of band.

Transmitting side makes a threshold of all packets SNR and it is used to select transmission mode.  

Page 14: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 14/18

 

c) Determine the maximum range for successful packet transmission in the simulation

The above graph shows that the maximum range of successful packet transmission in the simulation

lies between 10 to 15 second.

d) Why is the application throughput less than the modulation data rate chosen by the ratecontrol algorithms?

Total throughput is always less than the data rate chosen by the control rate algorithm because of

addition information (like header bit, control bit, frame acknowledgement) with the real information

bits and back-off time period. In back off period, every station has to wait for a particular time

period after each transmission of packets .Therefore we get less throughput as compare to data

rate.

Task 2.4

a) Extend the simulation file to use the trace source PhyRxDrop in the physical layer class WifiPhy

of node 1 (the receiver STA where the packets of nodes 0 and 2 collide), to gather additional

data about dropped packets: • the number of DATA frames, that have been dropped (not

received successfully) • the number of dropped RTS/CTS frames • the overall lost data in bytes 

Waf: Leaving directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

'build' finished successfully (8.703s)

Page 15: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 15/18

  Hidden station experiment with RTS/CTS disabled:

Flow 1 (10.0.0.1 -> 10.0.0.2)

Tx Bytes: 4320000

Rx Bytes: 2499200

Throughput: 2.1186 Mbps

Flow 2 (10.0.0.3 -> 10.0.0.2)Tx Bytes: 4321024

Rx Bytes: 2363520

Throughput: 2.00358 Mbps

Data Packet Collisions: 55164

RTS/CTS Collisions: 0

Lost MBytes: 8.64388

------------------------------------------------

Hidden station experiment with RTS/CTS enabled:

Flow 1 (10.0.0.1 -> 10.0.0.2)

Tx Bytes: 4320000

Rx Bytes: 1641088

Throughput: 1.39117 Mbps

Flow 2 (10.0.0.3 -> 10.0.0.2)

Tx Bytes: 4321024

Rx Bytes: 1494784

Throughput: 1.26714 Mbps

Data Packet Collisions: 24505

RTS/CTS Collisions: 37207

Lost MBytes: 4.53698

We study the simulation file and get to know that there are 3 node connected with adhoc mode. Node 1 and 3 arenot connected with each other and they are hidden to each there. Both the nodes are connected to node 2 andtransmit data with him.

Now, when node 1 and 3 transmit data when RTS/CTS is disable. In this case there will be more collision of datapacket but when we enable the RTS/CTS there will be less collision of data packets. When we enable RTS/CTSsome packets will be dropped because of collision and total throughput will be reduce because we are sendingRTS/CTS packets with actual data packets .

b) 

As you can see in the achieved throughput, currently, the use of RTS/CTS is not beneficial in thisscenario. This is because it causes overhead by introducing additional transmissions and

waiting times per data packet. Draw a timing diagram of a successful data transmission usingRTS/CTS and mark the overhead caused by RTS/CTS. On the other hand, if no RTS/CTS wasused, which factors determine the time wasted if a packet has to be retransmitted?

In the 802.11 standard, if the frame exceeds the maximum length, it can be sent in fragments. Aftersending the first portion of the frame, the station releases the channel and waits for confirmation (ACK)from the destination station. When the confirmation has been received, after SIFS time the station cantransmit another fragment.

Page 16: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 16/18

  An example of frame fragmentation

The frame header contains a field informing other stations about how long the transmitter will occupy the channelto transmit the frame. The length of the period takes into account the time needed for transmission of the frame

and the time indispensable for confirmation from the receiving station. The channel busy time is called Network

Allocation Vector (NAV). After reading the frame header, all stations other than the addressee of the frame are

inactive (busy virtual channel).

Using the NAV mechanism

To ensure proper transmission in the case of hidden stations, the 802.11 standard also uses RTS/CTS ((RequestTo Send  / Clear To Send ) mechanism. The RTS/CTS frames ensure some redundancy (RTS - 20 bytes, CTS -14bytes), hence the use of this mechanism is particularly useful when sending long frames. In the case of sendingshort data frames, the ratio of control frames to the data frames becomes too large, which significantly reducesthe efficiency of the network resources. Therefore, the RTS/CTS mechanism is turned on beyond a certain lengthof the frame.

When the RTS/CTS mechanism is enabled, the station which won the competition for access to the medium -before sending the data frame - must send the RTS frame. Then, the destination station acknowledges this factby sending CTS frame. This ensures that all stations that are not involved in the transmission will remain inactivefor the time specified both in the RTS and CTS frames (transmission hold-on).

Transmission of frame using RTS/CTS mechanism

c) Determine conditions under which the use of RTS/CTS is worthwhile, i.e. the throughput with RTS/CTS

is higher than without it. Prove your ideas by modifying the simulation accordingly

Page 17: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 17/18

  When we increase the packet size in the simulation from 100 to more than 200 then we will get the total

throughput of 2.91Mbps.In this condition the RTS/CTS is more useful to use.

 

Task 2.5

a) 

Study the simulation script file. Run the simulation and describe your observations compared to theexpected behavior.

Waf: Entering directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

[ 672/1395] cxx: scratch/5_EdcaSim.cc -> build/scratch/5_EdcaSim.cc.3.o

[1381/1395] cxxprogram: build/scratch/5_EdcaSim.cc.3.o -> build/scratch/5_EdcaSim

Waf: Leaving directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

'build' finished successfully (8.808s)Flow 1 (192.168.1.1 -> 192.168.1.4)

Tx Bytes: 7602972

Rx Bytes: 3826836

Throughput: 9.73215 Mbps

Flow 2 (192.168.1.2 -> 192.168.1.4)

Tx Bytes: 7578636

Rx Bytes: 3974880

Throughput: 10.1425 Mbps

Flow 3 (192.168.1.3 -> 192.168.1.4)

Tx Bytes: 7576608

Rx Bytes: 4072224

Throughput: 10.3943 Mbps

In the simulation file three nodes are defined which are connected with a central node. Each node has a

maximum data rate of 20Mbps but no node is getting full data rate. It is because there is no Qos assigned to

a node. Therefore at a time each node will transmit packet and because of it collision/Interference will take

place which reduces the throughput of each node.

b)  The standard ns-3 simulator is able to handle different access categories differently, but lacks thefunctionality to create traffic of a certain class. This can be accomplished by manually adding aQosTag to the packets created by an application. The packets sent by node 2 should belong to thevoice traffic category. Use the trace source Tx of the OnOffApplication class to modify packets whenthey are sent by the application layer. Run the simulation again and describe the results.

Waf: Entering directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

Page 18: New Network Simulation Ns-3 (2) (1)

8/10/2019 New Network Simulation Ns-3 (2) (1)

http://slidepdf.com/reader/full/new-network-simulation-ns-3-2-1 18/18

[ 672/1395] cxx: scratch/5_EdcaSim.cc -> build/scratch/5_EdcaSim.cc.3.o

[1387/1395] cxxprogram: build/scratch/5_EdcaSim.cc.3.o -> build/scratch/5_EdcaSim

Waf: Leaving directory `/home/student/Lab ns-3/ns-allinone-3.16/ns-3.16/build'

'build' finished successfully (21.848s)

Flow 1 (192.168.1.1 -> 192.168.1.4)

Tx Bytes: 7602972

Rx Bytes: 2543112Throughput: 6.46747 Mbps

Flow 2 (192.168.1.2 -> 192.168.1.4)

Tx Bytes: 7578636

Rx Bytes: 2474160

Throughput: 6.31316 Mbps

Flow 3 (192.168.1.3 -> 192.168.1.4)

Tx Bytes: 7576608

Rx Bytes: 7574580

Throughput: 19.334 Mbps

We modify the code keeping in mind that node 2(192.168.1.3) belong to Voice traffic which means it requires

high Qos. So, when we modify and run the simulation we get the above result. The total throughput of node 2

is 20Mbps and we get 19.334Mbps which means packets which are send by node 2 has high priority as

compare to other two nodes that’s why throughput of node 0 and 1 is very less as compare to node 2.  

c) 

Explain how EDCA achieves to give priority to the voice data packets with respect to channel

access.

EDCA(Enhance Distributed Channel):- In EDCA high priority traffic has a higher chance of being sent than

low priority traffic. A STA with high priority traffic waits a little less before it sends its packet on average than

a STA with low priority traffic.

EDCA uses multiple virtual queues multiple virtual queues inside each STA which content for channel accessin parallel. Each has different channel access timings depending on its QoS access category.The Qos

access category can be describe by different parameters like CWmax, CWmin, and TXOP(CW=ContentialWindow). The AIFSN value is a multiplier for the time, a station has to wait before accessing the channel ordecrementing its backoff. Also transmission opportunity times (TXOP) are used instead of per-packetchannel access. In this time multiple frames of the same QoS access category may be sent. Thesetechniques are used to give a channel access prioritization to higher priority traffic. In voicecategory(AC_VO) has small CWmin and CWmax value(i.e CWmin=3 and CWmax=7) when compared withother categories voice category is given highest priority.

Reference

http://www.dipol.ie/newsletter2/inf_dipo_2009_36.html