소개
ACI는 컷스루 스위칭을 따릅니다. 즉, CRC를 계산하기 전에 패킷이 이미 전달되었습니다. 이러한 패킷은 일반적으로 출력 오류로 압축 및 전달됩니다. ACI는 이러한 패킷을 삭제하지 않으므로 동일한 패킷이 패킷을 통과하며, 중지 CRC 카운터가 경로에서 증가합니다. 이는 CRC가 표시된 모든 인터페이스에 결함이 있음을 의미하지는 않습니다. 따라서 문제가 되는 포트/SFP/파이버를 격리하려면 적절한 분류가 필요합니다. 이제 분류 프로세스가 Python 스크립트를 통해 자동화되므로 문제 해결이 더 쉬워지고 수동 작업을 피할 수 있습니다. 이 문서의 범위는 자동화 스크립트를 사용하는 방법을 설명하는 것입니다(첨부 참조).
스크립트를 수동으로 실행하기 위한 사전 요구 사항
스크립트가 실행될 클라이언트 시스템은 다음 요구 사항을 충족해야 합니다
a. Python3를 설치해야 합니다.
b. ACI 도메인에 대한 네트워크 액세스
c. 설치할 ACI_CRC_requirements.txt(첨부) 이 파일은 여기 있습니다.
클라이언트 머신에 파일(ACI_CRC_requirements.txt) 다운로드
터미널을 열고 pip3 install -r ACI_CRC_requirements.txt 명령을 실행합니다.
ABCD-M-G24X:downloads abcd$ pip3 install -r ACI_CRC_requirements.txt
Collecting bcrypt==3.2.0 (from -r ACI_CRC_requirements.txt (line 1))
Downloading https://files.pythonhosted.org/packages/bf/6a/0afb1e04aebd4c3ceae630a87a55fbfbbd94dea4eaf01e53d36743c85f02/bcrypt-3.2.0-cp36-abi3-macosx_10_9_x86_64.whl
Collecting cffi==1.14.6 (from -r ACI_CRC_requirements.txt (line 2))
Downloading https://files.pythonhosted.org/packages/ca/e1/015e2ae23230d9de8597e9ad8c0b81d5ac181f08f2e6e75774b7f5301677/cffi-1.14.6-cp38-cp38-macosx_10_9_x86_64.whl (176kB)
|████████████████████████████████| 184kB 1.4MB/s
**snip**
Successfully installed DateTime-4.3 Pillow-8.3.2 bcrypt-3.2.0 cffi-1.14.6 cryptography-3.4.8 cycler-0.10.0 kiwisolver-1.3.2
matplotlib-3.4.3 numpy-1.21.2 pandas-1.3.2 paramiko-2.7.2 pyparsing-2.4.7 python-dateutil-2.8.2 pytz-2021.1 six-1.16.0
stdiomask-0.0.5 tabulate-0.8.9 termcolor-1.1.0 zope.interface-5.4.0
컨테이너에서 스크립트를 실행하기 위한 사전 요구 사항
위와 같은 Python Packages가 미리 설치된 컨테이너를 준비한다.
docker login docker.io
docker pull aci-stomper
docker run -d --name -p :80 aci-stomper (on your browser http://ContainerIP:someport)
docker ps
docker exec -it /bin/bash
root@6df99d5dbbad:/# cd /home/scripts/
root@6df99d5dbbad:/home/scripts# ls
ACI_CRC_Parser.py ACI_CRC_Poller.py
스크립트를 실행하는 단계
총 2개의 python 스크립트(ACI_CRC_Poller.py 및 ACI_CRC_Parser.py)가 있습니다. 이러한 스크립트는 아래 URL을 사용하여 Cisco DevNet Code Exchange에서 다운로드할 수 있습니다.
https://developer.cisco.com/codeexchange/github/repo/CiscoDevNet/ACI-CRC-FCS-Checker
스크립트를 실행할 시스템/컴퓨터에 두 가지를 모두 다운로드합니다.
이 문서에서 script-1은 ACI_CRC_Poller.py를 참조하고 script-2는 ACI_CRC_Parser.py를 참조합니다.
1. ACI_CRC_Poller.py는 최대 7일 동안 5분마다 파일의 CRC 및 FCS 오류 데이터를 수집합니다.
터미널에서 script-1(ACI_CRC_Poller.py)을 실행합니다. 지정된 클러스터의 APIC 중 하나에 대한 OOB IP 주소와 해당 자격 증명을 입력하십시오.
ABCD-M-G24X:downloads abcd$ python3 ACI_CRC_Poller.py
Enter the IP address or DNS Name of APIC: 10.197.204.184
__________________________________________________________
Enter the username: admin
___________________________________________________________
Enter the password: **********
Trying to connect to APIC
Connection established to the APIC
___________________________________________________________
2. 스크립트-1은 레코드를 저장할 로컬 컴퓨터/컴퓨터의 위치/경로를 요청합니다. 올바른 경로를 입력하십시오. 그렇지 않으면 스크립트가 실행되지 않습니다.
Please enter the folder where files have to be stored
_____________________________________________________________
VALID folder format:
EXAMPLE:
Windows-> C:\Users\Admin\Desktop\ACI\
MAC -> /User/admin/Desktop/ACI/
---------------------------------------------------------------------------------------------------
PLEASE NOTE that data collection and script execution might get impacted if folder format is not as below
--------------------------------------------------------------------------------------------------------
Enter the absolute path of the folder where the files have to be stored:/Users/abcd/Downloads/FCS_Checker/ <<<<<<<<<<<<<<
3 . 이제 스크립트가 실행 종료 시간을 요청합니다.
yyyy-mm-dd hh:mm 형식(패브릭의 로컬 시간대당)으로 최소 5분, 최대 7일까지 시간을 입력하십시오.
이 때 script-1은 5분마다(사용자가 이전에 지정한 종료 시간까지) 패브릭에서 FCS/CRC 오류를 수집하기 시작하고 이전 입력에서 지정한 경로에 있는 파일에 데이터를 저장합니다.
----------------------------------------------------------------
Enter the End Time until which the script runs(in the format of yyyy-mm-dd hh:mm, current time:2021-09-27 11:27.... maximum upto 2021-10-04 11:27): 2021-09-27 11:32 <<<<<
___________________________________________________________
The script is executing ........................
The script is executing ........................
ABCD-M-G24X:downloads abcd$
4. 첫 번째 스크립트를 성공적으로 실행하면 2단계에서 사용자가 지정한 위치에 원시 데이터 파일이 저장됩니다.
아래 예제와 같이 동일하게 확인합니다.
ABCD-M-G24X:FCS_Checker kbosu$ pwd
/Users/abcd/Downloads/FCS_Checker
ls -l
total 16
-rw-r--r--@ 1 kbosu staff 1419 Sep 27 11:28 CRC_FCS_20210927_1128.txt
-rw-r--r--@ 1 kbosu staff 1419 Sep 27 11:33 CRC_FCS_20210927_1133.txt
ABCD-M-G24X:FCS_Checker abcd$
5. 이제 두 번째 스크립트(ACI_CRC_Parser.py)를 실행해야 합니다.
Script-2는 script-1에서 만든 파일을 사용하고 더 많은 작업을 수행합니다.
지정된 클러스터의 APIC 중 하나에 대한 OOB IP 주소와 해당 자격 증명을 입력하십시오.
또한 첫 번째 스크립트를 실행하는 동안 2단계에서 입력한 것과 동일한 파일 위치를 입력합니다.
ABCD-M-G24X:downloads abcd$ python3 ACI_CRC_Parser.py
Enter the IP address or DNS Name of APIC: 10.197.204.184
__________________________________________________________
Enter the username: admin
___________________________________________________________
Enter the password: **********
Trying to connect to APIC
Connection established to the APIC
_____________________________________________________________
Please enter the folder where files are stored
Please make sure we have at least two files exists in the directory where you have saved data
_____________________________________________________________
--------------------------------------------------------------------------------------------------------
Enter the absolute path of the folder where the files are stored:/Users/abcd/Downloads/FCS_Checker/
___________________________________________________________
You have CRC and FCS for the below date range
1.2021-09-27
Fetching first and last file of the same date 20210927
CRC_FCS_20210927_1128.txt
CRC_FCS_20210927_1133.txt
__________________________________________________________
The script is executing.....
__________________________________________________________
The script execution has completed
6. Script-2는 아래 예제와 같이 데이터를 표 형식으로 인쇄합니다.
기본적으로 사용자가 지정한 시간 간격 동안 0이 아닌 CRC 및 FCS 오류가 있는 노드 인터페이스와 해당 CRC/FCS 카운터의 차이점이 나열됩니다. 또한 스크립트는 LLDP를 사용하여 지정된 인터페이스와 연결된 네이버 디바이스를 확인하고, 가장 중요한 것은 패브릭 측면에서 어떤 노드/인터페이스가 오류의 원인인지, 어떤 노드 인터페이스에서 스톰으로 인해 CRC가 방금 표시되는지를 나타냅니다.
FCS 트러블슈팅 관점에서 "빨간색"으로 강조 표시되고 "로컬"로 표시된 것은 추가 트러블슈팅에 중점을 두어야 하는 부분입니다.
이는 불량/손상된 패킷이 패브릭으로 들어가서 패브릭에서 CRC가 플러딩되는 인터페이스일 가능성이 높습니다.
+--------+---------+--------------------+-----------+-----------+---------------+---------------+---------------+---------------+-------------------------------------------------------------------------------------+--------------+
| POD_ID | NODE_ID | NODE_NAME | NODE_ROLE | INTERFACE | 20210927_1128 | 20210927_1133 | 20210927_1128 | 20210927_1133 | NEIGHBOR | ERROR SOURCE |
+--------+---------+--------------------+-----------+-----------+-----CRC-------+----CRC Diff---+----FCS--------+---FCS Diff----+-------------------------------------------------------------------------------------+--------------+
| 1 | 302 | bgl-aci06-t2-leaf2 | leaf | eth1/44 | 5002806823759 | 127841888 | 5002806823759 | 127841888 | No LLDP /CDP neighbours found please check physically where this interface connects | Local |
| 1 | 101 | bgl-aci06-spine1 | spine | eth1/1 | 2981200154 | 132103050 | 0 | 0 | System:bgl-aci06-t1-leaf1.cisco.com,Interface:Eth1/49 | Stomp |
| 1 | 101 | bgl-aci06-spine1 | spine | eth1/2 | 968286 | 0 | 0 | 0 | | Historic |
| 1 | 201 | bgl-aci06-t1-leaf1 | leaf | eth1/1 | 12 | 0 | 0 | 0 | | Historic |
| 1 | 201 | bgl-aci06-t1-leaf1 | leaf | eth1/51 | 4999243774529 | 0 | 0 | 0 | | Historic |
| 1 | 201 | bgl-aci06-t1-leaf1 | leaf | eth1/52 | 5002807353809 | 127841212 | 0 | 0 | System:bgl-aci06-t2-leaf2.cisco.com,Interface:Eth1/49 | Stomp |
| 1 | 202 | bgl-aci06-t1-leaf2 | leaf | eth1/51 | 968286 | 0 | 0 | 0 | | Historic |
| 1 | 301 | bgl-aci06-t2-leaf1 | leaf | eth1/44 | 4999245287405 | 0 | 4999245287405 | 0 | | Historic |
| 1 | 301 | bgl-aci06-t2-leaf1 | leaf | eth1/49 | 4999823953891 | 0 | 0 | 0 | | Historic |
| 1 | 302 | bgl-aci06-t2-leaf2 | leaf | eth1/49 | 4999243774529 | 0 | 0 | 0 | | Historic |
+--------+---------+--------------------+-----------+-----------+---------------+---------------+---------------+---------------+-------------------------------------------------------------------------------------+--------------+
7. 또한 스크립트는 사용자에게 스크립트-1과 2에서 수집한 세부 데이터를 정렬하고 볼 수 있는 다음 옵션을 제공합니다.
사용자는 1-3 사이의 옵션을 입력으로 선택할 수 있다. 아래 예를 참조하십시오.
1.Sort the data further
2.View the granular data of an interface
3.Exit
Input the number:
아래 예에서는 임의의 인터페이스에 대한 세분화된 데이터를 보는 데 도움이 되는 옵션 2를 살펴보겠습니다.
스크립트는 사용자에게 위 테이블에 인쇄된 각각의 POD 번호, 노드 ID 및 인터페이스 ID를 입력하라는 메시지를 표시합니다(6단계).
이 예에서는 1-302-eth1/44를 사용합니다. 여기서 POD ID는 1이고, 노드 ID는 302이며, 인터페이스 ID eth1/44입니다. 이 인터페이스는 인터페이스입니다
로컬 FCS가 스크립트에 의해 보고되었습니다(6단계 참조).
Input the number:2
---------------------------------------------------------------------------
Enter an interface for which you need granular data(POD_ID-NODE_ID-INTERFACE Example:1-101-eth1/5): 1-302-eth1/44
----------------------------------------------------------------------
You have CRC and FCS data in the below date range
1.2021-09-27
Enter the date for which you need granular data(any number from the above list range(1-1)):
이 예에서는 하루 중 몇 분 동안만 데이터를 수집했으므로 9월 27일자 옵션에는 하나만 표시됩니다.
따라서 우리의 입력은 "1"이 될 것입니다.
Enter the date for which you need granular data(any number from the above list range(1-1)): 1
+-------+---------------+---------------+
| Time | CRC | FCS |
+-------+---------------+---------------+
| 11:28 | 5002806823759 | 5002806823759 |
| 11:33 | 5002934665647 | 5002934665647 |
+-------+---------------+---------------+
----------------------------------------------------------------
Do you want to continue viewing the granular data(0/1), 1-yes, 0-no:0
--------------------------------------------------------------------------------
Please select any number below to sort the data further or to view granular data of an interface
1.Sort the data further
2.View the granular data of an interface
3.Exit
Input the number:3
ABCD-M-G24X:downloads abcd$