September 9, 2010

today's update

今天学到的东西
rm
scp
mkdir
mv
...
data quota exceeded
some basic perl rules

待学的东西
vim
tcpdump

实验室工作今儿到此为止。开始写作业了~

September 8, 2010

setup wireless LAN among Ubuntu linux OS

Fix Wireless Ad-Hoc in GUI [click]


Wireless Extensions CLI tools
This process is often used as the fall back position if the gui tools fail to work. The following example uses eth1 for the wifi interface though this may be wlan0, ath0 or something else in your case.

Preparation:
Ensure that network manager has been stopped and then bring the interface down.
sudo service network-manager stop
sudo ifconfig eth1 down
iwconfig (or ifconfig) //look up if there is anything abnormal
sudo dhclient eth1  ////Bring the interface back up

Configuration:
sudo iwconfig eth1 mode ad-hoc  //Switch the card into ad hoc mode
*sudo iwconfig eth1 channel 4  //Set the channel/frequency that you want to use.
sudo iwconfig eth1 essid 'name'  //Add the name (ssid) for the network you want to create/join. Use single quotes if there is a space in the name.
*sudo iwconfig eth1 key 1234567890  //Add a WEP encryption key
*sudo dhclient eth1  //Start dhclient to get an address
sudo ifconfig eth1 169.254.34.2  //If you want to do it manually, you will have to make up an IP address.

You should now be connected to the ad hoc network. Use the iwconfig command to view the cell being used. This must match the same cell on the other PCs that you want to connect to.

Testing:
ping 169.254.34.2  //Once you have two or more computers connected to the ad hoc network, all of them showing the same cell number and having different IP addresses, then try pinging one from the others. If that doesn't work then try specifying the interface name along with the address.
ping -I eth1 169.254.34.2  //If you have more than one interface with link-local addresses there can be some routing confusion, so I recommend that you bring down these unused interfaces while connected to non-DHCP networks. If the other interfaces are all on DHCP networks, such as in the case of InternetConnectionSharing this is not necessary.
sudo ifdown eth0

Example Interfaces File:
Currently Network Manager does not support static address settings and Network-Admin does not support ad hoc networks. So instead we can configure the network in the /etc/network/interfaces file. The following is an example.

auto lo
iface lo inet loopback

auto eth1
iface eth1 inet static
wireless-mode ad-hoc
wireless-channel 4
wireless-essid 'name'
wireless-key 1234567890
address 192.168.0.2
netmask 255.255.255.0
gateway 192.168.0.1



ps. some useful command:
ifconfig [click]  iwconfig [click]
wlanconfig [click]  tcpdump [click]

rssi and snr

In telecommunications, received signal strength indicator (RSSI) is a measurement of the power present in a received radio signal. RSSI is generic radio receiver technology metric, which is usually invisible to the user of device containing the receiver, but is directly known to users of wireless networking of IEEE 802.11 protocol family. RSSI is often done in the intermediate frequency (IF) stage before the IF amplifier. In zero-IF systems, it is done in the baseband signal chain, before the baseband amplifier. RSSI output is often a DC analog level. It can also be sampled by an internal ADC and the resulting codes available directly or via peripheral or internal processor bus.

"RSSI" values have unspecified unit, ie. their meaning depends on manufacturer. Some report as dBm, some as a percent, some even in milliwatts. There is no standard. Also, the proper way to find SNR *is* to subtract dB values, as dB are logarithmic and hence the difference of logs is the same as a ratio without log. In other words, if a signal has amplitude 1 and noise is 0.5, the SNR is (1/0.5) = 2, but if the signal is measured as being at (say) -12 dB and noise floor is -16 dB, the SNR is (-12-(-16)) = 4 dB.

Moreover, link quality depends on many other factors and the signal-to-noise ratio (computed from rssi and noise floor) is only one such factor.

And finally, finding SNR of a wifi signal by subtracting noise floor from the rssi is of course only applicable if both values are reported in a log/dB scale. Otherwise if they are linear you'd need to use ratio (as you said) and if they are some other sort of scale then who knows what needs to be used!

September 7, 2010

nice advice (by prof. Elaine Rich)

The Computer Sciences Department Rules to Live By

November 2, 2008
The Computer Sciences Department is a community of scholars and students. Each of us thrives if the community thrives. Each of us thus has an individual responsibility to strive, not just for our own goals, but for the goals of the larger community. In this document, a group of the faculty have laid out a set of ground rules designed to make our department the kind of community in which we all want to live. If a professor in one of your classes has pointed you here, you should view this document as part of the syllabus for that class.

