The document discusses simulating the S-MAC protocol in NS2 based on an IEEE paper on an energy efficient MAC protocol for wireless sensor networks. It describes making changes to NS2 for running S-MAC, including common simulation settings and basic S-MAC features such as listening and sleeping periodically, overhearing avoidance, and RTS/CTS mechanisms. It also outlines measuring S-MAC's energy consumption compared to 802.11 through trace files and examining the impact of varying duty cycle, traffic variation, and node role.
Download as PPT, PDF, TXT or read online on Scribd
0 ratings0% found this document useful (0 votes)
240 views
S-Mac Simulation 3rd Review
The document discusses simulating the S-MAC protocol in NS2 based on an IEEE paper on an energy efficient MAC protocol for wireless sensor networks. It describes making changes to NS2 for running S-MAC, including common simulation settings and basic S-MAC features such as listening and sleeping periodically, overhearing avoidance, and RTS/CTS mechanisms. It also outlines measuring S-MAC's energy consumption compared to 802.11 through trace files and examining the impact of varying duty cycle, traffic variation, and node role.
Download as PPT, PDF, TXT or read online on Scribd
You are on page 1/ 18
S-MAC Simulation in NS2
Based on IEEE Paper ”An Energy Efficient Mac Protocol for Wireless sensor Network” Wei Ye, John Heidemann, Deborah Estrin
Guided By: Prepared By:
Prof. Sachin Gajjar Pravin Gareta(08BEC156) Malav Mehta(08BEC159) Changes Made for NS2 • If your NS release is 2.30 and above then it is not problem for running the s-mac program • If your ns version is 2.29 and below then you have to download a cmu-trace.cc file from the http://www.isi.edu/ilense/software/smac/cmu- trace.cc • Put this file into these path : ns-2/trace/cmu- trace.cc • These file is for the detailed trace analysis of the program S-MAC Parameter Settings Common Settings For Simulation • Topology : In this simulation we have used a 2 node toplogy one is source and another is sink • Traffic pattern: We attached the UDP agent and CBR Traffic source to the source node. • Comparison : In this simulation we have compare the IEEE 802.11 and S-MAC protocol • Both are same except S-MAC having the some differences from 802.11 Basic Features of S-MAC • Listen and Sleep Periodically according to the schedule • Both Physical and Virtual Carrier Sense • Overhearing Avoidance • RTS/CTS Mechanism • Synchronization Algorithm • Neighbor discovery S-MAC Trace Format
• First field indicate event type :
• Send(s) • Receive(r) • Drop(d) • Forward(f) • Time Event • Id of the node on which event takes place • Layer where these event happen – AGT(Agent) – RTR(Router) – IFQ(Interface Queue) – MAC(mac) • Fifth field is reserved for special event • 6th field indicate global sequence number for packet • 7th represented by packet type Here CBR represents that it is data source generated by CBR Traffic source. • The ninth field including three numbers in brackets concerns MAC layer information. Originally, there will be four numbers in the brackets. But S-MAC revises this format. The first number is the duration field of this packet. In Fig. the duration field of this RTS packet is 0.11 s, which is the remaining time reserved for the coming transmission. The second number stands for the MAC address of the receiver of this packet, and the third number for the sender. • The above nine fields are common for all traces if S-MAC is employed. Measurement of Energy Consumption • First we run the s-mac program • Then run the 802.11 program • Form the trace file we compare the ideal energy of both • Because for s-mac periodic sleep and listen is employed so, obviously energy consumption of s-mac is low compared to the 802.11 • The Gnuplot of these are below: Measurement of delay vs. energy consumption • Here we change the duty cycle of the program • We take first duty cycle 10% • For the second case we have taken it 20% • So, basically we changed the listen period of the program • We get the result that as a listen time is small energy consumption is less and delay is more Traffic Variation vs. energy consumption • Here for the traffic variation we change the CBR traffic interval from 0.001 to 10s. • Here 0.001s is high traffic case and 10s is the low traffic case. • We see that for s-mac there is o such variation for high or low traffic means s-mac will adjust its sleep period according to the situation • While for 802.11 energy consumption is large. Energy consumption at Intermediate node • Here we design a 5 node topology • 2 node are sender and 2 node are sink and 1 is router. • Here we also taken the 2 cases like high traffic load and less traffic load • For s-mac variation of energy consumption is very less while for 802.11 it is large variation • See the graph Conclusion
Upto our 3rd review we have try to understand
s-mac basics as good as we can. We also simulate the s-mac in the ns2 for these also we have to refer IEEE paper. We have done the work as good as we can. At last We are thankful to Prof. Sachin Gajjar for his valuable support and guidance throughout the semester. THANK YOU!!