如果您喜歡這裡的內容,記得分享到您的Facebook和Twitter上面所有的朋友們吧!

顯示具有 快速參考 標籤的文章。 顯示所有文章
顯示具有 快速參考 標籤的文章。 顯示所有文章

2026年8月10日 星期一

撰寫網路文件與展示專用的單播(Unicast)IP 位址

在製作網路教學教材、撰寫技術文件或進行概念驗證(Proof of Concept, PoC)展示時,無論是公開課程還是企業內部訓練,我們都需要示範用的 IP 位址。

你是否想過:是否存在某些保留網段,其範圍完全不會與任何線上生產環境(Production)的位址重疊?

答案是肯定的,IETF 在幾篇相關的 RFC 文件中早已為我們定義好了。本文先針對最常被使用的單播(Unicast)位址進行整理。


2014年8月9日 星期六

乙太網 Auto-Negotiation 和手動設定等連接組合的結果,從Cisco官網資訊整理

自動協商(Auto Negotiation) 是乙太網的一個很棒的功能,任何網路口接上線以後,我們不需要擔心任何速度(Speed)、雙工(Duplex)的設定內容,硬體自動就幫我們找到最好的設定。

EW線地鐵橋下的Upper Changi Road景觀。新加坡。

2009年5月22日 星期五

IEEE OUI 和 IAB的註冊費用

Breathless (DSC_0543)
Breathless (DSC_0543),
originally uploaded by Li-Ji.
IAB (Individual Address Block) 簡單的講起來, 相當於是個人或是小團體可以負擔得起的, 除了OUI以外的申請全球唯一的 MAC Address 的方式.

當然價格便宜的話, 可用的位址一定比較少. 沒錯, IAB 你只有 12 位元可以自由使用, 所以一共是 4096 個 MAC Address 可用.

OUI 則有 24 個位元可以自由使用, 所以一共是大約一千六百多萬個位址可用.

如下圖所示, IAB 註冊費是 US$ 550, OUI 是 US$ 1,650. 雖然還是所費不貲, 不過好消息是沒有年費! 所以可以終身使用!

http://standards.ieee.org/faqs/OUI.html#q2

What costs are involved with obtaining an OUI, IAB or EtherType Field?

The OUI is $1,650.00 (US); the IAB is $550.00 (US) and the EtherType Field is $2,500.00 (US). The only other fees that would be involved is a $15.00 bank fee that is only applicable with the wire transfer payment method and a fee for private status on the public listing. There are no annual fees.

從這個圖我們還看到了連訊框中的 16位元的 EtherType 都可以付費買下, 只不過稍微貴了一點: US$ 2,500.

2009年5月21日 星期四

Wireshark 怎麼知道訊框是由哪一廠牌的網卡送出?

關鍵就在於, MAC Address 並不是可以隨便用的, 而是要統一跟 IEEE 申請繳費的. 各位應該都還記得, 48位元的 MAC Address 當中, 從高位元數下來的前 24 位元是所謂的組織唯一識別碼 (Organizationally Unique Identifier, OUI). 這個數值是就是由 IEEE 配發的. 至於剩下的其他 24 位元, 才是由廠商自己分配.

所以, Wireshark 這種 "封包擷取軟體" 裡面其實就是參考了這樣的對照表, 所以一收到訊框, 查完前 24 位元, 馬上就知道是哪家廠牌製造的.

那麼這個對照表要去哪裡下載或是查詢? 其實就在 IEEE 的網站當中.



[Wireshark (就是以前的 Ethereal) 參考資訊]

2009年4月30日 星期四

怎麼會忽然 "動態取得" 一個怪怪的 IP 位址? (DHCP Snooping)

其實就是有人在你的網段中, 不小心打開了 DHCP Server 功能. 最常見的原因, 就是因為網路孔位不足, 有人自己去電子商場買了 "寬頻分享器" (Cheap, SOHO, Broadband Router). 通常他們的 DHCP 服務預設都是打開的, 而且都是 192.168.1.0/24 這個網段. 所以這些怪怪的 IP 位址, 通常都是長得這個模樣: 192.168.1.X.

而且整個網段, 通常會"部分取得正確, 部分取得錯誤". 我相信很多網管工作者都有遇到過這種窘境.

