50
1 Chapter 21 Chapter 21 Simple Network Simple Network Management Management Protocol (SNMP) Protocol (SNMP) Mi-Jung Choi Dept. of Computer Science and Engineering [email protected]

Chapter 21 Simple Network Management Protocol (SNMP)

  • Upload
    jules

  • View
    71

  • Download
    1

Embed Size (px)

DESCRIPTION

Chapter 21 Simple Network Management Protocol (SNMP). Mi-Jung Choi Dept. of Computer Science and Engineering [email protected]. Overview. 21.1 CONCEPT 21.2 SMI 21.3 MIB 21.4 SNMP 21.5 EXAMPLE 21.6 UDP PORTS. 21.1 CONCEPT. 21.1 CONCEPT. Managers and Agent - PowerPoint PPT Presentation

Citation preview

Page 1: Chapter 21 Simple Network Management   Protocol (SNMP)

11

Chapter 21Chapter 21 Simple Network Management Simple Network Management Protocol (SNMP) Protocol (SNMP)

Mi-Jung Choi

Dept. of Computer Science and Engineering

[email protected]

Page 2: Chapter 21 Simple Network Management   Protocol (SNMP)

22

OverviewOverview

21.1 CONCEPT

21.2 SMI

21.3 MIB

21.4 SNMP

21.5 EXAMPLE

21.6 UDP PORTS

Page 3: Chapter 21 Simple Network Management   Protocol (SNMP)

33

21.1 CONCEPT21.1 CONCEPT

Page 4: Chapter 21 Simple Network Management   Protocol (SNMP)

44

21.1 CONCEPT21.1 CONCEPT

Managers and Agent

관리자 (manager)

SNMP 클라이언트 프로그램을 수행하는 호스트 데이터베이스에서 값들을 읽어옴 라우터로 하여금 특정한 동작을 행하도록 함 ( 예 , 재시동 )

에이전트 (agent)

SNMP 서버 프로그램을 수행하는 라우터 ( 또는 호스트 ) 데이터베이스에 성능 정보를 유지 관리 과정에 기여

Page 5: Chapter 21 Simple Network Management   Protocol (SNMP)

55

21.1 CONCEPT21.1 CONCEPT

Managers and Agent

관리 관리자와 에이전트간의 간단한 대화에 의해 수행

SNMP 를 사용한 관리 관리자는 에이전트의 행동을 반영하는 정보를 요구하여 에이전트를 검사한다 관리자는 에이전트 데이터베이스에 있는 값을 리셋하여 에이전트가 작업을

수행하도록 한다 에이전트는 비정상적인 상황을 관리자에게 경고하여 관리 과정에 기여한다

Page 6: Chapter 21 Simple Network Management   Protocol (SNMP)

66

21.1 CONCEPT21.1 CONCEPT

Components of network management on the Internet

Page 7: Chapter 21 Simple Network Management   Protocol (SNMP)

77

21.2 SMI21.2 SMI

SMI (Structure of Management Information)

SNMP 를 위한 지침

기능 객체에 이름을 붙인다 객체에 저장된 데이터의 종류를 결정한다 네트워크 상의 전송을 위해 데이터를 어떻게 인코딩 할지를 보여준다

Page 8: Chapter 21 Simple Network Management   Protocol (SNMP)

88

21.2 SMI21.2 SMI

SMI

Object attributes

Page 9: Chapter 21 Simple Network Management   Protocol (SNMP)

99

21.2 SMI21.2 SMI

Name

트리 구조에 기초한 계층적 식별자인 객체 식별자를 사용

정수 - 점 표현 : SNMP 에 의해 사용 예 ) 1.3.6.1.2.1

이름 - 점 표현 : 사람이 사용 예 ) iso.org.dod.internet.mgmt.mib

SNMP 에서 사용되는 객체는 mib 객체 밑에 위치 → 식별자는 항상 1.3.6.1.2.1 로 시작

Page 10: Chapter 21 Simple Network Management   Protocol (SNMP)

1010

21.2 SMI21.2 SMI

Page 11: Chapter 21 Simple Network Management   Protocol (SNMP)

1111

21.2 SMI21.2 SMI Type

저장되는 데이터 유형

SMI 는 ASN.1 의 부분집합이면서 포함 집합

Page 12: Chapter 21 Simple Network Management   Protocol (SNMP)

1212

21.2 SMI21.2 SMI Simple Type

A counting value that records time in 1/100 sec-onds4 bytesTimeTicks

Same as Counter, but when it reaches its maximum value, it does nto wrap; it remains there until it is reset4 bytesGauge

An integer whose value and be incremented form zero to 4, 294, 967, 295; when it reaches its maximum value it wraps back to zero4 bytesCounter

