TDEB Top Bar

Trending
Semiconductor Industry News — The Digital Electronics Blog
Follow Us

TDEB Masthead

The Semiconductor Hub

Semiconductors.  Chips and Systems.  Innovation.

Indexed by leading Search Engines, AI and referenced by Engineers worldwide 500+ Articles 10M+ Pageviews 30+ Reports 50+ Citations

Ethernet Interview Questions and Answers

The Editor's Desk
by
0
Share Facebook X LinkedIn WhatsApp Email

Ethernet is the most widely used wired networking technology, and it comes up in interviews for networking, embedded, FPGA and SoC roles. This post collects the classic Ethernet interview questions with clear answers: what Ethernet is, how devices share the wire, what collisions are, how addresses work, and the exact layout of Ethernet II, IEEE 802.3, 802.2 LLC and SNAP frames.

Ethernet in plain words

Ethernet is a family of standards for local area networks (LANs). It defines the cables and signaling (how bits travel on copper or fiber) and the frame format and media access rules (how a device packages data and when it may send). In OSI terms it covers the Physical layer (Layer 1) and the Data Link layer (Layer 2). Protocols such as IP run on top of it.

Every device on an Ethernet network has a 48-bit address, usually called its MAC address. A device sends data in a frame that carries the destination address, the source address, a field that says what is inside, the data itself and a checksum. The device whose address matches picks up the frame and hands it to the next layer up.

Shared wires and collisions

Early Ethernet put every device on one shared cable, so only one device could transmit at a time. If two started together, their signals collided and both frames were lost. Ethernet solved this with a simple rule set called CSMA/CD: listen before you send, keep listening while you send, and if you hear a collision, stop and try again after a random wait.

Modern Ethernet mostly uses switches with a dedicated full-duplex link to each device. On such a link each side can send and receive at the same time, so collisions do not happen and CSMA/CD is not used. The IEEE 802.3 standard still defines both half-duplex operation with CSMA/CD and full-duplex operation, which is why interview questions about collisions are still common.

Frames and formats

There are two main frame formats on the wire. Ethernet II (also called DIX, after DEC, Intel and Xerox) has a 2-byte type field that names the protocol inside, such as IP or ARP. IEEE 802.3 put a 2-byte length field in the same place and moved the protocol identification into an 802.2 LLC header, optionally extended with a SNAP header. A receiver tells the two apart by the value of that 2-byte field. Ethernet II framing is what carries most IP traffic today.

Speeds

Ethernet started at 10 Mbps and has been extended many times. The current base standard, IEEE 802.3-2022, covers speeds from 1 Mb/s to 400 Gb/s, and an amendment approved in 2024 added 800 Gb/s.

How to answer Ethernet interview questions

  • Say which Ethernet you mean. Many classic answers (collisions, backoff, segment lengths) apply only to shared, half-duplex Ethernet. Say so, and add that switched full-duplex links do not have collisions.
  • Know the frame by heart. Interviewers often ask you to draw the frame: destination address, source address, type or length, data, checksum. Be ready to give the size of each field.
  • Explain the reason behind a number. The minimum frame size exists so that a sender is still transmitting when news of a collision reaches it. Giving the reason shows you understand the rule rather than having memorized it.
  • Correct old myths politely. Two common ones: that a MAC address can never be changed, and that the length and type fields split exactly at 1500. Both are covered in the answers below.

Deep dive: the numbers and details

This part holds the full question-and-answer set with frame layouts, field sizes, timing rules and the values interviewers expect. Skip it if the overview is all you need.

1. What is Ethernet?

Ethernet is a Local Area Network (LAN) cabling and signaling specification for baseband networks. Ethernet uses a bus or star topology for connecting different nodes in a network: the original coaxial versions used a shared bus, while twisted-pair versions connect each node to a hub or switch in a star.

2. To which OSI layer does Ethernet belong?

Ethernet belongs to both the Physical layer (Layer 1) and the Data Link layer (Layer 2) in the OSI architecture.

3. What are the standard data rates for Ethernet?

The classic data rates are 10 Mbps, 100 Mbps and 1 Gbps. The standard has since grown well beyond that: IEEE 802.3-2022 covers selected speeds from 1 Mb/s to 400 Gb/s, including 10, 25, 40, 100, 200 and 400 Gb/s, and IEEE 802.3df-2024, approved on February 16, 2024, added 800 Gb/s.

4. What are the IEEE standards that cover Ethernet?