如何防範, 其實在各位的 Cisco 2950 以上的 Switch 就支援的 DHCP Snooping 功能, 正是為了解決這個問題而來的! 打開以後, 不管再有誰做這種事, 也不會發生錯誤取得IP位址的問題!

DHCP Snooping 的原理簡單的來說, Switch 會監看 DHCP 的活動, 就是只允許指定的部分 Switch Port 放行 DHCP伺服器的回應封包, 其他的一律不准. 所以只會取得指定 Server 回應的 DHCP 內容.

注意: 有一點很重要, 如果 DHCP Server 不是接在本 Switch 時, Uplink port 請務必要允許 DHCP Server 回應, 不然整台 Switch 上的 PC 都會收不到動態的 IP位址資訊!

另外, 因為設定過程會影響 DHCP 運作, 建議最好是在下班時間再啟動這個功能!

以下是典型的設定:
! Global, 啟動 DHCP Snooping, 這行一定要
 ip dhcp snooping

! 假設只對 VLAN 100 和 VLAN 200 作 DHCP 設限, 這行也一定要
 ip dhcp snooping vlan 100 200

! DHCP Server 埠, 或是 Uplink, 這點很重要, 不然會全部都收不到!
 interface GigabitEthernet0/1
  ip dhcp trust

! 一般使用者埠, 這是預設值, 可以不用下
 interface FastEthernet 0/1
  no ip dhcp trust

[Reference]
DHCP Snooping Configuration Guidelines section of Configuring DHCP Features, on Cisco.com


2008年12月30日 星期二

哪幾個 subnet 可以用

如果是 "分等級" (Classful) 的世界, IP位址就有這個現制: subnet 的網段位址位元全為"0" 的這個 subnet 不能用. 這是因為分等級的世界的路由資訊,  並不包含 "subnet mask", 路由器會分不清楚, 到底該資訊是主網段, 還是子網段.

但是反過來說, 如果是 "不分等級" (Classless) 的世界, 那這個網段就可以用了! 因為 '不分等級"的世界, 路由器交換的資訊, 都多包含 subnet mask.

例如, 分等級的世界 Class A 10.0.0.0/8 網段中, 假設 subnet mask 長度是 16, 那麼以下網段可用.

10.1.0.0/16,  10.2.0.0/16, 10.3.0.0/16, ... 10.255.0.0/16, 共 254個.

然而  10.0.0.0/16 不能用. 因為, 路由器只能看到 10.0.0.0 這個數字 (請用32個位元的二進位數字來想), 但是看不到像是 255.0.0.0 或是 255.255.0.0 這些 subnet mask, 所以會分不清楚到底是 10.0.0.0/8, 還是 10.0.0.0/16.

同樣的例子, 在 "不分等級" 的世界就沒問題, 因為所有的路由資訊都會多有 255.0.0.0 或是 255.255.0.0 的 subnet mask. 所以 10.0.0.0/8 和  10.0.0.0/16 是分得出來的不同路由資訊.

2008年12月12日 星期五

Cisco學習相關網站, 我的訂閱追蹤清單

最近從 Johnson Liu (Thanks!) 的網站, 得到很多有關Cisco學習的相關網站連結. 我將它們加到我的訂閱清單中, 然後再全部彙整成這份訂閱追蹤清單的 OPML(?) 檔案.

希望對大家的學習有幫助!



另外跟各位分享一個使用心得: 有了 Google Reader 以後, 我發現我按 "訂閱, Subscribe RSS/ATOM" 的按鈕的次數, 遠比用 "Bookmark, 加到我的最愛/書籤" 的機會還要多!


Subscribe when you can, bookmark otherwise.


2008年12月4日 星期四

DTE 和 DCE 方向的速記法

DTE (Data terminal equipment) 和 DCE (Data circuit-terminating equipment)的方向很容易弄錯, 我在此提供一個簡單的速記法.

其實就是從中間字母的形狀來看:
  • T - 公
  • C - 母
我們在使用電力或是牆上的網孔時, 都是使用"公"的接頭, 插入"母"的插孔. 所以:
  • "公的" DTE 就是 "使用者" 端
  • "母的" DCE 就是 "服務業者" 端

[References]
Wiki: DTE
Wiki: DCE

---

2008年12月2日 星期二

Repeater 就是兩埠的 Hub

