Requirements for Internet Hosts -- Communication Layers (rfc1122)

本文档概述了互联网主机通信层的要求,包括网关不应保存连接状态信息,所有用于端到端流量控制和可靠性的状态信息应在主机的传输层或应用程序中实现。强调了地址解析协议(ARP)的重要性,如ARP缓存验证和防止ARP泛洪的机制。此外,详细介绍了互联网层协议的功能,如IP层的选择下一跳网关、重组IP数据报、实现故意分片以及错误和诊断功能。还讨论了多宿主主机的问题,源路由选项以及特定IP选项的处理。

摘要生成于 C知道 ,由 DeepSeek-R1 满血版支持, 前往体验 >

The current Internet architecture is based on a set of assumptions about the communication system. The assumptions most relevant to hosts are as follows:
  1. The Internet is a network of networks.
  2. Gateways don’t keep connection state information.
    All state information required for end-to-end flow control and reliability is implemented in the hosts, in the transport layer or in application programs.
  3. Routing complexity should be in the gateways.
  4. The System must tolerate wide network variation.
LINK LAYER

Address Resolution Protocol -- ARP

ARP Cache Validation

An implementation of the ARP MUST provide a mechanism to flush out-of-date cache entries.A mechanism to prevent ARP flooding (repeatedly sending an ARP Request for the same IP address, at a high rate) MUST be included.

Four mechanisms have been used to flush out-of-date cache entries.

  1. Timeout -- Periodically time out cache entries, even if they are in use. Note that this timeout should be restarted when the cache entry is "refreshed". it SHOULD be possible to configure the timeout value
  2. Unicast Poll -- Actively poll the remote host by periodically sending a point-to-point ARP Request to it, and delete the entry if no ARP Reply is received from N successive polls. Again, the timeout should be on the order of a minute, and typically N is 2.
  3. Link-Layer Advice -- If the link-layer driver detects a delivery problem, flush the corresponding ARP cache entry.
  4. Higher-layer Advice -- Provide a call from the Internet layer to the link layer to indicate a delivery problem. The effect of this call would be to invalidate the corresponding cache entry. 
ARP Packet Queue

The link layer SHOULD save (rather than discard) at least one (the latest) packet of each set of packets destined to the same unresolved IP address, and transmit the saved packet when the address has been resolved.

Failure to follow this recommendation causes the first packet of every exchange to be lost. Although higherlayer protocols can generally cope with packet loss by retransmission, packet loss does impact performance. For example, loss of a TCP open request causes the initial round-trip time estimate to be inflated.

LINK/INTERNET LAYER INTERFACE

The packet receive interface between the IP layer and the link layer MUST include a flag to indicate whether the incoming packet was addressed to a link-layer broadcast address.

The packet send interface between the IP and link layers MUST include the 5-bit TOS field.

The link layer MUST NOT report a Destination Unreachable error to IP solely because there is no ARP cache entry for a destination.

INTERNET LAYER PROTOCOLS

The host IP layer has two basic functions:

  1. choose the "next hop" gateway or host for outgoing IP datagrams and
  2. reassemble incoming IP datagrams. The IP layer may also
  3. implement intentional fragmentation of outgoing datagrams. Finally, the IP layer must
  4. provide diagnostic and error functionality.

For incoming datagrams, the IP layer:

  1. verifies that the datagram is correctly formatted;
  2. verifies that it is destined to the local host;
  3. processes options;
  4. reassembles the datagram if necessary; and
  5. passes the encapsulated message to the appropriate transport-layer protocol module.

For outgoing datagrams, the IP layer:

  1. sets any fields not set by the transport layer;
  2. selects the correct first hop on the connected network (a process called "routing");
  3. fragments the datagram if necessary and if intentional fragmentation is implemented; and
  4. passes the packet(s) to the appropriate link-layer driver.

A host is said to be multihomed if it has multiple IP addresses. There are two distinct problem areas in multihoming:

  1. Local multihoming -- the host itself is multihomed; or
  2. Remote multihoming -- the local host needs to communicate with a remote multihomed host.

Any host that forwards datagrams generated by another host is acting as a gateway. 

