summaryrefslogtreecommitdiff
path: root/doc/rfc/rfc823.txt
blob: 4b87f033bf8971de1ca007614b855e3fce715d2b (plain) (blame)
1
2
3
4
5
6
7
8
9
10
11
12
13
14
15
16
17
18
19
20
21
22
23
24
25
26
27
28
29
30
31
32
33
34
35
36
37
38
39
40
41
42
43
44
45
46
47
48
49
50
51
52
53
54
55
56
57
58
59
60
61
62
63
64
65
66
67
68
69
70
71
72
73
74
75
76
77
78
79
80
81
82
83
84
85
86
87
88
89
90
91
92
93
94
95
96
97
98
99
100
101
102
103
104
105
106
107
108
109
110
111
112
113
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
169
170
171
172
173
174
175
176
177
178
179
180
181
182
183
184
185
186
187
188
189
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
227
228
229
230
231
232
233
234
235
236
237
238
239
240
241
242
243
244
245
246
247
248
249
250
251
252
253
254
255
256
257
258
259
260
261
262
263
264
265
266
267
268
269
270
271
272
273
274
275
276
277
278
279
280
281
282
283
284
285
286
287
288
289
290
291
292
293
294
295
296
297
298
299
300
301
302
303
304
305
306
307
308
309
310
311
312
313
314
315
316
317
318
319
320
321
322
323
324
325
326
327
328
329
330
331
332
333
334
335
336
337
338
339
340
341
342
343
344
345
346
347
348
349
350
351
352
353
354
355
356
357
358
359
360
361
362
363
364
365
366
367
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
401
402
403
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
459
460
461
462
463
464
465
466
467
468
469
470
471
472
473
474
475
476
477
478
479
480
481
482
483
484
485
486
487
488
489
490
491
492
493
494
495
496
497
498
499
500
501
502
503
504
505
506
507
508
509
510
511
512
513
514
515
516
517
518
519
520
521
522
523
524
525
526
527
528
529
530
531
532
533
534
535
536
537
538
539
540
541
542
543
544
545
546
547
548
549
550
551
552
553
554
555
556
557
558
559
560
561
562
563
564
565
566
567
568
569
570
571
572
573
574
575
576
577
578
579
580
581
582
583
584
585
586
587
588
589
590
591
592
593
594
595
596
597
598
599
600
601
602
603
604
605
606
607
608
609
610
611
612
613
614
615
616
617
618
619
620
621
622
623
624
625
626
627
628
629
630
631
632
633
634
635
636
637
638
639
640
641
642
643
644
645
646
647
648
649
650
651
652
653
654
655
656
657
658
659
660
661
662
663
664
665
666
667
668
669
670
671
672
673
674
675
676
677
678
679
680
681
682
683
684
685
686
687
688
689
690
691
692
693
694
695
696
697
698
699
700
701
702
703
704
705
706
707
708
709
710
711
712
713
714
715
716
717
718
719
720
721
722
723
724
725
726
727
728
729
730
731
732
733
734
735
736
737
738
739
740
741
742
743
744
745
746
747
748
749
750
751
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
807
808
809
810
811
812
813
814
815
816
817
818
819
820
821
822
823
824
825
826
827
828
829
830
831
832
833
834
835
836
837
838
839
840
841
842
843
844
845
846
847
848
849
850
851
852
853
854
855
856
857
858
859
860
861
862
863
864
865
866
867
868
869
870
871
872
873
874
875
876
877
878
879
880
881
882
883
884
885
886
887
888
889
890
891
892
893
894
895
896
897
898
899
900
901
902
903
904
905
906
907
908
909
910
911
912
913
914
915
916
917
918
919
920
921
922
923
924
925
926
927
928
929
930
931
932
933
934
935
936
937
938
939
940
941
942
943
944
945
946
947
948
949
950
951
952
953
954
955
956
957
958
959
960
961
962
963
964
965
966
967
968
969
970
971
972
973
974
975
976
977
978
979
980
981
982
983
984
985
986
987
988
989
990
991
992
993
994
995
996
997
998
999
1000
1001
1002
1003
1004
1005
1006
1007
1008
1009
1010
1011
1012
1013
1014
1015
1016
1017
1018
1019
1020
1021
1022
1023
1024
1025
1026
1027
1028
1029
1030
1031
1032
1033
1034
1035
1036
1037
1038
1039
1040
1041
1042
1043
1044
1045
1046
1047
1048
1049
1050
1051
1052
1053
1054
1055
1056
1057
1058
1059
1060
1061
1062
1063
1064
1065
1066
1067
1068
1069
1070
1071
1072
1073
1074
1075
1076
1077
1078
1079
1080
1081
1082
1083
1084
1085
1086
1087
1088
1089
1090
1091
1092
1093
1094
1095
1096
1097
1098
1099
1100
1101
1102
1103
1104
1105
1106
1107
1108
1109
1110
1111
1112
1113
1114
1115
1116
1117
1118
1119
1120
1121
1122
1123
1124
1125
1126
1127
1128
1129
1130
1131
1132
1133
1134
1135
1136
1137
1138
1139
1140
1141
1142
1143
1144
1145
1146
1147
1148
1149
1150
1151
1152
1153
1154
1155
1156
1157
1158
1159
1160
1161
1162
1163
1164
1165
1166
1167
1168
1169
1170
1171
1172
1173
1174
1175
1176
1177
1178
1179
1180
1181
1182
1183
1184
1185
1186
1187
1188
1189
1190
1191
1192
1193
1194
1195
1196
1197
1198
1199
1200
1201
1202
1203
1204
1205
1206
1207
1208
1209
1210
1211
1212
1213
1214
1215
1216
1217
1218
1219
1220
1221
1222
1223
1224
1225
1226
1227
1228
1229
1230
1231
1232
1233
1234
1235
1236
1237
1238
1239
1240
1241
1242
1243
1244
1245
1246
1247
1248
1249
1250
1251
1252
1253
1254
1255
1256
1257
1258
1259
1260
1261
1262
1263
1264
1265
1266
1267
1268
1269
1270
1271
1272
1273
1274
1275
1276
1277
1278
1279
1280
1281
1282
1283
1284
1285
1286
1287
1288
1289
1290
1291
1292
1293
1294
1295
1296
1297
1298
1299
1300
1301
1302
1303
1304
1305
1306
1307
1308
1309
1310
1311
1312
1313
1314
1315
1316
1317
1318
1319
1320
1321
1322
1323
1324
1325
1326
1327
1328
1329
1330
1331
1332
1333
1334
1335
1336
1337
1338
1339
1340
1341
1342
1343
1344
1345
1346
1347
1348
1349
1350
1351
1352
1353
1354
1355
1356
1357
1358
1359
1360
1361
1362
1363
1364
1365
1366
1367
1368
1369
1370
1371
1372
1373
1374
1375
1376
1377
1378
1379
1380
1381
1382
1383
1384
1385
1386
1387
1388
1389
1390
1391
1392
1393
1394
1395
1396
1397
1398
1399
1400
1401
1402
1403
1404
1405
1406
1407
1408
1409
1410
1411
1412
1413
1414
1415
1416
1417
1418
1419
1420
1421
1422
1423
1424
1425
1426
1427
1428
1429
1430
1431
1432
1433
1434
1435
1436
1437
1438
1439
1440
1441
1442
1443
1444
1445
1446
1447
1448
1449
1450
1451
1452
1453
1454
1455
1456
1457
1458
1459
1460
1461
1462
1463
1464
1465
1466
1467
1468
1469
1470
1471
1472
1473
1474
1475
1476
1477
1478
1479
1480
1481
1482
1483
1484
1485
1486
1487
1488
1489
1490
1491
1492
1493
1494
1495
1496
1497
1498
1499
1500
1501
1502
1503
1504
1505
1506
1507
1508
1509
1510
1511
1512
1513
1514
1515
1516
1517
1518
1519
1520
1521
1522
1523
1524
1525
1526
1527
1528
1529
1530
1531
1532
1533
1534
1535
1536
1537
1538
1539
1540
1541
1542
1543
1544
1545
1546
1547
1548
1549
1550
1551
1552
1553
1554
1555
1556
1557
1558
1559
1560
1561
1562
1563
1564
1565
1566
1567
1568
1569
1570
1571
1572
1573
1574
1575
1576
1577
1578
1579
1580
1581
1582
1583
1584
1585
1586
1587
1588
1589
1590
1591
1592
1593
1594
1595
1596
1597
1598
1599
1600
1601
1602
1603
1604
1605
1606
1607
1608
1609
1610
1611
1612
1613
1614
1615
1616
1617
1618
1619
1620
1621
1622
1623
1624
1625
1626
1627
1628
1629
1630
1631
1632
1633
1634
1635
1636
1637
1638
1639
1640
1641
1642
1643
1644
1645
1646
1647
1648
1649
1650
1651
1652
1653
1654
1655
1656
1657
1658
1659
1660
1661
1662
1663
1664
1665
1666
1667
1668
1669
1670
1671
1672
1673
1674
1675
1676
1677
1678
1679
1680
1681
1682
1683
1684
1685
1686
1687
1688
1689
1690
1691
1692
1693
1694
1695
1696
1697
1698
1699
1700
1701
1702
1703
1704
1705
1706
1707
1708
1709
1710
1711
1712
1713
1714
1715
1716
1717
1718
1719
1720
1721
1722
1723
1724
1725
1726
1727
1728
1729
1730
1731
1732
1733
1734
1735
1736
1737
1738
1739
1740
1741
1742
1743
1744
1745
1746
1747
1748
1749
1750
1751
1752
1753
1754
1755
1756
1757
1758
1759
1760
1761
1762
1763
1764
1765
1766
1767
1768
1769
1770
1771
1772
1773
1774
1775
1776
1777
1778
1779
1780
1781
1782
1783
1784
1785
1786
1787
1788
1789
1790
1791
1792
1793
1794
1795
1796
1797
1798
1799
1800
1801
1802
1803
1804
1805
1806
1807
1808
1809
1810
1811
1812
1813
1814
1815
1816
1817
1818
1819
1820
1821
1822
1823
1824
1825
1826
1827
1828
1829
1830
1831
1832
1833
1834
1835
1836
1837
1838
1839
1840
1841
1842
1843
1844
1845
1846
1847
1848
1849
1850
1851
1852
1853
1854
1855
1856
1857
1858
1859
1860
1861
1862
1863
1864
1865
1866
1867
1868
1869
1870
1871
1872
1873
1874
1875
1876
1877
1878
1879
1880
1881
1882
1883
1884
1885
1886
1887
1888
1889
1890
1891
1892
1893
1894
1895
1896
1897
1898
1899
1900
1901
1902
1903
1904
1905
1906
1907
1908
1909
1910
1911
1912
1913
1914
1915
1916
1917
1918
1919
1920
1921
1922
1923
1924
1925
1926
1927
1928
1929
1930
1931
1932
1933
1934
1935
1936
1937
1938
1939
1940
1941
1942
1943
1944
1945
1946
1947
1948
1949
1950
1951
1952
1953
1954
1955
1956
1957
1958
1959
1960
1961
1962
1963
1964
1965
1966
1967
1968
1969
1970
1971
1972
1973
1974
1975
1976
1977
1978
1979
1980
1981
1982
1983
1984
1985
1986
1987
1988
1989
1990
1991
1992
1993
1994
1995
1996
1997
1998
1999
2000
2001
2002
2003
2004
2005
2006
2007
2008
2009
2010
2011
2012
2013
2014
2015
2016
2017
2018
2019
2020
2021
2022
2023
2024
2025
2026
2027
2028
2029
2030
2031
2032
2033
2034
2035
2036
2037
2038
2039
2040
2041
2042
2043
2044
2045
2046
2047
2048
2049
2050
2051
2052
2053
2054
2055
2056
2057
2058
2059
2060
2061
2062
2063
2064
2065
2066
2067
2068
2069
2070
2071
2072
2073
2074
2075
2076
2077
2078
2079
2080
2081
2082
2083
2084
2085
2086
2087
2088
2089
2090
2091
2092
2093
2094
2095
2096
2097
2098
2099
2100
2101
2102
2103
2104
2105
2106
2107
2108
2109
2110
2111
2112
2113
2114
2115
2116
2117
2118
2119
2120
2121
2122
2123
2124
2125
2126
2127
2128
2129
2130
2131
2132
2133
2134
2135
2136
2137
2138
2139
2140
2141
2142
2143
2144
2145
2146
2147
2148
2149
2150
2151
2152
2153
2154
2155
2156
2157
2158
2159
2160
2161
2162
2163
2164
2165
2166
2167
2168
2169
2170
2171
2172
2173
2174
2175
2176
2177
2178
2179
2180
2181
2182
2183
2184
2185
2186
2187
2188
2189
2190
2191
2192
2193
2194
2195
2196
2197
2198
2199
2200
2201
2202
2203
2204
2205
2206
2207
2208
2209
2210
2211
2212
2213
2214
2215
2216
2217
2218
2219
2220
2221
2222
2223
2224
2225
2226
2227
2228
2229
2230
2231
2232
2233
2234
2235
2236
2237
2238
2239
2240
2241
2242
2243
2244
2245
2246
2247
2248
2249
2250
2251
2252
2253
2254
2255
2256
2257
2258
2259
2260
2261
2262
2263
2264
2265
2266
2267
2268
2269
2270
2271
2272
2273
2274
2275
2276
2277
2278
2279
2280
2281
2282
2283
2284
2285
2286
2287
2288
2289
2290
2291
2292
2293
2294
2295
2296
2297
2298
2299
2300
2301
2302
2303
2304
2305
2306
2307
2308
2309
2310
2311
2312
2313
2314
2315
2316
2317
2318
2319
2320
2321
2322
2323
2324
2325
2326
2327
2328
2329
2330
2331
2332
2333
2334
2335
2336
2337
2338
2339
2340
2341
2342
2343
2344
2345
2346
2347
2348
2349
2350
2351
2352
2353
2354
2355
2356
2357
2358
2359
2360
2361
2362
2363
2364
2365
2366
2367
2368
2369
2370
2371
2372
2373
2374
2375
2376
2377
2378
2379
2380
2381
2382
2383
2384
2385
2386
2387
2388
2389
2390
2391
2392
2393
2394
2395
2396
2397
2398
2399
2400
2401
2402
2403
2404
2405
2406
2407
2408
2409
2410
2411
2412
2413
2414
2415
2416
2417
2418
2419
2420
2421
2422
2423
2424
2425
2426
2427
2428
2429
2430
2431
2432
2433
2434
2435
2436
2437
2438
2439
2440
2441
2442
2443
2444
2445
2446
2447
2448
2449
2450
2451
2452
2453
2454
2455
2456
2457
2458
2459
2460
2461
2462
2463
2464
2465
2466
2467
2468
2469
2470
2471
2472
2473
2474
2475
2476
2477
2478
2479
2480
2481
2482
2483
2484
2485
2486
2487
2488
2489
2490
2491
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
2547
2548
2549
2550
2551
2552
2553
2554
2555
2556
2557
2558
2559
2560
2561
2562
2563
2564
2565
2566
2567
2568
2569
2570
2571
2572
2573
2574
2575
2576
2577
2578
2579
2580
2581
2582
2583
2584
2585
2586
2587
2588
2589
2590
2591
2592
2593
2594
2595
2596
2597
2598
2599
2600
2601
2602
2603
2604
2605
2606
2607
2608
2609
2610
Request for Comments:  823
Obsoletes IEN-30 and IEN-109




                        THE DARPA INTERNET GATEWAY



                                  RFC 823






                               Robert Hinden
                               Alan Sheltzer





                       Bolt Beranek and Newman Inc.
                              10 Moulton St.
                      Cambridge, Massachusetts 02238





                              September 1982




                               Prepared for

                 Defense Advanced Research Projects Agency
                 Information Processing Techniques Office
                           1400 Wilson Boulevard
                         Arlington, Virginia 22209





