2013年4月26日 星期五

What is the difference between Flooding and Broadcasting?


In a network, flooding is the forwarding by a router of a packet from any node to every other node attached to the router except the node from which the packet arrived. Flooding is a way to distribute routing information updates quickly to every node in a large network. It is also sometimes used in multicast packets (from one source node to many specific nodes in a real or virtual network).

The Internet's Open Shortest Path First (OSPF) protocol, which updates router information in a network, uses flooding.

在網路環境中,Flooding(洪泛)是一種藉由路由器繞送一封包從任何結點到其他可以抵達節點的運作方式。在大型網路環境中,Flooding是一種快速分享路由資訊給予分散路由節點的技術。他們有些時候會使用群播的方式發出封包(在實體或虛擬網路中,從單一結點到一群指定結點)。

在網際網路的OSPF協定運作中,即是利用Flooding進行路由資料交換。

Flooding vs Broadcasting 
Routing is the process of choosing which paths to be used to send network traffic, and sending the packets along the selected sub-network. Flooding and Broadcast are two routing algorithms used in computer networks today. Flooding sends all incoming packets through every outgoing edge. Broadcasting means every device in the network will receive a packet.

What is Flooding?
Flooding is a very simple routing algorithm which sends all incoming packets through every outgoing edge. Because of how this routing algorithm works, a packet is guaranteed to be delivered (if it can be delivered).

What is Broadcasting?
Broadcasting is a method used in computer networking, which makes sure that every device in the network will receive a (broadcasted) packet. Because broadcasting can impact performance in a negative way, not every network technology supports broadcasting. X.25 and frame relay does not support broadcasting and there is no such thing as internet-wide broadcasting.

What is the difference between Flooding and Broadcasting?
Sending a packet to all hosts simultaneously is broadcasting. But flooding does not send packets to all hosts simultaneously. The packets would ultimately reach all nodes in the network due to flooding. Flooding may send the same packet along the same link multiple times, but broadcasting sends a packet along a link at most once. Several copies of the same packet may reach nodes in flooding, while broadcasting does not cause that problem. Unlike flooding, broadcasting is done by specifying a special broadcast address on packets.

簡單來說,Flooding的機制,會有機會在同一節點上收到兩個以上相同封包;但是Broadcasting不會發生,因為Broadcasting通常會使用一個指定的廣播位址,就是該次一次性的送出。

2013年4月23日 星期二

DNS查詢是利用UDP 53 port,何時使用TCP 53 port?



1. Zone transfers
此為DNS Server間的資料轉送,即指Master DNS(Primary DNS)與 Slave DNS(Secondary DNS)間,進行資料轉換時會使用TCP 53 Port。

2. Data requests larger than 484 bytes(Request Packet larger than 512 bytes)
The second legitimate use for TCP/53 traffic is when the requested data exceeds 484 bytes (512 bytes minus the DNS header). 
依上述說明,當Request超越512 bytes時,即使用TCP 53 Port來進行相關詢問,即去掉DNS表頭後內含超過484 bytes的查詢長度,這是一個非常長的電腦系統名稱,此時就會使用TCP 53 Port。依照一般的情況來說,DNS查詢不會有機會用到TCP 53 Port。

3. Some load balancing packages
部分的負載平衡機制,有可能為了達到外部對內部的DNS Server查詢附載平衡,而向ISP業者申請對內查詢時使用TCP 53 Port來進行。

2013年4月16日 星期二

How to reset Cisco ASA 5500


Step by step


ciscoasa(config)# configure factory-default
ciscoasa(config)# write memory

*ciscoasa(config)# no enable password
ciscoasa(config)#reload

2013年4月9日 星期二

System Prepare



為了維護Windows作業系統當中,Security ID的唯一性,在Vcenter中進行Clone後,通常需要進行System Prepare,來保障SID不會產生衝突,有其是在擁有網域的環境下,以下為執行步驟。

How to change SID on Windows 7 and Windows Server 2008 R2 using sysprep?
Run as 'sysprep' , Important: select Generalize if you want to change SID.

必須選取一般化執行修改SID動作,而非只進行初始化。

2013年3月26日 星期二

Plug-in與Add-on有何不同?



大多數人把Plug-in稱為插件,而Add-on在國內鮮少看到中譯後的名稱(或許叫作外掛),但事實上,它們在國外所釋出的英文技術文獻上,有明顯含義上的不同。