剛才在回答同學的問題時, 想到的一種簡單好記的講法. Repeater 和 Hub 都是乙太網路(Ethernet)的訊號放大器, 差別只有埠數的不同.

(當然, Repeater也有多埠的產品, 不過各位應該可以接受我所要強調的重點)

2008年11月27日 星期四

ARP 到底算是 OSI 的哪一層

ARP (Address Resolution Protocol) 是IP網路中用來解析指定IP位址所對應的 Layer 2 MAC位址的協定. 那 ARP 到底算是 OSI 的哪一層.

我認為 ARP 應該算是跨 Layer2/3 的一個協定.
  • ARP詢問用的參照資料, 是第三層的 IP 位址; 所以有第三層的行為.
  • ARP的PDU完全是LAN的訊框, 運作在Layer 2 的 broadcast範圍, 也不能跨 Router, 所以有第二層的行為.
嚴格講起來 OSI 是參考模型, 用來突顯各層次的特徵, 但是不代表 單一協定 不能同時屬於兩個層次.


2008年11月25日 星期二

交換器 PPS 標示說明

其實 PPS (packet per second) 是硬體晶片的規格, 不是線路的速度.

如果標示為144880 pps, 代表硬體每秒可以處理的封包數就是144880個那麼多.
  • 所以, 如果全部封包都剛好是 64 bytes, 那有效的頻寬值就是 64 x 144880 x 8 = 74,178,560 bps  ~= 74 Mbps
  • 但如果全部封包都剛好是 1500 bytes, 那就變成 1500 x 144880 x 8 = 1,738,560,000 bps ~= 1.7Gbps.
所以真正用得到的有效頻寬值, 會介於兩者之間.

一般廠商, 都會用後面這個比較漂亮的數字來標示. Cisco 也會, 不過也標示 pps值.

另外, PPS的規格是整台一起算, 所以,當各埠同時全速傳送時, 每埠的單向有效傳輸速度, 要用=整台的PPS去除以埠數, 然後再除以二(雙向同時傳送).

2008年11月12日 星期三

IEEE 802.11n 預計 2009年11月定案

課堂中講錯了! 更正!


Quotes from Status of Project IEEE 802.11n


July 2008, Denver, Colorado, US

TGn Draft 5.0 passed recirculation ballot #129 by an 90% majority (75% required) with 261 votes to approve, 29 not approve, 23 abstain.

All 1112 comments from this recirculation ballot were resolved during this meeting, and the working group approved a recirculation ballot on a TGn Draft 6.0, incorporating these comment resolutions.

The timeline was modified, and now anticipates publication in November 2009 instead of July 2009. The group is targeting September 3-5 for an ad hoc meeting to resolve comments from the recirculation ballot on Draft 6.0.

References:

2008年11月11日 星期二

Cisco SDM 個人練習環境

最近朋友介紹這篇有關 Cisco SDM 安裝的文章, 我將內容精簡和整理一下, 跟各位朋友分享! 有了這環境, 各位就可以用自己的電腦練習, 這樣到客戶那裡時, 才不會臨時出糗.


所需軟體:
  1. 最新版Java Runtime. 更正一下: 本例子中, Java Runtime 必須要使用 "JRE 1.5.0_07" 才能順利執行!
  2. Cisco SDM-V232. (Cisco 軟體下載, 都需要申請免費的CCO帳號後,登入才能下載)
  3. Cisco SDM Demo Tool
安裝步驟:
  1. 安裝Java Runtime.
  2. 解壓縮 SDM-V232.zip, 執行裡面的 setup.exe
  3. 解壓縮 SDM_demo_tool.zip, 將裡面的 dataFile.zip 複製到 C槽根目錄 "C:\".
執行步驟:
  1. 雙擊執行桌面新出現的 "Cisco SDM" 連結.
  2. "Device IP Address or Hostname" 欄位中填入 "127.0.0.1", 點選 "Launch", 隨後即出現SDM畫面!


Reference: 【CCNA】安裝 Cisco 安全裝置管理員 SDM - Security Device, by 喜歡在黃昏啃甘蔗

2008年11月5日 星期三

PPP CHAP 身份認證設定, 方向很容易弄錯


PPP CHAP 設定, 快速參考!


hostname Left
username Right password samepassword

int serial 1/0
encapsulation ppp
ppp authentication chap
ip address 1.1.1.1 255.255.255.0
no shutdown


