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
This document is posted to help you gain knowledge. Please leave a comment to let me know what you think about it! Share it to your friends and learn new things together.
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.
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.
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.
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
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.
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.