An IP address made of four integers4 bytesIPAddress

An object identifier represented in ASCII digitsVariableObjectIdentifier

Zero or more ASCII charactersVariableString

A cardinal number between 0 and 232-14 bytesInteger

DescriptionSizeType

Page 13: Chapter 21 Simple Network Management   Protocol (SNMP)

1313

21.2 SMI21.2 SMI

Structured Type

Sequence

반드시 같은 데이터 종류일 필요는 없는 , 단순 데이터 유형들의 결합 예 ) 프로그래밍 언어에서의 구조체나 레코드의 개념

Sequence of

모두 같은 유형인 단순 데이터 유형들의 결합 모두 같은 유형인 sequence 데이터 유형들의 결합 예 ) 프로그래밍 언어에서의 배열의 개념

Page 14: Chapter 21 Simple Network Management   Protocol (SNMP)

1414

21.2 SMI21.2 SMI

Page 15: Chapter 21 Simple Network Management   Protocol (SNMP)

1515

21.2 SMI21.2 SMI

Encoding Method

BER (Basic Encoding Rules) 표준 사용하여 전송되는 데이터를 인코딩

Page 16: Chapter 21 Simple Network Management   Protocol (SNMP)

1616

21.2 SMI21.2 SMI

Encoding Method

Tag : 데이터 유형을 정의하는 한 바이트 필드 Class : 데이터의 범위를 정의 Format : 단순 (0)/ 구조적 (1) 데이터 유형 지정 Number : 단순 / 구조적 데이터를 서브 그룹들로 나눈다

Page 17: Chapter 21 Simple Network Management   Protocol (SNMP)

1717

21.2 SMI21.2 SMI

430100001100011001TimeTicks

420100001000010001Gauge

410100000100001001Counter

400100000000000001IPAddress

300011000010000100Sequence

sequence of

060000011000110000ObjectIdentifier

040000010000100000String

020000001000010000Integer

Tag(Hex)Tag(Binary)NumberFormatClassData

Page 18: Chapter 21 Simple Network Management   Protocol (SNMP)

1818

21.2 SMI21.2 SMI

Encoding Method

Length : 데이터의 길이를 규정 한 바이트 : 최상위 비트 0 한 바이트 이상 : 첫번째 바이트의 최상위 비트 1

Value : 데이터의 값을 부호화

Page 19: Chapter 21 Simple Network Management   Protocol (SNMP)

1919

21.2 SMI21.2 SMI

Example 1

Integer 14 정의

Page 20: Chapter 21 Simple Network Management   Protocol (SNMP)

2020

21.2 SMI21.2 SMI

Example 2

String HI 정의

Page 21: Chapter 21 Simple Network Management   Protocol (SNMP)

2121

21.2 SMI21.2 SMI

Example 3

객체 식별자 1.3.6.1(iso.org.dod.internet) 정의

Page 22: Chapter 21 Simple Network Management   Protocol (SNMP)

2222

21.2 SMI21.2 SMI

Example 4

IP 주소 131.21.14.8 정의

Page 23: Chapter 21 Simple Network Management   Protocol (SNMP)

2323

21.3 MIB21.3 MIB MIB (Management Information Base)

각 에이전트는 관리자가 관리할 수 있는 모든 객체를 모아놓은 자신의 MIB 를 갖는다8 개의 서로 다른 그룹으로 분류각 그룹은 값 그리고 / 또는 테이블을 규정

Page 24: Chapter 21 Simple Network Management   Protocol (SNMP)

2424

21.3 MIB21.3 MIB

Page 25: Chapter 21 Simple Network Management   Protocol (SNMP)

2525

21.3 MIB21.3 MIB Accessing MIB Variables

Udp 그룹의 예 : 단순변수 4 개 , 레코드 열 1 개

Page 26: Chapter 21 Simple Network Management   Protocol (SNMP)

2626

21.3 MIB21.3 MIBSimple Variable

그룹 식별자 + 변수의 식별자 : 변수 정의udpInDatagrams ====> 1.3.6.1.2.1.7.1

udpNoPorts ====> 1.3.6.1.2.1.7.2

udpInErrors ====> 1.3.6.1.2.1.7.3

udpOutDatagrams ====> 1.3.6.1.2.1.7.4 실제 값 / 내용 : 인스턴스 접미사 (0) 사용udpInDatagrams.0 ====> 1.3.6.1.2.1.7.1.0

udpNoPorsts.0 ====> 1.3.6.1.2.1.7.2.0

udpInErrors.0 ====> 1.3.6.1.2.1.7.3.0

udpOutDatagrams.0 ====> 1.3.6.1.2.1.7.4.0

