Lecture Notes

for

CSCI 301: Great Ideas in Computer Science

(c) 1993, 1994, 1995 John E. Howland, All Rights Reserved

Department of Computer Science

Trinity University

Stadium Drive

San Antonio, Texas 78212-7200

Internet: jhowland@ariel.cs.trinity.edu

11 Computer Networks ( Terminal Session on this Machine )

11.1 Network Terminology

A network is a collection of two or more machines together wih operating system software which facilitates communication between machines (sometimes called nodes) on the network. There are several common interconnection topologies used to network computers.

11.1.1 Bus Network Topology

Bus networks have a single network wire attached to all machines on the network. Different types of wiring are widely used. One type, a coxial cable, uses a single copper wire with a special ground shield conductor which surrounds the copper core. Another type uses two pairs of twisted copper wire.

Each machine on the network sees every message sent on the network, but only processes messages which pertain to that machine. Special signaling techniques are used to detect and avoid message collisions when two machines attempt to transmit a message at the same instant in time. The method used to avoid future collision when two or more machines detect that their messages were transmitted at the same time is to have each machine compute a small, but random, delay time before trying to transmit again.

11.1.2 Star Network Topology

Star networks use a single network node which connects to every other node in the net and provides communication services to other machines on the net.

In a star network, each machine may communicate with the Hub machine without worrying about whether or not their messages will collide with other messages. The performance of a star network is determined largely by the performance of the Hub machine. The Hub machine performs all message routing to the desired destination machine.

11.1.3 Ring Network Topology

Ring networks use a ring of connections from one machine to the next.

Messages get routed from one machine to the next until they arrive at the desired destination. A special message, called the token, is sent from one machine to the next around the ring. The message collision problem is solved in a ring network by requiring each machine to wait until the token arrives before transmitting a message. When a message arrives at a machine it is forwarded to the next machine in the ring unless the message is for that machine.

11.2 Internets

An internet is a collection of interconnected networks together with special software which facilitates communication between networks.

An internet is built from two or more networks by having a network connection between two machines, each of which are on different networks.

11.2.1 Connecting Two Networks

The machines M5 and M3 are sometimes called bridges or gateways because these machines each exist on two networks. Special software is required to route messages between the networks through these machines. These software programs are called routers. Sometimes, rather than use two general purpose computers to function as a bridge or gatway connecting two networks, a special purpose computer together with routing software is used to connect two networks.

11.3 Internet Network Software

When several different networks are connected together, a common set of operating system routines must be provided on each machine. Such software is referred to as a network protocol. When the machines run the Unix operating system, an often used protocol is TCP/IP. TCP/IP stands for Transmission Control Protocol / Internet Protocol. This protocol provides a reliable communication mechanism for sending data and messages across an internet.

An internet usually contains a variety of different machines which are not easily compatible with one another. Hence, there must be different implementations of the common network software protocol, such as TCP/IP, and each of these implementations must provide the necessary communication compatibility between the incompatible machines.

Other noteworthy protocols include Novel IPX, AppleTalk and DECNET. Each of these protocols has been developed by a particular vendor, but, because they are widely used, they are licensed by other vendors so as to provide greater compatibility. Each of these protocols has become a defacto standard for networking.

11.3.1 Internet Addressing

Machines on an internet need a naming scheme which uniquely identifies each machine on the internet. Ther world-wide internet uses a domain naming system. The top-level domains indentify the country in which a machine resides by a code (uk - United Kingdom or ca - Canada) , but for historical reasons, in the United States, top-level domains are: edu - school, gov - government, com - commercial site, net - network administration or mil - military. The next level domain includes a site name. trinity.edu, for example, is the domain containing all machines on the internet which are located at Trinity University. The next level domains specify one or more sub domains at a given site. For example, cs.trinity.edu is the domain name for all machines in the Trinity compter science department. However, the cs domain contains a subdomain mars.cs.trinity.edu which contains two machines. Similarly, engr.trinity.edu is the domain of all machines on the internet which are in the Trinity engineering science department. Finally, each machine in a domain must be uniquely named. For example, uranus.cs.trinity.edu is one of our laboratory machines and is uniquely identified even though other machines named uranus exist in other domains on the internet.

11.4 Network Applications

Networks are used to share system resources between several machines. For example, a printer which is attached to one machine on a network might be accessed by other machines on that network. Similarly, files which are stored on one machine might be accessed by other machines on the network. So the sharing of resources involves not only sharing devices such as printers, but also the sharing of data.

Recent estimates of the size of the internet indicate that more than 1.3 million machines are connected and new connections are being made at a rate of more than 100,000 per month. It is also estimated that there are databases containing more than 3000 Giga bytes of information available on the internet. A Giga byte is a thousand mega bytes!

11.5 Using Networks for Parallel Computation

Given the right permissions on unix machines which are connected to an internet, a program running on one machine on the internet can request that another program be run on another machine and have a resulting value returned to the first program over the internet.

11.5.1 Function remote-eval

The following function function, remote-eval, will evaluate an expression on another machine which is attached to an internet. This function takes two arguments, a machine name and an expression and return a result of evaluating the expression on the specified machine.
(remote-eval 'janus1.cs.trinity.edu "(+ 2 3)" )
requests that (+ 2 3) be run on janus1.cs.trinity.edu and the result be returned to the requesting workstation.

Following is the code for remote-eval:

(define remote-eval
  (lambda (machine expr)
    (let* ((remote-shell "remsh ")
         (port (open-input-pipe
                (string-append
            remote-shell
          (symbol->string machine)
          " echo \"'"
          expr
          "'\" | /usr/local/scm4e1/scm/scm"))))
      (with-input-from-port port read))))