2.1
| Introduction   7
|
2.2
| The Process Concept   8
|
2.3
| Process Priority   9
|
2.4
| Process Synchronization   9
|
2.5
| Interprocess Communication   12
|
| 2.5.1
| Ports   12
|
| 2.5.2
| Message Passing   13
|
2.6
| Device Drivers, Input, And Output   14
|
2.7
| Network Input and Interrupts   14
|
2.8
| Passing Packets To Higher Level Protocols   16
|
2.9
| Passing Datagrams From IP To Transport Protocols   16
|
| 2.9.1
| Passing Incoming Datagrams to TCP   17
|
| 2.9.2
| Passing Incoming Datagrams to UDP   17
|
2.10
| Delivery To Application Programs   18
|
2.11
| Information Flow On Output   19
|
2.12
| From TCP Through IP To Network Output   20
|
2.13
| UDP Output   21
|
2.14
| Summary   21
|
| For Further Study   25
|
| Exercises   25
|
3.1
| Introduction   27
|
3.2
| The Network Interface Abstraction   28
|
| 3.2.1
| Interface Structure   28
|
3.3
| Ethernet Definitions   30
|
| 3.3.1
| Statistics About Use   34
|
3.4
| Logical State Of An Interface   34
|
3.5
| Local Host Interface   35
|
3.6
| Buffer Management   36
|
| 3.6.1
| Large Buffer Solution   36
|
| 3.6.2
| Linked List Solutions (mbufs)   36
|
| 3.6.3
| Our Example Solution   37
|
| 3.6.4
| Other Buffer Issues   37
|
3.7
| Demultiplexing Incoming Packets   38
|
3.8
| Summary   40
|
| For Further Study   40
|
| Exercises   40
|
4.1
| Introduction   41
|
4.2
| Conceptual Organization Of ARP Software   42
|
4.3
| Example ARP Design   42
|
4.4
| Data Structures For The ARP Cache   43
|
4.5
| ARP Output Processing   46
|
| 4.5.1
| Searching The ARP Cache   46
|
| 4.5.2
| Broadcasting An ARP Request   47
|
| 4.5.3
| Output Procedure   49
|
4.6
| ARP Input Processing   51
|
| 4.6.1
| Adding Resolved Entries To The Table   51
|
| 4.6.2
| Sending Waiting Packets   52
|
| 4.6.3
| ARP Input Procedure   53
|
4.7
| ARP Cache Management   56
|
| 4.7.1
| Allocating A Cache Entry   56
|
| 4.7.2
| Periodic Cache Maintenance   58
|
| 4.7.3
| Deallocating Queued Packets   59
|
4.8
| ARP Initialization   60
|
4.9
| ARP Configuration Parameters   61
|
4.10
| Summary   61
|
| For Further Study   61
|
| Exercises   62
|
5.1
| Introduction   63
|
5.2
| The Central Switch   63
|
5.3
| IP Software Design   64
|
5.4
| IP Software Organization And Datagram Flow   65
|
| 5.4.1
| A Policy For Selecting Incoming Datagrams   65
|
| 5.4.2
| Allowing The IP Process To Block   67
|
| 5.4.3
| Definitions Of Constants Used By IP   71
|
| 5.4.4
| Checksum Computation   74
|
| 5.4.5
| Handling Directed Broadcasts   75
|
| 5.4.6
| Recognizing A Broadcast Address   77
|
5.5
| Byte-Ordering In The IP Header   78
|
5.6
| Sending A Datagram To IP   80
|
| 5.6.1
| Sending Locally-Generated Datagrams   80
|
| 5.6.2
| Sending Incoming Datagrams   82
|
5.7
| Table Maintenance   83
|
5.8
| Summary   84
|
| For Further Study   85
|
| Exercises   85
|
6.1
| Introduction   87
|
6.2
| Route Maintenance And Lookup   87
|
6.3
| Routing Table Organization   88
|
6.4
| Routing Table Data Structures   89
|
6.5
| Origin Of Routes And Persistence   91
|
6.6
| Routing A Datagram   91
|
| 6.6.1
| Utility Procedures   91
|
| 6.6.2
| Obtaining A Route   95
|
| 6.6.3
| Data Structure Initialization   97
|
6.7
| Periodic Routing Table Maintenance   98
|
| 6.7.1
| Adding A Route   100
|
| 6.7.2
| Deleting A Route   103
|
6.8
| IP Options Processing   106
|
6.9
| Summary   107
|
| For Further Study   107
|
| Exercises   108
|
7.1
| Introduction   109
|
7.2
| Fragmenting Datagrams   109
|
| 7.2.1
| Fragmenting Fragments   110
|
7.3
| Implementation Of Fragmentation   110
|
| 7.3.1
| Sending One Fragment   112
|
| 7.3.2
| Copying A Datagram Header   113
|
7.4
| Datagram Reassembly   115
|
| 7.4.1
| Data Structures   115
|
| 7.4.2
| Mutual Exclusion   117
|
| 7.4.3
| Adding A Fragment To A List   117
|
| 7.4.4
| Discarding During Overflow   119
|
| 7.4.5
| Testing For A Complete Datagram   121
|
| 7.4.6
| Building A Datagram From Fragments   122
|
7.5
| Maintenance Of Fragment Lists   124
|
7.6
| Initialization   126
|
7.7
| Summary   126
|
| For Further Study   127
|
| Exercises   127
|
8.1
| Introduction   129
|
8.2
| ICMP Message Formats   129
|
8.3
| Implementation Of ICMP Messages   129
|
8.4
| Handling Incoming ICMP Messages   132
|
8.5
| Handling An ICMP Redirect Message   134
|
8.6
| Setting A Subnet Mask   135
|
8.7
| Choosing A Source Address For An ICMP Packet   137
|
8.8
| Generating ICMP Error Messages   138
|
8.9
| Avoiding Errors About Errors   141
|
8.10
| Allocating A Buffer For ICMP   142
|
8.11
| The Data Portion Of An ICMP Message   144
|
8.12
| Generating An ICMP Redirect Message   146
|
8.13
| Summary   147
|
| For Further Study   147
|
| Exercises   147
|
9.1
| Introduction   149
|
9.2
| Maintaining Multicast Group Membership Information   149
|
9.3
| A Host Group Table   150
|
9.4
| Searching For A Host Group   152
|
9.5
| Adding A Host Group Entry To The Table   153
|
9.6
| Configuring The Network Interface For A Multicast Address   155
|
9.7
| Translation Between IP and Hardware Multicast Addresses   157
|
9.8
| Removing A Multicast Address From The Host Group Table   159
|
9.9
| Joining A Host Group   160
|
9.10
| Maintaining Contact With A Multicast Router   161
|
9.11
| Implementing IGMP Membership Reports   163
|
9.12
| Computing A Random Delay   165
|
9.13
| A Process To Send IGMP Reports   166
|
9.14
| Handling Incoming IGMP Messages   167
|
9.15
| Leaving A Host Group   169
|
9.16
| Initialization Of IGMP Data Structures   170
|
9.17
| Summary   171
|
| For Further Study   172
|
| Exercises   172
|
10.1
| Introduction   173
|
10.2
| UDP Ports And Demultiplexing   173
|
| 10.2.1
| Ports Used For Pairwise Communication   174
|
| 10.2.2
| Ports Used For Many-One Communication   175
|
| 10.2.3
| Modes Of Operation   175
|
| 10.2.4
| The Subtle Issue Of Demultiplexing   175
|
10.3
| UDP Input Processing   177
|
| 10.3.1
| UDP Declarations   177
|
| 10.3.2
| Incoming Datagram Queue Declarations   179
|
| 10.3.3
| Mapping UDP Port Numbers To Queues   181
|
| 10.3.4
| Allocating A Free Queue   182
|
| 10.3.5
| Converting To And From Network Byte Order   183
|
| 10.3.6
| Processing An Arriving Datagram   184
|
| 10.3.7
| UDP Checksum Computation   186
|
10.4
| UDP Output Processing   187
|
| 10.4.1
| Sending A UDP Datagram   188
|
10.5
| Summary   190
|
| For Further Study   191
|
| Exercises   191
|
11.1
| Introduction   193
|
11.2
| Overview Of TCP Software   194
|
11.3
| Transmission Control Blocks   194
|
11.4
| TCP Segment Format   199
|
11.5
| Sequence Space Comparison   200
|
11.6
| TCP Finite State Machine   202
|
11.7
| Example State Transition   204
|
11.8
| Declaration Of The Finite State Machine   204
|
11.9
| TCB Allocation And Initialization   206
|
| 11.9.1
| Allocating A TCB   206
|
| 11.9.2
| Deallocating A TCB   207
|
11.10
| Implementation Of The Finite State Machine   208
|
11.11
| Handling An Input Segment   209
|
| 11.11.1
| Converting A TCP Header To Local Byte Order   211
|
| 11.11.2
| Computing The TCP Checksum   212
|
| 11.11.3
| Finding The TCB For A Segment   213
|
| 11.11.4
| Checking Segment Validity   215
|
| 11.11.5
| Choosing A Procedure For the Current State   217
|
11.12
| Summary   218
|
| For Further Study   219
|
| Exercises   219
|
12.1
| Introduction   221
|
12.2
| CLOSED State Processing   221
|
12.3
| Graceful Shutdown   222
|
12.4
| Timed Delay After Closing   222
|
12.5
| TIME-WAIT State Processing   223
|
12.6
| CLOSING State Processing   225
|
12.7
| FIN-WAIT-2 State Processing   226
|
12.8
| FIN-WAIT-1 State Processing   227
|
12.9
| CLOSE-WAIT State Processing   229
|
12.10
| LAST-ACK State Processing   231
|
12.11
| ESTABLISHED State Processing   232
|
12.12
| Processing Urgent Data In A Segment   233
|
12.13
| Processing Other Data In A Segment   235
|
12.14
| Keeping Track Of Received Octets   237
|
12.15
| Aborting A TCP Connection   240
|
12.16
| Establishing A TCP Connection   241
|
12.17
| Initializing A TCB   241
|
12.18
| SYN-SENT State Processing   243
|
12.19
| SYN-RECEIVED State Processing   244
|
12.20
| LISTEN State Processing   247
|
12.21
| Initializing Window Variables For A New TCB   248
|
12.22
| Summary   250
|
| For Further Study   250
|
| Exercises   250
|
13.1
| Introduction   251
|
13.2
| Controlling TCP Output Complexity   251
|
13.3
| The Four TCP Output States   252
|
13.4
| TCP Output As A Process   252
|
13.5
| TCP Output Messages   253
|
13.6
| Encoding Output States And TCB Numbers   254
|
13.7
| Implementation Of The TCP Output Process   254
|
13.8
| Mutual Exclusion   255
|
13.9
| Implementation Of The IDLE State   256
|
13.10
| Implementation Of The PERSIST State   256
|
13.11
| Implementation Of The TRANSMIT State   257
|
13.12
| Implementation Of The RETRANSMIT State   259
|
13.13
| Sending A Segment   259
|
13.14
| Computing The TCP Data Length   263
|
13.15
| Computing Sequence Counts   264
|
13.16
| Other TCP Procedures   265
|
| 13.16.1
| Sending A Reset   265
|
| 13.16.2
| Converting To Network Byte Order   266
|
| 13.16.3
| Waiting For Space In The Output Buffer   267
|
| 13.16.4
| Awakening Processes Waiting For A TCB   269
|
| 13.16.5
| Choosing An Initial Sequence Number   270
|
13.17
| Summary   271
|
| For Further Study   272
|
| Exercises   272
|
14.1
| Introduction   273
|
14.2
| A General Data Structure For Timed Events   273
|
14.3
| A Data Structure For TCP Events   274
|
14.4
| Timers, Events, And Messages   275
|
14.5
| The TCP Timer Process   276
|
14.6
| Deleting A TCP Timer Event   278
|
14.7
| Deleting All Events For A TCB   280
|
14.8
| Determining The Time Remaining For An Event   281
|
14.9
| Inserting A TCP Timer Event   282
|
14.10
| Starting TCP Output Without Delay   283
|
14.11
| Summary   285
|
| For Further Study   285
|
| Exercises   285
|
15.1
| Introduction   287
|
15.2
| The Difficulties With Adaptive Retransmission   288
|
15.3
| Tuning Adaptive Retransmission   288
|
15.4
| Retransmission Timer And Backoff   288
|
| 15.4.1
| Karn's Algorithm   288
|
| 15.4.2
| Retransmit Output State Processing   289
|
15.5
| Window-Based Flow Control   291
|
| 15.5.1
| Silly Window Syndrome   291
|
| 15.5.2
| Receiver-Side Silly Window Avoidance   292
|
| 15.5.3
| Optimizing Performance After A Zero Window   293
|
| 15.5.4
| Adjusting The Sender's Window   293
|
15.6
| Maximum Segment Size Computation   295
|
| 15.6.1
| The Sender's Maximum Segment Size   295
|
| 15.6.2
| Option Processing   297
|
| 15.6.3
| Advertising An Input Maximum Segment Size   298
|
15.7
| Congestion Avoidance And Control   299
|
| 15.7.1
| Multiplicative Decrease   299
|
15.8
| Slow-Start And Congestion Avoidance   300
|
| 15.8.1
| Slow-start   300
|
| 15.8.2
| Slower Increase After Threshold   300
|
| 15.8.3
| Implementation Of Congestion Window Increase   301
|
15.9
| Round Trip Estimation And Timeout   303
|
| 15.9.1
| A Fast Mean Update Algorithm   303
|
| 15.9.2
| Handling Incoming Acknowledgements   305
|
| 15.9.3
| Generating Acknowledgments For Data Outside The Window   307
|
| 15.9.4
| Changing Output State After Receiving An Acknowledgement   308
|
15.10
| A Miscellaneous Note   309
|
15.11
| Summary   310
|
| For Further Study   310
|
| Exercises   310
|
16.1
| Introduction   313
|
16.2
| Out-Of-Band Signaling   313
|
16.3
| Urgent Data   314
|
16.4
| Interpreting The Standard   314
|
| 16.4.1
| The Out-Of-Band Data Interpretation   314
|
| 16.4.2
| The Data Mark Interpretation   316
|
16.5
| Configuration For Berkeley Urgent Pointer Interpretation   317
|
16.6
| Informing An Application   317
|
| 16.6.1
| Multiple Concurrent Application Programs   318
|
16.7
| Reading Data From TCP   318
|
16.8
| Sending Urgent Data   320
|
16.9
| TCP Push Function   321
|
16.10
| Interpreting Push With Out-Of-Order Delivery   322
|
16.11
| Implementation Of Push On Input   323
|
16.12
| Summary   324
|
| For Further Study   324
|
| Exercises   324
|
17.1
| Introduction   327
|
17.2
| Interfacing Through A Device   327
|
| 17.2.1
| Single Byte I/O   328
|
| 17.2.2
| Extensions For Non-Transfer Functions   329
|
17.3
| TCP Connections As Devices   329
|
17.4
| An Example TCP Client Program   330
|
17.5
| An Example TCP Server Program   331
|
17.6
| Implementation Of The TCP Master Device   333
|
| 17.6.1
| TCP Master Device Open Function   333
|
| 17.6.2
| Forming A Passive TCP Connection   335
|
| 17.6.3
| Forming An Active TCP Connection   336
|
| 17.6.4
| Allocating An Unused Local Port   337
|
| 17.6.5
| Completing An Active Connection   339
|
| 17.6.6
| Control For The TCP Master Device   340
|
17.7
| Implementation Of A TCP Slave Device   341
|
| 17.7.1
| Input From A TCP Slave Device   341
|
| 17.7.2
| Single Byte Input From A TCP Slave Device   344
|
| 17.7.3
| Output Through A TCP Slave Device   344
|
| 17.7.4
| Closing A TCP Connection   347
|
| 17.7.5
| Control Operations For A TCP Slave Device   348
|
| 17.7.6
| Accepting Connections From A Passive Device   350
|
| 17.7.7
| Changing The Size Of A Listen Queue   350
|
| 17.7.8
| Acquiring Statistics From A Slave Device   351
|
| 17.7.9
| Setting Or Clearing TCP Options   354
|
17.8
| Initialization Of A Slave Device   355
|
17.9
| Summary   356
|
| For Further Study   356
|
| Exercises   356
|
18.1
| Introduction   359
|
18.2
| Active And Passive Mode Participants   360
|
18.3
| Basic RIP Algorithm And Cost Metric   360
|
18.4
| Instabilities And Solutions   361
|
| 18.4.1
| Count To Infinity   361
|
| 18.4.2
| Gateway Crashes And Route Timeout   361
|
| 18.4.3
| Split Horizon   362
|
| 18.4.4
| Poison Reverse   362
|
| 18.4.5
| Route Timeout With Poison Reverse   363
|
| 18.4.6
| Triggered Updates   363
|
| 18.4.7
| Randomization To Prevent Broadcast Storms   364
|
18.5
| Message Types   364
|
18.6
| Protocol Characterization   365
|
18.7
| Implementation Of RIP   366
|
| 18.7.1
| The Two Styles Of Implementation   366
|
| 18.7.2
| Declarations   366
|
| 18.7.3
| Conceptual Organization For Output   369
|
18.8
| The Principle RIP Process   369
|
| 18.8.1
| Must Be Zero Field Must Be Zero   371
|
| 18.8.2
| Processing An Incoming Response   373
|
| 18.8.3
| Locking During Update   374
|
| 18.8.4
| Verifying An Address   374
|
18.9
| Responding To An Incoming Request   375
|
18.10
| Generating Update Messages   377
|
18.11
| Initializing Copies Of An Update Message   379
|
| 18.11.1
| Adding Routes To Copies Of An Update Message   380
|
| 18.11.2
| Computing A Metric To Advertise   382
|
| 18.11.3
| Allocating A Datagram For A RIP Message   383
|
18.12
| Generating Periodic RIP Output   384
|
18.13
| Limitations Of RIP   385
|
18.14
| Summary   385
|
| For Further Study   386
|
| Exercises   386
|
19.1
| Introduction   387
|
19.2
| OSPF Configuration And Options   388
|
19.3
| OSPF's Graph-Theoretic Model   388
|
19.4
| OSPF Declarations   392
|
| 19.4.1
| OSPF Packet Format Declarations   392
|
| 19.4.2
| OSPF Interface Declarations   393
|
| 19.4.3
| Global Constant And Data Structure Declarations   395
|
19.5
| Adjacency And Link State Propagation   398
|
19.6
| Discovering Neighboring Gateways With Hello   399
|
19.7
| Sending Hello Packets   401
|
| 19.7.1
| A Template For Hello Packets   403
|
| 19.7.2
| The Hello Output Process   405
|
19.8
| Designated Router Concept   407
|
19.9
| Electing A Designated Router   407
|
19.10
| Reforming Adjacencies After A Change   411
|
19.11
| Handling Arriving Hello Packets   414
|
19.12
| Adding A Gateway To The Neighbor List   416
|
19.13
| Neighbor State Transitions   418
|
19.14
| OSPF Timer Events And Retransmissions   420
|
19.15
| Determining Whether Adjacency Is Permitted   422
|
19.16
| Handling OSPF input   423
|
19.17
| Declarations And Procedures For Link State Processing   426
|
19.18
| Generating Database Description Packets   429
|
19.19
| Creating A Template   430
|
19.20
| Transmitting A Database Description Packet   431
|
19.21
| Handling An Arriving Database Description Packet   433
|
| 19.21.1
| Handling A Packet In The EXSTART State   435
|
| 19.21.2
| Handling A Packet In The EXCHNG State   437
|
| 19.21.3
| Handling A Packet In The FULL State   438
|
19.22
| Handling Link State Request Packets   440
|
19.23
| Building A Link State Summary   442
|
19.24
| OSPF Utility Procedures   443
|
19.25
| Summary   446
|
| For Further Study   447
|
| Exercises   447
|
20.1
| Introduction   449
|
20.2
| Server Organization And Name Mapping   450
|
20.3
| MIB Variables   451
|
| 20.3.1
| Fields Within Tables   451
|
20.4
| MIB Variable Names   452
|
| 20.4.1
| Numeric Representation Of Names   452
|
20.5
| Lexicographic Ordering Among Names   453
|
20.6
| Prefix Removal   453
|
20.7
| Operations Applied To MIB Variables   454
|
20.8
| Names For Tables   454
|
20.9
| Conceptual Threading Of The Name Hierarchy   455
|
20.10
| Data Structure For MIB Variables   456
|
| 20.10.1
| Using Separate Functions To Perform Operations   458
|
20.11
| A Data Structure For Fast Lookup   459
|
20.12
| Implementation Of The Hash Table   460
|
20.13
| Specification Of MIB Bindings   460
|
20.14
| Internal Variables Used In Bindings   467
|
20.15
| Hash Table Lookup   469
|
20.16
| SNMP Structures And Constants   471
|
20.17
| ASN.1 Representation Manipulation   477
|
| 20.17.1
| Representation Of Length   478
|
| 20.17.2
| Converting Integers To ASN.1 Form   481
|
| 20.17.3
| Converting Object Ids To ASN.1 Form   483
|
| 20.17.4
| A Generic Routine For Converting Values   486
|
20.18
| Summary   488
|
| For Further Study   489
|
| Exercises   489
|
21.1
| Introduction   491
|
21.2
| Data Representation In The Server   491
|
21.3
| Server Implementation   492
|
21.4
| Parsing An SNMP Message   495
|
21.5
| Converting ASN.1 Names In The Binding List   500
|
21.6
| Resolving A Query   501
|
21.7
| Interpreting The Get-Next Operation   504
|
21.8
| Indirect Application Of Operations   504
|
21.9
| Indirection For Tables   507
|
21.10
| Generating A Reply Message Backward   509
|
21.11
| Converting From Internal Form to ASN.1   512
|
21.12
| Utility Functions Used By The Server   514
|
21.13
| Implementation Of An SNMP Client   515
|
21.14
| Initialization Of Variables   517
|
21.15
| Summary   519
|
| For Further Study   519
|
| Exercises   520
|
22.1
| Introduction   521
|
22.2
| Table Access   522
|
22.3
| Object Identifiers For Tables   522
|
22.4
| Address Entry Table Functions   522
|
| 22.4.1
| Get Operation For The Address Entry Table   524
|
| 22.4.2
| Get-First Operation For The Address Entry Table   526
|
| 22.4.3
| Get-Next Operation For The Address Entry Table   527
|
| 22.4.4
| Incremental Search In The Address Entry Table   528
|
| 22.4.5
| Set Operation For The Address Entry Table   529
|
22.5
| Net-To-Media Table Functions   530
|
| 22.5.1
| Get Operation For The Net-To-Media Table   532
|
| 22.5.2
| Get-First Operation For The Net-To-Media Table   534
|
| 22.5.3
| Get-Next Operation For The Net-To-Media Table   535
|
| 22.5.4
| Incremental Search In The Net-To-Media Table   537
|
| 22.5.5
| Order From Chaos   539
|
| 22.5.6
| Set Operation For The Net-To-Media Table   539
|
22.6
| Network Interface Table Functions   541
|
| 22.6.1
| Interface Table ID Matching   541
|
| 22.6.2
| Get Operation For The Network Interface Table   543
|
| 22.6.3
| Get-First Operation For The Network Interface Table   546
|
| 22.6.4
| Get-Next Operation For The Network Interface Table   547
|
| 22.6.5
| Set Operation For The Network Interface Table   549
|
22.7
| Routing Table Functions   550
|
| 22.7.1
| Get Operation For The Routing Table   551
|
| 22.7.2
| Get-First Operation For The Routing Table   554
|
| 22.7.3
| Get-Next Operation For The Routing Table   555
|
| 22.7.4
| Incremental Search In The Routing Table   557
|
| 22.7.5
| Set Operation For The Routing Table   558
|
22.8
| TCP Connection Table Functions   560
|
| 22.8.1
| Get Operation For The TCP Connection Table   562
|
| 22.8.2
| Get-First Operation For The TCP Connection Table   563
|
| 22.8.3
| Get-Next Operation For The TCP Connection Table   565
|
| 22.8.4
| Incremental Search In The TCP Connection Table   566
|
| 22.8.5
| Set Operation For The TCP Connection Table   567
|
22.9
| UDP Listener Table   569
|
| 22.9.1
| Get Operation For The UDP Listener Table   570
|
| 22.9.2
| Get-First Operation For The UDP Listener Table   572
|
| 22.9.3
| Get-Next Operation For The UDP Listener Table   573
|
| 22.9.4
| Incremental Search In The UDP Listener Table   574
|
| 22.9.5
| Set Operation For The UDP Listener Table   575
|
22.10
| Utility Routines To Convert IP Addresses   576
|
22.11
| Summary   578
|
| For Further Study   578
|
| Exercises   578
|