hostname Right
username Left password samepassword

int serial 1/0
encapsulation ppp
ppp authentication chap
ip address 1.1.1.2 255.255.255.0
no shutdown

2008年11月4日 星期二

OSI Layer 7, 6, 5, 4, 舉例說明

Golden Flower (DSC_0090)
Golden Flower (DSC_0090),
originally uploaded by Li-Ji.
我舉一個例子, 來說明 OSI 第 7, 6, 5, 4 層次的不同.

"使用Google查詢關鍵字: 美食" (Application), 瀏覽器需要得到很多個Google提供的JPEG和HTML格式的內容來顯示 (Presentation). 在操作瀏覽器的完整過程當中 (Session), 瀏覽器建立了好幾個HTTP連線(Transport), 下載了很多個JPEG和HTML檔案完成整個查詢.


Reference: Wiki: OSI model




2008年7月25日 星期五

RIP冷靜計時器(Hold-down Timer) 說明

IOS中RIP的路由資訊交換軟體, 針對每一個目的地網段的路由資訊, 一共有四組計時器:
  1. 更新週期計時器 (Update Timer)
  2. 宣告失效計時器 (Invalid Timer)
  3. 冷靜計時器 (Hold-down Timer)
  4. 清除計時器 (Flush Timer)
所以針對每一個目的地網段的路由資訊, 大致上會有以下的生命狀態循環:
  1. 正常情況下, 收到更新通知時, 該目的地網段的最短距離和方向, 都被重新更新一次.
  2. 無論何時一收到更新, "宣告失效計時器", 和 "清除計時器" 都歸零, 重新計時.
  3. 當超過宣告失效計時器的設定時間, 都沒有收到任何更新時, 會被宣告為失效. 但是, 該路由資訊仍可以殘存一段時間.
  4. 當超過 "清除計時器" 的設定時間, 還是沒有收到更新, 該路由資訊就會被清除.
  5. 任何時間一收到立即失效的更新通知(Poisoning)時, 就啟動冷靜計時器. 在冷靜期間, "宣告失效計時器", 和 "清除計時器", 都繼續計時; 一收到非Poisoning的更好的路由資訊, 在收到的同時結束冷靜期. 如果 "清除計時器" 先到期, 那就會被清除; 反之如果 "冷靜計時器" 先到期,  就回到(1)接受更新通知的正常狀態.
[Cisco.com參考資訊]
update

Rate in seconds at which updates are sent. This is the fundamental timing parameter of the routing protocol. The default is 30 seconds.

invalid

Interval of time (in seconds) after which a route is declared invalid. The interval should be at least three times the value of update time. The interval is measured from the last update received for the route. The route becomes invalid when there is an absence of updates during the invalid time that refresh the route. The route is marked inaccessible and advertised as unreachable. However, the route still forwards packets until the flush interval expires. The default is 180 seconds.

holddown

Interval (in seconds) during which routing information regarding better paths is suppressed. The interval should be at least three times the value of update time. A route enters into a holddown state when an update packet is received that indicates the route is unreachable. The route is marked inaccessible and advertised as unreachable. However, the route continues to forward packets until an update is received with a better metric or until the holddown time expires. When the holddown expires, routes advertised by other sources are accepted and the route is no longer inaccessible. The default is 180 seconds.

flush

Amount of time (in seconds) that must pass before the route is removed from the routing table. The interval is measured from the last update received for the route. The interval should be longer than the larger of the invalid and holddown values. If the interval is less than the sum of the update and holddown values, the proper holddown interval cannot elapse, which results in a new route being accepted before the holddown interval expires. The default is 240 seconds.
http://www.cisco.com/en/US/docs/ios/12_0/np1/command/reference/1rrip.html#wp1018019

2008年6月17日 星期二

OSPF LSA Types (2), LSA Type 1: Router LSA

(接前文)

Type 1 LSA定義一個OSPF路由器本身,和直接接在他身上的所有"網路物件"的連結.

"網路物件"指的是: (1) OSPF 路由器,和 (2) OSPF 設定中定義的網段.

附圖中可以看得出來,R1接了三個物件: (1) R2, (2)10.12.12.0/24網段, 和 (3) 10.1.1.0/24網段.

