Making systems talk to one another is a fundamental task for system administrators. Often, we are called upon to provide abstraction, analysis, monitoring, and even translation of network protocols and services. Thus a grasp of how Ruby augments our network toolkit is vitally important.
In this chapter, we'll cover basic socket operations and how to deal with some of the most common problems. We'll discuss a few of the higher-level protocols and operations that can be employed quite easily from within Ruby, and we'll build a web robot and a calculation server. Finally, we'll peruse some ideas for automating command and control with SSH and sample the joys of the packet capture library.