Thứ Sáu, 30 tháng 11, 2012

Sử dụng BibTex trong Latex để add references

Source: http://www.tex.ac.uk/cgi-bin/texfaq2html?label=usebibtex
1. BibTeX bibliography (đuôi file .bib), file .bib nên để cùng thư mục với file source code latex, cấu trúc file ví dụ như sau:

@article{Aggrarwal2007,
author = {V. Aggarwal and A. Feldmann and C. Scheideler},
title = {Can ISPs and P2P users cooperate for improved performance?},
journal = {ACM SIGCOMM Comput. Commun. Rev.},
volume = {37},
number = {3},
pages = {29-40},
month = {July},
year = {2007}
}


@inproceedings {Seedorf2009,
author={J. Seedorf and S.Kiesel and M.Stiemerling},
title = {Traffic localization for P2P-applications: the ALTO apprach},
booktitle = {IEEE Int. Conf. Peer-to-Peer Comput. (P2P2009)},
pages = {171-177},
month = {Sept.},
year = {2009}
}

article cho journal và inproceedings cho conferences

2. Trong file source latex cần có các lệnh cite và gọi đến bibtex

ví dụ:
~\cite{Aggarwal2007}

\bibliographystyle{plain}
\bibliography{HiephvBibAll}

--> Chú ý thay plain bằng file format của hội thảo hoặc tạp chí tương ứng

3. Dịch file source code latex
latex myfile

As LaTeX processes the file, the \bibliographystyle command writes a note of the style to the .aux file; each \cite command writes a note of the citation to the .aux file, and the \bibliography command writes a note of which .bib file is to be used, to the .aux file.
Note that, at this stage, LaTeX isn’t “resolving” any of the citations: at every \cite command, LaTeX will warn you of the undefined citation, and when the document finishes, there will be a further warning of undefined references.
4. Chạy lệnh bibtex
bibtex myfile

BibTeX will scan the .aux file; it will find which bibliography style it needs to use, and will “compile” that style; it will note the citations; it will find which bibliography files it needs, and will run through them matching citations to entries in the bibliography; and finally it will sort the entries that have been cited (if the bibliography style specifies that they should be sorted), and outputs the resulting details to a .bbl file.

5. Chạy Latex một lần nữa
you run LaTeX again. It warns, again, that each citation is (still) undefined, but when it gets to the \bibliography command, it finds a .bbl file, and reads it. As it encounters each \bibitem command in the file, it notes a definition of the citation.

6. Chạy Latex một lần nữa
you run LaTeX yet again. This time, it finds values for all the citations, in its .aux file. Other things being equal, you’re done… until you change the file.



Chủ Nhật, 25 tháng 11, 2012

Chú ý về các phần mềm P2P

1. PPStream cần có loa để chạy???

Khi application dectect ko có thiết bị audio nào --> sẽ không chạy cả video
2. PPTV không chỉ phụ thuộc vào peerlist --> có nhiều default server, và video traffic không phải lúc nào cũng là udp
3. SopCast: hide the peer list, thường SopCast cũng chỉ trao đổi dữ liệu với 4, hoặc 5 peers --> hơi ít
4. Zattoo chỉ hỗ trợ các host trong domain EU

Thứ Tư, 21 tháng 11, 2012

Chạy framework p2p_localization

1. Di chuyển đến thư mục chứa file chạy: p2p_localization_frw
cd /home/hiephv/workspace/p2p_localization_frw/Debug

2. Chạy lệnh

./p2p_localization_frw param1 param2 param3 param4

- param1: tên cạc mạng (ví dụ: eth1)

- param2: phương pháp áp dụng
0: adding delay
1: packet loss
2: limited bandwidth

- param3: tham số tương ứng với phương pháp
+ adding delay: thì là thời gian delay (ms): ví dụ: 1000ms
+ packet loss: thì là tỷ lệ packet loss (%): ví dụ: 0.2
+ limited bandwidth: thì là băng thông tối đa cho phép

-param4: mode áp dụng
0: bi-direction (cả download và upload)
1: download only
2: upload only


ví dụ lệnh hoàn chỉnh: ./p2p_localization_frw eth1 0 500 0

Thứ Sáu, 16 tháng 11, 2012

Peerlist modification framework

Để chạy framework Peerlist modification

1. Đăng nhập quyền root
(Vì phải gọi nhiều hàm can thiệp đến hệ thống nên cần có quyền root)

2. Sửa lại #define để chạy với những phần mềm khác nhau
#define PPTV
#define PPStream
#define PPLive

Chú ý: hiện tại đang cài đặt 2 phương pháp
1. Peer list packet modification
2. Video request packet redirection

Để chạy theo phương pháp 1 thêm dấu comment
Chuyển #define REDIRECTION 1 --> //#define REDIRECTION 1 trong main file và trong PPStream.c file

Để chạy theo phương pháp 2, bỏ dấu comment
Chuyển //#define REDIRECTION 1 --> #define REDIRECTION 1 trong main file và trong PPStream.c file

3. Chú ý là khi dừng chương trình peer list modification giữa chừng thì mạng của máy measurement sẽ mất (do các gói tin từ eth0 sang eth1 và ngược lại đang được đẩy vào QUEUE)

4. Một vấn đề nữa là có vẻ libipq được cài từ gói iptables-dev conflict với dummynet nên nếu đang chạy peer list modification thì không insert mod cho file ipfw_mod.ko được. Và ngược lại nếu insert mod cho file ipfw_mod.ko vào trước thì không chạy được chương trình peerlist modifications nữa


Tạm thời: để chạy peer list modification, trướt hết remove ipfw_mod
lệnh: rmmod ipfw_mod

Thứ Ba, 13 tháng 11, 2012

Cumulative distribution function of download time

Định nghĩa về CDF (cumulative distribution function) xem tại đây:
http://en.wikipedia.org/wiki/Cumulative_distribution_function

Nếu rời rạc hóa trục thời gian, và coi dung lượng down được tại các thời điểm là xác suất của biễn ngẫu nhiên X tại thời điểm đó thì CDF của download time sẽ phản ánh tốc độ download. CDF càng dốc đứng chứng tỏ tốc độ download càng nhanh và ngược lại