This RFC is a status report on the Internet Gateway developed by BBN. It
describes the Internet Gateway as of September 1982.  This memo presents
detailed descriptions of message formats and gateway procedures, however
this is not an implementation specification, and such details are 
subject to change.




^L


     DARPA Internet Gateway                             September 1982
     RFC 823



                             Table of Contents




     1   INTRODUCTION.......................................... 1
     2   BACKGROUND............................................ 2
     3   FORWARDING INTERNET DATAGRAMS......................... 5
     3.1   Input............................................... 5
     3.2   IP Header Checks.................................... 6
     3.3   Routing............................................. 7
     3.4   Redirects........................................... 9
     3.5   Fragmentation....................................... 9
     3.6   Header Rebuild..................................... 10
     3.7   Output............................................. 10
     4   PROTOCOLS SUPPORTED BY THE GATEWAY................... 12
     4.1   Cross-Net Debugging Protocol....................... 12
     4.2   Host Monitoring Protocol........................... 12
     4.3   ICMP............................................... 14
     4.4   Gateway-to-Gateway Protocol........................ 14
     4.4.1   Determining Connectivity to Networks............. 14
     4.4.2   Determining Connectivity to Neighbors............ 16
     4.4.3   Exchanging Routing Information................... 17
     4.4.4   Computing Routes................................. 19
     4.4.5   Non-Routing Gateways............................. 22
     4.4.6   Adding New Neighbors and Networks................ 23
     4.5   Exterior Gateway Protocol.......................... 24
     5   GATEWAY SOFTWARE..................................... 26
     5.1   Software Structure................................. 26
     5.1.1   Device Drivers................................... 27
     5.1.2   Network Software................................. 27
     5.1.3   Shared Gateway Software.......................... 29
     5.2   Gateway Processes.................................. 29
     5.2.1   Network Processes................................ 29
     5.2.2   GGP Process...................................... 30
     5.2.3   HMP Process...................................... 31
     APPENDIX A. GGP Message Formats.......................... 32
     APPENDIX B. Information Maintained by Gateways........... 39
     APPENDIX C. GGP Events and Responses..................... 41
     REFERENCES............................................... 43







                                    -i-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     1  INTRODUCTION


          This document explains the design of  the  Internet  gateway

     used  in  the  Defense  Advanced  Research Project Agency (DARPA)

     Internet program.  The gateway design was  originally  documented

     in  IEN-30,  "Gateway  Routing:  An Implementation Specification"

     [2], and was later updated in IEN-109, "How to Build  a  Gateway"

     [3].   This  document  reflects changes made both in the internet

     protocols and in the gateway design since  these  documents  were

     released.  It supersedes both IEN-30 and IEN-109.


          The Internet gateway described in this document is based  on

     the  work  of many people; in particular, special credit is given

     to V. Strazisar, M. Brescia, E. Rosen, and J. Haverty.


          The gateway's primary purpose is to route internet datagrams

     to their destination networks.  These datagrams are generated and

     processed as described in RFC 791,  "Internet  Protocol  -  DARPA

     Internet  Program  Protocol  Specification"  [1].   This document

     describes  how  the  gateway  forwards  datagrams,  the   routing

     algorithm  and  protocol  used  to  route  them, and the software

     structure  of  the  current   gateway.    The   current   gateway

     implementation  is written in macro-11 assembly language and runs

     in the DEC PDP-11 or LSI-11 16-bit processor.



                                    -1-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     2  BACKGROUND


          The gateway system has undergone a series of  changes  since

     its  inception,  and  it  is  continuing  to  evolve  as research

     proceeds in the Internet community.  This document describes  the

     implementation as of mid-1982.


          Early versions of gateway software  were  implemented  using

     the   BCPL   language   and   the  ELF  operating  system.   This

     implementation evolved into one  which  used  the  MOS  operating

     system  for  increased  performance.   In  late 1981, we began an

     effort to produce a  totally  new  gateway  implementation.   The

     primary  motivation  for  this was the need for a system oriented

     towards  the  requirements  of  an   operational   communications

     facility,  rather than the research testbed environment which was

     associated with the BCPL implementation.   In  addition,  it  was

     generally   recognized   that   the   complexity   and  buffering

     requirements of future gateway  configurations  were  beyond  the

     capabilities of the PDP-11/LSI-11 and BCPL architecture.  The new

     gateway implementation therefore had a second goal of producing a

     highly  space-efficient  implementation in order to provide space

     for buffers and for the extra  mechanisms,  such  as  monitoring,

     which are needed for an operational environment.




                                    -2-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



          This document  describes  the  implementation  of  this  new

     gateway  which  incorporates  several  mechanisms  for operations

     activities,  is coded in assembly  language  for  maximum  space-

     efficiency,  but otherwise is fundamentally the same architecture

     as the older, research-oriented, implementations.


          One of the results of recent research  is  the  thesis  that

     gateways  should be viewed as elements of a gateway system, where

     the  gateways   act   as   a   loosely-coupled   packet-switching

     communications   system.   For  reasons  of  maintainability  and

     operability,  it  is  easiest  to  build  such  a  system  in  an

     homogeneous  fashion  where  all  gateways  are  under  a  single

     authority and control,  as  is  the  practice  in  other  network

     implementations.


          In order to create  a  system  architecture  that  permitted

     multiple  sets of gateways with each set under single control but

     acting together to implement a composite single Internet  System,

     new  protocols  needed to be developed.  These protocols, such as

     the "Exterior Gateway Protocol," will be introduced in the  later

     releases of the gateway implementation.


          We  also  anticipate  further   changes   to   the   gateway

     architecture  and  implementation  to  introduce  support for new



                                    -3-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     capabilities, such as large numbers of networks, access  control,

     and  other  requirements which have been proposed by the Internet

     research community.  This document represents a snapshot  of  the

     current implementation, rather than a specification.








































                                    -4-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     3  FORWARDING INTERNET DATAGRAMS


          This section describes how the  gateway  forwards  datagrams

     between  networks.   A host computer that wants an IP datagram to

     reach a host on another network  must  send  the  datagram  to  a

     gateway to be forwarded.  Before it is sent into the network, the

     host attaches to the datagram a local network  header  containing

     the address of the gateway.




     3.1  Input


          When a gateway receives a message, the  gateway  checks  the

     message's  local  network header for possible errors and performs

     any actions  required  by  the  host-to-network  protocol.   This

     processing involves functions such as verifying the local network

     header checksum or  generating  a  local  network  acknowledgment

     message.   If  the  header indicates that the message contains an

     Internet datagram, the datagram is passed to the Internet  header

     check  routine.   All  other  messages  received that do not pass

     these tests are discarded.









                                    -5-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     3.2  IP Header Checks


          The Internet header  check  routine  performs  a  number  of

     validity tests on the IP header.  Datagrams that fail these tests

     are discarded causing an HMP trap to  be  sent  to  the  Internet

     Network  Operations  Center (INOC) [7].  The following checks are

     currently performed:


          o  Proper IP Version Number
          o  Valid IP Header Length ( >= 20 bytes)
          o  Valid IP Message Length
          o  Valid IP Header Checksum
          o  Non-Zero Time to Live field


     After a datagram passes these checks,  its  Internet  destination

     address  is examined to determine if the datagram is addressed to

     the gateway.  Each of the gateway's internet addresses  (one  for

     each  network  interface)  is  checked  against  the  destination

     address in the datagram.  If a match is not found,  the  datagram

     is passed to the forwarding routine.


          If the datagram is addressed to the gateway itself,  the  IP

     options  in  the IP header are processed.  Currently, the gateway

     supports the following IP options:








                                    -6-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823




          o  NOP
          o  End of Option List
          o  Loose Source and Record Route
          o  Strict Source and Record Route


     The datagram is next processed according to the protocol  in  the

     IP  header.  If  the protocol is not supported by the gateway, it

     replies with an ICMP error message  and  discards  the  datagram.

     The  gateway  does  not  support  IP  reassembly,  so  fragmented

     datagrams which are addressed to the gateway are discarded.




     3.3  Routing


          The gateway must make a routing decision for  all  datagrams

     that  are to be to forwarded.  The routing algorithm provides two

     pieces of information for the gateway:  1) the network  interface

     that  should be used to send this datagram and 2) the destination

     address that should be put in the local  network  header  of  the

     datagram.


          The gateway maintains a dynamic Routing Table which contains

     an  entry  for  each  reachable network.  The entry consists of a

     network number and the address of the  neighbor  gateway  on  the

     shortest  route  to  the  network, or else an indication that the




                                    -7-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     gateway is directly connected to the network.  A neighbor gateway

     is  one  which  shares  a  common network with this gateway.  The

     distance metric that is  used  to  determine  which  neighbor  is

     closest  is  defined  as the "number of hops," where a gateway is

     considered to be zero hops from its directly connected  networks,

     one  hop  from a network that is reachable via one other gateway,

     etc.  The Gateway-to-Gateway Protocol (GGP) is used to update the

     Routing  Table (see Section 4.4 describing the Gateway-to-Gateway

     Protocol).


          The gateway tries to match the destination  network  address

     in  the IP header of the datagram to be forwarded, with a network

     in its Routing Table.  If no match is found,  the  gateway  drops

     the datagram and sends an ICMP Destination Unreachable message to

     the IP source.  If the gateway does find an entry for the network

     in  its  table,  it  will use the network address of the neighbor

     gateway entry as the local network  destination  address  of  the

     datagram.   However, if the final destination network is one that

     the gateway is directly connected to, the destination address  in

     the  local network header is created from the destination address

     in the IP header of the datagram.







                                    -8-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     3.4  Redirects


          If the routing procedure decides that an IP datagram  is  to

     be  sent back out the same network interface that it was read in,

     then this gateway is not on the shortest path  to  the  IP  final

     destination.   Nevertheless, the datagram will still be forwarded

     to the next address chosen by  the  routing  procedure.   If  the

     datagram  is  not  using  the  IP Source Route Option, and the IP

     source network of the datagram is the same as the network of  the

     next  gateway  chosen  by the routing procedure, an ICMP Redirect

     message will be sent  to  the  IP  source  host  indicating  that

     another  gateway  should  be used to send traffic to the final IP

     destination.




     3.5  Fragmentation


          The datagram is passed to the  fragmentation  routine  after

     the  routing decision has been made.  If the next network through

     which the datagram must pass has a maximum message size  that  is

     smaller  than  the  size  of  the  datagram, the datagram must be

     fragmented.   Fragmentation  is  performed   according   to   the

     algorithm  described  in the Internet Protocol Specification [1].

     Certain IP options must be copied  into  the  IP  header  of  all



                                    -9-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     fragments, and others appear only in the first fragment according

     to the IP specification.  If a datagram must be  fragmented,  but

     the  Don't  fragment bit is set, the datagram is discarded and an

     ICMP error message is sent to the IP source of the datagram.




     3.6  Header Rebuild


          The datagram (or the fragments of the original  datagram  if

     fragmentation  was  needed)  is  next  passed  to  a routine that

     rebuilds  the  Internet  header.  The  Time  to  Live  field   is

     decremented by one and the IP checksum is recomputed.


          The  local  network  header  is  now   built.    Using   the

     information  obtained  from  its  routing  procedure, the gateway

     chooses the network interface it considers  proper  to  send  the

     datagram  and  to  build  the  destination  address  in the local

     network header.




     3.7  Output


          The datagram is now enqueued on an output queue for delivery

     towards  its destination.  A limit is enforced on the size of the

     output queue for each network interface so that  a  slow  network



                                   -10-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     does  not  unfairly  use  up  all of the gateway's buffers.  If a

     datagram cannot be enqueued due to the limit on the output  queue

     length, it is dropped and an HMP trap is sent to the INOC.  These

     traps, and others of a similar nature, are  used  by  operational

     personnel to monitor the operations of the gateways.






































                                   -11-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     4  PROTOCOLS SUPPORTED BY THE GATEWAY


          A number of  protocols  are  supported  by  the  gateway  to

     provide   dynamic   routing,  monitoring,  debugging,  and  error

     reporting.  These protocols are described below.




     4.1  Cross-Net Debugging Protocol


          The Cross-Net Debugging Protocol (XNET) [8] is used to  load

     the  gateway  and  to  examine  and  deposit  data.   The gateway

     supports the following XNET op-codes:


          o  NOP
          o  Debug
          o  End Debug
          o  Deposit
          o  Examine
          o  Create Process




     4.2  Host Monitoring Protocol


          The Host Monitoring Protocol (HMP) [6] is  used  to  collect

     measurements   and   status   information   from   the  gateways.

     Exceptional conditions in the gateways are reported in HMP traps.

     The status of a gateway's interfaces, neighbors, and the networks

     which it can reach are reported in the HMP status message.



                                   -12-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



          Two types of gateway statistics, the Host Traffic Matrix and

     the  gateway  throughput,  are currently defined by the HMP.  The

     Host Traffic Matrix records the number  of  datagrams  that  pass

     through  the  gateway  with  a  given IP source, destination, and

     protocol number.   The  gateway  throughput  message  collects  a

     number  of  important counters that are kept by the gateway.  The

     current gateway reports the following values:


          o  Datagrams dropped because destination net unreachable

          o  Datagrams dropped because destination host unreachable


          o  Per Interface:
                  Datagrams received with IP errors
                  Datagrams received for this gateway
                  Datagrams received to be forwarded
                  Datagrams looped
                  Bytes received
                  Datagrams sent, originating at this gateway
                  Datagrams sent to destination hosts
                  Datagrams dropped due to flow control limitations
                  Datagrams dropped due to full queue
                  Bytes sent

          o  Per Neighbor:
                  Routing updates sent to
                  Routing updates received from
                  Datagrams sent, originating here
                  Datagrams forwarded to
                  Datagrams dropped due to flow control limitations
                  Datagrams dropped due to full queue
                  Bytes sent







                                   -13-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     4.3  ICMP


          The gateway will generate the following ICMP messages  under

     appropriate  circumstances  as  defined by the ICMP specification

     [4]:


          o  Echo Reply
          o  Destination Unreachable
          o  Source Quench
          o  Redirect
          o  Time Exceeded
          o  Parameter Problem
          o  Information Reply




     4.4  Gateway-to-Gateway Protocol


          The gateway uses the Gateway-to-Gateway  Protocol  (GGP)  to

     determine  connectivity  to networks and neighbor gateways; it is

     also used in  the  implementation  of  a  dynamic,  shortest-path

     routing  algorithm.  The current GGP message formats (for release

     1003 of the gateway software) are presented in Appendix A.




     4.4.1  Determining Connectivity to Networks


          When a gateway  starts  running  it  assumes  that  all  its

     neighbor  gateways  are  "down,"  that  it  is  disconnected from




                                   -14-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     networks to which it is attached, and that the distance  reported

     in  routing  updates  from  each  neighbor  to  each  network  is

     "infinity."


          The gateway first determines the state of  its  connectivity

     to  networks  to  which it is physically attached.  The gateway's

     connection to a network is declared up if it can send and receive

     internet  datagrams  on its interface to that network.  Note that

     the method that the gateway uses to determine its connectivity to

     a  network  is network-dependent.  In some networks, the host-to-

     network protocol determines whether or not datagrams can be  sent

     and  received  on  the  host  interface.   In these networks, the

     gateway simply checks-status information provided by the protocol

     in order to determine if it can communicate with the network.  In

     other networks, where  the  host-to-network  protocols  are  less

     sophisticated,  it  may  be  necessary  for  the  gateway to send

     datagrams to itself to determine if it can communicate  with  the

     network.   In  these networks, the gateways periodically poll the

     network using GGP network interface status messages [Appendix  A]

     to determine if the network interface is operational.


          The gateway has two rules relevant to computing distances to

     networks:   1) if the gateway can send and receive traffic on its




                                   -15-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     network interface, its distance to the network is zero;  2) if it

     cannot send and receive traffic on the interface, its distance to

     the network is "infinity."  Note  that  if  a  gateway's  network

     interface is not working, it may still be able to send traffic to

     the network on  an  alternate  route  via  one  of  its  neighbor

     gateways.




     4.4.2  Determining Connectivity to Neighbors


          The gateway determines connectivity to neighbors using a  "K

     out  of  N"  algorithm.   Every 15 seconds, the gateway sends GGP

     Echo messages  [Appendix  A]  to  each  of  its  neighbors.   The

     neighbors  respond  by  sending GGP echo replies.  If there is no

     reply to K out of  N  (current  values  are  K=3  and  N=4)  echo

     messages sent to a neighbor, the neighbor is declared down.  If a

     neighbor is down and J out of M (current values are J=2 and  M=4)

     echo  replies  are  received,  the neighbor is declared to be up.

     The values of J,K,M,N  and  the  time  interval  are  operational

     parameters which can be adjusted as required.










                                   -16-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     4.4.3  Exchanging Routing Information


          The gateway sends routing information in GGP Routing  Update

     messages.  The gateway receives and transmits routing information

     reliably using sequence-numbered messages  and  a  retransmission

     and acknowledgment scheme as explained below.  For each neighbor,

     the gateway remembers the Receive Sequence  Number,  R,  that  it

     received  in  the  most recent routing update from that neighbor.

     This value is initialized with the sequence number in  the  first

     Routing  Update  received  from  a neighbor after that neighbor's

     status is set to "up."  On receipt of a  routing  update  from  a

     neighbor,  the  gateway subtracts the Receive Sequence Number, R,

     from the sequence number in the routing update, S. If this  value

     (S-R)  is greater than or equal to zero, then the gateway accepts

     the routing update, sends an acknowledgment (see Appendix  A)  to

     the  neighbor  containing the sequence number S, and replaces the

     Receive Sequence Number, R, with S. If this value (S-R)  is  less

     than  zero,  the  gateway  rejects the routing update and sends a

     negative  acknowledgment  [Appendix  A]  to  the  neighbor   with

     sequence number R.


          The gateway has a  Send  Sequence  Number,  N,  for  sending

     routing  updates  to  all of its neighbors.  This sequence number




                                   -17-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     can be initialized to any value.  The  Send  Sequence  Number  is

     incremented  each  time  a  new  routing  update  is created.  On

     receiving an acknowledgment for a  routing  update,  the  gateway

     subtracts  the  sequence  number  acknowledged,  A, from the Send

     Sequence Number, N.  If the value (N-A) is non-zero, then an  old

     routing  update  is being acknowledged.  The gateway continues to

     retransmit the most recent routing update to  the  neighbor  that

     sent  the  acknowledgment.   If (N-A) is zero, the routing update

     has been acknowledged.  Note that only the  most  recent  routing

     update  must  be  acknowledged;  if  a  second  routing update is

     generated before the first routing update is  acknowledged,  only

     the second routing update must be acknowledged.


          If  a  negative  acknowledgment  is  received,  the  gateway

     subtracts  the  sequence  number negatively acknowledged, A, from

     its Send Sequence Number, N.  If this value (N-A)  is  less  than

     zero, then the gateway replaces its Send Sequence Number, N, with

     the sequence number negatively acknowledged plus  one,  A+1,  and

     retransmits the routing update to all of its neighbors.  If (N-A)

     is greater than or equal to zero, then the gateway  continues  to

     retransmit  the routing update using sequence number N.  In order

     to maintain the correct sequence numbers at all gateways, routing

     updates  must  be  retransmitted  to  all  neighbors  if the Send



                                   -18-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     Sequence Number changes, even if the routing information does not

     change.


          The gateway retransmits routing updates  periodically  until

     they  are  acknowledged  and  whenever  its  Send Sequence Number

     changes.  The gateway sends routing  updates  only  to  neighbors

     that are in the "up" state.




     4.4.4  Computing Routes


          A routing update  contains  a  list  of  networks  that  are

     reachable  through  this  gateway, and the distance in "number of

     hops"  to  each  network  mentioned.   The  routing  update  only

     contains information about a network if the gateway believes that

     it is as close or closer to that network then the neighbor  which

     is  to receive the routing update.  The network address may be an

     internet class A, B, or C address.


          The information inside a  routing  update  is  processed  as

     follows.   The gateway contains an N x K distance matrix, where N

     is the number of  networks  and  K  is  the  number  of  neighbor

     gateways.   An  entry  in this matrix, represented as dm(I,J), is

     the distance to network I from neighbor J as reported in the most




                                   -19-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     recent routing update from neighbor J.  The gateway also contains

     a vector indicating  the  connectivity  between  itself  and  its

     neighbor  gateways.   The  values  in this vector are computed as

     discussed above (see Section 4.4.2, Determining  Connectivity  to

     Neighbors).   The value of the Jth entry of this vector, which is

     the connectivity between the gateway and  the  Jth  neighbor,  is

     represented as d(J).


          The gateway copies the routing update received from the  Jth

     neighbor  into  the  appropriate row of the distance matrix, then

     updates its routes as follows.  The gateway calculates a  minimum

     distance  vector  which  contains  the  minimum  distance to each

     network  from  the  gateway.   The  Ith  entry  of  this  vector,

     represented as MinD(I) is:


       MinD(I) = minimum over all neighbors of d(J) + dm(I,J)


     where d(J) is the  distance  between  the  gateway  and  the  Jth

     neighbor,  and  dm(I,J)  is the distance from the Jth neighbor to

     the Ith network.  If the Ith network is attached to  the  gateway

     and  the  gateway  can  send  and  receive traffic on its network

     interface (see Section 4.4.2), then  the  gateway  sets  the  Ith

     entry of the minimum distance vector to zero.





                                   -20-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



          Using the minimum distance vector, the  gateway  computes  a

     list  of  neighbor gateways through which to send traffic to each

     network.  The entry for a  given  network  contains  one  of  the

     neighbors that is the minimum distance away from that network.


          After updating its  routes  to  the  networks,  the  gateway

     computes  the  new  routing  updates to be sent to its neighbors.

     The gateway reports a network to a neighbor  only  if  it  is  as

     close  to  or closer to that network than its neighbor.  For each

     network I, the routing update contains the address of the network

     and the minimum distance to that network which is MinD(I).


          Finally, the gateway must determine whether it  should  send

     routing  updates to its neighbors.  The gateway sends new updates

     to its neighbors if every one of the following  three  conditions

     occurs:   1)  one  of the gateway's interfaces changes state,  2)

     one of the gateway's neighbor gateways changes state, and  3) the

     gateway  receives  a  routing  update  from  a  neighbor  that is

     different from the update that it had  previously  received  from

     that  neighbor.   The  gateway  sends  routing  updates  only  to

     neighbors that are currently in the "up" state.


          The gateway requests a routing update  from  neighbors  that

     are  in  the  "up"  state,  but  from which it has yet received a



                                   -21-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     routing update.  Routing updates are  requested  by  setting  the

     appropriate  bit  in  the routing update being sent [Appendix A].

     Similarly, if a gateway receives from a neighbor a routing update

     in  which the bit requesting a routing update is set, the gateway

     sends the neighbor the most recent routing update.




     4.4.5  Non-Routing Gateways


          A Non-routing Gateway is a gateway  that  forwards  internet

     traffic,  but  does  not  implement  the  GGP  routing algorithm.

     Networks that are behind a Non-routing Gateway are known a-priori

     to  Routing Gateways.  There can be one or more of these networks

     which are considered to be directly connected to the  Non-routing

     Gateway.   A  Routing  Gateway  will forward a datagram to a Non-

     routing Gateway if it is addressed to a network behind  the  Non-

     routing   Gateway.    Routing  Gateways  currently  do  not  send

     Redirects for  Non-routing  Gateways.   A  Routing  Gateway  will

     always  use  another  Routing Gateway as a path instead of a Non-

     routing Gateways if both exist and are the same  number  of  hops

     away from the destination network.  The Non-routing Gateways path

     will be used only when the Routing Gateway path is down; when the

     Routing Gateway path comes back up, it will be used again.




                                   -22-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     4.4.6  Adding New Neighbors and Networks


          Gateways  dynamically  add  routing  information  about  new

     neighbors   and  new  networks  to  their  tables.   The  gateway

     maintains a list of neighbor gateway addresses.  When  a  routing

     update  is  received, the gateway searches this list of addresses

     for the Internet source address of the  routing  update  message.

     If  the  Internet  source  address  of  the routing update is not

     contained in the list of neighbor  addresses,  the  gateway  adds

     this  address  to  the  list  of  neighbor addresses and sets the

     neighbor's connectivity status to "down."   Routing  updates  are

     not  accepted  from neighbors until the GGP polling mechanism has

     determined that the neighbor is up.


          This strategy of adding  new  neighbors  requires  that  one

     gateway   in  each  pair  of  neighbor  gateways  must  have  the

     neighbor's address configured in its tables.  The newest  gateway

     can be given a complete list of neighbors, thus avoiding the need

     to re-configure older gateways when new gateways are installed.


          Gateways obtain routing information about  new  networks  in

     several  steps.   The  gateway has a list of all the networks for

     which it currently maintains routing information.  When a routing

     update  is  received,  if the routing update contains information



                                   -23-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     about a new network, the gateway adds this network to the list of

     networks  for  which it maintains routing information.  Next, the

     gateway adds  the  new  network  to  its  distance  matrix.   The

     distance  matrix comprises the is the matrix of distances (number

     of hops) to networks as reported  in  routing  updates  from  the

     neighbor  gateways.   The  gateway  sets  the distance to all new

     networks to "infinity," and then  computes  new  routes  and  new

     routing updates as outlined above.




     4.5  Exterior Gateway Protocol


          The Exterior Gateway Protocol (EGP) is used to permit  other

     gateways  and  gateway systems to pass routing information to the

     DARPA Internet gateways.  The use of the EGP permits the user  to

     perceive  all  of  the networks and gateways as part of one total

     Internet system, even though the "exterior" gateways are disjoint

     and  may  use  a  routing  algorithm  that  is  different and not

     compatible with  that  used  in  the  "interior"  gateways.   The

     important elements of the EGP are:


     o Neighbor Acquisition

          The procedure by which a gateway requests that it  become  a
          neighbor  of  another  gateway.  This is used when a gateway
          wants to become a neighbor  of  another  in  order  to  pass



                                   -24-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



          routing information.  This includes the capability to accept
          or refuse the request.

     o Neighbor Up/Down

          The procedure by which a gateway decides if another  gateway
          is up or down.

     o Network Reachability Information

          The facility used to pass routing and  neighbor  information
          between gateways.

     o Gateway Going Down

          The ability of a gateway to inform other gateways that it is
          going  down  and  no  longer  has  any  routes  to any other
          networks.  This permits a gateway to go down in  an  orderly
          way without disrupting the rest of the Internet system.


     A complete description of the EGP can be found  in  IEN-209,  the

     "Exterior Gateway Protocol" [10].























                                   -25-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     5  GATEWAY SOFTWARE


          The DARPA Internet Gateway  runs  under  the  MOS  operating

     system [9] which provides facilities for:


          o Multiple processes
          o Interprocess communication
          o Buffer management
          o Asynchronous input/output
          o Shareable real-time clock


     There is a MOS process for  each  network  that  the  gateway  is

     directly  connected  to.   A  data  structure  called  a NETBLOCK

     contains variables of interest for each network and  pointers  to

     local  network  routines.   Network  processes run common gateway

     code while  network-specific  functions  are  dispatched  to  the

     routines  pointed  to  in the NETBLOCK.  There are also processes

     for gateway functions which require their own timing, such as GGP

     and HMP.




     5.1  Software Structure


          The gateway software can be divided conceptually into  three

     parts:   MOS Device Drivers, Network software, and Shared Gateway

     software.





                                   -26-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     5.1.1  Device Drivers


          The gateway has a set of  routines  to  handle  sending  and

     receiving  data  for  each type of hardware interface.  There are

     routines for initialization,  initiation,  and  interruption  for

     both  the  transmit  and  receive sides of a device.  The gateway

     supports the following types of devices:


          a)  ACC LSI-11 1822
          b)  DEC IMP11a 1822
          c)  ACC LHDH 1822
          d)  ACC VDH11E
          e)  ACC VDH11C
          f)  Proteon Ring Network
          g)  RSRE HDLC
          h)  Interlan Ethernet
          i)  BBN Fibernet
          j)  ACC XQ/CP X.25 **
          k)  ACC XQ/CP HDH  **




     5.1.2  Network Software


          For each connected network, the gateway has a set  of  eight

     routines  which  handle  local  network  functions.   The network

     routines and their functions are described briefly below.




     _______________
     ** Planned, not yet supported.




                                   -27-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



          Up.net    Perform  local  network  initialization  such   as
                    flapping the 1822 ready line.

          Sg.net    Handle specific  local  network  timing  functions
                    such as timing out 1822 Destination Deads.

          Rc.net    A message  has  been  received  from  the  network
                    interface.  Check for any input errors.

          Wc.net    A message has  been  transmitted  to  the  network
                    interface.  Check for any output errors.

          Rs.net    Set up a buffer (or buffers) to  receive  messages
                    on the network interface.

          Ws.net    Transmit a message to the network interface.

          Hc.net    Check the local network  header  of  the  received
                    message.    Perform  any  local  network  protocol
                    tasks.

          Hb.net    Rebuild the local network header.


          There are  network  routines  for  the  following  types  of

     networks:


          o  Arpanet (a,b,c,k)
          o  Satnet (d,e,k)
          o  Proteon Ring Network (f)
          o  Packet Radio Network (a,b,c)
          o  Rsre HDLC Null Network (g)
          o  Ethernet (h)
          o  Fibernet (i)
          o  Telenet X.25 (j) **


     Note: The letters in parentheses refer to the device drivers used

     _______________
     ** Planned, not yet supported.




                                   -28-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     for each type of network as described in the previous section.




     5.1.3  Shared Gateway Software


          The internet processing of a datagram is performed by a body

     of  code  which  is  shared  by the network processes.  This code

     includes  routines  to  check   the   IP   header,   perform   IP

     fragmentation, calculate the IP checksum, forward a datagram, and

     implement the routing, monitoring, and error reporting protocols.




     5.2  Gateway Processes


     5.2.1  Network Processes


          When the gateway starts up, each network process  calls  its

     local network initialization routine and read start routine.  The

     read start routine sets up two maximum network size  buffers  for

     receiving datagrams.  The network process then waits for an input

     complete signal from the network device driver.


          When a message has been received, the MOS  Operating  System

     signals  the  appropriate  network process with an input complete

     signal.  The network process wakes up and executes the  net  read




                                   -29-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     complete  routine.   After  the  message  has been processed, the

     network process waits for more input.


          The  net  read  complete  routine  is  the   major   message

     processing  loop  in  the  gateway.   The  following  actions are

     performed when a message has been received:


          o  Call Local Network Read Complete Routine
          o  Start more reads
          o  Check local Network Header
          o  Check Internet header
          o  Check if datagram is for the gateway
          o  Forward the datagram if necessary
          o  Send ICMP error message if necessary.




     5.2.2  GGP Process


          The GGP process periodically sends GGP echos to each of  the

     gateway's neighbors to determine neighbor connectivity, and sends

     interface  status  messages  addressed  to  itself  to  determine

     network  connectivity.   The  GGP  process also sends out routing

     updates when necessary.  The details of the algorithms  currently

     implemented  by  the  GGP  process  are  given  in  Section  4.4,

     Gateway-to-Gateway Protocol, and in Appendix C.








                                   -30-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     5.2.3  HMP Process


          The  HMP  process  handles  timer-based  gateway  statistics

     collection and the periodic transmission of traps.









































                                   -31-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     APPENDIX A. GGP Message Formats


          Note that the GGP protocol is currently undergoing extensive

     changes to introduce the Exterior Gateway Protocol facility; this

     is the vehicle needed to permit  gateways  in  other  systems  to

     exchange  routing information with the gateways described in this

     document.


          Each GGP message consists of an Internet header followed  by

     one  of the messages explained below.  The values (in decimal) in

     the Internet header used in a GGP message are as follows.


     Version                  4.

     IHL                      Internet header length in 32-bit words.

     Type of Service          0.

     Total Length             Length of Internet header  and  data  in
                              octets.

     ID, Flags,
     Fragment Offset          0.

     Time to Live             Time to live in seconds.  This field  is
                              decremented   at   least  once  by  each
                              machine that processes the datagram.

     Protocol                 Gateway Protocol = 3.

     Header Checksum          The 16 bit one's complement of the one's
                              complement  sum  of  all 16-bit words in
                              the header.  For computing the checksum,
                              the checksum field should be zero.




                                   -32-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     Source Address           The address of the  gateway's  interface
                              from which the message is sent.

     Destination Address      The address of the gateway to which  the
                              message is sent.










































                                   -33-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     ROUTING UPDATE


      0                   1
      0 1 2 3 4 5 6 7 8 9 0 1 2 3 4 5
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     !Gateway Type   !  unused (0)   !                 ; 2 bytes
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     !     Sequence Number           !                 ; 2 bytes
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     !  need-update  !  n-distances  !                 ; 2 bytes
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     !  distance 1   !   n1-dist     !                 ; 2 bytes
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     !   net11       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ; 1, 2 or 3
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ;   bytes
     !   net12       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!! ; 1, 2 or 3
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+ ;   bytes
                                     .
                                     .
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     !   net1n1      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  ; n1 nets at
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ;   dist 1
                                     .                      ...
                                     .                  ; ndist groups
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+                  ;    of nets
     !  distance n   !   nn-dist     !                  ; 2 bytes
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     !   netn1       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  ; 1, 2 or 3
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ;   bytes
     !   netn2       !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  ; 1, 2 or 3
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ;   bytes
                                .
                                .
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     !   netnnn      !!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!!  ; nn nets at
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+  ;  dist n

     Gateway Type             12 (decimal)

     Sequence Number          The  16-bit  sequence  number  used   to
                              identify routing updates.

     need-update              An 8-bit field.  This byte is set  to  1



                                   -34-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



                              if the source gateway requests a routing
                              update from the destination gateway, and
                              set to 0 if not.

     n-distances              An   8-bit   field.    The   number   of
                              distance-groups reported in this update.
                              Each  distance-group   consists   of   a
                              distance  value  and  a  number of nets,
                              followed by the actual net numbers which
                              are reachable at that distance.  Not all
                              distances need be reported.

     distance 1               hop count (or  other  distance  measure)
                              which applies to this distance-group.

     n1-dist                  number of nets  which  are  reported  in
                              this distance-group.

     net11                    1, 2, or 3 bytes for the  first  net  at
                              distance "distance 1".

     net12                    second net

     ...

     net1n1                   etc.





















                                   -35-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     ACKNOWLEDGMENT or NEGATIVE ACKNOWLEDGMENT


      0                   1                   2                   3
      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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | Gateway Type  |  Unused       |        Sequence number        |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


     Gateway Type             Acknowledgments are  type  2.   Negative
                              acknowledgments are type 10.

     Sequence Number          The  16-bit  sequence  number  that  the
                              gateway  is  acknowledging or negatively
                              acknowledging.































                                   -36-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     GGP ECHO and ECHO REPLY



      0                   1                   2                   3
      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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     | Gateway Type  |            Unused                             |
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+


     Gateway Type             8 for echo message; 0 for echo reply.

     Source Address           In an echo message, this is the  address
                              of  the  gateway  on the same network as
                              the neighbor to which it is sending  the
                              echo message.  In an echo reply message,
                              the source and destination addresses are
                              simply  reversed,  and  the remainder is
                              returned unchanged.



























                                   -37-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     NETWORK INTERFACE STATUS

      0                   1                   2                   3
      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
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+
     ! Gateway Type  !                  unused                       !
     +-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+-+

     Gateway Type             9

     Source Address
     Destination Address      The address  of  the  gateway's  network
                              interface.   The  gateway  can  send Net
                              Interface Status messages to  itself  to
                              determine  if  it  is  able  to send and
                              receive   traffic   on    its    network
                              interface.






























                                   -38-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     APPENDIX B. Information Maintained by Gateways


          In order to implement the shortest-path  routing  algorithm,

     gateways  must  maintain  information about their connectivity to

     networks  and  other  gateways.   This   section   explains   the

     information  maintained  by each gateway; this information can be

     organized into the following tables and variables.


     o  Number of Networks

          The number of  networks  for  which  the  gateway  maintains
          routing information and to which it can forward traffic.

     o  Number of Neighbors

          The number of  neighbor  gateways  with  which  the  gateway
          exchanges routing information.

     o  Gateway Addresses

          The addresses of the gateway's network interfaces.

     o  Neighbor Gateway Addresses

          The address of each  neighbor  gateway's  network  interface
          that is on the same network as this gateway.

     o  Neighbor Connectivity Vector

          A vector of the connectivity between this gateway  and  each
          of its neighbors.

     o  Distance Matrix

          A matrix of the routing updates received from  the  neighbor
          gateways.





                                   -39-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     o  Minimum Distance Vector

          A vector containing the minimum distance to each network.

     o  Routing Updates from Non-Routing Gateways

          The routing updates that would have been received from  each
          non-routing  neighbor  gateway which does not participate in
          this routing strategy.

     o  Routing Table

          A table containing, for each network, a list of the neighbor
          gateways on a minimum-distance route to the network.

     o  Send Sequence Number

          The sequence number that will  be  used  to  send  the  next
          routing update.

     o  Receive Sequence Numbers

          The sequence numbers that the gateway received in  the  last
          routing update from each of its neighbors.

     o  Received Acknowledgment Vector

          A  vector  indicating  whether  or  not  each  neighbor  has
          acknowledged  the sequence number in the most recent routing
          update sent.

















                                   -40-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     APPENDIX C. GGP Events and Responses


          The following list shows the GGP  events  that  occur  at  a

     gateway  and  the  gateway's responses.  The variables and tables

     referred to are listed above.



     o  Connectivity to an attached network changes.

          a. Update the Minimum Distance Vector.
          b. Recompute the Routing Updates.
          c. Recompute the Routing Table.
          d. If any routing update has changed, send the  new  routing
             updates to the neighbors.

     o  Connectivity to a neighbor gateway changes.

          a. Update the Neighbor Connectivity Vector.
          b. Recompute the Minimum Distance Vector.
          c. Recompute the Routing Updates.
          d. Recompute the Routing Table.
          e. If any routing update has changed, send the  new  routing
             updates to the neighbors.

     o  A Routing Update message is received.

          a. Compare the Internet source address of the Routing Update
             message to the Neighbor Addresses.  If the address is not
             on the list, add it to the list  of  Neighbor  Addresses,
             increment  the  Number  of Neighbors, and set the Receive
             Sequence Number for this neighbor to the sequence  number
             in the Routing Update message.

          b. Compare the Receive Sequence Number for this neighbor  to
             the  sequence  number  in  the  Routing Update message to
             determine whether or not to accept this message.  If  the
             message  is  rejected,  send  a  Negative  Acknowledgment
             message.   If  the   message   is   accepted,   send   an
             Acknowledgment  message  and  proceed  with the following
             steps.



                                   -41-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



          c. Compare the  networks  reported  in  the  Routing  Update
             message  to  the Number of Networks.  If new networks are
             reported, enter them in the network vectors, increase the
             number  of  networks,  and  expand the Distance Matrix to
             account for the new networks.

          d. Copy the routing update received into the appropriate row
             of the Distance Matrix.

          e. Recompute the Minimum Distance Vector.

          f. Recompute the Routing Updates.

          g. Recompute the Routing Table.

          h. If any routing update has changed, send the  new  routing
             updates to the neighbors.

     o  An Acknowledgment message is received.

             Compare the sequence number in the message  to  the  Send
             Sequence   Number.    If  the  Send  Sequence  Number  is
             acknowledged,  update   the   entry   in   the   Received
             Acknowledgment  Vector  for  the  neighbor  that sent the
             acknowledgment.

     o  A Negative Acknowledgment message is received.

             Compare the sequence number in the message  to  the  Send
             Sequence Number.  If necessary, replace the Send Sequence
             Number, and retransmit the routing updates.
















                                   -42-


