Switch storm-control

Switching 2008. 11. 2. 20:23
최종 Update 16.3.7

출처 http://ohdol.com | 오돌
원문 http://memolog.blog.naver.com//51

storm-control

스톰-컨트롤(storm-control)은 특정 Port에서 발생하는
Traffic(UniCast, MultiCast, BroadCast)을 제어할 수 있는 명령어입니다.

예제 장비 : cisco WS-C2950G-48-EI / Version 12.1(22)EA2

명령어는 VLAN에서는 적용되지 않고 원하는 Port에서 적용가능합니다.

"int 해당Port"로 진입. ( range명령어 가능합니다.)


 Switch(config-if)#int f0/1
 Switch(config-if)#storm-control┌ broadcast level┌ pps # #
                                │                └ # #
                                ├ multicast level┌ pps # #
                                │                └ # #
                                ├ unicast level  ┌ pps # #
                                │                └ # #
                                └ action┌ shutdown
                                        └ trap


BroadCast, MultiCast, UniCast는 명령이 각각 같습니다.

단지, Traffic 측정의 기준을 pps(packets per second)로 할지 Port 스피드의 %(percentage of bandwidth)로 할지만 정하면 됩니다.

해당 Port에 pps와 % 동시 지정은 안 됩니다.

단, Port끼리는 서로 다르게 할 수도 있으니 원하는 기준으로 지정하면 됩니다.

예를 들어, f0/1에는 pps를 적용하고 f0/2에는 %로 지정 가능하다는 뜻입니다.


pps로 할 경우에는 level 뒤에 pps를 써 준 뒤에 수치를 적는 방식이고 %일 경우에는 level 뒤에 바로 수치를 적어 주면 됩니다.

첫번째 수치는 제한값을 적는 것이고 두번째 값은 제한값을 넘어갈때 변경될 값을 적는 것입니다. Forwarding 되는 임계값 입니다.

예를 들어,

broadcast level 10 2 이렇게 명령을 주면

BroadCast Traffic이 10%를 넘어가면 2%가 되게 Traffic을 제어 하는 것입니다. Block이 되었다가 2%이하로 떨어지게 되면 다시 Forward 되는 것입니다.

그럼 10% 였던 Traffic이 2%로 내려갑니다. 그러다 다시 10%을 넘어가면 또 2%로 이렇게 계속 반복이 됩니다.

broadcast level pps 1000 10 이렇게 명령을 주면 BroadCast Traffic이 초당 1000 Packet을 넘어가면 초당 10 Packet만 되게끔 제어하는거죠. Block이 되었다가 10pps로 떨어지게 되면 다시 Forward 됩니다.


action shutdown 은 이 명령을 주기 전까지는 제한된 값을 넘어가면 지정된 값으로 내려가게 했지만 Block 되었다가 Forward 임계치 이하로 떨어지면 자동으로 복구되지만

action shutdown을 넣어주면 지정된 값으로 내려 가는게 아니라, 해당 Port를 shutdown 시켜 버립니다.

sh run 해서 해당 Port를 보면 shutdown이 들어가 있습니다.

관리자가 no shut 해주기 전까지는 해당 Port를 사용할 수가 없는 상태가 됩니다.


action trap 는 storm-control에 해당하는 Traffic이 발생되면 SNMP로 정보를 보내주어 관리자가 nms에서 인지하게 해주는 명령어입니다.

기본적으로 꼭 해주어야 관리자가 빨리 대처 할 수 있겠죠?


storm-control에 대한 자료를 찾다보니, 쉽게 설명된 자료가 없는거 같아서 한번 만들어 봤습니다.

초보에게는 쉽다면 쉽고 어렵다면 어려운거 같습니다. 무작정 해보고 나면 어렵지 않음을 알게 될 것입니다.

매번 좋은 자료와 도움만 받았는데... 이 자료가 초보분들에게 도움이 되었길 바랍니다 ^^

 

아래 내용은 실습한 내용을 캡쳐한 것입니다.

실습시 참고 하세요 ^^;

 

================================================================================

준비물 : 2950 Switch 1대, PC a, PC b


PC a랑 Switch랑 Console로 연결하고 PC a는 f0/1번 Port에 랜 연결

