1.\" Copyright 2014 Garrett D'Amore <garrett@damore.org> 2.\" Copyright 2016 Joyent, Inc. 3.\" Copyright 2023 Oxide Computer Company 4.\" Redistribution and use in source and binary forms, with or without 5.\" modification, are permitted provided that the following conditions 6.\" are met: 7.\" 1. Redistributions of source code must retain the above copyright 8.\" notice, this list of conditions and the following disclaimer. 9.\" 2. Redistributions in binary form must reproduce the above copyright 10.\" notice, this list of conditions and the following disclaimer in the 11.\" documentation and/or other materials provided with the distribution. 12.\" 13.\" THIS SOFTWARE IS PROVIDED BY THE COPYRIGHT HOLDER AND CONTRIBUTORS 14.\" ``AS IS'' AND ANY EXPRESS OR IMPLIED WARRANTIES, INCLUDING, BUT NOT 15.\" LIMITED TO, THE IMPLIED WARRANTIES OF MERCHANTABILITY AND FITNESS 16.\" FOR A PARTICULAR PURPOSE ARE DISCLAIMED. IN NO EVENT SHALL THE 17.\" COPYRIGHT HOLDER OR CONTRIBUTORS BE LIABLE FOR ANY DIRECT, INDIRECT, 18.\" INCIDENTAL, SPECIAL, EXEMPLARY, OR CONSEQUENTIAL DAMAGES (INCLUDING, BUT 19.\" NOT LIMITED TO, PROCUREMENT OF SUBSTITUTE GOODS OR SERVICES; LOSS OF 20.\" USE, DATA, OR PROFITS; OR BUSINESS INTERRUPTION) HOWEVER CAUSED AND ON 21.\" ANY THEORY OF LIABILITY, WHETHER IN CONTRACT, STRICT LIABILITY, OR TORT 22.\" (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE OF 23.\" THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE 24.\" 25.Dd "July 25, 2023" 26.Dt IEEE802.3 7 27.Os 28.Sh NAME 29.Nm ieee802.3 30.Nd IEEE 802.3 Ethernet parameters and statistics 31.Sh DESCRIPTION 32The IEEE 802.3 standard specifies the details for Ethernet 33networking. 34This page describes the various statistics and tunables that device drivers 35supporting Ethernet commonly offer. 36. 37Note that not every device or driver supports every one of these 38values, and many devices offer additional statistics and tunables that 39are specific to that hardware. 40See the device driver's documentation for those specific details. 41. 42.Lp 43Values that are statistics are visible 44.Xr kstat 8 , 45whereas properties are visible using the 46.Xr dladm 8 47.Sy show-linkprop 48subcommand. 49Tunables are properties that can be changed using the 50.Xr dladm 8 51.Sy set-linkprop 52subcommand. 53A more useful summary of current operational state can be seen with the 54.Xr dladm 8 55.Sy show-ether 56subcommand. 57. 58.Ss Statistics 59The following statistics are accessible with 60.Xr kstat 8 . 61Note that some statistics are available in both 32- and 64-bit counters, 62in which case the name of the 64 bit statistic will be the same as the 6332-bit, but with 64.Dq Sy 64 65appended. 66For example, 67.Sy ipackets64 68is the 64-bit version of the 69.Sy ipackets 70statistic. 71These are indicated with the special suffix 72.Op Sy 64 73in the table below. 74. 75.Bl -tag -width tx_late_collisions 76.It Sy adv_cap_10hdx 77Advertises 10 Mbps half-duplex support. 78.It Sy adv_cap_10fdx 79Advertises 10 Mbps full-duplex support. 80.It Sy adv_cap_100hdx 81Advertises 100 Mbps half-duplex support. 82.It Sy adv_cap_100T4 83Advertises 100BASE-T4 support. 84.It Sy adv_cap_100fdx 85Advertises 100 Mbps full-duplex support. 86.It Sy adv_cap_1000hdx 87Advertises 1000 Mbps half-duplex support. 88.It Sy adv_cap_1000fdx 89Advertises 1000 Mbps full-duplex support. 90.It Sy adv_cap_2500fdx 91Advertises 2.5 Gbps support. 92.It Sy adv_cap_5000fdx 93Advertises 5 Gbps support. 94.It Sy adv_cap_10gfdx 95Advertises 10 Gbps support. 96.It Sy adv_cap_25gfdx 97Advertises 25 Gbps support. 98.It Sy adv_cap_40gfdx 99Advertises 40 Gbps support. 100.It Sy adv_cap_50gfdx 101Advertises 50 Gbps support. 102.It Sy adv_cap_100gfdx 103Advertises 100 Gbps support. 104.It Sy adv_cap_200gfdx 105Advertises 200 Gbps support. 106.It Sy adv_cap_400gfdx 107Advertises 400 Gbps support. 108.It Sy adv_cap_autoneg 109Advertises auto-negotiation support. 110.It Sy adv_cap_asmpause 111Advertises asymmetric flow control support. 112.It Sy adv_cap_pause 113Advertises flow control support. 114.It Sy adv_rem_fault 115Remote fault status sent to peer. 116.It Sy align_errors 117Mis-aligned frames received. 118.It Sy brdcstrcv 119Broadcast frames received. 120.It Sy brdcstxmt 121Broadcast frames transmitted. 122.It Sy cap_10hdx 123Device supports 10 Mbps half-duplex. 124.It Sy cap_10fdx 125Device supports 10 Mbps full-duplex. 126.It Sy cap_100hdx 127Device supports 100 Mbps half-duplex. 128.It Sy cap_100T4 129Device supports 100BASE-T4. 130.It Sy cap_100fdx 131Device supports 100 Mbps full-duplex. 132.It Sy cap_1000hdx 133Device supports 1000 Mbps half-duplex. 134.It Sy cap_1000fdx 135Device supports 1000 Mbps full-duplex. 136.It Sy cap_2500fdx 137Device supports 2.5 Gbps. 138.It Sy cap_5000fdx 139Device supports 5 Gbps. 140.It Sy cap_10gfdx 141Device supports 10 Gbps. 142.It Sy cap_25gfdx 143Device supports 25 Gbps. 144.It Sy cap_40gfdx 145Device supports 40 Gbps. 146.It Sy cap_50gfdx 147Device supports 50 Gbps. 148.It Sy cap_100gfdx 149Device supports 100 Gbps. 150.It Sy cap_200gfdx 151Device supports 200 Gbps. 152.It Sy cap_400gfdx 153Device supports 400 Gbps. 154.It Sy cap_asmpause 155Device supports asymmetric flow control. 156.It Sy cap_autoneg 157Device supports auto-negotiation. 158.It Sy cap_pause 159Device supports symmetric flow control. 160.It Sy cap_rem_fault 161Device supports remote fault notification. 162.It Sy carrier_errors 163Frames dropped due to loss of link. 164.It Sy collisions 165Collisions. 166.It Sy defer_xmts 167Transmits deferred due to link activity. 168.It Sy ex_collisions 169Frames dropped due to too many collisions. 170.It Sy fcs_errors 171Frames received with bad frame checksum. 172.It Sy first_collisions 173Frames with at least one collision. 174.It Sy ierrors 175Receive errors. 176.It Sy ifspeed 177Link speed in bits per second. 178.It Sy ipackets Ns Op Sy 64 179Frames received successfully. 180.It Sy jabber_errors 181Jabber errors. 182.It Sy link_asmpause 183Asymmetric flow control; works together with 184.Sy link_pause . 185See the description for it below. 186.It Sy link_autoneg 187Link was auto-negotiated. 188.It Sy link_duplex 189Link duplex status, values as follows: 190.Bl -column "0" infinity 191.It 0 Ta Unknown. 192.It 1 Ta Half-duplex. 193.It 2 Ta Full-duplex. 194.El 195.It Sy link_pause 196Link flow control available; works together with 197.Sy link_asmpause . 198The meanings of these bits are: 199.Bl -column "pause" "asmpause" 200.It Sy pause Ta Sy asmpause Ta Sy meaning 201.It 0 Ta 0 Ta "No flow control." 202.It 1 Ta 0 Ta Symmetric flow control. 203.It 0 Ta 1 Ta Honor received pause frames. 204.It 1 Ta 1 Ta Send pause frames when congested. 205.El 206.It Sy link_state 207Link state; 0 for down, 1 for up. 208.It Sy link_up 209Link is up if 1. 210.It Sy lp_cap_10hdx 211Peer supports 10 Mbps half-duplex. 212.It Sy lp_cap_10fdx 213Peer supports 10 Mbps full-duplex. 214.It Sy lp_cap_100T4 215Peer supports 100BASE-T4. 216.It Sy lp_cap_100hdx 217Peer supports 100 Mbps half-duplex. 218.It Sy lp_cap_100fdx 219Peer supports 100 Mbps full-duplex. 220.It Sy lp_cap_1000fdx 221Peer supports 1000 Mbps full-duplex. 222.It Sy lp_cap_1000hdx 223Peer supports 1000 Mbps half-duplex. 224.It Sy lp_cap_2500fdx 225Peer supports 2.5 Gbps. 226.It Sy lp_cap_5000fdx 227Peer supports 5 Gbps. 228.It Sy lp_cap_10gfdx 229Peer supports 10 Gbps. 230.It Sy lp_cap_25gfdx 231Peer supports 25 Gbps. 232.It Sy lp_cap_40gfdx 233Peer supports 40 Gbps. 234.It Sy lp_cap_50gfdx 235Peer supports 50 Gbps. 236.It Sy lp_cap_100gfdx 237Peer supports 100 Gbps full-duplex. 238.It Sy lp_cap_200gfdx 239Peer supports 200 Gbps full-duplex. 240.It Sy lp_cap_400gfdx 241Peer supports 400 Gbps full-duplex. 242.It Sy lp_cap_asmpause 243Peer supports asymmetric flow control. 244.It Sy lp_cap_autoneg 245Peer supports auto-negotiation. 246.It Sy lp_cap_pause 247Peer advertises flow control support. 248.It Sy lp_rem_fault 249Peer announces a remote fault. 250.It Sy macrv_errors 251Generic receive errors. 252.It Sy macxmt_errors 253Generic transmit errors. 254.It Sy multi_collisions 255Frames with more than one collision. 256.It Sy multircv 257Multicast frames received. 258.It Sy multixmt 259Multicast frames transmitted. 260.It Sy norcvbuf 261Receive frames dropped due to lack of resources. 262.It Sy noxmtbuf 263Transmit frames dropped due to lack of resources. 264.It Sy obytes Ns Op Sy 64 265Bytes (octets) transmitted successfully. 266.It Sy oerrors 267Transmit errors. 268.It Sy oflo 269Overflow errors. 270.It Sy opackets Ns Op Sy 64 271Frames successfully transmitted. 272.It Sy promisc 273Interface is in promiscuous mode. 274.It Sy rbytes Ns Op Sy 64 275Bytes (octets) received successfully. 276.It Sy runt_errors 277Frames received that were too short. 278.It Sy sqe_errors 279Squelch errors. 280.It Sy toolong_errors 281Frames received that were too long. 282.It Sy tx_late_collisions 283Late collisions on transmit. 284.It Sy uflo 285Underflow errors. 286.It Sy unknowns 287Frames received with no local recipient. 288.It Sy xcvr_addr 289Transceiver address. 290.It Sy xcvr_id 291Transceiver vendor and device ID. 292.It Sy xcvr_inuse 293Identifies the type of transceiver in use. 294Ethernet-specific media values are defined in 295.In sys/mac_ether.h . 296For more information see the section on 297.Dv MAC_PROP_MEDIA 298in 299.Xr mac 9E . 300.El 301.Ss Properties 302The following parameters are accessible with 303.Xr dladm 8 . 304Some of these are normally read-only. 305Other properties that are not specific to IEEE 802.3 / Ethernet links are also 306available via 307.Xr dladm 8 , 308and are documented in its man page rather than here. 309. 310.Bl -tag -width adv_1000hdx_cap 311.It Sy speed 312Link speed, in Mbps per second (dladm only). 313.It Sy duplex 314Link duplex, either "full" or "half". 315.It Sy state 316Link state, either "up" or "down". 317.It Sy mtu 318Maximum link frame size in bytes. 319See 320.Sx Jumbo Frames . 321.It Sy flowctrl 322Flow control setting, one of 323.Dq no , 324.Dq tx , 325.Dq rx , 326or 327.Dq bi . 328See 329.Sx Flow Control . 330.It Sy fec 331FEC settings, one of 332.Dq none , 333.Dq auto , 334.Dq rs , 335or 336.Dq base-r . 337See 338.Sx Forward Error Correction . 339.It Sy adv_10hdx_cap 340Advertising 10 Mbps half-duplex support. 341.It Sy en_10fhdx_cap 342Enable 10 Mbps full-duplex. 343.It Sy en_10fhdx_cap 344Enable 10 Mbps half-duplex. 345.It Sy adv_10fdx_cap 346Advertising 10 Mbps full-duplex support. 347.It Sy adv_100hdx_cap 348Advertising 100 Mbps half-duplex support. 349.It Sy en_100hdx_cap 350Enable 100 Mbps half-duplex. 351.It Sy adv_100fdx_cap 352Advertising 100 Mbps full-duplex support. 353.It Sy en_100fdx_cap 354Enable 100 Mbps full-duplex. 355.It Sy adv_1000hdx_cap 356Advertising 1000 Mbps half-duplex support. 357.It Sy en_1000hdx_cap 358Enable 1000 Mbps half-duplex. 359.It Sy adv_1000fdx_cap 360Advertising 1000 Mbps full-duplex support. 361.It Sy en_1000fdx_cap 362Enable 1000 Mbps full-duplex. 363.It Sy adv_10gfdx_cap 364Advertising 10 Gbps support. 365.It Sy en_10gfdx_cap 366Enable 10 Gbps support. 367.It Sy adv_25gfdx_cap 368Advertising 25 Gbps support. 369.It Sy en_25gfdx_cap 370Enable 25 Gbps support. 371.It Sy adv_40gfdx_cap 372Advertising 40 Gbps support. 373.It Sy en_40gfdx_cap 374Enable 40 Gbps support. 375.It Sy adv_50gfdx_cap 376Advertising 50 Gbps support. 377.It Sy en_50gfdx_cap 378Enable 50 Gbps support. 379.It Sy adv_100gfdx_cap 380Advertising 100 Gbps support. 381.It Sy en_100gfdx_cap 382Enable 100 Gbps support. 383.It Sy adv_200gfdx_cap 384Advertising 200 Gbps support. 385.It Sy en_200gfdx_cap 386Enable 200 Gbps support. 387.It Sy adv_400gfdx_cap 388Advertising 400 Gbps support. 389.It Sy en_400gfdx_cap 390Enable 400 Gbps support. 391.El 392.Ss Auto-negotiation 393With modern devices, auto-negotiation is normally handled automatically. 394With 1 Gbps, 10 Gbps, and higher speeds it is mandatory (10GBASE-T 395also requires full-duplex operation). 396It is also 397.Em strongly 398recommended for use whenever possible; without auto-negotiation the link 399will usually not operate unless both partners are configured to use the 400same link mode. 401.Lp 402Auto-negotiation, when enabled, takes place by comparing the local capabilities 403that have been advertised (which must also be supported by the local device), 404with the capabilities that have been advertised by the link partner (peer). 405. 406The first of the following modes that is supported by both partners is 407selected as the link negotiation result: 408.Lp 409.Bl -bullet -offset indent -compact 410.It 411400 Gbps (400gfdx) 412.It 413200 Gbps (200gfdx) 414.It 415100 Gbps (100gfdx) 416.It 41750 Gbps (50gfdx) 418.It 41940 Gbps (40gfdx) 420.It 42125 Gbps (25gfdx) 422.It 42310 Gbps (10gfdx) 424.It 4255 Gbps (5000fdx) 426.It 4272.5 Gbps (2500fdx) 428.It 4291000 Mbps full-duplex (1000fdx) 430.It 4311000 Mbps half-duplex (1000hdx) 432.It 433100 Mbps full-duplex (100fdx) 434.It 435100BASE-T4 (100T4) 436.It 437100 Mbps half-duplex (100hdx) 438.It 43910 Mbps full-duplex (10fdx) 440.It 44110 Mbps half-duplex (10hdx) 442.El 443.Lp 444Advertisement of these modes can be enabled or disabled by setting the 445appropriate 446.Sy en_ 447property in 448.Xr dladm 8 . 449.Lp 450Auto-negotiation may also be disabled, by setting the 451.Sy adv_autoneg_cap 452property to 0. 453In this case, the highest enabled link mode (using the above list) is 454.Dq forced 455for the link. 456.Ss Flow Control 457Link layer flow control is available on many modern devices, and is mandatory 458for operation at 10 Gbps. 459It requires that the link be auto-negotiated, and that the link be full-duplex, 460in order to function. 461.Lp 462Flow control is applied when a receiver becomes congested. 463In this case the receiver can send a special frame, called a pause frame, to 464request its partner cease transmitting for a short period of time. 465.Lp 466Flow control can be said to be either symmetric, in which case both partners 467can send and honor pause frames, or asymmetric, in which case one partner 468may not transmit pause frames. 469.Lp 470The flow control mode used is driven by the 471.Sy flowctrl 472property. 473It has the following meanings: 474.Lp 475.Bl -column -compact -offset indent Dv 476.It Dq no Ta Neither send, nor honor pause frames. 477.It Dq tx Ta Send pause frames, provided that the peer can support them, 478but do not honor them. 479.It Dq rx Ta Receive and honor pause frames. 480.It Dq bi Ta Both send and receive (and honor) pause frames. 481.El 482.Lp 483The statistics for flow control 484.Po Sy adv_cap_pause , adv_cap_asmpause , lp_cap_pause , lp_cap_asmpause , 485.Sy link_pause , 486and 487.Sy link_asmpause 488.Pc 489are based on the properties exchanged in the auto-negotiation and are 490confusing as a result. 491Administrators are advised to use the 492.Sy flowctrl 493property instead. 494. 495.Ss Forward Error Correction 496Beginning with 25 Gbit per-lane Ethernet 497.Pq 100 Gbit QSFP devices use 4 lanes of 25 GbE 498the various IEEE Ethernet standards allowed the optional use of forward 499error correction, often abbreviated FEC. 500In 25/100 Gbit Ethernet, FEC is considered an optional part of the 501standard and is subject to auto-negotiation. 502In 25/100 Gbit Ethernet, there are two explicit types of FEC that are 503defined and two meta options: 504.Bl -tag -width Ds 505.It rs 506This is a Reed-Solomon based code 507.Po 508.Pf RS Pq 514,528 509.Pc 510This is considered the stronger of the two FEC modes and operates on 511both a per-lane basis and the entire channel. 512.It base-r 513This is known as FireCode and comes from IEEE 802.3 clause 74. 514FireCode operates on each lane indepenently. 515It cannot correct as much as the rs FEC; however, it has lower latency. 516.It auto 517This indicates that the device should perform auto-negotiation to 518determine the type of FEC that should be used. 519.It none 520This indicates the devie should not use FEC at all. 521.El 522.Pp 523Due to the evolution of FEC support in 25/100 Gbit Ethernet, not all 524devices support FEC auto-negotiation. 525Sometimes to form a working link, a particular FEC must be explicitly 526selected. 527.Pp 528With 50 Gbit per-lane Ethernet and higher single-lane and combined 529speeds, the use of FEC is no longer something separate that is part of 530auto-negotiation. 531Instead, it is a mandatory part of higher-speed specifications. 532.Ss Jumbo Frames 533The IEEE 802.3 standard specifies a standard frame size of 1518 bytes, 534which includes a 4-byte frame checksum, a 14-byte header, and 1500 bytes 535of payload. 536Most devices support larger frame sizes than this, and when all possible parties 537on the same local network can do so, it may be advantageous to choose a larger 538frame size; 9000 bytes is the most common option, as it allows a transport layer 539to convey 8 KB (8192) of data, while leaving room for various link, network, and 540transport layer headers. 541.Lp 542Note that the use of frames carrying more than 1500 bytes of payload is 543not standardized, even though it is common practice. 544.Lp 545The 546.Sy mtu 547property is used to configure the frame size. 548Note that this is the size of the payload, and excludes the preamble, checksum, 549and header. 550It also excludes the tag for devices that support tagging (see 551.Sx Virtual LANs 552below). 553.Lp 554Care must be taken to ensure that all communication parties agree on the same 555size, or communication may cease to function properly. 556.Lp 557Note that the 558.Sy mtu 559property refers to the link layer property. 560It may be necessary to configure upper layer protocols such as IP to use a 561different size when this changes. 562See 563.Xr ifconfig 8 . 564. 565.Ss Virtual LANs 566Most devices support virtual LANs (and also priority control tagging) though 567the use of a 4-byte tag inserted between the frame header and payload. 568The details of configuration of this are covered in the 569.Xr dladm 8 570manual. 571. 572.Ss Data Link Provider Interface (DLPI) Details 573. 574The correct method for applications to access Ethernet devices directly 575is to use the DLPI. 576See 577.Xr dlpi 4P 578and 579.Xr libdlpi 3LIB 580for further information. 581.Lp 582The following DLPI parameters are presented to applications. 583.Bl -column -offset indent "Broadcast address" 584.It Maximum SDU Ta 1500 (or larger, as determined by the Sy mtu No property.) 585.It Minimum SDU Ta 0 586.It Address length Ta 6 587.It MAC type Ta Dv DL_ETHER 588.It SAP length Ta -2 589.It Service mode Ta Dv DL_CLDLS 590.It Broadcast address Ta Li ff:ff:ff:ff:ff:ff No (6 bytes with all bits set) 591.El 592.Lp 593Note that if the application binds to SAP of 0, then standard IEEE 802.3 594mode is assumed and the frame length is stored in place of the Ethernet type. 595Frames that arrive with the type field set to 1500 or less, are delivered 596to applications that bind to SAP 0. 597.Lp 598Ethernet drivers on the support both DLPI style 1 and style 2 operation. 599Additionally, it is possible to configure provide 600.Dq vanity 601names to interfaces using the 602.Xr dladm 8 603.Sy rename-link 604subcommand. 605Such vanity names are only accessible using DLPI style 1. 606.Sh NOTES 607There may be other mechanisms available to configure link layer properties. 608Historically the 609.Xr ndd 8 610command, and 611.Xr driver.conf 5 612files could be used to do this. 613These methods are deprecated in favor of 614.Xr dladm 8 615properties. 616. 617.Sh INTERFACE STABILITY 618When present, the statistics and properties presented here 619are 620.Sy Committed . 621However, note that not every Ethernet device supports all of these, 622and some devices may support additional statistics and properties. 623.Lp 624The DLPI and IEEE 802.3 itself are 625.Sy Standard . 626.Sh SEE ALSO 627.Xr libdlpi 3LIB , 628.Xr dlpi 4P , 629.Xr driver.conf 5 , 630.Xr dladm 8 , 631.Xr ifconfig 8 , 632.Xr kstat 8 , 633.Xr ndd 8 , 634.Xr netstat 8 635.Rs 636.%T IEEE 802.3: Ethernet 637.%Q IEEE Standards Association 638.Re 639.Rs 640.%B Data Link Provider Interface (DLPI) 641.%Q The Open Group 642.%D 1997 643.Re 644.Rs 645.%B STREAMs Programming Guide 646.%Q Sun Microsystems, Inc. 647.%D January 2005 648.Re 649