2010년 7월 29일 목요일

Google Analytics

엔터프라이즈급 무료 웹 분석 도구인 Google Analytics를 적용했다.
http://www.google.com/intl/ko_ALL/analytics/

로그 및 트래픽 분석, 최적화가 가능한 툴에 엑세스 하여 사이트 전략 및 마케팅, 운영등의 정책을 수립하고 강화하는데 도움이 되지 않을까?

2010년 7월 28일 수요일

Installation of Network Simulator NS2

OS : xubuntu 9.04
NS2 Ver. : ns-allinone-2.34

xubuntu에 ns2 설치 전 꼭 필요한 필수 패키지들이 있다.
다음과 같이 설치한다.

$ apt-get install gcc, g++, libc6-dev, tcl8.5, tk8.5, tcl8.5-dev, tk8.5-dev, libxmu-dev

이미 xubuntu 배포판 설치 시 설치되어 있는 경우도 있으므로 패스~ 
패키지 설치가 끝나면 ns2 설치를 위해 다음 링크에서 2.34 버전을 다운로드 받는다.

http://sourceforge.net/projects/nsnam/files/allinone/ns-allinone-2.34/

다운로드 받은 ns-allinone-2.34를 /opt 에 위치시키고 압축해제 한 후 해당 폴더에서 ./install 명령을 통해 설치를 한다.

$ tar –xvf ns-allinone-2.34.tar.gz
$ ./install

설치가 정상적으로 완료되면 다음과 같은 내용을 볼 수 있다.
------------------------------------------------------------------------------
Please put /opt/ns-allinone-2.34/bin:/opt/ns-allinone-2.34/tcl8.4.18/unix:/opt/ns-allinone-2.34/tk8.4.18/unix
into your PATH environment; so that you'll be able to run itm/tclsh/wish/xgraph.

IMPORTANT NOTICES:
(1) You MUST put /opt/ns-allinone-2.34/otcl-1.13, /opt/ns-allinone-2.34/lib,
    into your LD_LIBRARY_PATH environment variable.
    If it complains about X libraries, add path to your X libraries
    into LD_LIBRARY_PATH.
    If you are using csh, you can set it like:
        setenv LD_LIBRARY_PATH <paths>
    If you are using sh, you can set it like:
        export LD_LIBRARY_PATH=<paths>

(2) You MUST put /opt/ns-allinone-2.34/tcl8.4.18/library into your TCL_LIBRARY environmental
    variable. Otherwise ns/nam will complain during startup.

After these steps, you can now run the ns validation suite with
cd ns-2.34; ./validate

For trouble shooting, please first read ns problems page
http://www.isi.edu/nsnam/ns/ns-problems.html . Also search the ns mailing list archive
for related posts.
-------------------------------------------------------------------------------

설치가 완료되면 path를 설정한다. ~/.bashrc 파일을 열고 다음의 내용을 추가한다.

# LD_LIBRARY_PATH
OTCL_LIB=/opt/ns-allinone-2.34/otcl-1.13
NS2_LIB=/opt/ns-allinone-2.34/lib
X11_LIB=/usr/X11R6/
USR_LOCAL_LIB=/usr/local/lib
export LD_LIBRARY_PATH=$LD_LIBRARY_PATH:$OTCL_LIB:$NS2_LIB:$X11_LIB:$USR_LOCAL_LIB

# TCL_LIBRARY
TCL_LIB=/opt/ns-allinone-2.34/tcl8.4.18/library
USR_LIB=/usr/lib
export TCL_LIBRARY=$TCL_LIB:$USR_LIB

# PATH
XGRAPH=/opt/ns-allinone-2.34/bin:/opt/ns-allinone-2.34/tcl8.4.18/unix:/opt/ns-allinone-2.34/tk8.4.18/unix
NS=/opt/ns-allinone-2.34/ns-2.34/
NAM=/opt/ns-allinone-2.34/nam-1.14/
PATH=$PATH:$XGRAPH:$NS:$NAM

저장한 후 설정된 내용을 적용시킨다.

$ source ~/.bashrc

마지막으로 실행은 다음과 같다.

$ ns
%

위와 같은 내용이 눈에 보인다면 성공이다... 종료는 exit 명령을 사용한다.

2010년 7월 21일 수요일

CC2420 in-line security option

Introduction

The CC2420 radio chip supports three types of in-line security modes, leveraging the same underlying 128-bit AES encryption:

  • Counter Mode Encryption (CTR)
  • Cipher Block Chaining Message Authentication Code (CBC-MAC)
  • Counter with CBC-MAC (CCM).

The CC2420 in-line security implementations add two new interfaces to the CC2420 radio stack in TinyOS 2.1: CC2420SecurityMode and CC2420Keys. The implementations are located in tos/chips/cc2420/security/ and the interfaces are located in tos/chips/cc2420/interfaces/. The design of the security implementation is based on the CC2420 specifications and the IEEE 802.15.4 2006 standards.


Transmitter Configuration

