2008年3月27日 星期四

lab 9 hidden terminal and exposed terminal

Here in this project, we will discuss the hidden terminal and exposed terminal problem.
Using the RTS/CTS to solve the problem.


Hidden terminal
A and C, can't hear each other, both want to send data to B. The data will occur collision at node B.
A --- B --- C


Exposed terminal
S1 is sending data to S1, but S2 hear S1 is sending. So S2 will stop to send if it want to send something to R2. R2 is called a exposed terminal.
R1 <--- S1 S2 ---> R2

1.
The program need to compile in the first time.



2.
Two Ray ground, distance set 250m.


3.
simulate the tcl files


4
use threshold.exe to find the parameters
A-B 100m
B-C 100m
Transmit distance=120m
Carrier Sense distance=150m






9.
Test hidden terminal
without RTS/CTS


10.
sd1 sent 1688 packets


Sd2 sent 1626 packets


rd1 only get 125 pakets


and rd2 get 83 packets



11.
with RTS/CTS
rd1 receive 746 packets


11
rd2 got 782 packets


12
expose terminal sim.
A and C, can't hear each other, both want to send data to B. The data will occur collision at node B.
A --- B --- C
100m 100m

carrier sense distance 120m
data transmit distance 100m




13.

sim. the tcl files



14.
and we can see
without RTS/CTS

the same as previous one
10.
sd1 sent 1688 packets


Sd2 sent 1626 packets









16.
rd1 receive 1038 packets from node1



17.
rd2 receive 660 packets from node 3



18.
when we have RTS/CTS
rd1 receive 875 packets from node1



19.
rd2 receive 741 packets from node 3


The packets receive rate is not increased .
The result shows even we have RTS/CTS, the hidden terminal problem is not solved.

lab4 measure network throuput

1.ns simulate wired-measure.tcl to generate record files


2.sd_udp list 550 items


3. open rd_udp
542 packets collected(543 lines)


8 packet loss = 8/550 = 1.45%

4. packet delay time


依照課本完成圖形,到電腦打開那張gif有發現打不開的情形,發現是cygwin佔用那張圖片
把cygwin關掉候,就可以順利打開了

5. measure jitter




6.udp throuput measure



7. wireless measure


8
my result is different from the books

why?

Here is my data.
sd_udp
440 packets are found.



rd_udp

190 packets are found.

packet loss
250 / 440 = 0.568

9

packet delay time



10

find jitter


11

throughput found!;

2008年3月13日 星期四

lab3 Network Scenario Generator (NSG)

NGS is another TCL generator.
Both wired and wireless network can be simulated.

wired simulation
1.
The same topology from lab2 is used. But we take NGS as the simulator.


2. After all the parameter is all set. Click the TCL button to generate TCL files.


3. type "ns lab2nsg.tcl" you will get out.nam and out .tr



4.

Use nam to run the .nam files.
The animation start.


wireless simulation
1.
according to the ref. book, we can create the topology of 6 nodes.





2. n4 waypoint setup and agent , application are carefully determined.

Use nam to run the .nam files.

The animation of the wireless scenario as follows.







n4 is moving horizontally form (200,300) to (200,800)