'Network'에 해당되는 글 204건

  1. 2009.01.18 [네트워크 디자이너 기본기 쌓기] ① 네트워크 개념과 동작 원리
  2. 2009.01.18 [네트워크 디자이너 기본기 쌓기] ② 큐잉 이론과 네트워크 모델링
  3. 2009.01.18 [ns] ns-2.29 allinone package error (1/2)
  4. 2009.01.18 [펌] NS-2 유용한 site 모음
  5. 2009.01.18 [펌] NS-2 관련 site 모음
  6. 2009.01.18 ns베이직 원본
  7. 2009.01.18 ns2 802.11b의 파라미터에 대한 설명
  8. 2009.01.18 802.11b
  9. 2009.01.18 R:[ns] Route to base_stn not known: dropping pkt
  10. 2009.01.18 Making NS-2 simulate an 802.11b link

[네트워크 디자이너 기본기 쌓기] ① 네트워크 개념과 동작 원리

| 2009. 1. 18. 03:59
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[네트워크 디자이너 기본기 쌓기] ② 큐잉 이론과 네트워크 모델링

| 2009. 1. 18. 03:59
보호되어 있는 글입니다.
내용을 보시려면 비밀번호를 입력하세요.

[ns] ns-2.29 allinone package error (1/2)

|
ns-allinone-2.29를 설치하다보면 tcl과 tk 설치시 error가 발생한다.

문제는 tcl8.4.11rhk tk8.4.11의 configure 파일에 이상이 있기 때문이다.

(tcl8.4.11 :configure파일의 위치 : ~/ns-allinone-2.29/tcl.8.4.11/unix
 tk8.4.11 : configure파일의 위치 : ~/ns-allinone-2.29/tcl.8.4.11/unix)

이를 수정하기 위해서는

configure안에

\"$ac_link\"라고 되어있는 부분을 "$ac_link"로 고치고

\"$ac_compile\"라고 되어있는 부분을 "$ac_compile"로 고치고

\"$ac_try\"라고 되어있는 부분을 "$ac_try"로 고치고

/etc/.relid'` 라고 되어있는 부분을 /etc/.relid`로 고치면 된다.


(앞에 있는 세미콜론을 지우면 된다.- 헤깔려서 3초간 멈칫했다는....)

그럼 tcl과 tk은 문제 없이 컴파일이 될 것이다.

하지만 문제는 ns-2.29...

ns-2.29는 다음 편에....;;;;

한 두군데가 아니라서 수정후 파일을 첨부합니다.

요긴하게 쓰세요~


PS. 이거 알아내기 위해서 install 파일을 뒤적이다 발견한 또 다른 오타.

tcl에서 error 발생시 tcl 버전이 제대로 표기 되지 않는다.

install 파일에서 8.3.2를 $TCLVER 변수로 변경하면 된다.

실행하는데 에러는 안 나므로 그다지 중요하지는 않다

from : http://totori.tistory.com/91
And

[펌] NS-2 유용한 site 모음

|

[펌] NS-2 유용한 site 모음

이 페이지는 khpoo's Homepage의 일부(http://www.matlab.nitech.ac.jp/~khpoo/research/ns2.html)에서 가져온 것입니다.

Network Simulator (NS-2) Resource Page

Tutorial & Documentation for NS2

Forum & FAQ

TCL/TK

Technical Resources & Books

Trace

Awk

Topology Generator

Traffic Generator

GNUPlot

Queue Simulation for NS-2

QoS for NS-2

Multimedia

Multicasting

Wireless Simulation

Mobiwan

Peer-to-Peer Simulation

TCP/UDP Enhancements for NS-2

Routing

Ant Routing

Video Traces

Add-ons & Extensions

Source Code

Etc


And

[펌] NS-2 관련 site 모음

|
NS-2 관련 자료모음

http://csl.changwon.ac.kr/ref_doc/ns2/index.html
http://sung2ne.tistory.com/entry/Ref-Doc-NS-2
http://www.joon.pe.kr/blog/12
http://wm.hanyang.ac.kr/lecture/ns-2/ns_by_example.html
http://4ellene.net/tt/category/Network/Ns-2
http://www.gongdory.co.kr/category/연구실~/NS-2
http://blog.naver.com/etenallove?redire ··· 22229739
http://tagus.inesc-id.pt/~pestrela/ns2/


일반사항

manual
http://www.isi.edu/nsnam/ns/ns-documentation.html

NS-2 blog
http://ns-2.blogspot.com/

NS-2 by example
http://www.samsiki.net/175

NS-2 강의 mp3 녹음파일
http://nslab.ee.ntu.edu.tw/courses/net- ··· dio.html

802.11 MAC in NS-2
http://www.ece.rice.edu/~jpr/ns/docs/802_11.html