The following IEEE standards define Ethernet:

   +--------+----------------------------------------------------+
IEEE Description
Standard
+--------+----------------------------------------------------+
802.2 Logical Link Control (LLC) Specification. Specifies
the general interface between the network layer
(IP, IPX, etc) and the data link layer (Ethernet,
Token Ring, etc).
+--------+----------------------------------------------------+
802.3 CSMA/CD Network (Ethernet) Specification. Specifies
the frame format, cabling and signaling standards.
+--------+----------------------------------------------------+

Today IEEE 802.3 defines both half-duplex CSMA/CD operation and full-duplex operation, with a common MAC specification across speeds.

5. How do two systems in an Ethernet network communicate?

In an Ethernet network, a system sends the data in an Ethernet frame. The destination system is specified in the frame using its Ethernet address. On a shared segment, all the systems listen for frames carrying their Ethernet address. When a system receives a frame with its address in it, it processes the frame and passes it to the higher layers (like IP) for further processing. On a switched network, the switch learns which port each address lives on and forwards the frame only to that port.

6. What is a "collision"?

On a shared (half-duplex) Ethernet segment, only one device can transmit at any one instant. If two devices transmit at the same time, the signals from both devices collide. When a collision occurs, the signals are distorted and both frames are lost. Collisions are a normal part of operation on busy shared segments. On full-duplex switched links they do not occur at all.

7. How is a "collision" handled in Ethernet networks?

Half-duplex Ethernet uses the Carrier Sense Multiple Access with Collision Detection (CSMA/CD) media access control mechanism to detect and recover from a collision.

8. What is CSMA/CD?

CSMA/CD is the media access control mechanism used in half-duplex Ethernet to recover from frame collisions. The steps are:

  1. Carrier sense: before sending a frame, the device listens to find out whether another device is already transmitting.
  2. Multiple access: once the medium is free, the device starts transmitting. If two devices find the cable free at the same time, both start transmitting, which results in a collision.
  3. Collision detect: while transmitting, each device also listens for a collision.
  4. Jam and stop: when a device detects a collision, it stops sending the frame and sends a short jam signal so that every station notices the collision.
  5. Back off and retry: each device waits a random time chosen by the truncated binary exponential backoff algorithm, then tries again. The frame is discarded after 16 unsuccessful attempts.

A correction to the earlier version of this post, which called the wait "logarithmic": the backoff range doubles after each collision. After the k-th successive collision a station picks a random integer J from 0 to 2q - 1, where q = min(k, 10), and waits J x 512 bit times (the slot time). After one collision the choice is 0 or 1 slot; after two, 0 to 3 slots; and so on, capped at 0 to 1,023 slots. These values are given in University of Pennsylvania TCOM 370 notes on Ethernet LANs.

Collision count kRange of JMaximum wait at 10 Mbps (slot = 51.2 us)
10 to 151.2 us
20 to 3153.6 us
30 to 7358.4 us
10 to 150 to 1,02352.4 ms
16Give up and discard the frame

9. What is a "late collision"?

A transmitting device can detect a collision only while it is still transmitting. The minimum frame size is chosen so that, on a network built within the size limits, any collision reaches the sender within the first 512 bit times (the slot time) of the frame. A collision detected after that point is called a late collision. It means something is wrong: the collision domain is longer than the standard allows, or a link has a configuration fault. If the collision arrives after the sender has finished the whole frame, the sender does not see it at all, does not retry, and the frame is simply lost; recovery is then left to higher layers. (The earlier version of this post said the transmitter would assume the collision came from some other frame; the real problem is that the frame is lost without a MAC-level retry.)

10. How is "late collision" avoided in Ethernet?

Late collisions are avoided by restricting the size of the network so that a collision always reaches the transmitter before it has finished sending the smallest legal frame. In 10 Mbps Ethernet the minimum frame is 64 bytes (512 bits); with the 8-byte preamble and start-of-frame delimiter it occupies 576 bits (72 bytes) on the wire. For 10BASE5 (thick coax), each cable segment is limited to 500 m, and up to four repeaters may join five segments, so the maximum distance between two nodes is about 2.5 km (UPenn TCOM 370 notes, linked above). The earlier version of this post called 2.5 km the maximum length of a single segment; it is the maximum span between nodes across repeated segments.

11. What is an Ethernet address?

