# Numeración y orden de los bits

> Cada bit de un valor con su peso y su número en las numeraciones LSB 0, MSB 0 y en base 1, el campo que indiques como bits i a j, el valor con los bits invertidos y en el orden en que lo envía un enlace, una cadena de bits impresa leída en el orden en que se imprimió, y una dirección MAC en forma canónica y con los bits invertidos, con los bits I/G y U/L identificados. Esquemas para el estado LACP, los flags TCP, los flags DNS, el octeto ToS y la etiqueta 802.1Q.

- Tool: https://ronutz.com/es/tools/bit-numbering-and-order
- Family: Redes

---

## Qué hace

Cada bit de un número binario tiene un peso, y los documentos no se ponen de acuerdo sobre cómo llamar a cada uno. El bit menos significativo (LSB, least significant bit) es el que vale 1; el bit más significativo (MSB, most significant bit), el que más vale; y las tres numeraciones en uso cuentan desde extremos distintos o desde un primer número distinto. La página responde a las preguntas que se derivan de ello, en tres modos:

- **Valor.** Un número y su ancho: cada bit con su peso y su número en las numeraciones LSB 0, MSB 0 y en base 1, los bits a 1 en cada una, el número de unos y el bit de paridad, los bits a 1 más bajo y más alto, la lectura en complemento a dos, el valor con los bits invertidos, octeto a octeto y entero, los octetos intercambiados, y el orden que toman los bits en un enlace que envía primero el bit menos significativo y en uno que envía primero el más significativo. Opcionalmente, un esquema conocido nombra cada campo, y “bits i a j” en cualquier numeración da la máscara, el desplazamiento y el valor del campo.
- **Bits impresos.** Una cadena de ceros y unos tal como la imprimió un dispositivo, con el orden en que se imprimió: el valor que representa y el valor que da la misma cadena si se lee al revés.
- **Dirección MAC.** Una dirección MAC (Media Access Control) de 48 bits escrita en forma canónica o con los bits invertidos: las dos formas, los bits I/G (individual/grupo) y U/L (universal/local), el cuadrante de una dirección local según el Structured Local Address Plan (SLAP) y los 48 bits en el orden en que los envía un enlace Ethernet.

Todo se calcula en tu navegador.

## Las tres numeraciones