Makefile

Users intending to enable the security features MUST add the CC2420_HW_SECURITY flag in the Makefile.

CFLAGS+=-DCC2420_HW_SECURITY

Another point to note is the possible need for modifying the value of TOSH_DATA_LENGTH. Using different security options will add different amounts of additional overhead in the packet. For example, using the CBC-MAC authentication with a 16 byte MIC will require an additional 16 bytes in the payload portion of the message_t. While the security header is located in the cc2420_header_t, it takes up 6 additional bytes in the packet as well. The format of the security header can be found in tos/chips/cc2420/CC2420.h

Wiring (configuration file)

components new SecAMSenderC(AM_RADIO_COUNT_MSG) as AMSenderC;
components new AMReceiverC(AM_RADIO_COUNT_MSG);
components CC2420KeysC;
App.Receive -> AMReceiverC;
App.AMSend -> AMSenderC;
App.Packet -> AMSenderC;
App.CC2420SecurityMode -> AMSenderC;
App.CC2420Keys -> CC2420KeysC;

The AMSender interface MUST be wired to the SecAMSenderC component. The Packet interface is also provided by the SecAMSenderC and all packets that use the CC2420 in-line security features MUST be wired to this component. Note that the CC2420SecurityMode interface explained in the previous section is also provided by the SecAMSenderC component. The CC2420Key interface is provided by the CC2420KeyC component. The Receive interface can be wired as the case when no security is used because decryption happens transparently for the secured packets at the lower layers (below AM stack).


Implementation File

An array of 16 bytes SHOULD be set to store the desired key values. An example is shown below.

uint8_t key[16] = {0x98,0x67,0x7F,0xAF,0xD6,0xAD,0xB7,0x0C,0x59,0xE8,0xD9,0x47,0xC9,0x71,0x15,0x0F};

After the radio starts (SplitControl.startDone()), the following commands SHOULD be called to set the key values to a desired key register as explained above. The example below sets register 1 of the key registers (CC2420 offers registers 0 and 1) to a user specified key value shown above.

call CC2420Keys.setKey(1, key);

This call to the setKey command signals an event indicating the end of the key setting process.

event void CC2420Keys.setKeyDone(uint8_t keyNo, uint8_t* skey){}

This event is important for both the transmitting node. When this event is signaled, one of the following commands (provided by the CC2420SecurityMode interface) can be called for each packet transmission, with respect to the user-defined key values.

call CC2420SecurityMode.setCtr(msg, 1, 0);
call CC2420SecurityMode.setCbcMac(msg, 1, 0, 16);
call CC2420SecurityMode.setCcm(msg, 1, 0, 16);

For setCbcMac and setCcm, the last parameter is the size in bytes of the message authentication code. It can be 4, 8 or 16. Once the above steps are done,

call AMSend.send(msg, len);

can be called to send a packet just like any other packet transmissions.


Receiver Configuration

A receiver node that intends to enable the CC2420 Security features MUST add the CC2420_HW_SECURITY flag in the Makefile as well as the transmitter.

CFLAGS+=-DCC2420_HW_SECURITY

This enables all the decryption processes in the CC2420ReceiveP.nc file. Also, the receiver must have knowledge about the key values that a transmitter is using and SHOULD set the key registers with the user-desired keys before packets are exchanged. The example below sets register 1 of the key registers (CC2420 offers registers 0 and 1) to a user specified key value.

uint8_t key[16] = {0x98,0x67,0x7F,0xAF,0xD6,0xAD,0xB7,0x0C,0x59,0xE8,0xD9,0x47,0xC9,0x71,0x15,0x0F};
call CC2420Keys.setKey(1, key);

This call to the setKey command will signal an event indicating the end of the key setting process.

event void CC2420Keys.setKeyDone(uint8_t keyNo, uint8_t* skey){}

To use the CC2420Keys interface above, the following wiring MUST be done in the configuration file.

components CC2420KeysC;
App.CC2420Keys -> CC2420KeysC;

For the receiver, this event indicates that the radio is now ready to decrypt packets with the user-defined key values.


Examples

Sample implementations of applications that enable the CC2420 in-line security features (RadioCountToLeds and BaseStation) can be found in apps/tests/cc2420/TestSecurity/.

2010년 7월 5일 월요일

Contiki install and compile(for Linux)

1. install

cvs –d:pserver:anonymous@contiki.cvs.sourceforge.net:/cvsroot/contiki login

cvs –z3 –d:pserver:anonymous@contiki.cvs.sourceforge.net:/cvsroot/contiki co contiki-2.x

다운로드는 /opt에 위치.(/opt/contiki-2.x)

2. compile

$cd /opt/contiki-2.x/examples/sky로 이동

$make sky-motelist 명령으로 현재 연결된 mote 정보 출력.

$make blink.upload 명령으로 컴파일 및 업로드.

 

주의! 이미 컴파일 및 업로드를 위한 패키지가 설치되어 있으므로 이 부분은 생략.