Each device in an Ethernet network is identified by a 48-bit (6-byte) address called the Ethernet address, also known as the Media Access Control (MAC) address. Ethernet addresses are written as six pairs of hexadecimal digits separated by colons, for example 00:60:08:11:B1:AB or 00:00:c0:5e:83:0e. The manufacturer programs a universally administered address into the network adapter, and the first three bytes are the manufacturer's Organizationally Unique Identifier (OUI).

A correction to the earlier version of this post, which said the address cannot be changed: drivers and operating systems can override the burned-in address with a locally administered one. The IEEE Registration Authority guidelines for EUI, OUI and CID define two flag bits in the first byte: the least significant bit (I/G) marks an individual address (0) or a group address (1), and the next bit (U/L) marks a universally administered (0) or locally administered (1) address.

12. What is a broadcast address?

The Ethernet address in which all the bits are 1 is the broadcast address, written FF:FF:FF:FF:FF:FF. A frame sent to this address is received and processed by all the nodes in the network.

13. What are the different Ethernet frame formats?

The main Ethernet frame formats are Ethernet II and IEEE 802.3. An 802.3 frame carries an 802.2 LLC header, and optionally an 802.2 SNAP header after it.

14. Why are there different Ethernet frame formats?

Xerox developed the first version of Ethernet, Ethernet I. The second version, Ethernet II, was developed by DEC, Intel and Xerox. Ethernet was then standardized by IEEE, and the new format is known as the 802.3 format. To provide backward compatibility with Ethernet II, the 802.2 SNAP format was developed.

15. What is the format of an Ethernet II frame?

    +-----------+----------+----------+-----------+----------+
DestinationSource MACFrame typeData CRC
MAC AddressAddress (IP, ARP) (46 to Checksum
(6 bytes) (6 bytes) (2 bytes) 1500 bytes) (4 bytes)
+-----------+----------+----------+-----------+----------+
FieldSize
Destination MAC address6 bytes
Source MAC address6 bytes
Frame type (for example IP, ARP)2 bytes
Data46 to 1500 bytes
CRC checksum4 bytes

16. What is the format of an 802.3 frame?

The components of an 802.3 frame are shown below:

    +----------+---------+-----------+----------+
802.3 MAC 802.2 LLCData CRC
Header Header (43 to Checksum
(14 bytes)(3 bytes)1497 bytes) (4 bytes)
+----------+---------+-----------+----------+

The first two components, the MAC header and the LLC header, are expanded below. 802.3 MAC header:

    +-----------+----------+---------+
DestinationSource MACLength of
MAC AddressAddress the frame
(6 bytes) (6 bytes) (2 bytes)
+-----------+----------+---------+

802.2 LLC header:

    +-----------+--------+--------+
DestinationSource Control
SAP SAP Byte
(1 byte) (1 byte)(1 byte)
+-----------+--------+--------+
PartFieldsSize
802.3 MAC headerDestination address (6), source address (6), length (2)14 bytes
802.2 LLC headerDestination SAP (1), source SAP (1), control (1)3 bytes
DataPayload43 to 1497 bytes
CRCFrame check sequence4 bytes

17. What is the format of an 802.2 SNAP frame?

    +----------+---------+----------+-----------+----------+
802.3 MAC 802.2 LLC802.2 SNAPData CRC
Header Header Header (38 to Checksum
(14 bytes)(3 bytes)(5 bytes) 1492 bytes) (4 bytes)
+----------+---------+----------+-----------+----------+

The 802.2 SNAP header is expanded below. 802.2 SNAP header:

    +---------------------+---------+
OUI (OrganizationallyType
Unique Id) (2 bytes)
(3 bytes)
+---------------------+---------+

In words: 14-byte MAC header, 3-byte LLC header, 5-byte SNAP header (3-byte OUI plus 2-byte type), 38 to 1492 bytes of data and a 4-byte CRC.

18. How is the length of an Ethernet II frame calculated?

The length of an Ethernet II frame is not carried in the frame itself. When the network interface passes a received frame to the device driver, it supplies the length of the received frame.

19. What is the minimum and maximum size of an Ethernet frame?

The minimum size of an Ethernet frame is 64 bytes: destination address (6) + source address (6) + frame type (2) + data (46) + CRC checksum (4). The data field must carry at least 46 bytes; if there is less data to send, padding bytes are added. The maximum size of a basic Ethernet frame is 1518 bytes: destination address (6) + source address (6) + frame type (2) + data (1500) + CRC checksum (4), so the maximum data in a single frame is 1500 bytes. These sizes exclude the 8-byte preamble and start-of-frame delimiter. A frame that carries an IEEE 802.1Q VLAN tag is 4 bytes longer, up to 1522 bytes.