As a Student, What You Can Expect from Your Department

I. The CS Curriculum

  • The faculty as a whole have the responsibility to formulate a curriculum that will prepare you for a lifetime of work in the field of computing. Yes, some of what you learn will get you a job right away. Some of what you learn may seem more esoteric and less essential. But remember that the faculty have lived through a lot of changes in the field. They've all had to learn new ideas, new programming language, new architectures, and new applications many times (and without the aid of classes or textbooks). They've got a lot of first hand understanding of the fundamental concepts that make it easiest to adapt as new things come along. Trust a bit and take advantage of this expertise. Try to like every class you take.

II. Each Class that You Take

  • The most important thing that each of your teachers should give you is a guided tour through the subject matter of the class. After all, you can go to the bookstore, buy books, read them, and write some code without ever signing up for a class. But, whenever you do sign up for a class, you have the right to expect that the instructor has read a lot of books, solved a lot of problems, and then chosen, from all of that material, 14 weeks of the most important ideas presented in the clearest fashion.
  • You have the right to expect that every instructor will show up for class on time and be prepared to conduct the class.

III. Responsiveness from the Instructional Staff

  • In most of your CS classes, you will have an instructor, one or more TAs, and possibly a set of proctors. This group of people, working as a team, have the responsibility to do everything they can to help you learn.
  • Your instructor, TAs, and proctors should treat you with respect and encourage you to seek help when you need it.

IV. Grades

  • Publication of the Grading Policy: You have a right to be told, within the first four days of the semester, how grades in each class will be determined. You will be told what the basis of the grade will be and how much weight will be assigned to each component of the grade. In some classes, you may be told even more, for example, what numeric scores will be assigned what letter grades. But keep in mind that this isn't always possible. Classes that use different exams each semester may have very different score distributions from one semester to the next so it isn't possible to know in advance what thresholds make sense.
  • Fairness: You have a right to expect that grades will be assigned fairly. Every student who turns in the same quality of work will receive the same grade.
  • Feedback: You have a right to see your graded work and to understand what, if anything, was wrong with the work you submitted.
  • Punctuality: You have a right to expect that exams and assignments will be graded in a timely fashion. It's hard to be more specific on this since the amount of time required to do a good job of grading depends so heavily on the kind of work and the staffing level of the class. One concrete thing you should expect is that you will have gotten some substantive feedback on your performance in each class before the Q drop deadline.

As a Student, What the Department Can Expect from You

I. Academic Honesty

The University and the Department are committed to preserving the reputation of your degree. It means a lot to you. In order to guarantee that every degree means what it says it means, we must enforce a strict policy that guarantees that the work that you turn in is your own and that the grades you receive measure your personal achievements in your classes:
Every piece of work that you turn in with your name on it must be yours and yours alone unless explicitly allowed by an instructor in a particular class. Specifically, unless otherwise authorized by an instructor:
  • Students may not discuss their work with anyone except the instructor and other members of the instructional staff (TA, Section Leader or Lab Proctor).
  • Students may not acquire from any source (e.g., another student or an internet site) a partial or complete solution to a problem or project that has been assigned.

You are responsible for complying with this policy in two ways:
1.      You must not turn in work that is not yours, except as expressly permitted by the instructor of each course.
2.      You must take all reasonable precautions to prevent your work from being stolen.  It is important that you do nothing that would enable someone else to turn in work that is not theirs.  Do not share your work with anyone else.  Make sure that you adequately protect all your files.  Even after you have finished a class, do not share your work or published answers with the students who come after you.  They need to do their work on their own.
IMPORTANT: The penalty for academic dishonesty will be a course grade of F and a referral of the case to the Dean of Students Office. Further penalties, including suspension or expulsion from the University may be imposed by that office.
One final word: This policy is not intended to discourage students from learning from each other, nor is it unmindful of the fact that most significant work in computer science and in the computing industry is done by teams of people working together. But, because of our need to assign individual grades, we are forced to impose an otherwise artificial requirement for individual work. In some classes, it is possible to allow and even encourage collaboration in ways that do not interfere with the instructor's ability to assign grades. In these cases, your instructor will make clear to you exactly what kinds of collaboration are allowed for that class.

