UC Irvine, Information and Computer Science Department Winter 2000

ICS 54: Brief Notes on Chapter 12: Networking with TCP/IP


References

http://freesoft.org/CIE/
Connected: An Internet Encyclopedia
http://www.whatis.com/tour.htm
An overview of the Internet from http://www.whatis.com/


TCP/IP

Network hardware allows sending packets of data (of limited size) from one computer to another.

Higher level protocols are needed to solve the following problems:

Routing.
With a complex topology such as the Internet's,
how do packets efficiently find their way to the appropriate gateways?
Virtual circuits.
Most applications want a continuous, ordered, full-duplex communications link, not packets.
Robustness.
Checksums, retransmission, packet ordering, and duplicate removal.


TCP/IP Key Points


TCP/IP Network Model

TCP/IP model of networking has are four layers:
Link Layer
Network hardware and device drivers.
Network Layer
Does addressing and routing. IP and ICMP operate here. IP layer.
Transport Layer
Enables application programs to communicate over the network. TCP and UDP (User Datagram Protocol) operate here.
Application Layer
Applications may define their own protocols: HTTP, telnet, FTP, SMTP, etc.


The "Other" Network Model

Networking classes usually teach the 7 layer ISO Open Systems Interconnection (OSI) networking model:

  1. Physical
  2. Data Link
  3. Network
  4. Transport
  5. Session
  6. Presentation
  7. Application

In addition to the 7 layers, OSI committees specified a set of standard protocols which in the 1980's were expected to replace TCP/IP.

When finally implemented, they were found to be inefficient and underspecified.

TCP had by then become established, and the OSI protocols have largely fallen by the wayside, though many commercial e-mail systems still use the X.400 family of mail protocols.


Packets

Network data is transmitted in packets.
At the hardware level, packets are often called frames.

The packet header contains the addresses of where it's coming from and where it's going to, checksums to verify data integrity, and other protocol-specific information.

The packet's body contains data which may represent a packet of another protocol.

As packets move from the application to the hardware, each layer of software adds its own header information, called encapsulation. Upon receipt, of course, each layer removes its headers as the packet moves upwards to the application.

This is why it's often called a protocol stack.


Packet Size

Packet size may be limited.
Most interfaces specify a Maximum Transmission Unit (MTU).
Ethernet, for example, has an MTU of 1,500 bytes.

Because software at the application and transport layers can't know the MTU limit which will be encountered by their packets, it is the job of the Internet Protocol (IP) to fragment and reassemble packets when necessary to make them fit through a selected interface.

Fragmentation may also be necessary when a packet moves through several different media; fragmentation of fragments is quite possible.


Routing

Routing allows packets to cross network boundaries on their way from system to system.

