Ethernet Overview

Ethernet is a Data Link and Physical Layer protocol defined by the IEEE 802.3™ Specification. It comes in many flavors, defined by maximum bit rate, mode of transmission, and physical transmission medium:

  • Maximum Bit Rate (Mbits/s): 10, 100, 1000, etc.
  • Mode of Transmission: Broadband, Baseband.
  • Physical Transmission Medium: Coax, Fiber, UTP, etc.

OSI Model Basics

One of the things that have made Ethernet so widely adopted is the Open Systems Interconnection (OSI) model. OSI is a model of the many complicated layers involved when two intelligent devices share information. The OSI model is mostly a theoretical framework, ideally setting up standard interfaces from one layer to another. With this model, you, as the developer of the Application Layer, do not need to know about the physical medium that data is being transmitted on, you can just focus on presenting the data. In theory, the OSI model is seven layers, but in reality, these layers can be mapped to software and hardware applications.

Here, the OSI model is mapped to the Internet Engineering Task Force Transmission Control Protocol/Internet Protocol (TCP/IP) (Software) and Ethernet (Hardware) realities.

osi-model.png

The "Medium" is not considered part of the OSI model, however, it falls within the IEEE 802 specification and forms the basis for naming all of the Ethernet Families.

What Does Each Layer Do?

Each layer is responsible for negotiating the details of the data transfer to different degrees. Below is a summary of what information is shared on each layer. Note that Ethernet covers the bottom two layers:

osi-model-functions.png

Physical Layer

This layer encodes and decodes the bits found within a frame and includes the transceiver that drives and receives the signals on the network. This layer handles the speed and medium that the data is transported on. The physical layer is where the data is translated from digital 1s and 0s to analog signals. Microchip switches can communicate over CAT-5 cables at 10 Mbits/s, 100 Mb/s, and 1000 Mb/s.

Data Link (MAC) Layer

This layer is responsible for creating the frames that move across the network. These frames encapsulate the packets and use MAC addresses to identify the source and destination. The MAC also checks to see if the data is complete and passes some basic Cyclic Redundancy Check (CRC) error checks.

Network Layer

This layer is responsible for creating packets that move across the network. It uses IP addresses to identify the packet’s source and destination.

Transport Layer

This layer establishes the connection between applications running on different hosts. It uses TCP for reliable connections and User Datagram Protocol (UDP) for fast connections. It keeps track of the processes running in the applications above it by assigning port numbers to them and uses the Network layer to access the TCP/IP network.

Application Layer

This layer is where the applications requiring network communications live. This is the top-level application that is normally exposed to the general user. Examples of these applications include email clients and web browsers. These applications use the Transport layer to send requests to connect to remote hosts.

Data Flow (Transmitting Data)

To send and receive data across a TCP/IP network, data is passed to each lower layer, which will add to the data until the full packet is formed. This is a simplified view of how the network layers work together to generate frames. Higher layers pass information to lower layers. Each layer adds information called a header to the data being passed to it. This header contains information the layer needs to perform its job.

data-flow-tx.png


Application Layer – It generates a message. In this case, the specific application is a web browser requesting a web page download. This message is then sent to the Transport layer.

Transport Layer – It adds the TCP or UDP header, which includes the source and destination port addresses. Additional information like the packet sequence number used for TCP will also be added to the header. The data generated by the Transport layer is referred to as a Segment if TCP is used and as Datagram if UDP is used. This segment is then sent to the Network layer.

Network Layer – It adds a header including the source and destination IP address to generate a packet. This packet is then sent to the Data Link layer.

Data Link (MAC) Layer – It adds a header containing the MAC address information to create a frame. The frame is then sent to the Physical layer to transmit the bits.

Data Flow (Receiving Data)

When receiving data, the network layers act as filters:

data-flow-rx.png

When the frame is received in the Data Link layer, the destination MAC address is compared with its own. If the data received is not intended for that host, it is immediately discarded. If it matches, the header is stripped and the payload, which in this case is a packet, is forwarded up to the next layer. Here, the Network layer checks if the destination IP address matches its own. If it matches, the header is stripped and the payload is forwarded up to the next layer. Here, the Transport layer checks to determine if there is a process running on the host with a destination port number of 80, which is the case. So, the header is stripped and the message is sent to process number 80 in the Application layer. Process number 80 is a function running in the HTTP server. This completes the message transmission process from one application to another.

© 2024 Microchip Technology, Inc.
Notice: ARM and Cortex are the registered trademarks of ARM Limited in the EU and other countries.
Information contained on this site regarding device applications and the like is provided only for your convenience and may be superseded by updates. It is your responsibility to ensure that your application meets with your specifications. MICROCHIP MAKES NO REPRESENTATIONS OR WARRANTIES OF ANY KIND WHETHER EXPRESS OR IMPLIED, WRITTEN OR ORAL, STATUTORY OR OTHERWISE, RELATED TO THE INFORMATION, INCLUDING BUT NOT LIMITED TO ITS CONDITION, QUALITY, PERFORMANCE, MERCHANTABILITY OR FITNESS FOR PURPOSE. Microchip disclaims all liability arising from this information and its use. Use of Microchip devices in life support and/or safety applications is entirely at the buyer's risk, and the buyer agrees to defend, indemnify and hold harmless Microchip from any and all damages, claims, suits, or expenses resulting from such use. No licenses are conveyed, implicitly or otherwise, under any Microchip intellectual property rights.