La cabecera del datagrama IPv4 |  | UPV

La cabecera del datagrama IPv4 | | UPV

Overview of the IP Version 4 Datagram Header

Introduction to IP Datagram Header

  • The objective is to explain the significance of each field in an IPv4 datagram header.

Structure of the Datagram Header

  • The IPv4 header consists of a total of 32 bits, divided into five mandatory fields (20 bytes) and an optional part that can extend up to 40 bytes.

Key Fields in the Header

Version and Length Fields

  • The version field is 4 bits long, indicating the IP version being used (IPv4). The length field specifies the header length in 32-bit words, allowing for a maximum length of fifteen words (60 bytes).

Service Field

  • This field indicates the quality of service required for transmission, consisting of eight bits: three for priority (values from 0 to 7) and five for specific service requirements. A value of zero indicates normal priority while seven indicates maximum priority.

Total Length Field

  • A 16-bit field that includes both the header and data lengths, with a maximum size limit set at 65,535 bytes.

Time to Live (TTL)

  • TTL initializes at a set value upon sending; it decrements as it passes through routers or if delayed due to congestion. When TTL reaches zero, the datagram is discarded by routers.

Protocol and Checksum Fields

  • The protocol field specifies which protocol is encapsulated within the IP datagram. The checksum verifies errors only in the header; it must be recalculated at each hop as TTL decreases.

Addressing Fields

  • Contains both source and destination addresses, each being 32 bits long as per IPv4 standards.

Options Field

  • This optional field can store various options such as recording all nodes traversed by the datagram; its maximum size is limited to 40 bytes allowing for tracking up to ten nodes.

Fragmentation Fields

Identifier and Offset

  • The identifier helps track fragmented packets by assigning them a sequence number; offset indicates data position relative to original datagram structure measured in units of eight bytes.

Flags

  • Two out of three flags are utilized: one indicates whether fragmentation is allowed (F bit), while another signals if it's the last fragment (MF bit). If F is set to one, fragmentation isn't permitted during transit; MF remains zero on final fragments only.

Understanding Datagram Fragmentation

Example of Datagram Fragmentation

  • A practical example illustrates a datagram arriving at a router with a total length of 1420 bytes, consisting of a 20-byte header and 1400 bytes of data. The network's maximum PDU size is 620 bytes, necessitating fragmentation.
  • The original datagram must be fragmented into smaller pieces due to the PDU limit. It can be split into two fragments of 600 bytes each and one final fragment of 200 bytes.
  • All three fragments retain the same identifier (327). The "More Fragments" (MF) bit is set to one for the first two fragments and zero for the last, indicating it’s the final piece.

Calculating Offsets for Fragments

  • When receiving fragments, if not all are received within a certain timeframe, any received fragments are discarded, prompting a resend of all datagrams.
  • The total length of the original datagram can only be determined upon receiving the last fragment since they may arrive out of order.
  • For instance, if the first fragment arrives with an offset calculated as 1200 bytes (150 in units of 8), its header indicates a total length that helps reconstruct the original datagram's data size.
Video description

Título: La cabecera del datagrama IPv4 Descripción: Con este objeto, se explica al alumno el significado de cada uno de los campos que componen la cabecera de un datagrama IPv4. Boronat Segui, F. (2011). La cabecera del datagrama IPv4. http://hdl.handle.net/10251/13076 Descripción automática: En este video se explica la estructura de la cabecera del datagrama IP versión 4, detallando cada campo que compone la misma. La cabecera consta de 20 bytes obligatorios, repartidos en cinco partes de 32 bits, y una sección opcional que puede extender la cabecera hasta 40 bytes adicionales. Se comienza con el campo de versión de 4 bits que indica que se trata de la versión 4 de IP. Le sigue un campo de 4 bits para la longitud de la cabecera. Luego está el campo de servicio, que utiliza 8 bits para definir la calidad de servicio y prioridades del datagrama. El campo de longitud total, de 16 bits, indica la longitud completa del datagrama, incluyendo la cabecera. Posteriormente, se describe el campo de tiempo de vida (TTL), que disminuye a medida que el datagrama pasa por enrutadores, y el campo de protocolo, que especifica qué protocolo está por encima del nivel IP. El campo de comprobación de errores (checksum) sólo verifica la cabecera y, al igual que el TTL, debe ser recalculado en cada transito por un nodo. Se explican las direcciones de origen y destino de 32 bits cada una, y el campo de opciones, que entre otras cosas, permite registrar las direcciones IP por las que ha transitado el datagrama. Finalmente, se abordan los campos de segmentación y reensamblado, como el campo de identificador, que contiene un número de secuencia para identificar los fragmentos de un datagrama durante su reensamblado, y los campos de offset y flags, que indican la posición de cada segmento y si el datagrama puede ser fragmentado en ruta. El video concluye mostrando cómo los campos mencionados interactúan durante la fragmentación y la reconstrucción de los datagramas originales. Autor/a: Boronat Segui Fernando + Universitat Politècnica de València UPV: https://www.upv.es + Más vídeos en: https://www.youtube.com/valenciaupv + Accede a nuestros MOOC: https://upvx.es #Ip #Cabecera #Datagrama #INGENIERIA TELEMATICA