(C) Mike Benjamin 24/09/2015
Ethernet Frames:
The ethernet frame is the core of local area, and sometimes even wide-area networking. Operating at Layer-2 in the OSI-layer concept, or Data-link layer (just one step above Layer-1 the Physical Layer), frames allow an efficient, fast method of delivery of data, before that data is translated into packets, encapsulated, or handled by things like MPLS / X.25 or protocols like TCP/IP at higher layers.
Do not confuse a Frame, with a Packet, as they are distinctly different items. A frame is PDU or a Protocol Data Unit at the data-link layer, and is normally not packet-switched/routed without additional encapsulation etc. They were originally designed to operate across simple serial connections, and simple networks, where packet-switching etc. is not in play.
Unlike a packet, a frame is not "aware" of more than one network, or carrying a payload (like an IP address) to allow it to be routed, this makes sense if you think about a single LAN, where machines are capable of sending out frames at Layer-2 on hubs etc. All it contains is the MAC addresses which network device/s can use to move the frame from source to destination. Examples of such devices might be hubs / bridges, and Layer-2 switches. The actual topology of the network is not important to the frame itself, but there are limitations to design/operation with just Layer-2.
Understanding the structure of an ethernet frame, will also allow you to have an understanding of
how the physical equipment at the OSI-Layer 1 - Physical Layer, that deals with these frames, is required to operate.
The frame is made up of the following:
Preamble (802.3):
This initial transmitted stream of 7 bytes (56 bits) is a sequence, with each byte pattern of 10101010 repeated 7 times. This preamble of digital signals gives the receiving device (be it a hub/switch port or a Network Interface Card) time to get ready, or to notify it, to receive the rest of the transmitted data within the frame. This is the 802.3 defined preamble.
SFD (Start-Frame-Delimiter):
A single byte (8 bits) then follows the preamble, this is known as the Start Frame Delimiter. It's structure will always be 10101011. Note the two 1's in sequence at the end of the byte. This different byte, compared to the preamble sequence, indicates to the remote equipment that the frame in essence, has now begun. Both the preamble and SFD will be discarded, and have no further use as data. Data immediately afterward is relevant frame data that will be utilised to get the data payload to the destination.
Destination MAC Address:
This 6 byte (48 bit) sequence, represents the destination MAC (Media Access Control) address that this frame should be sent to, (or forwarded to, if it is not the end-point). This is usually the target end-point for the frame in the network.
Typically, you will see this represented like this: D4-BE-D9-82-0A-03 or this: D4:BE:D9:82:0A:03. Sometimes, with no delimiters (- or :) at all: D4BED9820A03. These hexadecimal representations of the byte-values, are more for human consumption and ease of use, the first 3 bytes will represent the manufacturer of the equipment, and the last 3 will be an identifier like a serial number. In the above case, this MAC represents an imbedded Network Interface Card (NIC) - "Intel(R) 82579LM Gigabit Network Connection" in a notebook.
So a device like a hub, or a switch, that is moving traffic, will "see" the MAC address from the powered-on equipment attached, store that in a small table and correlate that MAC address with a physical port number. It then knows where to fire the stream of electrical signals that make up the frame to.
Source MAC Address:
Source is the same as above, but represents the equipment that initiated / constructed, and sent the frame. Source MAC (and destination) can be over-written, but that is for another discussion. For the moment, consider that it is the origin of the traffic.
EtherType or Length:
This 2 byte (16 bit) field indicates either the EtherType or a explicit length of the frame content.
There are a number of types of Ethernet frame types detailed here:
http://academic.keystone.edu/Cisco/Documents/Sem1/ccna1-Mod5-EthernetFrameTypes.pdf
As the EtherType field went through an IEEE standardisation process, it was changed to a data length field in the new 802.3 standard. Normally it is not used to store frame length, rather type. If the equipment does not recognise the type value, it will interpret the value as a specific length.
Data (+ Pad if required):
The Data field contains the actual data that we want transmitted. The minimum Ethernet frame size is 64 bytes from the Destination MAC Address field including the Frame Check Sequence. If the size falls below this number the data field will be "padded" with addition extra redundant data bytes to bring the frame to a minimum 64 byte transmission. If a frame was smaller than this, it could cause problems with fragmentation, and beingidentified as a "runt" packet that may be discarded.
FCS:
This field consists of a 4-byte Cyclic Redundancy Check (CRC) value that is used for error checking. The CRC is calculated on all fields, EXCEPT: preamble, SFD and FCS fields. This is calculated by the sending device, and written into the FCS field before transmission. On arrival, a similar calculation is checked at the recieving device, if the recieving device figure does not match the FCS then the frame is considered corrupt, and must be discarded.
Note that frames, not being packets, and part of a protocol, have no built-in concept of connection-orientated service. FCS/CRC is the only way the receiving device knows that the frame is not corrupted or requires discard. If a frame is lost, some higher level logic must arrange the retransmit. Often termed LLC (Link-Layer Control). One common method is something called ARQ (Automatic Repeat reQuest) error control.
Data Link Layer - Flow Control
DCN - Data-link Control & Protocols
This would typically be implemented at a hardware layer, in the Network Interfaces and equipment themselves, rather than at a software level. Which also makes sense from the high speeds of transmission, or re-transmission involved.
Errata:
Post is still under revision and will be added to / improved.
If you spot any genuine errors in the post, typos, or better ways to phrase things, please drop a comment so this can be improved. Thanks.
Comments