2010年7月15日 星期四

IEEE 802.1p

From Wikipedia, the free encyclopedia

IEEE 802.1p, also known as Class of Service (CoS), is a 3 bit field within an Ethernet frame header when using tagged frames on an 802.1 network. It specifies a priority value of between 0 and 7 inclusive that can be used by Quality of Service (QoS) disciplines to differentiate traffic.
IEEE P802.1p is also the name of a task group active during 1995–98 responsible for adding traffic class expediting and dynamic multicast filtering to the IEEE 802.1D standard. Essentially, they provided a mechanism for implementing QoS at the Media Access Control (MAC) level. The group's work with the new priority classes and Generic Attribute Registration Protocol (GARP) was not published separately but was incorporated into a major revision of the standard, IEEE 802.1D-1998. It also required a short amendment extending the frame size of the ethernet standard by four bytes which was published as IEEE 802.3ac-1998.

Short Summary

802.1p defines eight different classes of service which are available, usually expressed through the 3-bit user_priority field in an IEEE 802.1Q header added to the frame. The way traffic is treated when assigned to any particular class is undefined and left to the implementation.
The IEEE however has made some broad recommendations:
User priority Traffic Type
0 Background
1 Best Effort
2 Excellent Effort
3 Critical Applications
4 Video, < 100 ms latency
5 Voice, < 10 ms latency
6 Internetwork Control
7 Network Control
Note that the above recommendations were revised in IEEE 802.1Q-2005 and differ from the original recommendations found in IEEE 802.1D-2004.

2010年7月14日 星期三

packETH - ethernet packet generator



IEEE 802.1Q-in-Q VLAN Tag (QinQ)

The IEEE 802.1Q-in-Q VLAN Tag is purpose to expand the VLAN space by tagging the tagged packets, thus producing a "double-tagged" frame. The expanded VLAN space allows the service provider to provide certain services, such as Internet access on specific VLANs for specific customers, and yet still allows the service provider to provide other types of services for their other customers on other VLANs.

2010年7月5日 星期一

googlecl (Command line tools for the Google Data APIs)

GoogleCL brings Google services to the command line.
We currently support the following Google services:

  • Blogger
  • $ google blogger post --title "foo" "command line posting"
  • Calendar
  • $ google calendar add "Lunch with Jim at noon tomorrow"
  • Contacts
  • $ google contacts list name,email > contacts.csv
  • Docs
  • $ google docs edit --title "Shopping list"
  • Picasa
  • $ google picasa create --title "Cat Photos" ~/photos/cats/*.jpg
  • Youtube
  • $ google youtube post --category Education killer_robots.avi
Check out our ExampleScripts for many more examples of what you can do, or the SystemRequirements for simple install instructions.



LINK:http://www.pcadv.com.tw/posts/2904-googlecl

2010年7月1日 星期四

Subversion, Grep, Diff

習慣用 grep 來找 source code 當中的字串;也很習慣用 diff 來比較兩個 source tree 的差異。如:
grep -r STRING *
diff -ur DIR1 DIR2
這兩個指令很好用。但是遇到 Subversion 的 working copy 時,就會受到 .svn 目錄的干擾。所幸這兩個指令都提供排除非必要目錄的方法:
grep --exclude-dir=.svn -r STRING *
diff -x .svn -ur DIR1 DIR2

老實說,常會忘記這些參數,也常弄混。 因此建議在 .bashrc 當中加上以下設定,這樣以後不管是不是 working copy 都可以安心使用 grep -r 和 diff -r 了:
alias grep='grep --exclude-dir=.svn'
alias diff='diff -x .svn'

from Rupert's blog :http://softsmith.blogspot.com/2009/03/subversion-grep-diff.html

C/C++ Predefined Macros

寫程式經常會用到編譯器預先定義的巨集 (Predefined Macros),例如:__FILE__、__LINE__、__DATE__、__TIME__、__func__ 等。這些巨集有些是標準 C/C++ 語言所定義的,有些則是編譯器自行定義的。使用 GNU C/C++ 的人,可參考以下資料:
Predefined Macros (GNU C/C++)
這份資料所提到的 System-specific Predefined Macros 是指針對不同的系統平台 (arm、mips 等),編譯器所預先定義的特殊巨集。若想直接看看這些預先定義的巨集,可執行以下指令:
echo | gcc -dM -E - | sort

http://softsmith.blogspot.com/2009/07/cc-predefined-macros.html

colordiff



diff 使用很方便, 但是就是要花點眼睛去看差別.
ColorDiff 是隻 perl 的 script, 主要是把差異分不同顏色標示出來, 雖然只是加個顏色, 但是感覺起來還是好看多

http://colordiff.sourceforge.net/

How to use simple speedtest in RaspberryPi CLI

  pi@ChunchaiRPI2:/tmp $  wget -O speedtest-cli https://raw.githubusercontent.com/sivel/speedtest-cli/master/speedtest.py --2023-06-26 10:4...