Ethernet frame - Wikipedia
Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main pageContentsCurrent eventsRandom articleAbout WikipediaContact usDonate
Contribute
HelpLearn to editCommunity portalRecent changesUpload file
Search
Search
Create account
Log in
Personal tools
Create account Log in
Pages for logged out editors learn more
ContributionsTalk
Contents
move to sidebar
hide
(Top)
1Structure
Toggle Structure subsection
1.1Ethernet packet – physical layer
1.1.1Preamble and start frame delimiter
1.2Frame – data link layer
1.2.1Header
1.2.2Payload
1.2.3Frame check sequence
1.3End of frame – physical layer
1.4Interpacket gap – physical layer
2Types
Toggle Types subsection
2.1Ethernet II
2.2Novell raw IEEE 802.3
2.3IEEE 802.2 LLC
2.4IEEE 802.2 SNAP
3Maximum throughput
4Runt frames
5Notes
6References
7Further reading
Toggle the table of contents
Ethernet frame
12 languages
CatalàČeštinaDeutschEspañol한국어Bahasa IndonesiaItaliano日本語SvenskaTürkçeTiếng Việt中文
Edit links
ArticleTalk
English
ReadEditView history
Tools
Tools
move to sidebar
hide
Actions
ReadEditView history
General
What links hereRelated changesUpload fileSpecial pagesPermanent linkPage informationCite this pageGet shortened URLDownload QR codeWikidata item
Print/export
Download as PDFPrintable version
From Wikipedia, the free encyclopedia
Unit of data on an Ethernet network
Ethernet packet. The SFD (start frame delimiter) marks the end of the packet preamble. It is immediately followed by the Ethernet frame, which starts with the destination MAC address.[1]
In computer networking, an Ethernet frame is a data link layer protocol data unit and uses the underlying Ethernet physical layer transport mechanisms. In other words, a data unit on an Ethernet link transports an Ethernet frame as its payload.[2]
An Ethernet frame is preceded by a preamble and start frame delimiter (SFD), which are both part of the Ethernet packet at the physical layer. Each Ethernet frame starts with an Ethernet header, which contains destination and source MAC addresses as its first two fields. The middle section of the frame is payload data including any headers for other protocols (for example, Internet Protocol) carried in the frame. The frame ends with a frame check sequence (FCS), which is a 32-bit cyclic redundancy check used to detect any in-transit corruption of data.
Structure[edit]
See also: Physical Coding Sublayer
A data packet on the wire and the frame as its payload consist of binary data. Ethernet transmits data with the most-significant octet (byte) first; within each octet, however, the least-significant bit is transmitted first.[a]
The internal structure of an Ethernet frame is specified in IEEE 802.3.[2] The table below shows the complete Ethernet packet and the frame inside, as transmitted, for the payload size up to the MTU of 1500 octets.[b] Some implementations of Gigabit Ethernet and other higher-speed variants of Ethernet support larger frames, known as jumbo frames.
802.3 Ethernet packet and frame structure
Layer
Preamble
Start frame delimiter (SFD)
MAC destination
MAC source
802.1Q tag (optional)
Ethertype (Ethernet II) or length (IEEE 802.3)
Payload
Frame check sequence (32‑bit CRC)
Interpacket gap (IPG)
Length (octets)
7
1
6
6
(4)
2
42–1500[c]
4
12
Layer 2 Ethernet frame
(not part of the frame)
← 64–1522 octets →
(not part of the frame)
Layer 1 Ethernet packet & IPG
← 72–1530 octets →
← 12 octets →
The optional 802.1Q tag consumes additional space in the frame. Field sizes for this option are shown in brackets in the table above. IEEE 802.1ad (Q-in-Q) allows for multiple tags in each frame. This option is not illustrated here.
Ethernet packet – physical layer[edit]
Preamble and start frame delimiter[edit]
See also: Syncword
An Ethernet packet starts with a seven-octet (56-bit) preamble and one-octet (8-bit) start frame delimiter (SFD).[d] The preamble bit values alternate 1 and 0, allowing receivers to synchronize their clock at the bit-level with the transmitter. The preamble is followed by the SFD which ends with a 1 instead of 0, to break the bit pattern of the preamble and signal the start of the actual frame.[1]: section 4.2.5
Physical layer transceiver circuitry (PHY for short) is required to connect the Ethernet MAC to the physical medium. The connection between a PHY and MAC is independent of the physical medium and uses a bus from the media independent interface family (MII, GMII, RGMII, SGMII, XGMII). The preamble and SFD representation depends on the width of the bus:
Preamble and SFD representations as bits, decimal, bytes, and nibbles
Representation
56-bit (7-byte) Preamble
SFD byte
uncoded on-the-wire bit pattern transmitted from left to right (used by Ethernet variants transmitting serial bits instead of larger symbols)[1]: sections 4.2.5 and 3.2.2
10101010
10101010
10101010
10101010
10101010
10101010
10101010
10101011
decimal in Ethernet LSb-first ordering[1]: sections 3.2.2, 3.3 and 4.2.6
85
85
85
85
85
85
85
213
hexadecimal LSb-first bytes for 8-bit wide busses
(GMII bus for Gigabit Ethernet transceivers)
0x55
0x55
0x55
0x55
0x55
0x55
0x55
0xD5
hexadecimal LSb-first nibbles for 4-bit wide busses (MII bus for Fast Ethernet or RGMII for gigabit transceivers)
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0xD
The SFD is immediately followed by the destination MAC address, which is the first field in an Ethernet frame.
Frame – data link layer[edit]
Header[edit]
The header features destination and source MAC addresses (each six octets in length), the EtherType field and, optionally, an IEEE 802.1Q tag or IEEE 802.1ad tag.
The EtherType field is two octets long and it can be used for two different purposes. Values of 1500 and below mean that it is used to indicate the size of the payload in octets, while values of 1536 and above indicate that it is used as an EtherType, to indicate which protocol is encapsulated in the payload of the frame. When used as EtherType, the length of the frame is determined by the location of the interpacket gap and valid frame check sequence (FCS).
The IEEE 802.1Q tag or IEEE 802.1ad tag, if present, is a four-octet field that indicates virtual LAN (VLAN) membership and IEEE 802.1p priority. The first two octets of the tag are called the Tag Protocol IDentifier (TPID) and double as the EtherType field indicating that the frame is either 802.1Q or 802.1ad tagged. 802.1Q uses a TPID of 0x8100. 802.1ad uses a TPID of 0x88a8.
Payload[edit]
Payload is a variable-length field. Its minimum size is governed by a requirement for a minimum frame transmission of 64 octets (bytes).[e] With header and FCS taken into account, the minimum payload is 42 octets when an 802.1Q tag is present[f] and 46 octets when absent. When the actual payload is less than the minimum, padding octets are added accordingly. IEEE standards specify a maximum payload of 1500 octets. Non-standard jumbo frames allow for larger payloads on networks built to support them.
Frame check sequence[edit]
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. According to the standard, 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).
Per the standard, this computation is done using the left shifting CRC-32 (polynomial = 0x4C11DB7, initial CRC = 0xFFFFFFFF, CRC is post complemented, verify value = 0x38FB2284) algorithm. The standard states that data is transmitted least significant bit (bit 0) first, while the FCS is transmitted most significant bit (bit 31) first.[1]: section 3.2.9 An alternative is to calculate a CRC using the right shifting CRC-32 (polynomial = 0xEDB88320, initial CRC = 0xFFFFFFFF, CRC is post complemented, verify value = 0x2144DF1C), which will result in a CRC that is a bit reversal of the FCS, and transmit both data and the CRC least significant bit first, resulting in identical transmissions.
The standard states that the receiver should calculate a new FCS as data is received and then compare the received FCS with the FCS the receiver has calculated. An alternative is to calculate a CRC on both the received data and the FCS, which will result in a fixed non-zero "verify" value. (The result is non-zero because the CRC is post complemented during CRC generation). Since the data is received least significant bit first, and to avoid having to buffer octets of data, the receiver typically uses the right shifting CRC-32. This makes the "verify" value (sometimes called "magic check") 0x2144DF1C.[5]
However, hardware implementation of a logically right shifting CRC may use a left shifting Linear Feedback Shift Register as the basis for calculating the CRC, reversing the bits and resulting in a verify value of 0x38FB2284. Since the complementing of the CRC may be performed post calculation and during transmission, what remains in the hardware register is a non-complemented result, so the residue for a right shifting implementation would be the complement of 0x2144DF1C = 0xDEBB20E3, and for a left shifting implementation, the complement of 0x38FB2284 = 0xC704DD7B.
End of frame – physical layer[edit]
The end of a frame is usually indicated by the end-of-data-stream symbol 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. Later physical layers use an explicit end of data or end of stream symbol or sequence to avoid ambiguity, especially where the carrier is continually sent between frames; an example is Gigabit Ethernet with its 8b/10b encoding scheme that uses special symbols which are transmitted before and after a frame is transmitted.[6][7]
Interpacket gap – physical layer[edit]
Interpacket gap (IPG) 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.
Types[edit]
Ethernet frame differentiation
Frame type
Ethertype or length
Payload start two bytes
Ethernet II
≥ 1536
Any
Novell raw IEEE 802.3
≤ 1500
0xFFFF
IEEE 802.2 LLC
≤ 1500
Other
IEEE 802.2 SNAP
≤ 1500
0xAAAA
There are several types of Ethernet frames:
Ethernet II frame, or Ethernet Version 2,[g] or DIX frame is the most common type in use today, as it is often used directly by the Internet Protocol.
Novell raw IEEE 802.3 non-standard variation frame
IEEE 802.2 Logical Link Control (LLC) frame
IEEE 802.2 Subnetwork Access Protocol (SNAP) frame
The different frame types have different formats and MTU values, but can coexist on the same physical medium. Differentiation between frame types is possible based on the table on the right.
In addition, all four Ethernet frame types may optionally contain an IEEE 802.1Q tag to identify what VLAN it belongs to and its priority (quality of service). This encapsulation is defined in the IEEE 802.3ac specification and increases the maximum frame by 4 octets.
The IEEE 802.1Q tag, if present, is placed between the Source Address and the EtherType or Length fields. The first two octets of the tag are the Tag Protocol Identifier (TPID) value of 0x8100. This is located in the same place as the EtherType/Length field in untagged frames, so an EtherType value of 0x8100 means the frame is tagged, and the true EtherType/Length is located after the Q-tag. The TPID is followed by two octets containing the Tag Control Information (TCI) (the IEEE 802.1p priority (quality of service) and VLAN id). The Q-tag is followed by the rest of the frame, using one of the types described above.
Ethernet II[edit]
Ethernet II framing (also known as DIX Ethernet, named after DEC, Intel and Xerox, the major participants in its design[8]), defines the two-octet EtherType field in an Ethernet frame, preceded by destination and source MAC addresses, that identifies an upper layer protocol encapsulated by the frame data. Most notably, an EtherType value of 0x0800 indicates that the frame contains an IPv4 datagram, 0x0806 indicates an ARP datagram, and 0x86DD indicates an IPv6 datagram. See EtherType § Values for more.
The most common Ethernet frame format, type II
As this industry-developed standard went through a formal IEEE standardization process, the EtherType field was changed to a (data) length field in the new 802.3 standard.[h] Since the recipient still needs to know how to interpret the frame, the standard required an IEEE 802.2 header to follow the length and specify the type. Many years later, the 802.3x-1997 standard, and later versions of the 802.3 standard, formally approved of both types of framing. Ethernet II framing is the most common in Ethernet local area networks, due to its simplicity and lower overhead.
In order to allow some frames using Ethernet II framing and some using the original version of 802.3 framing to be used on the same Ethernet segment, EtherType values must be greater than or equal to 1536 (0x0600). That value was chosen because the maximum length of the payload field of an Ethernet 802.3 frame is 1500 octets (0x05DC). Thus if the field's value is greater than or equal to 1536, the frame must be an Ethernet II frame, with that field being a type field.[9] If it's less than or equal to 1500, it must be an IEEE 802.3 frame, with that field being a length field. Values between 1500 and 1536, exclusive, are undefined.[10] This convention allows software to determine whether a frame is an Ethernet II frame or an IEEE 802.3 frame, allowing the coexistence of both standards on the same physical medium.
Novell raw IEEE 802.3[edit]
Novell's "raw" 802.3 frame format was based on early IEEE 802.3 work. Novell used this as a starting point to create the first implementation of its own IPX Network Protocol over Ethernet. They did not use any LLC header but started the IPX packet directly after the length field. This does not conform to the IEEE 802.3 standard, but since IPX always has FF as the first two octets (while in IEEE 802.2 LLC that pattern is theoretically possible but extremely unlikely), in practice this usually coexists on the wire with other Ethernet implementations, with the notable exception of some early forms of DECnet which got confused by this.
Novell NetWare used this frame type by default until the mid-nineties, and since NetWare was then very widespread, while IP was not, at some point in time most of the world's Ethernet traffic ran over "raw" 802.3 carrying IPX. Since NetWare 4.10, NetWare defaults to IEEE 802.2 with LLC (NetWare Frame Type Ethernet_802.2) when using IPX.[11]
IEEE 802.2 LLC[edit]
Main article: IEEE 802.2
Some protocols, such as those designed for the OSI stack, operate directly on top of IEEE 802.2 LLC encapsulation, which provides both connection-oriented and connectionless network services.
IEEE 802.2 LLC encapsulation is not in widespread use on common networks currently, with the exception of large corporate NetWare installations that have not yet migrated to NetWare over IP. In the past, many corporate networks used IEEE 802.2 to support transparent translating bridges between Ethernet and Token Ring or FDDI networks.
There exists an Internet standard for encapsulating IPv4 traffic in IEEE 802.2 LLC SAP/SNAP frames.[12] It is almost never implemented on Ethernet, although it is used on FDDI, Token Ring, IEEE 802.11 (with the exception of the 5.9 GHz band, where it uses EtherType)[13] and other IEEE 802 LANs. IPv6 can also be transmitted over Ethernet using IEEE 802.2 LLC SAP/SNAP, but, again, that's almost never used.
IEEE 802.2 SNAP[edit]
Main article: Subnetwork Access Protocol
By examining the 802.2 LLC header, it is possible to determine whether it is followed by a SNAP header. The LLC header includes two eight-bit address fields, called service access points (SAPs) in OSI terminology; when both source and destination SAP are set to the value 0xAA, the LLC header is followed by a SNAP header. The SNAP header allows EtherType values to be used with all IEEE 802 protocols, as well as supporting private protocol ID spaces.
In IEEE 802.3x-1997, the IEEE Ethernet standard was changed to explicitly allow the use of the 16-bit field after the MAC addresses to be used as a length field or a type field.
The AppleTalk v2 protocol suite on Ethernet ("EtherTalk") uses IEEE 802.2 LLC + SNAP encapsulation.
Maximum throughput[edit]
We may calculate the protocol overhead for Ethernet as a percentage (packet size including IPG)
Protocol overhead
=
Packet size
−
Payload size
Packet size
{\displaystyle {\text{Protocol overhead}}={\frac {{\text{Packet size}}-{\text{Payload size}}}{\text{Packet size}}}}
We may calculate the protocol efficiency for Ethernet
Protocol efficiency
=
Payload size
Packet size
{\displaystyle {\text{Protocol efficiency}}={\frac {\text{Payload size}}{\text{Packet size}}}}
Maximum efficiency is achieved with largest allowed payload size and is:
1500
1538
=
97.53
%
{\displaystyle {\frac {1500}{1538}}=97.53\%}
for untagged frames, since the packet size is maximum 1500 octet payload + 8 octet preamble + 14 octet header + 4 octet trailer + minimum interpacket gap corresponding to 12 octets = 1538 octets. The maximum efficiency is:
1500
1542
=
97.28
%
{\displaystyle {\frac {1500}{1542}}=97.28\%}
when 802.1Q VLAN tagging is used.
The throughput may be calculated from the efficiency
Throughput
=
Efficiency
×
Net bit rate
{\displaystyle {\text{Throughput}}={\text{Efficiency}}\times {\text{Net bit rate}}\,\!}
,
where the physical layer net bit rate (the wire bit rate) depends on the Ethernet physical layer standard, and may be 10 Mbit/s, 100 Mbit/s, 1 Gbit/s or 10 Gbit/s. Maximum throughput for 100BASE-TX Ethernet is consequently 97.53 Mbit/s without 802.1Q, and 97.28 Mbit/s with 802.1Q.
Channel utilization is a concept often confused with protocol efficiency. It considers only the use of the channel disregarding the nature of the data transmitted – either payload or overhead. At the physical layer, the link channel and equipment do not know the difference between data and control frames. We may calculate the channel utilization:
Channel utilization
=
Time spent transmitting data
Total time
{\displaystyle {\text{Channel utilization}}={\frac {\text{Time spent transmitting data}}{\text{Total time}}}}
The total time considers the round trip time along the channel, the processing time in the hosts and the time transmitting data and acknowledgements. The time spent transmitting data includes data and acknowledgements.
Runt frames[edit]
A runt frame is an Ethernet frame that is less than the IEEE 802.3's minimum length of 64 octets. Runt frames are most commonly caused by collisions; other possible causes are a malfunctioning network card, buffer underrun, duplex mismatch or software issues.[14]
Notes[edit]
^ The frame check sequence (FCS) uses a different bit ordering.[3]
^ The bit patterns in the preamble and start of frame delimiter are written as bit strings, with the first bit transmitted on the left (not as octet values, which in Ethernet are transmitted least significant bit(s) first). This notation matches the one used in the IEEE 802.3 standard.
^ Payload can be 42 octets if an 802.1Q tag is present. Minimum is 46 octets without.
^ Preamble and start frame delimiter are not displayed by packet sniffing software because these bits are stripped away at OSI layer 1 by the network interface controller (NIC) before being passed on to the OSI layer 2, which is where packet sniffers collect their data. There are layer-2 sniffers that can capture and display the preamble and start frame delimiter, but they are expensive and mainly used to detect problems related to physical connectivity.
^ Minimum payload size is dictated by the 512-bit slot time used for collision detection in the Ethernet LAN architecture.
^ Both 42 and 46 octet minimums are valid when 802.1Q is present.[4]
^ A version 1 Ethernet frame was used for early Ethernet prototypes and featured 8-bit MAC addresses and was never commercially deployed.
^ Original Ethernet frames define their length with the framing that surrounds it, rather than with an explicit length count.
References[edit]
^ a b c d e 802.3-2018 – IEEE Standard for Ethernet. IEEE. 14 June 2018. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4.
^ a b "3.1.1 Packet format". 802.3-2018 – IEEE Standard for Ethernet. IEEE. 14 June 2018. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4.
^ 802.3-2018 – IEEE Standard for Ethernet. IEEE. 14 June 2018. Section 3.3 and annex 31A. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4. Opcodes are transmitted high-order octet first. Within each octet, bits are transmitted least-significant bit first. [...] Each octet of the MAC frame, with the exception of the FCS, is transmitted least significant bit first.
^ "Annex G". IEEE Standard for Local and metropolitan area networks--Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks. doi:10.1109/IEEESTD.2011.6009146. ISBN 978-0-7381-6708-4.
^ "Specification of CRC Routines V4.5.0 R4.1 Rev 3" (PDF). AUTOSAR. p. 24.
^ Charles E. Spurgeon (February 2000). Ethernet: The Definitive Guide. O'Reilly. pp. 41, 47. ISBN 9780596552824. Retrieved 30 June 2014.
^ "40.1.3.1 Physical Coding Sublayer (PCS)". 802.3-2018 – IEEE Standard for Ethernet. IEEE. 14 June 2018. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4.
^ Drew Heywood; Zubair Ahmad (2001). Drew Heywood's Windows 2000 Network Services. Sams. p. 53. ISBN 978-0-672-31741-5.
^ LAN MAN Standards Committee of the IEEE Computer Society (20 March 1997). IEEE Std 802.3x-1997 and IEEE Std 802.3y-1997. The Institute of Electrical and Electronics Engineers, Inc. pp. 28–31.
^ "3.2.6 Length/Type field". 802.3-2018 – IEEE Standard for Ethernet. 14 June 2018. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4.
^ Don Provan (17 September 1993). "Ethernet Framing". Newsgroup: comp.sys.novell. Usenet: 1993Sep17.190654.13335@novell.com. (HTML-formatted version Archived 18 April 2015 at the Wayback Machine) — a classic series of Usenet postings by Novell's Don Provan that have found their way into numerous FAQs and are widely considered the definitive answer to the Novell Frame Type usage.
^
A Standard for the Transmission of IP Datagrams over IEEE 802 Networks. Network Working Group of the IETF. February 1988. doi:10.17487/RFC1042. RFC 1042.
^ Computer Society, IEEE (2016). IEEE Std 802.11-2016: Part 11: Wireless LAN Medium Access Control IEEE (MAC) and Physical Layer (PHY) Specifications. New York, NY: IEEE. p. 249.
^
"Troubleshooting Ethernet". Cisco Systems. Retrieved 13 August 2016.
Further reading[edit]
Wikiversity has learning resources about Topic:Web Science/Part1: Foundations of the web/Internet Architecture/Ethernet
Video which explains how to build an Ethernet Frame
Minimum Frame Length in Ethernet explained
vteEthernet family of local area network technologiesSpeeds
10 Mbit/s
100 Mbit/s
1 Gbit/s
2.5 and 5 Gbit/s
10 Gbit/s
25 and 50 Gbit/s
40 and 100 Gbit/s
200, 400, 800 and 1600 Gbit/s
General
Physical layer
Autonegotiation
EtherType
Flow control
Frames
Jumbos
Organizations
IEEE 802.3
Ethernet Alliance
Media
Twisted pair
Coaxial
First mile
10G-EPON
Historic
CSMA/CD
StarLAN
10BROAD36
10BASE-FB
10BASE-FL
10BASE5
10BASE2
MAU
FOIRL
100BaseVG
LattisNet
Long Reach
Applications
Audio
Carrier
Data center
Energy Efficiency
Industrial
Metro
Power
Synchronous
Transceivers
GBIC
SFP/SFP+/QSFP/QSFP+/OSFP
XENPAK/X2
XFP
CFP
Interfaces
AUI
EAD
MDI
MII
GMII
XGMII
XAUI
Category
Commons
Retrieved from "https://en.wikipedia.org/w/index.php?title=Ethernet_frame&oldid=1211981089"
Category: EthernetHidden categories: Webarchive template wayback linksArticles with short descriptionShort description is different from WikidataUse dmy dates from March 2024Use American English from March 2019All Wikipedia articles written in American EnglishArticles containing video clips
This page was last edited on 5 March 2024, at 15:40 (UTC).
Text is available under the Creative Commons Attribution-ShareAlike License 4.0;
additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.
Privacy policy
About Wikipedia
Disclaimers
Contact Wikipedia
Code of Conduct
Developers
Statistics
Cookie statement
Mobile view
Toggle limited content width
以太网帧结构详解 - 知乎首发于网络协议详解切换模式写文章登录/注册以太网帧结构详解nwatch计算机的世界真是太精彩了!!!前言20世纪60年代以来,计算机网络得到了飞速发展。各大厂商和标准组织为了在数据通信网络领域占据主导地位,纷纷推出了各自的网络架构体系和标准,如IBM公司的SNA协议,Novell公司的IPX/SPX协议,以及广泛流行的OSI参考模型和TCP/IP协议。同时,各大厂商根据这些协议生产出了不同的硬件和软件。标准组织和厂商的共同努力促进了网络技术的快速发展和网络设备种类的迅速增长。网络通信中,“协议”和“标准”这两个词汇常常可以混用。同时,协议或标准本身又常常具有层次的特点。一般地,关注于逻辑数据关系的协议通常被称为上层协议,而关注于物理数据流的协议通常被称为低层协议。IEEE 802就是一套用来管理物理数据流在局域网中传输的标准,包括在局域网中传输物理数据的802.3以太网标准。还有一些用来管理物理数据流在使用串行介质的广域网中传输的标准,如帧中继FR(Frame Relay),高级数据链路控制HDLC(High-Level Data Link Control),异步传输模式ATM(Asynchronous Transfer Mode)。分层模型- OSI不同的协议栈用于定义和管理不同网络的数据转发规则。国际标准化组织ISO于1984年提出了OSI RM(Open System Interconnection Reference Model,开放系统互连参考模型)。OSI 参考模型很快成为了计算机网络通信的基础模型。OSI参考模型具有以下优点:简化了相关的网络操作;提供了不同厂商之间的兼容性;促进了标准化工作;结构上进行了分层;易于学习和操作。OSI参考模型各个层次的基本功能如下:1.物理层: 在设备之间传输比特流,规定了电平、速度和电缆针脚。2.数据链路层:将比特组合成字节,再将字节组合成帧,使用链路层地址(以太网使用MAC地址)来访问介质,并进行差错检测。3.网络层:提供逻辑地址,供路由器确定路径。4.传输层:提供面向连接或非面向连接的数据传递以及进行重传前的差错检测。5.会话层:负责建立、管理和终止表示层实体之间的通信会话。该层的通信由不同设备中的应用程序之间的服务请求和响应组成。6.表示层:提供各种用于应用层数据的编码和转换功能,确保一个系统的应用层发送的数据能被另一个系统的应用层识别。7.应用层:OSI参考模型中最靠近用户的一层,为应用程序提供网络服务。分层模型– TCP/IPTCP/IP模型同样采用了分层结构,层与层相对独立但是相互之间也具备非常密切的协作关系。TCP/IP模型将网络分为四层。TCP/IP模型不关注底层物理介质,主要关注终端之间的逻辑数据流转发。TCP/IP模型的核心是网络层和传输层:网络层解决网络之间的逻辑转发问题,传输层保证源端到目的端之间的可靠传输。最上层的应用层通过各种协议向终端用户提供业务应用。数据封装应用数据需要经过TCP/IP每一层处理之后才能通过网络传输到目的端,每一层上都使用该层的协议数据单元PDU(Protocol Data Unit)彼此交换信息。不同层的PDU中包含有不同的信息,因此PDU在不同层被赋予了不同的名称。如上层数据在传输层添加TCP报头后得到的PDU被称为Segment(数据段 )数据段被传递给网络层,网络层添加IP报头得到的PDU被称为Packet(数据包)数据包被传递到数据链路层,封装数据链路层报头得到的PDU被称为Frame(数据帧)最后,帧被转换为比特(物理层)通过网络介质传输。这种协议栈逐层向下传递数据,并添加报头和报尾的过程称为封装。终端之间的通信数据链路层控制数据帧在物理链路上传输。数据包在以太网物理介质上传播之前必须封装头部和尾部信息。封装后的数据包称为称为数据帧,数据帧中封装的信息决定了数据如何传输。以太网上传输的数据帧有两种格式,选择哪种格式由TCP/IP协议簇中的网络层决定。帧格式以太网上使用两种标准帧格式。第一种是上世纪80年代初提出的DIX v2格式,即Ethernet II帧格式。Ethernet II后来被IEEE 802标准接纳,并写进了IEEE 802.3x-1997的3.2.6节。第二种是1983年提出的IEEE 802.3格式。这两种格式的主要区别在于,Ethernet II格式中包含一个Type字段,标识以太帧处理完成之后将被发送到哪个上层协议进行处理。IEEE 802.3格式中,同样的位置是长度字段。不同的Type字段值可以用来区别这两种帧的类型当Type字段值小于等于1500(或者十六进制的0x05DC)时,帧使用的是IEEE 802.3格式。当Type字段值大于等于1536 (或者十六进制的0x0600)时,帧使用的是Ethernet II格式。以太网中大多数的数据帧使用的是Ethernet II格式。以太帧中还包括源和目的MAC地址,分别代表发送者的MAC和接收者的MAC,此外还有帧校验序列字段,用于检验传输过程中帧的完整性。Ethernet_II 帧格式Ethernet_II 帧类型值大于等于1536 (0x0600)以太网数据帧的长度在64-1518字节之间Ethernet_II的帧中各字段说明如下:DMAC(Destination MAC)是目的MAC地址。DMAC字段长度为6个字节,标识帧的接收者。SMAC(Source MAC)是源MAC地址。SMAC字段长度为6个字节,标识帧的发送者。类型字段(Type)用于标识数据字段中包含的高层协议,该字段长度为2个字节。类型字段取值为0x0800的帧代表IP协议帧;类型字段取值为0806的帧代表ARP协议帧。数据字段(Data)是网络层数据,最小长度必须为46字节以保证帧长至少为64字节,数据字段的最大长度为1500字节。循环冗余校验字段(FCS)提供了一种错误检测机制。该字段长度为4个字节。IEEE802.3 帧格式IEEE 802.3 帧长度字段值小于等于1500 (0x05DC)IEEE 802.3帧格式类似于Ethernet_II帧,只是Ethernet_II帧的Type域被802.3帧的Length域取代,并且占用了Data字段的8个字节作为LLC和SNAP字段。Length字段定义了Data字段包含的字节数。逻辑链路控制LLC(Logical Link Control)由目的服务访问点DSAP(Destination Service Access Point)、源服务访问点SSAP(Source Service Access Point)和Control字段组成。SNAP(Sub-network Access Protocol)由机构代码(Org Code)和类型(Type)字段组成。Org code三个字节都为0。Type字段的含义与Ethernet_II帧中的Type字段相同。IEEE802.3帧根据DSAP和SSAP字段的取值又可分为以下几类:当DSAP和SSAP都取特定值0xff时,802.3帧就变成了Netware-ETHERNET帧,用来承载NetWare类型的数据。当DSAP和SSAP都取特定值0xaa时,802.3帧就变成了ETHERNET_SNAP帧。ETHERNET_SNAP帧可以用于传输多种协议。DSAP和SSAP其他的取值均为纯IEEE802.3帧。数据帧传输数据链路层基于MAC地址进行帧的传输以太网在二层链路上通过MAC地址来唯一标识网络设备,并且实现局域网上网络设备之间的通信。MAC地址也叫物理地址,大多数网卡厂商把MAC地址烧入了网卡的ROM中。发送端使用接收端的MAC地址作为目的地址。以太帧封装完成后会通过物理层转换成比特流在物理介质上传输。以太网的MAC地址MAC地址由两部分组成,分别是供应商代码和序列号。其中前24位代表该供应商代码,由IEEE管理和分配。剩下的24位序列号由厂商自己分配。如同每一个人都有一个名字一样,每一台网络设备都用物理地址来标识自己,这个地址就是MAC地址。网络设备的MAC地址是全球唯一的。MAC地址长度为48比特,通常用十六进制表示。MAC地址包含两部分:前24比特是组织唯一标识符(OUI,Organizationally Unique Identifier),由IEEE统一分配给设备制造商。例如,华为的网络产品的MAC地址前24比特是0x00e0fc。后24位序列号是厂商分配给每个产品的唯一数值,由各个厂商自行分配(这里所说的产品可以是网卡或者其他需要MAC地址的设备)。数据帧的发送和接收单播局域网上的帧可以通过三种方式发送。第一种是单播,指从单一的源端发送到单一的目的端。每个主机接口由一个MAC地址唯一标识,MAC地址的OUI中,第一字节第8个比特表示地址类型。对于主机MAC地址,这个比特固定为0,表示目的MAC地址为此MAC地址的帧都是发送到某个唯一的目的端。在冲突域中,所有主机都能收到源主机发送的单播帧,但是其他主机发现目的地址与本地MAC地址不一致后会丢弃收到的帧,只有真正的目的主机才会接收并处理收到的帧。广播第二种发送方式是广播,表示帧从单一的源发送到共享以太网上的所有主机。广播帧的目的MAC地址为十六进制的FF:FF:FF:FF:FF:FF,所有收到该广播帧的主机都要接收并处理这个帧。广播方式会产生大量流量,导致带宽利用率降低,进而影响整个网络的性能。当需要网络中的所有主机都能接收到相同的信息并进行处理的情况下,通常会使用广播方式。组播第三种发送方式为组播,组播比广播更加高效。组播转发可以理解为选择性的广播,主机侦听特定组播地址,接收并处理目的MAC地址为该组播MAC地址的帧。组播MAC地址和单播MAC地址是通过第一字节中的第8个比特区分的。组播MAC地址的第8个比特为1,而单播MAC地址的第8个比特为0。当需要网络上的一组主机(而不是全部主机)接收相同信息,并且其他主机不受影响的情况下,通常会使用组播方式。发送与接收当主机接收到的数据帧所包含的目的MAC地址是自己时,会把以太网封装剥掉后送往上层协议。帧从主机的物理接口发送出来后,通过传输介质传输到目的端。共享网络中,这个帧可能到达多个主机。主机检查帧头中的目的MAC地址,如果目的MAC地址不是本机MAC地址,也不是本机侦听的组播或广播MAC地址,则主机会丢弃收到的帧。如果目的MAC地址是本机MAC地址,则接收该帧,检查帧校验序列(FCS)字段,并与本机计算的值对比来确定帧在传输过程中是否保持了完整性。如果帧的FCS值与本机计算的值不同,主机会认为帧已被破坏,并会丢弃该帧。如果该帧通过了FCS校验,则主机会根据帧头部中的Type字段来确定将帧发送给上层哪个协议处理。实际数据包分析:ARP类型数据包其他类型数据包:原文链接;以太网帧结构详解_曌赟的博客-CSDN博客发布于 2020-10-12 11:16计算机网络网络通信数据通信赞同 531 条评论分享喜欢收藏申请转载文章被以下专栏收录网络协议详解网络协
Ethernet frame - Wikipedia
Jump to content
Main menu
Main menu
move to sidebar
hide
Navigation
Main pageContentsCurrent eventsRandom articleAbout WikipediaContact usDonate
Contribute
HelpLearn to editCommunity portalRecent changesUpload file
Search
Search
Create account
Log in
Personal tools
Create account Log in
Pages for logged out editors learn more
ContributionsTalk
Contents
move to sidebar
hide
(Top)
1Structure
Toggle Structure subsection
1.1Ethernet packet – physical layer
1.1.1Preamble and start frame delimiter
1.2Frame – data link layer
1.2.1Header
1.2.2Payload
1.2.3Frame check sequence
1.3End of frame – physical layer
1.4Interpacket gap – physical layer
2Types
Toggle Types subsection
2.1Ethernet II
2.2Novell raw IEEE 802.3
2.3IEEE 802.2 LLC
2.4IEEE 802.2 SNAP
3Maximum throughput
4Runt frames
5Notes
6References
7Further reading
Toggle the table of contents
Ethernet frame
12 languages
CatalàČeštinaDeutschEspañol한국어Bahasa IndonesiaItaliano日本語SvenskaTürkçeTiếng Việt中文
Edit links
ArticleTalk
English
ReadEditView history
Tools
Tools
move to sidebar
hide
Actions
ReadEditView history
General
What links hereRelated changesUpload fileSpecial pagesPermanent linkPage informationCite this pageGet shortened URLDownload QR codeWikidata item
Print/export
Download as PDFPrintable version
From Wikipedia, the free encyclopedia
Unit of data on an Ethernet network
Ethernet packet. The SFD (start frame delimiter) marks the end of the packet preamble. It is immediately followed by the Ethernet frame, which starts with the destination MAC address.[1]
In computer networking, an Ethernet frame is a data link layer protocol data unit and uses the underlying Ethernet physical layer transport mechanisms. In other words, a data unit on an Ethernet link transports an Ethernet frame as its payload.[2]
An Ethernet frame is preceded by a preamble and start frame delimiter (SFD), which are both part of the Ethernet packet at the physical layer. Each Ethernet frame starts with an Ethernet header, which contains destination and source MAC addresses as its first two fields. The middle section of the frame is payload data including any headers for other protocols (for example, Internet Protocol) carried in the frame. The frame ends with a frame check sequence (FCS), which is a 32-bit cyclic redundancy check used to detect any in-transit corruption of data.
Structure[edit]
See also: Physical Coding Sublayer
A data packet on the wire and the frame as its payload consist of binary data. Ethernet transmits data with the most-significant octet (byte) first; within each octet, however, the least-significant bit is transmitted first.[a]
The internal structure of an Ethernet frame is specified in IEEE 802.3.[2] The table below shows the complete Ethernet packet and the frame inside, as transmitted, for the payload size up to the MTU of 1500 octets.[b] Some implementations of Gigabit Ethernet and other higher-speed variants of Ethernet support larger frames, known as jumbo frames.
802.3 Ethernet packet and frame structure
Layer
Preamble
Start frame delimiter (SFD)
MAC destination
MAC source
802.1Q tag (optional)
Ethertype (Ethernet II) or length (IEEE 802.3)
Payload
Frame check sequence (32‑bit CRC)
Interpacket gap (IPG)
Length (octets)
7
1
6
6
(4)
2
42–1500[c]
4
12
Layer 2 Ethernet frame
(not part of the frame)
← 64–1522 octets →
(not part of the frame)
Layer 1 Ethernet packet & IPG
← 72–1530 octets →
← 12 octets →
The optional 802.1Q tag consumes additional space in the frame. Field sizes for this option are shown in brackets in the table above. IEEE 802.1ad (Q-in-Q) allows for multiple tags in each frame. This option is not illustrated here.
Ethernet packet – physical layer[edit]
Preamble and start frame delimiter[edit]
See also: Syncword
An Ethernet packet starts with a seven-octet (56-bit) preamble and one-octet (8-bit) start frame delimiter (SFD).[d] The preamble bit values alternate 1 and 0, allowing receivers to synchronize their clock at the bit-level with the transmitter. The preamble is followed by the SFD which ends with a 1 instead of 0, to break the bit pattern of the preamble and signal the start of the actual frame.[1]: section 4.2.5
Physical layer transceiver circuitry (PHY for short) is required to connect the Ethernet MAC to the physical medium. The connection between a PHY and MAC is independent of the physical medium and uses a bus from the media independent interface family (MII, GMII, RGMII, SGMII, XGMII). The preamble and SFD representation depends on the width of the bus:
Preamble and SFD representations as bits, decimal, bytes, and nibbles
Representation
56-bit (7-byte) Preamble
SFD byte
uncoded on-the-wire bit pattern transmitted from left to right (used by Ethernet variants transmitting serial bits instead of larger symbols)[1]: sections 4.2.5 and 3.2.2
10101010
10101010
10101010
10101010
10101010
10101010
10101010
10101011
decimal in Ethernet LSb-first ordering[1]: sections 3.2.2, 3.3 and 4.2.6
85
85
85
85
85
85
85
213
hexadecimal LSb-first bytes for 8-bit wide busses
(GMII bus for Gigabit Ethernet transceivers)
0x55
0x55
0x55
0x55
0x55
0x55
0x55
0xD5
hexadecimal LSb-first nibbles for 4-bit wide busses (MII bus for Fast Ethernet or RGMII for gigabit transceivers)
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0x5
0xD
The SFD is immediately followed by the destination MAC address, which is the first field in an Ethernet frame.
Frame – data link layer[edit]
Header[edit]
The header features destination and source MAC addresses (each six octets in length), the EtherType field and, optionally, an IEEE 802.1Q tag or IEEE 802.1ad tag.
The EtherType field is two octets long and it can be used for two different purposes. Values of 1500 and below mean that it is used to indicate the size of the payload in octets, while values of 1536 and above indicate that it is used as an EtherType, to indicate which protocol is encapsulated in the payload of the frame. When used as EtherType, the length of the frame is determined by the location of the interpacket gap and valid frame check sequence (FCS).
The IEEE 802.1Q tag or IEEE 802.1ad tag, if present, is a four-octet field that indicates virtual LAN (VLAN) membership and IEEE 802.1p priority. The first two octets of the tag are called the Tag Protocol IDentifier (TPID) and double as the EtherType field indicating that the frame is either 802.1Q or 802.1ad tagged. 802.1Q uses a TPID of 0x8100. 802.1ad uses a TPID of 0x88a8.
Payload[edit]
Payload is a variable-length field. Its minimum size is governed by a requirement for a minimum frame transmission of 64 octets (bytes).[e] With header and FCS taken into account, the minimum payload is 42 octets when an 802.1Q tag is present[f] and 46 octets when absent. When the actual payload is less than the minimum, padding octets are added accordingly. IEEE standards specify a maximum payload of 1500 octets. Non-standard jumbo frames allow for larger payloads on networks built to support them.
Frame check sequence[edit]
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. According to the standard, 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).
Per the standard, this computation is done using the left shifting CRC-32 (polynomial = 0x4C11DB7, initial CRC = 0xFFFFFFFF, CRC is post complemented, verify value = 0x38FB2284) algorithm. The standard states that data is transmitted least significant bit (bit 0) first, while the FCS is transmitted most significant bit (bit 31) first.[1]: section 3.2.9 An alternative is to calculate a CRC using the right shifting CRC-32 (polynomial = 0xEDB88320, initial CRC = 0xFFFFFFFF, CRC is post complemented, verify value = 0x2144DF1C), which will result in a CRC that is a bit reversal of the FCS, and transmit both data and the CRC least significant bit first, resulting in identical transmissions.
The standard states that the receiver should calculate a new FCS as data is received and then compare the received FCS with the FCS the receiver has calculated. An alternative is to calculate a CRC on both the received data and the FCS, which will result in a fixed non-zero "verify" value. (The result is non-zero because the CRC is post complemented during CRC generation). Since the data is received least significant bit first, and to avoid having to buffer octets of data, the receiver typically uses the right shifting CRC-32. This makes the "verify" value (sometimes called "magic check") 0x2144DF1C.[5]
However, hardware implementation of a logically right shifting CRC may use a left shifting Linear Feedback Shift Register as the basis for calculating the CRC, reversing the bits and resulting in a verify value of 0x38FB2284. Since the complementing of the CRC may be performed post calculation and during transmission, what remains in the hardware register is a non-complemented result, so the residue for a right shifting implementation would be the complement of 0x2144DF1C = 0xDEBB20E3, and for a left shifting implementation, the complement of 0x38FB2284 = 0xC704DD7B.
End of frame – physical layer[edit]
The end of a frame is usually indicated by the end-of-data-stream symbol 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. Later physical layers use an explicit end of data or end of stream symbol or sequence to avoid ambiguity, especially where the carrier is continually sent between frames; an example is Gigabit Ethernet with its 8b/10b encoding scheme that uses special symbols which are transmitted before and after a frame is transmitted.[6][7]
Interpacket gap – physical layer[edit]
Interpacket gap (IPG) 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.
Types[edit]
Ethernet frame differentiation
Frame type
Ethertype or length
Payload start two bytes
Ethernet II
≥ 1536
Any
Novell raw IEEE 802.3
≤ 1500
0xFFFF
IEEE 802.2 LLC
≤ 1500
Other
IEEE 802.2 SNAP
≤ 1500
0xAAAA
There are several types of Ethernet frames:
Ethernet II frame, or Ethernet Version 2,[g] or DIX frame is the most common type in use today, as it is often used directly by the Internet Protocol.
Novell raw IEEE 802.3 non-standard variation frame
IEEE 802.2 Logical Link Control (LLC) frame
IEEE 802.2 Subnetwork Access Protocol (SNAP) frame
The different frame types have different formats and MTU values, but can coexist on the same physical medium. Differentiation between frame types is possible based on the table on the right.
In addition, all four Ethernet frame types may optionally contain an IEEE 802.1Q tag to identify what VLAN it belongs to and its priority (quality of service). This encapsulation is defined in the IEEE 802.3ac specification and increases the maximum frame by 4 octets.
The IEEE 802.1Q tag, if present, is placed between the Source Address and the EtherType or Length fields. The first two octets of the tag are the Tag Protocol Identifier (TPID) value of 0x8100. This is located in the same place as the EtherType/Length field in untagged frames, so an EtherType value of 0x8100 means the frame is tagged, and the true EtherType/Length is located after the Q-tag. The TPID is followed by two octets containing the Tag Control Information (TCI) (the IEEE 802.1p priority (quality of service) and VLAN id). The Q-tag is followed by the rest of the frame, using one of the types described above.
Ethernet II[edit]
Ethernet II framing (also known as DIX Ethernet, named after DEC, Intel and Xerox, the major participants in its design[8]), defines the two-octet EtherType field in an Ethernet frame, preceded by destination and source MAC addresses, that identifies an upper layer protocol encapsulated by the frame data. Most notably, an EtherType value of 0x0800 indicates that the frame contains an IPv4 datagram, 0x0806 indicates an ARP datagram, and 0x86DD indicates an IPv6 datagram. See EtherType § Values for more.
The most common Ethernet frame format, type II
As this industry-developed standard went through a formal IEEE standardization process, the EtherType field was changed to a (data) length field in the new 802.3 standard.[h] Since the recipient still needs to know how to interpret the frame, the standard required an IEEE 802.2 header to follow the length and specify the type. Many years later, the 802.3x-1997 standard, and later versions of the 802.3 standard, formally approved of both types of framing. Ethernet II framing is the most common in Ethernet local area networks, due to its simplicity and lower overhead.
In order to allow some frames using Ethernet II framing and some using the original version of 802.3 framing to be used on the same Ethernet segment, EtherType values must be greater than or equal to 1536 (0x0600). That value was chosen because the maximum length of the payload field of an Ethernet 802.3 frame is 1500 octets (0x05DC). Thus if the field's value is greater than or equal to 1536, the frame must be an Ethernet II frame, with that field being a type field.[9] If it's less than or equal to 1500, it must be an IEEE 802.3 frame, with that field being a length field. Values between 1500 and 1536, exclusive, are undefined.[10] This convention allows software to determine whether a frame is an Ethernet II frame or an IEEE 802.3 frame, allowing the coexistence of both standards on the same physical medium.
Novell raw IEEE 802.3[edit]
Novell's "raw" 802.3 frame format was based on early IEEE 802.3 work. Novell used this as a starting point to create the first implementation of its own IPX Network Protocol over Ethernet. They did not use any LLC header but started the IPX packet directly after the length field. This does not conform to the IEEE 802.3 standard, but since IPX always has FF as the first two octets (while in IEEE 802.2 LLC that pattern is theoretically possible but extremely unlikely), in practice this usually coexists on the wire with other Ethernet implementations, with the notable exception of some early forms of DECnet which got confused by this.
Novell NetWare used this frame type by default until the mid-nineties, and since NetWare was then very widespread, while IP was not, at some point in time most of the world's Ethernet traffic ran over "raw" 802.3 carrying IPX. Since NetWare 4.10, NetWare defaults to IEEE 802.2 with LLC (NetWare Frame Type Ethernet_802.2) when using IPX.[11]
IEEE 802.2 LLC[edit]
Main article: IEEE 802.2
Some protocols, such as those designed for the OSI stack, operate directly on top of IEEE 802.2 LLC encapsulation, which provides both connection-oriented and connectionless network services.
IEEE 802.2 LLC encapsulation is not in widespread use on common networks currently, with the exception of large corporate NetWare installations that have not yet migrated to NetWare over IP. In the past, many corporate networks used IEEE 802.2 to support transparent translating bridges between Ethernet and Token Ring or FDDI networks.
There exists an Internet standard for encapsulating IPv4 traffic in IEEE 802.2 LLC SAP/SNAP frames.[12] It is almost never implemented on Ethernet, although it is used on FDDI, Token Ring, IEEE 802.11 (with the exception of the 5.9 GHz band, where it uses EtherType)[13] and other IEEE 802 LANs. IPv6 can also be transmitted over Ethernet using IEEE 802.2 LLC SAP/SNAP, but, again, that's almost never used.
IEEE 802.2 SNAP[edit]
Main article: Subnetwork Access Protocol
By examining the 802.2 LLC header, it is possible to determine whether it is followed by a SNAP header. The LLC header includes two eight-bit address fields, called service access points (SAPs) in OSI terminology; when both source and destination SAP are set to the value 0xAA, the LLC header is followed by a SNAP header. The SNAP header allows EtherType values to be used with all IEEE 802 protocols, as well as supporting private protocol ID spaces.
In IEEE 802.3x-1997, the IEEE Ethernet standard was changed to explicitly allow the use of the 16-bit field after the MAC addresses to be used as a length field or a type field.
The AppleTalk v2 protocol suite on Ethernet ("EtherTalk") uses IEEE 802.2 LLC + SNAP encapsulation.
Maximum throughput[edit]
We may calculate the protocol overhead for Ethernet as a percentage (packet size including IPG)
Protocol overhead
=
Packet size
−
Payload size
Packet size
{\displaystyle {\text{Protocol overhead}}={\frac {{\text{Packet size}}-{\text{Payload size}}}{\text{Packet size}}}}
We may calculate the protocol efficiency for Ethernet
Protocol efficiency
=
Payload size
Packet size
{\displaystyle {\text{Protocol efficiency}}={\frac {\text{Payload size}}{\text{Packet size}}}}
Maximum efficiency is achieved with largest allowed payload size and is:
1500
1538
=
97.53
%
{\displaystyle {\frac {1500}{1538}}=97.53\%}
for untagged frames, since the packet size is maximum 1500 octet payload + 8 octet preamble + 14 octet header + 4 octet trailer + minimum interpacket gap corresponding to 12 octets = 1538 octets. The maximum efficiency is:
1500
1542
=
97.28
%
{\displaystyle {\frac {1500}{1542}}=97.28\%}
when 802.1Q VLAN tagging is used.
The throughput may be calculated from the efficiency
Throughput
=
Efficiency
×
Net bit rate
{\displaystyle {\text{Throughput}}={\text{Efficiency}}\times {\text{Net bit rate}}\,\!}
,
where the physical layer net bit rate (the wire bit rate) depends on the Ethernet physical layer standard, and may be 10 Mbit/s, 100 Mbit/s, 1 Gbit/s or 10 Gbit/s. Maximum throughput for 100BASE-TX Ethernet is consequently 97.53 Mbit/s without 802.1Q, and 97.28 Mbit/s with 802.1Q.
Channel utilization is a concept often confused with protocol efficiency. It considers only the use of the channel disregarding the nature of the data transmitted – either payload or overhead. At the physical layer, the link channel and equipment do not know the difference between data and control frames. We may calculate the channel utilization:
Channel utilization
=
Time spent transmitting data
Total time
{\displaystyle {\text{Channel utilization}}={\frac {\text{Time spent transmitting data}}{\text{Total time}}}}
The total time considers the round trip time along the channel, the processing time in the hosts and the time transmitting data and acknowledgements. The time spent transmitting data includes data and acknowledgements.
Runt frames[edit]
A runt frame is an Ethernet frame that is less than the IEEE 802.3's minimum length of 64 octets. Runt frames are most commonly caused by collisions; other possible causes are a malfunctioning network card, buffer underrun, duplex mismatch or software issues.[14]
Notes[edit]
^ The frame check sequence (FCS) uses a different bit ordering.[3]
^ The bit patterns in the preamble and start of frame delimiter are written as bit strings, with the first bit transmitted on the left (not as octet values, which in Ethernet are transmitted least significant bit(s) first). This notation matches the one used in the IEEE 802.3 standard.
^ Payload can be 42 octets if an 802.1Q tag is present. Minimum is 46 octets without.
^ Preamble and start frame delimiter are not displayed by packet sniffing software because these bits are stripped away at OSI layer 1 by the network interface controller (NIC) before being passed on to the OSI layer 2, which is where packet sniffers collect their data. There are layer-2 sniffers that can capture and display the preamble and start frame delimiter, but they are expensive and mainly used to detect problems related to physical connectivity.
^ Minimum payload size is dictated by the 512-bit slot time used for collision detection in the Ethernet LAN architecture.
^ Both 42 and 46 octet minimums are valid when 802.1Q is present.[4]
^ A version 1 Ethernet frame was used for early Ethernet prototypes and featured 8-bit MAC addresses and was never commercially deployed.
^ Original Ethernet frames define their length with the framing that surrounds it, rather than with an explicit length count.
References[edit]
^ a b c d e 802.3-2018 – IEEE Standard for Ethernet. IEEE. 14 June 2018. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4.
^ a b "3.1.1 Packet format". 802.3-2018 – IEEE Standard for Ethernet. IEEE. 14 June 2018. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4.
^ 802.3-2018 – IEEE Standard for Ethernet. IEEE. 14 June 2018. Section 3.3 and annex 31A. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4. Opcodes are transmitted high-order octet first. Within each octet, bits are transmitted least-significant bit first. [...] Each octet of the MAC frame, with the exception of the FCS, is transmitted least significant bit first.
^ "Annex G". IEEE Standard for Local and metropolitan area networks--Media Access Control (MAC) Bridges and Virtual Bridged Local Area Networks. doi:10.1109/IEEESTD.2011.6009146. ISBN 978-0-7381-6708-4.
^ "Specification of CRC Routines V4.5.0 R4.1 Rev 3" (PDF). AUTOSAR. p. 24.
^ Charles E. Spurgeon (February 2000). Ethernet: The Definitive Guide. O'Reilly. pp. 41, 47. ISBN 9780596552824. Retrieved 30 June 2014.
^ "40.1.3.1 Physical Coding Sublayer (PCS)". 802.3-2018 – IEEE Standard for Ethernet. IEEE. 14 June 2018. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4.
^ Drew Heywood; Zubair Ahmad (2001). Drew Heywood's Windows 2000 Network Services. Sams. p. 53. ISBN 978-0-672-31741-5.
^ LAN MAN Standards Committee of the IEEE Computer Society (20 March 1997). IEEE Std 802.3x-1997 and IEEE Std 802.3y-1997. The Institute of Electrical and Electronics Engineers, Inc. pp. 28–31.
^ "3.2.6 Length/Type field". 802.3-2018 – IEEE Standard for Ethernet. 14 June 2018. doi:10.1109/IEEESTD.2018.8457469. ISBN 978-1-5044-5090-4.
^ Don Provan (17 September 1993). "Ethernet Framing". Newsgroup: comp.sys.novell. Usenet: 1993Sep17.190654.13335@novell.com. (HTML-formatted version Archived 18 April 2015 at the Wayback Machine) — a classic series of Usenet postings by Novell's Don Provan that have found their way into numerous FAQs and are widely considered the definitive answer to the Novell Frame Type usage.
^
A Standard for the Transmission of IP Datagrams over IEEE 802 Networks. Network Working Group of the IETF. February 1988. doi:10.17487/RFC1042. RFC 1042.
^ Computer Society, IEEE (2016). IEEE Std 802.11-2016: Part 11: Wireless LAN Medium Access Control IEEE (MAC) and Physical Layer (PHY) Specifications. New York, NY: IEEE. p. 249.
^
"Troubleshooting Ethernet". Cisco Systems. Retrieved 13 August 2016.
Further reading[edit]
Wikiversity has learning resources about Topic:Web Science/Part1: Foundations of the web/Internet Architecture/Ethernet
Video which explains how to build an Ethernet Frame
Minimum Frame Length in Ethernet explained
vteEthernet family of local area network technologiesSpeeds
10 Mbit/s
100 Mbit/s
1 Gbit/s
2.5 and 5 Gbit/s
10 Gbit/s
25 and 50 Gbit/s
40 and 100 Gbit/s
200, 400, 800 and 1600 Gbit/s
General
Physical layer
Autonegotiation
EtherType
Flow control
Frames
Jumbos
Organizations
IEEE 802.3
Ethernet Alliance
Media
Twisted pair
Coaxial
First mile
10G-EPON
Historic
CSMA/CD
StarLAN
10BROAD36
10BASE-FB
10BASE-FL
10BASE5
10BASE2
MAU
FOIRL
100BaseVG
LattisNet
Long Reach
Applications
Audio
Carrier
Data center
Energy Efficiency
Industrial
Metro
Power
Synchronous
Transceivers
GBIC
SFP/SFP+/QSFP/QSFP+/OSFP
XENPAK/X2
XFP
CFP
Interfaces
AUI
EAD
MDI
MII
GMII
XGMII
XAUI
Category
Commons
Retrieved from "https://en.wikipedia.org/w/index.php?title=Ethernet_frame&oldid=1211981089"
Category: EthernetHidden categories: Webarchive template wayback linksArticles with short descriptionShort description is different from WikidataUse dmy dates from March 2024Use American English from March 2019All Wikipedia articles written in American EnglishArticles containing video clips
This page was last edited on 5 March 2024, at 15:40 (UTC).
Text is available under the Creative Commons Attribution-ShareAlike License 4.0;
additional terms may apply. By using this site, you agree to the Terms of Use and Privacy Policy. Wikipedia® is a registered trademark of the Wikimedia Foundation, Inc., a non-profit organization.
Privacy policy
About Wikipedia
Disclaimers
Contact Wikipedia
Code of Conduct
Developers
Statistics
Cookie statement
Mobile view
Toggle limited content width
21.2 二层网络 --- Ethernet - 知乎首发于MIT6.S081 操作系统工程中文翻译切换模式写文章登录/注册21.2 二层网络 --- Ethernet肖宏辉网络/OpenStack/SDN/NFV搬运工让我从最底层开始,我们先来看一下一个以太网packet的结构是什么。当两个主机非常靠近时,或许是通过相同的线缆连接,或许连接在同一个wifi网络,或许连接到同一个以太网交换机。当局域网中的两个主机彼此间要通信时,最底层的协议是以太网协议。你可以认为Host1通过以太网将Frame发送给Host2。Frame是以太网中用来描述packet的单词,本质上这就是两个主机在以太网上传输的一个个的数据Byte。以太网协议会在Frame中放入足够的信息让主机能够识别彼此,并且识别这是不是发送给自己的Frame。每个以太网packet在最开始都有一个Header,其中包含了3个数据。Header之后才是payload数据。Header中的3个数据是:目的以太网地址,源以太网地址,以及packet的类型。每一个以太网地址都是48bit的数字,这个数字唯一识别了一个网卡。packet的类型会告诉接收端的主机该如何处理这个packet。接收端主机侧更高层级的网络协议会按照packet的类型检查并处理以太网packet中的payload。整个以太网packet,包括了48bit+48bit的以太网地址,16bit的类型,以及任意长度的payload这些都是通过线路传输。除此之外,虽然对于软件来说是不可见的,但是在packet的开头还有被硬件识别的表明packet起始的数据(注,Preamble + SFD),在packet的结束位置还有几个bit表明packet的结束(注,FCS)。packet的开头和结束的标志不会被系统内核所看到,其他的部分会从网卡送到系统内核。如果你们查看了这门课程的最后一个lab,你们可以发现我们提供的代码里面包括了一些新的文件,其中包括了kernel/net.h,这个文件中包含了大量不同网络协议的packet header的定义。上图中的代码包含了以太网协议的定义。我们提供的代码使用了这里结构体的定义来解析收到的以太网packet,进而获得目的地址和类型值(注,实际中只需要对收到的raw data指针强制类型转换成结构体指针就可以完成解析)。学生提问:硬件用来识别以太网packet的开头和结束的标志是不是类似于lab中的End of Packets?Robert教授:并不是的,EOP是帮助驱动和网卡之间通信的机制。这里的开头和结束的标志是在线缆中传输的电信号或者光信号,这些标志位通常在一个packet中是不可能出现的。以结束的FCS为例,它的值通常是packet header和payload的校验和,可以用来判断packet是否合法。有关以太网48bit地址,是为了给每一个制造出来的网卡分配一个唯一的ID,所以这里有大量的可用数字。这里48bit地址中,前24bit表示的是制造商,每个网卡制造商都有自己唯一的编号,并且会出现在前24bit中。后24bit是由网卡制造商提供的任意唯一数字,通常网卡制造商是递增的分配数字。所以,如果你从一个网卡制造商买了一批网卡,每个网卡都会被写入属于自己的地址,并且如果你查看这些地址,你可以发现,这批网卡的高24bit是一样的,而低24bit极有可能是一些连续的数字。虽然以太网地址是唯一的,但是出了局域网,它们对于定位目的主机的位置是没有帮助的。如果网络通信的目的主机在同一个局域网,那么目的主机会监听发给自己的地址的packet。但是如果网络通信发生在两个国家的主机之间,你需要使用一个不同的寻址方法,这就是IP地址的作用。在实际中,你可以使用tcpdump来查看以太网packet。这将会是lab的一部分。下图是tcpdump的一个输出:tcpdump输出了很多信息,其中包括:接收packet的时间第一行的剩下部分是可读的packet的数据接下来的3行是收到packet的16进制数如果按照前面以太网header的格式,可以发现packet中:前48bit是一个广播地址,0xffffffffffff。广播地址是指packet需要发送给局域网中的所有主机。之后的48bit是发送主机的以太网地址,我们并不能从这个地址发现什么,实际上这个地址是运行在QEMU下的XV6生成的地址,所以地址中的前24bit并不是网卡制造商的编号,而是QEMU编造的地址。接下来的16bit是以太网packet的类型,这里的类型是0x0806,对应的协议是ARP。剩下的部分是ARP packet的payload。发布于 2021-04-24 19:21网络协议以太网(Ethernet)MIT 公开课程赞同 4添加评论分享喜欢收藏申请转载文章被以下专栏收录MIT6.S081 操作系统工程中文翻译争取两周更新一个lect
ETHERNET数据包格式( IP & UDP & ICMP & ARP ) - the_tops - 博客园
会员
周边
新闻
博问
AI培训
云市场
所有博客
当前博客
我的博客
我的园子
账号设置
简洁模式 ...
退出登录
注册
登录
the_tops ----->人生犹如负重致远,不可急于求成.
在linux的浪潮中挣扎求存,转载,粘贴一切有用的好的文章,若有冒犯,请谅解.
博客园
首页
新随笔
联系
订阅
管理
ETHERNET数据包格式( IP & UDP & ICMP & ARP )
ETHERNET数据包格式( IP & UDP & ICMP & ARP )
ETHERNET数据包格式
一、ETHERNET 数据包的协议类型 TYPE 的值为 0x0800:IP协议,即:ETHERTYPE_IP, 该值在 /usr/include/net/ethernet.h中有定义。ETHERNET 数据包的格式又细分 为如下几种情况:(1) IP 报头中的协议号码为 IPPROTO_TCP,其值为 6 。ETHERNET 数据包的格式如下: |<------------ Ethernet Header ---------->| ------------------------------------------------------------------------- |DST MAC ADDR |SRC MAC ADDR | TYPE | IP PACKET | TCP PACKET | ------------------------------------------------------------------------- |<- 6 bytes ->|<- 6 bytes ->|<- 2 bytes ->|<- 20 bytes ->|<- 20 bytes ->| 如下例所示: 00 00 21 cd a8 48 00 0a 98 1f 0a 8a 08 00 45 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 00 28 38 13 40 00 7e 06 85 48 a6 6f e5 87 a6 6f -- -- -- -- -- -- -- e5 0d 04 3a 01 95 bc 5d 5a 8b 25 69 20 82 50 11 -- -- -- -- -- -- 41 87 cc 34 00 00 00 00 00 00 00 00 00 00 00 00 -- -- 其中作如下说明: 00 00 --- 08 00 : ETHERNET PACKET,共 14 个字节 00 00 21 cd a8 48 : 接收方的 MAC 地址,6 个字节 00 0a 98 1f 0a 8a : 发送方的 MAC 地址,6 个字节 08 00 : 协议类型,2 个字节, 0x0800:IP协议,该值在/usr/include/net/ethernet.h 中有定义,其值为:ETHERTYPE_IP 45 00 --- e5 0d : IP PACKET ,共 20 个字节 06 : 协议类型,1 是 ICMP,6 是 TCP,17 是 UDP a6 6f e5 87 : 发送方 IP 地址,4 个字节,十进制:166.111.229.135 a6 6f e5 0d : 接收方 IP 地址,4 个字节,十进制:166.111.229.13 04 3a --- 00 00 : TCP PACKET,共 20 个字节 04 3a : 发送方的端口号,2 个字节,其十进制表示为:1082 01 95 : 接收方的端口号,2 个字节,其十进制表示为:405 41 87 : TCP PACKET 的窗口大小(2) IP 报头中的协议号码为 IPPROTO_UDP,其值为 17 。ETHERNET 数据包的格式如下: |<------------ Ethernet Header ---------->| ------------------------------------------------------------------------ |DST MAC ADDR |SRC MAC ADDR | TYPE | IP PACKET | UDP PACKET | ------------------------------------------------------------------------ |<- 6 bytes ->|<- 6 bytes ->|<- 2 bytes ->|<- 20 bytes ->|<- 8 bytes ->| 如下例所示: ff ff ff ff ff ff 00 80 c8 f7 0b 99 08 00 45 00 -- -- -- -- -- -- -- -- -- -- -- -- -- -- 00 4e 0b 46 00 00 80 11 24 ff c0 a8 44 0a c0 a8 -- 44 ff 00 89 00 89 00 3a fa 63 80 37 01 10 00 01 -- -- -- -- -- -- -- -- 00 00 00 00 00 00 20 45 4e 46 44 45 49 45 50 45 4e 45 46 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 43 41 42 4c 00 00 20 00 01 其中作如下说明: ETHERNET PACKET、IP PACKET 的报头格式同 (1) , 其中:第二行的 11 表示 IPPROTO_UDP 协议。 00 89 --- fa 63 : UDP PACKET,共 8 个字节 00 89 : 发送方的端口号,2 个字节,其十进制表示为:137 00 89 : 接收方的端口号,2 个字节,其十进制表示为:137 00 3a : UDP 包长度,其十进制表示为:58 fa 63 : UDP 检查和(3) IP 报头中的协议号码为 IPPROTO_ICMP,其值为 1 。ETHERNET数据包的格式如下: |<------------ Ethernet Header ---------->| ------------------------------------------------------------------------- |DST MAC ADDR |SRC MAC ADDR | TYPE | IP PACKET | ICMP PACKET | ------------------------------------------------------------------------- |<- 6 bytes ->|<- 6 bytes ->|<- 2 bytes ->|<- 20 bytes ->|<- 8 bytes ->| 如下例所示: 00 0a 98 1f 0a 8a 00 00 21 cd a8 48 08 00 45 00 00 54 00 00 40 00 40 01 d0 97 a6 6f f9 0d ca 70 -- 00 24 08 00 bc 04 1b 21 00 01 c3 e6 2b 41 3b ae -- -- -- -- -- -- -- -- 0b 00 08 09 0a 0b 0c 0d 0e 0f 10 11 12 13 14 15 16 17 18 19 1a 1b 1c 1d 1e 1f 20 21 22 23 24 25 26 27 28 29 2a 2b 2c 2d 2e 2f 30 31 32 33 34 35 36 37 其中作如下说明: ETHERNET PACKET、IP PACKET 的报头格式同 (1) , 其中:第二行的 01 表示 IPPROTO_ICMP 协议。 08 00 --- 00 01 : ICMP PACKET,共 8 个字节 08 : ICMP_TYPE,1 个字节。 00 : ICMP_CODE,1 个字节。 bc 04 : ICMP 检查和 1b 21 : ICMP 标识 00 01 : ICMP 数据包序列号二、ETHERNET 数据包的协议类型 TYPE 的值为 0x0806:ARP协议,即:ETHERTYPE_ARP, 该值在 /usr/include/net/ethernet.h中有定义。ETHERNET 数据包的格式如下: |<------------ Ethernet Header ---------->| ------------------------------------------------------------ |DST MAC ADDR |SRC MAC ADDR | TYPE | ARP 协议数据包 | ------------------------------------------------------------ |<- 6 bytes ->|<- 6 bytes ->|<- 2 bytes ->|<-- 28 bytes -->| 如下例所示: ff ff ff ff ff ff 00 0a 98 1f 0a 8a 08 06 00 01 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 08 00 06 04 00 01 00 0a 98 1f 0a 8a a6 6f e5 01 -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- -- 00 00 00 00 00 00 a6 6f e5 58 00 00 00 00 00 00 -- -- -- -- -- -- -- -- -- -- 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 00 其中作如下说明: ff ff --- 08 06 : ETHERNET PACKET,共 14 个字节 ff ff ff ff ff ff : 接收方的 MAC 地址,6 个字节 00 0a 98 1f 0a 8a : 发送方的 MAC 地址,6 个字节 08 06 : 协议类型,2 个字节, 0x0806:ARP协议,在/usr/include/net/ethernet.h 中有定义,其值为:ETHERTYPE_ARP 00 01 --- f9 58 : ARP PACKET ,共 28 个字节 00 01 : 硬件地址格式,2 个字节 08 00 : 协议地址格式,2 个字节 06 : 硬件地址长度,1 个字节 04 : 协议地址长度,1 个字节 00 01 : 可选项,2 个字节,0x0001:ARPOP_REQUEST, 0x0002:ARPOP_REPLY 该值在 /usr/include/net/if_arp.h中有定义 00 0a 98 1f 0a 8a : 发送方的 MAC 地址,6 个字节 a6 6f e5 01 : 发送方的 IP 地址, 4 个字节,十进制:166.111.229.1 00 00 00 00 00 00 : 接收方的 MAC 地址,6 个字节 a6 6f e5 58 : 接收方的 IP 地址, 4 个字节,十进制:166.111.229.88
---------------------------------->人生犹如负重致远,不可急于求成。
自律使人自由!
posted @
2016-07-15 17:09
the_tops
阅读(3141)
评论(0)
编辑
收藏
举报
会员力量,点亮园子希望
刷新页面返回顶部
公告
Copyright © 2024 the_tops
Powered by .NET 8.0 on Kubernetes
以太网扫盲——帧结构(Ethernet Frame Structure)介绍-Felix-电子技术应用-AET-中国科技核心期刊-最丰富的电子设计资源平台
AET网站
资源下载
技术应用
资讯
电路图
技术专栏
小组
大学堂
登录 | 注册
Felix
技术源于积累,成功始于执着!
个人邮箱:justlxy@mail.dhu.edu.cn QQ:1576109464
以太网扫盲——帧结构(Ethernet Frame Structure)介绍
0赞
发表于 2019/6/15 16:15:36
阅读(15748)
以太网信号帧结构(Ethernet Signal Frame Structure),有被称为以太网帧结构,一般可以分为两类——数据帧和管理帧。按照IEEE 802.3,ISO/IEC8803-3系列标准规范,数据帧还可以分为基本数据帧、虚拟局域网(VLAN,Virtual Local Area Network)采用的扩展帧、Gbit Ethernet中的扩充帧、突发帧(Burst Frame)以及帧标志类型放在客户数据区域中的IEEE 802.3帧等。管理帧可包括用于与PHY层器件之间交换状态信息,实现控制与配置的管理帧,和用于防止网络拥塞的暂停帧(Pause Frame)等。1.数据帧1.1 基本帧基本帧(Base Frame)的结构如下图所示,各区域说明如下:(1)、帧前序(Preamble):这个区域是:“1”、“0”交替的56bit数据;(2)、帧起始符SOF(Start of Frame Delimiter):固定值为10101011的8bit数据,用于表示一帧的开始;(3)、MAC目的地址与源地址(Destination & Source MAC Address):前三个字节是IEEE分配给各产商的地址,后三个字节是个产商自行决定的。源地址总是唯一的,而目的地址可以是单播(Unicast)地址、多播(Multicast)地址或者广播(Broadcast)地址;【注】关于MAC地址,请参考:http://blog.chinaaet.com/justlxy/p/5100064182(4)、帧长度/类型(L/T,Length/Type):这个区域占用两个字节,其功能是用于表示MAC帧内不包括任何填充的数据字段长度或MAC帧内数据字段的数据类型。若这个区域的取值小于等于1500字节,则这个区域表示的是MAC帧内数据字段长度(客户数据区域字节数)。若这个区域的取值大于1500字节,则表示客户数据要到达的上册协议类型(客户数据类型区域);注:当帧长度/类型(L/T)区域只作为帧长度标志区域使用时,称为IEEE802.3帧,则这个区域长度小于或等于1500字节;而此区域作为帧类型区域时,则称其为Ethernet-II帧或者DIX帧,此时L/T的值大于1500字节。(5)、MAC客户数据(MAC Client Data):即数据段区域,一般在46~1500字节之间;(6)、填充区(Pad):填充区占用的字节数根据需要而定。这个区域的功能是确保帧尺寸不少于64字节。当从MAC目的地址到帧校验区整个数据帧尺寸少于64字节时,利用该区域将帧尺寸填充到64字节。因为尺寸小于64字节的帧属于违法帧,在接收端会被自动丢弃。如果帧尺寸已经达到64字节,则该区域占用的字节数应为零;(7)、帧校验序列(FCS,Frame Check Sequence):这个区域占用4个字节,其功能是用于整个帧的差错校验。在帧的源端,从MAC的目的地址到填充区在全帧范围内进行循环冗余校验(CRC-32)计算,将计算结果放入源帧的此区域中,在帧的接收端,重新计算CRC-32的值,并进行对比。若一致则传输过程中无误码产生,否则帧中有误码产生。这里应明确,MAC客户数据区数据最低不能少于46个字节,而最高不能大于1500字节;网络MAC帧的尺寸最短不能少于64字节,而最长不能大于1518字节,这里不包括帧前序(Preamble)和帧起始符(SOF,Start of Frame Delimiter)两个区域,共占用18字节。1.2、虚拟网采用的一种扩展帧结构IEEE 802.3ac标准有规范了在以太网上运行的虚拟局域网(VLAN,Virtual Local Area Network)采用的一种扩展帧结构。VLAN协议允许将标识符或“TAG”插入以太网帧结构中,如下图所示:在上述VLAN以太网扩展帧结构中,增加的VLAN标记4字节分为两部分。前两个字节由“802.1Q标记类型”组成,被固定为0x8100,为预留长度/类型区域,主要是赋予VLAN标记。其后两字节分为以下三个功能区域:(1)、前3bit是用户优先权标志区,用于对该帧分配的优先级指示;(2)、最后1bit是格式符合规定的指示符(CFI,Canonical Format Indicator),在以太网帧结构中用于指示路由选择信息区域(RIF,Routing Information Field);(3)、剩余12bit是VLAN帧标识符,他是以太网VLAN帧的唯一标志。加入VLAN标记后,使得802.3ac标准帧的最大长度由1518字节扩大到1522字节。1.3、Gbit以太网的帧结构在1988年,又制定了针对于Gbit以太网的IEEE 802.3z标准规范,其帧结构图下图所示:Gbit以太网IEEE 802.3z标准规范的扩充帧结构是在原IEEE 802.3标准规范的以太网信号的基本帧结构基础后面增加一个扩充区域,其目的是使帧长最短不少于512字节(从目的地址到填充区),从而保证发生的碰撞(冲突)可以传播到网上的每个节点。扩充区bit并非是数据,其作用仅仅是扩大了占用载体最短要求时间。1.4、帧间间隙以太网设备必须允许在传输帧之间有一个最小空载周期时间,这就是所称的帧间间隙IFG(Inter-Frame Gap)或称为包间间隙IPG(Inter-Packet Gap)。其提供的这段间隙时间,使设备得到恢复,以便设备为接收下一帧做必要的准备。IEEE标准规范帧间的最小间隔为不少于96bit占用的时间,具体如下表所示:2.管理帧2.1、基本管理帧这是用于PHY(物理层器件)与STA(站管理实体)之间通信的管理帧(Management Frame),也称为基本管理帧(Base Management Frame)。ISO/IEC、IEEE标准规范的有线以太网管理数据流的帧结构,其帧长通常为8个字节,即64bit,如下图所示。管理帧前后都可以是空载状态(IDLE)。(1)、管理帧前序(Preamble):占用4个字节,为连续32个逻辑“1”,对应于管理数据的32个时钟周期。管理帧前序用于连续监视管理接口管理,并从而为管理接口给出接收管理数据做准备的时间;若帧前序出现则标志STA处理的开始。管理接口有抑制管理帧前序的能力,以便缩短管理帧的长度,从而使STA可以尽快访问管理寄存器。(2)、管理帧起始符(SOF):占用2bit,为固定值“01”;(3)、管理帧操作码(OP):占用2bit,10b表示读取管理寄存器,01b表示写管理寄存器,00b和11b无效;(4)、管理帧PHY地址(PHYAD):占用5bit;(5)、管理帧寄存器地址(REGAD):占用5bit;(6)、帧换向区TA(Turnaround Field):占用2bit;(7)、管理帧数据(Data):占用2个字节,即16bit。2.2、暂停帧在全双工通信工作模式下,以太网标准规范为了实现对数据流量的控制,规范了一种所谓的暂停帧。这是应用发送暂停帧(Pause Frame)的方法,通告所有发送数据的站点暂停发送帧信息,防止链路发生拥塞。暂停帧仅适用于全双工通信,并不适用于半双工通信。链路两端都可以向对端发送暂停帧,并且在对端暂停发送状态时,仍然可以向其发送暂停帧,以便延长对端停发MAC帧数据时间。在全双工通信模式下,链路两端也可以只有一方支持暂停帧,而另一方不支持。只是不支持的一方无法解释其收到的暂停帧。可以通过自动协商原理了解对方端是否具备支持暂停帧的能力。暂停帧的结构图如下图所示:(1)目的地址(DA):可以使单播地址,也可以使广播地址01-80-C2-00-00-01;(2)类型区(L/T):固定值88-08,表示此帧为MAC介质介入控制帧;(3)暂停标志(MAC操作码):固定值00-01,表示此帧为暂停帧;(4)MAC控制参数:设定延时时间,取值范围为00-00到FF-FF,时间单位为时隙(Slot Time);(5)备用区域:占用42bit,无意义。用于使暂停帧长度满足最小帧的要求。
« 上一篇:【转】ITU-R BT.656视频标准接口简介
» 下一篇:PCIe扫盲——ReTimer和ReDriver简介
作者
Felix
关注
文章:274 篇
阅读:3563612 次
标签
以太网
Ethernet
帧结构
相关文章
莱尔德科技推出Dual Slant 45系列天线
机器人光纤激光切割系统研究
GPRS 火灾监测设计
网络带宽还能满足需求多久?
浅谈基于WiFi与ZigBee技术的楼宇监测
虚拟现实VR火了 想搭顺风车的多了
相关资料
日立单片机模糊控制开发平台及其应用
OFDM系统非线性失真自适应补偿技术
逆向多播树构建算法在MPLS上的应用
一种基于VSM的中文网页分类方法
一种抗噪的大米边缘检测方法*
基于无线传感网的智能电网线路传感器
相关视频
短距离无线通信系统简介
【视频】向Femto和微蜂窝市场进军--基
【视频】2011电子技术应用最佳产品奖
【视频】研祥智能产品总监唐青文演讲
【视频】TI Simplelink无线连接解决方
【视频】什么是蓝牙?
关注微信公众号
网站相关
关于我们
联系我们
投稿须知
广告及服务
内容许可
广告服务
杂志订阅
会员与积分
积分商城
会员等级
会员积分
VIP会员
关注我们
Copyright © 2005-2020 《电子技术应用》版权所有 京ICP备10017138号
EtherNet/IP协议基础知识(Part 2) - 知乎切换模式写文章登录/注册EtherNet/IP协议基础知识(Part 2)虹科工业智能互联2.2.3 Encapsulation封装协议2.2.3.1 主要功能图:EtherNet/IP封装层协议 实时性要求不同的数据会采用不同的封装形式与传输形式:实时性要求不高的数据会采用CPF(Common Packet Format通用包格式)+Encapsulation的封装,走TCP/IP传输通道;而实时性要求较高的数据仅采用CPF封装,并走UDP/IP传输通道。封装层主要功能如下: 1) 解除IP网络的CIP消息封装; 2) 将CIP消息包装为以太网消息; 3) 会话管理; 4) 与下层TCP/IP协议层以及TCP/IP堆栈进行交互。2.2.3.2 封装结构图:EtherNet/IP以太网包结构 图:封装部分的结构EtherNet/IP的以太网包与其中的封装部分结构如上图所示,其中封装部分各细分部分功能如下:Command:代表该包的功能和作用;Length:指示后方数据域的长度;Session Handle:会话句柄,表示会话建立或响应的请求;Status:指示改包的命令有无正确执行,可比对状态码表进行确认;Sender Context:包含描述发送者信息的内容;Options:可选设置;Command-specific Data:根据命令的不同有所区别2.2.3.3 命令类型表:部分命令类型2.2.3.4 命令特定数据域(CPF)结构图:数据域结构数据域部分的结构如上图所示,其结构为1个1个的item的连接,其每种item的含义如下: ① Item Count:指示该包数据域中item的总个数; ② Address Item:存放目的地地址信息:Type ID:地址类型;Length:地址长度;Data:地址具体数值; ③ Data Item:存放数据信息:Type ID:数据类型;Length:数据长度;Data:具体数据,封装了CIP报文包的内容,包含CIP命令、请求路径等内容;2.2.4 传输层的消息类型2.2.4.1 显式消息应用:非周期性从端数据的读写特点:①报文中包含地址项和服务请求(命令);②通常用于两个站点之间的通用通信路径;③面向逻辑连接的连接方式,点对点传输,请求对应响应;图:显式消息封装部分的报文结构 上图中,Command的值为0x6F,指示该报文为SendRRData,其上半部分的结构为封装报文头结构,下半部分为命令特定数据域结构,与前文提到的报文结构基本无异。2.2.4.2 隐式消息应用:实时的IO应用数据交互特点:①报文中没有地址项,也没有服务请求(命令);②通过Connection ID来确定任务目标;③生产者与(一或多个)消费者之间的特殊通信路径;④点对点或多播;图:隐式消息封装部分的报文结构上图的报文结构中,不含有封装协议报文头,且命令特定数据域中的地址项与数据均固定,通过Connection ID来标识访问的数据。2.2.5 EtherNet/IP 应用层-CIP图:CIP协议基本架构 基本原理:以是否存在实时性要求为依据,划分数据的优先级,区别对待不同优先级的数据。具体的协议内容,将单独成篇进行介绍。2.3 EtherNet/IP 特点总结①在标准以太网基础上建立,而不仅仅是与之兼容;②多种数据传输速率:10、100、1000Mbit/s;③可以使用标准基础架构来构建系统;④可以使用IP路由器将网络构建为子网;⑤使用IP寻址进行所有通信,完全支持跨子网的通信,因此网络中几乎没有节点数量限制;⑥非实时通信和实时通信可以在同一子网中共存;⑦支持协调驱动和运动控制;⑧支持设备级环网(DLR),该环网通过介质冗余提供单容错能力;⑨与其他上层协议(如HTTP,FTP,VOIP等)共存;若需要更多帮助,欢迎联系我们发布于 2020-09-08 10:50TCP/IPUDP以太网(Ethernet)赞同 3添加评论分享喜欢收藏申请
以太网帧格式 - 维基百科,自由的百科全书
跳转到内容
主菜单
主菜单
移至侧栏
隐藏
导航
首页分类索引特色内容新闻动态最近更改随机条目资助维基百科
帮助
帮助维基社群方针与指引互助客栈知识问答字词转换IRC即时聊天联络我们关于维基百科
搜索
搜索
创建账号
登录
个人工具
创建账号 登录
未登录编辑者的页面 了解详情
贡献讨论
目录
移至侧栏
隐藏
序言
1结构
开关结构子章节
1.1前导码和帧开始符
1.2报头
1.3帧校验码
1.4帧间距
2以太帧类型
开关以太帧类型子章节
2.1Ethernet II
2.2802.2 LLC
2.3子网接入协议
2.4Novell raw 802.3
3效率
4矮帧
5注释
6参考资料
开关目录
以太网帧格式
12种语言
CatalàČeštinaDeutschEnglishEspañolBahasa IndonesiaItaliano日本語한국어SvenskaTürkçeTiếng Việt
编辑链接
条目讨论
大陆简体
不转换简体繁體大陆简体香港繁體澳門繁體大马简体新加坡简体臺灣正體
阅读编辑查看历史
工具
工具
移至侧栏
隐藏
操作
阅读编辑查看历史
常规
链入页面相关更改上传文件特殊页面固定链接页面信息引用本页获取短URL下载二维码维基数据项目
打印/导出
下载为PDF可打印版
维基百科,自由的百科全书
此条目可参照英语维基百科相应条目来扩充。 (2019年8月27日)若您熟悉来源语言和主题,请协助参考外语维基百科扩充条目。请勿直接提交机械翻译,也不要翻译不可靠、低品质内容。依版权协议,译文需在编辑摘要注明来源,或于讨论页顶部标记{{Translated page}}标签。
此条目需要补充更多来源。 (2019年8月27日)请协助补充多方面可靠来源以改善这篇条目,无法查证的内容可能会因为异议提出而被移除。致使用者:请搜索一下条目的标题(来源搜索:"以太网帧格式" — 网页、新闻、书籍、学术、图像),以检查网络上是否存在该主题的更多可靠来源(判定指引)。
在以太网链路上的数据包称作以太帧。以太帧起始部分由前导码和帧开始符组成。后面紧跟着一个以太网报头,以MAC地址说明目的地址和源地址。帧的中部是该帧负载的包含其他协议报头的数据包(例如IP协议)。以太帧由一个32位冗余校验码结尾。它用于检验数据传输是否出现损坏。
结构[编辑]
来自线路的二进制数据包称作一个帧。从物理线路上看到的帧,除其他信息外,还可看到前导码和帧开始符。任何物理硬件都会需要这些信息。[note 1]
下面的表格显示了在以1500个八比特组为MTU传输(有些吉比特以太网甚至更高速以太网支持更大的帧,称作巨型帧)时的完整帧格式。[note 2] 一个八比特组是八个位组成的数据(也就是现代计算机的一个字节)。
802.3 以太网帧结构
前导码
帧开始符
MAC 目标地址
MAC 源地址
802.1Q 标签 (可选)
以太类型
负载
冗余校验
帧间距(英语:Interframe gap)
10101010 7个octet
10101011 1个octet
6 octets
6 octets
(4 octets)
2 octets
46–1500 octets
4 octets
12 octets
64–1522 octets
72–1530 octets
84–1542 octets
前导码和帧开始符[编辑]
参见:Syncword
一个帧以7个字节的前导码和1个字节的帧开始符作为帧的开始。快速以太网之前,在线路上帧的这部分的位模式是10101010 10101010 10101010 10101010 10101010 10101010 10101010 10101011。由于在传输一个字节时最低位最先传输(LSB),因此其相应的16进制表示为0x55 0x55 0x55 0x55 0x55 0x55 0x55 0xD5。
10/100M 网卡(介质无关接口 PHY)一次传输4位(一个半字节(英语:nibble))。因此前导符会成为7组0x5+0x5,而帧开始符成为0x5+0xD。1000M网卡(GMII(英语:Gigabit Media Independent Interface))一次传输8位,而10Gbit/s(XGMII(英语:nibble)) PHY芯片一次传输32位。 注意当以octet描述时,先传输7个01010101然后传输11010101。由于8位数据的低4位先发送,所以先发送帧开始符的0101,之后发送1101。
报头[编辑]
报头包含源地址和目标地址的MAC地址,以太类型字段和可选的用于说明VLAN成员关系和传输优先级的IEEE 802.1Q VLAN 标签。
帧校验码[编辑]
帧校验码是一个32位循环冗余校验码,以便验证帧数据是否被损坏。
帧间距[编辑]
主条目:en:Interframe gap
当一个帧发送出去之后,发送方在下次发送帧之前,需要再发送至少12个octet的空闲线路状态码。
以太帧类型[编辑]
以太帧有很多种类型。不同类型的帧具有不同的格式和MTU值。但在同种物理媒体上都可同时存在。
以太网第二版[note 3] 或者称之为Ethernet II 帧,DIX帧,是最常见的帧类型。并通常直接被IP协议使用。
Novell的非标准IEEE 802.3帧变种。
IEEE 802.2 逻辑链路控制 (LLC) 帧
子网接入协议(SNAP)帧
所有四种以太帧类型都可包含一个IEEE 802.1Q选项来确定它属于哪个VLAN以及他的IEEE 802.1p优先级(QoS)。这个封装由IEEE 802.3ac定义并将帧大小从64字节扩充到1522字节(注:不包含7个前导字节和1个字节的帧开始符以及12个帧间距字节)。
IEEE 802.1Q标签,如果出现,需要放在源地址字段和以太类型或长度字段的中间。这个标签的前两个字节是标签协议标识符(TPID)值0x8100。这与没有标签帧的以太类型/长度字段的位置相同,所以以太类型0x8100就表示包含标签的帧,而实际的以太类型/长度字段则放在Q-标签的后面。TPID后面是两个字节的标签控制信息(TCI)。(IEEE 802.1p 优先级(QoS)和VLAN ID)。Q标签后面就是通常的帧内容。
Ethernet II[编辑]
以太 II 帧 (也称作DIX以太网,是以这个设计的主要成员,DEC,Intel和Xerox的名字命名的。[1]),把紧接在目标和源MAC地址后面的这个两字节定义为以太网帧数据类型字段。
例如,一个0x0800的以太类型说明这个帧包含的是IPv4数据报。同样的,一个0x0806的以太类型说明这个帧是一个ARP帧,0x8100说明这是一个IEEE 802.1Q帧,而0x86DD说明这是一个IPv6帧。
当这个工业界的标准通过正式的IEEE标准化过程后,在802.3标准中以太类型字段变成了一个(数据)长度字段。(最初的以太包通过包括他们的帧来确定它们的长度,而不是以一个明确的数值。)但是包的接收层仍需知道如何解析包,因此标准要求将IEEE802.2头跟在长度字段后面,定义包的类型。多年之后,802.3x-1997标准,一个802.3标准的后继版本,正式允许两种类型的数据包同时存在。实际上,两种数据包都被广泛使用,而最初的以太数据包在以太局域网中被广泛应用,因为他的简便和低开销。
为了允许一些使用以太II版本的数据报和一些使用802.3封装的最初版本的数据包能够在同一个以太网段使用,以太类型值必须大于等于1536(0x0600)。这个值比802.3数据包的最大长度1500byte (0x05DC)要更大。因此如果这个字段的值大于等于1536,则这个帧是以太II帧,而那个字段是类型字段。否则(小于1500而大于46字节),他是一个IEEE 802.3帧,而那个字段是长度字段。1500~1536(不包含)的数值未定义。[2]
802.2 LLC[编辑]
一些协议,尤其是为OSI模型设计的,会直接在802.2 LLC层上操作。802.2 LLC层同时提供数据报和面向连接的网络服务。
802.2以太网变种没有在常规网络中普遍使用。只有一些大公司的没有与IP网络融合的Netware设备。以前,很多公司Netware网络支持802.2以太网,以便支持从以太网到IEEE 802.5令牌环网或FDDI网络的透明桥接。当今最流行的数据包是以太网版本二,由基于IP协议的网络使用,将其以太类型设置为0x0800用于封装IPv4或者0x86DD来支持IPv6。
还有一个互联网标准来使用LLC/SNAP报头将IPv4封装在IEEE 802.2帧中。[3] 这几乎从未在以太网中实现过。(但在FDDI以及令牌环网,IEEE 802.11和其他IEEE 802网络中使用)。如果不使用SNAP,IP传输无法封装在IEEE 802.2 LLC帧中。这是因为LLC协议中虽然有一种IP协议类型,却没有ARP。IPv6同样可使用LLC/SNAP在IEEE 802.2以太网上传播,但,如同IPv4,它也绝少被这样使用。(尽管LLC/SNAP的IPv6数据包在IEEE 802网络中被使用)。
子网接入协议[编辑]
通过检查802.2 LLC头,可以确定他是否后继一个SNAP头。LLC头包含两个附加的8位地址字段,在OSI模型术语中称作服务访问点(SAPs)。当源和目标SAP都设置为0xAA时,就会使用SNAP服务。SNAP头允许以太类型值被任何IEEE 802协议使用,即使支持的是私有协议ID空间。在IEEE 802.3x-1997中,IEEE 以太标准被修改为明确允许紧接着MAC地址的16位字段即可用于长度字段,也可用于类型字段。
Mac OS使用 802.2/SNAP 数据包来实现以太网上的AppleTalk V2协议包("EhterTalk")。
Novell raw 802.3[编辑]
Novell的"raw"802.3帧格式基于早期IEEE 802.3的工作。Novell以它作为起点来创建他自己的以太网上IPX协议的的第一个实现。他们没有使用LLC头,而是直接在长度字段后面开始IPX数据包。这不符合IEEE 802.3标准,但由于IPX的前两个字节一直是FF(而在IEEE 802.2 LLC中这种模式虽然理论上是可能的但实际上概率极其微小),实用中这种方式与其他以太实现共同存在。但须注意在一些早期的DECnet(英语:DECnet)可能无法识别之。
直到90年代中期,Novell NetWare默认使用这个帧类型,而由于Netware曾如此流行,而那时IP还不是那么流行,在过去的一些时候,大多数的以太网上都运载着负载IPX的"raw" 802.3数据包。直到Netware 4.10,当使用IPX时,Netware才默认使用IEEE 802.2和LLC(Nerware 帧类型Ethernet_802.2)。
效率[编辑]
我们可以计算以太网的效率和比特率:
Efficiency
=
Payload size
Frame size
{\displaystyle {\text{Efficiency}}={\frac {\text{Payload size}}{\text{Frame size}}}}
当达到允许的最大负载值时可达到最高效率,对于无标签的以太网数据包是
1500
1538
=
97.53
%
{\displaystyle {\frac {1500}{1538}}=97.53\%}
,而使用802.1Q VLAN标签时是
1500
1542
=
97.28
%
{\displaystyle {\frac {1500}{1542}}=97.28\%}
。
由效率中可计算比特率:
Net bit rate
=
Efficiency
×
Wire bit rate
{\displaystyle {\text{Net bit rate}}={\text{Efficiency}}\times {\text{Wire bit rate}}\,\!}
不带802.1Q标签的100BASE-TX以太网的最大比特率是97.53 Mbit/s.
注:不带标签的最大帧尺寸=1518 + 20 (7-byte 前导符,1-byte 帧开始符, 12-byte 帧间距)= 1538。
矮帧[编辑]
矮帧是一个尺寸不及IEEE 802.3定义的最小长度64字节的以太网帧。可能的原因是以太网碰撞,数据不足,网卡错误或软件错误。[4]
注释[编辑]
^ 前导码和帧开始符无法在包嗅探程序中显示。这些信息会在OSI第1层被网卡处理掉,而不会传入嗅探程序采集数据的OSI第2层。也存在OSI物理层的嗅探工具以显示这些前导码和帧开始符,但这些设备大多昂贵,多用于检测硬件相关的故障。
^ 前导码和帧开始符的位模式以位串的方式给出,最左的比特最先传输(而非以字节为单位,以太网传输最优先的位)。这个脚注与IEEE 802.3标准吻合。
^ 第一版以太帧在早期以太网原型中使用,并使用8位MAC地址,从未在商业中使用
参考资料[编辑]
^ Drew Heywood; Zubair Ahmad. Drew Heywood's Windows 2000 Network Services. Sams. 2001: 53. ISBN 0672317419.
^ IEEE Std 802.3-2005, 3.2.6
^ RFC 1042
^ Glossary of Terms - R (Zarlink Semiconductor). [2011-03-01]. (原始内容存档于2009-10-26). 071227 products.zarlink.com
查论编局域网技术之以太网家族速度
10Mbit/s
双绞线以太网
100Mbit/s
1Gbit/s
2.5和5Gbit/s
10Gbit/s
25和50Gbit/s(英语:25 Gigabit Ethernet)
40和100Gbit/s
200Gbit/s和400Gbit/s
常规
IEEE 802.3
以太网物理层(英语:Ethernet physical layer)
自动协商(英语:Autonegotiation)
以太网供电
以太类型
以太网联盟(英语:Ethernet Alliance)
流控制
帧
巨型帧
历史
CSMA/CD
StarLAN(英语:StarLAN)
10BROAD36(英语:10BROAD36)
10BASE-FB(英语:10BASE-FB)
10BASE-FL(英语:10BASE-FL)
10BASE5(英语:10BASE5)
10BASE2(英语:10BASE2)
100BaseVG(英语:100BaseVG)
LattisNet(英语:LattisNet)
长距离(英语:Long Reach Ethernet)
应用程序
音频(英语:Audio over Ethernet)
运营商(英语:Carrier Ethernet)
数据中心(英语:Data center bridging)
高能效以太网
第一英里(英语:Ethernet in the first mile)
10G-EPON(英语:10G-EPON)
工业以太网
以太网供电
同步(英语:Synchronous Ethernet)
收发器
MAU(英语:Medium Attachment Unit)
GBIC
SFP
XENPAK
X2
XFP
SFP+
QSFP(英语:QSFP)
CFP(英语:C Form-factor Pluggable)
接口
AUI(英语:Attachment Unit Interface)
MDI
MII
GMII
XGMII
XAUI
分类
维基共享
取自“https://zh.wikipedia.org/w/index.php?title=以太网帧格式&oldid=73376925”
分类:以太网路隐藏分类:使用RFC魔术链接的页面自2019年8月需要从英语维基百科翻译的条目需要从英语维基百科翻译的条目自2019年8月需补充来源的条目拒绝当选首页新条目推荐栏目的条目
本页面最后修订于2022年8月26日 (星期五) 04:35。
本站的全部文字在知识共享 署名-相同方式共享 4.0协议之条款下提供,附加条款亦可能应用。(请参阅使用条款)
Wikipedia®和维基百科标志是维基媒体基金会的注册商标;维基™是维基媒体基金会的商标。
维基媒体基金会是按美国国内税收法501(c)(3)登记的非营利慈善机构。
隐私政策
关于维基百科
免责声明
行为准则
开发者
统计
Cookie声明
手机版视图
开关有限宽度模式
以太网(Ethernet) - 知乎首页知乎知学堂发现等你来答切换模式登录/注册以太网(Ethernet)以太网的标准拓扑结构为总线型拓扑,但目前的快速以太网(100BASE-T、1000BASE-T标准)为了减少冲突,将能提高的网络速度和使用效率最大化,使用交换机(Switch hub)来进行网络连…查看全部内容关注话题管理分享百科讨论精华视频等待回答详细内容以太网(英语:Ethernet)是一种计算机局域网技术。IEEE组织的IEEE 802.3标准制定了以太网的技术标准,它规定了包括物理层的连线、电子信号和介质访问控制的内容。以太网是目前应用最普遍的局域网技术,取代了其他局域网标准如令牌环、FDDI和ARCNET。以太网的标准拓扑结构为总线型拓扑,但目前的快速以太网(100BASE-T、1000BASE-T标准)为了减少冲突,将能提高的网络速度和使用效率最大化,使用交换机(Switch hub)来进行网络连接和组织。如此一来,以太网的拓扑结构就成了星型;但在逻辑上,以太网仍然使用总线型拓扑和CSMA/CD(Carrier Sense Multiple Access/Collision Detection,即载波多重访问/碰撞侦测)的总线技术。概述:1990年代的以太网网卡或叫NIC(Network Interface Card,以太网适配器)。这张卡可以支持基于同轴电缆的10BASE2 (BNC连接器,左)和基于双绞线的10BASE-T(RJ-45,右)。以太网实现了网络上无线电系统多个节点发送信息的想法,每个节点必须获取电缆或者信道才能传送信息,有时也叫作以太(Ether)。这个名字来源于19世纪的物理学家假设的电磁辐射媒体——光以太。 每一个节点有全球唯一的48位地址也就是制造商分配给网卡的MAC地址,以保证以太网上所有节点能互相鉴别。由于以太网十分普遍,许多制造商把以太网卡直接集成进计算机主板。以太网通讯具有自相关性的特点,这对于电信通讯工程十分重要。CSMA/CD共享介质以太网:带冲突检测的载波侦听多路访问(CSMA/CD)技术规定了多台电脑共享一个通道的方法。这项技术最早出现在1960年代由夏威夷大学开发的ALOHAnet,它使用无线电波为载体。这个方法要比令牌环网或者主控制网简单。当某台电脑要发送信息时,在以下行动与状态之间进行转换:开始 - 如果线路空闲,则启动传输,否则跳转到第4步。发送 - 如果检测到冲突,继续发送数据直到达到最小回报时间(min echo receive interval)以确保所有其他转发器和终端检测到冲突,而后跳转到第4步。成功传输 - 向更高层的网络协议报告发送成功,退出传输模式。线路繁忙 - 持续等待直到线路空闲。线路空闲 - 在尚未达到最大尝试次数之前,每隔一段随机时间转到第1步重新尝试。超过最大尝试传输次数 - 向更高层的网络协议报告发送失败,退出传输模式。就像在没有主持人的座谈会中,所有的参加者都通过一个共同的介质(空气)来相互交谈。每个参加者在讲话前,都礼貌地等待别人把话讲完。如果两个客人同时开始讲话,那么他们都停下来,分别随机等待一段时间再开始讲话。这时,如果两个参加者等待的时间不同,冲突就不会出现。如果传输失败超过一次,将延迟指数增长时间后再次尝试。延迟的时间通过截断二进制指数后移(英语:Exponential_backoff)(truncated binary exponential backoff)算法来实现。最初的以太网是采用同轴电缆来连接各个设备的。电脑通过一个叫做附加单元接口(Attachment Unit Interface,AUI)的收发器连接到电缆上。一条简单网路线对于一个小型网络来说很可靠,而对于大型网络来说,某处线路的故障或某个连接器的故障,都会造成以太网某个或多个网段的不稳定。因为所有的通信信号都在共享线路上传输,即使信息只是想发给其中的一个终端(destination),却会使用广播的形式,发送给线路上的所有电脑。在正常情况下,网络接口卡会滤掉不是发送给自己的信息,接收到目标地址是自己的信息时才会向CPU发出中断请求,除非网卡处于混杂模式(Promiscuous mode)。这种“一个说,大家听”的特质是共享介质以太网在安全上的弱点,因为以太网上的一个节点可以选择是否监听线路上传输的所有信息。共享电缆也意味着共享带宽,所以在某些情况下以太网的速度可能会非常慢,比如电源故障之后,当所有的网络终端都重新启动时。以太网中继器和集线器:在以太网技术的发展中,以太网集线器(Ethernet Hub)的出现使得网络更加可靠,接线更加方便。因为信号的衰减和延时,根据不同的介质以太网段有距离限制。例如,10BASE5同轴电缆最长距离500米 (1,640英尺)。最大距离可以通过以太网中继器实现,中继器可以把电缆中的信号放大再传送到下一段。中继器最多连接5个网段,但是只能有4个设备(即一个网段最多可以接4个中继器)。这可以减轻因为电缆断裂造成的问题:当一段同轴电缆断开,所有这个段上的设备就无法通讯,中继器可以保证其他网段正常工作。类似于其他的高速总线,以太网网段必须在两头以电阻器作为终端。对于同轴电缆,电缆两头的终端必须接上被称作“终端器”的50欧姆的电阻和散热器,如果不这么做,就会发生类似电缆断掉的情况:总线上的AC信号当到达终端时将被反射,而不能消散。被反射的信号将被认为是冲突,从而使通信无法继续。中继器可以将连在其上的两个网段进行电气隔离,增强和同步信号。大多数中继器都有被称作“自动隔离”的功能,可以把有太多冲突或是冲突持续时间太长的网段隔离开来,这样其他的网段不会受到损坏部分的影响。中继器在检测到冲突消失后可以恢复网段的连接。随着应用的拓展,人们逐渐发现星型的网络拓扑结构最为有效,于是设备厂商们开始研制有多个端口的中继器。多端口中继器就是众所周知的集线器(Hub)。集线器可以连接到其他的集线器或者同轴网络。第一个集线器被认为是“多端口收发器”或者叫做“fanouts”。最著名的例子是DEC的DELNI,它可以使许多台具有AUI连接器的主机共享一个收发器。集线器也导致了不使用同轴电缆的小型独立以太网网段的出现。像DEC和SynOptics这样的网络设备制造商曾经出售过用于连接许多10BASE-2细同轴线网段的集线器。非屏蔽双绞线(unshielded twisted-pair cables , UTP)最先应用在星型局域网中,之后也在10BASE-T中应用,最后取代了同轴电缆成为以太网的标准。这项改进之后,RJ45电话接口代替了AUI成为电脑和集线器的标准线路,非屏蔽3类双绞线/5类双绞线成为标准载体。集线器的应用使某条电缆或某个设备的故障不会影响到整个网络,提高了以太网的可靠性。双绞线以太网把每一个网段点对点地连起来,这样终端就可以做成一个标准的硬件,解决了以太网的终端问题。采用集线器组网的以太网尽管在物理上是星型结构,但在逻辑上仍然是总线型的,半双工的通信方式采用CSMA/CD的冲突检测方法,集线器对于减少数据包冲突的作用很小。每一个数据包都被发送到集线器的每一个端口,所以带宽和安全问题仍没有解决。集线器的总传输量受到单个连接速度的限制(10或100 Mbit/s),这还是考虑在前同步码、传输间隔、标头、档尾和封装上都是最小花费的情况。当网络负载过重时,冲突也常常会降低传输量。最坏的情况是,当许多用长电缆组成的主机传送很多非常短的帧(frame)时,可能因冲突过多导致网络的负载在仅50%左右程度就满载。为了在冲突严重降低传输量之前尽量提高网络的负载,通常会先做一些设定以避免类似情况发生。桥接和交换:尽管中继器在某些方面分隔了以太网网段,使得电缆断线的故障不会影响到整个网络,但它向所有的以太网设备转发所有的数据。这严重限制了同一个以太网网络上可以相互通信的机器数量。为了减轻这个问题,桥接方法被采用,在工作在物理层的中继器之基础上,桥接工作在数据链路层。通过网桥时,只有格式完整的数据包才能从一个网段进入另一个网段;冲突和数据包错误则都被隔离。通过记录分析网络上设备的MAC地址,网桥可以判断它们都在什么位置,这样它就不会向非目标设备所在的网段传递数据包。像生成树协议这样的控制机制可以协调多个交换机共同工作。早期的网桥要检测每一个数据包,因此当同时处理多个端口的时候,数据转发比Hub(中继器)来得慢。1989年网络公司Kalpana发明了EtherSwitch,第一台以太网交换机。以太网交换机把桥接功能用硬件实现,这样就能保证转发数据速率达到线速。大多数现代以太网用以太网交换机代替Hub。尽管布线方式和Hub以太网相同,但交换式以太网比共享介质以太网有很多明显的优势,例如更大的带宽和更好的异常结果隔离设备。交换网络典型的使用星型拓扑,虽然设备在半双工模式下运作时仍是共享介质的多节点网,但10BASE-T和以后的标准皆为全双工以太网,不再是共享介质系统。交换机启动后,一开始也和Hub一样,转发所有数据到所有端口。接下来,当它记录了每个端口的地址以后,他就只把非广播数据发送给特定的目的端口。因此线速以太网交换可以在任何端口对之间实现,所有端口对之间的通讯互不干扰。因为数据包一般只是发送到他的目的端口,所以交换式以太网上的流量要略微小于共享介质式以太网。然而,交换式以太网仍然是不安全的网络技术,因为它很容易因为ARP欺骗或者MAC满溢而瘫痪,同时网络管理员也可以利用监控功能抓取网络数据包。当只有简单设备(除Hub之外的设备)连接交换机端口时,整个网络可能处于全双工模式。如果一个网段只有2个设备,那么冲突探测也不需要了,两个设备可以随时收发数据。这时总带宽是链路的2倍,虽然双方的带宽相同,但没有发生冲突就意味着几乎能利用到100%的带宽。交换机端口和所连接的设备必须使用相同的双工设置。多数100BASE-TX和1000BASE-T设备支持自动协商特性,即这些设备通过信号来协调要使用的速率和双工设置。然而,如果自动协商功能被关闭或者设备不支持,则双工设置必须通过自动检测进行设置或在交换机端口和设备上都进行手工设置以避免双工错配——这是以太网问题的一种常见原因(设备被设置为半双工会报告迟发冲突,而设备被设为全双工则会报告runt)。许多较低层级的交换机没有手工进行速率和双工设置的能力,因此端口总是会尝试进行自动协商。当启用了自动协商但不成功时(例如其他设备不支持),自动协商会将端口设置为半双工。速率是可以自动感测的,因此将一个10BASE-T设备连接到一个启用了自动协商的10/100交换端口上时将可以成功地创建一个半双工的10BASE-T连接。但是将一个配置为全双工100Mb工作的设备连接到一个配置为自动协商的交换端口时(反之亦然)则会导致双工错配。即使电缆两端都设置成自动速率和双工模式协商,错误猜测还是经常发生而退到10Mbps模式。因此,如果性能差于预期,应该查看一下是否有计算机设置成10Mbps模式了,如果已知另一端配置为100Mbit,则可以手动强制设置成正确模式。.当两个节点试图用超过电缆最高支持数据速率(例如在3类线上使用100Mbps或者3类/5类线使用1000Mbps)通信时就会发生问题。不像ADSL或者传统的拨号Modem通过详细的方法检测链路的最高支持数据速率,以太网节点只是简单的选择两端支持的最高速率而不管中间线路,因此如果速率过高就会导致链路失效。解决方案为强制通讯端降低到电缆支持的速率。以太网类型:除了以上提到的不同帧类型以外,各类以太网的差别仅在速率和配线。因此,同样的网络协议栈软件可以在大多数以太网上执行。以下的章节简要综述了不同的正式以太网类型。除了这些正式的标准以外,许多厂商因为一些特殊的原因,例如为了支持更长距离的光纤传输,而制定了一些专用的标准。很多以太网卡和交换设备都支持多速率,设备之间通过自动协商设置最佳的连接速度和双工方式。如果协商失败,多速率设备就会探测另一方使用的速率但是默认为半双工方式。10/100以太网端口支持10BASE-T和100BASE-TX。10/100/1000支持10BASE-T、100BASE-TX和1000BASE-T。部分以太网类型局域网(英语:Local Area Network,简称LAN)是连接住宅、学校、实验室、大学校园或办公大楼等有限区域内计算机的计算机网络 。相比之下,广域网(WAN)不仅覆盖较大的地理距离,而且还通常涉及固接专线和对于互联网的链接。 相比来说互联网则更为广阔,是连接全球商业和个人电脑的系统。在历经使用了链式局域网(英语:ARCNET)、令牌环与AppleTalk技术后,以太网和Wi-Fi(无线网络连接)是现今局域网最常用的两项技术。机理:局域网(Local Area Network, LAN),又称内网。指覆盖局部区域(如办公室或楼层)的计算机网络。按照网络覆盖的区域(距离)不同,其他的网络类型还包括个人网、城域网、广域网等。早期的局域网网络技术都是各不同厂家所专有,互不兼容。后来,电机电子工程师学会推动了局域网技术的标准化,由此产生了IEEE 802系列标准。这使得在建设局域网时可以选用不同厂家的设备,并能保证其兼容性。这一系列标准覆盖了双绞线、同轴电缆、光纤和无线等多种传输介质和组网方式,并包括网络测试和管理的内容。随着新技术的不断出现,这一系列标准仍在不断的更新变化之中。以太网(IEEE 802.3标准)是最常用的局域网组网方式。以太网使用双绞线作为传输介质。在没有中继的情况下,最远可以覆盖200米的范围。最普及的以太网类型数据传输速率为100Mb/s,更新的标准则支持1000Mb/s和10Gb/s的速率。其他主要的局域网类型有令牌环和FDDI(光纤分布数字接口,IEEE 802.8)。令牌环网络采用同轴电缆作为传输介质,具有更好的抗干扰性;但是网络结构不能很容易的改变。FDDI采用光纤传输,网络带宽大,适于用作连接多个局域网的骨干网。近两年来,随着802.11标准的制定,无线局域网的应用大为普及。这一标准采用2.4GHz 和5.8GHz 的频段,数据传输速度最高可以达到300Mbps和866Mbps。局域网标准定义了传输介质、编码和介质访问等底层(一二层)功能。要使数据通过复杂的网络结构传输到达目的地,还需要具有寻址、路由和流量控制等功能的网络协议的支持。TCP/IP(传输控制协议/互联网络协议)是最普遍使用的局域网网络协议。它也是互联网所使用的网络协议。其他常用的局域网协议包括,IPX、AppleTalk等。在无线 LAN 中,用户可以在覆盖区域内不受限制地移动。无线网络因其易于安装而在住宅和小型企业中流行起来。大多数无线局域网都使用 Wi-Fi,因为它内置于智能手机、平板电脑和笔记本电脑中。客人通常可以通过热点服务上网。网络拨接互联网(英语:Internet)是指20世纪末期兴起电脑网络与电脑网络之间所串连成的庞大网络系统。这些网络以一些标准的网络协议相连。它是由从地方到全球范围内几百万个私人、学术界、企业和政府的网络所构成,通过电子、无线和光纤网络技术等等一系列广泛的技术联系在一起。互联网承载范围广泛的信息资源和服务,比方说相互关系的超文本文件,还有万维网(WWW)的应用、电子邮件、通话,以及文件共享服务。互联网的起源可以追溯到1960年代美国联邦政府委托进行的一项研究,目的是创建容错与电脑网络的通信。互联网的前身ARPANET最初在1980年代作为区域学术和军事网络连接的骨干。1980年代,NSFNET(英语:NSFNET)成为新的骨干而得到资助,以及其他商业化扩展得到了私人资助,这导致了全世界网络技术的快速发展,以及许多不同网络的合并结成更大的网络。到1990年代初,商业网络和企业之间的连接标志着向现代互联网的过渡。尽管互联网在1980年代只被学术界广泛使用,但商业化的服务和技术,令其极快的融入了现代每个人的生活。互联网并不等同万维网,互联网是指凡是能彼此通信的设备组成的网络就叫互联网,指利用TCP/IP通讯协定所创建的各种网络,是国际上最大的互联网,也称“国际互联网”。万维网是一个由许多互相链接的超文本组成的系统,通过互联网访问。在此定义下,万维网是互联网的一项服务。不过多数民众并不区分两者,常常混用。连接技术:任何需要使用互联网的计算机必须通过某种方式与互联网进行连接。互联网接入技术的发展非常迅速,带宽由最初的14.4Kbps发展到目前的100Mbps甚至1Gbps带宽,接入方式也由过去单一的电话拨号方式,发展成现在多样的有线和无线接入方式,接入终端也开始朝向移动设备发展。并且更新更快的接入方式仍在继续地被研究和开发。架构:最顶层的是一些应用层协议,这些协议定义了一些用于通用应用的数据报结构,包括FTP及HTTP等。中间层是UDP协议和TCP协议,它们用于控制数据流的传输。UDP是一种不可靠的数据流传输协议,仅为网络层和应用层之间提供简单的接口。而TCP协议则具有高的可靠性,通过为数据报加入额外信息,并提供重发机制,它能够保证数据不丢包、没有冗余包以及保证数据包的顺序。对于一些需要高可靠性的应用,可以选择TCP协议;而相反,对于性能优先考虑的应用如流媒体等,则可以选择UDP协议。最底层的是互联网协议,是用于报文交换网络的一种面向数据的协议,这一协议定义了数据包在网际传送时的格式。目前使用最多的是IPv4版本,这一版本中用32位定义IP地址,尽管地址总数达到43亿,但是仍然不能满足现今全球网络飞速发展的需求,因此IPv6版本应运而生。在IPv6版本中,IP地址共有128位,“几乎可以为地球上每一粒沙子分配一个IPv6地址”。IPv6目前并没有普及,许多互联网服务提供商并不支持IPv6协议的连接。但是,可以预见,将来在IPv6的帮助下,任何家用电器都有可能连入互联网。互联网承载着众多应用程序和服务,包括万维网、社交媒体、电子邮件、移动应用程序、多人电子游戏、互联网通话、文件分享和流媒体服务等。提供这些服务的大多数服务器托管于数据中心,并且通过高性能的内容分发网络访问。万维网(英语:World Wide Web)亦作WWW、Web、全球广域网,是一个透过互联网访问的,由许多互相链接的超文本组成的信息系统。英国科学家蒂姆·伯纳斯-李于1989年发明了万维网。1990年他在瑞士CERN的工作期间编写了第一个网页浏览器。网页浏览器于1991年1月向其他研究机构发行,并于同年8月向公众开放。罗伯特·卡里奥设计的Web图标万维网是信息时代发展的核心,也是数十亿人在互联网上进行交互的主要工具。网页主要是文本文件格式化和超文本置标语言(HTML)。除了格式化文字之外,网页还可能包含图片、视频、声音和软件组件,这些组件会在用户的网页浏览器中呈现为多媒体内容的连贯页面。万维网并不等同互联网,万维网只是互联网所能提供的服务其中之一,是靠着互联网运行的一项服务。参考文献: Wendell Odom. CCENT/CCNA ICND1 100-105 Official Cert Guide. Cisco Press. 2016: 43页. ISBN 978-1-58720-580-4.Internet协议观念与实现ISBN 9577177069Internet协议观念与实现ISBN 9577177069IEEE 802.3-2008 Section 3 Table 38-2 p.109IEEE 802.3-2008 Section 3 Table 38-6 p.111网络化生存,乔岗,中国城市出版社,1997年,ISBN 978-7-5074-0930-7Richard J. Smith, Mark Gibbs, Paul McFedries 著,毛伟、张文涛 译,Internet漫游指南,人民邮电出版社,1998年. ISBN 978-7-115-06663-3世界是平的,汤马斯·佛里曼 著,2005年出版. ISBN 978-986-80180-9-9内容采用CC BY-SA 3.0授权。浏览量2690 万讨论量9728 帮助中心知乎隐私保护指引申请开通机构号联系我们 举报中心涉未成年举报网络谣言举报涉企侵权举报更多 关于知乎下载知乎知乎招聘知乎指南知乎协议更多京 ICP 证 110745 号 · 京 ICP 备 13052560 号 - 1 · 京公网安备 11010802020088 号 · 京网文[2022]2674-081 号 · 药品医疗器械网络信息服务备案(京)网药械信息备字(2022)第00334号 · 广播电视节目制作经营许可证:(京)字第06591号 · 服务热线:400-919-0001 · Investor Relations · © 2024 知乎 北京智者天下科技有限公司版权所有 · 违法和不良信息举报:010-82716601 · 举报邮箱:jubao@zhihu.
What Is Ethernet? - Cisco
Skip to content
Skip to search
Skip to footer
Cisco.com Worldwide
Products and Services
Solutions
Support
Learn
Explore Cisco
How to Buy
Partners Home
Partner Program
Support
Tools
Find a Cisco Partner
Meet our Partners
Become a Cisco Partner
SolutionsNetworking
What Is Ethernet?
If two or more connected devices on a shared network attempt to transmit data packets at the same time, a packet collision occurs. Ethernet technology provides rules that allow network-connected devices to talk to one another without packet collisions.
Explore Cisco NetworkingWhat is a WAN?
Contact Cisco
Get a call from Sales
Call Sales:
1-800-553-6387
US/CAN | 5am-5pm PT
Product / Technical Support
Training & Certification
What Is Ethernet?
Ethernet technology provides rules that allow network-connected devices to talk to one another without talking over each other. In a verbal conversation, when two people speak at the same time, each may have difficulty understanding what the other is saying. This is amplified when, say, 10 people are talking at once. Imagine 100 or 1000 at once.
The same is true for a data network. If two or more connected devices on a shared network attempt to transmit data packets at the same time, a packet collision occurs. The pulses of electricity or photons that make up a packet overlap when sent at the same time over a shared copper or optical cable. This jumbles the sequence of "on" pulses and "off" voids that are sent to indicate the bits and bytes of 1s and 0s that make up a packet.
Ethernet was designed to solve the problem of packet collision. It provides network devices with a set of rules that essentially says: "Make sure no one else is talking before you talk. If you hear someone talking while you're talking, stop, listen, and wait for the talking to end before you talk again."
Ethernet is commonly associated with connected devices in a wired LAN or WAN. Using a wired Ethernet cable, devices are connected to an Ethernet switch. Ethernet has the ability to use both wired and fiber cables, delivering not only data but also power, now up to 90W with UPOE+.
More formally, Ethernet is a common name for the IEEE 802.3 standard based on the Carrier Sense Multiple Access/Collision Detection (CSMA/CD) protocol. CSMA/CD defines when to transmit and what is to happen if a collision is detected, as well as endpoint addressing, transmission speeds, and media. Ethernet has evolved dramatically since its first application. Today it's the de facto protocol for IP-based networks.
Where did Ethernet originate?
The concept of Ethernet has its roots in the late 1960s and the University of Hawaii's Aloha Network. Aloha was a pioneering, experimental radio-communications network connecting the Hawaiian Islands to a central time-shared computer on the main campus, in Oahu.
Aloha was often referred to as one of the first wireless packet networks. It used two radio frequencies, separating send and receive data that passed between user terminals and the main hub connected to the computer. Designed for simplicity, the network followed these rules:
Send a packet when you're ready and wait for a receipt acknowledgement.
If no acknowledgement occurs, resend at some random time.
As use of the network grew, it became obvious that packet collision would severely limit the capacity of the network as designed. Researching the problem for his doctoral thesis, a young computer science student, Bob Metcalfe, devised a solution. His innovation earned him not only his Harvard Ph.D. but a place in history as the inventor of Ethernet. Metcalfe's solution: Listen before you talk.
In 1972, Metcalfe took Ethernet from idea to fruition with the first experimental Ethernet system, created at Xerox PARC. The network had an initial speed of 2.94 Mbps and linked Xerox Altos mainframes, servers, and printers using inexpensive coaxial cable.
At the time, Ethernet competed with Token Ring, ARCnet, Fiber Distributed Data Interface (FDDI), and other proprietary protocols. It quickly rose to dominance as it was open and reliable, yet inexpensive. Today, it supports speeds from 1 Mbps to 400 Gbps and beyond.
When was the Ethernet standard created?
Ethernet was formalized in 1983 as the IEEE 802.3 Ethernet standard. It is one of 12 in the IEEE 802 family of variable-size packet LAN standards. IEEE 802 services and protocols focus on the physical and data link layers of a network. In the Open Systems Interconnection (OSI) networking model, those layers are known as Layer 1 and Layer 2, respectively.
Based on the addressing scheme used in early implementations of Ethernet, the IEEE 802 standards use Media Access Control (MAC) addresses, which are unique identifiers typically assigned to endpoint access hardware by device manufacturers. The most significant part of a MAC address identifies the manufacturer, which assigns the remainder of the address, potentially providing a unique address. This makes it possible for frames to be delivered within a network that interconnects sender and receiver through some combination of Ethernet switches.
Routers are used to pass packets between networks and use IP addresses rather than MAC addresses to tag packets' origination and destination points. Using the U.S. Postal Service as an analogy, IP addresses are like ZIP codes, while MAC addresses are like street addresses or post office boxes.
What are Ethernet frames?
In an Ethernet network, data is broken into packets, with each packet transmitted using the CSMA/CD algorithm until it arrives at its destination without colliding with any other packet. The first open slot after a transmission is reserved for an acknowledge packet. A device or node is either transmitting or receiving at any instant.
When sending data to another device on an Ethernet network, the MAC sublayer (data link sublayer):
Encapsulates higher-level frames into frames appropriate for the transmission medium
Adds a frame check sequence to identify transmission errors
Forwards the data to the physical layer as soon as the CSMA/CD protocol permits, waiting as necessary to avoid collisions.
Is responsible for compensating for collisions by starting retransmission when a collision (jam signal) is detected.
When receiving data from the physical layer, the frame check sequence in the MAC block is used to ensure data integrity. It strips off the sender's Ethernet-packet preamble and padding before passing the data to the higher layers.
The Ethernet switch creates the frame by encapsulating the Ethernet packet with a preamble, which is used to synchronize the sender and receiver, followed by a 1-octet start-frame delimiter byte.
The Ethernet packet includes the data encapsulated by a header and a frame check value. The MAC header provides the source and destination MAC addresses as well as a 2-octet EtherType code indicating IPv4 or IPv6, MACsec encryption, etc. The frame ends with a frame check sequence (FCS), which is a 32-bit cyclic redundancy check used to detect any in-transit corruption of data.
What is a CSMA/CD protocol?
When a frame is ready, the transmitting station checks to see whether the channel is idle or busy. If the channel is busy, the station waits until the channel becomes idle. If the channel is idle, the station starts transmitting and continually monitors the channel to detect collision.
Related topics
Related products and solutions
2020 Ethernet Roadmap, created by the Ethernet Alliance
You may also like…
What Is a LAN (Local-Area Network)?
What Is WAN (Wide-Area Network)?
What Is SD-WAN (Software-Defined WAN)?
What Is PoE (Power over Ethernet)?
What Is PON (Passive Optical Networking)?
How the Ethernet Protocol Works – A Complete Guide
Search
Submit your search query
Forum
Donate
October 21, 2022
/
#Computer Networking
How the Ethernet Protocol Works – A Complete Guide
Omer Rosenbaum
Whether you’ve been aware of it or not, you’ve probably used the Ethernet in the past. Does this cable look familiar?(Source: Wikipedia)Ethernet is extremely popular, and is the most widely used Data Link Layer protocol, at least where the devices are linked by physical cables (rather than wireless). If you need a reminder about the Data Link Layer and its role within the Layers Model, check out my previous post.In this tutorial, you will learn everything about Ethernet – its history, as well as every bit and byte of the Ethernet frame. You will also get to know how protocols are formed, why it is so hard to change them after they are published, and what lessons can be learned for other protocols.Here's what we'll cover:Some Ethernet HistoryEthernet Frame Overview– Before the frame – preamble (8 bytes)– Destination Address and Source Address (6 bytes each)– Type / Length field – Ethernet II (Type) (2 bytes)– Data and Pad (46-1500 bytes)– Checksum – CRC32 (4 bytes)– The Problem with the Type / Length FieldHow Ethernet Addresses Work– Unicast and Multicast Bits– Globally Unique / Locally Administered BitWhy Does an Ethernet Frame Have a Minimum Length?– How are Collisions Handled in Ethernet?ConclusionSome Ethernet HistoryThe first version of Ethernet was implemented in 1976. In 1978 a second version was published by DEC, Intel, and Xerox who worked together to publish DIX (which stands for DEC, Intel and Xerox). This was also called "Ethernet II". In 1983, with a change that we will discuss soon, a new Ethernet version was released – the IEEE 802.3 standard, by the IEEE standards association.Both Ethernet II and IEEE 802.3 are widely used, so we will cover them both. As you will see, they are almost identical. Usually, both are simply referred to as “Ethernet”. For this tutorial, in order to be precise about what we mean, I will explicitly state whether I'm talking about Ethernet II or IEEE 802.3.The versions of Ethernet (Source: Brief)Ethernet Frame OverviewLet's consider the Ethernet Frame format:Ethernet Frame Header and Trailer (Source: Brief)Before the Frame – Preamble (8 bytes)First comes a Preamble consisting of 8 bytes, each containing the bit pattern of alternating 1s and 0s, that is, 10101010. In Ethernet II, all 8 bytes had this pattern. In 802.3, the seven first bytes carry the value 10101010, yet the last bit of the last byte is set to 1, so the byte carries the value of 10101011. This last byte is called the Start of Frame. The last two 1 bits tell the receiver that the rest of the frame is about to start. Sending this bit pattern before a new frame allows devices on the network to easily synchronize their receiver clocks. Note that the preamble is not really a part of the actual frame – it only precedes every frame, and thus you won't see it on many diagrams of the Ethernet protocol.Ethernet Preamble (Source: Brief)Destination Address and Source Address (6 bytes each)Next, we have two addresses, each consisting of 6 bytes. I'll describe Ethernet Addresses in more detail later on in this post, but for now, let's notice that a frame starts with a destination address, followed by the source address. Why would the frame start with the destination address? Is there a reason for that?Well, there is. The very first thing a device is likely to do with a frame it has received is to check whether this frame is destined to it, or not. If the frame is not destined to this device, it can be simply dropped. Therefore, the destination address comes in first.Why is the source address important? Well, to know to whom the receiver should send a reply, if necessary. This source address also plays a role in the way some network devices are implemented, as we will see in future posts.Type / Length field – Ethernet II (Type) (2 bytes)Next comes a quite problematic field, called the Type or Length field.In Ethernet II, this field is called Type, and tells the receiver what payload this frame carries. For instance, if this frame carries an IP layer (that is, the data of the Ethernet layer is an IP packet), then the receiving network card should forward the frame’s payload to the IP handler. If the frame’s payload is ARP, then the ARP handler should deal with it. By handler I mean the code that handles this protocol, for instance the code that parses ARP.We will come back to the need for Length and how it is dealt within IEEE 802.3 shortly.In Ethernet II, the Type field carries the type of the payload (Source: Brief)Data and Pad (46-1500 bytes)After this field, we get up to 1500 bytes of Data. This number was chosen because RAM was expensive back in 1978, and a receiver would have needed more RAM if the frame had been bigger.This means that if the third layer wants to send more than 1500 bytes of data over Ethernet, it must be sent across multiple frames.There is also a minimum length of data, which is 46 bytes. Together with the other fields of the frame, the minimum length of an Ethernet frame is 64 bytes in total.Why would we need a minimum frame length? We will discuss this in a subsequent section.For now, given that we have a minimum length for an Ethernet frame, what happens if the sender wants to send a very short message, let’s say just one byte? In that case, the sender has to pad the message, for instance with 0s until reaching the minimum length. For example, if the sender wants to send only 1 byte of data, such as the letter A, they will have to add 45 bytes of 0s.46-1500 bytes of data, with padding if needed (Source: Brief)Checksum – CRC32 (4 bytes)Last but not least, we have a Checksum. This is a 32-bit CRC checksum, used to determine whether the bits of the frame have been received correctly. In case of an error, the frame is dropped. The CRC is computed on the entire frame – that is, including the header. Notice that it doesn’t include the preamble, as it is not really a part of the frame.When we use CRC-32 for the checksum, we set a fixed overhead of 32 bits, or 4 bytes, regardless of the length of the data. In other words, if we send only 1 byte of data, we get a 32-bit checksum, and if we send a thousand bytes of data – we still get 32-bits of checksum.The Problem with the Type / Length FieldEarlier, we mentioned that the Data field has to be at least 46 bytes long, and if not, we pad it. For simplicity’s sake, let’s assume we pad with 0s, as the standard indicates. Well, we actually have a problem here.Let’s say the sender wants to send a single byte, consisting of the character A. So they will send an A followed by 45 0s.What happens in case the sender wants to send A and zero? That is, the data actually consists of A0. In this case, they would also send an A, followed by 45 0s. But this time, the first zero is actually part of the data, and not the padding.Whether the sender would like to send A as data or A0 as the data, due to padding the frame consists of A and 45 0s (Source: Brief)As a receiver, you'd need a way to differentiate these cases, and understand which bytes belong to the padding, and which bytes belong to the data, in case of a short frame.Ethernet II dealt with this problem by… Well, not handling it. That is, the third layer will receive the data and the padding, which would be an A followed by 45 0s in this example. It will then have to figure out on its own which bytes belong to the data and which don’t. This is doable, of course, if the third layer includes a length field. However, this solution is far from elegant – why would the third layer deal with a padding problem that should be dealt with by the second layer? This is a clear violation of our layers model (if you would like to see an overview about the Layers Model, refer to this tutorial).For this reason, IEEE decided to change the Type field into a Length field in IEEE 802.3 . So, for example, a frame carrying a single byte of data, A, will have the Length field set to 1, whereas a fame carrying two bytes of data, A0, will have the Length field set to 2. In 802.3, the Length field sets the data apart from the padding (Source: Brief)This is an elegant solution, but now two issues arise:First, if you receive an Ethernet frame, how do you know if it’s an Ethernet II frame, where this field means Type, or an IEEE 802.3 frame, where this field means length?Second, what happens with the Type field? How would the receiver know what protocol is carried inside the frame?Let's start with the first question. Just to clarify, by the time IEEE 802.3 was published, many Ethernet cards had already been in use. People didn’t want to replace their network cards just because a new standard was published. Think about it, would you want to buy a new network card? Or perhaps your friends who are not programmers – would they get a new card as someone told them that "the internet geeks" decided that there was "a new standard" (whatever that means?).The solution was to allow both Ethernet II and IEEE 802.3 to operate on the same network.Fortunately, all the Type values used at that time had greater values than 1500. The solution is thus straightforward: in case this field has a value less than or equal to 1500, it actually means Length. In case it has a value greater than or equal to 1536, it means Type. The values in between currently have no meaning.The Type/Length field is divided: values equal to or lower than 1500 are Length values, and values equal to or greater than 1536 are Type values. (Source: Brief)For example, if we see a frame where the value of this field is 400, it is clear that we have an IEEE 802.3 frame, which is 400 bytes long.Now you try: in case we see a frame where this field is set to 20, is it an Ethernet II frame or IEEE 802.3 frame? Indeed, this is an IEEE 802.3 frame, which has 20 bytes of data, and thus 26 bytes of padding. And… in case we see a frame where this field is set to 2000? In this case we know that this is an Ethernet II frame, and 2000 is the Type.So this is how we know whether we are dealing with an Ethernet 2 or an IEEE 802.3 frame.Next, how does an IEEE 802.3 frame contain the Type information? That is, given that IEEE 802.3 overrode the Type field, there was no way for the receiver to figure out what to do with an incoming frame. Thus, IEEE 802.3 adds another header of the 802.2 LLC (Logical Link Control) protocol right before the data. This header conveys the type information.So an IEEE 802.3 frame will have a destination address field, then a source field, then a length field, and then an LLC header, followed by the data and the checksum.Wait, wasn't IEEE 802.3 published in 1983? Why is it relevant? As mentioned beforehand, in 1978, Ethernet II was published. Not so long later, in 1983, a new format came out – and its authors allowed for backward compatibility, probably believing that in a few years, all devices would be upgraded to the new standard.Oh, were they wrong.If you check your own network (given that you are connected to an Ethernet one), I bet you will see Ethernet II frames. Your device probably supports both versions, but by default it will transmit Ethernet II frames, rather than 802.3. After all, it is guaranteed that any device connected to an Ethernet network can read Ethernet II frames, and it's not guaranteed that the device can read 802.3 ones. If Ethernet II works, why not use it? All third-layer protocols had to account for the fact that Ethernet doesn't solve the problem of differentiating data from padding. So if all protocols already deal with that, why don't we just...keep things the way they are?Endpoint devices (such as personal computers) almost always communicate over Ethernet II. IEEE 802.3 is also very common, though, and it's used by default on most modern network devices (such as switches).This story actually entails a really important lesson.It is very, very hard to replace protocols after the fact, especially when they are implemented on hardware devices (such as network cards).What's an Interpacket Gap?After an Ethernet frame is sent, transmitters wait a very short period of time before transmitting the next frame, in order to allow the receiver to know that the transmission of a frame is over. This idle time between frames is called the “Interpacket gap”.How Ethernet Addresses WorkEvery Ethernet frame carries two addresses – first, the destination, and second, the source. We mentioned that the destination address appears first so the receiver will be able to tell whether the frame is relevant for it. If not, the frame will be discarded.Ethernet addresses within the Ethernet Frame (Source: Brief)What does an Ethernet address look like?An Ethernet address consists of 6 bytes – that is, 48 bits. Usually, they are presented in hexadecimal base, delimited either by dashes or colons, as you can see in these examples: Two representations of the same Ethernet Address (Source: Brief)00:01:42:a9:c2:dd
00-01-42-a9-c2-ddThese are two representations of the exact same Ethernet address, and there is no real difference between the two.In general, Ethernet addresses are supposed to be globally unique. That is, no two Ethernet devices share the same address (at least, in theory). The first 3 bytes of any address is called the OUI – Organizationally Unique Identifier. To make sure the addresses are unique, IEEE assigns these OUIs to various manufacturers, such as Dell, HP or IBM. This part of the address is also called the Vendor ID (with the exception of the two least significant bits, as we will see). Then, the manufacturers assign the remaining 3 bytes to specific hosts. This part is also called the Host ID.The most significant 3 bytes are the Vendor ID, and the least significant 3 bytes are the Host ID (Source: Brief)For example, the OUI 00:01:42 belongs to Cisco. Now, Cisco can manufacture a network card and assign it the address 00:01:42:00:00:01. Next, it can manufacture another card and assign it the address 00:01:42:00:00:02, and so on. These two addresses share the same Vendor ID, but have different Host IDs.Since a single OUI leaves 3 bytes to be used for the host IDs, we have 2^24 host IDs per OUI – that is, 16,777,216 host IDs. Of course, big manufacturers need many more addresses, and thus they are assigned additional OUIs. For example, 00:01:64 is another OUI that belongs to Cisco.Unicast and Multicast BitsEthernet addresses also consist of two special bits.The first special bit indicates whether the address is a unicast or a multicast address. Unicast means that the address represents a single device. Multicast addresses represent a group of devices – such as all printers on the network, or all devices in the same local network. The bit representing whether the address is unicast or multicast is the least significant bit within the most significant byte. Wait, what?Consider the following Ethernet address:06:b2:d9:a2:32:9eThe most significant byte is 06.Let’s convert this to binary:00000110Now we look at the least significant bit – that is, this 0:When the least significant bit within the most significant byte is set to 0, this is a Unicast address (Source: Brief)This bit is off. This means that this is a unicast address. In other words, it belongs to a single device, such as a computer’s network card.Let’s consider another address:11:c0:ff:ee:d8:abThe most significant byte is 11 (in hexadecimal base).Let’s convert this to binary:00010001When the least significant bit within the most significant byte is set to 1, this is a Multicast address (Source: Brief)The least significant bit is this one. Since it is on, we can tell that this is a multicast address. That is, it’s an address of a group. You can send a frame to this address, and all devices that belong to this group will consider the frame as sent to them.One very famous multicast address is called the broadcast address, that is – the group that contains all machines. The address of this group is:FF:FF:FF:FF:FF:FFIn other words, the address where all bits are on.All the machines are part of the broadcast group.Globally Unique / Locally Administered BitThe second special bit indicates whether the address is indeed globally unique. This bit is the second least significant bit within the most significant byte. Um, what?Well, again, consider the first address from before:06:b2:d9:a2:32:9eThe first byte is 06.Converted to binary, we get:00000110So the second least significant bit is the one right here:When the second least significant bit within the most significant byte is set to 1, this address is not globally unique (Source: Brief)This bit is on, and thus we know that this address is actually not globally unique. IEEE will never assign this address to any vendor. So what is this address? Well, in this case it’s just one that I’ve made up. If I wanted to, I could assign it to a specific device. The fact that this bit is on declares that it is not globally unique.Consider another address:00:01:42:a9:c2:ddThe first byte is 00, so the second least significant bit is 0.This is indeed a globally unique address, assigned to Cisco.Ethernet Addresses – RecapSo, all in all, an Ethernet address has two main parts: The vendor ID, and the host ID.There are also two special bits: the least significant bit within the most significant byte states whether the address is unicast or multicast. The second least significant bit within the most significant byte states whether the address is globally unique.Why Does an Ethernet Frame Have a Minimum Length?This is more of a "bonus" part of this post, and concerns collisions. Collisions is a very interesting topic, but since this post focuses on the Ethernet protocol, collisions will not be of our focus. I will therefore address this issue just briefly. While it's not crucial to understand in order to understand Ethernet frames, I promised a complete overview of the Ethernet protocol. In the overview, I mentioned that an Ethernet frame consists of minimum 46 bytes of data and maximum 1500 of data. I already explained why we have that maximum limit, but what about the minimum?To simplify our discussion, let's consider a network using classic Ethernet where all computers are attached to a single cable.A "classic Ethernet" network with four devices connected via a single cable (Source: Brief)Let’s say A wants to send a message to B, and C wants to send a message to D. Let’s say that while A is transmitting its frame, C is also transmitting its frame. In this case, the frames will collide.In case two devices transmit data on the same time - their frames will collide (Source: Brief)When this happens, we get errors – much like the case where two people start to speak in the same time, and it is impossible to understand either of them. How are collisions handled in Ethernet?Ethernet uses two main mechanisms to deal with collisions. The first is called CSMA, which stands for Carrier Sense Multiple Access. This basically means that when a station wants to transmit data, it first senses the channel to see if anyone else is transmitting by checking the signal level of the line. If the channel is in use, the station will wait and try again.So, if A is transmitting, and C wants to send data, C will wait until A finishes its transmission before starting to transmit.This is just like the case in a human conversation, where one person waits until the other stops talking, and only then does that person talk.Yet, just like the case where two people might start talking at the same time, two Ethernet machines might start transmitting data at the same time. In this case, CD – Collision Detection – comes into play. Collision Detection means that the transmitting devices detect the fact that a collision has occurred. This is achieved by listening to the channel while transmitting.For example, assume that station A transmits the bit stream 11001010. While transmitting, A is also listening to the channel. If no collision occurred, A would also read the signal 11001010 from the line.With Collision Detection, A is listening to the channel while transmitting data. In case no collision occurred, A will sense exactly the bitstream it has sent (Source: Brief)If, however, a collision occurred, say with a frame sent by C, then A would read something different from the line – for instance, 11011010. This way, machine A realizes that its frame has collided.With Collision Detection, A is listening to the channel while transmitting data. In case of a collision, A reads a different bitstream than that it has sent (Source: Brief)Machine A can realize that a collision has occurred even before it finished transmitting the frame. Then, machine A stops transmitting and issues a JAM signal to tell the other station that a collision has occurred. As a result, both stations stop transmitting and wait a random interval of time before trying to submit again. The amount of time that the stations wait increases with the number of collisions in the network. So on the first collision, A and C wait for a relatively short amount of time before transmitting again. If another collision occurs, they might wait longer.After a collision occurs, the amount of time that the stations wait increases with the number of collisions in the network (Source: Brief)Now, back to Ethernet. Ethernet requires that valid frames must be at least 64 bytes long, from destination address to checksum, including both. So, that data has to be at least 46 bytes long. If the frame is too short, then it must be padded.The minimum length of an Ethernet frame consists of 46 bytes of data, or 64 bytes overall (Source: Brief)One reason for having this minimum is directly related to the collision detection mechanism stated above.Let's consider the following scenario. Host A wants to transmit a really really short frame to B, a frame that is only 1 byte long. I am exaggerating of course, this can’t really happen in Ethernet, but it will be helpful for the explanation. Host A transmits this frame, which consists of 8 1s. Then, A listens to the channel while transmitting, and also reads 8 1s from it, reaching the conclusion that the frame has been transmitted successfully. However, before the frame reaches the other end of the network, D starts transmitting a very short frame, one byte long, consisting of 8 0s. D listens to the channel while transmitting, and also reads 8 0s from it, concluding that the frame has been transmitted successfully.Both A and D send a really short frame, and they finish transmitting without realizing a collision is liable to take place (Source: Brief)Now, these two really short frames collide. Yet, neither A nor D are aware of this collision, as they have already concluded that the frame has been successfully delivered.In order to avoid such cases, the frame must be long enough to prevent a station from completing its transmission before the first bit of the frame reaches the far end of the line. Having a minimum length for Ethernet frames solves this issue.This was a very short discussion of collisions. If you’d like to know more about this topic, refer to the "additional resources" section below.ConclusionIn this tutorial, we covered every bit and byte of the Ethernet protocol. You should now have a good understanding of this protocol, as well as a reference to consult when needed. About the AuthorOmer Rosenbaum is Swimm’s Chief Technology Officer. He's the author of the Brief YouTube Channel. He's also a cyber training expert and founder of Checkpoint Security Academy. He's the author of Computer Networks (in Hebrew). You can find him on Twitter.Additional ReferencesComputer Networks Playlist - on my Brief channelCarrier-sense multiple access with collision detection - WikipediaCarrier Sense Multiple Access Collision Detect (CSMA/CD) Explained - ITPRC
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
ADVERTISEMENT
Omer Rosenbaum
Read more posts.
If you read this far, thank the author to show them you care. Say Thanks
Learn to code for free. freeCodeCamp's open source curriculum has helped more than 40,000 people get jobs as developers. Get started
ADVERTISEMENT
freeCodeCamp is a donor-supported tax-exempt 501(c)(3) charity organization (United States Federal Tax Identification Number: 82-0779546)
Our mission: to help people learn to code for free. We accomplish this by creating thousands of videos, articles, and interactive coding lessons - all freely available to the public.
Donations to freeCodeCamp go toward our education initiatives, and help pay for servers, services, and staff.
You can make a tax-deductible donation here.
Trending Guides
Delete File in Linux
What is :: in Python?
Python PWD Equivalent
JSONObject.toString()
What is SSH in Linux?
Max int Size in Python
Python Bytes to String
Git Pull Remote Branch
Fix Git Merge Conflicts
JavaScript Refresh Page
Git Revert
JSON Comments
Java Use Cases
Python Copy File
Linux cp Command
Python list.pop()
JS Sum of an Array
Python Split String
HTTP Request Methods
Compare Strings in C
What Does $ Mean in JS?
Python range() Function
Pandas Iterate Over Rows
Initialize a List in Java
Check for Empty String JS
Initialize ArrayList Java
Delete Environment in Conda
Pretty Print JSON in Python
What Does $ Mean in Python?
Check for Empty List Python
Mobile App
Our Charity
About
Alumni Network
Open Source
Shop
Support
Sponsors
Academic Honesty
Code of Conduct
Privacy Policy
Terms of Service
Copyright Policy