- **LSB 0**: el bit 0 es el menos significativo, así que el bit k vale 2 elevado a k. El manual de Intel lo dice en una frase: “Bit positions are numbered from right to left. The numerical value of a set bit is equal to two raised to the power of the bit position” ([volumen 1 del Intel SDM](https://cdrdv2-public.intel.com/825744/253665-sdm-vol-1.pdf), 1.3.1). El kernel de Linux escribe las máscaras de la misma forma, `BIT(nr)` como `1 << nr` y `GENMASK(h, l)` como “a contiguous bitmask starting at bit position @l and ending at position @h” ([include/linux/bits.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/bits.h)).
- **MSB 0**: el bit 0 es el más significativo. Todos los diagramas de los RFC (Request for Comments) la usan: “the bit labeled 0 is the most significant bit”, así que el octeto dibujado `1 0 1 0 1 0 1 0` es 170 ([RFC 791](https://www.rfc-editor.org/rfc/rfc791.txt), apéndice B). La z/Architecture de IBM también numera así sus registros: en el modo de direccionamiento de 24 bits, “bits 0-39 of the intermediate value are ignored” ([IBM SA22-7832-13](https://publibfi.dhe.ibm.com/epubs/pdf/a227832d.pdf)).
- **Base 1**: el bit 1 es el menos significativo. El protocolo simple de administración de red (SNMP, Simple Network Management Protocol) coloca un valor BITS en los “bits 8 (high order bit) to 1 (low order bit)” de cada octeto ([RFC 3417](https://www.rfc-editor.org/rfc/rfc3417.txt), sección 8), y el `display eth-trunk` de Huawei documenta su LACP PortState como Bit 1 a Bit 8 ([Huawei, Link Aggregation Commands](https://support.huawei.com/enterprise/en/doc/EDOC1100514211/54c5f31b/link-aggregation-commands)).

Con un ancho de w bits, el bit k en LSB 0 es el bit w − 1 − k en MSB 0 y el bit k + 1 en base 1. La página muestra las tres para cada bit, de modo que un número leído en un documento se puede encontrar en otro.

## Valor: los datos de entrada

- **Valor**: hexadecimal con `0x` (`0x3D`), binario con `0b` (`0b0011_1101`) o dígitos decimales (`61`); los grupos de dígitos pueden separarse con espacios simples o guiones bajos. Un signo menos delante de un decimal da sus bits en complemento a dos. Una cadena de dígitos hexadecimales sin `0x` se rechaza con una pista, para que `10` nunca sea, sin avisar, diez o dieciséis.
- **Ancho**: de 1 a 64 bits. Si se deja vacío, sale de la entrada: cuatro bits por cada dígito hexadecimal y uno por cada dígito binario, incluidos los ceros a la izquierda (así que `0x0800` tiene 16 bits), o el menor de 8, 16, 32 y 64 que contenga un valor decimal.
- **Esquema** (opcional), para un valor del ancho del esquema:
  - **Estado LACP** (8 bits): el octeto Actor_State o Partner_State del protocolo de control de agregación de enlaces (LACP, Link Aggregation Control Protocol). La norma 802.1AX del Institute of Electrical and Electronics Engineers (IEEE) numera los bits del 0 (LACP_Activity) al 7 (Expired) ([IEEE8023-LAG-MIB](https://www.ieee802.org/1/files/public/MIBs/IEEE8021-AX-MIB-202005290000Z.mib)), las máscaras del controlador de Linux van de `0x1` a `0x80` ([if_bonding.h](https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/if_bonding.h)) y Huawei imprime los mismos bits como Bit 1 a Bit 8.
  - **Primer octeto MAC** (8 bits): “The least significant bit of Octet 0 (the I/G bit)” y “the second least significant bit of Octet 0 (the U/L bit)” ([directrices de la IEEE RA](https://standards-support.ieee.org/hc/en-us/articles/4888705676564-Guidelines-for-Use-of-Extended-Unique-Identifier-EUI-Organizationally-Unique-Identifier-OUI-and-Company-ID-CID)), con los bits Y y Z que el [RFC 9542](https://www.rfc-editor.org/rfc/rfc9542.txt) dibuja encima de ellos (sección 2.1).
  - **Flags TCP** (8 bits): el decimocuarto octeto del encabezado, CWR, ECE, URG, ACK, PSH, RST, SYN, FIN ([RFC 9293](https://www.rfc-editor.org/rfc/rfc9293.txt), sección 3.1). La Internet Assigned Numbers Authority (IANA) los numera del 8 al 15 en su registro TCP Header Flags ([IANA](https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xml)), y Linux, de `BIT(7)` a `BIT(0)` ([include/net/tcp.h](https://raw.githubusercontent.com/torvalds/linux/master/include/net/tcp.h)).
  - **Flags DNS** (16 bits): la segunda palabra del encabezado del sistema de nombres de dominio (DNS, Domain Name System), QR, Opcode, AA, TC, RD, RA, Z, AD, CD y RCODE tal como los dibujan el [RFC 1035](https://www.rfc-editor.org/rfc/rfc1035.txt) (sección 4.1.1) y el [RFC 6895](https://www.rfc-editor.org/rfc/rfc6895.txt) (sección 2); el registro DNS Header Flags de la IANA numera desde AA, bit 5, hasta CD, bit 11 ([IANA](https://www.iana.org/assignments/dns-parameters/dns-parameters.xml)).
  - **ToS de IPv4** (8 bits): el octeto Type of Service (tipo de servicio), el Traffic Class de IPv6: el punto de código de servicios diferenciados (DSCP, differentiated services codepoint) en los bits 0 a 5 ([RFC 2474](https://www.rfc-editor.org/rfc/rfc2474.txt), sección 3) y la notificación explícita de congestión (ECN, Explicit Congestion Notification) en los “Bits 6 and 7” ([RFC 3168](https://www.rfc-editor.org/rfc/rfc3168.txt), sección 5), con el nombre del punto de código ECN.
  - **TCI de 802.1Q** (16 bits): la prioridad de la etiqueta, el DEI (indicador de apto para descarte, Drop Eligible Indicator) y el ID de VLAN (red de área local virtual, virtual local area network), con las máscaras del kernel de Linux `0xe000` (desplazamiento 13), `0x1000` y `0x0fff` ([include/linux/if_vlan.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/if_vlan.h)).
- **Bits i a j** (opcional): una numeración y uno o dos números de bit. La máscara, el desplazamiento y el valor del campo, la expresión C `(v >> shift) & mask` y el `GENMASK(hi, lo)` del kernel (o `BIT(n)` para un solo bit), y los mismos bits en las otras dos numeraciones.

## Valor: las reglas

- **Complemento a dos.** El valor leído como número con signo es negativo cuando su bit superior está a 1; para 8, 16, 32 y 64 bits se aplica la frase de Intel: “The sign bit is located in bit 7 in a byte integer, bit 15 in a word integer, bit 31 in a doubleword integer, and bit 63 in a quadword integer” (Intel SDM, 4.2.1.2).
- **Bits a 1 más bajo y más alto.** En números LSB 0, lo que devuelven las instrucciones BSF y BSR de Intel: “the offset from the least significant bit (bit 0) in the bit string to the first set bit” (7.3.7.2).
- **Paridad.** La paridad par añade el bit que deja “an even number of logic 1s in the data and parity bits” (un número par de unos entre los datos y el bit de paridad), y la impar, el bit que lo deja impar ([TI TL16C550D](https://www.ti.com/lit/ds/symlink/tl16c550d.pdf), bit 4 del registro de control de línea).
- **Inversión.** “Todos los bits invertidos” refleja el ancho entero; “Bits invertidos en cada octeto” refleja cada octeto en su sitio, el intercambio que el [RFC 2469](https://www.rfc-editor.org/rfc/rfc2469.txt) describe entre las direcciones canónicas y las de Token Ring; “Octetos intercambiados” es el orden de bytes, que explica [Big-endian y little-endian](https://ronutz.com/es/learn/big-endian-and-little-endian). Reflejar el ancho entero equivale a las otras dos operaciones juntas. El propio CRC-32 del kernel de Linux, una comprobación de redundancia cíclica (CRC, cyclic redundancy check), muestra una inversión: el mismo polinomio es `0x04c11db7` con el bit más significativo primero y `0xedb88320` con el menos significativo primero ([include/linux/crc32.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/crc32.h)).
- **En el cable.** Para octetos completos, los bits en el orden en que los envía un enlace, octeto a octeto, con los octetos en el orden escrito (el más significativo primero, como envía un número el orden de bytes de red, RFC 791). El bit menos significativo primero es el orden de Ethernet, el inverso del que dibuja el Internet Engineering Task Force (IETF): “the physical order of bit transmission within an octet on an IEEE [802.3] link is from the lowest order bit to the highest order bit (i.e., the reverse of the IETF's ordering)” (RFC 9542, sección 1.1); un UART (transmisor-receptor asíncrono universal, universal asynchronous receiver-transmitter) hace lo mismo, “Bit 0 is the least significant bit. It is the first bit serially transmitted or received” (TI TL16C550D), y también el protocolo punto a punto (PPP, Point-to-Point Protocol): “All octets are transmitted least significant bit first” ([RFC 1662](https://www.rfc-editor.org/rfc/rfc1662.txt), secciones 4.5.2 y 5.5). El bit más significativo primero es la regla de un bus I2C, “Data is transferred with the Most Significant Bit (MSB) first” ([NXP UM10204](https://www.nxp.com/docs/en/user-guide/UM10204.pdf), 3.1.5), y el valor predeterminado de un bus de interfaz periférica serie (SPI, Serial Peripheral Interface), “the 'MSB first' default for each word in a transfer”, que un dispositivo puede cambiar con `SPI_LSB_FIRST` ([include/linux/spi/spi.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/spi/spi.h)).

## Bits impresos

Escribe los bits en el orden en que están impresos e indica qué extremo va primero. **El bit más significativo primero** es el orden en que se escriben los números. **El bit menos significativo primero** es como Huawei imprime un LACP PortState: su referencia de comandos describe “The status variable is eight bits, such as 10111100” como Bit 1 a Bit 8, en el orden de los bits 0 a 7 de 802.1AX, así que su primer carácter es LACP_Activity, el bit de peso 1, y `10111100` es el octeto 0x3D (Huawei, tabla 5-17). Leída al revés, la misma cadena sería 0xBC, y la página muestra las dos, porque un orden mal leído cambia el número sin dar ningún error. A continuación viene la lectura completa del valor, con el esquema de estado LACP si lo eliges.

## Dirección MAC

- **Forma canónica** es como el [RFC 2469](https://www.rfc-editor.org/rfc/rfc2469.txt) define una dirección para mostrarla: “The first bit of each byte that appears on the LAN maps to the least significant (i.e., right-most) bit of each byte in memory”, lo que “puts the group address indicator ... in the least significant bit of the first byte”. El hardware Ethernet funciona así.
- **Forma con los bits invertidos** (“formato MSB”, “forma no canónica”) es como guardaban las direcciones Token Ring y algunos adaptadores FDDI (interfaz de datos distribuidos por fibra, Fiber Distributed Data Interface): cada octeto con sus bits invertidos, así que 12-34-56-78-9A-BC estaba en memoria como 48-2C-6A-1E-59-3D. Elige la forma en que se escribió la dirección; la página da la otra.
- **I/G y U/L.** A partir del primer octeto canónico: I/G 0 para una estación, 1 para un grupo (multicast o broadcast); U/L 0 para una dirección bajo un prefijo asignado por el IEEE, 1 para una local (directrices de la IEEE RA; RFC 9542). El kernel de Linux los comprueba como `0x01 & addr[0]` y `0x02 & addr[0]` ([include/linux/etherdevice.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/etherdevice.h)).
- **Cuadrante SLAP.** En una dirección local, los bits Y y Z eligen uno de cuatro cuadrantes: Administratively Assigned (Y 0, Z 0), Extended Local (Y 0, Z 1), Reserved (Y 1, Z 0) y Standard Assigned (Y 1, Z 1) (RFC 9542, sección 2.1.1, tabla 2); el plan es opcional.
- **En el cable.** Los 48 bits octeto a octeto, cada uno con el bit menos significativo primero, así que el primer bit enviado es el bit I/G.
- **La línea de lectura errónea** muestra lo que concluiría sobre I/G y U/L quien tomara la forma con los bits invertidos por la canónica. El RFC 2469 recoge la consecuencia práctica: los puentes entre Token Ring y Ethernet tenían que “perform bit swaps of the addresses in the address fields of ARP packets” (invertir los bits de las direcciones en los campos de dirección de los paquetes ARP), los del protocolo de resolución de direcciones, Address Resolution Protocol (sección 3.2).

## Qué rechaza y por qué

Un campo de más de 80 caracteres; un campo vacío; hexadecimal sin `0x` (con una pista), un prefijo sin dígitos detrás, octal, una dirección MAC en el modo de valor (remite al modo MAC); un valor de más de 64 bits; un ancho fuera del rango de 1 a 64 o un valor que no cabe en su ancho (con los bits que necesita), y un decimal negativo fuera del rango de complemento a dos del ancho; un esquema, una numeración, un orden de impresión o una forma MAC desconocidos; un esquema de un ancho distinto del valor (con el ancho que hay que poner); un número de bit que no es entero o que no existe en el ancho para la numeración elegida (con el rango); un último bit sin primero; una cadena impresa con algo distinto de ceros, unos y separadores simples; y una dirección MAC que no tiene seis octetos en una de las cuatro formas.

## Ejemplos resueltos

- **Los flags de respuesta DNS 0x81A0** (el Ejemplo, tomado del artículo sobre el encabezado DNS): leídos como flags DNS, están activados QR, RD, RA y AD. QR es el bit 0 en MSB 0 y el bit 15 en LSB 0; RD, al que la IANA da el número 7, es el bit 8 en LSB 0.
- **El PortState 10111100 de Huawei** (el Ejemplo de bits impresos), con el bit menos significativo primero: 0x3D, con LACP_Activity, Aggregation, Synchronization, Collecting y Distributing activados; leído por error con el más significativo primero, es 0xBC. Las muestras 10100000 y 10110000 son 0x05 y 0x0D.
- **El “0111101 (binary)” de Cisco**: el documento de Cisco para solucionar problemas de EtherChannel dice “The expected value for LACP flags is 0x3D (hex) or 0111101 (binary)” ([Cisco, documento 220367](https://www.cisco.com/c/en/us/support/docs/switches/catalyst-9300-series-switches/220367-troubleshoot-etherchannels-on-catalyst-9.html)). Escritos como `0b0111101`, esos siete dígitos son un valor de 7 bits, y el esquema LACP de 8 bits lo rechaza; con el ancho puesto en 8 vuelve el cero inicial que se había perdido y el valor es 0x3D, el mismo octeto que Huawei imprime como 10111100.
- **La dirección del RFC 2469** (el Ejemplo de MAC): 12-34-56-78-9A-BC es local (U/L 1) e individual, Administratively Assigned según el SLAP, y 48-2C-6A-1E-59-3D con los bits invertidos; leída como canónica, esa forma invertida parecería universal.
- **El DSCP a partir del ToS 0xB8**: los bits 0 a 5 en MSB 0 son los bits 7 a 2 en LSB 0, `GENMASK(7, 2)`, máscara 0xFC, desplazamiento 2, valor 46.
- **El polinomio CRC-32 0x04C11DB7** con los bits invertidos es 0xEDB88320, las dos formas del mismo polinomio en el kernel; la constante FCS-16 0x8408 del RFC 1662, invertida, es 0x1021.

## Qué no hace

Lee los valores y las direcciones que escribes; no captura tráfico ni habla con ningún dispositivo. No calcula sumas de comprobación ni CRC, no convierte el orden de bytes más allá de mostrar los octetos intercambiados, no decodifica encabezados completos (eso lo hacen el [decodificador de etiquetas 802.1Q](https://ronutz.com/es/tools/vlan-tag-and-trunk-calculator), el [lector de enlaces miembro y estado de LACP](https://ronutz.com/es/tools/lacp-hash-and-state-reader) y las herramientas de DNS) ni identifica el fabricante de una dirección MAC (eso lo hace la [búsqueda de OUI](https://ronutz.com/es/tools/oui-lookup)).

## Compartir resultados

Debajo del resultado principal, **Compartir resultados** genera un enlace a esta página, solo cuando lo presionas, que lleva después del `#` el campo tal como se escribió y la configuración propia del modo: siempre `input` y `mode` (`value`, `printed` o `mac`); en el modo de valor, `width` si se escribió, `layout` si se eligió uno, y `numbering`, `from` y `to` (si se escribieron) para un campo; en el modo de bits impresos, `order`, `layout` y el campo como en el modo de valor; en el modo MAC, `form`. La configuración de los otros modos no se lleva.

Según el [RFC 3986](https://www.rfc-editor.org/rfc/rfc3986.txt) (sección 3.5, consultado el 2026-11-08), el fragmento queda “separated from the rest of the URI prior to a dereference” (separado del resto del URI antes de resolverlo), así que estos valores no se envían al servidor cuando se abre el enlace; se quedan en la barra de direcciones y en el historial de quien lo abra, y cualquiera que tenga el enlace puede leerlos.

- **Longitud.** Un enlace lleva como máximo 16.384 caracteres, el límite que el sitio aplica a todo valor después del `#`; estos campos son mucho más cortos.
- **Al abrir un enlace.** Se establecen el modo y su configuración como si los escribieras, los otros modos conservan sus valores y la página calcula. Se ignora un enlace con un modo, un esquema, un orden, una forma o una numeración desconocidos, con una opción de otro modo, con un ancho o un número de bit que no tenga de uno a tres dígitos, con un `to` sin `from`, con una numeración sin `from` o con un campo de más de una línea o de más de 80 caracteres. Se acepte o no, los valores salen después de la propia dirección de la página al instante, sin ninguna solicitud, así que al recargar, con un marcador o con el propio botón Compartir de la página no se lleva nada que no hayas decidido compartir.

## Procedencia

El motor es aritmética de bits fija sobre valores BigInt, sin reloj, sin red y sin aleatoriedad. Sus vectores de referencia (conjunto `bit-numbering-and-order-golden-2026-11-08`) fijan los 256 octetos en el modo de valor y en el de bits impresos con el menos significativo primero, los anchos de 1 a 64 (todo unos y solo el bit superior), la deducción del ancho a partir de hexadecimal, binario y decimal, los decimales negativos, cada esquema sobre varios valores, campos en las tres numeraciones, incluido el propio ejemplo `GENMASK_ULL(39, 21)` del kernel, cadenas impresas en los dos órdenes con separadores, direcciones MAC en todas las formas y cuadrantes SLAP, los Ejemplos y las muestras, las frases que contienen las reglas, los textos de la API y los rechazos. Cada valor esperado se calculó con un modelo independiente en Python escrito a partir de los documentos (los bits como texto, las posiciones como índices de cadena, la inversión invirtiendo el texto, los octetos con `int.to_bytes`), no ejecutando este motor.

## API

El mismo motor responde a `/api/v1/bit-numbering-and-order` en la API HTTP del sitio; el contrato está en la [página de la API](https://ronutz.com/es/api), que también indica si este sitio sirve la API.

- **Solicitud.** Un objeto JSON. Valor: `{"mode": "value", "input": "0x81A0", "width": 16, "layout": "dns-flags", "numbering": "msb0", "from": 1, "to": 4}`; `width`, `layout`, `numbering`, `from` y `to` son opcionales. Bits impresos: `{"mode": "printed", "input": "10111100", "order": "lsb-first", "layout": "lacp"}`; `order` (`msb-first` de forma predeterminada) y el resto son opcionales. MAC: `{"mode": "mac", "input": "48-2C-6A-1E-59-3D", "form": "reversed"}`; `form` (`canonical` de forma predeterminada) es opcional.
- **Respuesta, valor y bits impresos.** `mode`, `width`, `widthInferred`, `hex`, `decimal`, `signed`, `binary`, `binaryLsbFirst`, `octets`, `bits` (cada uno con `lsb0`, `msb0`, `one`, `weight`, `set`), `setBits` (`lsb0`, `msb0`, `one`), `ones`, `parityEven`, `parityOdd`, `lowestSet`, `highestSet`, `reversed`, `reversedPerOctet`, `byteSwapped`, `wire` (`lsbFirst`, `msbFirst`), `printed` (`order`, `typed`, `otherHex`, `otherDecimal`, o null), `layout` (`id`, `width`, `fields`, `numberingNote`, o null), `field` (`numbering`, `from`, `to`, `lsb0Hi`, `lsb0Lo`, `msb0From`, `msb0To`, `oneHi`, `oneLo`, `span`, `mask`, `shift`, `value`, `valueHex`, `bits`, `expression`, `kernel`, o null) y `notes`.
- **Respuesta, MAC.** `mode`, `form`, `formDefault`, `canonical`, `canonicalColon`, `reversed`, `firstOctetBits`, `group`, `local`, `broadcast`, `slap` (`y`, `z`, `quadrant`, `name`, o null), `wire`, `firstBitOnWire`, `reversedMisread` (`group`, `local`) y `notes`.
- **Errores.** HTTP 400, `invalid_input`, con el mensaje del motor, por ejemplo `"3D" looks hexadecimal: write it with 0x in front (0x3D), so it is not read as decimal.`.

## Fuentes

- [Intel 64 and IA-32 Architectures Software Developer's Manual, volume 1, 253665-084US, June 2024](https://cdrdv2-public.intel.com/825744/253665-sdm-vol-1.pdf) (consultado el 2026-11-08): 1.3.1, 4.2.1.2, 7.3.7
- [IBM z/Architecture Principles of Operation, SA22-7832-13, May 2022](https://publibfi.dhe.ibm.com/epubs/pdf/a227832d.pdf) (consultado el 2026-11-08): capítulo 3
- [RFC 791, Internet Protocol](https://www.rfc-editor.org/rfc/rfc791.txt) (STD 5, consultado el 2026-11-08): apéndice B
- [RFC 1035, Domain Names: Implementation and Specification](https://www.rfc-editor.org/rfc/rfc1035.txt) (STD 13, consultado el 2026-11-08): secciones 2.3.2 y 4.1.1; [RFC 6895](https://www.rfc-editor.org/rfc/rfc6895.txt) (BCP 42, consultado el 2026-11-08): sección 2; [IANA, DNS Header Flags](https://www.iana.org/assignments/dns-parameters/dns-parameters.xml) (actualizado el 2026-10-16, consultado el 2026-11-08)
- [RFC 3417, Transport Mappings for SNMP](https://www.rfc-editor.org/rfc/rfc3417.txt) (STD 62, consultado el 2026-11-08): sección 8
- [Huawei, S5700 and S6700 V200R025C00 Command Reference, Link Aggregation Commands](https://support.huawei.com/enterprise/en/doc/EDOC1100514211/54c5f31b/link-aggregation-commands) (consultado en un navegador el 2026-11-08, porque el sitio rechaza las lecturas automatizadas): display eth-trunk, tabla 5-17
- [Cisco, Troubleshoot EtherChannels on Catalyst 9000 Switches, document 220367](https://www.cisco.com/c/en/us/support/docs/switches/catalyst-9300-series-switches/220367-troubleshoot-etherchannels-on-catalyst-9.html) (actualizado el 8 de agosto de 2024; consultado en un navegador el 2026-11-08, porque el sitio rechaza las lecturas automatizadas): los flags LACP esperados
- [IEEE8023-LAG-MIB for IEEE 802.1AX-2020](https://www.ieee802.org/1/files/public/MIBs/IEEE8021-AX-MIB-202005290000Z.mib) (consultado el 2026-11-08) y el [include/uapi/linux/if_bonding.h](https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/if_bonding.h) del kernel de Linux (consultado el 2026-11-08)
- [RFC 9542, IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 Parameters](https://www.rfc-editor.org/rfc/rfc9542.txt) (BCP 141, consultado el 2026-11-08): secciones 1.1, 2.1, 2.1.1, 2.1.4 y 2.3.1
- [RFC 2469, A Caution On The Canonical Ordering Of Link-Layer Addresses](https://www.rfc-editor.org/rfc/rfc2469.txt) (Informational, consultado el 2026-11-08): secciones 2 y 3
- [IEEE Registration Authority, Guidelines for Use of EUI, OUI and CID](https://standards-support.ieee.org/hc/en-us/articles/4888705676564-Guidelines-for-Use-of-Extended-Unique-Identifier-EUI-Organizationally-Unique-Identifier-OUI-and-Company-ID-CID) (actualizado el 1 de abril de 2022, consultado el 2026-11-08)
- [RFC 1662, PPP in HDLC-like Framing](https://www.rfc-editor.org/rfc/rfc1662.txt) (STD 51, consultado el 2026-11-08): secciones 3.1, 4.5.2 y 5.5 y apéndice C.1
- [Texas Instruments, TL16C550D](https://www.ti.com/lit/ds/symlink/tl16c550d.pdf) (SLLS597E, consultado el 2026-11-08)
- [NXP Semiconductors, UM10204 I2C-bus specification and user manual, Rev. 7.0, 1 October 2021](https://www.nxp.com/docs/en/user-guide/UM10204.pdf) (consultado en un navegador el 2026-11-08, porque el sitio rechaza las lecturas automatizadas): 3.1.5 Byte format, figura 10
- El código fuente del kernel de Linux, torvalds/linux master (consultado el 2026-11-08): [include/linux/spi/spi.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/spi/spi.h), [include/linux/bits.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/bits.h), [include/linux/crc32.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/crc32.h), [include/linux/etherdevice.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/etherdevice.h), [include/net/tcp.h](https://raw.githubusercontent.com/torvalds/linux/master/include/net/tcp.h) e [include/linux/if_vlan.h](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/if_vlan.h)
- [IANA, TCP Header Flags](https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xml) (actualizado el 2026-10-22, consultado el 2026-11-08) y [RFC 9293, Transmission Control Protocol](https://www.rfc-editor.org/rfc/rfc9293.txt) (STD 7, consultado el 2026-11-08): sección 3.1
- [RFC 2474, the DS Field](https://www.rfc-editor.org/rfc/rfc2474.txt) (consultado el 2026-11-08): sección 3; [RFC 3168, ECN](https://www.rfc-editor.org/rfc/rfc3168.txt) (consultado el 2026-11-08): sección 5
- [RFC 3986, Uniform Resource Identifier (URI): Generic Syntax](https://www.rfc-editor.org/rfc/rfc3986.txt) (STD 66, consultado el 2026-11-08): sección 3.5
- [RFC Editor, RFC index](https://www.rfc-editor.org/rfc-index.xml) (consultado el 2026-11-08): el estado de cada uno de los RFC anteriores

## Standards and references

- [Intel 64 and IA-32 Architectures Software Developer's Manual, volume 1, 253665-084US, June 2024: 1.3.1 Bit and Byte Order, 4.2.1.2 Signed Integers, 7.3.7 bit test and bit scan instructions](https://cdrdv2-public.intel.com/825744/253665-sdm-vol-1.pdf) - LSB 0: "Bit positions are numbered from right to left. The numerical value of a set bit is equal to two raised to the power of the bit position"; the sign bit in bit 7, 15, 31 or 63; BSF and BSR give "the offset from the least significant bit (bit 0)"
- [IBM z/Architecture Principles of Operation, SA22-7832-13, fourteenth edition, May 2022: chapter 3, information formats and operand addresses](https://publibfi.dhe.ibm.com/epubs/pdf/a227832d.pdf) - MSB 0 in a processor manual: "bits are numbered in a left-to-right sequence", an address's "bits are numbered 0-63", and in 24-bit mode "bits 0-39 of the intermediate value are ignored"
- [RFC 791, Internet Protocol, September 1981 (STD 5): Appendix B, Data Transmission Order](https://www.rfc-editor.org/rfc/rfc791.txt) - "the bit labeled 0 is the most significant bit"; the octet drawn 1 0 1 0 1 0 1 0 is 170; the most significant octet of a multi-octet quantity is transmitted first
- [RFC 1035, Domain Names: Implementation and Specification, November 1987 (STD 13): sections 2.3.2 and 4.1.1](https://www.rfc-editor.org/rfc/rfc1035.txt) - the same transmission-order rule; the header's flags word QR, Opcode, AA, TC, RD, RA, Z and RCODE as drawn
- [RFC 6895, Domain Name System (DNS) IANA Considerations, April 2013 (BCP 42): section 2](https://www.rfc-editor.org/rfc/rfc6895.txt) - the header drawing with AD and CD in the place of RFC 1035's Z bits
- [IANA, Domain Name System (DNS) Parameters, DNS Header Flags (registry updated 2026-10-16)](https://www.iana.org/assignments/dns-parameters/dns-parameters.xml) - AA bit 5, TC bit 6, RD bit 7, RA bit 8, bit 9 reserved, AD bit 10, CD bit 11 of the second 16-bit word (MSB 0)
- [RFC 3417, Transport Mappings for the Simple Network Management Protocol (SNMP), December 2002 (STD 62): section 8](https://www.rfc-editor.org/rfc/rfc3417.txt) - a BITS value is placed in "bits 8 (high order bit) to 1 (low order bit)" of each octet, first named bit first: 1-based numbering from the least significant bit
- [Huawei, S5700 and S6700 V200R025C00 Command Reference, Link Aggregation Commands: display eth-trunk and Table 5-17 PortState (read in a browser on 2026-11-08: the site refuses automated reads)](https://support.huawei.com/enterprise/en/doc/EDOC1100514211/54c5f31b/link-aggregation-commands) - "The status variable is eight bits, such as 10111100", described as Bit 1 to Bit 8 in the order of 802.1AX's bits 0 to 7; the example rows 10111100, 10100000 and 10110000
- [Cisco, Troubleshoot EtherChannels on Catalyst 9000 Switches, document 220367, updated 8 August 2024 (read in a browser on 2026-11-08: the site refuses automated reads)](https://www.cisco.com/c/en/us/support/docs/switches/catalyst-9300-series-switches/220367-troubleshoot-etherchannels-on-catalyst-9.html) - "The expected value for LACP flags is 0x3D (hex) or 0111101 (binary)", seven binary digits as printed (0x3D is 00111101 in 8 bits); its state table labels Expired the most significant bit and LACP Activity the least
- [IEEE 802.1 Working Group, IEEE8023-LAG-MIB (IEEE 802.1AX-2020), revision 2020-05-29: LacpState and dot3adAggPortActorAdminState](https://www.ieee802.org/1/files/public/MIBs/IEEE8021-AX-MIB-202005290000Z.mib) - LacpState BITS lacpActivity(0) to expired(7); "The first bit corresponds to bit 0 of the Actor_State (LACP_Activity)"
- [The Linux kernel source, include/uapi/linux/if_bonding.h (torvalds/linux master): LACP_STATE_* masks](https://raw.githubusercontent.com/torvalds/linux/master/include/uapi/linux/if_bonding.h) - LACP_STATE_LACP_ACTIVITY 0x1 to LACP_STATE_EXPIRED 0x80: 802.1AX's bit k is the bit of weight 2^k
- [RFC 9542, IANA Considerations and IETF Protocol and Documentation Usage for IEEE 802 Parameters, April 2024 (BCP 141): sections 1.1, 2.1, 2.1.1, 2.1.4 and 2.3.1](https://www.rfc-editor.org/rfc/rfc9542.txt) - bit transmission within an octet on an IEEE 802.3 link "from the lowest order bit to the highest order bit (i.e., the reverse of the IETF's ordering)"; the M, X, Y and Z bits of the first octet; the four SLAP quadrants; the documentation and 33-33 addresses of the samples
- [RFC 2469, A Caution On The Canonical Ordering Of Link-Layer Addresses, December 1998 (Informational): sections 2 and 3](https://www.rfc-editor.org/rfc/rfc2469.txt) - canonical form ("LSB format") against Token Ring's "MSB format"; 12-34-56-78-9A-BC held as 48-2C-6A-1E-59-3D; bridges that "perform bit swaps of the addresses" in ARP packets
- [IEEE Registration Authority, Guidelines for Use of Extended Unique Identifier (EUI), Organizationally Unique Identifier (OUI), and Company ID (CID), updated 1 April 2022](https://standards-support.ieee.org/hc/en-us/articles/4888705676564-Guidelines-for-Use-of-Extended-Unique-Identifier-EUI-Organizationally-Unique-Identifier-OUI-and-Company-ID-CID) - "The least significant bit of Octet 0 (the I/G bit)" and "the second least significant bit of Octet 0 (the U/L bit)"; EUI bit ordering, which "applications and protocols must unambiguously specify"
- [The Linux kernel source, include/linux/etherdevice.h (torvalds/linux master): is_multicast_ether_addr and is_local_ether_addr](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/etherdevice.h) - the group test 0x01 & addr[0] and the local test 0x02 & addr[0] on the canonical address in memory
- [RFC 1662, PPP in HDLC-like Framing, July 1994 (STD 51): sections 3.1, 4.5.2, 5.5 and appendix C.1](https://www.rfc-editor.org/rfc/rfc1662.txt) - "All octets are transmitted least significant bit first"; binary numbers written most significant bit first, "contrary to standard ISO and CCITT practice which orders bits as transmitted"; the FCS-16 polynomial constant 0x8408
- [Texas Instruments, TL16C550D Asynchronous Communications Element with Autoflow Control, SLLS597E, revised December 2008](https://www.ti.com/lit/ds/symlink/tl16c550d.pdf) - "Bit 0 is the least significant bit. It is the first bit serially transmitted or received"; even parity is "an even number of logic 1s in the data and parity bits"
- [NXP Semiconductors, UM10204 I2C-bus specification and user manual, Rev. 7.0, 1 October 2021: 3.1.5 Byte format and Figure 10 (read in a browser on 2026-11-08: the site refuses automated reads)](https://www.nxp.com/docs/en/user-guide/UM10204.pdf) - "Data is transferred with the Most Significant Bit (MSB) first"; the first byte after START carries the target address from its most significant bit with the R/W bit as its least significant
- [The Linux kernel source, include/linux/spi/spi.h and include/uapi/linux/spi/spi.h (torvalds/linux master): spi_device mode, SPI_LSB_FIRST](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/spi/spi.h) - the "MSB first" default for each word in a transfer, overridden by SPI_LSB_FIRST ("per-word bits-on-wire")
- [The Linux kernel source, include/vdso/bits.h and include/linux/bits.h (torvalds/linux master): BIT and GENMASK](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/bits.h) - BIT(nr) is (1 << nr); GENMASK(h, l) is "a contiguous bitmask starting at bit position @l and ending at position @h", and GENMASK_ULL(39, 21) is 0x000000ffffe00000
- [The Linux kernel source, include/linux/crc32.h (torvalds/linux master): crc32_le and crc32_be](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/crc32.h) - the same CRC-32 polynomial least-significant-bit-first as 0xedb88320 and most-significant-bit-first as 0x04c11db7: one is the other bit-reversed
- [IANA, Transmission Control Protocol (TCP) Parameters, TCP Header Flags (registry updated 2026-10-22)](https://www.iana.org/assignments/tcp-parameters/tcp-parameters.xml) - AE bit 7, CWR bit 8, ECE 9, URG 10, ACK 11, PSH 12, RST 13, SYN 14, FIN 15
- [The Linux kernel source, include/net/tcp.h (torvalds/linux master): TCPHDR_* flags](https://raw.githubusercontent.com/torvalds/linux/master/include/net/tcp.h) - TCPHDR_FIN BIT(0) to TCPHDR_CWR BIT(7), TCPHDR_AE BIT(8)
- [RFC 9293, Transmission Control Protocol (TCP), August 2022 (STD 7): section 3.1, header format](https://www.rfc-editor.org/rfc/rfc9293.txt) - the control bits CWR, ECE, URG, ACK, PSH, RST, SYN and FIN in that order after the Data Offset and the reserved bits
- [RFC 2474, Definition of the Differentiated Services Field (DS Field) in the IPv4 and IPv6 Headers, December 1998 (Proposed Standard, updated by RFC 3168, 3260 and 8436): section 3](https://www.rfc-editor.org/rfc/rfc2474.txt) - the DSCP in bits 0 to 5 of the DS field, "the left-most bit signifies bit 0"
- [RFC 3168, The Addition of Explicit Congestion Notification (ECN) to IP, September 2001 (Proposed Standard): section 5](https://www.rfc-editor.org/rfc/rfc3168.txt) - "Bits 6 and 7 in the IPv4 TOS octet are designated as the ECN field"; the codepoints Not-ECT, ECT(1), ECT(0) and CE
- [The Linux kernel source, include/linux/if_vlan.h (torvalds/linux master): VLAN_PRIO_MASK, VLAN_CFI_MASK and VLAN_VID_MASK](https://raw.githubusercontent.com/torvalds/linux/master/include/linux/if_vlan.h) - 0xe000 with shift 13 for the priority, 0x1000 "Canonical Format Indicator / Drop Eligible Indicator", 0x0fff for the VLAN ID
- [RFC 3986, Uniform Resource Identifier (URI): Generic Syntax, January 2005 (STD 66): section 3.5](https://www.rfc-editor.org/rfc/rfc3986.txt) - the fragment is "separated from the rest of the URI prior to a dereference": a Share results link's values are not sent to the server
- [RFC Editor, RFC index (XML): the current status of every RFC cited](https://www.rfc-editor.org/rfc-index.xml) - RFC 791, 1035, 1662, 3417, 9293 and 3986 are Internet Standards; RFC 9542 and 6895 are BCPs; RFC 2474 and 3168 Proposed Standards; RFC 2469 Informational; none obsoleted

## Related reading

- [Badges and cards: RFID, NFC, the Proxmark and MIFARE](https://ronutz.com/en/learn/badges-and-cards-rfid-nfc-the-proxmark-and-mifare.md): An office badge, a transit card and a car key's transponder are radio devices with no battery that answer whatever reader powers them. The cheap ones at 125 kHz answer with a bare number anyone can copy; the 13.56 MHz MIFARE Classic, the most deployed card of its kind, hid a weak cipher until researchers in Berlin and Nijmegen took it apart in 2007 and 2008, and its manufacturer lost a court bid to stop the publication. After reading, you can explain how passive cards are powered and which standards govern them, decode a 26-bit badge number, follow the Proxmark from Jonathan Westhues's bench to the Proxmark 5, read a MIFARE Classic authentication trace, date every major break from the car-key transponders of 2005 to the 2024 backdoor in compatible chips, see where Brazil's Bilhete Único and Brazilian law fit, and name the migrations and reader settings that actually defend a door.
- [Big-endian and little-endian: byte order explained](https://ronutz.com/en/learn/big-endian-and-little-endian.md): A number wider than one byte has to be laid out over several addresses, and machines disagree about which end goes first. What big-endian and little-endian mean, one 32-bit value byte by byte in both orders, where Danny Cohen found the names in 1980, why byte order is not bit order, network byte order in the RFCs and in POSIX, which processors are little-endian, big-endian or both, the instructions that swap bytes, the file formats and protocols that fix an order, what each order really costs, the bugs it causes, how to tell what a machine is, and three cases on this site: the LACP hash, the BIG-IP cookie and UTF-16.
- [Hiding in images: LSB, JPEG and adaptive steganography](https://ronutz.com/en/learn/hiding-in-images-lsb-jpeg-and-adaptive-steganography.md): Digital images became the favourite carrier for hidden messages because every pixel and every compressed coefficient is a number with a little noise in it. This part follows the techniques from the first least-significant-bit tools of the 1990s through palette tricks, JPEG coefficient embedding (JSteg, OutGuess, F5 and matrix embedding) to the content-adaptive schemes of the 2010s (HUGO, WOW, UNIWARD) and the syndrome-trellis codes that drive them. After reading, you can embed one byte into eight pixels by hand, explain why JPEG hiding works on quantized DCT coefficients, compute how matrix embedding saves changes, read a payload in bits per pixel critically, and name the open tools from their own documentation.
- [Least and most significant bit: bit numbering and bit order](https://ronutz.com/en/learn/least-and-most-significant-bit.md): Every bit of a binary number has a weight, and the least significant bit is worth 1 while the most significant bit is worth the most and, in two's complement, carries the sign. What significance means, why LSB and MSB sometimes mean bytes, the three ways documents number bits (LSB 0, MSB 0 and 1-based) and the same field read all three ways, the order bits travel on Ethernet, a UART, PPP, I2C and SPI, canonical and bit-reversed MAC addresses, masks, shifts, parity and reflected CRCs, the bugs a wrong order causes, and three cases on this site: Huawei's PortState printed bit 1 first, the I/G and U/L bits of a MAC address, and the DNS header flags.
- [Link aggregation and LACP: several links that act as one, and the protocol that keeps them honest](https://ronutz.com/en/learn/link-aggregation-and-lacp.md): A link aggregation group bundles parallel Ethernet links into one logical link for more bandwidth and for resilience. Where the standard came from (802.3ad, then 802.1AX), how LACP lets both ends agree before a single frame is sent, the fast and slow timers, why static bundles are risky, why one flow never goes faster than one member link, the rules members must follow, multi-chassis bundles, and the Linux bonding modes.
- [The DNS Header: Opcode, Status, and Flags](https://ronutz.com/en/learn/dns-message-header-and-flags.md): Every DNS message opens with the same 12-byte header: a 16-bit ID, a flags word that holds the opcode, seven named flags, a reserved bit and the response code, and four section counts, which dig prints as its header and flags lines. After reading, you can decode a header from its hexadecimal bytes, say what each flag, opcode and status tells a diagnosis, recognize a truncated answer and test the TCP retry it needs, and explain why the ID and the source port must be unpredictable.
- [The Ethernet frame, field by field: preamble to FCS, the 802.1Q tag, and the sizes that matter](https://ronutz.com/en/learn/the-ethernet-frame-field-by-field.md): Every Ethernet frame is the same short sequence of fields: a preamble to wake the receiver, two addresses, one field that is either a length or a type, the payload, and a checksum. What each field holds, why the minimum is 64 octets and the maximum 1518, where the 802.1Q tag goes and what it carries, and why jumbo frames are not in the standard.
- [The hardware hacker's bench: Bus Pirate, JTAG, UART and ChipWhisperer](https://ronutz.com/en/learn/the-hardware-hackers-bench-bus-pirate-jtag-uart-and-chipwhisperer.md): Every circuit board is built with doors for its makers: a serial console that prints the boot log, a Joint Test Action Group (JTAG) port defined by IEEE 1149.1 for testing and debugging, Arm's two-wire Serial Wire Debug, and the SPI and I2C buses where firmware and secrets are stored. This part explains what each interface is for and how it works, the tools that speak to them (the Bus Pirate, the JTAGulator, Saleae and sigrok logic analysers, Great Scott Gadgets' GreatFET, the Tigard, the Shikra and NewAE's ChipWhisperer), what power analysis and fault injection are, and how manufacturers lock the doors. After reading, you can read a UART settings line and a debug-header pin-out, decode a JTAG IDCODE down to the manufacturer, explain side-channel and glitch attacks in principle, retell four documented cases from their sources, and say which controls (readout protection, debug lockout, secure boot, tamper response) a product-security team should test.
- [What Is an OUI, and How MAC Addresses Are Assigned](https://ronutz.com/en/learn/what-is-an-oui.md): How a MAC address is structured, what the OUI (the manufacturer prefix) is and who hands it out, the difference between universally and locally administered addresses, and why a randomized Wi-Fi MAC has no vendor at all.
