UNIX System Administration Handbook - Evi Nemeth [177]
PPP has three main components:
• A method for encapsulating datagrams over serial links
• A Link Control Protocol (LCP) for establishing, configuring, and testing the data link connection
• A family of Network Control Protocols (NCPs) for establishing and configuring different network-layer protocols
These components, complete with state tables that rival the best finite-state automata final exams, are explained in detail in the RFC; we don’t discuss them in detail.
PPP is shipped with each of our example systems. Table 13.11 shows the locations of the relevant commands and config files. We have not attempted to show any correspondence between particular config files and the commands that refer to them.
Table 13.11 PPP-related commands and config files by system
a The commands and config files have no particular correspondence; they are independent lists.
Addressing PPP performance issues
PPP provides all the functionality of Ethernet, but at much slower speeds. Normal office LANs operate at 10 Mb/s or 100 Mb/s—that’s 10,000-100,000 Kb/s. A dial-up connection operates at about 28-56 Kb/s.17
To put these numbers in perspective, it takes about 5 minutes to transfer a one-megabyte file across a PPP line. The speed is OK for email or web browsing with images turned off, but glitzy web sites will drive you crazy. To improve interactive performance, you can set the MTU of the point-to-point quite low. It usually defaults to 512 bytes; try 128 if you are doing a lot of interactive work.
Running NFS over a PPP link can be painfully slow. You should consider it only if you have the ability to run NFS over TCP instead of UDP. On some systems (e.g., Solaris), NFS mounts use TCP by default.
See Chapter 17 for more information about NFS.
The X Windows protocol uses TCP, so it’s possible to run X applications over a PPP link. Programs like xterm work fine, but avoid applications that use fancy fonts or bitmapped graphics.
Connecting to a network with PPP
To connect a host to a network with PPP, you must satisfy three prerequisites:
• Your host’s kernel must be able to send IP packets across a serial line as specified by the PPP protocol standard.
• You must have a user-level program that allows you to establish and maintain PPP connections.
• There must be a host on the other end of the serial line that understands the protocol you are using.
Making your host speak PPP
To establish a PPP connection, your host must be capable of sending and receiving PPP packets. On UNIX systems, PPP is generally implemented as a kernel module that places network packets in the serial device output queue, and vice versa. This module usually pretends to be just another network interface, so it can be manipulated with standard configuration tools such as ifconfig.
See page 300 for more information about ifconfig.
Controlling PPP links
The exact sequence of events involved in establishing a PPP connection depends on your OS and on the type of server you are dialing into. Connections can be initiated either manually or dynamically.
To establish a PPP connection manually, you run a command that dials a modem, logs in to a remote host, and starts the remote PPP protocol engine. If this procedure succeeds, the serial port is then configured as a network interface. This option normally leaves the link up for a long time, which makes it best suited for a phone line dedicated to IP connectivity.
In a dynamic configuration, a daemon watches your serial “network” interfaces to see when traffic has been queued for them. When someone tries to send a packet, the daemon automatically dials a modem to establish the connection, transmits the packet, and if the line goes back to being idle, disconnects the line after a reasonable amount of time. Dynamic dial-up is often used if a phone line carries both voice and data traffic or if the connection involves long distance or connect-time charges.