Page 27: Chapter 21 Simple Network Management   Protocol (SNMP)

2727

21.3 MIB21.3 MIBTables

테이블 식별자를 사용 Udp 그룹 : 1 개의 테이블udpTable ====> 1.3.6.1.2.1.7.5 테이블의 엔트리 (sequence) 정의udpEntry ====> 1.3.6.1.2.1.7.5.1 엔트리에 있는 각 항목의 정의udpLocalAddress ====> 1.3.6.1.2.1.7.5.1.1

udpLocalPort ====> 1.3.6.1.2.1.7.5.1.2 테이블의 특정 인스턴스를 읽기 위해 색인 추가udpLocalAddress.181.23.45.14.23

====> 1.3.6.1.2.1.7.5.1.1. 181.23.45.14.23

Page 28: Chapter 21 Simple Network Management   Protocol (SNMP)

2828

21.3 MIB21.3 MIB Udp 변수와 테이블

Page 29: Chapter 21 Simple Network Management   Protocol (SNMP)

2929

21.3 MIB21.3 MIB Udp Table 에 대한 색인

Page 30: Chapter 21 Simple Network Management   Protocol (SNMP)

3030

21.3 MIB21.3 MIB

Lexicographic Ordering

객체 식별자는 사전적 순서로 되어 있다

열 - 행 규칙에 따라 배열 → 열 순으로 접근

관리자가 변수들의 조합을 첫번째 변수를 정의한 후 차례대로 읽는 것이 가능

Page 31: Chapter 21 Simple Network Management   Protocol (SNMP)

3131

21.3 MIB21.3 MIB Lexicographic Ordering

Page 32: Chapter 21 Simple Network Management   Protocol (SNMP)

3232

21.4 SNMP21.4 SNMP

SNMP(Simple Network Management Protocol)

네트워크 관리에 SMI 와 MIB 를 모두 사용

관리자가 에이전트에서 정의된 객체의 값을 읽는다

관리자가 에이전트에서 정의된 객체에 값을 저장

에이전트가 비정상적 상황에 대한 경고 메시지를 관리자에게 보낸다

Page 33: Chapter 21 Simple Network Management   Protocol (SNMP)

3333

21.4 SNMP21.4 SNMP

Messages

Page 34: Chapter 21 Simple Network Management   Protocol (SNMP)

3434

21.4 SNMP21.4 SNMPGetRequest

변수의 값을 읽기 위하여 관리자 ( 클라이언트 ) 가 에이전트 ( 서버 ) 로 보내는 메시지

GetNextRequest

변수의 값을 읽기 위하여 관리자가 에이전트로 보내는 메시지 읽혀진 값 : 메시지에 정의된 ObjectID 바로 다음 객체의 값

GetResponse

GetRequest 와 GetNextRequest 에 대한 응답으로 에이전트가 관리자에게 보내는 메시지

Page 35: Chapter 21 Simple Network Management   Protocol (SNMP)

3535

21.4 SNMP21.4 SNMPSetRequest

관리자가 변수에 값을 설정하기 위해 전송하는 메시지

Trap

에이전트가 사건을 관리자에게 보고하기 위해 전송되는 메시지 예 ) 에이전트의 재시동 시간 보고

Page 36: Chapter 21 Simple Network Management   Protocol (SNMP)

3636

21.4 SNMP21.4 SNMP Format

Page 37: Chapter 21 Simple Network Management   Protocol (SNMP)

3737

21.4 SNMP21.4 SNMPVersion

버전 번호 정의 실제로는 버전 번호 – 1 값

Community

비밀번호를 정의 비밀번호가 없으면 public

Request ID

순서 번호 요청과 응답을 일치시키는 데 사용

Error status

에이전트에 의해 보고되는 오류의 종류 응답 메시지에서만 사용

Page 38: Chapter 21 Simple Network Management   Protocol (SNMP)

3838

21.4 SNMP21.4 SNMP 오류 종류

Error Index

관리자에게 오류를 일으킨 변수를 알려주는 옵셋

Other errors genErr5

The value cannot be modified readOnly4

The Value to be stored is invalid badValue3

Variable does not exist noSuchName2

Response too big to fit in one message tooBig1

No error noError0

MeaningNameStatus

Page 39: Chapter 21 Simple Network Management   Protocol (SNMP)

3939

21.4 SNMP21.4 SNMPVarBindList

관리자가 읽거나 설정하기를 원하는 값을 갖는 변수들의 조합 Trap 메시지에서 특정 메시지에 관련된 변수와 값

Enterprise Trap 을 발생시키는 소프트웨어 패키지의 ObjectId 정의

Agent Address Trap 을 생성하는 에이전트의 IP 주소 정의