A quick efficiency check: on the wire, each frame also needs the 8-byte preamble and a 12-byte inter-frame gap. A maximum frame therefore occupies 1518 + 8 + 12 = 1538 byte times to carry 1500 bytes of data, or 97.5% efficiency. A minimum frame occupies 64 + 8 + 12 = 84 byte times to carry 46 bytes, or 54.8%. At 1 Gbps that is about 1.488 million minimum-size frames per second (109 / (84 x 8)).

20. What is a SAP?

A SAP (Service Access Point) is the logical point at which services are provided by an OSI layer. Typically, network layer protocols (like IP) bind to a specific SAP in the Logical Link Control (LLC) layer to access the services it provides.

21. Why is the Sub Network Access Protocol (SNAP) header required?

The 802.2 LLC header replaces the protocol type field of the Ethernet II format with two SAP fields, the source SAP and the destination SAP. The value of the SAP field plays the role of the protocol type field of the Ethernet II header. Because SAP is an 8-bit field, its value can be at most 255, while the protocol type values of standard protocols such as IP and ARP are greater than 1500. These values cannot be represented in the SAP fields. So, to stay compatible with Ethernet II, the SNAP header was added after the 802.2 LLC header. In a SNAP frame, both SAP values are 0xAA, and the first 5 bytes of the data carry the protocol ID. The last 2 of those 5 bytes are the same as the protocol type field of the Ethernet II frame. The first 3 bytes are the Organizationally Unique Identifier (OUI), allocated as a vendor identifier. Typically, the OUI is zero.

22. What are the values for the SSAP, DSAP, control and OUI fields in an 802.2 SNAP frame?

    +-------+-----+
Field Value
+-------+-----+
SSAP 0xAA
DSAP 0xAA
Control3
OUI 0
+-------+-----+

That is: SSAP = 0xAA, DSAP = 0xAA, control = 0x03 (unnumbered information), OUI = 0x000000.

23. How do you tell an 802.3 frame from an Ethernet II frame?

The 802.3 length field and the Ethernet II type field sit at the same offset in the header, so the receiver looks at the value. In an 802.3 frame the field holds a length, which can be at most 1500 (0x05DC). In an Ethernet II frame it holds a type, and type values start at 1536 (0x0600); IP, for example, is 0x0800. Values from 1501 to 1535 are not used, which keeps the two interpretations apart. (The earlier version of this post said "less than 1500" and "more than 1500"; a length of exactly 1500 is valid, and types begin at 1536.)

24. What is promiscuous mode?

Normally, an Ethernet network interface passes a frame to the higher layers only if it is addressed to that interface (or to a broadcast or subscribed multicast address). In promiscuous mode, the interface passes up all frames it receives, regardless of destination address. Network analyzers use this mode to capture traffic. On a switched network, an interface in promiscuous mode still sees only the frames the switch sends to its port, which is why analyzers are often connected to a mirror port.

25. What is MTU?

The Maximum Transmission Unit (MTU) is the largest number of bytes that can be carried in a single transmission unit. Every communication medium has an MTU. For Ethernet, the MTU is 1500 bytes, which is the maximum data field of a frame (the 1518-byte frame minus the 18 bytes of header and CRC).

Quick reference

ItemValue
MAC address size48 bits (6 bytes); first 3 bytes are the OUI for universally administered addresses
Minimum / maximum frame64 / 1518 bytes (1522 with a VLAN tag), excluding preamble
Minimum / maximum Ethernet II data46 / 1500 bytes
Slot time512 bit times (51.2 us at 10 Mbps)
BackoffRandom 0 to 2min(k,10) - 1 slots; give up after 16 attempts
Length vs typeLength 1500 or less; type 0x0600 (1536) or more
SNAPDSAP = SSAP = 0xAA, control = 0x03
BroadcastFF:FF:FF:FF:FF:FF

Further reading

The Editor's Desk
About the Author
The Editor's Desk
Share Facebook X LinkedIn WhatsApp Email

Post a Comment

0 Comments

Your comments will be moderated before it appears here.

Post a Comment (0)

#buttons=(Ok, Go it!) #days=(20)

Our website uses cookies to enhance your experience. Learn more
Ok, Go it!