𝖂𝖎ƙ𝖎𝖊

Protocolo de Internet

O IP acrónimo do inglês para Internet Protocol (Ou Protocolo da Internet) é um protocolo usado pela fonte e host de destino para comunicação de dados através de troca de pacotes dentro da rede.

Os dados numa rede IP são enviados em blocos referidos como pacotes ou datagramas (os termos são basicamente sinónimos no IP). Em particular, no IP nenhuma definição é necessária antes do host tentar enviar pacotes para um host com o qual não comunicou previamente.

O IP oferece um serviço de datagrramas não fiável (também camado de melhor esforço); ou seja, o pacote vem quase sem garantias. O pacote pode chegar danificado, desordenado (comparado com outros pacotes enviados entre os mesmos hosts), também podem chegar duplicados, ou perdidos por inteiro. Se a aplicação precisa de fiabilidade, esta é adicionada na camada de transporte.

Os routers, são usados para reencaminhar datagramas IP através das redes interconectadas na segunda camada. A falta de qualquer garantia de entrega significa que o desenho da troca de pacotes é feita de forma mais simplificadamente. (note que se a rede cai, reordena ou de outra forma danifica um grande número de pacotes, a performance observada pelo utilizador será pobre, logo a maioria dos elementos de rede tentam arduamente não fazer este tipo de coisas - melhor esforço. Contudo, um erro ocasional não irá produzir nenhum efeito que se note.)

O IP é o elemento comum encontrado na internet pública dos dias de hoje. É descrita no RFC 791 da IETF, que foi pela primeira vez publicada em Setembro de 1981. Este documento descreve o protocolo da camada de rede mais popular e actualmente em uso. Esta versão do protocolo é designada de versão 4, ou IPv4. O IPv6 tem enderelamento de origem e destino de 128 bits, oferecendo mais endereçamentos que os 32 bits do IPv4.

IPv4 header format

+ 0 - 3 4 - 7 8 - 15 16 - 18 19 - 31
0 Version Header length Type of Service
(agora DiffServ e ECN)
Total Length
32 Identification Flags Fragment Offset
64 Time to Live Protocol Header Checksum
96 Source Address
128 Destination Address
160 Options
192  
Dados
 

O primeiro campo do header (ou cabeçalho) de um datagrama IPv4 é o campo de version (ou versão) de 4 bits.

O segundo campo, de 4 bits, é o IHL (acrónimo para Internet Header Length, ou seja, Comprimento do Cabeçalho da Internet) com o número de words de 32 bits no cabeçalho IPv4. Como o cabeçalho IPv4 pode conter um número variável de opções, este campo essencialmente especifica o offset para a porção de dados de um datagrama IPv4. Um cabeçalho mínimo tem 20 bytes de comprimento, logo o valor mínimo em decima no campo IHL seria 5.


In RFC 791, the following 8 bits were allocated to a Type of Service (ToS) field - now DiffServ and ECN. The original intention was for a sending host to specify a preference for how the datagram would be handled as it made its way through an internetwork. For instance, one host could set its IPv4 datagrams' ToS field value to prefer low delay, while another might prefer high reliability. In practice, the ToS field has not been widely implemented. However, a great deal of experimental, research and deployment work has focused on how to make use of these eight bits. These bits have been redefined and most recently through DiffServ working group in the IETF and the Explicit Congestion Notification codepoints (see RFC 3168).

The next 16-bit IPv4 field defines the entire datagram size, including header and data, in 8-bit bytes. The minimum-length datagram is 20 bytes and the maximum is 65535. The maximum size datagram which any host is required to be able to handle is 576 bytes, but most modern hosts handle much larger packets. Sometimes subnetworks impose further restrictions on the size, in which case datagrams must be fragmented. Fragmentation is handled in either the host or packet switch in IPv4, and in the host only in IPv6.

The next 16-bit field is an identification field. This field is primarily used for uniquely identifying fragments of an original IP datagram. Some experimental work has suggested using the ID field for other purposes, such as for adding packet tracing information to datagrams in order to help trace back datagrams with spoofed source addresses.

A 3-bit field follows and is used to control or identify fragments.

The fragment offset field is 13-bits long, and allows a receiver determine the place of a particular fragment in the original IP datagram.

An 8-bit time to live (TTL) field helps prevent datagrams from persisting (e.g. going in circles) on an internetwork. Historically the TTL field limited a datagram's lifetime in seconds, but has come to be a hop count field. Each packet switch (or router) that a datagram crosses decrements the TTL field by one. When the TTL field hits zero, the packet is no longer forwarded by a packet switch and is discarded.

An 8-bit Protocol field follows. This field defines the next protocol used in the data portion of the IP datagram. The Internet Assigned Numbers Authority maintains a list of Protocol numbers. Common protocols and their decimal values include ICMP (1), TCP (6) and UDP (17).

The following field is a 16-bit checksum field for the IPv4 datagram header. Some values in a IPv4 datagram header may change at each packet switch hop, so the checksum must be adjusted on its way through an internetwork.

The checksum is followed by a 32-bit source address and 32-bit destination address respectively. (Note: IPv6 source and destination addresses are 128 bits each.)

Additional header fields (called options) may follow the destination address field, but these are not often used. Option fields may be followed by a pad field which ensures that the user data are aligned on a 32-bit word boundary. (In IPv6, options move out of the standard header and are specified by a Next Protocol field, similar in function to IPv4's Protocol field.)

IPv4 addressing and routing

Perhaps the most complex aspects of IP are addressing and routing. Addressing refers to how end hosts are assigned IP addresses and how subnetworks of IP host addresses are divided and grouped together. IP routing is performed by all hosts, but most famously by internetwork routers, which typically use either interior gateway protocols (IGPs) or external gateway protocols (EGPs) to help make IP datagram forwarding decisions across IP connected networks.

See also: Internet protocol suite, Classes of IP addresses, IANA, List of well-known ports (computing)

Leitura posterior

bg:Internet Protocol da:Internetprotokol de:Internet Protocol es:Protocolo IP en:Internet Protocol fr:Protocole Internet hu:IP szám ja:Internet Protocol ko:IP nl:Internet Protocol pl:IP zh-cn:互联网协议

talvez você goste