不過, 100.100.100.0/24網段,就不在其中之一, 這是因為100.100.100.0/24並沒有在OSPF設定中被宣告, 所以不算!

我們可以用這個命令 show ip ospf database router 0.0.0.1 ,來印出定義R1的Type 1 Router LSA. 其中"0.0.0.1"是 R1的Router ID, 也就是R1的在OSPF協定中,被稱呼的名字.


R1>show ip ospf database router 0.0.0.1

OSPF Router with ID (0.0.0.1) (Process ID 1)

Router Link States (Area 0)

LS age: 1724
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 0.0.0.1
Advertising Router: 0.0.0.1
LS Seq Number: 80000003
Checksum: 0x54DC
Length: 60
AS Boundary Router
Number of Links: 3

Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 0.0.0.2
(Link Data) Router Interface address: 10.12.12.1
Number of TOS metrics: 0
TOS 0 Metrics: 64

Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.12.12.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64

Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.1.1.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 10


R1>

相同的方式,我們也可以列出定義R2的Type 1 Router LSA.我們使用相同的命令 "show ip ospf database router 0.0.0.2"

R1>show ip ospf database router 0.0.0.2

OSPF Router with ID (0.0.0.1) (Process ID 1)

Router Link States (Area 0)

Routing Bit Set on this LSA
LS age: 1508
Options: (No TOS-capability, DC)
LS Type: Router Links
Link State ID: 0.0.0.2
Advertising Router: 0.0.0.2
LS Seq Number: 80000004
Checksum: 0x84A8
Length: 60
Area Border Router
Number of Links: 3

Link connected to: another Router (point-to-point)
(Link ID) Neighboring Router ID: 0.0.0.1
(Link Data) Router Interface address: 10.12.12.2
Number of TOS metrics: 0
TOS 0 Metrics: 64

Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.12.12.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 64

Link connected to: a Stub Network
(Link ID) Network/subnet number: 10.2.2.0
(Link Data) Network Mask: 255.255.255.0
Number of TOS metrics: 0
TOS 0 Metrics: 10


R1>
大家應該有注意到,R2事實上接上了不只三個網路物件.怎麼會只有印出三個? 這是因為OSPF協定的每一個區域(Area)當中,都有自己的連線狀態資料集合(Link State Database). 列出來的這三個,正是含在R1和R2共同連接的零號區域(Area 0)中.


(待續)

2008年6月1日 星期日

OSPF LSA Types (1)

為了幫助了解OSPF的LSA型態到底有哪幾種,我設計了以下這個例子,方便大家隨時可以參考!

這個例子是使用4部Router啟動OSPF協定,其中R1屬於Area 0, R3和R4屬於Area 1. R2則是介於這兩個Area中間的ABR,一半的WAN和LAN網路卡分別屬於這兩個Area.

(待續)

架構圖
R1設定
R2設定
R3設定
R4設定

2008年3月27日 星期四

快速參考: show ip route

在檢查router的路由表的正確性時, 最常下的命令就是"show ip route", 如下所示:

wg_ro_h#show ip route
Codes: C - connected, S - static, R - RIP, M - mobile, B - BGP
D - EIGRP, EX - EIGRP external, O - OSPF, IA - OSPF inter area
N1 - OSPF NSSA external type 1, N2 - OSPF NSSA external type 2
E1 - OSPF external type 1, E2 - OSPF external type 2
i - IS-IS, su - IS-IS summary, L1 - IS-IS level-1, L2 - IS-IS level-2
ia - IS-IS inter area, * - candidate default, U - per-user static route
o - ODR, P - periodic downloaded static route

Gateway of last resort is not set

wg_ro_h#


其中各英文字母的代碼整理如下:
  • C - connected
  • S - static
  • R - RIP
  • M - mobile
  • B - BGP
  • D - EIGRP
  • EX - EIGRP external
  • O - OSPF
  • IA - OSPF inter area
  • N1 - OSPF NSSA external type 1
  • N2 - OSPF NSSA external type 2
  • E1 - OSPF external type 1
  • E2 - OSPF external type 2
  • i - IS-IS
  • su - IS-IS summary
  • L1 - IS-IS level-1
  • L2 - IS-IS level-2
  • ia - IS-IS inter area
  • * - candidate default
  • U - per-user static route
  • o - ODR
  • P - periodic downloaded static route

經典熱門文章