After providing an introduction to the Perl programming language, this helpful guide teaches computer networking using Perl. Topics discussed include ethernet network analysis, programming standard Internet protocols, and exploring mobile agent programming. ∗ Each chapter provides a general discussion of the technologies under consideration, the support for programming the technologies as provided by Perl, and implementations of working examples ∗ Covers Mobile Agent Technology, which is set to become one of the „next big things” on the Internet ∗ Further information is supplied, including a listing of Web and print resources, programming exercises, and tips to expand the reader′ s understanding of the material This book covers network programming with Perl but goes beyond programming network sockets. It presents the entire spectrum of skills network professionals need, including the ability to analyze network traffic that programs generate, efficient interaction with standard network protocols, and effective management of complex network systems. It is no longer enough for today′ s software engineers to be able to program the computer and debug programs – the modern programmer needs to know how to program the network and debug communications. This book shows you how, using Perl. Originally created as a tool for System Administrators, the Perl Programming languauge has matured into a powerful, yet easy– to– use, general– purpose programming language. Widely used on the Internet, Perl is the programming language of choice when it comes to adding dynamic content to websites using the Common Gateway Interface (CGI). Its strengths – simplicity, power and adaptability – make it an excellent vehicle with which to study computer networking and to program computer networks in general. In Programming the Network with Perl, Paul Barry applies Perl to the study of tradiitonal computer networking topics. After an introductory tutorial to the Perl programming language appropriate for the non– Perl programmer, five key computer networking topics are examined from the perspective of the software engineer using Perl. ∗ Snooping details the creation of a successively more functional set of Ethernet Network Analaysers and cumulates in the development of The Network Debugger, a tool for monitoring the traffic generated by both standard and custom– built networked applications. ∗ Sockets details how to use Perl to create custom networked applications by programming the TCP/IP transport protocols (TCP and UDP), using the Client/Server Model and the standard Berkeley Socket API. ∗ Protocols details just how easy it is to program the HTTP (web), SMTP (e– mail), NNTP (news) and TELNET (remote login) protocols with Perl. HTML parsing is also described. ∗ Management uses Perl to program the Simple Network Management Protocol (SNMP), the cornerstone network management technology on the modern Internet. ∗ Mobile Agents is a presentation of one of the technologies that can be added to Perl to provide for the development of custom networked applications that can transport themselves from network device to network device while executing. Each chapter concludes with a set of Print and Web Resources, as well as suggested Exercises to support further study by the reader. The associated website provides Perl links, downloadable source code, presentation materials (in PDF format), and instructions for joining the pertnetbook discussion mailing list. It is no longer enough for today′ s software engineers to be able to program the computer and debug programs – the modern programmer needs to know how to program the network and debug communications. This book shows you how, using Perl. Originally created as a tool for System Administrators, the Perl Programming languauge has matured into a powerful, yet easy– to– use, general– purpose programming language. Widely used on the Internet, Perl is the programming language of choice when it comes to adding dynamic content to websites using the Common Gateway Interface (CGI). Its strengths – simplicity, power and adaptability – make it an excellent vehicle with which to study computer networking and to program computer networks in general. In Programming the Network with Perl, Paul Barry applies Perl to the study of tradiitonal computer networking topics. After an introductory tutorial to the Perl programming language appropriate for the non– Perl programmer, five key computer networking topics are examined from the perspective of the software engineer using Perl. ∗ Snooping details the creation of a successively more functional set of Ethernet Network Analaysers and cumulates in the development of The Network Debugger, a tool for monitoring the traffic generated by both standard and custom– built networked applications. ∗ Sockets details how to use Perl to create custom networked applications by programming the TCP/IP transport protocols (TCP and UDP), using the Client/Server Model and the standard Berkeley Socket API. ∗ Protocols details just how easy it is to program the HTTP (web), SMTP (e– mail), NNTP (news) and TELNET (remote login) protocols with Perl. HTML parsing is also described. ∗ Management uses Perl to program the Simple Network Management Protocol (SNMP), the cornerstone network management technology on the modern Internet. ∗ Mobile Agents is a presentation of one of the technologies that can be added to Perl to provide for the development of custom networked applications that can transport themselves from network device to network device while executing. Each chapter concludes with a set of Print and Web Resources, as well as suggested Exercises to support further study by the reader. The associated website provides Perl links, downloadable source code, presentation materials (in PDF format), and instructions for joining the pertnetbook discussion mailing list. 1. Meet Perl Perl′ s Default Behaviour Using Variables in Perl Controlling Flow Boolean in Perl Perl Operators Subroutines Perl I/O Packages, Modules and Objects More Perl Where to From Here? Print Resources Web Resources 2. Snooping Thank You, Tim Potter Preparing to Snoop Building Low– Level Snooping Tools Snooping IP Datagrams Transport Snoopers The Network Debugger Where to From Here? Print Resources Web Resources 3. Sockets Clients and Servers Transport Services Introducing the Perl Socket API Socket Support Subroutines Simple UDP Clients and Servers Genericity and Robustness UDP is Unreliable Sending and Receiving with UDP Dealing with Deadlock TCP Clients and Servers A Common TCP Gotcha More TCP Socket Communication The Concurrent Syntax Checker Object– Oriented Sockets Where to From Here? Print Resources Web Resources 4. Protocols Gotcha! Working with the Web The World′ s Worst Web Browser HTTP Status Codes It′ s the Gisle and Graham Show! The Library for WWW Access in Perl The LWPwwwb Program Doing More with LWPwwwb Building a Custom Web Server The libnet Library Email Enabling simplehttpd Other Networking Add– on Modules Where to From Here? Print Resources Web Resources 5. Management Simple Management with ICMP Doing the Ping Thing Doing the Net: Ping Thing Tracing Routes Not So Simple Management with SNMP The SNMP Management Framework Managed Data The SNMP Protocol The Net: SNMP Module Working with Net: SNMP What′ s Up? Setting MIB– II Data IP Router Mapping Where to From Here? Print Resources Web Resources 6. Mobile Agents What is a Mobile Agent? Mobile– Agent Examples Mobile– Agent Advantages/Disavantages Perl Agents The Agent.pm Module Ooooh, Objects! The Default Mobile Agent A Launching Mobile– Agent Environment A One– Shot Location Relocating to Multiple Locations The Mobile– Agent multiwho The Mobile– Agent ipdetermine The Cloning Mobile– Agent ipdetermine Other Perl Agent Examples Where to From Here? Print Resources Web Resources Appendices Index „Clear writing and useful examples characterise this book”. (www.linuxjournal.com, 21 May 2002) „Clear writing and useful examples characterise this book”. (www.linuxjournal.com, 21 May 2002)