What is Ethernet?
By Bruce Cyburt, Senior Design Engineer | March 26, 2018
Wixom, MI: Ethernet is a system of connecting more than two devices to form a Local Area Network (LAN) for sharing information and resources, technically referred to as the IEEE 802.3 protocol standard. Ethernet is considered a link layer protocol of a TCP/IP stack and controls how network data is formatted and how it is transmitted to other network devices. It includes protocols for passing information between devices while avoiding simultaneous transmission by devices and it is the most widely installed network topology used for Local Area Networks (LAN), Metropolitan Area Networks (MAN or confined to a single geographic area), and Wide Area Networks (WAN or spanning a large geographic area).
Briefly, Ethernet refers to a means for transporting messages across a network as datagrams. The actual payload (data) of a single datagram frame can be up to 1500 bytes. Long streams of Ethernet data are generally divided into shorter datagrams, each inserted into a frame for transport on the same LAN, or additionally in a packet for transport between networks.
A payload is first framed with fields that contain information about the data, such as its origin address and originating MAC (Media Access Control) address, its destination address and destination MAC address, its data type, VLAN tag information, plus QoS (Quality of Service) and error correction information helpful for detecting problems in transmission, allowing damaged frames to be discerned, discarded, and sometimes retransmitted. When destined for travel outside of a network, each framed datagram is additionally wrapped inside a packet which adds information used for establishing a connection and marking where the frame starts.
As a network standard, Ethernet was designed to use a shared medium for communication with other devices. When a device connected to an Ethernet network wants to send data to another device, it senses the presence of the carrier or main wire connecting the devices. If the carrier is free and no other devices are sending data, it transmits the datagram onto the network. All other devices connected to the carrier check that data message to see whether they are the intended destination, until the actual intended recipient discovers and consumes the packet. If instead, the sending device determines there is already a message on the carrier, it holds the datagram back for a moment and retires sending it when it senses the carrier is free. This approach to sharing its connection medium is referred to as CSMA/CD (Carrier Sense Multiple Access with Collision Detection).
The Internet Protocol (IP) and Ethernet Addressing
For any network, its “protocols” refer to the various rules its network devices use when they communicate over the network. You can view your own network and the internet as a collection of protocols for accomplishing network services/tasks. One key protocol is the Internet Protocol (IP). IP governs the rules for addressing network messages and exchanging message packets. It operates by placing messages/data into frames that include both destination and return addresses, and sending them along an IP network where they can be routed among many possible destinations, and in packets for traversing across many networks, but will ultimately be delivered to the right address. Linked sub-networks of a WAN do not know the specific location to which a packet is being sent, but only to what network the destination node resides at. They discern this using information stored in their routing tables to determine if a destination address matches a node in their own address domain or subnet, whereupon it can ultimately be routed to the appropriate host.
The Internet Protocol address (IP address) refers to the numerical label assigned to each network node — each host computer, printer, router, or other Ethernet device that has been inter-connected to form a network and that uses the Internet Protocol to communicate. An IPv4 address is 4 bytes long (32-bits), and IPv6 addresses are 16 bytes long (128-bits). IPv4 addressing still dominates the internet, but IPv6 has been implemented in parallel to continue to uniquely address Ethernet devices once IPv4 address space has been exhausted. Many modern devices support both IPv4 and IPv6 addressing and should remain operable when that day comes. The most widely supported IPv4 addresses are made up of four octets (four groups of 8 bits), where each octet has an integer value between 0 and 255 (00-FF Hexadecimal), allowing IPv4 to support up to 4.3 billion unique numeric addresses (232-2=4,294,967,296 addresses). You will see IPv4 addresses commonly expressed as a series of four integers from 0 to 255 with a period places between them and this format is referred to as dotted-decimal (like 22.214.171.124). A numeric IPv4 address like this is behind every web address name that you commonly use when you surf the internet. Every Ethernet device has an IP address assigned to it either manually, or automatically as part of connecting to a network, and the IP address serves as both a host or network interface ID, and a host/node location address (more on this later). Each node of a sub-network can only communicate directly with another node in its own address space (its own subnet).
While IP is the only addressing protocol used by Ethernet, Ethernet networks use two types of data transmission: TCP and UDP. Briefly, TCP refers to Transmission Control Protocol, and UDP refers to User Datagram Protocol. Contrasting the two, TCP is connection-oriented and first seeks to establish the connection, then transmits the data bi-directionally. UDP is simpler and connectionless — it just sends the data without first establishing a connection. The combination TCP/IP denotes the Transmission Control Protocol/Internet Protocol, while UDP/IP denotes User-Datagram Protocol/Internet Protocol. But for Ethernet, each of these protocols represent larger suites of communication protocols or stacks of protocols that define the details of how data is sent and received through inter-connected Ethernet devices such as: adapters, hubs, switches, gateways, and routers.
The Dynamic Host Configuration Protocol (DHCP) is a method used to automatically assign temporary IP addresses to devices as needed. A device set to obtain its IP address automatically via DHCP looks up the LAN DHCP server and requests an IP address when connected. The DHCP server maintains a “pool” or range of IP addresses that are dynamically assigned and recycled as needed. If the DHCP server has an address available, it assigns it to the device on a temporary basis. If the server checks its supply and none are available, it returns a busy signal to the client to try again later. The DHCP server itself can be a separate piece of hardware on large corporate networks, but its function is normally built into the small routers used by home networks. Most home routers want to control address assignment to LAN devices via their DHCP, and require that the LAN devices are setup to obtain their IP address via DHCP when connected. To avert delay, some LAN devices can optionally be set to use DHCP but revert to a default IP address if no DHCP server is present. Some home routers and most business class routers will also allow a LAN device to use a static IP address set inside itself. A static IP address does not change and can ensure a connection every time, if the static IP address is unique and within the LAN’s address domain.
A Static IP Address is as the name implies — static and doesn’t change on the network and is fixed into the device itslef. Conversely, a Dynamic IP address is an address temporarily assigned to a network node by another host/service provider on that network each time the node connects and may be subject to change “dynamically” as required. Ethernet devices may have the option of being assigned an IP address or have a default IP address already assigned (static assignment), or may be set up to determine their IP address automatically when they connect to a network (dynamic assignment via DHCP).
The Transmission Control Protocol (TCP)
With Ethernet, the Transmission Control Protocol complements the Internet Protocol as one of the two main protocols used on the internet. While network IP deals with addressing the nodes, TCP is the method used to manage the data transfer between nodes and provides the following service:
- TCP establishes a connection before transferring data between local hosts/clients/servers using a three-way handshake with each node exchanging SYNch and ACKnowledgment packets to synchronize sequence numbers and setup data transfer before actual data communication begins.
- TCP manages large data transfers by splitting a continuous data stream (many bytes of information) into separate IP-framed segments.
- TCP also manages message flow control by pre-specifying the number of bytes that may be sent before additional permission is required.
- TCP will multiplex messages to many recipients using port numbers to specify different destinations.
- TCP essentially increases reliability of the data transfer by assigning sequence numbers to data bytes and by using special flags to trigger other services. Sequence numbers help TCP assemble data in the correct order, discern duplicate data, and recover damaged or lost data bytes. For example, a sending TCP requires acknowledgment from a receiving TCP, and if not received within a timeout perios, it causes the data to be sent again, helping to ensure its eventual delivery.
The User-Datagram Protocol (UDP)
UDP provides an alternative transmission protocol to TCP and is generally used to send shorter messages without first establishing a connection between nodes. In this way, it is less reliable than TCP, but quicker for sending data. A UDP message is limited to 1500-20 (IPv4 Header)- 8 (UDP Header) or 1472 bytes maximum.
The MAChine Address
While network routers/gateways use logically assigned 32-bit IP addresses and subnet masks to determine network destinations, a second unique hard-coded number inside every LAN device is called the MAC address (Media Access Control or MAChine address). While an IP address is logically assigned by the network IP and can change, the MAC address is a unique 48-bit (6-byte) number fixed into the device hardware and often expressed as 6 hexadecimal numbers separated by colons, like 00:01:07:B7:EB:6F.
The first three bytes of a MAC address identify the manufacturer of the device. Ethernet devices broadcast MAC addresses continuously on a network to let other devices know where to send/return a frame or packet. The router keeps track of where specific devices are located on its subnet by maintaining a list of MAC addresses associated with its LAN IP addresses, and it is the MAC address that allows a message to be delivered right to the device when the device location or logical IP address has changed.