PROTOCOL WALK-THROUGH

  1. Version Number
    A datagram whose version number is not 4 MUST be silently discarded.
  2. Checksum
    A host MUST verify the IP header checksum on every received datagram and silently discard every datagram that has a bad checksum.
  3. Addressing:
    There are now five classes of IP addresses: Class A through Class E. Class D addresses are used for IP multicasting, while Class E addresses are reserved for experimental use.
    A multicast (Class D) address is a 28-bit logical address that stands for a group of hosts, and may be either permanent or transient. Permanent multicast addresses are allocated by the Internet Assigned Number Authority, while transient addresses may be allocated dynamically to transient groups. Group membership is determined dynamically using IGMP
    We now summarize the important special cases for Class A, B, and C IP addresses, using the following notation for an IP address:
    { <Network-number>, <Host-number> }
    or
    { <Network-number>, <Subnet-number>, <Host-number> }
    and the notation "-1" for a field that contains all 1 bits
    1. { 0, 0 }
      This host on this network. MUST NOT be sent, except as a source address as part of an initialization procedure by which the host learns its own IP address.
    2. { 0, <Host-number> }
      Specified host on this network. It MUST NOT be sent, except as a source address as part of an initialization procedure by which the host learns its full IP address.
    3.  { -1, -1 }
      Limited broadcast. It MUST NOT be used as a source address.
      A datagram with this destination address will be received by every host on the connected physical network but will not be forwarded outside that network.
    4. { <Network-number>, -1 }
      Directed broadcast to the specified network. It MUST NOT be used as a source address.
    5. { <Network-number>, <Subnet-number>, -1 }
      Directed broadcast to the specified subnet. It MUST NOT be used as a source address.
    6. { <Network-number>, -1, -1 }
      Directed broadcast to all subnets of the specified subnetted network. It MUST NOT be used as a source address.
    7. { 127, <any> }
      Internal host loopback address. Addresses of this form MUST NOT appear outside a host.

The <Network-number> is administratively assigned so that its value will be unique in the entire world.

When a host sends any datagram, the IP source address MUST be one of its own IP addresses (but not a broadcast or multicast address).

A host MUST silently discard an incoming datagram that is not destined for the host. An incoming datagram is destined for the host if the datagram’s destination address field is:

  1. (one of) the host’s IP address(es); or
  2. an IP broadcast address valid for the connected network; or
  3. the address for a multicast group of which the host is a member on the incoming physical interface.
Time-to-Live

A host MUST NOT send a datagram with a Time-to-Live (TTL) value of zero. A host MUST NOT discard a datagram just because it was received with TTL less than 2.

The IP layer MUST provide a means for the transport layer to set the TTL field of every datagram that is sent. When a fixed TTL value is used, it MUST be configurable.

Options:

All IP options (except NOP or END-OF-LIST) received in datagrams MUST be passed to the transport layer (or to ICMP processing when the datagram is an ICMP message). The IP and transport layer MUST each interpret those IP options that they understand and silently ignore the others.

Here are the requirements for specific IP options:

  1. Security Option
    Some environments require the Security option in every datagram;( RFC-791and RFC-1038 )
  2. Stream Identifier Option
    This option is obsolete; it SHOULD NOT be sent, and it MUST be silently ignored if received.
  3. Source Route Options
    A host MUST support originating a source route and MUST be able to act as the final destination of a source route.
    If host receives a datagram containing a completed source route (i.e., the pointer points beyond the last field), the datagram has reached its final destination; the option as received (the recorded route) MUST be passed up to the transport layer (or to ICMP message processing). This recorded route will be reversed and used to form a return source route for reply datagrams. When a return source route is built, it MUST be correctly formed even if the recorded route included the source host.
    An IP header containing more than one Source Route option MUST NOT be sent; the effect on routing of multiple Source Route options is implementationspecific.
    If a source-routed datagram is fragmented, each fragment will contain a copy of the source route. Since the processing of IP options (including a source route) must precede reassembly, the original datagram will not be reassembled until the final destination is reached.
    Suppose a source routed datagram is to be routed from host S to host D via gateways G1, G2, ... Gn. There was an ambiguity in the specification over whether the source route option in a datagram sent out by S should be (A) or (B):
    (A): {>>G2, G3, ... Gn, D} <--- CORRECT
    (B): {S, >>G2, G3, ... Gn, D} <---- WRONG
    (where >> represents the pointer).
    If (A) is sent, the datagram received at D will contain the option: {G1, G2, ... Gn >>}, with S and D as the IP source and destination addresses.
    If (B) were sent, the datagram received at D would again contain S and D as the same IP source and destination addresses, but the option would be: {S, G1, ...Gn >>};  i.e., the originating host would be the first hop in the route.
  4. Record Route Option
    OPTIONAL
  5. Timestamp Option
    OPTIONAL. If it is implemented, the following rul
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值