PC b는 f0/2번 Port에 랜 연결을 합니다.

Switch vlan1에 ip을 할당해 줍니다.

 

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int vlan 1
Switch(config-if)#no shut
Switch(config-if)#ip add 10.254.254.9 255.255.255.0

 

PC a : 10.254.254.10/24
PC b : 10.254.254.11/24

 

Setting해 주고 각각 ping이 되는지 확인합니다.

많은 분들이 OSI_1를 무시하는 경향이 있더라고요.

아무리 2,3을 잘해도 1이 제대로 안 되어 있으면 말짱 꽝입니다.

물리적으로 연결이 잘 되어 있는지 확인은 필수 입니다 ^^

나중에 Traffic 유발을 위한 FTP 테스트도 미리 한번 합니다.

PC a에 알FTP Server를 구동하고 PC b에서 FTP Client로 접속해서 Download를 해 봅니다.

PC, Switch 다 100Mbps라면 약 100Mbps Full-Speed가 나올거에요 ^^;

 

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int ran f0/1 - 2
Switch(config-if-range)#storm-control broadcast level 10 1
Switch(config-if-range)#storm-control multicast level 20 2
Switch(config-if-range)#storm-control unicast level 50 5
Switch(config-if-range)#storm-control action trap

action shutdown은 나중에 하기로 하고 여기까지 Setting후에


Switch#show storm-control
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising   10.00%    1.00%    0.00%           0
Fa0/2      Forwarding     Below rising   10.00%    1.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0


show storm-control 명령을 치면 storm-control에 대한 정보를 볼 수가 있는데,

저도 여기서 잠시 헷갈린게 show storm-control 뒤에 아무것도 없이 Enter를 쳐서 나오는건 BroadCast에 대한 storm-control 정보입니다.

위 예제에서 broadcast level 10 1 했듯이 show해서 나온 정보도 Upper은 10.00% 이고 Lower은 1.00% 이죠?


Switch#show storm-control broadcast
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising   10.00%    1.00%    0.00%           0
Fa0/2      Forwarding     Below rising   10.00%    1.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0


show storm-control 뒤에 BroadCast 명령을 주나 안 주나 같은 정보죠? ^^(이걸 몰라서 처음에... Multi랑 Uni는 어디갔나하고 ㅜ.ㅜ)

Multi랑 Uni는 아래 처럼 볼 수 있습니다.


Switch#show storm-control multicast
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising   20.00%    2.00%    0.00%           0
Fa0/2      Forwarding     Below rising   20.00%    2.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0

 

Switch#show storm-control unicast
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising   50.00%    5.00%    0.00%           0
Fa0/2      Forwarding     Below rising   50.00%    5.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0


쉽게 Traffic을 유발할 수 있는 UniCast를 예로 설명 하겠습니다.


Switch#show storm-control unicast
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising   50.00%    5.00%    0.00%           0
Fa0/2      Forwarding     Below rising   50.00%    5.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0

 

여기서 보면, (F0/3 이후로도 쭉 있는데 생략한거니 왜 없지 하고 고민하지 마세요^^)

1,2번 Port에는 storm-control을 셋팅했기에 Filter state에 현재 Port 상태(Forwarding)을 표시해 준거고

3번 Port에는 storm-control을 셋팅하지 않았기에 inactive라고 표시되어 나온 것입니다.

Trap State에도 1,2번 Port는 셋팅되어 있는 Port라서 현재 감시중이라는걸 나타나고.

Upper 50.00%은 제한값이 50%라는 거고 Lower은 제한된 값이 넘어 갔을때 Lower값인 5.00%로 내려주라는걸 뜻 합니다. Forward 시작값 입니다.

Current는 현재 Port의 사용률을 표시해 줍니다.

지금은 아무런 데이타가 없기 때문에 0.00%라고 나오네요.

Traps Sent는 제한된 값을 넘어서 storm-control 정보를 SNMP로 몇번 보냈는지를 표시해 줍니다.

아직까지는 한번도 넘어간적이 없어서 0 이네요.


그럼 본격적인 테스트를 해 볼까요?

