CS 4633 Simulation Techniques

Spring 2005
Instructor Dr. Turgay Korkmaz

Homework 3 – programming (80 points)

 

Design Deadline is Feb 24, 2005 (3:30pm)  -- 30 points

NO LATE DESIGN WILL BE ACCEPTED.

I will give you a sample design on Feb 24, so that

you can fix your design or extend my design for implementation.

 

Implementation & Execution Deadline is March 3, 2005 (3:30pm) -- 50 points

 

 

In this homework, you will implement a simulation program for a simplified sensor network using CSIM (i.e., process-oriented approach).

 

Suppose we have N sensors uniformly distributed in an area to monitor the occurrence of a certain type of event (say Fire_Event) that might happen at any time and at any point in that area. When Fire_Event happens, it will be detected by the close-by sensors and that information will be sent to a base station for further processing (e.g., finding the exact location of the event).

 

Consider the below figure that illustrates the main components in the sensor network.

 

 

 

 

 

 

 

 

 

 

 

 


 

 

Base station located at x=MaxX/2, y=MaxY/2 directly communicates with each sensors over a wireless link that has the capacity of C Kbit/sec, so the transmission delay is (size of packet) / C. Propagation delay is computed by (distance between the base station and the given sensor) / speed of signal=2*10^8m/s). Since this wireless communication channel is a shared medium, only one sensor can talk to the base station at a given time. To control the access to this medium, the base station uses a technique known as token-ring. Basically, base station asks each station in a predefined order (say, sensor0, sensor1,…sensorN-1) if it has a data-packet . If yes, that sensors sends its data packet otherwise it informs the base station that it does not have nay packet at this time. Suppose packets are not corrupted or lost during transmission. If a sensor has more packets, it can send one more in the next cycle.  

 

Each sensor located at x=uniform(0,MaxX), y=uniform(0,MaxY) senses the area within a circle with radius SR as shown below. When a sensor i detects Fire_Event, it creates a packet containing (i, time for Fire_Event, x of sensor i, y of sensor i, and some data=uniform_int(10,100) bytes). Sensor keeps generated packets in a FIFO queue and sends them one-by-one whenever the base station allows it. You will compute transmission and propagation delay as mentioned above.

 

 

 

 

 

 

 

 

 

 

 

 

 

 


Fire_Events are randomly happening with inter-arrival time exponential( Te sec) at x=uniform(0,MaxX), y=uniform(0,MaxY).

 

We will give seed, MaxX, MaxY, N, SR, C, Te SIM_TIME as parameters when running simulation program.

 

Suppose we are interested in

a)      what percent of the events are actually detected and 

b)      what is the average delay/time between the time at which actual event happened and the time at which the base station received the information about that event.

 

Suppose we want to measure these performance parameters when N=10, 50, 100  and

SR = 5 meters, 10 meters, and 20 meters while MaxX=500meters, MaxY=500meters, C=2, Te= 5, SIM_TIME=20 minutes; So we the following nine (9) cases

 

N=10 SR=5 MaxX=500meters, MaxY=500meters, C=2, Te= 5, SIM_TIME=20

N=10 SR=10 MaxX=500meters, MaxY=500meters, C=2, Te= 5, SIM_TIME=20

N=10 SR=20 MaxX=500meters, MaxY=500meters, C=2, Te= 5, SIM_TIME=20

 

N=50 SR=5 MaxX=500meters, MaxY=500meters, C=2, Te= 5, SIM_TIME=20

N=50 SR=10 MaxX=500meters, MaxY=500meters, C=2, Te= 5, SIM_TIME=20

N=50 SR=20 MaxX=500meters, MaxY=500meters, C=2, Te= 5, SIM_TIME=20

 

N=100 SR=5 MaxX=500meters, MaxY=500meters, C=2, Te= 5 , SIM_TIME=20

N=100 SR=10 MaxX=500meters, MaxY=500meters, C=2, Te= 5 , SIM_TIME=20

N=100 SR=20 MaxX=500meters, MaxY=500meters, C=2, Te= 5 , SIM_TIME=20

 

For each case run your program five (5) times and compute the performance measure we are interested in as shown in the below table:

Case                 run1     run2     run3     run4     run5     Avg

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

CASE- I           p1,d1   p2,d2   p3,d3   p4,d4   p5,d5   avg p = (p1+...+p5)/5

                                                                                    avg d= (d1+...+d5)/5

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

CASE- I I        p1,d1   p2,d2   p3,d3   p4,d4   p5,d5   avg p = (p1+...+p5)/5

                                                                                    avg d= (d1+...+d5)/5

 

………..