forum
http://www.nabble.com/network-simulator ··· 582.html

trace file for wireless LAN
http://ns-2.blogspot.com/2007/06/how-to ··· for.html

NAM editor
http://ns-2.blogspot.com/2007/04/extend ··· nam.html

Tips : How to scale your simulation to more nodes eg. > 500 nodes and increase the simulation speed
http://ns-2.blogspot.com/2007/02/tips-h ··· -to.html

NS WorkBench : Graphical User Interface For Network Simulator
http://ns-2.blogspot.com/2007/11/ns-wor ··· ace.html

awk 이용한 trace file 분석
http://ns-2.blogspot.com/2006/05/awk-to ··· ile.html

exercise - simulate ad hoc network
http://ns-2.blogspot.com/2006/03/exerci ··· ork.html

how to add a new module in NS-2
http://ns-2.blogspot.com/2006/03/how-do ··· s-2.html

GT-ITM topology generator
http://ns-2.blogspot.com/2006/05/gt-itm ··· tor.html

fast NS-2
http://lst.inf.ethz.ch/fast-ns2/

random trip mobility model for NS-2
http://www.cs.rice.edu/~santa/research/mobility/


modules

GPSR
http://ns-2.blogspot.com/2007/07/greedy ··· psr.html

DSR - FAQ
http://www.geocities.com/b_j_hogan/

infrastructure mode patch
http://www.ee.washington.edu/research/f ··· ions.htm

others

online papers library
http://www.citeulike.org/

network simulators
http://cnonyk.tistory.com/?page=91

기타 유용한 정보
http://www.elmurod.net/
http://www.megite.com/discover/:find_isi_edu/
http://www-static.cc.gatech.edu/classes ··· ummer%2F
http://tmtam.wordpress.com/

'Network > Ns2_Lecture' 카테고리의 다른 글

[ns] ns-2.29 allinone package error (1/2)  (0) 2009.01.18
[펌] NS-2 유용한 site 모음  (0) 2009.01.18
ns베이직 원본  (0) 2009.01.18
ns2 802.11b의 파라미터에 대한 설명  (0) 2009.01.18
802.11b  (0) 2009.01.18
And

ns베이직 원본

|

OTcl: The User Language



As mentioned in the overview section, NS is basically an OTcl interpreter with network simulation object libraries. It is very useful to know how to program in OTcl to use NS. This section shows an example Tcl and OTcl script, from which one can get the basic idea of programming in OTcl. These examples are from the 5th VINT/NS Simulation Tutorial/Workshop. This section and the sections after assumes that the reader installed NS, and is familiar with C and C++.

Example 1 is a general Tcl script that shows how to create a procedure and call it, how to assign values to variables, and how to make a loop. Knowing that OTcl is Object-orieneted extension of Tcl, it is obvious that all Tcl commands work on OTcl - the relationship between Tcl and Otcl is just same as C and C++. To run this script you should download ex-tcl.tcl, and type "ns ex-tcl.tcl" at your shell prompt - the command "ns" starts the NS (an OTcl interpreter). You will also get the same results if you type "tcl ex-tcl.tcl", if tcl8.0 is installed in your machine.



Example 1. A Sample Tcl Script

In Tcl, the keyword proc is used to define a procedure, followed by an procedure name and arguments in curly brackets. The keyword set is used to assign a value to a variable. [expr ...] is to make the interpreter calculate the value of expression within the bracket after the keyword. One thing to note is that to get the value assigned to a variable, $ is used with the variable name. The keyword puts prints out the following string within double quotation marks. The following shows the result of Example 1.

The next example is an object-oriented programming example in OTcl. This example is very simple, but shows the way which an object is created and used in OTcl. As an ordinary NS user, the chances that you will write your own object might be rare. However, since all of the NS objects that you will use in a NS simulation programming, whether or not they are written in C++ and made available to OTcl via the linkage or written only in OTcl, are essentially OTcl objects, understanding OTcl object is helpful.

ex-otcl.tcl

Example 2. A Sample OTcl Script

Example 2 is an OTcl script that defines two object classes, "mom" and "kid", where "kid" is the child class of "mom", and a member function called "greet" for each class. After the class definitions, each object instance is declared, the "age" variable of each instance is set to 45 (for mom) and 15 (for kid), and the "greet" member function of each object instance is called. The keyword Class is to create an object class and instproc is to define a member function to an object class. Class inheritance is specified using the keyword -superclass. In defining member functions, $self acts same as the "this" pointer in C++, and instvar checks if the following variable name is already declared in its class or in its superclass. If the variable name given is already declared, the variable is referenced, if not a new one is declared. Finally, to create an object instance, the keyword new is used as shown in the example. Downloading ex-otcl.tcl and executing "ns ex-otcl.tcl" will give you the following result:


'Network > Ns2_Lecture' 카테고리의 다른 글

[펌] NS-2 유용한 site 모음  (0) 2009.01.18
[펌] NS-2 관련 site 모음  (0) 2009.01.18
ns2 802.11b의 파라미터에 대한 설명  (0) 2009.01.18
802.11b  (0) 2009.01.18
R:[ns] Route to base_stn not known: dropping pkt  (0) 2009.01.18
And

ns2 802.11b의 파라미터에 대한 설명

|
ns2 802.11b의 파라미터에 대한 설명

'Network > Ns2_Lecture' 카테고리의 다른 글

[펌] NS-2 관련 site 모음  (0) 2009.01.18
ns베이직 원본  (0) 2009.01.18
802.11b  (0) 2009.01.18
R:[ns] Route to base_stn not known: dropping pkt  (0) 2009.01.18
Making NS-2 simulate an 802.11b link  (0) 2009.01.18
And

802.11b

|

The received power Pr at a distance d from the transmitter for the two-ray ground reflection model [2] can be expressed as:

          (1)

 

where Gt is the transmitter antenna gain, Gr is the receiver antenna gain, d is the distance between the antennas in meters, ht is the height of the transmitter and hr is the height of the receiver.

The power level at which the packet was received at MAC layer is compared with the receiving threshold (RTX) and the carrier-sense threshold (CTX). If the power level falls below the carrier sense threshold, the packet is discarded as noise. If the received power level is above the carrier sense threshold but below the receive threshold, the packet is marked as a packet in error before being passed to the MAC layer. Otherwise, the packet is simply handed up to the MAC layer.

In NS-2, the default transmitting power Pt is 0.28, and thus the transmission range (TX_range) and physical carrier sensing range (PCS_range) are calculated as 250 meters and 550 meters. However, as discussion in [1; pp.97, 94, 73], the default values of TX_range and PCS_range used in the NS-2 is two to three times higher than the values measured in practice. To accurately model the attenuation of communication radius between antennas close to the ground, in our simulation model, the TX_range is set 40 meters, and the PCS_range, with respect to the transmitting station, is set to 90 meters. Thus the RTX and the CTX can calculated as 1.74293×10-08 and 3.44283×10-09, respectively. The height of antennas is 1.5m above the ground plane operating in the 2.4 GHz band. Table n and Table n lists the parameter values that are used for simulation in the 802.11b/g standard specification .

Table 1. Value of the IEEE 802.11b parameters

SLOT

SIFS

DIFS

PHYhdr

CWmin

CWmax

RTS

CTS

ACK

20 μsec

10μsec

50 μsec

192 bits

32

1024

20

14

14

 

Table 2. Value of the IEEE 802.11g parameters

SLOT

SIFS

DIFS

PHYhdr

CWmin

CWmax

RTS

CTS

ACK

9 μsec

10μsec

28 μsec

192 bits

16

1024

20

14

14

 


And

R:[ns] Route to base_stn not known: dropping pkt

|

Hello,

The message "warning:Route to base_stn not known: dropping pkt" is generated
by the mobile node's DSDV agent (see ns/dsdv/dsdv.cc). DSDV agent always
tries to send packets to the base station referred in the variable base_stn_
of the class MobileNode (see ns/mobilenode.cc). In wireless3.tcl, with the
instruction

set HAaddress [AddrParams set-hieraddr [$HA node-addr]]
[$MH set regagent_] set home_agent_ $HAaddress

we set base_stn_ with the address of the home agent.

When the mobile node performs a handoff, after receiving a new agent
advertisement (from the foreign agent), it modifies the value of base_stn_
with the address of the foreign agent (see mip-reg.cc).

The warning message is caused because the mobile node is trying to send a
packet (probably an acknowledgement to a received TCP packet) to the old
base station, but it is not under its coverage area and it has not updated
the value of base_stn_ yet. 

I hope it helps,


'Network > Ns2_Lecture' 카테고리의 다른 글

ns2 802.11b의 파라미터에 대한 설명  (0) 2009.01.18
802.11b  (0) 2009.01.18
Making NS-2 simulate an 802.11b link  (0) 2009.01.18
NS2 - 무선환경 시뮬레이션  (0) 2009.01.18
NS2 - OTcl linkage  (0) 2009.01.18
And

Making NS-2 simulate an 802.11b link

|

Making NS-2 simulate an 802.11b link
Last update: 4-29-05
Joshua Robinson
jpr -at- rice.edu