PC a에 FTP Server를 구동하고 PC b에서 PC a로 ftp 접속을 합니다.

(전 무난한 알ftpServer를 이용했습니다 ^^;)

Server에서 File을 Download 합니다. (PC a -> PC b)

 

Switch#show storm-control unicast
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising   50.00%    5.00%    9.89%           0
Fa0/2      Forwarding     Below rising   50.00%    5.00%    0.11%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0


 

반대로 Server로 Uploading 하면(PC b -> PC a)

 

Switch#show storm-control unicast
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising   50.00%    5.00%    0.38%           0
Fa0/2      Forwarding     Below rising   50.00%    5.00%    9.94%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0 


위 가지를 보면서 유추할 수 있는 내용이 뭘까요?

바로 storm-control에서 제어되는 Traffic은 바로 해당 Port의 OUT Traffic IN Traffic 이란 것입니다.

(사실 저도 테스트 하면서 알게 되었네요 ^^;)


PC b의 랜카드가 10메가짜리라서 Traffic이 10%을 못 넘기네요 ㅜ.ㅜ

어쩔 수 없이 셋팅값을 변경 좀 하겠습니다 ^^;

 

Switch(config)#int ran f0/1 -2
Switch(config-if-range)#storm-control unicast level 8 1
Switch(config-if-range)#^Z
Switch#sh
01:12:16: %SYS-5-CONFIG_I: Configured from console by console

Switch#sh sto uni
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising    8.00%    1.00%    0.00%           0
Fa0/2      Forwarding     Below rising    8.00%    1.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0

 

제한된 값을 8%로 바꾸었습니다 ^^;

다시, Server에서 File을 다운 받습니다 (PC a -> PC b)

 

Switch#sh sto uni
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Blocking       Above falling   8.00%    1.00%    8.31%           1
Fa0/2      Forwarding     Below rising    8.00%    1.00%    0.09%           0 

 

현재 값이 8.31%네요 8%을 넘어 갔기 때문에

설정된 값인 1.00%로 만들기 위해서 Traffic 제어를 시작했네요

 

 

Switch#sh sto uni
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising    8.00%    1.00%    0.27%           1
Fa0/2      Forwarding     Below rising    8.00%    1.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0 

 

1.00% 이하로 만들어 버렸네요 ^^

 

 

Switch#sh sto uni
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising    8.00%    1.00%    7.13%          76
Fa0/2      Forwarding     Below rising    8.00%    1.00%    0.08%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0

 

테스트 하는 동안 76번이나 제한된 8%를 넘어갔네요 ^^;

다운 받는 사람은 속도가 계속 오르락 내리락 했을테니 짜증 났을거 같네요 >.<


 

그럼, 이번엔 action shutdown을 넣어볼까요?


Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int range f0/1 -2
Switch(config-if-range)#storm-control action shutdown
Switch(config-if-range)#^Z
Switch#sh run int f0/1
Building configuration...
 
Current configuration : 214 bytes
!
interface FastEthernet0/1
 storm-control broadcast level 10.00 1.00
 storm-control multicast level 20.00 2.00
 storm-control unicast level 8.00 1.00
 storm-control action shutdown
 storm-control action trap
end 

 

현재 f0/1 Port에는 no shut 상태입니다.

이 상태에서 다시 한번 Server에서 File을 다운 받습니다 (PC a -> PC b)

해 보겠습니다...^^


Switch#
01:21:45: %STORM_CONTROL-2-SHUTDOWN: Storm control shut down FastEthernet0/1
Switch#
01:21:47: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
01:21:48: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down
Switch#
Switch#sh run int f0/1
Building configuration...
 
Current configuration : 224 bytes
!
interface FastEthernet0/1
 shutdown
 storm-control broadcast level 10.00 1.00
 storm-control multicast level 20.00 2.00
 storm-control unicast level 8.00 1.00
 storm-control action shutdown
 storm-control action trap
end        

 

Switch#sh sto un
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Shutdown       Below rising    8.00%    1.00%    0.00%          87
Fa0/2      Forwarding     Below rising    8.00%    1.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0 

 

