이더넷 프레임 구조
위키피디아 영문버전을 주로 참고하면서 공부해본다.
이더넷은 LANs(Local Area Networks), MANs(Metropolitan Area Networks)를 위한 컴퓨터 네트워크 기술이다.
1980년에 소개되고 1983년에 IEEE 802.3으로 표준화된 기술로 token ring, FDDI, ARCNET과 같은 와이어(Wired) LAN 기술중 단연 널리쓰이는 기술이기도하다. 그리고 요즘 이더넷 대신에 쓰는 네트워크 기술중 1순위는 Wired LAN의 다른것이 아니라 Wrieless 방법인 IEEE 802.11의 와이파이(Wi-Fi) 기술이다.
이게 중요한게 아니라 정말 궁금했던 본론부터 말해야겠다.
(나는 네트워크 스위치 프로그래머도 아니고 이더넷프레임 해더가지고 프로그램을 하는 사람도 아니다. 프로그램을 하더라도 상용화되어 있는 공개소스를 참고하여 응용프로그램을 만들고 OS레이어 프로그램을 하지는 않을 것이므로 이해하는 정도로 넘어가자. 이는 네트워크 프로그래밍, OS프로그래밍이 어렵다는것을 말하는것이 아니라 프로그래밍도 고유의 영역이 있고 프로그래머로써 분야전문가가 되려면 그만큼의 노력이 필요하지만 나는 다른 할일이 충분히 많이 있기 때문에 다른곳에 더 힘써야하고 이해하는 수준에서 공부해본다.)
이더넷 프레임 Structure
Layer |
Preamble |
Start of Frame Delimiter |
MAC destination |
MAC source |
802.1Q tag(optional) |
Ethertype(Ethernet 2) or length(IEEE802.3) |
Payload |
Frame check sequence(32-bit CRC) |
interpacket gap |
|
7 octets(bytes) |
1 octect |
6 octets |
6 octets |
(4 octets) |
2 octets |
46(42) -1500 octets |
4 octets |
12 |
Layer2 Ethernet frame |
|
|
<------ 64 ~ 1518(1522) octets --------> |
| |||||
Layer1 Ethernet packet |
<------ 72 ~ 1526(1530) octets --------> |
|
○ Preamble and start frame delimiter
- 이더넷 프레임은 7 octets Preamble과 1 octet SFD(start frame delimiter)로 시작한다. Preamble은 56비트 패턴의 1과 0비트를 반복하는 패턴이며 네트워크상의 디바이스들이 쉽게 시간 동기화 할수 있게 해준다. 이더넷은 Symbol Rate(symbol data) 대신에 preamble과 SFD를 보내는데 1개 프레임에서 이들의 패턴은 10101010 10101010 10101010 10101010 10101010 10101010 10101010 10101011 같다. IEEE 802.3-2012 section 3.1.1. and 3.2에 따라 Hexa로 표현하면 0x55 0x55 0x55 0x55 0x55 0x55 0x55 0xD5 이다. SFD 이후에는 MAC Address가 바로 나온다.
○ Header
- Header는 Mac addresses와 EtherType, IEEE 802.1Q 태그로 구성된다. EtherType 필드는 2 octets으로 1500 값 아래는 Payload octets의 크기를 나타내고 1536(0x0600) 이상의 크기는 EtherType 종류의 의미를 가지고 payload 크기를 결정한다. IEEE 802.1Q 태그가 표시되어 있다면 VLAN임을 의미하고 IEEE 802.1p 을 우선으로 고려해야한다.
EtherType인 이더넷프레임이라면 프레임의 길이는 interpacket gap이나 FCS(frame check sequence)에 의해 결정된다.
○ Payload
- 데이터이다. IP 프로토콜을 사용한다면 IP Address와 같은 헤더가 있고 어떤 데이터가 있을 것이다.
○ Frame check sequence
- The frame check sequence (FCS) is a four-octet cyclic redundancy check (CRC) that allows detection of corrupted data within the entire frame as received on the receiver side. The FCS value is computed as a function of the protected MAC frame fields: source and destination address, length/type field, MAC client data and padding (that is, all fields except the FCS).
○ End of frame
- The end of a frame is usually indicated by the end of data stream at the physical layer or by loss of the carrier signal; an example is 10BASE-T, where the receiving station detects the end of a transmitted frame by loss of the carrier.
○ Interpacket gap
- Interpacket gap is idle time between packets. After a packet has been sent, transmitters are required to transmit a minimum of 96 bits (12 octets) of idle line state before transmitting the next packet.
Reference from
-site-
이더넷프레임 : https://en.wikipedia.org/wiki/Ethernet_frame
'공부방' 카테고리의 다른 글
Linux Red Hat Enterprise Version 7 Study.. (0) | 2015.09.16 |
---|---|
이더넷, TCP/IP 소켓 프로그래밍 방법 (0) | 2015.08.28 |
L2스위칭 & L3라우팅 과정에서 ARP/IP 패킷의 변화 (1) | 2015.08.26 |
영어 '기본' 문법 정리 (참고서적 : 토마토 basic) (0) | 2014.10.28 |
[펌] 좌파와 우파의 개념 구분 (0) | 2009.05.05 |