For a research project I worked on in 2004 (resulting paper here), I used two Netgear MA311 cards to create a simple ad hoc connection. These cards are 802.11b PCI cards, stuck in the back of brand new dell workstations. I did some simple throughput tests using netperf, and found that my results differed significantly from what NS told me.

So I set about to figure out why things were different and what needed to be done to sync the results. I'll quickly explain my findings as it wasn't a complex process. Skip to here if you want to see my actual results.

First, I'm assuming version 2.27 or newer here. If you're using older versions, some things will be different and I'll try to point them out if I can. If you're using a newer version, then things will likely also be different, but I've unfortunately stopped work on Ns-2 since 2005.

Data Rate
NS, by default, has the data rate for the MAC set at 2 Mbps. But cards are faster now. My cards are 802.11b, which means they're 11 Mbps, and so we need to change this. Add the following to the beginning of your simulation script:
Mac/802_11 set dataRate_ 11Mb

The card can send at 1, 2, 5.5, or 11 Mbps. Most cards support some kind of ARF (Auto-Rate Fallback) for automatic rate selection between these choices. ARF basically seems to be a slow-timescale feedback mechanism. If there are a lot of packet errors, ARF will step down the rate, and conversely, if there are no errors then the rate will be increased. I'm not explaining this in detail because NS doesn't support any multi-rate functionality by default. That means mobile nodes will always send their packets at dataRate_. So if you really want to be realistic, you need to support this somehow. I didn't.

RTS Threshold
Almost all commercial 802.11b cards have the RTS/CTS exchange turned off by default. This is not a bad decision since I think most people's home wlan networks are simple enough so that the RTS/CTS really is just unnecessary overhead. NS by default has this feature turned on, so we probably want to tell NS not to use this feature. Add this line to the beginning of your script:
Mac/802_11 set RTSThreshold_ 3000

This means that an RTS will only be sent for packets that are bigger than 3000 bytes, which should be never. Note: if you want RTS/CTS on, then set this value to zero.

Preamble
I think this is probably the least obvious modification so I'll try to be a little more detailed. Every packet is sent with a preamble, which is just a known pattern of bits at the beginning of the packet so that the receiver can sync up and be ready for the real data. This preamble must be sent at the basic rate (1 Mbps), according to the official standard. But there are two different kinds of preambles, short and long - referring to the length of the sync field. The long preamble has a field size of 128 bits, while the short preamble is only 56 bits. I would guess this short preamble option came about as hardware progressed and transceivers got better at locking on to a signal. NS is set by default to use the long preamble. My cards use the short preamble by default, and unfortunately, I don't know a good way to determine if your card is using long or short preambles. Email me if you have any ideas.

To support short preambles in NS, add the following line at the beginning of your script:
Mac/802_11 set PreambleLength_ 72
Note: there are 16 other bits in the preamble that aren't affected by the short/long distinction. To go back to long, change this value to 144.

The ChannelAbove is everything you need to simulate an 802.11b card accurately (at least more accurately than the default NS does), but there's still a big assumption in NS - that's the wireless channel model. Currently the received power of a packet only depends on the distance between sender and receiver. But in real life, there are a lot of other factors influencing received power. And if you want a realistic simulation, you need to simulate this. I would suggest going here to find out more information about a more realistic channel fading model.

Packet SizeThere is a slightly annoying default setting in many versions of ns that makes your packet size not what you think it is. The default setting is this:
Agent/UDP set packetSize_ 1000
Which means that if you try to set your UDP packet size to greater than this, it will actually split up each packet into two smaller ones. You really want this line:
Agent/UDP set packetSize_ 1500
If you are not sure if this is a problem, I would recommend checking the packet sizes in your trace file. If you see the wrong packet sizes, this is most likely the problem.

ResultsThe table below shows achieved UDP throughput in Mbps.

Packet Size (Bytes)

Simulation
RTS off

Experimental
RTS off

Simulation
RTS on

Experimental
RTS on

128

1.28

1.2

0.75

0.76

256

2.03

2.08

1.4

1.42

512

3.67

3.58

2.48

2.5

1024

5.49

5.38

4.03

4.05

1440

6.41

6.35

4.93

4.96

As you can see, the simulation results are very close to the real results I obtained. In fact, I believe that they are close enough so that the difference can be entirely accounted for by the randomness of the CSMA MAC.

Note that I have not actually worked on this project or Ns-2 for several years, so I'm sure things have changed and I can't guarantee that this will still work.

Back


'Network > Ns2_Lecture' 카테고리의 다른 글

802.11b  (0) 2009.01.18
R:[ns] Route to base_stn not known: dropping pkt  (0) 2009.01.18
NS2 - 무선환경 시뮬레이션  (0) 2009.01.18
NS2 - OTcl linkage  (0) 2009.01.18
NS2 trace  (0) 2009.01.18
And