Switch#sh ip int br
Interface                  IP-Address      OK? Method Status                Prot
Vlan1                      10.254.254.9    YES NVRAM  up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down
FastEthernet0/2            unassigned      YES unset  up                    up
FastEthernet0/3            unassigned      YES unset  down                  down

 


내용이 많죠? ^^

하자마자 바로 제한값 8%을 넘어가니까 f0/1 Port가 down 되었다고 로그가 올라오네요.


Switch#
01:21:45: %STORM_CONTROL-2-SHUTDOWN: Storm control shut down FastEthernet0/1
Switch#
01:21:47: %LINK-5-CHANGED: Interface FastEthernet0/1, changed state to administratively down
01:21:48: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to down

storm-control에 의해 f0/1을 셧다운되었고

f0/1의 상태를 administratively down가 되었음을 알려주네요.


sh run으로 f0/1 내용을 보니까

interface FastEthernet0/1
 shutdown
 storm-control broadcast level 10.00 1.00
 storm-control multicast level 20.00 2.00
 storm-control unicast level 8.00 1.00
 storm-control action shutdown
 storm-control action trap
end 

shutdown 줄이 삽입되어 있죠?


Switch#sh sto un
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Shutdown       Below rising    8.00%    1.00%    0.00%          87
Fa0/2      Forwarding     Below rising    8.00%    1.00%    0.00%           0
Fa0/3      inactive       inactive      100.00%  100.00%      N/A           0 

show로 storm-control 상태를 보니 f0/1의 Filter State가 shutdown 이네요.


가장 많이 사용하는

Switch#sh ip int br
Interface                  IP-Address      OK? Method Status                Prot
Vlan1                      10.254.254.9    YES NVRAM  up                    up
FastEthernet0/1            unassigned      YES unset  administratively down down

f0/1이 administratively down 임을 알 수가 있네요.

 

이 Port를 사용하려면

Switch#conf t
Enter configuration commands, one per line.  End with CNTL/Z.
Switch(config)#int f0/1
Switch(config-if)#no shut
Switch(config-if)#^Z
Switch#
01:29:20: %SYS-5-CONFIG_I: Configured from console by console
Switch#
01:29:20: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to down
Switch#
01:29:22: %LINK-3-UPDOWN: Interface FastEthernet0/1, changed state to up
Switch#
01:29:24: %LINEPROTO-5-UPDOWN: Line protocol on Interface FastEthernet0/1, changed state to up
Switch#


Switch#sh sto u
Interface  Filter State   Trap State     Upper    Lower    Current  Traps Sent
---------  -------------  -------------  -------  -------  -------  ----------
Fa0/1      Forwarding     Below rising    8.00%    1.00%    0.00%          87
Fa0/2      Forwarding     Below rising    8.00%    1.00%    0.00%           0

 

Switch#
Switch#sh run int f0/1
Building configuration...
 
Current configuration : 214 bytes
!
interface FastEthernet0/1
 storm-control broadcast level 10.00 1.00
 storm-control multicast level 20.00 2.00
 storm-control unicast level 8.00 1.00
 storm-control action shutdown
 storm-control action trap
end
 
Switch#
Switch#sh ip int br
Interface                  IP-Address      OK? Method Status                Prot
Vlan1                      10.254.254.9    YES NVRAM  up                    up
FastEthernet0/1            unassigned      YES unset  up                    up


f0/1이 다시 사용할 수 있는 상태가 되었습니다 ^^

======================================


마무리하면서...

멋있게 화면 캡쳐도 하고 등등 그러면 좋겠지만,

구닥다리라서 그런지 메모장에서만 만들다 보니 비쥬얼이 떨어지네요 --;

실습 상황이라서 운영중인 장비에는 못해본게 아쉽지만

(운영중인거에 이런거 잘못하면 큰일 납니다 ^^;)

저도 실습하면서 인바운드 Traffic에는 해당되지 않고

아웃바운드 Traffic에만 해당된다는걸 알게 되었네요.

도움 주려고 했다가 오히려 저도 도움을 받게 된거 같습니다.


비가 많이 오는 수요일입니다.

다들 조심히 퇴근하시고~ 비오는날에 맞게 부침에 막걸리 한잔 *^^*



Posted by 불량소금
,