2014年6月5日 星期四

LLDP (Link Layer Discovery Protocol ,鏈路層發現協議)


1.1  LLDP簡介

1.1.1  LLDP概述

LLDP Link Layer Discovery Protocol ,鏈路層發現協議)是鏈路層協議,它將本地設備的信息組織成TLVType/Length/Value ,類型長度值)封裝在LLDPDU Link Layer Discovery Protocol Data Unit ,鏈路層發現協議數據單元)中發送給直連的鄰居,同時也把從鄰居接收的LLDPDU 以標準MIB Management Information Base ,管理信息庫)的形式保存起來。通過LLDP ,設備可以保存和管理自己以及直連鄰居設備的信息,供網絡管理系統查詢和判斷鍊路的通信狀況。

1.1.2  LLDP工作機制

1. LLDP 工作模式

LLDP 有以下四種工作模式:
              TxRx :既發送也接收LLDPDU
              Tx :只發送不接收LLDPDU
              Rx :只接收不發送LLDPDU
              Disable :既不發送也不接收LLDPDU
當端口的LLDP 工作模式發生變化時,端口將對協議狀態機進行初始化操作。為了避免端口工作模式頻繁改變而導致端口不斷執行初始化操作,可配置端口初始化延遲時間,當端口工作模式改變時延遲一段時間再執行初始化操作。

2. LLDPDU 發送機制

當端口工作在TxRx Tx 模式時,將按照指定的時間間隔週期性的向鄰居設備發送LLDPDU 。當本地配置發生變化時,為了將本地信息的變更情況盡快通知鄰居設備,將立即發送LLDPDU 。但為了防止本地信息頻繁變化引起大量發送LLDPDU,每發送一個LLDPDU 都需要延遲等待一段時間,才能繼續發送下一個LLDPDU 
當發現一個新鄰居(即接收到一個新的LLDPDU 且本地沒有保存發送該LLDPDU 的設備的信息)或工作模式從Disable(或Rx )切換為TxRx (或Tx )時,為了讓其它設備盡快發現本設備,將啟用快速發送機制,即將LLDP 報文的發送週期縮短為秒,並連續發送指定數量的LLDPDU 後再恢復為正常的發送週期。

3. LLDPDU 接收機制

當端口工作在TxRx Rx 模式時,將對收到的LLDPDU 及其攜帶的TLV 進行有效性檢查。通過有效性檢查後,將鄰居信息保存到本地設備,並根據LLDPDU 攜帶的TTL Time To Live ,老化時間)值設置鄰居信息在本地設備的老化時間,如果接收到的LLDPDU 中的TTL 值等於零,將立刻老化掉該鄰居信息。
可通過配置TTL 乘數的值控製本地信息在鄰居設備上的老化時間,TTL=TTL 乘數× LLDPDU 發送週期,如果TTL 乘數與LLDPDU 發送週期的乘積大於65535 ,則TTL 的值取65535 秒。

1.1.3  TLV信息類型

LLDP 可以封裝的TLV 包括基本TLV 、組織定義TLV 以及MED Media Endpoint Discovery ,媒體終端發現)相關TLV。基本TLV 是被視為網絡設備管理基礎的一組TLV ,組織定義TLV MED 相關TLV 是由標準組織以及其他機構定義的TLV ,用於增強對網絡設備的管理,可根據實際需要配置是否在LLDPDU 中發送。

1. 基本TLV

在基本TLV 中,有幾種類型的TLV 對於實現LLDP 功能來說是必選的,即必須在LLDPDU 中發佈,如 1-1所示。
TLV 類型
說明
是否必鬚髮布
End of LLDPDU TLV
標誌LLDPDU 結束
Chassis ID TLV
發送設備的橋MAC 地址
Port ID TLV
用來標識LLDPDU 發送端的端口。當設備不發送MED TLV時,內容為端口名稱,當設備發送MED TLV 時,內容為端口的MAC 地址,沒有端口MAC 時使用橋MAC
Time To Live TLV
本設備信息在鄰居設備上的存活時間
Port Description TLV
以太網端口的描述字符串
System Name TLV
設備的名稱
System Description TLV
系統描述
System Capabilities TLV
系統的主要功能以及有哪些主要功能被使能
Management Address TLV
管理地址,以及對應的接口號和OID(Object Identifier ,對象標識。管理地址內容為用戶指定的IP 地址,如果用戶沒有配置,管理地址為接口允許通過且VLAN ID 值最小的VLAN 的主IP 地址,若VLAN ID 值最小的VLAN 未配置主IP 地址,管理地址值為127.0.0.1

2. 組織定義TLV

(1)         IEEE 802.1 組織定義的TLV
              Port VLAN ID TLV 端口VLAN ID 
              Port And Protocol VLAN ID TLV :端口的協議VLAN ID 
              VLAN Name TLV :端口VLAN 名稱。
              Protocol Identity TLV :端口支持的協議類型。

 

LLDP

The Cisco Discovery Protocol (CDP) is a device discovery protocol that runs over Layer 2 (the data link layer) on all Cisco-manufactured devices (routers, bridges, access servers, and switches). CDP allows network management applications to automatically discover and learn about other Cisco devices connected to the network.
To support non-Cisco devices and to allow for interoperability between other devices, the switch supports the IEEE 802.1AB Link Layer Discovery Protocol (LLDP). LLDP is a neighbor discovery protocol that is used for network devices to advertise information about themselves to other devices on the network. This protocol runs over the data-link layer, which allows two systems running different network layer protocols to learn about each other.
LLDP supports a set of attributes that it uses to discover neighbor devices. These attributes contain type, length, and value descriptions and are referred to as TLVs. LLDP supported devices can use TLVs to receive and send information to their neighbors. This protocol can advertise details such as configuration information, device capabilities, and device identity.
The switch supports these basic management TLVs. These are mandatory LLDP TLVs.
Port description TLV
System name TLV
System description TLV
System capabilities TLV
Management address TLV
These organizationally specific LLDP TLVs are also advertised to support LLDP-MED.
Port VLAN ID TLV ((IEEE 802.1 organizationally specific TLVs)
MAC/PHY configuration/status TLV(IEEE 802.3 organizationally specific TLVs)