TCP/IP Lean Web Servers for Embedded Systems Second Edition Jeremy Bentham CMP Books Lawrence, Kansas 66046 CMP Books CMP Media LLC 1601 West 23rd Street, Suite 200 Lawrence, Kansas 66046 USA www.cmpbooks.com Designations used by companies to distinguish their products are often claimed as trademarks In all instances where CMP Books is aware of a trademark claim, the product name appears in initial capital letters, in all capital letters, or in accordance with the vendor’s capitalization preference Readers should contact the appropriate companies for more complete information on trademarks and trademark registrations All trademarks and registered trademarks in this book are the property of their respective holders Copyright © 2002 by Jeremy Bentham, except where noted otherwise Published by CMP Books, CMP Media LLC All rights reserved Printed in the United States of America No part of this publication may be reproduced or distributed in any form or by any means, or stored in a database or retrieval system, without the prior written permission of the publisher; with the exception that the program listings may be entered, stored, and executed in a computer system, but they may not be reproduced for publication The programs in this book are presented for instructional value The programs have been carefully tested, but are not guaranteed for any particular purpose The publisher does not offer any warranties and does not guarantee the accuracy, adequacy, or completeness of any information herein and is not responsible for any errors or omissions The publisher assumes no liability for damages resulting from the use of the information in this book or for any infringement of the intellectual property rights of third parties that would result from the use of this information Acquisitions Editor: Managing Editor: Editor: Layout production: Cover art: Cover design: Robert Ward Michelle O’Neal Rita Sooby Kris Peaslee Robert Ward Damien Castaneda Distributed in the U.S and Canada by: Publishers Group West 1700 Fourth Street Berkeley, California 94710 1-800-788-3123 www.pgw.com ISBN: 1-57820-108-X To Fred, Ilse, and Jane Table of Contents Preface xi The Lean Plan xi Embedded Systems xii The Hardware xiii The Network xiii The Operating System xiv The Development Environment xiv The Software xv Acknowledgments xv Chapter Introduction The Lean Plan Getting Started Software Introduction Network Hardware Device Drivers Configuration File Format 14 Process Timer 14 State Machines 17 Buffering 21 Coding Conventions .29 v vi Table of Contents Chapter Introduction to Protocols: SCRATCHP 31 Overview Protocol SCRATCHP Services Logical Connections Packet Format Addressing Protocol Identification Reception and Transmission Implementation Summary Chapter Network Addressing and Debugging 71 Overview Internetworks IP Addresses Address Resolution ARP Scanner Using ARPSCAN for Network Debugging Ethernet IEEE 802.3 Networks Summary Chapter 31 32 34 36 38 42 43 46 49 68 71 71 74 75 77 84 89 90 93 The Network Interface: IP and ICMP 95 Overview 95 TCP/IP Stack 95 Internet Control Message Protocol 110 Ping Implementation 112 Router Implementation 122 Summary 131 Chapter User Datagram Protocol: UDP 135 Overview Ports and Sockets Datagram Format UDP Checksum UDP Utility Summary 135 135 138 140 142 152 Table of Contents Chapter vii Transmission Control Protocol: TCP 155 Overview 155 TCP Concepts 156 TCP Implementation 169 TCP Application — Telnet 188 Telnet Implementation 190 Using Telnet 199 Conclusion 203 Chapter Hypertext Transfer Protocol: HTTP 207 Overview 207 HTTP GET Method .207 Simple Web Server 211 Introducing HTML 217 State Machine Implementation 226 Summary 235 Chapter Embedded Gateway Interface: EGI 237 Overview 237 Interactive Displays 237 Standard CGI interface .244 EGI Implementation 249 Summary 267 Chapter Miniature Web Server Design 269 Overview 269 Microcontroller Software Development 270 Hardware 270 Development Environment 274 Software Techniques 275 Web Server Protocols 278 Summary 290 Chapter 10 TCP/IP on a PICmicro® Microcontroller 291 Overview 291 Peripherals 291 Block Diagram 294 Circuit Diagram 294 Low-Level Software 296 viii Table of Contents SLIP and IP Drivers ICMP TCP Summary 303 319 321 329 Chapter 11 PWEB: Miniature Web Server for the PICmicro® 331 Overview Web Server ROM File System Using the PWEB Server Dynamic Content Dynamic Web Pages Summary 331 331 336 349 351 355 367 Chapter 12 ChipWeb — Miniature Ethernet Web Server 369 Overview Hardware Ethernet Driver LCD Driver Other Drivers Protocols Protocol Debugging User Interface Configuration Conclusion Chapter 13 369 370 375 383 386 386 398 398 404 409 Point-to-Point Protocol: PPP 411 Overview Design of PPP Protocol Components Sample PPP Negotiation PPP Implementation Summary 411 412 415 420 426 433 Table of Contents ix Chapter 14 UDP Clients, Servers, and Fast Data Transfer 435 Overview 435 Client–Server Networking 435 Peer-to-Peer Networking 437 Beyond the Web Server .438 Buffer Enhancements 438 IP and ICMP Processing 445 UDP Servers 448 UDP Time Client 451 High-Speed Data Transfer 457 Hardware 458 Software 461 Summary 467 Chapter 15 Dynamic Host Configuration Protocol: DHCP 471 Overview 471 DHCP Methodology 472 Sample Transaction 477 DHCP Implementation .481 Summary 487 Chapter 16 TCP Clients, SMTP, and POP3 Email 489 Overview 489 TCP Client Techniques .490 TCP Client Implementation 494 SMTP Email Client .502 POP3 Email Client 509 Summary 515 Appendix A Configuration Notes 517 Network Configuration 517 Addressing 519 Testing the Network .519 Windows SLIP Configuration .520 x Table of Contents Appendix B Resources 523 Publications 523 Hardware 524 Software 524 Appendix C Software on the CD-ROM 527 ARPSCAN DATAGRAM NETMON PICmicro® Software PING ROUTER SCRATCHP TELNET WEBROM WEBSERVE WEB_EGI Appendix D 528 529 529 530 530 531 531 532 532 533 533 PICmicro®-Specific Issues 535 Compiler Support 535 Function Index 541 Stucture Index 545 Index 547 What’s on the CD-ROM? 576 Index implementation 426 IP data 425 message decoding 429 negotiation 414, 420 option format 416 reception and transmission 427 state machine 417 polling 50, 116, 195, 278, 306 port A (PICmicro) 293 B (PICmicro) 293, 301 C (PICmicro) 367 destination 136, 139, 149, 284, 322 number 79, 136–138, 149, 181–182, 185, 190, 326, 518 Chargen 137 Daytime 137, 167, 325 Discard 137, 167 Echo 137, 167 ephemeral 137, 167, 182, 190 FTP 167 HTTP 167, 325 SMTP 167 SNMP 137 Telnet 167, 196 TFTP 137 Time 137, 167 well-known 136–137, 167, 190 originating 136 TCP 325 UDP 137 PPP See point-to-point protocol (PPP) process timer 14 programmer PROM 338, 343, 350 protocol address resolution (ARP) 386–388 analyzer 51, 85–87, 92, 276 compression control 415 Daytime 136, 151, 199 debugging 398 definition 31 dynamic host configuration 471 hypertext transfer (HTTP) 394 identification 31, 43 Internet (IP) 388 Internet control message (ICMP) 389 555 IP control 411, 414–417, 423, 425 link control 411, 414–415, 417, 420, 431 packet 89 password authentication 411, 414–415, 423 point-to-point 411–433 post office (POP3) 509 SCRATCHP 69 stack 33, 95–96 transmission control (TCP) 390, 489 Web server 278 pseudoheader, IP 140, 168, 171, 276, 285– 286, 322–324 put_ 315 PWEB 331–368 R RAM banks 537 RAM limitation 275 read, sequential 337 README file real-time clock (RTC) 294–295, 356, 358 receive ICMP 319 TCP 322 Receive buffer 46, 62–63, 174, 176, 195, 285, 303, 318, 323 reception, packet 45 reliable delivery 6, request for comment (RFC) 90–91 retransmission, TCP 186 RFC See request for comment (RFC) RHIDE 2, ROM file system 335–336 file transfer 346 flash 271, 296 image utility 338, 349–350, 368, 406, 532 PICmicro 271, 273 Web page 350 router 72–75, 95–96, 108, 122–125, 129– 131, 133, 144 destination unreachable 110 implementation 122–131 subnetwork 120 time to live 101 556 Index Router utility 531 routing algorithm 123 datagram 124, 288 network 72 test 130 RTC See real-time clock (RTC) S scratch protocol (SCRATCHP) 31–70, 89, 531 flags 38 utility 531 segment format 166, 284 long 286 maximum size 168–170 TCP 166, 168, 170, 175–176, 185, 199, 283–285, 324 selector, device 336 sensor, temperature 293, 296, 300 sequence number 36–37, 116, 156, 158–159, 176, 281–282, 319, 326 space 158–161, 163, 179, 203, 281 sequencing block 36 byte 37–38 serial driver 8–9 link 3, 5–6, 277, 280, 288, 310, 318, 335, 352, 367, 517–518, 520 serial line internet protocol (SLIP) 3, 8–9, 39, 75, 122, 139, 274, 289, 291, 327, 518 addressing 75–77 configuration 327 datagram 97 decoding 303–304 differences from Ethernet 40 driver 303 encoding 286, 306, 318 escape codes 289 escape sequence 276 frame 96, 98, 289, 349 frame header size 97 frame storage 31 interface 127 link 112 MTU 121–122 ping 131 receive 303 transmit 306 Windows configuration 520 server state 164 text 332 Web 2–3, 9, 22, 163, 207, 211–217, 233, 269–291, 296, 331–368, 518 server side includes (SSI) 332 service Daytime 284, 327, 448 Echo 448 SCRATCHP 34 signal 8, 18–19, 50–59, 88–89, 163, 177, 293 simultaneous request 136 skip_ 277, 310, 314 slider 264, 267 sliding window 38 SLIP See serial line Internet protocol (SLIP) socket Active Open 181, 190 Closed 163 Passive Open 176, 183, 190 TCP 280 UDP 137 source code, format 30 source files 132, 329 source service access point (SSAP) 90 SSI See server side includes (SSI) stack hardware 271, 273, 298 protocol 33, 95–96 TCP/IP 1, 74, 88, 95–108, 135, 164, 175, 178–179, 181, 183, 188, 190– 191, 195, 211, 226, 269, 275, 280, 282, 291, 325, 331 state CONNECTED 54–55 IDLE 55 state machine 18, 21 DHCP 481 HTTP 226 miniature 195 Index PPP 417 SCRATCHP 50, 54 TCP 160, 175, 190, 282, 497–500 UDP 146 steam, one engine in 37 stream of bytes string handling 351 matching 360 subnetwork 73–74, 90, 120, 122 subnetwork access protocol (SNAP) 90–92 switch display 239 state storage 262 T table, HTML 223 tag EGI 260 HTML 215, 217–218 TCP See transmission control protocol (TCP) telephone state diagram 19 state machine 18 state table 20 Telnet application 190, 194, 532 client 191, 195–196 implementation 190 option 195, 205 server 197 temperature sensor 293, 296, 300 terminal emulation 167, 190 test, routing 130 text server 332 topology, network bus star transfer unit, maximum 7, 13, 92, 101, 105, 121–122, 169 transfer, data 31, 68, 157–160, 164, 200, 280–281, 283 transmission control protocol (TCP) 1, 7–8, 24, 71, 95–96, 155, 164, 168–205, 207, 211–213, 224, 226, 489–516 557 acknowledgment number 156–157, 167, 176, 178, 326 application 188 approach to services 34 callback 190 checksum 276, 285–286 client 280 client implementation 494 client startup 495 client techniques 490 datagram 318 discarding data 286 Ethernet driver modifications 492 FIN 158–160, 163–164, 167, 174, 179, 183–184, 201–203, 281, 283, 326–328 flags 167, 176, 184, 186 half-close 156, 164, 180, 184, 328 handler 321 header 166, 168–169, 275, 283–284, 286, 303, 310, 318, 322–323, 333, 349, 351 LANs 91 microcontroller 270 modem emulation 291 NIC RAM allocation 491 one-segment data transfer 283 options 168 parsing 322 port number, well-known 136–137, 167, 190 post office protocol (POP3) email client 509–515 protocol 101, 270 protocol family 95 receive 322 receive handler 496 reliable connection 280 reset 280, 326 retransmission 186 router 122 secondary NIC transmit buffer 490 segment 166, 168, 170, 175–176, 185, 199, 281–286, 288, 324, 326 format 166, 284 558 Index sequence number 36–37, 116, 156, 158–159, 176, 281–282, 319, 326 space 158–161, 163, 179, 203, 281 sequencer 325, 327, 332 sequencing 157–158 service access points 90 simple mail transfer protocol (SMTP) 502– 508 socket 280 socket definitions 494 stack 74, 88, 95–96, 269, 275, 282, 325 state 160, 162, 169, 175, 177 changes 17–19, 54, 59, 163–164, 175, 200 diagram 19, 160, 162, 181, 282 machine 160, 175, 190, 195, 225– 226, 282 state machine 497–500 states Active Close 183 Active Open 181–183, 190, 200 ARP Received 182 Close Wait 163–164, 180 Closed 156, 163, 176, 183–185, 191, 197, 201, 328 Closing 158, 174, 185, 190–191, 194, 196, 201 Established 163–164, 174, 177, 179, 183, 200 FIN Wait 163, 184 Last ACK 163–164, 181 Listen 163, 165, 176, 183 SYN Received 163, 177 SYN Sent 163, 168, 183 Timed Wait 163–164, 185 SYN 158–160, 163, 165, 167–168, 174, 177 Telnet options 327 timeouts 500 transaction 335 transaction log 335 transaction record 88 transmit 502 variable block size 38 Web server protocol 280 window 168, 176 window size 159 transmission control protocol (TCP)/Internet protocol (IP) 291–329 transmission, low-level packet 31, 69 transmissions control protocol (TCP) 390 transmit checksum 142 ICMP 320 IP 318 polling 306 ready flag 307 SLIP 286, 306–307 TCP 324 Transmit buffer 44, 46, 63, 174, 176, 191, 213, 224–227, 251, 257–258, 277, 303, 307, 320, 324 type/length field 10–11 types, data 16, 29, 284, 297, 312 U UDP See user datagram protocol unicast address 76 universal resource locator (URL) 240–241, 243–245, 253–255, 351 decoding 253–255 dynamic 241 unreachable destination 74, 110, 123, 149, 151 unreliable delivery 7–8 urgent pointer 285 URL See universal resource locator (URL) user datagram protocol (UDP) 96, 135–142, 144–146, 149–153, 167–168, 170–173, 199, 435–469 application 135 buffer enhancements 438–444 checksum 139–143, 168 client 451–457 client software 463 client–server networking 435 connectionless 96, 105 datagram 105, 529 format 138 fragment 139 Index hardware 458–461 high-speed data transfer 457 IP and ICMP processing 445 length 139, 141 Linux client 466 microcontroller software 463 peer-to-peer networking 437 protocol 101 server 448–450 socket 135, 137 software 461–467 time protocols 151 transmission 450 transmit 143 utility 135, 142, 144, 146, 529 video 458–462 Windows client 464 user interface dynamic Web pages (HTML) 398 LCD display 403 navigation frame 401 status display frame 400 V variable connection 251 counterbalanced 353 substitution 259, 337–338, 346, 351, 362, 364 version, IP 101 Visual C++ 2, 4, 29 W Web client 36, 160, 163–164, 234, 279–280 page 197, 280, 307, 332, 335, 337, 349– 350, 352, 355, 363 server 2–3, 9, 22, 163, 207, 211–217, 233, 269–291, 296, 331–368, 518 protocols 278 WEB_EGI utility 533 559 WEBROM 338, 349–350, 368, 406, 532 See ROM, image utility source files 368 utility 532 Webserve utility 533 well-known port number 136–137, 167, 190 window size, transmit 285 window, sliding 38 Windows configuration 520 X X-bitmap 209–210, 349 What’s on the CD-ROM? The CD-ROM that accompanies TCP/IP Lean: Web Servers for Embedded Systems, Second edition, contains complete source code to everything in this book so that you, as purchaser of the book, can experiment However, the author retains full copyright to the software, and it may only be distributed in conjunction with the book CD-ROM TCPLEAN Subdirectories BC31 BC45 DJGPP INFO PCM ROMDOCS SOURCE VC6 WEBDOCS Borland C v3.1 files Borland C v4.5 files DJGPP (GNU compiler plus RHIDE) files Application notes C and project files for Chapters 9–11 Web pages for the PWEB server Source code for all PC projects Visual C v6 files Web pages for the WEBSERVE and WEB_EGI utilities CD-ROM CHIPWEB Subdirectories P16WEB PCM Source files for Chapters 12–16 Original source files for Chapter 12 The Development Environment The following four PC compilers are supported Borland C++ v3.1 An excellent DOS-hosted compiler with an integrated development environment Borland (Inprise) C++ v4.52 Windows-hosted compiler, which seems to be the latest version that can generate executable files for DOS Microsoft Visual C++ v6 Windows-hosted compiler that can generate Win32 console applications DJGPP v2.02 with RHIDE v1.4 Part of the GNU project, this is a remarkably good clone of the Borland 3.1 development environment, which runs in a 32-bit extended DOS environment and can be downloaded free of charge The Borland compilers, though ostensibly obsolete, may be found on the CD-ROM of some C programming tutorial books or purchased from the supplier mentioned in Appendix B Please note that not all compilers support all network interfaces — see the book for details For PICmicro® development, the CCS and Hitech compilers are supported, for both the PIC16xxx and PIC18xxx families (see Appendix D for more information) For more information about installation, running and rebuilding the utilities, the packet driver, the PICmicro Web server, licensing, and so on, see the Readme.txt file on the CD-ROM and the Preface Software updates are available from the Iosoft Ltd Web site, www.iosoft.co.uk EmbeddedSystems P R O G R A M M I N G THE ONLY AUDITED MAGAZINE DEDICATED TO EMBEDDED DESIGN www.embedded.com EmbeddedSystems ® Embedded Systems Programming P R O G R A M M I N G has been providing invaluable information to the embedded industry for over 13 years Our H• Filters subscribers enjoy high-quality, practical articles on microcontroller, embedded microprocessor, DSP and SoC-based development C++ on Low-End Micros Working with Watchdog Timers month after month Internet Appliance Design Embedding SMTP User Interface Annoyances The industry magazine since 1988 New for 2002 Your embedded reference library! EmbeddedSystems P R O G R A M M I N G CD–ROM Library 7.0 The Embedded Systems Programming CD-ROM Library Release 7.0 contains columns, features, news items, editorials, and source code from the 1988 premiere issue through the December 2001 issue This time-saver contains a powerful text search engine and is a must-have for veteran readers and for those new to Embedded Systems Programming, the preeminent source of embedded development for more than 13 years Features Include: • Columns, features, and source code from the premier 1988 issue through the December 2001 issue • More than 800 articles—columns and features • A powerful text search engine • The entire 2002 Buyer’s Guide—more than 1,500 products covered in detail • Code you can copy directly into your designs • Windows, Unix, Linux, and Mac compatibility • Past and present author biographies • Links to updated information on www.embedded.com $89.95 new ways to order: online www.embedded.com phone (800) 444-4881 U.S./Canada (785) 841-1631 other countries Order it online today! www.embedded.com Embedded Systems Firmware Demystified by Ed Sutter Explore firmware development from coldboot to network-boot Investigate CPU-toperipheral interfaces Write a powerful CLI, flash drivers, a flash file system, and a TFTP client/server The CD-ROM includes a crosscompilation toolset for 21 processors and source for an extensible firmware development platform CD-ROM included, 366pp, ISBN 1-57820-099-7, $49.95 Embedded Systems Design A Step-by-Step Guide by Arnold S Berger Develop embedded systems from the ground up! This primer teaches the specialized aspects of writing software in this environment that are not covered in standard coursework for software developers and electrical engineers It traces the software and hardware methodologies and the integration of the two disciplines 236pp, ISBN 1-57820-073-3, $34.95 Find CMP Books in your local bookstore Order direct 800-500-6875 fax 408-848-5784 e-mail: books@cmp.com www.cmpbooks.com Math Toolkit for Real-Time Programming by Jack W Crenshaw Develop a solid understanding of the math behind common functions — and learn how to make your programs run faster and more efficiently! You get a solid course in applied math from the renowned columnist of Embedded Systems Programming Magazine — and a versatile set of algorithms to use in your own projects CD-ROM included, 466pp, ISBN 1-929629-09-5, $49.95 Practical Statecharts in C/C++ An Introduction to Quantum Programming by Miro Samek In the spirit of eXtreme programming, the author’s quantum programming is a lightweight method that allows programmers to quickly hand-code working, real-time systems in C and C++ directly from UML statecharts You get a cookbook with step-by-step instructions and complete source code to the state-oriented framework CD-ROM included, 265pp, ISBN 1-57820-110-1, $44.95 Find CMP Books in your local bookstore Order direct 800-500-6875 fax 408-848-5784 e-mail: books@cmp.com www.cmpbooks.com May 20 relea 02 se Simulation Engineering by Jim Ledin Learn when and how to use simulation methods The entire range of important techniques are presented, beginning with the fundamentals of mathematical models, how to produce useful results, how to analyze the data and how to validate the models Each chapter provides step-by-step instructions for developing a working simulation Includes a review of state-ofthe-art tools and administrative guidelines on management and communications 303pp, ISBN 1-57820-080-6, $44.95 Microcontroller Projects Using the Basic Stamp Second Edition by Al Williams Harness the power of the new BS2P Basic Stamp! Beginners find clear explanations of the principles needed to design hardware and program the Basic Stamp Seasoned designers discover a fast and easy means of prototyping microcontrollers Includes additional advanced projects, a Basic Stamp emulator, and a tool to program PIC chips CD-ROM included, 456pp, ISBN 1-57820-101-2, $44.95 Find CMP Books in your local bookstore Order direct 800-500-6875 fax 408-848-5784 e-mail: books@cmp.com www.cmpbooks.com MicroC/OS-II, The Real-Time Kernel Second Edition by Jean J Labrosse Learn the inner workings of an RTOS! This release of MicroC/OS adds documentation for several important new features of the latest version of the software, including new realtime services, floating points, and coding conventions It is a completely portable, ROMable, preemptive real-time kernel Complete code is included for use in your own applications Hardcover, CD-ROM included, 648pp, ISBN 1-57820-103-9, $74.95 Embedded Systems Building Blocks Second Edition by Jean J Labrosse You get microcontroller theory and functional code modules that can be used to create basic embedded system functions Hands-on exercises that employ the real-time system modules provided by the author demonstrate the key concepts unique to embedded systems and real-time kernels This second edition features a new chapter on PC Services and uses the updated MicroC/OSII Hardcover, CD-ROM included, 611pp, ISBN 0-87930-604-1, $69.95 Find CMP Books in your local bookstore Order direct 800-500-6875 fax 408-848-5784 e-mail: books@cmp.com www.cmpbooks.com [...]... working directory c:\>cd tcplean c:\tcplean>d:\tcplean\ping 10.1.1.1 This would execute the utility on the CD-ROM using the configuration file c:\tcplean\tcplean.cfg The default configuration file may be overridden using the -c command-line option c:\tcplean>ping -c slip 172.16.1.1 This uses the alternative configuration file slip.cfg, which makes it possible to experiment with multiple network configurations... sample documents for the PC Web server You’ll also find the directory chipweb with a two subdirectories containing the files for Chapters 12–16 ARCHIVE zip files containing older versions of the ChipWeb source code P1 6WEB latest ChipWeb source code Executable copies of all the utilities, sample configuration files, and a README file with any late-breaking update information are in tcplean Preferably,... went by and my TCP/ IP software matured, the Web became increasingly important My industrial customers would browse the Web at home or work and could see the advantages of using a Web browser for remote control and to monitor their industrial equipment TCP became just a vehicle for conveying Web pages The focus shifted from “I want TCP/ IP on my system” to “I want my system to produce Web pages,” and... directory tcplean with several subdirectories BC31 compiler-specific files for Borland C++ v3.1 BC45 compiler-specific files for Borland C++ v4.52 DJGPP compiler-specific files for (GNU) DJGPP and RHIDE PCM the PICmicro®-specific1 files for Chapters 9–11 ROMDOCS sample documents for the PICmicro Web server SOURCE all source code for PC systems VC6 compiler-specific files for Microsoft Visual C++ v6 WEBDOCS... directory Open a DOS box and change directory to \tcplean\pcm Copy the necessary system files (16C76.h and ctype.h) into this directory from the standard PCM distribution Run the PCM compiler, specifying PWEB.C on the command line c:\>cd \tcplean\pcm c:\tcplean\pcm>copy \picc\examples\16c76.h c:\tcplean\pcm>copy \picc\examples\ctype.h c:\tcplean\pcm>\picc\pcm pweb.c I run the PCM compiler from within the... produce these dynamic Web pages was designed for large multiuser systems, and I couldn’t find small-scale implementations that were usable on simple, low-cost embedded systems hardware I needed: • a description of the techniques to insert live data into Web pages and • some simple platform-independent code that I could adapt for specific projects Having implemented many small-scale Web servers of my own... of embedded Web servers, but I came to realize that the techniques of providing dynamic content (on-the-fly Web page generation) and client/server data transfers were equally important, yet relatively unexplored Here are some reasons for studying this book TCP/ IP You want to understand the inner workings of TCP/ IP and need some tools and utilities to experiment with Dynamic Web Content You have an embedded. .. information are in tcplean Preferably, the complete directory tree d:\ tcplean (where d: is the CD-ROM drive) should be copied to c:\tcplean on your hard disk, 1 PICmicro® is the registered trademark of Microchip Technology Inc.; PICDEM.net™ is the trademark of Microchip Technology Inc Getting Started 3 and d:\chipweb to c:\chipweb If a different directory path is used, it will be necessary to edit... doubt about the command-line arguments for a utility, use the -? option c:\>cd tcplean c:\tcplean>ping -? Some of the utilities have the same name as their DOS counterparts (because they do the same job), so it is important to change to tcplean before attempting to run them A final word of warning: I strongly recommend that you create a new “scratch” network for your experimentation that is completely... terminal, but industry is starting to see the advantages of remote diagnosis: because Web browser usage is so widespread, it seems the logical choice for a user interface The browser is technically a Web client, which implies that the embedded system must be a Web server; hence, the title of this book Whether you are an embedded systems developer or not, I trust you will find plenty of interest in this book ... current working directory c:>cd tcplean c: cplean>d: cpleanping 10.1.1.1 This would execute the utility on the CD-ROM using the configuration file c: cplean cplean.cfg The default configuration... for Chapters 9–11 ROMDOCS sample documents for the PICmicro Web server SOURCE all source code for PC systems VC6 compiler-specific files for Microsoft Visual C++ v6 WEBDOCS sample documents for. .. Web server You’ll also find the directory chipweb with a two subdirectories containing the files for Chapters 12–16 ARCHIVE zip files containing older versions of the ChipWeb source code P16WEB