24.7 Networking Fundamentals
24.7.1 Objective 1: Fundamentals of
TCP/IP
24.7.1.1 Addressing and masks
-
An address mask
separates the network portion from the host portion of the
32-bit IP address.
-
Class A addresses
have 8 bits of network address and 24 bits of host address.
-
Class B addresses have 16 bits of network
address and 16 bits of host address.
-
Class C addresses have 24 bits of network
address and 8 bits of host address.
-
Subnets can be
defined using the defined "class" schemes or using a locally
defined split of network/host bits.
-
The all-zero and
all-ones addresses are reserved on all subnets for the
network and broadcast addresses, respectively. This implies
that the maximum number of hosts on a network with n
bits in the host portion of the address is 2n-2.
For example, a Class C network has 8 bits in the host
portion. Therefore, it can have a maximum of
28-2=254 hosts.
24.7.1.2 Protocols
TCP/IP is a name
representing a larger suite of network protocols. Some network
protocols maintain a constant connection while others do not.
- IP
-
The Internet
Protocolis the fundamental building block of the Internet.
It is used by other protocols.
- ICMP
-
This
connectionless messaging protocol uses IP. It is used for
flow control, detection of unreachable destinations,
redirecting routes, and checking remote hosts (the ping utility).
- UDP
-
The User Datagram
Protocol is a connectionless transport agent. It is used by
applications such as DNS and NFS.
- TCP
-
The Tranmission
Control Protocol is a connection-oriented transport agent.
It is used by applications such as FTP and Telnet.
- PPP
-
The Point-to-Point Protocol is used over
serial lines, including modems.
24.7.1.3 TCP/IP services
Table 24-4. Common Port Assignments
20 |
FTP data |
When an FTP session is opened, the
binary or ASCII data flow to the server is conducted
using port 20, while control information flows on port
21. During use, both ports are managed by an ftp daemon, such as wu-ftpd or PROftpd. |
21 |
FTP control |
23 |
Telnet server |
Inbound Telnet requests are sent to
server port 23 and processed by telnetd. |
25 |
SMTP server |
This port is used by mail transfer
agents (MTAs), such as sendmail. |
53 |
DNS server |
This port is used by the Domain Name
System server, named.
|
67 |
BOOTP/DHCP server |
This port is used by BOOTP or the more
commonly used DHCP server. |
68 |
BOOTP/DHCP client |
This port is used by the client side
for BOOTP/DHCP. |
80 |
HTTP server |
Web servers, such as Apache (httpd), usually listen in on
this port. |
110 |
POP3 |
The Post Office Protocol (POP) is used
by mail client programs to transfer mail from a server.
|
119 |
NNTP server |
This port is used by news servers for
USENET news. |
139 |
NetBIOS |
This port is reserved for Microsoft's
LAN network manager. |
143 |
IMAP |
An alternate to POP3, IMAP is another
type of mail server. |
161 |
SNMP |
Agents running on monitored systems use
this port for access to the Simple Network Management
Protocol. |
-
Ports are assigned to specific programs.
Definitions are stored in /etc/services.
-
Ports 1-1023 are privileged ports, owned by superuser
processes.
24.7.1.4 TCP/IP utilities
-
ftp
implements the File Transfer
Protocol client for the exchange of files to and from remote
hosts.
-
The telnet client program implements a Telnet
session to a remote host.
-
ping sends ICMP echo requests to a remote
host to verify functionality.
-
dig obtains information from DNS servers.
-
traceroute
attempts to display the route over
which packets must travel to a remote host.
-
fwhois queries a whois database to determine the
owner of a domain or IP address.
24.7.2 Objective 3: TCP/IP
Troubleshooting and Configuration
24.7.2.1 Network interfaces
-
Interfaces are
configured through a number of configuration files.
-
/etc/hostname contains the assigned
hostname for the system.
-
/etc/hosts contains static mappings
between IP addresses and names.
-
/etc/nsswitch.conf directs system
library functions to specific name server methods such as
local files, DNS, and NIS.
-
/etc/host.conf controls name
resolution for older libraries.
-
/etc/host.conf is only rarely used
and is replaced by /etc/nsswitch.conf.
-
/etc/resolv.conf contains
information to direct the resolver to DNS servers.
-
/etc/networks sets up equivalence
between addresses and names for entire networks.
-
The host command returns DNS information.
-
The hostname, domainname, and dnsdomainname commands set or
display the current host, domain, or node name.
-
The ifconfig
command configures network
interfaces. It is used to create and configure interface
parameters, usually at boot time. Parameters include the IP
address and subnet mask.
-
The netstat
command displays network connections, routing tables,
interface statistics, masquerade connections, and multicast
memberships.
-
The route command displays the routing table
and can add or delete routes from the table.
24.7.2.2 DHCP
-
DHCP is the Dynamic Host Configuration
Protocol. It is used to assign an IP address and other
information to a client system.
-
The DHCP server is dhcpd.
-
A DHCP server offers an address for a
finite amount of time known as a lease.
24.7.3 Objective 4: Configure and
Use PPP
-
PPP is used to
make a network connection over a serial interface. This
could be a direct cable or modem connection.
-
PPP is a peer protocol; there are no
clients or servers.
-
pppd is the PPP
daemon, called when a PPP interface is needed. It uses a
chat script to send configuration commands to a modem prior
to dialing.
-
Basic authentication for PPP can be done in clear text via the
chat script. However, the
PAP, CHAP, and MSCHAP methods encode their authentication
information into the PPP data stream.
|