现今,见到的比较多的ethernet frames有如下的四种:
a. Ethernet II
b. Ethernet 802.3 (Raw), aka Novell Ethernet
c. Ethernet 802.3/802.2 by IEEE
d. Ethernet SNAP
file:///C:/DOCUME%7E1/Jianglei/LOCALS%7E1/Temp/moz-screenshot.jpg
---------------------------------------------------------------------------------| Preamble | Dest MAC | Src MAC | Length/EtherType | Data | FCS |---------------------------------------------------------------------------------
| 8 bytes | 6 bytes | 6 bytes | 2 bytes | 46 - 1500 bytes | 4 bytes |
这是个不同帧类型有不同的包结构:
Ethernet II Novell IPX/SPX, TCP/IP, and AppleTalk Phase 1 protocols >
Preamble : 8 bytesDestination Address : 6 bytesSource Address : 6 bytesEthernet Type : 2 bytes (Novell 0x81-37)Data Field : Between 46 and 1500 bytesPad Characters : Variable, stuffs data field up to 46 bytesFrame Check Sequence: 4 bytesMin Frame Length : 64 bytesMax Frame Length : 1518 bytes (not including Preamble)
Ethernet 802.3 (Raw)
Preamble : 8 bytesDestination Address : 6 bytesSource Address : 6 bytesLength Field : 2 bytes ------------------> followed by 0xFFFFData Field : Between 46 and 1500 bytesPad Characters : Variable, stuffs data field up to 46 bytesFrame Check Sequence: 4 bytesMin Frame Length : 64 bytes
Max Frame Length : 1518 bytes (not including Preamble)
Ethernet 802.3/802.2 IPX/SPX and FTAM >
Preamble : 8 bytesDestination Address : 6 bytesSource Address : 6 bytesLength Field : 2 bytesData Field : Between 46 and 1500 bytes (including LLC)Pad Characters : Variable, stuffs data field up to 46 bytesFrame Check Sequence: 4 bytesMin Frame Length : 64 bytesMax Frame Length : 1518 bytes (not including Preamble)
The LLC field consists of:
Destination Service Access Point (DSAP): 1 byte (NetWare 0xE0)
Source Service Access Point (SSAP) : 1 byte (NetWare 0xE0)
Control Field : 1 byte (NetWare 0x03)
Ethernet SNAP
Preamble : 8 bytes
Destination Address : 6 bytes
Source Address : 6 bytes
Length Field : 2 bytes
Data Field : Between 46 and 1500 bytes (including LLC)
Pad Characters : Variable, stuffs data field up to 46 bytes
Frame Check Sequence: 4 bytes
Min Frame Length : 64 bytes
Max Frame Length : 1518 bytes (not including Preamble)
The LLC field (the first eight bytes in the data field) consists of:
Destination Service Access Point (DSAP): 1 byte (0xAA)Source Service Access Point (SSAP) : 1 byte (0xAA)Control Field : 1 byte (NetWare 0x03)Organizational Code : 3 bytes (0x00-00-00)Ethernet Type : 2 bytes (NetWare 0x81-37)
那么如何区分这四个frames
1) Receive good frame.
2) Analyze frame. Perform the following steps, in order:
If the EtherType/Length value is greater than 0x05-DC (decimal
1500), then process the frame as Ethernet II. Any EtherType value
greater than 0x05-DC (such as 0x0800 for IP or 0x81-37 for NetWare
IPX/SPX) will be interpreted as an Ethernet II frame.
If the IPX header (0xFF-FF) follows the Length field, the frame is
interpreted as a 802.3 (Raw) frame with Netware IPX/SPX traffic.
Standard SSAP and DSAP values do not include hexadecimal FF, so the
802.3 (Raw) frame can be distinguished from LLC frames (Ethernet
SNAP, 802.2).
Next, the byte following the length field (DSAP) is examined. If the value is 0xAA, the frame is interpreted as a SNAP frame.
Otherwise, it is interpreted as a 802.2 frame.