14 DARPA INTERNET PROGRAM
16 PROTOCOL SPECIFICATION
36 Defense Advanced Research Projects Agency
37 Information Processing Techniques Office
39 Arlington, Virginia 22209
49 Information Sciences Institute
50 University of Southern California
52 Marina del Rey, California 90291
63 PREFACE ........................................................ iii
65 1. INTRODUCTION ..................................................... 1
67 1.1 Motivation .................................................... 1
68 1.2 Scope ......................................................... 1
69 1.3 Interfaces .................................................... 1
70 1.4 Operation ..................................................... 2
72 2. OVERVIEW ......................................................... 5
74 2.1 Relation to Other Protocols ................................... 9
75 2.2 Model of Operation ............................................ 5
76 2.3 Function Description .......................................... 7
77 2.4 Gateways ...................................................... 9
79 3. SPECIFICATION ................................................... 11
81 3.1 Internet Header Format ....................................... 11
82 3.2 Discussion ................................................... 23
83 3.3 Interfaces ................................................... 31
85 APPENDIX A: Examples & Scenarios ................................... 34
86 APPENDIX B: Data Transmission Order ................................ 39
88 GLOSSARY ............................................................ 41
90 REFERENCES .......................................................... 45
183 This document specifies the DoD Standard Internet Protocol. This
184 document is based on six earlier editions of the ARPA Internet Protocol
185 Specification, and the present text draws heavily from them. There have
186 been many contributors to this work both in terms of concepts and in
187 terms of text. This edition revises aspects of addressing, error
188 handling, option codes, and the security, precedence, compartments, and
189 handling restriction features of the internet protocol.
240 80, 54, 44, 41, 28, 26
244 DARPA INTERNET PROGRAM
245 PROTOCOL SPECIFICATION
253 The Internet Protocol is designed for use in interconnected systems of
254 packet-switched computer communication networks. Such a system has
255 been called a "catenet" [1]. The internet protocol provides for
256 transmitting blocks of data called datagrams from sources to
257 destinations, where sources and destinations are hosts identified by
258 fixed length addresses. The internet protocol also provides for
259 fragmentation and reassembly of long datagrams, if necessary, for
260 transmission through "small packet" networks.
264 The internet protocol is specifically limited in scope to provide the
265 functions necessary to deliver a package of bits (an internet
266 datagram) from a source to a destination over an interconnected system
267 of networks. There are no mechanisms to augment end-to-end data
268 reliability, flow control, sequencing, or other services commonly
269 found in host-to-host protocols. The internet protocol can capitalize
270 on the services of its supporting networks to provide various types
271 and qualities of service.
275 This protocol is called on by host-to-host protocols in an internet
276 environment. This protocol calls on local network protocols to carry
277 the internet datagram to the next gateway or destination host.
279 For example, a TCP module would call on the internet module to take a
280 TCP segment (including the TCP header and user data) as the data
281 portion of an internet datagram. The TCP module would provide the
282 addresses and other parameters in the internet header to the internet
283 module as arguments of the call. The internet module would then
284 create an internet datagram and call on the local network interface to
285 transmit the internet datagram.
287 In the ARPANET case, for example, the internet module would call on a
299 local net module which would add the 1822 leader [2] to the internet
300 datagram creating an ARPANET message to transmit to the IMP. The
301 ARPANET address would be derived from the internet address by the
302 local network interface and would be the address of some host in the
303 ARPANET, that host might be a gateway to other networks.
307 The internet protocol implements two basic functions: addressing and
310 The internet modules use the addresses carried in the internet header
311 to transmit internet datagrams toward their destinations. The
312 selection of a path for transmission is called routing.
314 The internet modules use fields in the internet header to fragment and
315 reassemble internet datagrams when necessary for transmission through
316 "small packet" networks.
318 The model of operation is that an internet module resides in each host
319 engaged in internet communication and in each gateway that
320 interconnects networks. These modules share common rules for
321 interpreting address fields and for fragmenting and assembling
322 internet datagrams. In addition, these modules (especially in
323 gateways) have procedures for making routing decisions and other
326 The internet protocol treats each internet datagram as an independent
327 entity unrelated to any other internet datagram. There are no
328 connections or logical circuits (virtual or otherwise).
330 The internet protocol uses four key mechanisms in providing its
331 service: Type of Service, Time to Live, Options, and Header Checksum.
333 The Type of Service is used to indicate the quality of the service
334 desired. The type of service is an abstract or generalized set of
335 parameters which characterize the service choices provided in the
336 networks that make up the internet. This type of service indication
337 is to be used by gateways to select the actual transmission parameters
338 for a particular network, the network to be used for the next hop, or
339 the next gateway when routing an internet datagram.
341 The Time to Live is an indication of an upper bound on the lifetime of
342 an internet datagram. It is set by the sender of the datagram and
343 reduced at the points along the route where it is processed. If the
344 time to live reaches zero before the internet datagram reaches its
345 destination, the internet datagram is destroyed. The time to live can
346 be thought of as a self destruct time limit.
358 The Options provide for control functions needed or useful in some
359 situations but unnecessary for the most common communications. The
360 options include provisions for timestamps, security, and special
363 The Header Checksum provides a verification that the information used
364 in processing internet datagram has been transmitted correctly. The
365 data may contain errors. If the header checksum fails, the internet
366 datagram is discarded at once by the entity which detects the error.
368 The internet protocol does not provide a reliable communication
369 facility. There are no acknowledgments either end-to-end or
370 hop-by-hop. There is no error control for data, only a header
371 checksum. There are no retransmissions. There is no flow control.
373 Errors detected may be reported via the Internet Control Message
374 Protocol (ICMP) [3] which is implemented in the internet protocol
477 2.1. Relation to Other Protocols
479 The following diagram illustrates the place of the internet protocol
480 in the protocol hierarchy:
483 +------+ +-----+ +-----+ +-----+
484 |Telnet| | FTP | | TFTP| ... | ... |
485 +------+ +-----+ +-----+ +-----+
487 +-----+ +-----+ +-----+
488 | TCP | | UDP | ... | ... |
489 +-----+ +-----+ +-----+
491 +--------------------------+----+
492 | Internet Protocol & ICMP |
493 +--------------------------+----+
495 +---------------------------+
496 | Local Network Protocol |
497 +---------------------------+
499 Protocol Relationships
503 Internet protocol interfaces on one side to the higher level
504 host-to-host protocols and on the other side to the local network
505 protocol. In this context a "local network" may be a small network in
506 a building or a large network such as the ARPANET.
508 2.2. Model of Operation
510 The model of operation for transmitting a datagram from one
511 application program to another is illustrated by the following
514 We suppose that this transmission will involve one intermediate
517 The sending application program prepares its data and calls on its
518 local internet module to send that data as a datagram and passes the
519 destination address and other parameters as arguments of the call.
521 The internet module prepares a datagram header and attaches the data
522 to it. The internet module determines a local network address for
523 this internet address, in this case it is the address of a gateway.
535 It sends this datagram and the local network address to the local
538 The local network interface creates a local network header, and
539 attaches the datagram to it, then sends the result via the local
542 The datagram arrives at a gateway host wrapped in the local network
543 header, the local network interface strips off this header, and
544 turns the datagram over to the internet module. The internet module
545 determines from the internet address that the datagram is to be
546 forwarded to another host in a second network. The internet module
547 determines a local net address for the destination host. It calls
548 on the local network interface for that network to send the
551 This local network interface creates a local network header and
552 attaches the datagram sending the result to the destination host.
554 At this destination host the datagram is stripped of the local net
555 header by the local network interface and handed to the internet
558 The internet module determines that the datagram is for an
559 application program in this host. It passes the data to the
560 application program in response to a system call, passing the source
561 address and other parameters as results of the call.
564 Application Application
567 Internet Module Internet Module Internet Module
569 LNI-1 LNI-1 LNI-2 LNI-2
571 Local Network 1 Local Network 2
594 2.3. Function Description
596 The function or purpose of Internet Protocol is to move datagrams
597 through an interconnected set of networks. This is done by passing
598 the datagrams from one internet module to another until the
599 destination is reached. The internet modules reside in hosts and
600 gateways in the internet system. The datagrams are routed from one
601 internet module to another through individual networks based on the
602 interpretation of an internet address. Thus, one important mechanism
603 of the internet protocol is the internet address.
605 In the routing of messages from one internet module to another,
606 datagrams may need to traverse a network whose maximum packet size is
607 smaller than the size of the datagram. To overcome this difficulty, a
608 fragmentation mechanism is provided in the internet protocol.
612 A distinction is made between names, addresses, and routes [4]. A
613 name indicates what we seek. An address indicates where it is. A
614 route indicates how to get there. The internet protocol deals
615 primarily with addresses. It is the task of higher level (i.e.,
616 host-to-host or application) protocols to make the mapping from
617 names to addresses. The internet module maps internet addresses to
618 local net addresses. It is the task of lower level (i.e., local net
619 or gateways) procedures to make the mapping from local net addresses
622 Addresses are fixed length of four octets (32 bits). An address
623 begins with a network number, followed by local address (called the
624 "rest" field). There are three formats or classes of internet
625 addresses: in class a, the high order bit is zero, the next 7 bits
626 are the network, and the last 24 bits are the local address; in
627 class b, the high order two bits are one-zero, the next 14 bits are
628 the network and the last 16 bits are the local address; in class c,
629 the high order three bits are one-one-zero, the next 21 bits are the
630 network and the last 8 bits are the local address.
632 Care must be taken in mapping internet addresses to local net
633 addresses; a single physical host must be able to act as if it were
634 several distinct hosts to the extent of using several distinct
635 internet addresses. Some hosts will also have several physical
636 interfaces (multi-homing).
638 That is, provision must be made for a host to have several physical
639 interfaces to the network with each having several logical internet
653 Examples of address mappings may be found in "Address Mappings" [5].
657 Fragmentation of an internet datagram is necessary when it
658 originates in a local net that allows a large packet size and must
659 traverse a local net that limits packets to a smaller size to reach
662 An internet datagram can be marked "don't fragment." Any internet
663 datagram so marked is not to be internet fragmented under any
664 circumstances. If internet datagram marked don't fragment cannot be
665 delivered to its destination without fragmenting it, it is to be
668 Fragmentation, transmission and reassembly across a local network
669 which is invisible to the internet protocol module is called
670 intranet fragmentation and may be used [6].
672 The internet fragmentation and reassembly procedure needs to be able
673 to break a datagram into an almost arbitrary number of pieces that
674 can be later reassembled. The receiver of the fragments uses the
675 identification field to ensure that fragments of different datagrams
676 are not mixed. The fragment offset field tells the receiver the
677 position of a fragment in the original datagram. The fragment
678 offset and length determine the portion of the original datagram
679 covered by this fragment. The more-fragments flag indicates (by
680 being reset) the last fragment. These fields provide sufficient
681 information to reassemble datagrams.
683 The identification field is used to distinguish the fragments of one
684 datagram from those of another. The originating protocol module of
685 an internet datagram sets the identification field to a value that
686 must be unique for that source-destination pair and protocol for the
687 time the datagram will be active in the internet system. The
688 originating protocol module of a complete datagram sets the
689 more-fragments flag to zero and the fragment offset to zero.
691 To fragment a long internet datagram, an internet protocol module
692 (for example, in a gateway), creates two new internet datagrams and
693 copies the contents of the internet header fields from the long
694 datagram into both new internet headers. The data of the long
695 datagram is divided into two portions on a 8 octet (64 bit) boundary
696 (the second portion might not be an integral multiple of 8 octets,
697 but the first must be). Call the number of 8 octet blocks in the
698 first portion NFB (for Number of Fragment Blocks). The first
699 portion of the data is placed in the first new internet datagram,
700 and the total length field is set to the length of the first
712 datagram. The more-fragments flag is set to one. The second
713 portion of the data is placed in the second new internet datagram,
714 and the total length field is set to the length of the second
715 datagram. The more-fragments flag carries the same value as the
716 long datagram. The fragment offset field of the second new internet
717 datagram is set to the value of that field in the long datagram plus
720 This procedure can be generalized for an n-way split, rather than
721 the two-way split described.
723 To assemble the fragments of an internet datagram, an internet
724 protocol module (for example at a destination host) combines
725 internet datagrams that all have the same value for the four fields:
726 identification, source, destination, and protocol. The combination
727 is done by placing the data portion of each fragment in the relative
728 position indicated by the fragment offset in that fragment's
729 internet header. The first fragment will have the fragment offset
730 zero, and the last fragment will have the more-fragments flag reset
735 Gateways implement internet protocol to forward datagrams between
736 networks. Gateways also implement the Gateway to Gateway Protocol
737 (GGP) [7] to coordinate routing and other internet control
740 In a gateway the higher level protocols need not be implemented and
741 the GGP functions are added to the IP module.
744 +-------------------------------+
745 | Internet Protocol & ICMP & GGP|
746 +-------------------------------+
748 +---------------+ +---------------+
749 | Local Net | | Local Net |
750 +---------------+ +---------------+
831 3.1. Internet Header Format
833 A summary of the contents of the internet header follows:
837 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
838 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
839 |Version| IHL |Type of Service| Total Length |
840 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
841 | Identification |Flags| Fragment Offset |
842 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
843 | Time to Live | Protocol | Header Checksum |
844 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
846 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
847 | Destination Address |
848 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
849 | Options | Padding |
850 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
852 Example Internet Datagram Header
856 Note that each tick mark represents one bit position.
860 The Version field indicates the format of the internet header. This
861 document describes version 4.
865 Internet Header Length is the length of the internet header in 32
866 bit words, and thus points to the beginning of the data. Note that
867 the minimum value for a correct header is 5.
889 Type of Service: 8 bits
891 The Type of Service provides an indication of the abstract
892 parameters of the quality of service desired. These parameters are
893 to be used to guide the selection of the actual service parameters
894 when transmitting a datagram through a particular network. Several
895 networks offer service precedence, which somehow treats high
896 precedence traffic as more important than other traffic (generally
897 by accepting only traffic above a certain precedence at time of high
898 load). The major choice is a three way tradeoff between low-delay,
899 high-reliability, and high-throughput.
901 Bits 0-2: Precedence.
902 Bit 3: 0 = Normal Delay, 1 = Low Delay.
903 Bits 4: 0 = Normal Throughput, 1 = High Throughput.
904 Bits 5: 0 = Normal Relibility, 1 = High Relibility.
905 Bit 6-7: Reserved for Future Use.
908 +-----+-----+-----+-----+-----+-----+-----+-----+
910 | PRECEDENCE | D | T | R | 0 | 0 |
912 +-----+-----+-----+-----+-----+-----+-----+-----+
916 111 - Network Control
917 110 - Internetwork Control
925 The use of the Delay, Throughput, and Reliability indications may
926 increase the cost (in some sense) of the service. In many networks
927 better performance for one of these parameters is coupled with worse
928 performance on another. Except for very unusual cases at most two
929 of these three indications should be set.
931 The type of service is used to specify the treatment of the datagram
932 during its transmission through the internet system. Example
933 mappings of the internet type of service to the actual service
934 provided on networks such as AUTODIN II, ARPANET, SATNET, and PRNET
935 is given in "Service Mappings" [8].
948 The Network Control precedence designation is intended to be used
949 within a network only. The actual use and control of that
950 designation is up to each network. The Internetwork Control
951 designation is intended for use by gateway control originators only.
952 If the actual use of these precedence designations is of concern to
953 a particular network, it is the responsibility of that network to
954 control the access to, and use of, those precedence designations.
956 Total Length: 16 bits
958 Total Length is the length of the datagram, measured in octets,
959 including internet header and data. This field allows the length of
960 a datagram to be up to 65,535 octets. Such long datagrams are
961 impractical for most hosts and networks. All hosts must be prepared
962 to accept datagrams of up to 576 octets (whether they arrive whole
963 or in fragments). It is recommended that hosts only send datagrams
964 larger than 576 octets if they have assurance that the destination
965 is prepared to accept the larger datagrams.
967 The number 576 is selected to allow a reasonable sized data block to
968 be transmitted in addition to the required header information. For
969 example, this size allows a data block of 512 octets plus 64 header
970 octets to fit in a datagram. The maximal internet header is 60
971 octets, and a typical internet header is 20 octets, allowing a
972 margin for headers of higher level protocols.
974 Identification: 16 bits
976 An identifying value assigned by the sender to aid in assembling the
977 fragments of a datagram.
981 Various Control Flags.
983 Bit 0: reserved, must be zero
984 Bit 1: (DF) 0 = May Fragment, 1 = Don't Fragment.
985 Bit 2: (MF) 0 = Last Fragment, 1 = More Fragments.
993 Fragment Offset: 13 bits
995 This field indicates where in the datagram this fragment belongs.
1007 The fragment offset is measured in units of 8 octets (64 bits). The
1008 first fragment has offset zero.
1010 Time to Live: 8 bits
1012 This field indicates the maximum time the datagram is allowed to
1013 remain in the internet system. If this field contains the value
1014 zero, then the datagram must be destroyed. This field is modified
1015 in internet header processing. The time is measured in units of
1016 seconds, but since every module that processes a datagram must
1017 decrease the TTL by at least one even if it process the datagram in
1018 less than a second, the TTL must be thought of only as an upper
1019 bound on the time a datagram may exist. The intention is to cause
1020 undeliverable datagrams to be discarded, and to bound the maximum
1025 This field indicates the next level protocol used in the data
1026 portion of the internet datagram. The values for various protocols
1027 are specified in "Assigned Numbers" [9].
1029 Header Checksum: 16 bits
1031 A checksum on the header only. Since some header fields change
1032 (e.g., time to live), this is recomputed and verified at each point
1033 that the internet header is processed.
1035 The checksum algorithm is:
1037 The checksum field is the 16 bit one's complement of the one's
1038 complement sum of all 16 bit words in the header. For purposes of
1039 computing the checksum, the value of the checksum field is zero.
1041 This is a simple to compute checksum and experimental evidence
1042 indicates it is adequate, but it is provisional and may be replaced
1043 by a CRC procedure, depending on further experience.
1045 Source Address: 32 bits
1047 The source address. See section 3.2.
1049 Destination Address: 32 bits
1051 The destination address. See section 3.2.
1068 The options may appear or not in datagrams. They must be
1069 implemented by all IP modules (host and gateways). What is optional
1070 is their transmission in any particular datagram, not their
1073 In some environments the security option may be required in all
1076 The option field is variable in length. There may be zero or more
1077 options. There are two cases for the format of an option:
1079 Case 1: A single octet of option-type.
1081 Case 2: An option-type octet, an option-length octet, and the
1082 actual option-data octets.
1084 The option-length octet counts the option-type octet and the
1085 option-length octet as well as the option-data octets.
1087 The option-type octet is viewed as having 3 fields:
1090 2 bits option class,
1091 5 bits option number.
1093 The copied flag indicates that this option is copied into all
1094 fragments on fragmentation.
1099 The option classes are:
1102 1 = reserved for future use
1103 2 = debugging and measurement
1104 3 = reserved for future use
1125 The following internet options are defined:
1127 CLASS NUMBER LENGTH DESCRIPTION
1128 ----- ------ ------ -----------
1129 0 0 - End of Option list. This option occupies only
1130 1 octet; it has no length octet.
1131 0 1 - No Operation. This option occupies only 1
1132 octet; it has no length octet.
1133 0 2 11 Security. Used to carry Security,
1134 Compartmentation, User Group (TCC), and
1135 Handling Restriction Codes compatible with DOD
1137 0 3 var. Loose Source Routing. Used to route the
1138 internet datagram based on information
1139 supplied by the source.
1140 0 9 var. Strict Source Routing. Used to route the
1141 internet datagram based on information
1142 supplied by the source.
1143 0 7 var. Record Route. Used to trace the route an
1144 internet datagram takes.
1145 0 8 4 Stream ID. Used to carry the stream
1147 2 4 var. Internet Timestamp.
1151 Specific Option Definitions
1160 This option indicates the end of the option list. This might
1161 not coincide with the end of the internet header according to
1162 the internet header length. This is used at the end of all
1163 options, not the end of each option, and need only be used if
1164 the end of the options would not otherwise coincide with the end
1165 of the internet header.
1167 May be copied, introduced, or deleted on fragmentation, or for
1191 This option may be used between options, for example, to align
1192 the beginning of a subsequent option on a 32 bit boundary.
1194 May be copied, introduced, or deleted on fragmentation, or for
1199 This option provides a way for hosts to send security,
1200 compartmentation, handling restrictions, and TCC (closed user
1201 group) parameters. The format for this option is as follows:
1203 +--------+--------+---//---+---//---+---//---+---//---+
1204 |10000010|00001011|SSS SSS|CCC CCC|HHH HHH| TCC |
1205 +--------+--------+---//---+---//---+---//---+---//---+
1208 Security (S field): 16 bits
1210 Specifies one of 16 levels of security (eight of which are
1211 reserved for future use).
1213 00000000 00000000 - Unclassified
1214 11110001 00110101 - Confidential
1215 01111000 10011010 - EFTO
1216 10111100 01001101 - MMMM
1217 01011110 00100110 - PROG
1218 10101111 00010011 - Restricted
1219 11010111 10001000 - Secret
1220 01101011 11000101 - Top Secret
1221 00110101 11100010 - (Reserved for future use)
1222 10011010 11110001 - (Reserved for future use)
1223 01001101 01111000 - (Reserved for future use)
1224 00100100 10111101 - (Reserved for future use)
1225 00010011 01011110 - (Reserved for future use)
1226 10001001 10101111 - (Reserved for future use)
1227 11000100 11010110 - (Reserved for future use)
1228 11100010 01101011 - (Reserved for future use)
1243 Compartments (C field): 16 bits
1245 An all zero value is used when the information transmitted is
1246 not compartmented. Other values for the compartments field
1247 may be obtained from the Defense Intelligence Agency.
1249 Handling Restrictions (H field): 16 bits
1251 The values for the control and release markings are
1252 alphanumeric digraphs and are defined in the Defense
1253 Intelligence Agency Manual DIAM 65-19, "Standard Security
1256 Transmission Control Code (TCC field): 24 bits
1258 Provides a means to segregate traffic and define controlled
1259 communities of interest among subscribers. The TCC values are
1260 trigraphs, and are available from HQ DCA Code 530.
1262 Must be copied on fragmentation. This option appears at most
1265 Loose Source and Record Route
1267 +--------+--------+--------+---------//--------+
1268 |10000011| length | pointer| route data |
1269 +--------+--------+--------+---------//--------+
1272 The loose source and record route (LSRR) option provides a means
1273 for the source of an internet datagram to supply routing
1274 information to be used by the gateways in forwarding the
1275 datagram to the destination, and to record the route
1278 The option begins with the option type code. The second octet
1279 is the option length which includes the option type code and the
1280 length octet, the pointer octet, and length-3 octets of route
1281 data. The third octet is the pointer into the route data
1282 indicating the octet which begins the next source address to be
1283 processed. The pointer is relative to this option, and the
1284 smallest legal value for the pointer is 4.
1286 A route data is composed of a series of internet addresses.
1287 Each internet address is 32 bits or 4 octets. If the pointer is
1288 greater than the length, the source route is empty (and the
1289 recorded route full) and the routing is to be based on the
1290 destination address field.
1302 If the address in destination address field has been reached and
1303 the pointer is not greater than the length, the next address in
1304 the source route replaces the address in the destination address
1305 field, and the recorded route address replaces the source
1306 address just used, and pointer is increased by four.
1308 The recorded route address is the internet module's own internet
1309 address as known in the environment into which this datagram is
1312 This procedure of replacing the source route with the recorded
1313 route (though it is in the reverse of the order it must be in to
1314 be used as a source route) means the option (and the IP header
1315 as a whole) remains a constant length as the datagram progresses
1316 through the internet.
1318 This option is a loose source route because the gateway or host
1319 IP is allowed to use any route of any number of other
1320 intermediate gateways to reach the next address in the route.
1322 Must be copied on fragmentation. Appears at most once in a
1325 Strict Source and Record Route
1327 +--------+--------+--------+---------//--------+
1328 |10001001| length | pointer| route data |
1329 +--------+--------+--------+---------//--------+
1332 The strict source and record route (SSRR) option provides a
1333 means for the source of an internet datagram to supply routing
1334 information to be used by the gateways in forwarding the
1335 datagram to the destination, and to record the route
1338 The option begins with the option type code. The second octet
1339 is the option length which includes the option type code and the
1340 length octet, the pointer octet, and length-3 octets of route
1341 data. The third octet is the pointer into the route data
1342 indicating the octet which begins the next source address to be
1343 processed. The pointer is relative to this option, and the
1344 smallest legal value for the pointer is 4.
1346 A route data is composed of a series of internet addresses.
1347 Each internet address is 32 bits or 4 octets. If the pointer is
1348 greater than the length, the source route is empty (and the
1361 recorded route full) and the routing is to be based on the
1362 destination address field.
1364 If the address in destination address field has been reached and
1365 the pointer is not greater than the length, the next address in
1366 the source route replaces the address in the destination address
1367 field, and the recorded route address replaces the source
1368 address just used, and pointer is increased by four.
1370 The recorded route address is the internet module's own internet
1371 address as known in the environment into which this datagram is
1374 This procedure of replacing the source route with the recorded
1375 route (though it is in the reverse of the order it must be in to
1376 be used as a source route) means the option (and the IP header
1377 as a whole) remains a constant length as the datagram progresses
1378 through the internet.
1380 This option is a strict source route because the gateway or host
1381 IP must send the datagram directly to the next address in the
1382 source route through only the directly connected network
1383 indicated in the next address to reach the next gateway or host
1384 specified in the route.
1386 Must be copied on fragmentation. Appears at most once in a
1391 +--------+--------+--------+---------//--------+
1392 |00000111| length | pointer| route data |
1393 +--------+--------+--------+---------//--------+
1396 The record route option provides a means to record the route of
1397 an internet datagram.
1399 The option begins with the option type code. The second octet
1400 is the option length which includes the option type code and the
1401 length octet, the pointer octet, and length-3 octets of route
1402 data. The third octet is the pointer into the route data
1403 indicating the octet which begins the next area to store a route
1404 address. The pointer is relative to this option, and the
1405 smallest legal value for the pointer is 4.
1407 A recorded route is composed of a series of internet addresses.
1408 Each internet address is 32 bits or 4 octets. If the pointer is
1420 greater than the length, the recorded route data area is full.
1421 The originating host must compose this option with a large
1422 enough route data area to hold all the address expected. The
1423 size of the option does not change due to adding addresses. The
1424 intitial contents of the route data area must be zero.
1426 When an internet module routes a datagram it checks to see if
1427 the record route option is present. If it is, it inserts its
1428 own internet address as known in the environment into which this
1429 datagram is being forwarded into the recorded route begining at
1430 the octet indicated by the pointer, and increments the pointer
1433 If the route data area is already full (the pointer exceeds the
1434 length) the datagram is forwarded without inserting the address
1435 into the recorded route. If there is some room but not enough
1436 room for a full address to be inserted, the original datagram is
1437 considered to be in error and is discarded. In either case an
1438 ICMP parameter problem message may be sent to the source
1441 Not copied on fragmentation, goes in first fragment only.
1442 Appears at most once in a datagram.
1446 +--------+--------+--------+--------+
1447 |10001000|00000010| Stream ID |
1448 +--------+--------+--------+--------+
1451 This option provides a way for the 16-bit SATNET stream
1452 identifier to be carried through networks that do not support
1455 Must be copied on fragmentation. Appears at most once in a
1481 +--------+--------+--------+--------+
1482 |01000100| length | pointer|oflw|flg|
1483 +--------+--------+--------+--------+
1484 | internet address |
1485 +--------+--------+--------+--------+
1487 +--------+--------+--------+--------+
1493 The Option Length is the number of octets in the option counting
1494 the type, length, pointer, and overflow/flag octets (maximum
1497 The Pointer is the number of octets from the beginning of this
1498 option to the end of timestamps plus one (i.e., it points to the
1499 octet beginning the space for next timestamp). The smallest
1500 legal value is 5. The timestamp area is full when the pointer
1501 is greater than the length.
1503 The Overflow (oflw) [4 bits] is the number of IP modules that
1504 cannot register timestamps due to lack of space.
1506 The Flag (flg) [4 bits] values are
1508 0 -- time stamps only, stored in consecutive 32-bit words,
1510 1 -- each timestamp is preceded with internet address of the
1513 3 -- the internet address fields are prespecified. An IP
1514 module only registers its timestamp if it matches its own
1515 address with the next specified internet address.
1517 The Timestamp is a right-justified, 32-bit timestamp in
1518 milliseconds since midnight UT. If the time is not available in
1519 milliseconds or cannot be provided with respect to midnight UT
1520 then any time may be inserted as a timestamp provided the high
1521 order bit of the timestamp field is set to one to indicate the
1522 use of a non-standard value.
1524 The originating host must compose this option with a large
1525 enough timestamp data area to hold all the timestamp information
1526 expected. The size of the option does not change due to adding
1538 timestamps. The intitial contents of the timestamp data area
1539 must be zero or internet address/zero pairs.
1541 If the timestamp data area is already full (the pointer exceeds
1542 the length) the datagram is forwarded without inserting the
1543 timestamp, but the overflow count is incremented by one.
1545 If there is some room but not enough room for a full timestamp
1546 to be inserted, or the overflow count itself overflows, the
1547 original datagram is considered to be in error and is discarded.
1548 In either case an ICMP parameter problem message may be sent to
1549 the source host [3].
1551 The timestamp option is not copied upon fragmentation. It is
1552 carried in the first fragment. Appears at most once in a
1557 The internet header padding is used to ensure that the internet
1558 header ends on a 32 bit boundary. The padding is zero.
1562 The implementation of a protocol must be robust. Each implementation
1563 must expect to interoperate with others created by different
1564 individuals. While the goal of this specification is to be explicit
1565 about the protocol there is the possibility of differing
1566 interpretations. In general, an implementation must be conservative
1567 in its sending behavior, and liberal in its receiving behavior. That
1568 is, it must be careful to send well-formed datagrams, but must accept
1569 any datagram that it can interpret (e.g., not object to technical
1570 errors where the meaning is still clear).
1572 The basic internet service is datagram oriented and provides for the
1573 fragmentation of datagrams at gateways, with reassembly taking place
1574 at the destination internet protocol module in the destination host.
1575 Of course, fragmentation and reassembly of datagrams within a network
1576 or by private agreement between the gateways of a network is also
1577 allowed since this is transparent to the internet protocols and the
1578 higher-level protocols. This transparent type of fragmentation and
1579 reassembly is termed "network-dependent" (or intranet) fragmentation
1580 and is not discussed further here.
1582 Internet addresses distinguish sources and destinations to the host
1583 level and provide a protocol field as well. It is assumed that each
1584 protocol will provide for whatever multiplexing is necessary within a
1599 To provide for flexibility in assigning address to networks and
1600 allow for the large number of small to intermediate sized networks
1601 the interpretation of the address field is coded to specify a small
1602 number of networks with a large number of host, a moderate number of
1603 networks with a moderate number of hosts, and a large number of
1604 networks with a small number of hosts. In addition there is an
1605 escape code for extended addressing mode.
1609 High Order Bits Format Class
1610 --------------- ------------------------------- -----
1611 0 7 bits of net, 24 bits of host a
1612 10 14 bits of net, 16 bits of host b
1613 110 21 bits of net, 8 bits of host c
1614 111 escape to extended addressing mode
1616 A value of zero in the network field means this network. This is
1617 only used in certain ICMP messages. The extended addressing mode
1618 is undefined. Both of these features are reserved for future use.
1620 The actual values assigned for network addresses is given in
1621 "Assigned Numbers" [9].
1623 The local address, assigned by the local network, must allow for a
1624 single physical host to act as several distinct internet hosts.
1625 That is, there must be a mapping between internet host addresses and
1626 network/host interfaces that allows several internet addresses to
1627 correspond to one interface. It must also be allowed for a host to
1628 have several physical interfaces and to treat the datagrams from
1629 several of them as if they were all addressed to a single host.
1631 Address mappings between internet addresses and addresses for
1632 ARPANET, SATNET, PRNET, and other networks are described in "Address
1635 Fragmentation and Reassembly.
1637 The internet identification field (ID) is used together with the
1638 source and destination address, and the protocol fields, to identify
1639 datagram fragments for reassembly.
1641 The More Fragments flag bit (MF) is set if the datagram is not the
1642 last fragment. The Fragment Offset field identifies the fragment
1643 location, relative to the beginning of the original unfragmented
1644 datagram. Fragments are counted in units of 8 octets. The
1656 fragmentation strategy is designed so than an unfragmented datagram
1657 has all zero fragmentation information (MF = 0, fragment offset =
1658 0). If an internet datagram is fragmented, its data portion must be
1659 broken on 8 octet boundaries.
1661 This format allows 2**13 = 8192 fragments of 8 octets each for a
1662 total of 65,536 octets. Note that this is consistent with the the
1663 datagram total length field (of course, the header is counted in the
1664 total length and not in the fragments).
1666 When fragmentation occurs, some options are copied, but others
1667 remain with the first fragment only.
1669 Every internet module must be able to forward a datagram of 68
1670 octets without further fragmentation. This is because an internet
1671 header may be up to 60 octets, and the minimum fragment is 8 octets.
1673 Every internet destination must be able to receive a datagram of 576
1674 octets either in one piece or in fragments to be reassembled.
1676 The fields which may be affected by fragmentation include:
1679 (2) more fragments flag
1681 (4) internet header length field
1682 (5) total length field
1685 If the Don't Fragment flag (DF) bit is set, then internet
1686 fragmentation of this datagram is NOT permitted, although it may be
1687 discarded. This can be used to prohibit fragmentation in cases
1688 where the receiving host does not have sufficient resources to
1689 reassemble internet fragments.
1691 One example of use of the Don't Fragment feature is to down line
1692 load a small host. A small host could have a boot strap program
1693 that accepts a datagram stores it in memory and then executes it.
1695 The fragmentation and reassembly procedures are most easily
1696 described by examples. The following procedures are example
1699 General notation in the following pseudo programs: "=<" means "less
1700 than or equal", "#" means "not equal", "=" means "equal", "<-" means
1701 "is set to". Also, "x to y" includes x and excludes y; for example,
1702 "4 to 7" would include 4, 5, and 6 (but not 7).
1715 An Example Fragmentation Procedure
1717 The maximum sized datagram that can be transmitted through the
1718 next network is called the maximum transmission unit (MTU).
1720 If the total length is less than or equal the maximum transmission
1721 unit then submit this datagram to the next step in datagram
1722 processing; otherwise cut the datagram into two fragments, the
1723 first fragment being the maximum size, and the second fragment
1724 being the rest of the datagram. The first fragment is submitted
1725 to the next step in datagram processing, while the second fragment
1726 is submitted to this procedure in case it is still too large.
1730 FO - Fragment Offset
1731 IHL - Internet Header Length
1732 DF - Don't Fragment flag
1733 MF - More Fragments flag
1735 OFO - Old Fragment Offset
1736 OIHL - Old Internet Header Length
1737 OMF - Old More Fragments flag
1738 OTL - Old Total Length
1739 NFB - Number of Fragment Blocks
1740 MTU - Maximum Transmission Unit
1744 IF TL =< MTU THEN Submit this datagram to the next step
1745 in datagram processing ELSE IF DF = 1 THEN discard the
1747 To produce the first fragment:
1748 (1) Copy the original internet header;
1749 (2) OIHL <- IHL; OTL <- TL; OFO <- FO; OMF <- MF;
1750 (3) NFB <- (MTU-IHL*4)/8;
1751 (4) Attach the first NFB*8 data octets;
1752 (5) Correct the header:
1753 MF <- 1; TL <- (IHL*4)+(NFB*8);
1755 (6) Submit this fragment to the next step in
1756 datagram processing;
1757 To produce the second fragment:
1758 (7) Selectively copy the internet header (some options
1759 are not copied, see option definitions);
1760 (8) Append the remaining data;
1761 (9) Correct the header:
1762 IHL <- (((OIHL*4)-(length of options not copied))+3)/4;
1774 TL <- OTL - NFB*8 - (OIHL-IHL)*4);
1775 FO <- OFO + NFB; MF <- OMF; Recompute Checksum;
1776 (10) Submit this fragment to the fragmentation test; DONE.
1778 In the above procedure each fragment (except the last) was made
1779 the maximum allowable size. An alternative might produce less
1780 than the maximum size datagrams. For example, one could implement
1781 a fragmentation procedure that repeatly divided large datagrams in
1782 half until the resulting fragments were less than the maximum
1783 transmission unit size.
1785 An Example Reassembly Procedure
1787 For each datagram the buffer identifier is computed as the
1788 concatenation of the source, destination, protocol, and
1789 identification fields. If this is a whole datagram (that is both
1790 the fragment offset and the more fragments fields are zero), then
1791 any reassembly resources associated with this buffer identifier
1792 are released and the datagram is forwarded to the next step in
1793 datagram processing.
1795 If no other fragment with this buffer identifier is on hand then
1796 reassembly resources are allocated. The reassembly resources
1797 consist of a data buffer, a header buffer, a fragment block bit
1798 table, a total data length field, and a timer. The data from the
1799 fragment is placed in the data buffer according to its fragment
1800 offset and length, and bits are set in the fragment block bit
1801 table corresponding to the fragment blocks received.
1803 If this is the first fragment (that is the fragment offset is
1804 zero) this header is placed in the header buffer. If this is the
1805 last fragment ( that is the more fragments field is zero) the
1806 total data length is computed. If this fragment completes the
1807 datagram (tested by checking the bits set in the fragment block
1808 table), then the datagram is sent to the next step in datagram
1809 processing; otherwise the timer is set to the maximum of the
1810 current timer value and the value of the time to live field from
1811 this fragment; and the reassembly routine gives up control.
1813 If the timer runs out, the all reassembly resources for this
1814 buffer identifier are released. The initial setting of the timer
1815 is a lower bound on the reassembly waiting time. This is because
1816 the waiting time will be increased if the Time to Live in the
1817 arriving fragment is greater than the current timer value but will
1818 not be decreased if it is less. The maximum this timer value
1819 could reach is the maximum time to live (approximately 4.25
1820 minutes). The current recommendation for the initial timer
1821 setting is 15 seconds. This may be changed as experience with
1833 this protocol accumulates. Note that the choice of this parameter
1834 value is related to the buffer capacity available and the data
1835 rate of the transmission medium; that is, data rate times timer
1836 value equals buffer size (e.g., 10Kb/s X 15s = 150Kb).
1840 FO - Fragment Offset
1841 IHL - Internet Header Length
1842 MF - More Fragments flag
1844 NFB - Number of Fragment Blocks
1846 TDL - Total Data Length
1847 BUFID - Buffer Identifier
1848 RCVBT - Fragment Received Bit Table
1849 TLB - Timer Lower Bound
1853 (1) BUFID <- source|destination|protocol|identification;
1854 (2) IF FO = 0 AND MF = 0
1855 (3) THEN IF buffer with BUFID is allocated
1856 (4) THEN flush all reassembly for this BUFID;
1857 (5) Submit datagram to next step; DONE.
1858 (6) ELSE IF no buffer with BUFID is allocated
1859 (7) THEN allocate reassembly resources
1861 TIMER <- TLB; TDL <- 0;
1862 (8) put data from fragment into data buffer with
1863 BUFID from octet FO*8 to
1864 octet (TL-(IHL*4))+FO*8;
1865 (9) set RCVBT bits from FO
1866 to FO+((TL-(IHL*4)+7)/8);
1867 (10) IF MF = 0 THEN TDL <- TL-(IHL*4)+(FO*8)
1868 (11) IF FO = 0 THEN put header in header buffer
1870 (13) AND all RCVBT bits from 0
1871 to (TDL+7)/8 are set
1872 (14) THEN TL <- TDL+(IHL*4)
1873 (15) Submit datagram to next step;
1874 (16) free all reassembly resources
1875 for this BUFID; DONE.
1876 (17) TIMER <- MAX(TIMER,TTL);
1877 (18) give up until next fragment or timer expires;
1878 (19) timer expires: flush all reassembly with this BUFID; DONE.
1880 In the case that two or more fragments contain the same data
1892 either identically or through a partial overlap, this procedure
1893 will use the more recently arrived copy in the data buffer and
1898 The choice of the Identifier for a datagram is based on the need to
1899 provide a way to uniquely identify the fragments of a particular
1900 datagram. The protocol module assembling fragments judges fragments
1901 to belong to the same datagram if they have the same source,
1902 destination, protocol, and Identifier. Thus, the sender must choose
1903 the Identifier to be unique for this source, destination pair and
1904 protocol for the time the datagram (or any fragment of it) could be
1905 alive in the internet.
1907 It seems then that a sending protocol module needs to keep a table
1908 of Identifiers, one entry for each destination it has communicated
1909 with in the last maximum packet lifetime for the internet.
1911 However, since the Identifier field allows 65,536 different values,
1912 some host may be able to simply use unique identifiers independent
1915 It is appropriate for some higher level protocols to choose the
1916 identifier. For example, TCP protocol modules may retransmit an
1917 identical TCP segment, and the probability for correct reception
1918 would be enhanced if the retransmission carried the same identifier
1919 as the original transmission since fragments of either datagram
1920 could be used to construct a correct TCP segment.
1924 The type of service (TOS) is for internet service quality selection.
1925 The type of service is specified along the abstract parameters
1926 precedence, delay, throughput, and reliability. These abstract
1927 parameters are to be mapped into the actual service parameters of
1928 the particular networks the datagram traverses.
1930 Precedence. An independent measure of the importance of this
1933 Delay. Prompt delivery is important for datagrams with this
1936 Throughput. High data rate is important for datagrams with this
1951 Reliability. A higher level of effort to ensure delivery is
1952 important for datagrams with this indication.
1954 For example, the ARPANET has a priority bit, and a choice between
1955 "standard" messages (type 0) and "uncontrolled" messages (type 3),
1956 (the choice between single packet and multipacket messages can also
1957 be considered a service parameter). The uncontrolled messages tend
1958 to be less reliably delivered and suffer less delay. Suppose an
1959 internet datagram is to be sent through the ARPANET. Let the
1960 internet type of service be given as:
1967 In this example, the mapping of these parameters to those available
1968 for the ARPANET would be to set the ARPANET priority bit on since
1969 the Internet precedence is in the upper half of its range, to select
1970 standard messages since the throughput and reliability requirements
1971 are indicated and delay is not. More details are given on service
1972 mappings in "Service Mappings" [8].
1976 The time to live is set by the sender to the maximum time the
1977 datagram is allowed to be in the internet system. If the datagram
1978 is in the internet system longer than the time to live, then the
1979 datagram must be destroyed.
1981 This field must be decreased at each point that the internet header
1982 is processed to reflect the time spent processing the datagram.
1983 Even if no local information is available on the time actually
1984 spent, the field must be decremented by 1. The time is measured in
1985 units of seconds (i.e. the value 1 means one second). Thus, the
1986 maximum time to live is 255 seconds or 4.25 minutes. Since every
1987 module that processes a datagram must decrease the TTL by at least
1988 one even if it process the datagram in less than a second, the TTL
1989 must be thought of only as an upper bound on the time a datagram may
1990 exist. The intention is to cause undeliverable datagrams to be
1991 discarded, and to bound the maximum datagram lifetime.
1993 Some higher level reliable connection protocols are based on
1994 assumptions that old duplicate datagrams will not arrive after a
1995 certain time elapses. The TTL is a way for such protocols to have
1996 an assurance that their assumption is met.
2012 The options are optional in each datagram, but required in
2013 implementations. That is, the presence or absence of an option is
2014 the choice of the sender, but each internet module must be able to
2015 parse every option. There can be several options present in the
2018 The options might not end on a 32-bit boundary. The internet header
2019 must be filled out with octets of zeros. The first of these would
2020 be interpreted as the end-of-options option, and the remainder as
2021 internet header padding.
2023 Every internet module must be able to act on every option. The
2024 Security Option is required if classified, restricted, or
2025 compartmented traffic is to be passed.
2029 The internet header checksum is recomputed if the internet header is
2030 changed. For example, a reduction of the time to live, additions or
2031 changes to internet options, or due to fragmentation. This checksum
2032 at the internet level is intended to protect the internet header
2033 fields from transmission errors.
2035 There are some applications where a few data bit errors are
2036 acceptable while retransmission delays are not. If the internet
2037 protocol enforced data correctness such applications could not be
2042 Internet protocol errors may be reported via the ICMP messages [3].
2046 The functional description of user interfaces to the IP is, at best,
2047 fictional, since every operating system will have different
2048 facilities. Consequently, we must warn readers that different IP
2049 implementations may have different user interfaces. However, all IPs
2050 must provide a certain minimum set of services to guarantee that all
2051 IP implementations can support the same protocol hierarchy. This
2052 section specifies the functional interfaces required of all IP
2055 Internet protocol interfaces on one side to the local network and on
2056 the other side to either a higher level protocol or an application
2057 program. In the following, the higher level protocol or application
2069 program (or even a gateway program) will be called the "user" since it
2070 is using the internet module. Since internet protocol is a datagram
2071 protocol, there is minimal memory or state maintained between datagram
2072 transmissions, and each call on the internet protocol module by the
2073 user supplies all information necessary for the IP to perform the
2076 An Example Upper Level Interface
2078 The following two example calls satisfy the requirements for the user
2079 to internet protocol module communication ("=>" means returns):
2081 SEND (src, dst, prot, TOS, TTL, BufPTR, len, Id, DF, opt => result)
2085 src = source address
2086 dst = destination address
2088 TOS = type of service
2090 BufPTR = buffer pointer
2091 len = length of buffer
2096 OK = datagram sent ok
2097 Error = error in arguments or local network error
2099 Note that the precedence is included in the TOS and the
2100 security/compartment is passed as an option.
2102 RECV (BufPTR, prot, => result, src, dst, TOS, len, opt)
2106 BufPTR = buffer pointer
2109 OK = datagram received ok
2110 Error = error in arguments
2111 len = length of buffer
2112 src = source address
2113 dst = destination address
2114 TOS = type of service
2128 When the user sends a datagram, it executes the SEND call supplying
2129 all the arguments. The internet protocol module, on receiving this
2130 call, checks the arguments and prepares and sends the message. If the
2131 arguments are good and the datagram is accepted by the local network,
2132 the call returns successfully. If either the arguments are bad, or
2133 the datagram is not accepted by the local network, the call returns
2134 unsuccessfully. On unsuccessful returns, a reasonable report must be
2135 made as to the cause of the problem, but the details of such reports
2136 are up to individual implementations.
2138 When a datagram arrives at the internet protocol module from the local
2139 network, either there is a pending RECV call from the user addressed
2140 or there is not. In the first case, the pending call is satisfied by
2141 passing the information from the datagram to the user. In the second
2142 case, the user addressed is notified of a pending datagram. If the
2143 user addressed does not exist, an ICMP error message is returned to
2144 the sender, and the data is discarded.
2146 The notification of a user may be via a pseudo interrupt or similar
2147 mechanism, as appropriate in the particular operating system
2148 environment of the implementation.
2150 A user's RECV call may then either be immediately satisfied by a
2151 pending datagram, or the call may be pending until a datagram arrives.
2153 The source address is included in the send call in case the sending
2154 host has several addresses (multiple physical connections or logical
2155 addresses). The internet module must check to see that the source
2156 address is one of the legal address for this host.
2158 An implementation may also allow or require a call to the internet
2159 module to indicate interest in or reserve exclusive use of a class of
2160 datagrams (e.g., all those with a certain value in the protocol
2163 This section functionally characterizes a USER/IP interface. The
2164 notation used is similar to most procedure of function calls in high
2165 level languages, but this usage is not meant to rule out trap type
2166 service calls (e.g., SVCs, UUOs, EMTs), or any other form of
2167 interprocess communication.
2186 APPENDIX A: Examples & Scenarios
2190 This is an example of the minimal data carrying internet datagram:
2194 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
2195 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2196 |Ver= 4 |IHL= 5 |Type of Service| Total Length = 21 |
2197 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2198 | Identification = 111 |Flg=0| Fragment Offset = 0 |
2199 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2200 | Time = 123 | Protocol = 1 | header checksum |
2201 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2203 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2204 | destination address |
2205 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2209 Example Internet Datagram
2213 Note that each tick mark represents one bit position.
2215 This is a internet datagram in version 4 of internet protocol; the
2216 internet header consists of five 32 bit words, and the total length of
2217 the datagram is 21 octets. This datagram is a complete datagram (not
2247 In this example, we show first a moderate size internet datagram (452
2248 data octets), then two internet fragments that might result from the
2249 fragmentation of this datagram if the maximum sized transmission
2250 allowed were 280 octets.
2254 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
2255 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2256 |Ver= 4 |IHL= 5 |Type of Service| Total Length = 472 |
2257 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2258 | Identification = 111 |Flg=0| Fragment Offset = 0 |
2259 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2260 | Time = 123 | Protocol = 6 | header checksum |
2261 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2263 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2264 | destination address |
2265 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2267 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2272 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2274 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2276 Example Internet Datagram
2304 Now the first fragment that results from splitting the datagram after
2309 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
2310 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2311 |Ver= 4 |IHL= 5 |Type of Service| Total Length = 276 |
2312 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2313 | Identification = 111 |Flg=1| Fragment Offset = 0 |
2314 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2315 | Time = 119 | Protocol = 6 | Header Checksum |
2316 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2318 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2319 | destination address |
2320 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2322 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2327 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2329 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2331 Example Internet Fragment
2363 And the second fragment.
2367 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
2368 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2369 |Ver= 4 |IHL= 5 |Type of Service| Total Length = 216 |
2370 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2371 | Identification = 111 |Flg=0| Fragment Offset = 32 |
2372 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2373 | Time = 119 | Protocol = 6 | Header Checksum |
2374 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2376 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2377 | destination address |
2378 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2380 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2385 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2387 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2389 Example Internet Fragment
2424 Here, we show an example of a datagram containing options:
2428 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
2429 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2430 |Ver= 4 |IHL= 8 |Type of Service| Total Length = 576 |
2431 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2432 | Identification = 111 |Flg=0| Fragment Offset = 0 |
2433 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2434 | Time = 123 | Protocol = 6 | Header Checksum |
2435 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2437 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2438 | destination address |
2439 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2440 | Opt. Code = x | Opt. Len.= 3 | option value | Opt. Code = x |
2441 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2442 | Opt. Len. = 4 | option value | Opt. Code = 1 |
2443 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2444 | Opt. Code = y | Opt. Len. = 3 | option value | Opt. Code = 0 |
2445 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2450 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2452 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2454 Example Internet Datagram
2481 APPENDIX B: Data Transmission Order
2483 The order of transmission of the header and data described in this
2484 document is resolved to the octet level. Whenever a diagram shows a
2485 group of octets, the order of transmission of those octets is the normal
2486 order in which they are read in English. For example, in the following
2487 diagram the octets are transmitted in the order they are numbered.
2491 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
2492 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2494 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2496 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2497 | 9 | 10 | 11 | 12 |
2498 +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
2500 Transmission Order of Bytes
2504 Whenever an octet represents a numeric quantity the left most bit in the
2505 diagram is the high order or most significant bit. That is, the bit
2506 labeled 0 is the most significant bit. For example, the following
2507 diagram represents the value 170 (decimal).
2515 Significance of Bits
2519 Similarly, whenever a multi-octet field represents a numeric quantity
2520 the left most bit of the whole field is the most significant bit. When
2521 a multi-octet quantity is transmitted the most significant octet is
2604 BBN Report 1822, "The Specification of the Interconnection of
2605 a Host and an IMP". The specification of interface between a
2606 host and the ARPANET.
2609 The control information on an ARPANET message at the host-IMP
2613 The unit of transmission between a host and an IMP in the
2614 ARPANET. The maximum size is about 1012 octets (8096 bits).
2617 A unit of transmission used internally in the ARPANET between
2618 IMPs. The maximum size is about 126 octets (1008 bits).
2621 The destination address, an internet header field.
2624 The Don't Fragment bit carried in the flags field.
2627 An internet header field carrying various control flags.
2630 This internet header field indicates where in the internet
2631 datagram a fragment belongs.
2634 Gateway to Gateway Protocol, the protocol used primarily
2635 between gateways to control routing and other gateway
2639 Control information at the beginning of a message, segment,
2640 datagram, packet or block of data.
2643 Internet Control Message Protocol, implemented in the internet
2644 module, the ICMP is used from gateways to hosts and between
2645 hosts to report errors and make routing suggestions.
2660 An internet header field carrying the identifying value
2661 assigned by the sender to aid in assembling the fragments of a
2665 The internet header field Internet Header Length is the length
2666 of the internet header measured in 32 bit words.
2669 The Interface Message Processor, the packet switch of the
2673 A four octet (32 bit) source or destination address consisting
2674 of a Network field and a Local Address field.
2677 The unit of data exchanged between a pair of internet modules
2678 (includes the internet header).
2681 A portion of the data of an internet datagram with an internet
2685 The address of a host within a network. The actual mapping of
2686 an internet local address on to the host addresses in a
2687 network is quite general, allowing for many to one mappings.
2690 The More-Fragments Flag carried in the internet header flags
2694 An implementation, usually in software, of a protocol or other
2698 A flag indicating whether or not this internet datagram
2699 contains the end of an internet datagram, carried in the
2700 internet header Flags field.
2703 The Number of Fragment Blocks in a the data portion of an
2704 internet fragment. That is, the length of a portion of data
2705 measured in 8 octet units.
2722 The internet header Options field may contain several options,
2723 and each option may be several octets in length.
2726 The internet header Padding field is used to ensure that the
2727 data begins on 32 bit word boundary. The padding is zero.
2730 In this document, the next higher level protocol identifier,
2731 an internet header field.
2734 The local address portion of an Internet Address.
2737 The source address, an internet header field.
2740 Transmission Control Protocol: A host-to-host protocol for
2741 reliable communication in internet environments.
2744 The unit of data exchanged between TCP modules (including the
2748 Trivial File Transfer Protocol: A simple file transfer
2749 protocol built on UDP.
2752 An internet header field which indicates the upper bound on
2753 how long this internet datagram may exist.
2759 The internet header field Total Length is the length of the
2760 datagram in octets including internet header and data.
2778 An internet header field which indicates the type (or quality)
2779 of service for this internet datagram.
2782 User Datagram Protocol: A user level protocol for transaction
2783 oriented applications.
2786 The user of the internet protocol. This may be a higher level
2787 protocol module, an application program, or a gateway program.
2790 The Version field indicates the format of the internet header.
2839 [1] Cerf, V., "The Catenet Model for Internetworking," Information
2840 Processing Techniques Office, Defense Advanced Research Projects
2841 Agency, IEN 48, July 1978.
2843 [2] Bolt Beranek and Newman, "Specification for the Interconnection of
2844 a Host and an IMP," BBN Technical Report 1822, Revised May 1978.
2846 [3] Postel, J., "Internet Control Message Protocol - DARPA Internet
2847 Program Protocol Specification," RFC 792, USC/Information Sciences
2848 Institute, September 1981.
2850 [4] Shoch, J., "Inter-Network Naming, Addressing, and Routing,"
2851 COMPCON, IEEE Computer Society, Fall 1978.
2853 [5] Postel, J., "Address Mappings," RFC 796, USC/Information Sciences
2854 Institute, September 1981.
2856 [6] Shoch, J., "Packet Fragmentation in Inter-Network Protocols,"
2857 Computer Networks, v. 3, n. 1, February 1979.
2859 [7] Strazisar, V., "How to Build a Gateway", IEN 109, Bolt Beranek and
2860 Newman, August 1979.
2862 [8] Postel, J., "Service Mappings," RFC 795, USC/Information Sciences
2863 Institute, September 1981.
2865 [9] Postel, J., "Assigned Numbers," RFC 790, USC/Information Sciences
2866 Institute, September 1981.