Whenever the IP layer receives a packet (it doesn't matter if it came in from another interface or if it came from application software on this machine), IP decides what to do with it.

If it's for the current machine, IP passes the packet up to the correct transport software above it, based on information in the packet header.

If it's for another machine, then IP tries to decide which interface it should use and what hardware address should be put on the enclosing packet.

If IP can't find a suitable place to send the packet, then it is returned with a "network unreachable" error.


TCP

All higher level protocols (TCP, UDP) in the Internet use IP to route their packets to their destinations.

Sometimes packets are lost or destroyed.

UDP doesn't address these problems.
TCP does.

For reliable communication, checksums must be employed to determine if a packet has been corrupted, and a mechanism of acknowledgements, timeouts, and retransmissions will be needed.

If there are retransmissions, then duplicates may be received and must be discarded.

If there are multiple routes to a destination, or packets are lost and retransmitted, then they may arrive out of sending order.

TCP uses these mechanisms to provide virtual circuit service to applications.


rlogin, rsh, rcp

These commands allow one to assume on a remote host Rhost the rights of the remote user Ruser on that system.

All of them depend on /etc/hosts.equiv and ~Ruser/.rhosts on Rhost

/etc/hosts.equiv lists those systems which are considered equivalent to this one in the sense that a valid login as Ruser there is considered as proof that the person should be allowed to operate as Ruser here.

~Ruser/.rhosts lists pairs of the form "thatsystem user" saying that user@thatsystem can operate on this system with the same rights as Ruser has on this system.
If user is omitted, its value is understood to be Ruser.

rlogin [ -l Ruser ] Rhost
Login to Rhost as Ruser
If Ruser is omitted the login name used on Rhost is the same as the login name on this system.
Suppose that from system S1 you rlogin to S2 and from there to S3: ~CTRL-Z suspends all your rlogins back to S1; ~~CTRL-Z suspends only the rlogin from S2 to S3.
rsh [ -n ] [ -l Ruser ] Rhost command
rsh Rhost [ -n ] [ -l Ruser ] command
On Rhost, acting as Ruser, execute the command command.
If -n is specified, rsh takes its input from /dev/null.
rcp [ -p ] file1 file2
rcp [ -pr ] file directory
These remote copies act exactly like cp except that the form of the file and directory names is a bit different.
That form is   [Ruser@]Rhost:name
Examples:   you@x.y.edu:InYourHomeDir    x.y.edu:/users/homes/me
All of these commands present the security problems associated with transmitting unencrypted information between systems.

Versions of these commands which used encrypted transmission between systems are called slogin, ssh, and scp.

They are often simply considered part of "ssh, the secure shell."


ftp = File Transfer Protocol

For moving files between systems and remote manipulations of files and directories.

When "ASCII" (as opposed to "binary") mode is used, it compensates for the differences among systems in in how text files are represented (end of line).

Note that password is sent unencrypted.


telnet

telnet host [ port ]

Interactive access to remote systems and services.

Note that password is sent unencrypted.

Ability to access ports other than the default (23) can be very useful.

% telnet www.uci.edu 80
Trying 128.200.222.100...
Connected to alpha.cwis.uci.edu.
Escape character is '^]'.
HEAD / HTTP/1.0

HTTP/1.1 200 OK
Date: Mon, 14 Feb 2000 07:00:53 GMT
Server: Apache/1.3.9 (Unix)
Last-Modified: Fri, 11 Feb 2000 08:00:08 GMT
ETag: "733ea-1c26-38a90788"
Accept-Ranges: bytes
Content-Length: 7206
Connection: close
Content-Type: text/html

Connection closed by foreign host.
%


ruptime

% uname -a
SunOS rigel.oac.uci.edu 5.6 Generic_105181-06 sun4u sparc SUNW,Ultra-2
% ruptime
eeeweb      down 326+08:17
mercury       up 42+16:00,     0 users,  load 4.03, 2.16, 1.50
polaris     down 42+16:36
rigel         up 42+15:29,    24 users,  load 0.63, 0.62, 0.63
taurus        up 42+15:31,    20 users,  load 0.72, 0.76, 0.75
%


ping

% ping www.uci.edu
alpha.cwis.uci.edu is alive
% 
% ping -s www.uci.edu
PING alpha.cwis.uci.edu: 56 data bytes
64 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=0. time=2. ms
64 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=1. time=1. ms
64 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=2. time=1. ms
64 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=3. time=1. ms
^C
----alpha.cwis.uci.edu PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 1/1/2
% 
% ping -s www.uci.edu 1016
PING alpha.cwis.uci.edu: 1016 data bytes
1024 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=0. time=6. ms
1024 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=1. time=4. ms
1024 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=2. time=4. ms
1024 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=3. time=4. ms
^C
----alpha.cwis.uci.edu PING Statistics----
4 packets transmitted, 4 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 4/4/6
% 
% ping -s -I 5 www.uci.edu
PING alpha.cwis.uci.edu: 56 data bytes
64 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=0. time=2. ms
64 bytes from alpha.cwis.uci.edu (128.200.222.100): icmp_seq=1. time=1. ms
^C
----alpha.cwis.uci.edu PING Statistics----
2 packets transmitted, 2 packets received, 0% packet loss
round-trip (ms)  min/avg/max = 1/1/2
% 

Comments are welcome.
Current as of 14 February 2000
HTML 4.01 Checked.