A transmission of data begins when a node on a network somewhere requests data from a different network on the internet. Data is transmitted in blocks called frames.
The structure of a frame depends on the link protocol that the network is using. However, all frame formats wrap an Internet Layer payload with metadata that explains how to send it across the network. (This is called encapsulation. Chapter 2 explains encapsulation in more detail.)
MAC Addresses
A node’s MAC address is a globally unique value that is “burned” into the read-only memory (ROM) of the node’s network interface card (NIC). So, theoretically, no two nodes anywhere in the world have the same MAC address. “Theoretically” because duplicate MAC addresses due to manufacturing errors, hacking, or administrative errors have occurred, although these are extremely rare.
MAC addresses are six bytes, or 48 bits, long, usually notated as six groups of two hex digits separated by a colon or hyphen, e.g. 0e:da:4c:53:f0:b4
. The first three sets of values are a three-byte ID assigned to a specific manufacturer; for example a NIC with a MAC address beginning with 60:33:4B
was manufactured by Apple. The last three bytes are the serial number for a specific NIC, as assigned by the manufacturer.
Ethernet Frames
The most common link-layer protocol in use — by far — is Ethernet. An Ethernet frame contains the following:
- Source MAC address. Six bytes.
- Destination MAC address. Six bytes.
- Length of the data being sent, or the data payload. Two bytes.
- Destination Service Access Point (DSAP), Source Service Access Point (SSAP) and Control. One byte each for DSAP and SSAP; Control may be either one or two bytes. These three together are also called the LLC header, for Logical Link Control. This header gives specifics about the protocol being used by communicating networks.
- The data payload.
- A frame check sequence. This is generated by an algorithm based on the value of bits in the address, type, and data fields. If the check shows corrupt data, the frame is dropped.
Basically, then, a frame consists of a source MAC address, the destination MAC address, some other metadata for control purposes, and the payload. (The payload is an Internet Layer PDU, which is called a packet. We’ll cover packets next, when we take up the Internet Layer.)
How Ethernet Frames Are Sent
To send an Ethernet frame, the sender first sends the recipient a preamble and a start-of-frame delimiter (SFD). These are used to notify the receiving device that a frame is on the way. The Ethernet preamble consists of seven bytes (a byte is — usually — eight bits; octet is a more precise term), each set to 10101010
; the SFD is one byte, set to 10101011
. So, basically, a bunch of 10
sequences gets the listener’s attention, and then a 11
tells the listener that the frame is coming next.
Frames are also sent with a small gap between them, called, not surprisingly, an interframe gap or IFG. The standard size of this gap is 96 bit-times, or the amount of time required to send 96 bits across a given point on the medium in use. As such, the actual length time of this gap varies with the physical medium in use; faster media will have shorter IFGs than slower media in terms of actual time.
The underlying reason for an IFG is to give the receiving device time to decode the frame and reset for the next one. It’s important to be aware of IFGs because if two different Ethernet cards are having trouble transmitting data it can be because they are each working with different IFG time.
Ethernet frames define how to send data over the internet, but not where.
Determining Where to Send Data Frames
Using MAC addresses to work out where to send frames is unworkable.
MAC addresses are not structured hierarchically. This means that, while every physical device has its own MAC, there’s no way to organize different MACs by their physical location. So, if MAC addresses were used to figure out where to send data between networks, each message would have to be broadcast worldwide, flooding every node in the world with messages not its own, from which it would have to pick out messages with its own MAC address on it. Clearly, this is unworkable; nearly all messages that a given node received would be for a different one.
This problem of where to send data is solved at the internet layer, which implements a hierarchical system of addressing. The next article explains how the internet layer uses IP addresses to determine where data is to be sent.