Flylib.com

Books Software

 
 
 

Using Networking


Using Networking

The ISO/OSI model is helpful for visualizing the way in which the networking layers interact. The model does not, however, tell you how to use the networking. Two widely used networking services that may be running on your system(s) and are worth taking a look at are ARPA and NFS.

The products we're about to cover in the upcoming sections fall under the umbrella of "Internet Services." The first networking product to try on your system is what is sometimes called ARPA Services - what I have been calling ARPA. ARPA is a combination of "ARPA Services" and "Berkeley Services." ARPA Services supports communications among systems running different operating systems, and Berkeley Services supports UNIX systems. The terms ARPA and Berkeley aren't used as often as they once were; however, since the roots of these command are in ARPA and Berkeley I'll use these terms in the following sections. The following sections are a list of the most common ARPA and Berkeley commands. Although many programs can be run under each of these services, the following are the most commonly used services in the UNIX world. In some cases, there are examples that show how these commands are used. For most of the examples, the local host is system1 and the remote host is system2 .


Internet Services ARPA (Communication among Systems w/ Different OS)

File Transfer Protocol ( ftp)

Transfer a file, or multiple files, from one system to another. This is often used when transferring files between a UNIX workstation and a Windows PC, VAX, etc. The following example shows copying the file /tmp/krsort.c from system2 (remote host) to the local directory on system1 (local host):

 

Comments

$ ftp system2

Issue ftp command

Connected to system2.

 

system2 FTP server (Version 4.1) ready.

 

Name (system2:root): root

Log in to system2

Password required for root.

 

Password:

Enter password

User root logged in.

 

Remote system type is UNIX.

 

Using binary mode to transfer files.

 

ftp> cd /tmp

cd to /tmp on system2

CWD command successful

 

ftp> get krsort.c

Get krsort.c file

PORT command successful

 

Opening BINARY mode data connection for krsort.c

 

Transfer complete.

 

2896 bytes received in 0.08 seconds

 

ftp> bye

Exit ftp

Goodbye.

 

$

 

In this example, both systems are running UNIX; however, the commands you issue through ftp are operating system-independent. The cd for change directory and get commands used above work for any operating system on which ftp is running. If you become familiar with just a few ftp commands, you may find that transferring information in a heterogeneous networking environment is not difficult.

Chances are that you are using your UNIX system(s) in a heterogeneous environment and may therefore use ftp to copy files and directories from one system to another. Because ftp is so widely used, I describe some of the more commonly used ftp commands:

ascii

Set the type of file transferred to ASCII. This means that you are transferring an ASCII file from one system to another. binary is usually the default.

Example: ascii

binary

Set the type of file transferred to binary. This means that you are transferring a binary file from one system to another. If, for instance, you want to have a directory on your UNIX system that holds applications that you copy to non-UNIX systems, then you want to use binary transfer.

Example: binary

cd

Change to the specified directory on the remote host.

Example: cd /tmp

dir

List the contents of a directory on the remote system to the screen or to a file on the local system, if you specify a local file name.

get

Copy the specified remote file to the specified local file. If you don't specify a local file name, then the remote file name will be used.

lcd

Change to the specified directory on the local host.

Example: lcd /tmp

ls

List the contents of a directory on the remote system to the screen or to a file on the local system, if you specify a local file name.

mget

Copy multiple files from the remote host to the local host.

Example: mget *.c

put

Copy the specified local file to the specified remote file. If you don't specify a remote file name, then the local file name will be used.

Example: put test.c

mput

Copy multiple files from the local host to the remote host.

Example: mput *.c

bye/quit

Close the connection to the remote host.

Example: bye

{% if main.adsdop %}{% include 'adsenceinline.tpl' %}{% endif %}

Other ftp commands are available in addition to those I have covered here. If you need more information on these commands or wish to review additional ftp commands, the UNIX manual pages for ftp are helpful.

telnet

Used for communication with another host using the telnet protocol. Telnet is an alternative to using rlogin , described later. The following example shows how to establish a telnet connection with the remote host, system2:

 

Comments

$ telnet system2

 

Connected to system2.

Telnet to system2

AIX version 4 system2

 

login: root

Log in as root on system2

password:

Enter password

Welcome to system2. - rs6000 aix 4.3.1.0

 

$

AIX prompt on system2