| 검색 | ?

Difference between r1.23 and the current

@@ -990,10 +990,9 @@
* [^https://tools.ietf.org/html/rfc2390 RFC2390 - Inverse Address Resolution Protocol]
* [^https://tools.ietf.org/html/rfc5227 RFC5227 - IPv4 Address Conflict Detection]
* [^https://tools.ietf.org/html/rfc7042 RFC7042 - IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 Parameters]
* [^http://www.ktword.co.kr/word/abbr_view.php?m_temp1=3301]
* [^http://www.ktword.co.kr/test/view/view.php?m_temp1=2136 802.1Q, 802.1q, IEEE 802.1Q Institute of Electrical and Electronic Engineers 802.1q - 정보통신기술용어해설]
* [^https://en.wikipedia.org/wiki/IEEE_802.1Q]
* [^https://en.wikipedia.org/wiki/IEEE_P802.1p]
* [^https://en.wikipedia.org/wiki/IEEE_802.1ad]
* [^http://www.ieee802.org/1/pages/802.1Q-2014.html]




대문 / 네트웍, 프로그래밍 / 이더넷 (Ethernet)

이더넷 (Ethernet)

1.1. 용어정의

  • SFD : Start of Frame Delimiter
  • DA : Destination MAC address
  • SA : Source MAC address
  • ToL : Type or Length
  • FCS : Frame Check Sequence
  • CRC : Cyclic Redundancy Check
  • LLC : Logical Link Control
  • DSAP : Destination Service Access Point
  • SSAP : Source Service Access Point
  • NIC : Network Interface Card
  • SNAP : SubNetwork Access Protocol

    7 parts of an Ethernet Frame
    참고 영상

    데이터 링크 계층, MAC 주소 지정 및 이더넷 프레임
    참고 영상

1.2. Ethernet frame

Preamble, 10101010B x 7 (7 octets) SFD, 10101011B (1 octet) DA(6 octets) SA(6 octets) 802.1Q/802.1p tag (4 octets, optional) ToL(2 octets) : Ethertype (Ethernet II) or length (IEEE 802.3) Payload(46~1500 octets) Frame check sequence (4 octets, 32bits CRC) Interpacket gap (12 octets)
← Layer 2 Ethernet frame (64(68) ~ 1518(1522) octets) → ← Layer 1 (12octets) →
← Layer 1 Ethernet packet & IPG (72(76) ~ 1526(1530) octets) →
  • Payload 부분이 46octets 보다 작은경우 46octets가 되도록 0으로 Pad합니다.
  • MAC address의 구조는 다음과 같이 제조회사 ID와 NIC ID로 구성됩니다.
    제조회사 ID (3 octets) NIC ID (3 octets)
  • ToL(Type or Length)의 값이 0x0600이상인 경우 Type으로 사용되며 미만인경우 Length로 사용됩니다. 즉, 0x0600이상인 경우 Ethernet v2 frame이 되며 미만인 경우 IEEE 802.3 frame 이 됩니다.
    • Ethernet v2 frame (RFC894, DIX 2.0)
      Preamble, 10101010B x 7 (7 octets) SFD, 10101011B (1 octet) DA(6 octets) SA(6 octets) Type (2 octets) Data unit + Pad (46~1500 octets) Frame check sequence (4 octets, 32bits CRC)
    • IEEE 802.3 frame
      Preamble, 10101010B x 7 (7 octets) SFD, 10101011B (1 octet) DA(6 octets) SA(6 octets) Length (2 octets) 802.2 LLC + Data unit + Pad (46~1500 octets) Frame check sequence (4 octets, 32bits CRC)
      • 802.2 LLC
        DSAP(1 octet) SSAP(1 octet) Control(1 or 2 octets) LLC Information
        • DSAP값 정의 (값이 AAH인 경우 802.2 LLC뒤에 802.2 SNAP가 붙습니다.)
          종류
          06H IP
          42H BPDU
          7EH X.25 PLP
          80H XNS
          E0H Netware IPX
          F0H NetBIOS
          FFH Global SAP
          AAH IEEE SNAP
      • 802.2 SNAP
        OUI (3 octets) Protocol Identifier (2 octets)
        • OUI (3 octets) : NIC 제조회사를 식별하는 값 (현재는 대부분 000000H이 많습니다.)
          • 값이 0080C2H이면 Protocol Identifier에 따라 MAC bridge에서 사용합니다.
          • 값이 000000H이면 Protocol Identifier를 확인하여 해당 protocol로 demultiplexing합니다.
        • Protocol Identifier : 상위 protocol을 지정하는 부분으로 Ethernet v2(DIX 2.0) frame의 Type과 같은 역할을 합니다.
  • FCS(Frame check sequence)는 DA(Destination MAC address) + SA(Source MAC address) + ToL(Type or Length) + Payload 를 CRC계산한 값입니다.

1.3. ARP packet 구조

  • Ethernet frame의 ToL(Type of Length)값이 0806H또는 0835H인경우 ARP packet입니다.
    Hardware Type(16bits) Protocol Type(16bit) Hardware Length(8bits) Protocol Length(8bits) Operation(16bits) Sender(Source) Hardware address(Hardware Length) Sender(Source) Protocol address (Protocol Length) Target(Destination) Hardware Address (Hardware Length) Target(Destination) Protocol Address (Protocol Length)
    • Hardware Type ([http]http://www.iana.org/assignments/arp-parameters/arp-parameters.xml[])
      설명
      0 Reserved
      1 Ethernet (10Mb)
      2 Experimental Ethernet (3Mb)
      3 Amateur Radio AX.25
      4 Proteon ProNET Token Ring
      5 Chaos
      6 IEEE 802.3 networks
      7 ARCNET
      8 Hyperchannel
      9 Lanstar
      10 Autonet Short Address
      11 LocalTalk
      12 LocalNet (IBM PCNet or SYTEK LocalNET)
      13 Ultra link
      14 SMDS
      15 Frame Relay
      16 Asynchronous Transmission Mode (ATM)
      17 HDLC
      18 Fibre Channel
      19 Asynchronous Tramsmission Mode (ATM)
      20 Serial Line
      21 Asynchronous Tramsmission Mode (ATM)
      22 MIL-STD-188-220
      23 Metricom
      24 IEEE 1394.1995
      25 MAPOS
      26 Twinaxial
      27 EUI-64
      28 HIRARP
      29 IP and ARP over ISO 7816-3
      30 ARPSec
      31 IPsec tunnel
      32 InfiniBand (TM)
      33 TIA-102 Project 25 Common Air Interface (CAI)
      34 Wiegand Interface
      35 Pure IP
      36 HW_EXP1
      37 HFI
      38~255 Unassigned
      256 HW_EXP2
      257~65534 Unassigned
      65535 Reserved
    • Protocol Type : Mapping 대상의 유형을 나타냅니다. (IPv4의 경우는 0x0800 으로 설정할 수 있습니다.)
    • Operation
      설명
      1 ARP Request
      2 ARP Reply
      3 RARP Request
      4 RARP Reply

1.4. Linux에서 Ethernet frame 수신해보기

  • 아래의 예제는 Linux에서 Ethernet packet을 수신해보는 예제입니다. RAW socket을 이용하기 때문에 반드시 root 유저권한에서 실행해야 올바른 수신이 됩니다.
    More

1.5. 2008년 9월 1일 현재 IANA ethernet-numbers

More

1.6. 참고자료



Copyright ⓒ MINZKN.COM
All Rights Reserved.