본문 바로가기

3-5. Networks

트래픽과 전송속도와의 상관 관계

내용 : 전송속도가 T1(1.544 Mbps)으로 연결된 라우터에 대해서 60초 동안 traffic을 체크하여, 트래픽 양과 전송속도의 관계를 확인하고자 함.

라우터IP(가상) : 10.1.1.1
community : public
포트번호 : 2번
사용한 프로그램 : snmpget

[트래픽추출]
#snmpget 10.1.1.1 public ifInOctets.2 ifOutOctets.2
interfaces.ifTable.ifEntry.ifInOctets.2 = 2870061957
interfaces.ifTable.ifEntry.ifOutOctets.2 = 3914191972

60초 후에 다시 체크
# snmpget 10.1.1.1 public ifInOctets.2 ifOutOctets.2
interfaces.ifTable.ifEntry.ifInOctets.2 = 2870917187
interfaces.ifTable.ifEntry.ifOutOctets.2 = 3915984744

위의 interfaces.ifTable.ifEntry.ifInOctets.2 가 의미하는 것은, 2번 포트에 입력된 트래픽 양을 의미합니다. 따라서 위 두 값의 차이가 60초 동안 입력된 트래픽 양이 됩니다. 출력값도 마찬가지로 계산하면 됩니다.

ifInOctets - The total number of octets received on the interface, including framing characters.
IfOutOctets – The total number of octets transmitted out of the interface, including framing characters
Octet – 8비트로 구성된 바이트와 같은 단위.

[계산]
① 60초 동안 발생한 트래픽
input: 2870917187 - 2870061957 = 855230 (bytes) 
output: 3915984744 - 3914191972 = 1792772 (bytes)

펌'd by  nanha님 블로그(
http://www.nanha.com/index.php?p=b/view&n=776&b=dft)