許多剛涉入資訊圈,或涉入不深的,都會認為沒有甚麼不同,但是實質上卻有很大的不同。兩者通常都是係指在既有的應用程式(Free Software/Open Source)上新增額外功能,而且普遍來看會是第三方所釋出的功能增強,而非原廠。如果是原廠所釋出的功能性增強,普遍會使用Extend、Expansion類似字眼,原有功能修正會稱為Fix、原有功能增強會稱為Patch,而Patch後通常會將軟件版本代碼更新,修正與增強兼而有之的會稱為Update或Pack。

回到正題,玩過Linux或是RHCE應該都能大致理解Plug-in與Add-on的不同,通常前者意味著這項第三方功能"有可能"會更動部分軟體程式碼,或者改變原有程式碼的數據,所以多數的Plug-in無法在應用程式運作的同時進行安裝,而且Plug-in的功能毀損或是程式碼安全性漏洞,會導致原有功能不穩會是停擺,因此Plug-in無法在程式提供服務的同時進行安裝,而且服務通常需要重啟,測試過後不穩可能還要移除,版本不符可能完全無法安裝或是運作。

Add-on意義就不一樣,通常Add-on表示額外附加功能,所以中文譯為外掛並無不妥,通常Add-on不會改動任何既有應用程式的程式碼,只會強化輸出結果或是重新整理、分析、搜尋等,所以User Interface方面的改動,通常都是Add-on;因此,有部分的軟件在新增Add-on的時候,並不需要暫停或中止服務運作就能安裝,服務重啟與否則是要看情況,而且Add-on不穩並不會對原有的應用程式造成任何影響,安全漏洞也不會影響原有功能,Add-on停擺也不會異常中止原有應用程式或功能。

在一些免費軟體中功能又很強大的監控軟體上,Plug-in跟Add-on界線更是清楚,因為他必須要讓網路管理者或是MIS主管單位理解,這項服務會不會中斷或停止,需不需要技術性測試與評估,導入的安全性為何...等等相關議題,所以會明確的區隔兩者的不同,例如:Linux平台上的Nagios軟體就是一例。

附帶一提,遊戲外掛通常是偽Add-on(掩人耳目)而實質的Plug-in(傳輸數據改動),所以不可能不被抓到,只是有沒有心想抓而已。

2013年3月19日 星期二

輕鬆搞懂首站備援(VRRP) – 首站(戰)即決戰;一站(戰)定乾坤



Virtual Router Redundancy Protocol (VRRP) is a non-proprietary (but allegedly patented and licensed [1]) redundancy protocol described in RFC 3768 designed to increase the availability of the default gateway servicing hosts on the same subnet. This increased reliability is achieved by advertising a "virtual router" (an abstract representation of master and backup routers acting as a group) as a default gateway to the host(s) instead of one physical router. Two or more physical routers are then configured to stand for the virtual router, with only one doing the actual routing at any given time. If the current physical router that is routing the data on behalf of the virtual router fails, an arrangement is made for another physical router to automatically replace it. The physical router that is currently forwarding data on behalf of the virtual router is called the master router. Physical routers standing by to take over from the master router in case something goes wrong are called backup routers.

VRRP can be used in Ethernet, MPLS and token ring networks. Implementations for IPv6 are in development, but not yet stable (i.e. keepalived 1.2.x). RFC 5798 handles VRRP (version 3) for both IPv4 and IPv6 networks. VRRP provides information on the state of a router, not the routes processed and exchanged by that router. Each VRRP instance is limited, in scope, to a single subnet. It does not advertise IP routes beyond that subnet or affect the routing table in any way.


繼首戰(站)即決戰(站),一戰(站)定乾坤之後,我們了解HSRP這個私有協定對於思科網路設備的重要性後,接下來即是公開的協定VRRP。


VRRP重點機制摘要

VRRP version2公開的協定(標準協定)follow RFC 2338,同一時間僅有一台Router運作。

Group – VRID(Virtual Router ID)視為同一群組。不同的VRID會視為不同的群組。

