Transcript Document

Chapter 8 網路管理
網路管理的概念
• 為了使網際網路上數百數千個網路元件(包含硬
體及軟體)能夠順利運作,AS管理者必須要能
夠監控所屬元件的情況以及與外界的溝通。
• 網路管理包含:元件的部署、設定、整合、監
控、分析以及與外界元件的協調。
• 網路管理的架構元件:
–
–
–
–
MIB: management information base.
SMI: data definition language.
SNMP: protocol for network management.
Secure and administration.
網路管理的基礎架構
managing entity
agent data
managing
data
entity
managed device
agent data
network
management
protocol
managed device
agent data
agent data
managed device
managed device
• Managed device
內含managed
objects。
• 資料集中放置到
Management
Information base
內。
網路管理的相關標準
• OSI CMIP
– Common Managed Information Protocol.
• SNMP
– Simple Network Management Protocol.
– 目前較常使用的網路管理協定.
– 目前版本: Version 3.
SNMP四大部分
• Management Information base (MIB):
– 存放網路元件的狀態資訊。
• Structure of Management Information (SMI):
– 定義網管資訊的語言。
• SNMP Protocol:
– 資訊傳輸的管理協定,可以傳達管理者的指令。
• Security, administration capabilities.
– 主要新增於第三版的SNMP中。
SMI
Basic Data Types
• SMI是用來完整描述網管資
INTEGER
訊的語法。
Integer32
• SMI base data types:基本的
Unsigned32
資料型態。
OCTET STRING
• OBJECT-TYPE:用來描述一 OBJECT IDENTIFIED
IPaddress
個物件(如介面卡)的網管資訊。
Counter32
• MODULE-IDENTITY:將數
Counter64
個類似的物件存放到MIB
Guage32
module中。
Tie Ticks
Opaque
SNMP MIB
MIB module specified via SMI
MODULE-IDENTITY
(100 standardized MIBs, more vendor-specific)
MODULE
OBJECT TYPE:
OBJECT TYPE:OBJECT TYPE:
objects specified via SMI
OBJECT-TYPE construct
Object以及module的範例
OBJECT-TYPE: ipInDelivers
ipInDelivers OBJECT TYPE
SYNTAX
Counter32
MAX-ACCESS read-only
STATUS current
DESCRIPTION
“The total number of input
datagrams successfully
delivered to IP userprotocols (including ICMP)”
::= { ip 9}
MODULE-IDENTITY: ipMIB
ipMIB MODULE-IDENTITY
LAST-UPDATED “941101000Z”
ORGANZATION “IETF SNPv2
Working Group”
CONTACT-INFO
“ Keith McCloghrie
……”
DESCRIPTION
“The MIB module for managing IP
and ICMP implementations, but
excluding their management of
IP routes.”
REVISION “019331000Z”
………
::= {mib-2 48}
MIB的範例 (UDP Module)
Object ID
Name
Type
Comments
1.3.6.1.2.1.7.1
UDPInDatagrams Counter32 total # datagrams delivered
at this node
1.3.6.1.2.1.7.2
UDPNoPorts
Counter32 # underliverable datagrams
no app at portl
1.3.6.1.2.1.7.3
UDInErrors
Counter32 # undeliverable datagrams
all other reasons
1.3.6.1.2.1.7.4
1.3.6.1.2.1.7.5
UDPOutDatagrams Counter32 # datagrams sent
udpTable
SEQUENCE one entry for each port
in use by app, gives port #
and IP address
SNMP的命名方式
• Object Identifier tree:
– 以階層式的方式命名。
– 每個分支(branch)都有一個以數字命名的代號。
• 例子:
1.3.6.1.2.1.7.1
ISO
ISO-ident. Org.
US DoD
Internet
udpInDatagrams
UDP
MIB2
management
OSI
Object
Identifier
Tree
可參考 http://www.alvestrand.no/harald/objectid/top.html
SNMP Protocol
• 兩種傳輸MIB資訊以及命令的方式:
managing
entity
request
response
agent data
Managed device
request/response mode
managing
entity
trap msg
agent data
Managed device
trap mode
SNMP protocol (message types)
Message type
GetRequest
GetNextRequest
GetBulkRequest
InformRequest
SetRequest
Function
Mgr-to-agent: “get me data”
(instance,next in list, block)
Mgr-to-Mgr: here’s MIB value
Mgr-to-agent: set MIB value
Response
Trap
Agent-to-mgr: inform manager
of exceptional event
SNMP protocol (封包格式)
SNMP的安全性
• Encryption:SNMP的PDU採用DES Encryption。
• 認證(Authentication):依照訊息內容以及安全鑰
(Key)計算MIC (Message Integrity Code)。 (RFC
2104)
• 避免playback的攻擊(RFC 2574)。
• 存取控制 (Access Control)
– SNMP紀錄一個存取權限的資料庫。
– 這個權限紀錄資料庫也是一個可被管理的物件。
資料存放格式
• 不同的機器對於相同的程式碼解讀類似,但存
放方式可能會不同。
• Memory-to-memory的傳輸會產生錯誤。
• 如下例:
struct {
char code;
int x;
} test;
test.x = 256;
test.code=‘a’
test.code
test.x
a
00000001
00000011
host 1 format
test.code
test.x
a
00000011
00000001
host 2 format
資料存放格式不同的解決方法
• 將本身的資料格式轉換成公用的資料格式。
• 傳輸這個公用的資料格式給遠端。
• 遠端系統將此公用的資料格式轉換成本身的資
料格式存放。
ASN.1 Abstract Syntax Notation 1
• ISO standard X.680
• 定義資料型態
• BER:Basic Encoding Rules
– 規定如何傳輸符合ASN.1定義的資訊。
– 每個傳輸的物件都包含(TLV):
• Type
• Length
• Value
TLV
• 傳輸的資料可以利用TLV解讀出正確的涵義。
– Type: 代表資料的型態 (由ASN.1定義)
– Length: 資料的長度 (以byte定義)
– Value: 資料的內容
Tag Value
1
2
3
4
5
6
9
Type
Boolean
Integer
Bitstring
Octet string
Null
Object Identifier
Real
TLV
encoding:
example
Value, 259
Length, 2 bytes
Type=2, integer
Value, 5 octets (chars)
Length, 5 bytes
Type=4, octet string
防火牆 (Firewall)
• 分隔所屬網路以及網際網路以及阻隔、過濾不
允許進入所屬網路的封包。
• 主要分做兩種型態:
– Packet filter
– Application gateways
• 用途:
– 防止DoS的攻擊。
– 防止不當存取。
– 其他安全性考量。
封包過濾 (Packet Filtering)
• 路由器 (Router)可以依照下列幾種考量過濾封包:
–
–
–
–
–
–
來源的IP (SrcIP)
目的地IP (DestIP)
TCP/UDP的埠號 (port)
ICMP message type
TCP的SYN以及ACK的欄位
…
• 範例:
– block incoming and outgoing datagrams with IP protocol field = 17
and with either source or dest port = 23
– Block inbound TCP segments with ACK=0
Application gateways
• 以IP/TCP/UDP的欄位來
決定是否阻隔封包。
• 範例:只允許內部網路
telnet到外部網路。
host-to-gateway
telnet session
application
gateway
gateway-to-remote
host telnet session
router and filter
1. 所有的telnet的訊息都必須經過此gateway。
2. 允許telnet的使用者都透過gateway進行telnet連線,Gateway會轉送
(relay)兩邊的資料。
3. 路由器阻隔不是gateway產生的telnet封包。
防火牆的一些限制
• IP spoofing:網際網路封包內的來源IP可能被
偽造。
• 針對Application gateway必須為每個不同的
application設定一個Application gateway。
• 使用者必須要知道透過Application gateway才能
夠連線。
– 比如要先設定Web Proxy。
• Tradeoff:與外界網路通訊的方便性與安全性。