1 / 34

이더넷 ( Ethernet)

Chapter 4:. 이더넷 ( Ethernet). 2003. 3. Ethernet Header. Preamble. S F D. Destination Address. Source Address. Type. DATA. FCS. 7 byte. 1 byte. 6 byte. 6 byte. 2 byte. 46-1500 byte. 4 byte. 이더넷 v2 프레임. 기능 한 스테이션에서 다른 스테이션으로 안전하고 효과적으로 패킷을 전송하는 컨테이너( container). 이더넷 프레임의 구조.

gavivi
Download Presentation

이더넷 ( Ethernet)

An Image/Link below is provided (as is) to download presentation Download Policy: Content on the Website is provided to you AS IS for your information and personal use and may not be sold / licensed / shared on other websites without getting consent from its author. Content is provided to you AS IS for your information and personal use only. Download presentation by click this link. While downloading, if for some reason you are not able to download a presentation, the publisher may have deleted the file from their server. During download, if you can't get a presentation, the file might be deleted by the publisher.

E N D

Presentation Transcript


  1. Chapter 4: 이더넷 (Ethernet) 2003. 3.

  2. Ethernet Header Preamble S F D Destination Address Source Address Type DATA FCS 7byte 1byte 6byte 6byte 2byte 46-1500byte 4byte 이더넷v2 프레임 • 기능 • 한 스테이션에서 다른 스테이션으로 안전하고 효과적으로 패킷을 전송하는 컨테이너(container). • 이더넷 프레임의 구조  SFD: Start-of-frame delimiter, FCS: Frame Check Sequence.  Type은 AMAN2002 온라인 도움말의 EtherType을 참고.

  3. 이더넷v2 프레임의 구조 • Preamble • 동기화 기능 • SFD(Start of frame delimiter) • 프레임의 시작을 표시 • 근원지 MAC 주소 • 데이터를 내보내는 기계의 MAC 주소 • 목적지 MAC 주소 • 데이터를 수신할 기계의 MAC 주소 • Type • 상위 계층 프로토콜 종류를 표시 • 데이터 필드 • 상위 프로토콜 데이터 패킷 • FCS (Frame Check Sequence) • 프레임에 문제가 있는지 판별에 사용 L3 데이터 네트워크 계층 Type 네트워크 인터페이스 계층 (데이터링크 계층) H2 L3 데이터 T2 물리 계층 1 0 1 0 1 0 0 0 1 1 0

  4. MAC 주소의 구조 • 제조 회사 ID • IEEE에서 관리하는 NIC 제조회사의 고유번호. • AMAN2002 도움말의 OUI Code 참조. • NIC(Network Interface Card) ID • 3bytes의 고유한 카드 번호. • Sony Corporation NIC의 MAC주소 예 제조회사 ID (3 byte) NIC ID (Network Card Interface ID) (3 byte) 08-00-46 - 18-BD-C8 <참고> PC의 MAC 주소를 확인하는 방법 Windows98: DOS창에서 winipcfg /all 명령, NT계열: DOS창에서 ipconfig /all 명령.

  5. Ethernet Header Data Field Preamble S F D Destination Address Source Address Length Data FCS 802.2 LLC header DSAP SSAP Ctrl 7byte 1byte 6byte 6byte 2byte 43-1497byte 4byte 1 1 1 IEEE 802.3 프레임 구조 • Type 필드를 Length로 대체 • 데이터 필드에 LLC(Logical Link Control) 추가 DSAP: Destination Service Access Point, SSAP: Source Service Access Point.

  6. Ethernet Header Data Field SNAP packet Preamble S F D Destination Address Source Address Length Data FCS 802.2 LLC header Code Type DSAP SSAP Ctrl 7byte 1byte 6byte 6byte 2byte 38-1492byte 4byte 1 1 1 3 2 IEEE 802.3 with SNAP 프레임 구조 • SNAP(Sub-Network Access Protocol)을 추가하여 지원 가능 프로토콜 수를 확장

  7. Novell 802.3 • Novell 네트워크에서 사용 • Novell IPX 데이터만을 지원 함 Ethernet Header Data Field Preamble S F D Destination Address Source Address Length Only IPX Data FCS 7byte 1byte 6byte 6byte 2byte 46-1500byte 4byte

  8. 이더넷 프레임 분석 • Packet Observer를 이용한 이더넷 분석

  9. 이더넷 프레임 분석 • 00 00 0C 07 AC 00 00 E0 18 1B 52 BE 08 00 • 송신측 MAC 주소 • NIC 제조회사: 00E018 ASUSTEK COMPUTER INC. • Card ID: 1B52BE • 수신측 MAC 주소 • NIC 제조회사: 00000C CISCO SYSTEMS, INC. • Card ID: 07AC00 • 상위 계층 프로토콜 종류 • 0x0800 Internet IP (IPv4)

  10. NIC 제조회사 코드표 • AMAN2002 Online Help의 “OUI 코드” 참조

  11. 상위 계층 프로토콜 번호 • AMAN2002 Online Help의 “EtherType” 참조

  12. 연습 문제 1 • 01 00 5E 00 00 02 00 07 4F A1 6B FC 08 00 • 송신측 MAC 주소 • NIC 제조회사:  • Card ID: • 수신측 MAC 주소 • NIC 제조회사:  • Card ID: • 상위 계층 프로토콜 종류 • 

  13. 연습 문제 2 • 00 01 02 E8 DF 8D 00 08 E2 44 76 3C 08 00 • 송신측 MAC 주소 • NIC 제조회사:  • Card ID: • 수신측 MAC 주소 • NIC 제조회사:  • Card ID: • 상위 계층 프로토콜 종류 • 

  14. Guru를 이용한 이더넷 프레임 분석 연습

  15. 이더넷 프레임 켑쳐 프로그램 작성

  16. Microsoft Visual C++ 실행 • 시작  프로그램 Microsoft Visual Studio 6.0  Microsoft Visual C++ 6.0

  17. 새 프로젝트 생성 • AppWizard 시작: Visual C++의 FileNew 메뉴 선택

  18. AppWizard – Step 1

  19. AppWizard – Step 2

  20. AppWizard – Step 3

  21. AppWizard – Step 4

  22. 라이브러리 경로 설정 (1) • Include 경로: Visual C++의 Directories Show directories for 메뉴 선택

  23. 라이브러리 경로 설정 (2) • Include 경로: Visual C++의 Directories Show directories for 메뉴 선택

  24. 대화상자 디자인 • EtherViewer 메인 대화상자 디자인 8 9 10 List Control 1 4 5 6 7 2 3 Check Box Edit Box Edit Box Button

  25. Control 속성

  26. 이벤트 처리

  27. 어뎁터 오픈 대화상자 표시 void CEtherViewerDlg::OnBUTTONSelectAdaptor() { //Ncap lib.(Dialog based class lib.) 객체 생성. CSelectAdaptorDlg *pDlg = new CSelectAdaptorDlg; if(pDlg->DoModal() != IDOK) { delete pDlg; return; } … }

  28. 어뎁터 열기 //선택된 네트워크 어뎁터를 사용할 수 있도록 초기화. if(pDlg->OpenAdaptor(m_iFilter_IP)) { ::AfxMessageBox("Adaptor open 실패"); pDlg->CloseAdaptor(); delete pDlg; return; }

  29. 패킷 캡쳐 #define MaxBufferLen 2048 UpdateData(TRUE); unsigned char arrTemp[MaxBufferLen]; for(int i=0; i<m_EDIT_iCountInput; i++) { memset(arrTemp, 0, MaxBufferLen); //패킷을 하나 획득함. 음수가 return되면 에러가 발생한 것. if(pDlg->Ncap(arrTemp, MaxBufferLen) < 0) continue; //패킷 분석 … }

  30. 패킷 분석 CString strDestMac = _T(""); strDestMac.Format(_T("%02X %02X %02X - %02X %02X %02X"), arrTemp[0], arrTemp[1], arrTemp[2], arrTemp[3], arrTemp[4], arrTemp[5]); m_LIST_PacketInfo.SetItem(i, 2, LVIF_TEXT, strDestMac, 0, 0, 0, 0); CString strSrcMac = _T(""); strSrcMac.Format(_T("%02X %02X %02X - %02X %02X %02X"), arrTemp[6], arrTemp[7], arrTemp[8], arrTemp[9], arrTemp[10], arrTemp[11]); m_LIST_PacketInfo.SetItem(i, 1, LVIF_TEXT, strSrcMac, 0, 0, 0, 0); CString strType = _T(""); unsigned int iTypeORlength = pDlg->Twobytes_to_number(arrTemp[12], arrTemp[13]); strType.Format(_T("%02X %02X(Hex), %d(Decimal)"), arrTemp[12], arrTemp[13], iTypeORlength); m_LIST_PacketInfo.SetItem(i, 3, LVIF_TEXT, strType, 0, 0, 0, 0);

  31. 어뎁터 닫기 //사용한 자원 해제. pDlg->CloseAdaptor(); //Ncap lib. 삭제. delete pDlg;

  32. EtherViewer 실행 모습

  33. EtherViewer를 이용한 이더넷 프레임 분석 • 송신측 MAC 주소 • NIC 제조사: 0008E2  Cisco Systems, Card ID: 44763C • 수신측 MAC 주소 • NIC 제조사: 000102  3COM CORPORATION, Card ID: E8DF8D • 상위 계층 프로토콜 종류 • 0x0806  Internet IP

  34. 참고 문헌 • 서승호 외, AMAN2002를 이용한 TCP/IP 프로토콜 분석 및 네트워크 프로그래밍, 정익사, 2002. • RFC 826, David C. Plummer, An Ethernet Address Resolution Protocol or Converting Network Protocol Addresses to 48 bit Ethernet Address for Transmission on Ethernet Hardware, November 1982. • RFC 1060, J. Reynolds J., ASSIGNED NUMBERS, March 1990. • RFC 1010, J. Reynolds J., ASSIGNED NUMBERS, May 1987. • RFC 1042, J. Reynolds J., A Standard for the Transmission of IP Datagrams over IEEE 802 Network, February 1988. • Behrouz Forouzan, “Introduction to Data Communication and Networking”, Mcgrwohill, 1999. • Fred Halsall, “Data Communications, Computer Networks and Open Systems”, Addison-wesley, 1995.

More Related