^L


     DARPA Internet Gateway                             September 1982
     RFC 823



     REFERENCES

     [1]  Postel,  J.  (ed.),  "Internet  Protocol  -  DARPA  Internet
          Program  Protocol  Specification,"  RFC 791, USC/Information
          Sciences Institute, September 1981.

     [2]  Strazisar,  V.,   "Gateway   Routing:    An   Implementation
          Specification," IEN-30, Bolt Beranek and Newman Inc., August
          1979.

     [3]  Strazisar, V., "How  to  Build  a  Gateway,"  IEN-109,  Bolt
          Beranek and Newman Inc., August 1979.

     [4]  Postel, J.,  "Internet  Control  Message  Protocol  -  DARPA
          Internet   Program   Protocol   Specification,"   RFC   792,
          USC/Information Sciences Institute, September 1981.

     [5]  Postel, J., "Assigned  Numbers,"  RFC  790,  USC/Information
          Sciences Institute, September 1981.

     [6]  Littauer, B., Huang, A.,  Hinden,  R.,  "A  Host  Monitoring
          Protocol,"  IEN-197, Bolt Beranek and Newman Inc., September
          1981.

     [7]  Santos,  P.,  Chalstrom,   H.,   Linn,   J.,   Herman,   J.,
          "Architecture   of   a   Network   Monitoring,  Control  and
          Management System," Proc. of  the  5th  Int.  Conference  on
          Computer Communication, October 1980.

     [8]  Haverty, J., "XNET Formats for Internet Protocol Version 4,"
          IEN-158, Bolt Beranek and Newman Inc., October 1980.

     [9]  Mathis, J., Klemba, K., Poggio,  "TIU  Notebook-  Volume  2,
          Software Documentation," SRI, May 1979.

     [10] Rosen,  E.,  "Exterior  Gateway  Protocol,"  IEN-209,   Bolt
          Beranek and Newman Inc., August 1982.










                                   -43-


^L