II. Attendance at Classes and Exams

  • Specific policies on class attendance will be set by individual instructors. Make sure you follow those policies.
  • Whether you come to class or not, you are responsible for keeping up with what happens in class. If you miss a class (other than for illness or an emergency), it is not reasonable for you to expect your instructor or TA to repeat just for you the material that was covered in the class that you missed. This applies both to the content of the class as well as to announcements about class policies, events, deadlines, or whatever.
  • Final examination schedules are published at the time of preregistration. If you are making end-of-semester travel plans, make sure that you will still be here to take each of your finals at the scheduled time. Travel plans are not a valid reason for missing an exam or asking for a special exam time.
  • The policy on makeup exams will be set by individual instructors. Sometimes a makeup will be allowed, but many times it will not be. Except for emergencies, you must take each exam at its scheduled time unless you have made prior arrangements with the instructor. Keep in mind that is often difficult or impossible for an instructor to create a separate makeup exam that is guaranteed to be of equal difficulty as the regular exam.
  • Demands of a job or job interviewing are never valid reasons for missing a class (or a deadline or an exam).

III. Classroom Behavior

  • You have the right to learn in every class you attend. But you have the responsibility to help assure that every other student shares that right. Specifically:
    • Come to class on time. Do not leave early. These things are very disruptive. Recognize that the buses and the parking space situation are unpredictable elements and allow for that. If you must come late or leave early (for example because of a doctor's appointment), let the instructor know in advance.
    • Don't be disruptive during class. Don't chat with your neighbor or rustle the newspaper.
    • Don't allow your electronic devices to be disruptive. Turn off your cell phone, beeper, and watch alarm.
    • Participate.

IV. Academic Work outside the Classroom

  • The only way to learn computer science is to do it. You should plan to spend a substantial amount of time outside the classroom working on each class that you take. For some classes, that will mean programming. For others, it may mean reading, studying, working problems, writing, or whatever. Don't let this work slide. It will not generally possible either to do a programming project or learn the material in a theoretical class the night before the due date or the exam. You should be working on your own every week of the semester.
  • A deadline is a deadline. Each instructor will publish the class policy for turning in late work. Plan your work accordingly. Don't push the deadlines and don't expect the instructor to do anything other than what has been published. Even five minutes is "late". Your instructor can't just acquiesce and accept your project five minutes late. Then what about seven or ten or fifteen or thirty? What about the other students in the class who had to miss some other event in order to get their work in on time? Is it fair to them to accept your work late? No. Plan that the printer will be down and the busses will be late on the day your assignment is due. Don't cut it down to the wire. And, if you do, accept the published consequences with grace.

V. Faculty and Staff Interaction

Your instructor, plus any TAs and/or proctors assigned to your class will work as a team to help you learn. But you need to interact with them in a reasonable way. Specifically:
  • Remember that the instructional staff are a team. They will not all do everything. The instructor will tell you who will be responsible for what. Respect that. If you ask the wrong person your question, you probably won't get a reasonable answer and you will waste their time as well as yours. For many kinds of questions it really is better to ask the TAs or the proctors. This is particularly true of nitty gritty questions that arise in the labs, since the TAs and proctors are likely to spend more time there than the instructor does. It's their job.
  • Email:
    • The University's electronic mail policy recognizes email as an effective way for your instructor and TAs to inform you about important things that may be happening in class. You are responsible for:
      • Making sure that your instructor has a valid email address for you. If you do not want to use the one that the university has on record, then make sure to give your instructor another one.
      • Reading your email every day.
      • Guaranteeing that your mailbox does not overflow.
Excuses such as, "My email box was full", "I don't use that email address any more", "I was too busy to check my email", "I was on an interview trip and couldn't check my email", or "My computer crashed and all of my email was destroyed" aren't acceptable.
    • Email is also a very valuable way for you to communicate with your instructor and TAs. But be sure you use it appropriately. Specifically:
      • Using email, it's easy to ask a question or make a comment that you'd never make in person. Be careful about this. If you think that what you're about to say wouldn't be something you'd feel comfortable going to office hours to say, you probably shouldn't say it in email either.
      • In particular, do not send email to your instructor (or anyone else for that matter) when you're angry. You'll regret it when you calm down and you'll have antagonized someone who is important to you.
      • Remember that the instructor has a permanent record of every email message.
      • Feel free to use email to ask questions about projects and homework assignments. But keep in mind that, although email is available, neither the instructors or the TAs are responsible for replying to email the instant it is sent. Don't wait until the last minute before something is due to ask your questions. Also, keep in mind that, if you ask a question that has a nontrivial answer, it may not make sense for the instructor or TA to write a small book for you. Sometimes it will be reasonable for them to ask you either to bring the question to class or to come to office hours to discuss it.
      • Although it's easy for you to dash off an email question, it takes time for the instructor or the TA to answer it. Don't ask questions to which you can find the answer somewhere else. For example, don't write to your instructor to ask where the regularly scheduled final exam is. (It's on the Registrar's web site.) Don't write and ask how much the first midterm counts. (It should be on the class syllabus.) Don't ask what happened in a class that you missed (unless you had an emergency).
  • Office hours are there for you to use. You can expect that the person who is teaching your class loves the material and wants to share it with anyone who will listen. If you have questions about what's been covered in class or you're interested in finding out more about something, go to office hours and ask. You'll probably find that it's hard to get the faculty to shut up. The one thing that most faculty hate is students who only come to office hours to ask questions about grades. If there's been a mistake in grading your work, of course, go and ask (see below). But think twice before you go to office hours to ask questions that give the impression that you care less about learning than you do about grades. A few other points to keep in mind about office hours:
    • If you can't make it to regularly scheduled office hours, ask for an appointment. But don't leave this to the day before the exam. It may not be possible to find a suitable time on such short notice.
    • Again, remember the team concept. The faculty and TAs for your class will try to schedule their office hours to cover as wide a range of times as possible. If you can't make it to one person's office hours, try someone else.
    • Unless an office door is already open, knock first and don't go in until you're invited to do so.

VI. Grades

  • Grades are a necessary evil. You don't like worrying about grades and the faculty hate having to assign them. We'd all rather focus on the content of our classes. But your degree is a commitment from the University that you have achieved a certain level of expertise in the classes you've taken, so we need some way to measure that. To make this process work, you need to understand:
  • The grade you are given, either on an individual exam or assignment or as your final grade, is not the starting point of a negotiation. It is your grade unless a concrete error has been made. Do not go to see your instructor or your TA to ask for a better grade because you want one or you "feel you deserve it". Go only if you can document a specific error in grading or in recording your scores.
  • Your grade is a reflection of only one thing: how well did you do in the class. Nonacademic circumstances have no bearing on your grade. Don't go to see your instructor and explain how important a better grade is in your life. It would be unfair to other students and it would undermine the meaning of the degree if the instructor responded to such issues.
  • If you believe that an error has been made in grading your work, you have one week from the time that the work was returned to the class to file a complaint in writing to your instructor. Note that this is one week from the time that the instructor made the work available to the class. If you missed class and didn't get your work until later, there is no extension of the one week deadline. If you decide to submit a complaint about the grading of your work, make sure to describe the issue clearly and return the original work and your note to your instructor.
  • Errors can certainly be made in grading. But keep in mind that the errors can be made either in your favor or not. So it's possible that if you ask to have a piece of work regraded your grade will go down rather than up.
  • Remember that the most important characteristic of any grading scheme is that it be scrupulously fair to everyone in the class. Keep this in mind if you're thinking of asking, for example, for more partial credit points on a problem. The important thing is not the exact number of points that were taken off for each kind of mistake. The important thing is that that number was the same for everyone. So it can't be changed once the grading is done and the papers have been returned.
  • You instructor will decide what it takes to get an A or a B or a C or D in the class. Deciding the boundary cases is always hard. Your instructor is under no obligation to make score cutoffs public or to tell you how far away your were from the next higher grade.

September 6, 2010

missing is a kind of sickness

当你在穿山越岭的另一边
我在孤独的路上没有尽头
 
一辈子有多少的来不及发现
已经失去最重要的东西
恍然大悟 早已远去
为何总是在犯错之后
才肯相信 错的是自己
他们说这就是人生
试著体会 试著忍住眼泪
还是躲不开应该有的情绪
我不会奢求世界停止转动
我知道逃避一点都没有用
只是这段时间里 尤其在夜里
还是会想起 难忘的事情
我想我的思念是一种病
久久不能痊愈
 
当你在穿山越岭的另一边
我在孤独的路上没有尽头
时常感觉你在耳后的呼吸
却未曾感觉你在心口的鼻息
 
汲汲营营
忘记身边的人需要爱和关心
藉口总是拉远了距离
不知不觉 无声无息
我们总是在抱怨事与愿违
却不愿意回头看看自己
想想自己 到底做了甚麼蠢事情
也许是上帝给我一个试炼
只是这伤口需要花点时间
只是会想念 过去的一切
那些人事物 会离我远去
而我们终究也会远离
变成回忆
 
当你在穿山越岭的另一边
我在孤独的路上没有尽头
时常感觉你在耳后的呼吸
却未曾感觉你在心口的鼻息
Oh 思念是一种病
Oh 思念是一种病 一种病
 
多久没有说我爱你
多久没有拥抱你所爱的人
当这个世界不在那麼美好
只有爱可以让他更好
我相信一切都来得及
别管那些纷纷扰扰
别让不开心的事 停下了脚步
就怕你不说 就怕你不做
别让遗憾继续 一切都来得及
 
当你在穿山越岭的另一边
我在孤独的路上没有尽头
时常感觉你在耳后的呼吸
却未曾感觉你在心口的鼻息
当你在穿山越岭的另一边
我在孤独的路上没有尽头
时常感觉你在耳后的呼吸
却未曾感觉你在心口的鼻息
Oh 思念是一种病
Oh 思念是一种病 一种病

by 张震岳 - 思念是一种病

September 1, 2010

rate adaptation for RT2870

The rate selection of the driver is working as follow: firstly, identify the initial link speed with the FUNCTION "MlmeUpdateTxRates" in mlme.c, then set the transmition rate with FUNCTION "SetCommonHT" in cmm_info.c. Specifically the FUNCTION "RTMPSetDesiredRates" in \common\cmm_info.c is to set 802.11a/b/g data rate; and FUNCTION "RTMPSetHT", "RTMPSetIndividualHT", and "RTMPUpdateHTIE" in the same file are to set the 802.11n data rate, where set its value according to desired rate according to input parameter and bandwidth.

The FUNCTION "MlmeUpdateHtTxRates" in \include\mlme.c is to update the data rate used in 802.11n scenario. The update decision is made based on the desired PHY layer infromation saved in a struct, the updated channel parameters provided by FUNCTION "RTMPCheckHt" in the same file, and more importantly, the calculation provided by FUNCITON "MlmeSelectTxRateTable". The three function mentioned about communication with each other mainly via the array MCSSet[16], whose definition is in file \include\mlme.h.

Furthermore, your advice about the rate selection range help me find the definition of high throughput in file \include\rtmp_def.h, where has two groups of transition rate: 0 to 7 (6Mbps to 54Mbps) for OFDM, and 0 to 33 (MCS_0 to MCS_32, and MCS_33 is auto-rate). As long as the dongle we chose have two transmission antennas, we can use MCS_0 to MCS_15, corresponding  up to 300Mbps. This can be set in file \common\cmm_profile.c, triggered by key words "FixedTxMode" or "HT_TxStream". However, because the algorithm will check the status of channel every time it updates the date rate, the original algorithm cannot set the rate to a specific number all the time.

August 31, 2010

configuration of the testbed

# all the machines should be upgraded to ubuntu 10.04 #

PRE INSTALLATION
----------------
- note down the ip address of the eth0 interface

INSTALLING UBUNTU
-----------------
- use the 10.04 ISO image from the CD
- make sure the Fedora 4 partition is formatted and wiped out
- use the username: lili, password: interference-
    - for instance, if m/c name: ut-mesh-d-14.csres.utexas.edu; then password: interference-d14
                    if m/c name: ut-mesh-14.csres.utexas.edu; then password: interference-14


POST INSTALLATION
-----------------
A. Configuring the network interfaces
- /etc/resolv.conf: create this file if it doesn't exist and use the following entries
search public.utexas.edu
nameserver 128.83.139.9

- /etc/network/interfaces: add the entry

auto eth0
iface eth0 inet static
address
gateway 128.83.141.1
netmask 255.255.255.0
network 128.83.141.0
broadcast 128.83.141.255

- sudo service network-manager stop (kills the network manager service, we don't need it)

- sudo /etc/init.d/networking restart
  - try connecting to the internet, should work!

INSTALLING VIM, SSH and WIRESHARK
---------------------------------
- open the Administration->Synaptic Packet Manager. Click Reload. (updates the package manager). Close the package manager.
- sudo apt-get install ssh
- sudo apt-get install vim
- sudo apt-get install wireshark

ADD RSA key of the host machine to this remote machine
------------------------------------------------------
- generate rsa key on the host machine using
    ssh-keygen -t rsa1
- cat ~/.ssh/ >> ~/.ssh/authorized_keys@remote_machine
- chmod 600 ~/.ssh/authorized_keys@remote_machine

Update the SUDOERS file
-----------------------
- sudo visudo
-
User_Alias FULLTIMERS=lili
lili    ALL=NOPASSWD:ALL
FULLTIMERS ALL = NOPASSWD: ALL
 

Remove ath5k and install madwifi
-------------------------------
http://art.ubuntuforums.org/showthread.php?t=1163380

IMPORTANT
--------
Driver Bug: Do not try to perform channel switch in the master mode; causes a hard freeze (Ref: http://madwifi-project.org/ticket/1903)

Days of our lives

Daisypath Anniversary tickers