Advertisement
RoniElBombardero

The Internet Protocol [IP]

Jan 11th, 2013
79
0
Never
Not a member of Pastebin yet? Sign Up, it unlocks many cool features!
text 95.49 KB | None | 0 0
  1.  
  2.  
  3. RFC: 791
  4.  
  5.  
  6.  
  7.  
  8.  
  9.  
  10.  
  11. INTERNET PROTOCOL
  12.  
  13.  
  14. DARPA INTERNET PROGRAM
  15.  
  16. PROTOCOL SPECIFICATION
  17.  
  18.  
  19.  
  20. September 1981
  21.  
  22.  
  23.  
  24.  
  25.  
  26.  
  27.  
  28.  
  29.  
  30.  
  31.  
  32.  
  33.  
  34. prepared for
  35.  
  36. Defense Advanced Research Projects Agency
  37. Information Processing Techniques Office
  38. 1400 Wilson Boulevard
  39. Arlington, Virginia 22209
  40.  
  41.  
  42.  
  43.  
  44.  
  45.  
  46.  
  47. by
  48.  
  49. Information Sciences Institute
  50. University of Southern California
  51. 4676 Admiralty Way
  52. Marina del Rey, California 90291
  53.  
  54. September 1981
  55. Internet Protocol
  56.  
  57.  
  58.  
  59. TABLE OF CONTENTS
  60.  
  61. PREFACE ........................................................ iii
  62.  
  63. 1. INTRODUCTION ..................................................... 1
  64.  
  65. 1.1 Motivation .................................................... 1
  66. 1.2 Scope ......................................................... 1
  67. 1.3 Interfaces .................................................... 1
  68. 1.4 Operation ..................................................... 2
  69.  
  70. 2. OVERVIEW ......................................................... 5
  71.  
  72. 2.1 Relation to Other Protocols ................................... 9
  73. 2.2 Model of Operation ............................................ 5
  74. 2.3 Function Description .......................................... 7
  75. 2.4 Gateways ...................................................... 9
  76.  
  77. 3. SPECIFICATION ................................................... 11
  78.  
  79. 3.1 Internet Header Format ....................................... 11
  80. 3.2 Discussion ................................................... 23
  81. 3.3 Interfaces ................................................... 31
  82.  
  83. APPENDIX A: Examples & Scenarios ................................... 34
  84. APPENDIX B: Data Transmission Order ................................ 39
  85.  
  86. GLOSSARY ............................................................ 41
  87.  
  88. REFERENCES .......................................................... 45
  89.  
  90.  
  91.  
  92.  
  93.  
  94.  
  95.  
  96.  
  97.  
  98.  
  99.  
  100.  
  101.  
  102.  
  103.  
  104.  
  105.  
  106.  
  107.  
  108.  
  109.  
  110. [Page i]
  111.  
  112. September 1981
  113. Internet Protocol
  114.  
  115.  
  116.  
  117.  
  118.  
  119.  
  120.  
  121.  
  122.  
  123.  
  124.  
  125.  
  126.  
  127.  
  128.  
  129.  
  130.  
  131.  
  132.  
  133.  
  134.  
  135.  
  136.  
  137.  
  138.  
  139.  
  140.  
  141.  
  142.  
  143.  
  144.  
  145.  
  146.  
  147.  
  148.  
  149.  
  150.  
  151.  
  152.  
  153.  
  154.  
  155.  
  156.  
  157.  
  158.  
  159.  
  160.  
  161.  
  162.  
  163.  
  164.  
  165.  
  166.  
  167.  
  168. [Page ii]
  169.  
  170. September 1981
  171. Internet Protocol
  172.  
  173.  
  174.  
  175. PREFACE
  176.  
  177.  
  178.  
  179. This document specifies the DoD Standard Internet Protocol. This
  180. document is based on six earlier editions of the ARPA Internet Protocol
  181. Specification, and the present text draws heavily from them. There have
  182. been many contributors to this work both in terms of concepts and in
  183. terms of text. This edition revises aspects of addressing, error
  184. handling, option codes, and the security, precedence, compartments, and
  185. handling restriction features of the internet protocol.
  186.  
  187. Jon Postel
  188.  
  189. Editor
  190.  
  191.  
  192.  
  193.  
  194.  
  195.  
  196.  
  197.  
  198.  
  199.  
  200.  
  201.  
  202.  
  203.  
  204.  
  205.  
  206.  
  207.  
  208.  
  209.  
  210.  
  211.  
  212.  
  213.  
  214.  
  215.  
  216.  
  217.  
  218.  
  219.  
  220.  
  221.  
  222.  
  223.  
  224.  
  225.  
  226. [Page iii]
  227.  
  228. September 1981
  229.  
  230.  
  231. RFC: 791
  232. Replaces: RFC 760
  233. IENs 128, 123, 111,
  234. 80, 54, 44, 41, 28, 26
  235.  
  236. INTERNET PROTOCOL
  237.  
  238. DARPA INTERNET PROGRAM
  239. PROTOCOL SPECIFICATION
  240.  
  241.  
  242.  
  243. 1. INTRODUCTION
  244.  
  245. 1.1. Motivation
  246.  
  247. The Internet Protocol is designed for use in interconnected systems of
  248. packet-switched computer communication networks. Such a system has
  249. been called a "catenet" [1]. The internet protocol provides for
  250. transmitting blocks of data called datagrams from sources to
  251. destinations, where sources and destinations are hosts identified by
  252. fixed length addresses. The internet protocol also provides for
  253. fragmentation and reassembly of long datagrams, if necessary, for
  254. transmission through "small packet" networks.
  255.  
  256. 1.2. Scope
  257.  
  258. The internet protocol is specifically limited in scope to provide the
  259. functions necessary to deliver a package of bits (an internet
  260. datagram) from a source to a destination over an interconnected system
  261. of networks. There are no mechanisms to augment end-to-end data
  262. reliability, flow control, sequencing, or other services commonly
  263. found in host-to-host protocols. The internet protocol can capitalize
  264. on the services of its supporting networks to provide various types
  265. and qualities of service.
  266.  
  267. 1.3. Interfaces
  268.  
  269. This protocol is called on by host-to-host protocols in an internet
  270. environment. This protocol calls on local network protocols to carry
  271. the internet datagram to the next gateway or destination host.
  272.  
  273. For example, a TCP module would call on the internet module to take a
  274. TCP segment (including the TCP header and user data) as the data
  275. portion of an internet datagram. The TCP module would provide the
  276. addresses and other parameters in the internet header to the internet
  277. module as arguments of the call. The internet module would then
  278. create an internet datagram and call on the local network interface to
  279. transmit the internet datagram.
  280.  
  281. In the ARPANET case, for example, the internet module would call on a
  282.  
  283.  
  284. [Page 1]
  285.  
  286. September 1981
  287. Internet Protocol
  288. Introduction
  289.  
  290.  
  291.  
  292. local net module which would add the 1822 leader [2] to the internet
  293. datagram creating an ARPANET message to transmit to the IMP. The
  294. ARPANET address would be derived from the internet address by the
  295. local network interface and would be the address of some host in the
  296. ARPANET, that host might be a gateway to other networks.
  297.  
  298. 1.4. Operation
  299.  
  300. The internet protocol implements two basic functions: addressing and
  301. fragmentation.
  302.  
  303. The internet modules use the addresses carried in the internet header
  304. to transmit internet datagrams toward their destinations. The
  305. selection of a path for transmission is called routing.
  306.  
  307. The internet modules use fields in the internet header to fragment and
  308. reassemble internet datagrams when necessary for transmission through
  309. "small packet" networks.
  310.  
  311. The model of operation is that an internet module resides in each host
  312. engaged in internet communication and in each gateway that
  313. interconnects networks. These modules share common rules for
  314. interpreting address fields and for fragmenting and assembling
  315. internet datagrams. In addition, these modules (especially in
  316. gateways) have procedures for making routing decisions and other
  317. functions.
  318.  
  319. The internet protocol treats each internet datagram as an independent
  320. entity unrelated to any other internet datagram. There are no
  321. connections or logical circuits (virtual or otherwise).
  322.  
  323. The internet protocol uses four key mechanisms in providing its
  324. service: Type of Service, Time to Live, Options, and Header Checksum.
  325.  
  326. The Type of Service is used to indicate the quality of the service
  327. desired. The type of service is an abstract or generalized set of
  328. parameters which characterize the service choices provided in the
  329. networks that make up the internet. This type of service indication
  330. is to be used by gateways to select the actual transmission parameters
  331. for a particular network, the network to be used for the next hop, or
  332. the next gateway when routing an internet datagram.
  333.  
  334. The Time to Live is an indication of an upper bound on the lifetime of
  335. an internet datagram. It is set by the sender of the datagram and
  336. reduced at the points along the route where it is processed. If the
  337. time to live reaches zero before the internet datagram reaches its
  338. destination, the internet datagram is destroyed. The time to live can
  339. be thought of as a self destruct time limit.
  340.  
  341.  
  342. [Page 2]
  343.  
  344. September 1981
  345. Internet Protocol
  346. Introduction
  347.  
  348.  
  349.  
  350. The Options provide for control functions needed or useful in some
  351. situations but unnecessary for the most common communications. The
  352. options include provisions for timestamps, security, and special
  353. routing.
  354.  
  355. The Header Checksum provides a verification that the information used
  356. in processing internet datagram has been transmitted correctly. The
  357. data may contain errors. If the header checksum fails, the internet
  358. datagram is discarded at once by the entity which detects the error.
  359.  
  360. The internet protocol does not provide a reliable communication
  361. facility. There are no acknowledgments either end-to-end or
  362. hop-by-hop. There is no error control for data, only a header
  363. checksum. There are no retransmissions. There is no flow control.
  364.  
  365. Errors detected may be reported via the Internet Control Message
  366. Protocol (ICMP) [3] which is implemented in the internet protocol
  367. module.
  368.  
  369.  
  370.  
  371.  
  372.  
  373.  
  374.  
  375.  
  376.  
  377.  
  378.  
  379.  
  380.  
  381.  
  382.  
  383.  
  384.  
  385.  
  386.  
  387.  
  388.  
  389.  
  390.  
  391.  
  392.  
  393.  
  394.  
  395.  
  396.  
  397.  
  398.  
  399.  
  400. [Page 3]
  401.  
  402. September 1981
  403. Internet Protocol
  404.  
  405.  
  406.  
  407.  
  408.  
  409.  
  410.  
  411.  
  412.  
  413.  
  414.  
  415.  
  416.  
  417.  
  418.  
  419.  
  420.  
  421.  
  422.  
  423.  
  424.  
  425.  
  426.  
  427.  
  428.  
  429.  
  430.  
  431.  
  432.  
  433.  
  434.  
  435.  
  436.  
  437.  
  438.  
  439.  
  440.  
  441.  
  442.  
  443.  
  444.  
  445.  
  446.  
  447.  
  448.  
  449.  
  450.  
  451.  
  452.  
  453.  
  454.  
  455.  
  456.  
  457.  
  458. [Page 4]
  459.  
  460. September 1981
  461. Internet Protocol
  462.  
  463.  
  464.  
  465. 2. OVERVIEW
  466.  
  467. 2.1. Relation to Other Protocols
  468.  
  469. The following diagram illustrates the place of the internet protocol
  470. in the protocol hierarchy:
  471.  
  472.  
  473. +------+ +-----+ +-----+ +-----+
  474. |Telnet| | FTP | | TFTP| ... | ... |
  475. +------+ +-----+ +-----+ +-----+
  476. | | | |
  477. +-----+ +-----+ +-----+
  478. | TCP | | UDP | ... | ... |
  479. +-----+ +-----+ +-----+
  480. | | |
  481. +--------------------------+----+
  482. | Internet Protocol & ICMP |
  483. +--------------------------+----+
  484. |
  485. +---------------------------+
  486. | Local Network Protocol |
  487. +---------------------------+
  488.  
  489. Protocol Relationships
  490.  
  491. Figure 1.
  492.  
  493. Internet protocol interfaces on one side to the higher level
  494. host-to-host protocols and on the other side to the local network
  495. protocol. In this context a "local network" may be a small network in
  496. a building or a large network such as the ARPANET.
  497.  
  498. 2.2. Model of Operation
  499.  
  500. The model of operation for transmitting a datagram from one
  501. application program to another is illustrated by the following
  502. scenario:
  503.  
  504. We suppose that this transmission will involve one intermediate
  505. gateway.
  506.  
  507. The sending application program prepares its data and calls on its
  508. local internet module to send that data as a datagram and passes the
  509. destination address and other parameters as arguments of the call.
  510.  
  511. The internet module prepares a datagram header and attaches the data
  512. to it. The internet module determines a local network address for
  513. this internet address, in this case it is the address of a gateway.
  514.  
  515.  
  516. [Page 5]
  517.  
  518. September 1981
  519. Internet Protocol
  520. Overview
  521.  
  522.  
  523.  
  524. It sends this datagram and the local network address to the local
  525. network interface.
  526.  
  527. The local network interface creates a local network header, and
  528. attaches the datagram to it, then sends the result via the local
  529. network.
  530.  
  531. The datagram arrives at a gateway host wrapped in the local network
  532. header, the local network interface strips off this header, and
  533. turns the datagram over to the internet module. The internet module
  534. determines from the internet address that the datagram is to be
  535. forwarded to another host in a second network. The internet module
  536. determines a local net address for the destination host. It calls
  537. on the local network interface for that network to send the
  538. datagram.
  539.  
  540. This local network interface creates a local network header and
  541. attaches the datagram sending the result to the destination host.
  542.  
  543. At this destination host the datagram is stripped of the local net
  544. header by the local network interface and handed to the internet
  545. module.
  546.  
  547. The internet module determines that the datagram is for an
  548. application program in this host. It passes the data to the
  549. application program in response to a system call, passing the source
  550. address and other parameters as results of the call.
  551.  
  552.  
  553. Application Application
  554. Program Program
  555. \ /
  556. Internet Module Internet Module Internet Module
  557. \ / \ /
  558. LNI-1 LNI-1 LNI-2 LNI-2
  559. \ / \ /
  560. Local Network 1 Local Network 2
  561.  
  562.  
  563.  
  564. Transmission Path
  565.  
  566. Figure 2
  567.  
  568.  
  569.  
  570.  
  571.  
  572.  
  573.  
  574. [Page 6]
  575.  
  576. September 1981
  577. Internet Protocol
  578. Overview
  579.  
  580.  
  581.  
  582. 2.3. Function Description
  583.  
  584. The function or purpose of Internet Protocol is to move datagrams
  585. through an interconnected set of networks. This is done by passing
  586. the datagrams from one internet module to another until the
  587. destination is reached. The internet modules reside in hosts and
  588. gateways in the internet system. The datagrams are routed from one
  589. internet module to another through individual networks based on the
  590. interpretation of an internet address. Thus, one important mechanism
  591. of the internet protocol is the internet address.
  592.  
  593. In the routing of messages from one internet module to another,
  594. datagrams may need to traverse a network whose maximum packet size is
  595. smaller than the size of the datagram. To overcome this difficulty, a
  596. fragmentation mechanism is provided in the internet protocol.
  597.  
  598. Addressing
  599.  
  600. A distinction is made between names, addresses, and routes [4]. A
  601. name indicates what we seek. An address indicates where it is. A
  602. route indicates how to get there. The internet protocol deals
  603. primarily with addresses. It is the task of higher level (i.e.,
  604. host-to-host or application) protocols to make the mapping from
  605. names to addresses. The internet module maps internet addresses to
  606. local net addresses. It is the task of lower level (i.e., local net
  607. or gateways) procedures to make the mapping from local net addresses
  608. to routes.
  609.  
  610. Addresses are fixed length of four octets (32 bits). An address
  611. begins with a network number, followed by local address (called the
  612. "rest" field). There are three formats or classes of internet
  613. addresses: in class a, the high order bit is zero, the next 7 bits
  614. are the network, and the last 24 bits are the local address; in
  615. class b, the high order two bits are one-zero, the next 14 bits are
  616. the network and the last 16 bits are the local address; in class c,
  617. the high order three bits are one-one-zero, the next 21 bits are the
  618. network and the last 8 bits are the local address.
  619.  
  620. Care must be taken in mapping internet addresses to local net
  621. addresses; a single physical host must be able to act as if it were
  622. several distinct hosts to the extent of using several distinct
  623. internet addresses. Some hosts will also have several physical
  624. interfaces (multi-homing).
  625.  
  626. That is, provision must be made for a host to have several physical
  627. interfaces to the network with each having several logical internet
  628. addresses.
  629.  
  630.  
  631.  
  632. [Page 7]
  633.  
  634. September 1981
  635. Internet Protocol
  636. Overview
  637.  
  638.  
  639.  
  640. Examples of address mappings may be found in "Address Mappings" [5].
  641.  
  642. Fragmentation
  643.  
  644. Fragmentation of an internet datagram is necessary when it
  645. originates in a local net that allows a large packet size and must
  646. traverse a local net that limits packets to a smaller size to reach
  647. its destination.
  648.  
  649. An internet datagram can be marked "don't fragment." Any internet
  650. datagram so marked is not to be internet fragmented under any
  651. circumstances. If internet datagram marked don't fragment cannot be
  652. delivered to its destination without fragmenting it, it is to be
  653. discarded instead.
  654.  
  655. Fragmentation, transmission and reassembly across a local network
  656. which is invisible to the internet protocol module is called
  657. intranet fragmentation and may be used [6].
  658.  
  659. The internet fragmentation and reassembly procedure needs to be able
  660. to break a datagram into an almost arbitrary number of pieces that
  661. can be later reassembled. The receiver of the fragments uses the
  662. identification field to ensure that fragments of different datagrams
  663. are not mixed. The fragment offset field tells the receiver the
  664. position of a fragment in the original datagram. The fragment
  665. offset and length determine the portion of the original datagram
  666. covered by this fragment. The more-fragments flag indicates (by
  667. being reset) the last fragment. These fields provide sufficient
  668. information to reassemble datagrams.
  669.  
  670. The identification field is used to distinguish the fragments of one
  671. datagram from those of another. The originating protocol module of
  672. an internet datagram sets the identification field to a value that
  673. must be unique for that source-destination pair and protocol for the
  674. time the datagram will be active in the internet system. The
  675. originating protocol module of a complete datagram sets the
  676. more-fragments flag to zero and the fragment offset to zero.
  677.  
  678. To fragment a long internet datagram, an internet protocol module
  679. (for example, in a gateway), creates two new internet datagrams and
  680. copies the contents of the internet header fields from the long
  681. datagram into both new internet headers. The data of the long
  682. datagram is divided into two portions on a 8 octet (64 bit) boundary
  683. (the second portion might not be an integral multiple of 8 octets,
  684. but the first must be). Call the number of 8 octet blocks in the
  685. first portion NFB (for Number of Fragment Blocks). The first
  686. portion of the data is placed in the first new internet datagram,
  687. and the total length field is set to the length of the first
  688.  
  689.  
  690. [Page 8]
  691.  
  692. September 1981
  693. Internet Protocol
  694. Overview
  695.  
  696.  
  697.  
  698. datagram. The more-fragments flag is set to one. The second
  699. portion of the data is placed in the second new internet datagram,
  700. and the total length field is set to the length of the second
  701. datagram. The more-fragments flag carries the same value as the
  702. long datagram. The fragment offset field of the second new internet
  703. datagram is set to the value of that field in the long datagram plus
  704. NFB.
  705.  
  706. This procedure can be generalized for an n-way split, rather than
  707. the two-way split described.
  708.  
  709. To assemble the fragments of an internet datagram, an internet
  710. protocol module (for example at a destination host) combines
  711. internet datagrams that all have the same value for the four fields:
  712. identification, source, destination, and protocol. The combination
  713. is done by placing the data portion of each fragment in the relative
  714. position indicated by the fragment offset in that fragment's
  715. internet header. The first fragment will have the fragment offset
  716. zero, and the last fragment will have the more-fragments flag reset
  717. to zero.
  718.  
  719. 2.4. Gateways
  720.  
  721. Gateways implement internet protocol to forward datagrams between
  722. networks. Gateways also implement the Gateway to Gateway Protocol
  723. (GGP) [7] to coordinate routing and other internet control
  724. information.
  725.  
  726. In a gateway the higher level protocols need not be implemented and
  727. the GGP functions are added to the IP module.
  728.  
  729.  
  730. +-------------------------------+
  731. | Internet Protocol & ICMP & GGP|
  732. +-------------------------------+
  733. | |
  734. +---------------+ +---------------+
  735. | Local Net | | Local Net |
  736. +---------------+ +---------------+
  737.  
  738. Gateway Protocols
  739.  
  740. Figure 3.
  741.  
  742.  
  743.  
  744.  
  745.  
  746.  
  747.  
  748. [Page 9]
  749.  
  750. September 1981
  751. Internet Protocol
  752.  
  753.  
  754.  
  755.  
  756.  
  757.  
  758.  
  759.  
  760.  
  761.  
  762.  
  763.  
  764.  
  765.  
  766.  
  767.  
  768.  
  769.  
  770.  
  771.  
  772.  
  773.  
  774.  
  775.  
  776.  
  777.  
  778.  
  779.  
  780.  
  781.  
  782.  
  783.  
  784.  
  785.  
  786.  
  787.  
  788.  
  789.  
  790.  
  791.  
  792.  
  793.  
  794.  
  795.  
  796.  
  797.  
  798.  
  799.  
  800.  
  801.  
  802.  
  803.  
  804.  
  805.  
  806. [Page 10]
  807.  
  808. September 1981
  809. Internet Protocol
  810.  
  811.  
  812.  
  813. 3. SPECIFICATION
  814.  
  815. 3.1. Internet Header Format
  816.  
  817. A summary of the contents of the internet header follows:
  818.  
  819.  
  820. 0 1 2 3
  821. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  822. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  823. |Version| IHL |Type of Service| Total Length |
  824. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  825. | Identification |Flags| Fragment Offset |
  826. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  827. | Time to Live | Protocol | Header Checksum |
  828. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  829. | Source Address |
  830. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  831. | Destination Address |
  832. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  833. | Options | Padding |
  834. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  835.  
  836. Example Internet Datagram Header
  837.  
  838. Figure 4.
  839.  
  840. Note that each tick mark represents one bit position.
  841.  
  842. Version: 4 bits
  843.  
  844. The Version field indicates the format of the internet header. This
  845. document describes version 4.
  846.  
  847. IHL: 4 bits
  848.  
  849. Internet Header Length is the length of the internet header in 32
  850. bit words, and thus points to the beginning of the data. Note that
  851. the minimum value for a correct header is 5.
  852.  
  853.  
  854.  
  855.  
  856.  
  857.  
  858.  
  859.  
  860.  
  861.  
  862.  
  863.  
  864. [Page 11]
  865.  
  866. September 1981
  867. Internet Protocol
  868. Specification
  869.  
  870.  
  871.  
  872. Type of Service: 8 bits
  873.  
  874. The Type of Service provides an indication of the abstract
  875. parameters of the quality of service desired. These parameters are
  876. to be used to guide the selection of the actual service parameters
  877. when transmitting a datagram through a particular network. Several
  878. networks offer service precedence, which somehow treats high
  879. precedence traffic as more important than other traffic (generally
  880. by accepting only traffic above a certain precedence at time of high
  881. load). The major choice is a three way tradeoff between low-delay,
  882. high-reliability, and high-throughput.
  883.  
  884. Bits 0-2: Precedence.
  885. Bit 3: 0 = Normal Delay, 1 = Low Delay.
  886. Bits 4: 0 = Normal Throughput, 1 = High Throughput.
  887. Bits 5: 0 = Normal Relibility, 1 = High Relibility.
  888. Bit 6-7: Reserved for Future Use.
  889.  
  890. 0 1 2 3 4 5 6 7
  891. +-----+-----+-----+-----+-----+-----+-----+-----+
  892. | | | | | | |
  893. | PRECEDENCE | D | T | R | 0 | 0 |
  894. | | | | | | |
  895. +-----+-----+-----+-----+-----+-----+-----+-----+
  896.  
  897. Precedence
  898.  
  899. 111 - Network Control
  900. 110 - Internetwork Control
  901. 101 - CRITIC/ECP
  902. 100 - Flash Override
  903. 011 - Flash
  904. 010 - Immediate
  905. 001 - Priority
  906. 000 - Routine
  907.  
  908. The use of the Delay, Throughput, and Reliability indications may
  909. increase the cost (in some sense) of the service. In many networks
  910. better performance for one of these parameters is coupled with worse
  911. performance on another. Except for very unusual cases at most two
  912. of these three indications should be set.
  913.  
  914. The type of service is used to specify the treatment of the datagram
  915. during its transmission through the internet system. Example
  916. mappings of the internet type of service to the actual service
  917. provided on networks such as AUTODIN II, ARPANET, SATNET, and PRNET
  918. is given in "Service Mappings" [8].
  919.  
  920.  
  921.  
  922. [Page 12]
  923.  
  924. September 1981
  925. Internet Protocol
  926. Specification
  927.  
  928.  
  929.  
  930. The Network Control precedence designation is intended to be used
  931. within a network only. The actual use and control of that
  932. designation is up to each network. The Internetwork Control
  933. designation is intended for use by gateway control originators only.
  934. If the actual use of these precedence designations is of concern to
  935. a particular network, it is the responsibility of that network to
  936. control the access to, and use of, those precedence designations.
  937.  
  938. Total Length: 16 bits
  939.  
  940. Total Length is the length of the datagram, measured in octets,
  941. including internet header and data. This field allows the length of
  942. a datagram to be up to 65,535 octets. Such long datagrams are
  943. impractical for most hosts and networks. All hosts must be prepared
  944. to accept datagrams of up to 576 octets (whether they arrive whole
  945. or in fragments). It is recommended that hosts only send datagrams
  946. larger than 576 octets if they have assurance that the destination
  947. is prepared to accept the larger datagrams.
  948.  
  949. The number 576 is selected to allow a reasonable sized data block to
  950. be transmitted in addition to the required header information. For
  951. example, this size allows a data block of 512 octets plus 64 header
  952. octets to fit in a datagram. The maximal internet header is 60
  953. octets, and a typical internet header is 20 octets, allowing a
  954. margin for headers of higher level protocols.
  955.  
  956. Identification: 16 bits
  957.  
  958. An identifying value assigned by the sender to aid in assembling the
  959. fragments of a datagram.
  960.  
  961. Flags: 3 bits
  962.  
  963. Various Control Flags.
  964.  
  965. Bit 0: reserved, must be zero
  966. Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment.
  967. Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.
  968.  
  969. 0 1 2
  970. +---+---+---+
  971. | | D | M |
  972. | 0 | F | F |
  973. +---+---+---+
  974.  
  975. Fragment Offset: 13 bits
  976.  
  977. This field indicates where in the datagram this fragment belongs.
  978.  
  979.  
  980. [Page 13]
  981.  
  982. September 1981
  983. Internet Protocol
  984. Specification
  985.  
  986.  
  987.  
  988. The fragment offset is measured in units of 8 octets (64 bits). The
  989. first fragment has offset zero.
  990.  
  991. Time to Live: 8 bits
  992.  
  993. This field indicates the maximum time the datagram is allowed to
  994. remain in the internet system. If this field contains the value
  995. zero, then the datagram must be destroyed. This field is modified
  996. in internet header processing. The time is measured in units of
  997. seconds, but since every module that processes a datagram must
  998. decrease the TTL by at least one even if it process the datagram in
  999. less than a second, the TTL must be thought of only as an upper
  1000. bound on the time a datagram may exist. The intention is to cause
  1001. undeliverable datagrams to be discarded, and to bound the maximum
  1002. datagram lifetime.
  1003.  
  1004. Protocol: 8 bits
  1005.  
  1006. This field indicates the next level protocol used in the data
  1007. portion of the internet datagram. The values for various protocols
  1008. are specified in "Assigned Numbers" [9].
  1009.  
  1010. Header Checksum: 16 bits
  1011.  
  1012. A checksum on the header only. Since some header fields change
  1013. (e.g., time to live), this is recomputed and verified at each point
  1014. that the internet header is processed.
  1015.  
  1016. The checksum algorithm is:
  1017.  
  1018. The checksum field is the 16 bit one's complement of the one's
  1019. complement sum of all 16 bit words in the header. For purposes of
  1020. computing the checksum, the value of the checksum field is zero.
  1021.  
  1022. This is a simple to compute checksum and experimental evidence
  1023. indicates it is adequate, but it is provisional and may be replaced
  1024. by a CRC procedure, depending on further experience.
  1025.  
  1026. Source Address: 32 bits
  1027.  
  1028. The source address. See section 3.2.
  1029.  
  1030. Destination Address: 32 bits
  1031.  
  1032. The destination address. See section 3.2.
  1033.  
  1034.  
  1035.  
  1036.  
  1037.  
  1038. [Page 14]
  1039.  
  1040. September 1981
  1041. Internet Protocol
  1042. Specification
  1043.  
  1044.  
  1045.  
  1046. Options: variable
  1047.  
  1048. The options may appear or not in datagrams. They must be
  1049. implemented by all IP modules (host and gateways). What is optional
  1050. is their transmission in any particular datagram, not their
  1051. implementation.
  1052.  
  1053. In some environments the security option may be required in all
  1054. datagrams.
  1055.  
  1056. The option field is variable in length. There may be zero or more
  1057. options. There are two cases for the format of an option:
  1058.  
  1059. Case 1: A single octet of option-type.
  1060.  
  1061. Case 2: An option-type octet, an option-length octet, and the
  1062. actual option-data octets.
  1063.  
  1064. The option-length octet counts the option-type octet and the
  1065. option-length octet as well as the option-data octets.
  1066.  
  1067. The option-type octet is viewed as having 3 fields:
  1068.  
  1069. 1 bit copied flag,
  1070. 2 bits option class,
  1071. 5 bits option number.
  1072.  
  1073. The copied flag indicates that this option is copied into all
  1074. fragments on fragmentation.
  1075.  
  1076. 0 = not copied
  1077. 1 = copied
  1078.  
  1079. The option classes are:
  1080.  
  1081. 0 = control
  1082. 1 = reserved for future use
  1083. 2 = debugging and measurement
  1084. 3 = reserved for future use
  1085.  
  1086.  
  1087.  
  1088.  
  1089.  
  1090.  
  1091.  
  1092.  
  1093.  
  1094.  
  1095.  
  1096. [Page 15]
  1097.  
  1098. September 1981
  1099. Internet Protocol
  1100. Specification
  1101.  
  1102.  
  1103.  
  1104. The following internet options are defined:
  1105.  
  1106. CLASS NUMBER LENGTH DESCRIPTION
  1107. ----- ------ ------ -----------
  1108. 0 0 - End of Option list. This option occupies only
  1109. 1 octet; it has no length octet.
  1110. 0 1 - No Operation. This option occupies only 1
  1111. octet; it has no length octet.
  1112. 0 2 11 Security. Used to carry Security,
  1113. Compartmentation, User Group (TCC), and
  1114. Handling Restriction Codes compatible with DOD
  1115. requirements.
  1116. 0 3 var. Loose Source Routing. Used to route the
  1117. internet datagram based on information
  1118. supplied by the source.
  1119. 0 9 var. Strict Source Routing. Used to route the
  1120. internet datagram based on information
  1121. supplied by the source.
  1122. 0 7 var. Record Route. Used to trace the route an
  1123. internet datagram takes.
  1124. 0 8 4 Stream ID. Used to carry the stream
  1125. identifier.
  1126. 2 4 var. Internet Timestamp.
  1127.  
  1128.  
  1129.  
  1130. Specific Option Definitions
  1131.  
  1132. End of Option List
  1133.  
  1134. +--------+
  1135. |00000000|
  1136. +--------+
  1137. Type=0
  1138.  
  1139. This option indicates the end of the option list. This might
  1140. not coincide with the end of the internet header according to
  1141. the internet header length. This is used at the end of all
  1142. options, not the end of each option, and need only be used if
  1143. the end of the options would not otherwise coincide with the end
  1144. of the internet header.
  1145.  
  1146. May be copied, introduced, or deleted on fragmentation, or for
  1147. any other reason.
  1148.  
  1149.  
  1150.  
  1151.  
  1152.  
  1153.  
  1154. [Page 16]
  1155.  
  1156. September 1981
  1157. Internet Protocol
  1158. Specification
  1159.  
  1160.  
  1161.  
  1162. No Operation
  1163.  
  1164. +--------+
  1165. |00000001|
  1166. +--------+
  1167. Type=1
  1168.  
  1169. This option may be used between options, for example, to align
  1170. the beginning of a subsequent option on a 32 bit boundary.
  1171.  
  1172. May be copied, introduced, or deleted on fragmentation, or for
  1173. any other reason.
  1174.  
  1175. Security
  1176.  
  1177. This option provides a way for hosts to send security,
  1178. compartmentation, handling restrictions, and TCC (closed user
  1179. group) parameters. The format for this option is as follows:
  1180.  
  1181. +--------+--------+---//---+---//---+---//---+---//---+
  1182. |10000010|00001011|SSS SSS|CCC CCC|HHH HHH| TCC |
  1183. +--------+--------+---//---+---//---+---//---+---//---+
  1184. Type=130 Length=11
  1185.  
  1186. Security (S field): 16 bits
  1187.  
  1188. Specifies one of 16 levels of security (eight of which are
  1189. reserved for future use).
  1190.  
  1191. 00000000 00000000 - Unclassified
  1192. 11110001 00110101 - Confidential
  1193. 01111000 10011010 - EFTO
  1194. 10111100 01001101 - MMMM
  1195. 01011110 00100110 - PROG
  1196. 10101111 00010011 - Restricted
  1197. 11010111 10001000 - Secret
  1198. 01101011 11000101 - Top Secret
  1199. 00110101 11100010 - (Reserved for future use)
  1200. 10011010 11110001 - (Reserved for future use)
  1201. 01001101 01111000 - (Reserved for future use)
  1202. 00100100 10111101 - (Reserved for future use)
  1203. 00010011 01011110 - (Reserved for future use)
  1204. 10001001 10101111 - (Reserved for future use)
  1205. 11000100 11010110 - (Reserved for future use)
  1206. 11100010 01101011 - (Reserved for future use)
  1207.  
  1208.  
  1209.  
  1210.  
  1211.  
  1212. [Page 17]
  1213.  
  1214. September 1981
  1215. Internet Protocol
  1216. Specification
  1217.  
  1218.  
  1219.  
  1220. Compartments (C field): 16 bits
  1221.  
  1222. An all zero value is used when the information transmitted is
  1223. not compartmented. Other values for the compartments field
  1224. may be obtained from the Defense Intelligence Agency.
  1225.  
  1226. Handling Restrictions (H field): 16 bits
  1227.  
  1228. The values for the control and release markings are
  1229. alphanumeric digraphs and are defined in the Defense
  1230. Intelligence Agency Manual DIAM 65-19, "Standard Security
  1231. Markings".
  1232.  
  1233. Transmission Control Code (TCC field): 24 bits
  1234.  
  1235. Provides a means to segregate traffic and define controlled
  1236. communities of interest among subscribers. The TCC values are
  1237. trigraphs, and are available from HQ DCA Code 530.
  1238.  
  1239. Must be copied on fragmentation. This option appears at most
  1240. once in a datagram.
  1241.  
  1242. Loose Source and Record Route
  1243.  
  1244. +--------+--------+--------+---------//--------+
  1245. |10000011| length | pointer| route data |
  1246. +--------+--------+--------+---------//--------+
  1247. Type=131
  1248.  
  1249. The loose source and record route (LSRR) option provides a means
  1250. for the source of an internet datagram to supply routing
  1251. information to be used by the gateways in forwarding the
  1252. datagram to the destination, and to record the route
  1253. information.
  1254.  
  1255. The option begins with the option type code. The second octet
  1256. is the option length which includes the option type code and the
  1257. length octet, the pointer octet, and length-3 octets of route
  1258. data. The third octet is the pointer into the route data
  1259. indicating the octet which begins the next source address to be
  1260. processed. The pointer is relative to this option, and the
  1261. smallest legal value for the pointer is 4.
  1262.  
  1263. A route data is composed of a series of internet addresses.
  1264. Each internet address is 32 bits or 4 octets. If the pointer is
  1265. greater than the length, the source route is empty (and the
  1266. recorded route full) and the routing is to be based on the
  1267. destination address field.
  1268.  
  1269.  
  1270. [Page 18]
  1271.  
  1272. September 1981
  1273. Internet Protocol
  1274. Specification
  1275.  
  1276.  
  1277.  
  1278. If the address in destination address field has been reached and
  1279. the pointer is not greater than the length, the next address in
  1280. the source route replaces the address in the destination address
  1281. field, and the recorded route address replaces the source
  1282. address just used, and pointer is increased by four.
  1283.  
  1284. The recorded route address is the internet module's own internet
  1285. address as known in the environment into which this datagram is
  1286. being forwarded.
  1287.  
  1288. This procedure of replacing the source route with the recorded
  1289. route (though it is in the reverse of the order it must be in to
  1290. be used as a source route) means the option (and the IP header
  1291. as a whole) remains a constant length as the datagram progresses
  1292. through the internet.
  1293.  
  1294. This option is a loose source route because the gateway or host
  1295. IP is allowed to use any route of any number of other
  1296. intermediate gateways to reach the next address in the route.
  1297.  
  1298. Must be copied on fragmentation. Appears at most once in a
  1299. datagram.
  1300.  
  1301. Strict Source and Record Route
  1302.  
  1303. +--------+--------+--------+---------//--------+
  1304. |10001001| length | pointer| route data |
  1305. +--------+--------+--------+---------//--------+
  1306. Type=137
  1307.  
  1308. The strict source and record route (SSRR) option provides a
  1309. means for the source of an internet datagram to supply routing
  1310. information to be used by the gateways in forwarding the
  1311. datagram to the destination, and to record the route
  1312. information.
  1313.  
  1314. The option begins with the option type code. The second octet
  1315. is the option length which includes the option type code and the
  1316. length octet, the pointer octet, and length-3 octets of route
  1317. data. The third octet is the pointer into the route data
  1318. indicating the octet which begins the next source address to be
  1319. processed. The pointer is relative to this option, and the
  1320. smallest legal value for the pointer is 4.
  1321.  
  1322. A route data is composed of a series of internet addresses.
  1323. Each internet address is 32 bits or 4 octets. If the pointer is
  1324. greater than the length, the source route is empty (and the
  1325.  
  1326.  
  1327.  
  1328. [Page 19]
  1329.  
  1330. September 1981
  1331. Internet Protocol
  1332. Specification
  1333.  
  1334.  
  1335.  
  1336. recorded route full) and the routing is to be based on the
  1337. destination address field.
  1338.  
  1339. If the address in destination address field has been reached and
  1340. the pointer is not greater than the length, the next address in
  1341. the source route replaces the address in the destination address
  1342. field, and the recorded route address replaces the source
  1343. address just used, and pointer is increased by four.
  1344.  
  1345. The recorded route address is the internet module's own internet
  1346. address as known in the environment into which this datagram is
  1347. being forwarded.
  1348.  
  1349. This procedure of replacing the source route with the recorded
  1350. route (though it is in the reverse of the order it must be in to
  1351. be used as a source route) means the option (and the IP header
  1352. as a whole) remains a constant length as the datagram progresses
  1353. through the internet.
  1354.  
  1355. This option is a strict source route because the gateway or host
  1356. IP must send the datagram directly to the next address in the
  1357. source route through only the directly connected network
  1358. indicated in the next address to reach the next gateway or host
  1359. specified in the route.
  1360.  
  1361. Must be copied on fragmentation. Appears at most once in a
  1362. datagram.
  1363.  
  1364. Record Route
  1365.  
  1366. +--------+--------+--------+---------//--------+
  1367. |00000111| length | pointer| route data |
  1368. +--------+--------+--------+---------//--------+
  1369. Type=7
  1370.  
  1371. The record route option provides a means to record the route of
  1372. an internet datagram.
  1373.  
  1374. The option begins with the option type code. The second octet
  1375. is the option length which includes the option type code and the
  1376. length octet, the pointer octet, and length-3 octets of route
  1377. data. The third octet is the pointer into the route data
  1378. indicating the octet which begins the next area to store a route
  1379. address. The pointer is relative to this option, and the
  1380. smallest legal value for the pointer is 4.
  1381.  
  1382. A recorded route is composed of a series of internet addresses.
  1383. Each internet address is 32 bits or 4 octets. If the pointer is
  1384.  
  1385.  
  1386. [Page 20]
  1387.  
  1388. September 1981
  1389. Internet Protocol
  1390. Specification
  1391.  
  1392.  
  1393.  
  1394. greater than the length, the recorded route data area is full.
  1395. The originating host must compose this option with a large
  1396. enough route data area to hold all the address expected. The
  1397. size of the option does not change due to adding addresses. The
  1398. intitial contents of the route data area must be zero.
  1399.  
  1400. When an internet module routes a datagram it checks to see if
  1401. the record route option is present. If it is, it inserts its
  1402. own internet address as known in the environment into which this
  1403. datagram is being forwarded into the recorded route begining at
  1404. the octet indicated by the pointer, and increments the pointer
  1405. by four.
  1406.  
  1407. If the route data area is already full (the pointer exceeds the
  1408. length) the datagram is forwarded without inserting the address
  1409. into the recorded route. If there is some room but not enough
  1410. room for a full address to be inserted, the original datagram is
  1411. considered to be in error and is discarded. In either case an
  1412. ICMP parameter problem message may be sent to the source
  1413. host [3].
  1414.  
  1415. Not copied on fragmentation, goes in first fragment only.
  1416. Appears at most once in a datagram.
  1417.  
  1418. Stream Identifier
  1419.  
  1420. +--------+--------+--------+--------+
  1421. |10001000|00000010| Stream ID |
  1422. +--------+--------+--------+--------+
  1423. Type=136 Length=4
  1424.  
  1425. This option provides a way for the 16-bit SATNET stream
  1426. identifier to be carried through networks that do not support
  1427. the stream concept.
  1428.  
  1429. Must be copied on fragmentation. Appears at most once in a
  1430. datagram.
  1431.  
  1432.  
  1433.  
  1434.  
  1435.  
  1436.  
  1437.  
  1438.  
  1439.  
  1440.  
  1441.  
  1442.  
  1443.  
  1444. [Page 21]
  1445.  
  1446. September 1981
  1447. Internet Protocol
  1448. Specification
  1449.  
  1450.  
  1451.  
  1452. Internet Timestamp
  1453.  
  1454. +--------+--------+--------+--------+
  1455. |01000100| length | pointer|oflw|flg|
  1456. +--------+--------+--------+--------+
  1457. | internet address |
  1458. +--------+--------+--------+--------+
  1459. | timestamp |
  1460. +--------+--------+--------+--------+
  1461. | . |
  1462. .
  1463. .
  1464. Type = 68
  1465.  
  1466. The Option Length is the number of octets in the option counting
  1467. the type, length, pointer, and overflow/flag octets (maximum
  1468. length 40).
  1469.  
  1470. The Pointer is the number of octets from the beginning of this
  1471. option to the end of timestamps plus one (i.e., it points to the
  1472. octet beginning the space for next timestamp). The smallest
  1473. legal value is 5. The timestamp area is full when the pointer
  1474. is greater than the length.
  1475.  
  1476. The Overflow (oflw) [4 bits] is the number of IP modules that
  1477. cannot register timestamps due to lack of space.
  1478.  
  1479. The Flag (flg) [4 bits] values are
  1480.  
  1481. 0 -- time stamps only, stored in consecutive 32-bit words,
  1482.  
  1483. 1 -- each timestamp is preceded with internet address of the
  1484. registering entity,
  1485.  
  1486. 3 -- the internet address fields are prespecified. An IP
  1487. module only registers its timestamp if it matches its own
  1488. address with the next specified internet address.
  1489.  
  1490. The Timestamp is a right-justified, 32-bit timestamp in
  1491. milliseconds since midnight UT. If the time is not available in
  1492. milliseconds or cannot be provided with respect to midnight UT
  1493. then any time may be inserted as a timestamp provided the high
  1494. order bit of the timestamp field is set to one to indicate the
  1495. use of a non-standard value.
  1496.  
  1497. The originating host must compose this option with a large
  1498. enough timestamp data area to hold all the timestamp information
  1499. expected. The size of the option does not change due to adding
  1500.  
  1501.  
  1502. [Page 22]
  1503.  
  1504. September 1981
  1505. Internet Protocol
  1506. Specification
  1507.  
  1508.  
  1509.  
  1510. timestamps. The intitial contents of the timestamp data area
  1511. must be zero or internet address/zero pairs.
  1512.  
  1513. If the timestamp data area is already full (the pointer exceeds
  1514. the length) the datagram is forwarded without inserting the
  1515. timestamp, but the overflow count is incremented by one.
  1516.  
  1517. If there is some room but not enough room for a full timestamp
  1518. to be inserted, or the overflow count itself overflows, the
  1519. original datagram is considered to be in error and is discarded.
  1520. In either case an ICMP parameter problem message may be sent to
  1521. the source host [3].
  1522.  
  1523. The timestamp option is not copied upon fragmentation. It is
  1524. carried in the first fragment. Appears at most once in a
  1525. datagram.
  1526.  
  1527. Padding: variable
  1528.  
  1529. The internet header padding is used to ensure that the internet
  1530. header ends on a 32 bit boundary. The padding is zero.
  1531.  
  1532. 3.2. Discussion
  1533.  
  1534. The implementation of a protocol must be robust. Each implementation
  1535. must expect to interoperate with others created by different
  1536. individuals. While the goal of this specification is to be explicit
  1537. about the protocol there is the possibility of differing
  1538. interpretations. In general, an implementation must be conservative
  1539. in its sending behavior, and liberal in its receiving behavior. That
  1540. is, it must be careful to send well-formed datagrams, but must accept
  1541. any datagram that it can interpret (e.g., not object to technical
  1542. errors where the meaning is still clear).
  1543.  
  1544. The basic internet service is datagram oriented and provides for the
  1545. fragmentation of datagrams at gateways, with reassembly taking place
  1546. at the destination internet protocol module in the destination host.
  1547. Of course, fragmentation and reassembly of datagrams within a network
  1548. or by private agreement between the gateways of a network is also
  1549. allowed since this is transparent to the internet protocols and the
  1550. higher-level protocols. This transparent type of fragmentation and
  1551. reassembly is termed "network-dependent" (or intranet) fragmentation
  1552. and is not discussed further here.
  1553.  
  1554. Internet addresses distinguish sources and destinations to the host
  1555. level and provide a protocol field as well. It is assumed that each
  1556. protocol will provide for whatever multiplexing is necessary within a
  1557. host.
  1558.  
  1559.  
  1560. [Page 23]
  1561.  
  1562. September 1981
  1563. Internet Protocol
  1564. Specification
  1565.  
  1566.  
  1567.  
  1568. Addressing
  1569.  
  1570. To provide for flexibility in assigning address to networks and
  1571. allow for the large number of small to intermediate sized networks
  1572. the interpretation of the address field is coded to specify a small
  1573. number of networks with a large number of host, a moderate number of
  1574. networks with a moderate number of hosts, and a large number of
  1575. networks with a small number of hosts. In addition there is an
  1576. escape code for extended addressing mode.
  1577.  
  1578. Address Formats:
  1579.  
  1580. High Order Bits Format Class
  1581. --------------- ------------------------------- -----
  1582. 0 7 bits of net, 24 bits of host a
  1583. 10 14 bits of net, 16 bits of host b
  1584. 110 21 bits of net, 8 bits of host c
  1585. 111 escape to extended addressing mode
  1586.  
  1587. A value of zero in the network field means this network. This is
  1588. only used in certain ICMP messages. The extended addressing mode
  1589. is undefined. Both of these features are reserved for future use.
  1590.  
  1591. The actual values assigned for network addresses is given in
  1592. "Assigned Numbers" [9].
  1593.  
  1594. The local address, assigned by the local network, must allow for a
  1595. single physical host to act as several distinct internet hosts.
  1596. That is, there must be a mapping between internet host addresses and
  1597. network/host interfaces that allows several internet addresses to
  1598. correspond to one interface. It must also be allowed for a host to
  1599. have several physical interfaces and to treat the datagrams from
  1600. several of them as if they were all addressed to a single host.
  1601.  
  1602. Address mappings between internet addresses and addresses for
  1603. ARPANET, SATNET, PRNET, and other networks are described in "Address
  1604. Mappings" [5].
  1605.  
  1606. Fragmentation and Reassembly.
  1607.  
  1608. The internet identification field (ID) is used together with the
  1609. source and destination address, and the protocol fields, to identify
  1610. datagram fragments for reassembly.
  1611.  
  1612. The More Fragments flag bit (MF) is set if the datagram is not the
  1613. last fragment. The Fragment Offset field identifies the fragment
  1614. location, relative to the beginning of the original unfragmented
  1615. datagram. Fragments are counted in units of 8 octets. The
  1616.  
  1617.  
  1618. [Page 24]
  1619.  
  1620. September 1981
  1621. Internet Protocol
  1622. Specification
  1623.  
  1624.  
  1625.  
  1626. fragmentation strategy is designed so than an unfragmented datagram
  1627. has all zero fragmentation information (MF = 0, fragment offset =
  1628. 0). If an internet datagram is fragmented, its data portion must be
  1629. broken on 8 octet boundaries.
  1630.  
  1631. This format allows 2**13 = 8192 fragments of 8 octets each for a
  1632. total of 65,536 octets. Note that this is consistent with the the
  1633. datagram total length field (of course, the header is counted in the
  1634. total length and not in the fragments).
  1635.  
  1636. When fragmentation occurs, some options are copied, but others
  1637. remain with the first fragment only.
  1638.  
  1639. Every internet module must be able to forward a datagram of 68
  1640. octets without further fragmentation. This is because an internet
  1641. header may be up to 60 octets, and the minimum fragment is 8 octets.
  1642.  
  1643. Every internet destination must be able to receive a datagram of 576
  1644. octets either in one piece or in fragments to be reassembled.
  1645.  
  1646. The fields which may be affected by fragmentation include:
  1647.  
  1648. (1) options field
  1649. (2) more fragments flag
  1650. (3) fragment offset
  1651. (4) internet header length field
  1652. (5) total length field
  1653. (6) header checksum
  1654.  
  1655. If the Don't Fragment flag (DF) bit is set, then internet
  1656. fragmentation of this datagram is NOT permitted, although it may be
  1657. discarded. This can be used to prohibit fragmentation in cases
  1658. where the receiving host does not have sufficient resources to
  1659. reassemble internet fragments.
  1660.  
  1661. One example of use of the Don't Fragment feature is to down line
  1662. load a small host. A small host could have a boot strap program
  1663. that accepts a datagram stores it in memory and then executes it.
  1664.  
  1665. The fragmentation and reassembly procedures are most easily
  1666. described by examples. The following procedures are example
  1667. implementations.
  1668.  
  1669. General notation in the following pseudo programs: "=<" means "less
  1670. than or equal", "#" means "not equal", "=" means "equal", "<-" means
  1671. "is set to". Also, "x to y" includes x and excludes y; for example,
  1672. "4 to 7" would include 4, 5, and 6 (but not 7).
  1673.  
  1674.  
  1675.  
  1676. [Page 25]
  1677.  
  1678. September 1981
  1679. Internet Protocol
  1680. Specification
  1681.  
  1682.  
  1683.  
  1684. An Example Fragmentation Procedure
  1685.  
  1686. The maximum sized datagram that can be transmitted through the
  1687. next network is called the maximum transmission unit (MTU).
  1688.  
  1689. If the total length is less than or equal the maximum transmission
  1690. unit then submit this datagram to the next step in datagram
  1691. processing; otherwise cut the datagram into two fragments, the
  1692. first fragment being the maximum size, and the second fragment
  1693. being the rest of the datagram. The first fragment is submitted
  1694. to the next step in datagram processing, while the second fragment
  1695. is submitted to this procedure in case it is still too large.
  1696.  
  1697. Notation:
  1698.  
  1699. FO - Fragment Offset
  1700. IHL - Internet Header Length
  1701. DF - Don't Fragment flag
  1702. MF - More Fragments flag
  1703. TL - Total Length
  1704. OFO - Old Fragment Offset
  1705. OIHL - Old Internet Header Length
  1706. OMF - Old More Fragments flag
  1707. OTL - Old Total Length
  1708. NFB - Number of Fragment Blocks
  1709. MTU - Maximum Transmission Unit
  1710.  
  1711. Procedure:
  1712.  
  1713. IF TL =< MTU THEN Submit this datagram to the next step
  1714. in datagram processing ELSE IF DF = 1 THEN discard the
  1715. datagram ELSE
  1716. To produce the first fragment:
  1717. (1) Copy the original internet header;
  1718. (2) OIHL <- IHL; OTL <- TL; OFO <- FO; OMF <- MF;
  1719. (3) NFB <- (MTU-IHL*4)/8;
  1720. (4) Attach the first NFB*8 data octets;
  1721. (5) Correct the header:
  1722. MF <- 1; TL <- (IHL*4)+(NFB*8);
  1723. Recompute Checksum;
  1724. (6) Submit this fragment to the next step in
  1725. datagram processing;
  1726. To produce the second fragment:
  1727. (7) Selectively copy the internet header (some options
  1728. are not copied, see option definitions);
  1729. (8) Append the remaining data;
  1730. (9) Correct the header:
  1731. IHL <- (((OIHL*4)-(length of options not copied))+3)/4;
  1732.  
  1733.  
  1734. [Page 26]
  1735.  
  1736. September 1981
  1737. Internet Protocol
  1738. Specification
  1739.  
  1740.  
  1741.  
  1742. TL <- OTL - NFB*8 - (OIHL-IHL)*4);
  1743. FO <- OFO + NFB; MF <- OMF; Recompute Checksum;
  1744. (10) Submit this fragment to the fragmentation test; DONE.
  1745.  
  1746. In the above procedure each fragment (except the last) was made
  1747. the maximum allowable size. An alternative might produce less
  1748. than the maximum size datagrams. For example, one could implement
  1749. a fragmentation procedure that repeatly divided large datagrams in
  1750. half until the resulting fragments were less than the maximum
  1751. transmission unit size.
  1752.  
  1753. An Example Reassembly Procedure
  1754.  
  1755. For each datagram the buffer identifier is computed as the
  1756. concatenation of the source, destination, protocol, and
  1757. identification fields. If this is a whole datagram (that is both
  1758. the fragment offset and the more fragments fields are zero), then
  1759. any reassembly resources associated with this buffer identifier
  1760. are released and the datagram is forwarded to the next step in
  1761. datagram processing.
  1762.  
  1763. If no other fragment with this buffer identifier is on hand then
  1764. reassembly resources are allocated. The reassembly resources
  1765. consist of a data buffer, a header buffer, a fragment block bit
  1766. table, a total data length field, and a timer. The data from the
  1767. fragment is placed in the data buffer according to its fragment
  1768. offset and length, and bits are set in the fragment block bit
  1769. table corresponding to the fragment blocks received.
  1770.  
  1771. If this is the first fragment (that is the fragment offset is
  1772. zero) this header is placed in the header buffer. If this is the
  1773. last fragment ( that is the more fragments field is zero) the
  1774. total data length is computed. If this fragment completes the
  1775. datagram (tested by checking the bits set in the fragment block
  1776. table), then the datagram is sent to the next step in datagram
  1777. processing; otherwise the timer is set to the maximum of the
  1778. current timer value and the value of the time to live field from
  1779. this fragment; and the reassembly routine gives up control.
  1780.  
  1781. If the timer runs out, the all reassembly resources for this
  1782. buffer identifier are released. The initial setting of the timer
  1783. is a lower bound on the reassembly waiting time. This is because
  1784. the waiting time will be increased if the Time to Live in the
  1785. arriving fragment is greater than the current timer value but will
  1786. not be decreased if it is less. The maximum this timer value
  1787. could reach is the maximum time to live (approximately 4.25
  1788. minutes). The current recommendation for the initial timer
  1789. setting is 15 seconds. This may be changed as experience with
  1790.  
  1791.  
  1792. [Page 27]
  1793.  
  1794. September 1981
  1795. Internet Protocol
  1796. Specification
  1797.  
  1798.  
  1799.  
  1800. this protocol accumulates. Note that the choice of this parameter
  1801. value is related to the buffer capacity available and the data
  1802. rate of the transmission medium; that is, data rate times timer
  1803. value equals buffer size (e.g., 10Kb/s X 15s = 150Kb).
  1804.  
  1805. Notation:
  1806.  
  1807. FO - Fragment Offset
  1808. IHL - Internet Header Length
  1809. MF - More Fragments flag
  1810. TTL - Time To Live
  1811. NFB - Number of Fragment Blocks
  1812. TL - Total Length
  1813. TDL - Total Data Length
  1814. BUFID - Buffer Identifier
  1815. RCVBT - Fragment Received Bit Table
  1816. TLB - Timer Lower Bound
  1817.  
  1818. Procedure:
  1819.  
  1820. (1) BUFID <- source|destination|protocol|identification;
  1821. (2) IF FO = 0 AND MF = 0
  1822. (3) THEN IF buffer with BUFID is allocated
  1823. (4) THEN flush all reassembly for this BUFID;
  1824. (5) Submit datagram to next step; DONE.
  1825. (6) ELSE IF no buffer with BUFID is allocated
  1826. (7) THEN allocate reassembly resources
  1827. with BUFID;
  1828. TIMER <- TLB; TDL <- 0;
  1829. (8) put data from fragment into data buffer with
  1830. BUFID from octet FO*8 to
  1831. octet (TL-(IHL*4))+FO*8;
  1832. (9) set RCVBT bits from FO
  1833. to FO+((TL-(IHL*4)+7)/8);
  1834. (10) IF MF = 0 THEN TDL <- TL-(IHL*4)+(FO*8)
  1835. (11) IF FO = 0 THEN put header in header buffer
  1836. (12) IF TDL # 0
  1837. (13) AND all RCVBT bits from 0
  1838. to (TDL+7)/8 are set
  1839. (14) THEN TL <- TDL+(IHL*4)
  1840. (15) Submit datagram to next step;
  1841. (16) free all reassembly resources
  1842. for this BUFID; DONE.
  1843. (17) TIMER <- MAX(TIMER,TTL);
  1844. (18) give up until next fragment or timer expires;
  1845. (19) timer expires: flush all reassembly with this BUFID; DONE.
  1846.  
  1847. In the case that two or more fragments contain the same data
  1848.  
  1849.  
  1850. [Page 28]
  1851.  
  1852. September 1981
  1853. Internet Protocol
  1854. Specification
  1855.  
  1856.  
  1857.  
  1858. either identically or through a partial overlap, this procedure
  1859. will use the more recently arrived copy in the data buffer and
  1860. datagram delivered.
  1861.  
  1862. Identification
  1863.  
  1864. The choice of the Identifier for a datagram is based on the need to
  1865. provide a way to uniquely identify the fragments of a particular
  1866. datagram. The protocol module assembling fragments judges fragments
  1867. to belong to the same datagram if they have the same source,
  1868. destination, protocol, and Identifier. Thus, the sender must choose
  1869. the Identifier to be unique for this source, destination pair and
  1870. protocol for the time the datagram (or any fragment of it) could be
  1871. alive in the internet.
  1872.  
  1873. It seems then that a sending protocol module needs to keep a table
  1874. of Identifiers, one entry for each destination it has communicated
  1875. with in the last maximum packet lifetime for the internet.
  1876.  
  1877. However, since the Identifier field allows 65,536 different values,
  1878. some host may be able to simply use unique identifiers independent
  1879. of destination.
  1880.  
  1881. It is appropriate for some higher level protocols to choose the
  1882. identifier. For example, TCP protocol modules may retransmit an
  1883. identical TCP segment, and the probability for correct reception
  1884. would be enhanced if the retransmission carried the same identifier
  1885. as the original transmission since fragments of either datagram
  1886. could be used to construct a correct TCP segment.
  1887.  
  1888. Type of Service
  1889.  
  1890. The type of service (TOS) is for internet service quality selection.
  1891. The type of service is specified along the abstract parameters
  1892. precedence, delay, throughput, and reliability. These abstract
  1893. parameters are to be mapped into the actual service parameters of
  1894. the particular networks the datagram traverses.
  1895.  
  1896. Precedence. An independent measure of the importance of this
  1897. datagram.
  1898.  
  1899. Delay. Prompt delivery is important for datagrams with this
  1900. indication.
  1901.  
  1902. Throughput. High data rate is important for datagrams with this
  1903. indication.
  1904.  
  1905.  
  1906.  
  1907.  
  1908. [Page 29]
  1909.  
  1910. September 1981
  1911. Internet Protocol
  1912. Specification
  1913.  
  1914.  
  1915.  
  1916. Reliability. A higher level of effort to ensure delivery is
  1917. important for datagrams with this indication.
  1918.  
  1919. For example, the ARPANET has a priority bit, and a choice between
  1920. "standard" messages (type 0) and "uncontrolled" messages (type 3),
  1921. (the choice between single packet and multipacket messages can also
  1922. be considered a service parameter). The uncontrolled messages tend
  1923. to be less reliably delivered and suffer less delay. Suppose an
  1924. internet datagram is to be sent through the ARPANET. Let the
  1925. internet type of service be given as:
  1926.  
  1927. Precedence: 5
  1928. Delay: 0
  1929. Throughput: 1
  1930. Reliability: 1
  1931.  
  1932. In this example, the mapping of these parameters to those available
  1933. for the ARPANET would be to set the ARPANET priority bit on since
  1934. the Internet precedence is in the upper half of its range, to select
  1935. standard messages since the throughput and reliability requirements
  1936. are indicated and delay is not. More details are given on service
  1937. mappings in "Service Mappings" [8].
  1938.  
  1939. Time to Live
  1940.  
  1941. The time to live is set by the sender to the maximum time the
  1942. datagram is allowed to be in the internet system. If the datagram
  1943. is in the internet system longer than the time to live, then the
  1944. datagram must be destroyed.
  1945.  
  1946. This field must be decreased at each point that the internet header
  1947. is processed to reflect the time spent processing the datagram.
  1948. Even if no local information is available on the time actually
  1949. spent, the field must be decremented by 1. The time is measured in
  1950. units of seconds (i.e. the value 1 means one second). Thus, the
  1951. maximum time to live is 255 seconds or 4.25 minutes. Since every
  1952. module that processes a datagram must decrease the TTL by at least
  1953. one even if it process the datagram in less than a second, the TTL
  1954. must be thought of only as an upper bound on the time a datagram may
  1955. exist. The intention is to cause undeliverable datagrams to be
  1956. discarded, and to bound the maximum datagram lifetime.
  1957.  
  1958. Some higher level reliable connection protocols are based on
  1959. assumptions that old duplicate datagrams will not arrive after a
  1960. certain time elapses. The TTL is a way for such protocols to have
  1961. an assurance that their assumption is met.
  1962.  
  1963.  
  1964.  
  1965.  
  1966. [Page 30]
  1967.  
  1968. September 1981
  1969. Internet Protocol
  1970. Specification
  1971.  
  1972.  
  1973.  
  1974. Options
  1975.  
  1976. The options are optional in each datagram, but required in
  1977. implementations. That is, the presence or absence of an option is
  1978. the choice of the sender, but each internet module must be able to
  1979. parse every option. There can be several options present in the
  1980. option field.
  1981.  
  1982. The options might not end on a 32-bit boundary. The internet header
  1983. must be filled out with octets of zeros. The first of these would
  1984. be interpreted as the end-of-options option, and the remainder as
  1985. internet header padding.
  1986.  
  1987. Every internet module must be able to act on every option. The
  1988. Security Option is required if classified, restricted, or
  1989. compartmented traffic is to be passed.
  1990.  
  1991. Checksum
  1992.  
  1993. The internet header checksum is recomputed if the internet header is
  1994. changed. For example, a reduction of the time to live, additions or
  1995. changes to internet options, or due to fragmentation. This checksum
  1996. at the internet level is intended to protect the internet header
  1997. fields from transmission errors.
  1998.  
  1999. There are some applications where a few data bit errors are
  2000. acceptable while retransmission delays are not. If the internet
  2001. protocol enforced data correctness such applications could not be
  2002. supported.
  2003.  
  2004. Errors
  2005.  
  2006. Internet protocol errors may be reported via the ICMP messages [3].
  2007.  
  2008. 3.3. Interfaces
  2009.  
  2010. The functional description of user interfaces to the IP is, at best,
  2011. fictional, since every operating system will have different
  2012. facilities. Consequently, we must warn readers that different IP
  2013. implementations may have different user interfaces. However, all IPs
  2014. must provide a certain minimum set of services to guarantee that all
  2015. IP implementations can support the same protocol hierarchy. This
  2016. section specifies the functional interfaces required of all IP
  2017. implementations.
  2018.  
  2019. Internet protocol interfaces on one side to the local network and on
  2020. the other side to either a higher level protocol or an application
  2021. program. In the following, the higher level protocol or application
  2022.  
  2023.  
  2024. [Page 31]
  2025.  
  2026. September 1981
  2027. Internet Protocol
  2028. Specification
  2029.  
  2030.  
  2031.  
  2032. program (or even a gateway program) will be called the "user" since it
  2033. is using the internet module. Since internet protocol is a datagram
  2034. protocol, there is minimal memory or state maintained between datagram
  2035. transmissions, and each call on the internet protocol module by the
  2036. user supplies all information necessary for the IP to perform the
  2037. service requested.
  2038.  
  2039. An Example Upper Level Interface
  2040.  
  2041. The following two example calls satisfy the requirements for the user
  2042. to internet protocol module communication ("=>" means returns):
  2043.  
  2044. SEND (src, dst, prot, TOS, TTL, BufPTR, len, Id, DF, opt => result)
  2045.  
  2046. where:
  2047.  
  2048. src = source address
  2049. dst = destination address
  2050. prot = protocol
  2051. TOS = type of service
  2052. TTL = time to live
  2053. BufPTR = buffer pointer
  2054. len = length of buffer
  2055. Id = Identifier
  2056. DF = Don't Fragment
  2057. opt = option data
  2058. result = response
  2059. OK = datagram sent ok
  2060. Error = error in arguments or local network error
  2061.  
  2062. Note that the precedence is included in the TOS and the
  2063. security/compartment is passed as an option.
  2064.  
  2065. RECV (BufPTR, prot, => result, src, dst, TOS, len, opt)
  2066.  
  2067. where:
  2068.  
  2069. BufPTR = buffer pointer
  2070. prot = protocol
  2071. result = response
  2072. OK = datagram received ok
  2073. Error = error in arguments
  2074. len = length of buffer
  2075. src = source address
  2076. dst = destination address
  2077. TOS = type of service
  2078. opt = option data
  2079.  
  2080.  
  2081.  
  2082. [Page 32]
  2083.  
  2084. September 1981
  2085. Internet Protocol
  2086. Specification
  2087.  
  2088.  
  2089.  
  2090. When the user sends a datagram, it executes the SEND call supplying
  2091. all the arguments. The internet protocol module, on receiving this
  2092. call, checks the arguments and prepares and sends the message. If the
  2093. arguments are good and the datagram is accepted by the local network,
  2094. the call returns successfully. If either the arguments are bad, or
  2095. the datagram is not accepted by the local network, the call returns
  2096. unsuccessfully. On unsuccessful returns, a reasonable report must be
  2097. made as to the cause of the problem, but the details of such reports
  2098. are up to individual implementations.
  2099.  
  2100. When a datagram arrives at the internet protocol module from the local
  2101. network, either there is a pending RECV call from the user addressed
  2102. or there is not. In the first case, the pending call is satisfied by
  2103. passing the information from the datagram to the user. In the second
  2104. case, the user addressed is notified of a pending datagram. If the
  2105. user addressed does not exist, an ICMP error message is returned to
  2106. the sender, and the data is discarded.
  2107.  
  2108. The notification of a user may be via a pseudo interrupt or similar
  2109. mechanism, as appropriate in the particular operating system
  2110. environment of the implementation.
  2111.  
  2112. A user's RECV call may then either be immediately satisfied by a
  2113. pending datagram, or the call may be pending until a datagram arrives.
  2114.  
  2115. The source address is included in the send call in case the sending
  2116. host has several addresses (multiple physical connections or logical
  2117. addresses). The internet module must check to see that the source
  2118. address is one of the legal address for this host.
  2119.  
  2120. An implementation may also allow or require a call to the internet
  2121. module to indicate interest in or reserve exclusive use of a class of
  2122. datagrams (e.g., all those with a certain value in the protocol
  2123. field).
  2124.  
  2125. This section functionally characterizes a USER/IP interface. The
  2126. notation used is similar to most procedure of function calls in high
  2127. level languages, but this usage is not meant to rule out trap type
  2128. service calls (e.g., SVCs, UUOs, EMTs), or any other form of
  2129. interprocess communication.
  2130.  
  2131.  
  2132.  
  2133.  
  2134.  
  2135.  
  2136.  
  2137.  
  2138.  
  2139.  
  2140. [Page 33]
  2141.  
  2142. September 1981
  2143. Internet Protocol
  2144.  
  2145.  
  2146.  
  2147. APPENDIX A: Examples & Scenarios
  2148.  
  2149. Example 1:
  2150.  
  2151. This is an example of the minimal data carrying internet datagram:
  2152.  
  2153.  
  2154. 0 1 2 3
  2155. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2156. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2157. |Ver= 4 |IHL= 5 |Type of Service| Total Length = 21 |
  2158. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2159. | Identification = 111 |Flg=0| Fragment Offset = 0 |
  2160. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2161. | Time = 123 | Protocol = 1 | header checksum |
  2162. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2163. | source address |
  2164. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2165. | destination address |
  2166. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2167. | data |
  2168. +-+-+-+-+-+-+-+-+
  2169.  
  2170. Example Internet Datagram
  2171.  
  2172. Figure 5.
  2173.  
  2174. Note that each tick mark represents one bit position.
  2175.  
  2176. This is a internet datagram in version 4 of internet protocol; the
  2177. internet header consists of five 32 bit words, and the total length of
  2178. the datagram is 21 octets. This datagram is a complete datagram (not
  2179. a fragment).
  2180.  
  2181.  
  2182.  
  2183.  
  2184.  
  2185.  
  2186.  
  2187.  
  2188.  
  2189.  
  2190.  
  2191.  
  2192.  
  2193.  
  2194.  
  2195.  
  2196.  
  2197.  
  2198. [Page 34]
  2199.  
  2200. September 1981
  2201. Internet Protocol
  2202.  
  2203.  
  2204.  
  2205. Example 2:
  2206.  
  2207. In this example, we show first a moderate size internet datagram (452
  2208. data octets), then two internet fragments that might result from the
  2209. fragmentation of this datagram if the maximum sized transmission
  2210. allowed were 280 octets.
  2211.  
  2212.  
  2213. 0 1 2 3
  2214. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2215. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2216. |Ver= 4 |IHL= 5 |Type of Service| Total Length = 472 |
  2217. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2218. | Identification = 111 |Flg=0| Fragment Offset = 0 |
  2219. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2220. | Time = 123 | Protocol = 6 | header checksum |
  2221. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2222. | source address |
  2223. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2224. | destination address |
  2225. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2226. | data |
  2227. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2228. | data |
  2229. \ \
  2230. \ \
  2231. | data |
  2232. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2233. | data |
  2234. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2235.  
  2236. Example Internet Datagram
  2237.  
  2238. Figure 6.
  2239.  
  2240.  
  2241.  
  2242.  
  2243.  
  2244.  
  2245.  
  2246.  
  2247.  
  2248.  
  2249.  
  2250.  
  2251.  
  2252.  
  2253.  
  2254.  
  2255.  
  2256. [Page 35]
  2257.  
  2258. September 1981
  2259. Internet Protocol
  2260.  
  2261.  
  2262.  
  2263. Now the first fragment that results from splitting the datagram after
  2264. 256 data octets.
  2265.  
  2266.  
  2267. 0 1 2 3
  2268. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2269. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2270. |Ver= 4 |IHL= 5 |Type of Service| Total Length = 276 |
  2271. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2272. | Identification = 111 |Flg=1| Fragment Offset = 0 |
  2273. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2274. | Time = 119 | Protocol = 6 | Header Checksum |
  2275. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2276. | source address |
  2277. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2278. | destination address |
  2279. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2280. | data |
  2281. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2282. | data |
  2283. \ \
  2284. \ \
  2285. | data |
  2286. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2287. | data |
  2288. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2289.  
  2290. Example Internet Fragment
  2291.  
  2292. Figure 7.
  2293.  
  2294.  
  2295.  
  2296.  
  2297.  
  2298.  
  2299.  
  2300.  
  2301.  
  2302.  
  2303.  
  2304.  
  2305.  
  2306.  
  2307.  
  2308.  
  2309.  
  2310.  
  2311.  
  2312.  
  2313.  
  2314. [Page 36]
  2315.  
  2316. September 1981
  2317. Internet Protocol
  2318.  
  2319.  
  2320.  
  2321. And the second fragment.
  2322.  
  2323.  
  2324. 0 1 2 3
  2325. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2326. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2327. |Ver= 4 |IHL= 5 |Type of Service| Total Length = 216 |
  2328. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2329. | Identification = 111 |Flg=0| Fragment Offset = 32 |
  2330. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2331. | Time = 119 | Protocol = 6 | Header Checksum |
  2332. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2333. | source address |
  2334. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2335. | destination address |
  2336. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2337. | data |
  2338. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2339. | data |
  2340. \ \
  2341. \ \
  2342. | data |
  2343. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2344. | data |
  2345. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2346.  
  2347. Example Internet Fragment
  2348.  
  2349. Figure 8.
  2350.  
  2351.  
  2352.  
  2353.  
  2354.  
  2355.  
  2356.  
  2357.  
  2358.  
  2359.  
  2360.  
  2361.  
  2362.  
  2363.  
  2364.  
  2365.  
  2366.  
  2367.  
  2368.  
  2369.  
  2370.  
  2371.  
  2372. [Page 37]
  2373.  
  2374. September 1981
  2375. Internet Protocol
  2376.  
  2377.  
  2378.  
  2379. Example 3:
  2380.  
  2381. Here, we show an example of a datagram containing options:
  2382.  
  2383.  
  2384. 0 1 2 3
  2385. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2386. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2387. |Ver= 4 |IHL= 8 |Type of Service| Total Length = 576 |
  2388. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2389. | Identification = 111 |Flg=0| Fragment Offset = 0 |
  2390. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2391. | Time = 123 | Protocol = 6 | Header Checksum |
  2392. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2393. | source address |
  2394. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2395. | destination address |
  2396. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2397. | Opt. Code = x | Opt. Len.= 3 | option value | Opt. Code = x |
  2398. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2399. | Opt. Len. = 4 | option value | Opt. Code = 1 |
  2400. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2401. | Opt. Code = y | Opt. Len. = 3 | option value | Opt. Code = 0 |
  2402. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2403. | data |
  2404. \ \
  2405. \ \
  2406. | data |
  2407. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2408. | data |
  2409. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2410.  
  2411. Example Internet Datagram
  2412.  
  2413. Figure 9.
  2414.  
  2415.  
  2416.  
  2417.  
  2418.  
  2419.  
  2420.  
  2421.  
  2422.  
  2423.  
  2424.  
  2425.  
  2426.  
  2427.  
  2428.  
  2429.  
  2430. [Page 38]
  2431.  
  2432. September 1981
  2433. Internet Protocol
  2434.  
  2435.  
  2436.  
  2437. APPENDIX B: Data Transmission Order
  2438.  
  2439. The order of transmission of the header and data described in this
  2440. document is resolved to the octet level. Whenever a diagram shows a
  2441. group of octets, the order of transmission of those octets is the normal
  2442. order in which they are read in English. For example, in the following
  2443. diagram the octets are transmitted in the order they are numbered.
  2444.  
  2445.  
  2446. 0 1 2 3
  2447. 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5 6 7 8 9 0 1
  2448. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2449. | 1 | 2 | 3 | 4 |
  2450. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2451. | 5 | 6 | 7 | 8 |
  2452. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2453. | 9 | 10 | 11 | 12 |
  2454. +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
  2455.  
  2456. Transmission Order of Bytes
  2457.  
  2458. Figure 10.
  2459.  
  2460. Whenever an octet represents a numeric quantity the left most bit in the
  2461. diagram is the high order or most significant bit. That is, the bit
  2462. labeled 0 is the most significant bit. For example, the following
  2463. diagram represents the value 170 (decimal).
  2464.  
  2465.  
  2466. 0 1 2 3 4 5 6 7
  2467. +-+-+-+-+-+-+-+-+
  2468. |1 0 1 0 1 0 1 0|
  2469. +-+-+-+-+-+-+-+-+
  2470.  
  2471. Significance of Bits
  2472.  
  2473. Figure 11.
  2474.  
  2475. Similarly, whenever a multi-octet field represents a numeric quantity
  2476. the left most bit of the whole field is the most significant bit. When
  2477. a multi-octet quantity is transmitted the most significant octet is
  2478. transmitted first.
  2479.  
  2480.  
  2481.  
  2482.  
  2483.  
  2484.  
  2485.  
  2486.  
  2487.  
  2488. [Page 39]
  2489.  
  2490. September 1981
  2491. Internet Protocol
  2492.  
  2493.  
  2494.  
  2495.  
  2496.  
  2497.  
  2498.  
  2499.  
  2500.  
  2501.  
  2502.  
  2503.  
  2504.  
  2505.  
  2506.  
  2507.  
  2508.  
  2509.  
  2510.  
  2511.  
  2512.  
  2513.  
  2514.  
  2515.  
  2516.  
  2517.  
  2518.  
  2519.  
  2520.  
  2521.  
  2522.  
  2523.  
  2524.  
  2525.  
  2526.  
  2527.  
  2528.  
  2529.  
  2530.  
  2531.  
  2532.  
  2533.  
  2534.  
  2535.  
  2536.  
  2537.  
  2538.  
  2539.  
  2540.  
  2541.  
  2542.  
  2543.  
  2544.  
  2545.  
  2546. [Page 40]
  2547.  
  2548. September 1981
  2549. Internet Protocol
  2550.  
  2551.  
  2552.  
  2553. GLOSSARY
  2554.  
  2555.  
  2556.  
  2557. 1822
  2558. BBN Report 1822, "The Specification of the Interconnection of
  2559. a Host and an IMP". The specification of interface between a
  2560. host and the ARPANET.
  2561.  
  2562. ARPANET leader
  2563. The control information on an ARPANET message at the host-IMP
  2564. interface.
  2565.  
  2566. ARPANET message
  2567. The unit of transmission between a host and an IMP in the
  2568. ARPANET. The maximum size is about 1012 octets (8096 bits).
  2569.  
  2570. ARPANET packet
  2571. A unit of transmission used internally in the ARPANET between
  2572. IMPs. The maximum size is about 126 octets (1008 bits).
  2573.  
  2574. Destination
  2575. The destination address, an internet header field.
  2576.  
  2577. DF
  2578. The Don't Fragment bit carried in the flags field.
  2579.  
  2580. Flags
  2581. An internet header field carrying various control flags.
  2582.  
  2583. Fragment Offset
  2584. This internet header field indicates where in the internet
  2585. datagram a fragment belongs.
  2586.  
  2587. GGP
  2588. Gateway to Gateway Protocol, the protocol used primarily
  2589. between gateways to control routing and other gateway
  2590. functions.
  2591.  
  2592. header
  2593. Control information at the beginning of a message, segment,
  2594. datagram, packet or block of data.
  2595.  
  2596. ICMP
  2597. Internet Control Message Protocol, implemented in the internet
  2598. module, the ICMP is used from gateways to hosts and between
  2599. hosts to report errors and make routing suggestions.
  2600.  
  2601.  
  2602.  
  2603.  
  2604. [Page 41]
  2605.  
  2606. September 1981
  2607. Internet Protocol
  2608. Glossary
  2609.  
  2610.  
  2611.  
  2612. Identification
  2613. An internet header field carrying the identifying value
  2614. assigned by the sender to aid in assembling the fragments of a
  2615. datagram.
  2616.  
  2617. IHL
  2618. The internet header field Internet Header Length is the length
  2619. of the internet header measured in 32 bit words.
  2620.  
  2621. IMP
  2622. The Interface Message Processor, the packet switch of the
  2623. ARPANET.
  2624.  
  2625. Internet Address
  2626. A four octet (32 bit) source or destination address consisting
  2627. of a Network field and a Local Address field.
  2628.  
  2629. internet datagram
  2630. The unit of data exchanged between a pair of internet modules
  2631. (includes the internet header).
  2632.  
  2633. internet fragment
  2634. A portion of the data of an internet datagram with an internet
  2635. header.
  2636.  
  2637. Local Address
  2638. The address of a host within a network. The actual mapping of
  2639. an internet local address on to the host addresses in a
  2640. network is quite general, allowing for many to one mappings.
  2641.  
  2642. MF
  2643. The More-Fragments Flag carried in the internet header flags
  2644. field.
  2645.  
  2646. module
  2647. An implementation, usually in software, of a protocol or other
  2648. procedure.
  2649.  
  2650. more-fragments flag
  2651. A flag indicating whether or not this internet datagram
  2652. contains the end of an internet datagram, carried in the
  2653. internet header Flags field.
  2654.  
  2655. NFB
  2656. The Number of Fragment Blocks in a the data portion of an
  2657. internet fragment. That is, the length of a portion of data
  2658. measured in 8 octet units.
  2659.  
  2660.  
  2661.  
  2662. [Page 42]
  2663.  
  2664. September 1981
  2665. Internet Protocol
  2666. Glossary
  2667.  
  2668.  
  2669.  
  2670. octet
  2671. An eight bit byte.
  2672.  
  2673. Options
  2674. The internet header Options field may contain several options,
  2675. and each option may be several octets in length.
  2676.  
  2677. Padding
  2678. The internet header Padding field is used to ensure that the
  2679. data begins on 32 bit word boundary. The padding is zero.
  2680.  
  2681. Protocol
  2682. In this document, the next higher level protocol identifier,
  2683. an internet header field.
  2684.  
  2685. Rest
  2686. The local address portion of an Internet Address.
  2687.  
  2688. Source
  2689. The source address, an internet header field.
  2690.  
  2691. TCP
  2692. Transmission Control Protocol: A host-to-host protocol for
  2693. reliable communication in internet environments.
  2694.  
  2695. TCP Segment
  2696. The unit of data exchanged between TCP modules (including the
  2697. TCP header).
  2698.  
  2699. TFTP
  2700. Trivial File Transfer Protocol: A simple file transfer
  2701. protocol built on UDP.
  2702.  
  2703. Time to Live
  2704. An internet header field which indicates the upper bound on
  2705. how long this internet datagram may exist.
  2706.  
  2707. TOS
  2708. Type of Service
  2709.  
  2710. Total Length
  2711. The internet header field Total Length is the length of the
  2712. datagram in octets including internet header and data.
  2713.  
  2714. TTL
  2715. Time to Live
  2716.  
  2717.  
  2718.  
  2719.  
  2720. [Page 43]
  2721.  
  2722. September 1981
  2723. Internet Protocol
  2724. Glossary
  2725.  
  2726.  
  2727.  
  2728. Type of Service
  2729. An internet header field which indicates the type (or quality)
  2730. of service for this internet datagram.
  2731.  
  2732. UDP
  2733. User Datagram Protocol: A user level protocol for transaction
  2734. oriented applications.
  2735.  
  2736. User
  2737. The user of the internet protocol. This may be a higher level
  2738. protocol module, an application program, or a gateway program.
  2739.  
  2740. Version
  2741. The Version field indicates the format of the internet header.
  2742.  
  2743.  
  2744.  
  2745.  
  2746.  
  2747.  
  2748.  
  2749.  
  2750.  
  2751.  
  2752.  
  2753.  
  2754.  
  2755.  
  2756.  
  2757.  
  2758.  
  2759.  
  2760.  
  2761.  
  2762.  
  2763.  
  2764.  
  2765.  
  2766.  
  2767.  
  2768.  
  2769.  
  2770.  
  2771.  
  2772.  
  2773.  
  2774.  
  2775.  
  2776.  
  2777.  
  2778. [Page 44]
  2779.  
  2780. September 1981
  2781. Internet Protocol
  2782.  
  2783.  
  2784.  
  2785. REFERENCES
  2786.  
  2787.  
  2788.  
  2789. [1] Cerf, V., "The Catenet Model for Internetworking," Information
  2790. Processing Techniques Office, Defense Advanced Research Projects
  2791. Agency, IEN 48, July 1978.
  2792.  
  2793. [2] Bolt Beranek and Newman, "Specification for the Interconnection of
  2794. a Host and an IMP," BBN Technical Report 1822, Revised May 1978.
  2795.  
  2796. [3] Postel, J., "Internet Control Message Protocol - DARPA Internet
  2797. Program Protocol Specification," RFC 792, USC/Information Sciences
  2798. Institute, September 1981.
  2799.  
  2800. [4] Shoch, J., "Inter-Network Naming, Addressing, and Routing,"
  2801. COMPCON, IEEE Computer Society, Fall 1978.
  2802.  
  2803. [5] Postel, J., "Address Mappings," RFC 796, USC/Information Sciences
  2804. Institute, September 1981.
  2805.  
  2806. [6] Shoch, J., "Packet Fragmentation in Inter-Network Protocols,"
  2807. Computer Networks, v. 3, n. 1, February 1979.
  2808.  
  2809. [7] Strazisar, V., "How to Build a Gateway", IEN 109, Bolt Beranek and
  2810. Newman, August 1979.
  2811.  
  2812. [8] Postel, J., "Service Mappings," RFC 795, USC/Information Sciences
  2813. Institute, September 1981.
  2814.  
  2815. [9] Postel, J., "Assigned Numbers," RFC 790, USC/Information Sciences
  2816. Institute, September 1981.
  2817.  
  2818.  
  2819.  
  2820.  
  2821.  
  2822.  
  2823.  
  2824.  
  2825.  
  2826.  
  2827.  
  2828.  
  2829.  
  2830.  
  2831.  
  2832.  
  2833.  
  2834.  
  2835.  
  2836. [Page 45]
Advertisement
Add Comment
Please, Sign In to add comment
Advertisement