機制:選出Virtual Router Master一台最高優先權的Router,其餘的為Virtual Router Backup,若VRRPVirtual Router Master掛了,會從Virtual Router Backup中選擇一台成為Virtual Router Master
Virtual Router Master,每隔一段時間間隔(Advertisement Time)要發送multicast(我還活著)。若經過了Advertisement Time*3 + 偏移時間尚未間聽到相關活著的封包,擁有較高PriorityRouter會優先發出multicast成為Master,而其他的Router則仍維持Virtual Router Backup的角色。

因為VRRP協定有明確的規範使用固定的MAC位址,所以當角色變換的同時,從Virtual Router Backup變成Virtual Router Master,會宣稱他有這個IP(Default Gateway),並且同時修正MAC位址成為規範的位址。這對其他裝置而言完全不影響原本的二、三層資料與快取,像是ARP Table等等相關資訊。

公開的協定,不具有負載平衡機制,同一時間內僅有一台Router運作。

依據 RFC 2338 所定義的 VRRP version 2VRRP 其實只是一種選舉 Virtual Router 的通訊協定,而 Virtual Router 又是由各個跑 VRRP 通訊協定的 Router 組成的,這些 Router 必須要有相同的 VRID(Virtual Router ID) 即相同的 Virtual IPVRRP 才會把他們視為在同一個群組!

換句話說,一個 Virtual Router 是由擁有相同的VRID及相同的 Virtual IP Router 組成的,一旦有一台 Router 同樣也有跑VRRP,但 VID Virtual IP 不同,就會被當作另一個 Virtual Router 群組。

VRRP 是 從Virtual Router 選出一台擁有最高優先權的 Router 作為 Virtual Router Master,其餘的則為 Virtual Router Backup,而 Virtual Router Master 負責對外宣稱他擁有 Virtual IP,並處理任何要到達 Virtual IP 的封包,一旦 Virtual Router Master 掛了,VRRP 就會再從 Backup 中選出一台作為 Master,繼續接手處理要到達 Virtual IP 的封包。

成為 Virtual Router Master Router 固定時間(Advertisement Interval) 會發出 Multicast(Advertisement),告訴其他的Virtual Router "我還活著" 及一些相關訊息,而成為 Virtual Router Backup Router 只負責聽 Master 所發出來的 Multicast(Advertisement),萬一超過了時間(3 倍的 Advertisement time + 偏移時間)還沒聽到 Master Multicast(Advertisement),具有比較高 Priority Router,會具有比較小的偏移時間,優先發出 Multicast 封包,持續成為 Master,而其他的 Router 則持續為 Backup Router

由於 VRRP 有明定標準的 MAC Address,所以要切換成 Master 除了必須要對外宣告他有這個 ip 外,還需要改變自己的 MAC Address 成為標準的 VRRP MAC Address,因此這對於其他的機器而言,完全沒有任何感覺,這也是為什麼 VRRP Fail-over 速度能如此快的理由。

2013年3月18日 星期一

VMware vCenter Converter Standalone


以下步驟可以將實體的機器轉成虛擬機,英文縮寫為 PtoV(P2V) - PC to VM。
下面步驟我們將實體機賦予代號為 A.(Source Machine);將要轉到的目標虛擬平台稱為B. (Destination System)

Step I. 首先我們需要先確認兩台電腦都有管理者權限的帳號密碼(若無密碼也需要設定一組密碼給予Administrator),A機器的本機防火牆必須為關閉狀態,以利Agent Software Tool安裝。


Step II.開啟VMware vCenter Converter並執行工作,按下Converter Machine,設定Source Type。
此處需要注意的點為Username格式務必寫成Hostname\Username,尤其是有納入網域也有本機管理著者的PC更需要特別註明。
圖一、Source System Setting

Step III. 下一步設定Destination System,需要注意的選項為Select Destination Type,我們這邊選擇在本機上所運作的VMware載台,並且要注意轉出來的Product版本,如果之後要移植的載台版本並非最新版,請注意不要選用太新版本的Product。
Select a location for Virtual Machine,此選項務必使用邏輯位址(\\Hstname\Shared_Folder架構),不要使用IP位址,最好按鈕Browse點選共享資料夾點選。
圖二、Destination System Setting

Step IV. 下兩個步驟就比較單純的調整VM輸出的檔案細節內容與Summary了,沒必要我們通常會保留預設值,按下完成後就加入排程開始緩慢執行轉換作業了。
圖三、Options

圖四、Summary