Trap type Trap 종류 정의

Page 40: Chapter 21 Simple Network Management   Protocol (SNMP)

4040

21.4 SNMP21.4 SNMP 트랩 종류

Invalid community detected authenticationFailure4

Other messages enterpriseSpecific6

An EGP router has gone to down state egpNeighborLoss5

An interface has come up linkUp3

An interface has gone down linkDown2

Agent has been rebooted warmStart1

Agent has been booted coldStart0

MeaningNameStatus

Page 41: Chapter 21 Simple Network Management   Protocol (SNMP)

4141

21.4 SNMP21.4 SNMPSpecific code

Trap 종류의 값이 6 일때 , 제작회사에 의해 사용되는 특정한 코드를 정의

Time stamp Trap 을 야기한 사건 이후 경과된 시간

Page 42: Chapter 21 Simple Network Management   Protocol (SNMP)

4242

21.4 SNMP21.4 SNMP 인코딩

BER 표준을 사용 SNMP 메시지에 대한 코드

A41010010000100110 Trap

A31010001100011110 SetRequest

A21010001000010110 GetResponse

A11010000100001110 GetNextRequest

A0101000000000110 GetRequest

Whole Tag(Hex)

Whole Tag(Binary)

NumberFormatClassData

Page 43: Chapter 21 Simple Network Management   Protocol (SNMP)

4343

21.4 SNMP21.4 SNMP

Page 44: Chapter 21 Simple Network Management   Protocol (SNMP)

4444

21.4 SNMP21.4 SNMPVersion

트리플렛 ( 태그 , 길이 , 값 ) 으로 인코딩

Community

PDU(Protocol Data Unit) PDU 의 종류 , 길이 , PDU 데이터에 대한 코드 포함 요청 식별자 ( 태그 , 길이 , 값의 트리플렛 ), 오류 상태 , 오류 식별자 , VarBindL

ist 로 PDU 데이터 생성

Page 45: Chapter 21 Simple Network Management   Protocol (SNMP)

4545

21.5 EXAMPLE21.5 EXAMPLE Example 1

관리자 국이 라우터가 수신한 UDP 데이터그램의 수를 읽기 위해 GetRequest 메시지를 사용

에이전트는 GetResponse 메시지로 응답

상응하는 MIB 변수 = 객체 식별자 1.3.6.1.2.1.7.1 인 udpInDatagrams

Page 46: Chapter 21 Simple Network Management   Protocol (SNMP)

4646

21.5 EXAMPLE21.5 EXAMPLE

30 2A Sequence of length 2A16

02 01 00 Integer of length 0116, version=0

04 06 70 75 62 6C 69 63 String of length 0616, “public”

A0 1D GetRequest of length 1D16

02 04 00 01 06 11 Integer of length 0416, Request ID=0001061116

02 01 00 Integer of length 0116, Error Status=0016

02 01 00 Integer of length 0116, Error Index=0016

03 0F Sequence of length 0F16

30 0D Sequence of length 0D16

06 09 01 03 06 01 02 01 07 01 00 ObjectId of length 0916, udpInDatagram

05 00 Null entity of length 0016

GetRequest Encoding fot Example 1

Page 47: Chapter 21 Simple Network Management   Protocol (SNMP)

4747

21.5 EXAMPLE21.5 EXAMPLE

Page 48: Chapter 21 Simple Network Management   Protocol (SNMP)

4848

21.5 EXAMPLE21.5 EXAMPLE

30 2E Sequence of length 2E16

02 01 00 Integer of length 0116, version=0

04 06 70 75 62 6C 69 63 String of length 0616, “public”

A2 21 GetResponse of length 1D16

02 04 00 01 06 11 Integer of length 0416, Request ID=0001061116

02 01 00 Integer of length 0116, Error Status=0016

02 01 00 Integer of length 0116, Error Index=0016

30 13 Sequence of length 1316

30 11 Sequence of length 1116

06 09 01 03 06 01 02 01 07 01 00 ObjectId of length 0916, udpInDatagram

05 00 Counter of length 04 with the value 12 11

GetResponse Encoding fot Example 1

Page 49: Chapter 21 Simple Network Management   Protocol (SNMP)

4949

21.6 UDP PORTS21.6 UDP PORTS

SNMP 의 UDP 서비스 사용

잘 알려진 포트 161( 에이전트 ) 과 162( 관리자 ) 사용

클라이언트와 서버 모두 잘 알려진 포트를 사용

클라이언트와 서버 모두 무한히 수행

Page 50: Chapter 21 Simple Network Management   Protocol (SNMP)

5050

21.6 UDP PORTS21.6 UDP PORTS