As per Relevance of the word computer, we have this rfc below:
Network Working Group T.
Request for Comments: 1180 C.
Spider Systems
January 1991
A TCP/IP
Status of this
This RFC is a tutorial on the TCP/IP protocol suite,
particularly on the steps in forwarding an IP datagram from
host to destination host through a router. It does not specify
Internet standard. Distribution of this memo is unlimited
Table of
1. Introduction................................................ 1
2. TCP/IP Overview............................................. 2
3. Ethernet.................................................... 8
4. ARP......................................................... 9
5. Internet Protocol........................................... 12
6. User Datagram Protocol...................................... 22
7. Transmission Control Protocol............................... 24
8. Network Applications........................................ 25
9. Other Information........................................... 27
10. References.................................................. 27
11. Relation to other RFCs...................................... 27
12. Security Considerations..................................... 27
13. Authors' Addresses.......................................... 28
1.
This tutorial contains only one view of the salient points of TCP/IP
and therefore it is the "bare bones" of TCP/IP technology. It
the history of development and funding, the business case for
use, and its future as compared to ISO OSI. Indeed, a great deal
technical information is also omitted. What remains is a minimum
information that must be understood by the professional working in
TCP/IP environment. These professionals include the
administrator, the systems programmer, and the network manager
This tutorial uses examples from the UNIX TCP/IP environment,
the main points apply across all implementations of TCP/IP
Note that the purpose of this memo is explanation, not definition
If any question arises about the correct specification of a protocol
please refer to the actual standards defining RFC
Socolofsky & Kale [Page 1]
RFC 1180 A TCP/IP Tutorial January 1991
The next section is an overview of TCP/IP, followed by
descriptions of individual components
2. TCP/IP
The generic term "TCP/IP" usually means anything and
related to the specific protocols of TCP and IP. It can
other protocols, applications, and even the network medium. A
of these protocols are: UDP, ARP, and ICMP. A sample of
applications are: TELNET, FTP, and rcp. A more accurate term
"internet technology". A network that uses internet technology
called an "internet".
2.1 Basic
To understand this technology you must first understand the
logical structure
----------------------------
| network applications |
| |
|... \ | / .. \ | / ...|
| ----- ----- |
| |TCP| |UDP| |
| ----- ----- |
| \ / |
| -------- |
| | IP | |
| ----- -*------ |
| |ARP| | |
| ----- | |
| \ | |
| ------ |
| |ENET| |
| ---@-- |
----------|-----------------
|
----------------------o---------
Ethernet
Figure 1. Basic TCP/IP Network
This is the logical structure of the layered protocols inside
computer on an internet. Each computer that can communicate
internet technology has such a logical structure. It is this
structure that determines the behavior of the computer on
internet. The boxes represent processing of the data as it
through the computer, and the lines connecting boxes show the path
Socolofsky & Kale [Page 2]
RFC 1180 A TCP/IP Tutorial January 1991
data. The horizontal line at the bottom represents the
cable; the "o" is the transceiver. The "*" is the IP address and
"@" is the Ethernet address. Understanding this logical structure
essential to understanding internet technology; it is referred
throughout this tutorial
2.2
The name of a unit of data that flows through an internet
dependent upon where it exists in the protocol stack. In summary:
it is on an Ethernet it is called an Ethernet frame; if it is
the Ethernet driver and the IP module it is called a IP packet; if
is between the IP module and the UDP module it is called a
datagram; if it is between the IP module and the TCP module it
called a TCP segment (more generally, a transport message); and if
is in a network application it is called a application message
These definitions are imperfect. Actual definitions vary from
publication to the next. More specific definitions can be found
RFC 1122, section 1.3.3.
A driver is software that communicates directly with the
interface hardware. A module is software that communicates with
driver, with network applications, or with another module
The terms driver, module, Ethernet frame, IP packet, UDP datagram
TCP message, and application message are used where
throughout this tutorial
2.3 Flow of
Let's follow the data as it flows down through the protocol
shown in Figure 1. For an application that uses TCP (
Control Protocol), data passes between the application and the
module. For applications that use UDP (User Datagram Protocol),
passes between the application and the UDP module. FTP (
Transfer Protocol) is a typical application that uses TCP.
protocol stack in this example is FTP/TCP/IP/ENET. SNMP (
Network Management Protocol) is an application that uses UDP.
protocol stack in this example is SNMP/UDP/IP/ENET
The TCP module, UDP module, and the Ethernet driver are n-to-1
multiplexers. As multiplexers they switch many inputs to one output
They are also 1-to-n de-multiplexers. As de-multiplexers they
one input to many outputs according to the type field in the
header
Socolofsky & Kale [Page 3]
RFC 1180 A TCP/IP Tutorial January 1991
1 2 3 ... n 1 2 3 ...
\ | / | \ | | / ^
\ | | / | \ | | / |
------------- flow ----------------
|multiplexer| of |de-multiplexer|
------------- data ----------------
| | | |
| v | |
1 1
Figure 2. n-to-1 multiplexer and 1-to-n de-
If an Ethernet frame comes up into the Ethernet driver off
network, the packet can be passed upwards to either the ARP (
Resolution Protocol) module or to the IP (Internet Protocol) module
The value of the type field in the Ethernet frame determines
the Ethernet frame is passed to the ARP or the IP module
If an IP packet comes up into IP, the unit of data is passed
to either TCP or UDP, as determined by the value of the
field in the IP header
If the UDP datagram comes up into UDP, the application message
passed upwards to the network application based on the value of
port field in the UDP header. If the TCP message comes up into TCP
the application message is passed upwards to the network
based on the value of the port field in the TCP header
The downwards multiplexing is simple to perform because from
starting point there is only the one downward path; each
module adds its header information so the packet can be de
multiplexed at the destination computer
Data passing out from the applications through either TCP or
converges on the IP module and is sent downwards through the
network interface driver
Although internet technology supports many different network media
Ethernet is used for all examples in this tutorial because it is
most common physical network used under IP. The computer in Figure 1
has a single Ethernet connection. The 6-byte Ethernet address
unique for each interface on an Ethernet and is located at the
interface of the Ethernet driver
The computer also has a 4-byte IP address. This address is
at the lower interface to the IP module. The IP address must
unique for an internet
Socolofsky & Kale [Page 4]
RFC 1180 A TCP/IP Tutorial January 1991
A running computer always knows its own IP address and
address
2.4 Two Network
If a computer is connected to 2 separate Ethernets it is as in
3.
----------------------------
| network applications |
| |
|... \ | / .. \ | / ...|
| ----- ----- |
| |TCP| |UDP| |
| ----- ----- |
| \ / |
| -------- |
| | IP | |
| ----- -*----*- ----- |
| |ARP| | | |ARP| |
| ----- | | ----- |
| \ | | / |
| ------ ------ |
| |ENET| |ENET| |
| ---@-- ---@-- |
----------|-------|---------
| |
| ---o---------------------------
| Ethernet Cable 2
---------------o----------
Ethernet Cable 1
Figure 3. TCP/IP Network Node on 2
Please note that this computer has 2 Ethernet addresses and 2
addresses
It is seen from this structure that for computers with more than
physical network interface, the IP module is both a n-to-
multiplexer and an m-to-n de-multiplexer
Socolofsky & Kale [Page 5]
RFC 1180 A TCP/IP Tutorial January 1991
1 2 3 ... n 1 2 3 ...
\ | | / | \ | | / ^
\ | | / | \ | | / |
------------- flow ----------------
|multiplexer| of |de-multiplexer|
------------- data ----------------
/ | | \ | / | | \ |
/ | | \ v / | | \ |
1 2 3 ... m 1 2 3 ...
Figure 4. n-to-m multiplexer and m-to-n de-
It performs this multiplexing in either direction to
incoming and outgoing data. An IP module with more than 1
interface is more complex than our original example in that it
forward data onto the next network. Data can arrive on any
interface and be sent out on any other
TCP
\ /
\ /
--------------
| IP |
| |
| --- |
| / \ |
| / v |
--------------
/ \
/ \
data
comes in goes
here
Figure 5. Example of IP Forwarding a IP
The process of sending an IP packet out onto another network
called "forwarding" an IP packet. A computer that has been
to the task of forwarding IP packets is called an "IP-router".
As you can see from the figure, the forwarded IP packet never
the TCP and UDP modules on the IP-router. Some IP-
implementations do not have a TCP or UDP module
2.5 IP Creates a Single Logical
The IP module is central to the success of internet technology.
module or driver adds its header to the message as the message
Socolofsky & Kale [Page 6]
RFC 1180 A TCP/IP Tutorial January 1991
down through the protocol stack. Each module or driver strips
corresponding header from the message as the message climbs
protocol stack up towards the application. The IP header
the IP address, which builds a single logical network from
physical networks. This interconnection of physical networks is
source of the name: internet. A set of interconnected
networks that limit the range of an IP packet is called
"internet".
2.6 Physical Network
IP hides the underlying network hardware from the
applications. If you invent a new physical network, you can put
into service by implementing a new driver that connects to
internet underneath IP. Thus, the network applications remain
and are not vulnerable to changes in hardware technology
2.7
If two computers on an internet can communicate, they are said
"interoperate"; if an implementation of internet technology is good
it is said to have "interoperability". Users of general-
computers benefit from the installation of an internet because of
interoperability in computers on the market. Generally, when you
a computer, it will interoperate. If the computer does not
interoperability, and interoperability can not be added, it
a rare and special niche in the market
2.8 After the
With the background set, we will answer the following questions
When sending out an IP packet, how is the destination
address determined
How does IP know which of multiple lower network interfaces to
when sending out an IP packet
How does a client on one computer reach the server on another
Why do both TCP and UDP exist, instead of just one or the other
What network applications are available
These will be explained, in turn, after an Ethernet refresher
Socolofsky & Kale [Page 7]
RFC 1180 A TCP/IP Tutorial January 1991
3.
This section is a short review of Ethernet technology
An Ethernet frame contains the destination address, source address
type field, and data
An Ethernet address is 6 bytes. Every device has its own
address and listens for Ethernet frames with that
address. All devices also listen for Ethernet frames with a wild
card destination address of "FF-FF-FF-FF-FF-FF" (in hexadecimal),
called a "broadcast" address
Ethernet uses CSMA/CD (Carrier Sense and Multiple Access
Collision Detection). CSMA/CD means that all devices communicate
a single medium, that only one can transmit at a time, and that
can all receive simultaneously. If 2 devices try to transmit at
same instant, the transmit collision is detected, and both
wait a random (but short) period before trying to transmit again
3.1 A Human
A good analogy of Ethernet technology is a group of people talking
a small, completely dark room. In this analogy, the physical
medium is sound waves on air in the room instead of
signals on a coaxial cable
Each person can hear the words when another is talking (
Sense). Everyone in the room has equal capability to talk (
Access), but none of them give lengthy speeches because they
polite. If a person is impolite, he is asked to leave the
(i.e., thrown off the net).
No one talks while another is speaking. But if two people
speaking at the same instant, each of them know this because
hears something they haven't said (Collision Detection). When
two people notice this condition, they wait for a moment, then
begins talking. The other hears the talking and waits for the
to finish before beginning his own speech
Each person has an unique name (unique Ethernet address) to
confusion. Every time one of them talks, he prefaces the
with the name of the person he is talking to and with his own
(Ethernet destination and source address, respectively), i.e., "
Jane, this is Jack, ..blah blah blah...". If the sender wants
talk to everyone he might say "everyone" (broadcast address), i.e.,
"Hello Everyone, this is Jack, ..blah blah blah...".
Socolofsky & Kale [Page 8]
RFC 1180 A TCP/IP Tutorial January 1991
4.
When sending out an IP packet, how is the destination
address determined
ARP (Address Resolution Protocol) is used to translate IP
to Ethernet addresses. The translation is done only for outgoing
packets, because this is when the IP header and the Ethernet
are created
4.1 ARP Table for Address
The translation is performed with a table look-up. The table,
the ARP table, is stored in memory and contains a row for
computer. There is a column for IP address and a column for
address. When translating an IP address to an Ethernet address,
table is searched for a matching IP address. The following is
simplified ARP table
------------------------------------
|IP address Ethernet address |
------------------------------------
|223.1.2.1 08-00-39-00-2F-C3|
|223.1.2.3 08-00-5A-21-A7-22|
|223.1.2.4 08-00-10-99-AC-54|
------------------------------------
TABLE 1. Example ARP
The human convention when writing out the 4-byte IP address is
byte in decimal and separating bytes with a period. When writing
the 6-byte Ethernet address, the conventions are each byte
hexadecimal and separating bytes with either a minus sign or a colon
The ARP table is necessary because the IP address and
address are selected independently; you can not use an algorithm
translate IP address to Ethernet address. The IP address is
by the network manager based on the location of the computer on
internet. When the computer is moved to a different part of
internet, its IP address must be changed. The Ethernet address
selected by the manufacturer based on the Ethernet address
licensed by the manufacturer. When the Ethernet hardware
board changes, the Ethernet address changes
4.2 Typical Translation
During normal operation a network application, such as TELNET,
an application message to TCP, then TCP sends the corresponding
message to the IP module. The destination IP address is known by
Socolofsky & Kale [Page 9]
RFC 1180 A TCP/IP Tutorial January 1991
application, the TCP module, and the IP module. At this point the
packet has been constructed and is ready to be given to the
driver, but first the destination Ethernet address must
determined
The ARP table is used to look-up the destination Ethernet address
4.3 ARP Request/Response
But how does the ARP table get filled in the first place? The
is that it is filled automatically by ARP on an "as-needed" basis
Two things happen when the ARP table can not be used to translate
address
1. An ARP request packet with a broadcast Ethernet address is
out on the network to every computer
2. The outgoing IP packet is queued
Every computer's Ethernet interface receives the broadcast
frame. Each Ethernet driver examines the Type field in the
frame and passes the ARP packet to the ARP module. The ARP
packet says "If your IP address matches this target IP address,
please tell me your Ethernet address". An ARP request packet
something like this
---------------------------------------
|Sender IP Address 223.1.2.1 |
|Sender Enet Address 08-00-39-00-2F-C3|
---------------------------------------
|Target IP Address 223.1.2.2 |
|Target Enet Address |
---------------------------------------
TABLE 2. Example ARP
Each ARP module examines the IP address and if the Target IP
matches its own IP address, it sends a response directly to
source Ethernet address. The ARP response packet says "Yes,
target IP address is mine, let me give you my Ethernet address".
ARP response packet has the sender/target field contents swapped
compared to the request. It looks something like this
Socolofsky & Kale [Page 10]
RFC 1180 A TCP/IP Tutorial January 1991
---------------------------------------
|Sender IP Address 223.1.2.2 |
|Sender Enet Address 08-00-28-00-38-A9|
---------------------------------------
|Target IP Address 223.1.2.1 |
|Target Enet Address 08-00-39-00-2F-C3|
---------------------------------------
TABLE 3. Example ARP
The response is received by the original sender computer.
Ethernet driver looks at the Type field in the Ethernet frame
passes the ARP packet to the ARP module. The ARP module examines
ARP packet and adds the sender's IP and Ethernet addresses to its
table
The updated table now looks like this
----------------------------------
|IP address Ethernet address |
----------------------------------
|223.1.2.1 08-00-39-00-2F-C3|
|223.1.2.2 08-00-28-00-38-A9|
|223.1.2.3 08-00-5A-21-A7-22|
|223.1.2.4 08-00-10-99-AC-54|
----------------------------------
TABLE 4. ARP Table after
4.4 Scenario
The new translation has now been installed automatically in
table, just milli-seconds after it was needed. As you remember
step 2 above, the outgoing IP packet was queued. Next, the
address to Ethernet address translation is performed by look-up
the ARP table then the Ethernet frame is transmitted on the Ethernet
Therefore, with the new steps 3, 4, and 5, the scenario for
sender computer is
1. An ARP request packet with a broadcast Ethernet address is
out on the network to every computer
2. The outgoing IP packet is queued
3. The ARP response arrives with the IP-to-Ethernet
translation for the ARP table
Socolofsky & Kale [Page 11]
RFC 1180 A TCP/IP Tutorial January 1991
4. For the queued IP packet, the ARP table is used to translate
IP address to the Ethernet address
5. The Ethernet frame is transmitted on the Ethernet
In summary, when the translation is missing from the ARP table,
IP packet is queued. The translation data is quickly filled in
ARP request/response and the queued IP packet is transmitted
Each computer has a separate ARP table for each of its
interfaces. If the target computer does not exist, there will be
ARP response and no entry in the ARP table. IP will discard
IP packets sent to that address. The upper layer protocols can'
tell the difference between a broken Ethernet and the absence of
computer with the target IP address
Some implementations of IP and ARP don't queue the IP packet
waiting for the ARP response. Instead the IP packet is discarded
the recovery from the IP packet loss is left to the TCP module or
UDP network application. This recovery is performed by time-out
retransmission. The retransmitted message is successfully sent
onto the network because the first copy of the message has
caused the ARP table to be filled
5. Internet
The IP module is central to internet technology and the essence of
is its route table. IP uses this in-memory table to make
decisions about routing an IP packet. The content of the route
is defined by the network administrator. Mistakes
communication
To understand how a route table is used is to
internetworking. This understanding is necessary for the
administration and maintenance of an IP network
The route table is best understood by first having an overview
routing, then learning about IP network addresses, and then
at the details
5.1 Direct
The figure below is of a tiny internet with 3 computers: A, B, and C
Each computer has the same TCP/IP protocol stack as in Figure 1.
Each computer's Ethernet interface has its own Ethernet address
Each computer has an IP address assigned to the IP interface by
network manager, who also has assigned an IP network number to
Ethernet
Socolofsky & Kale [Page 12]
RFC 1180 A TCP/IP Tutorial January 1991
A B
| | |
--o------o------o--
Ethernet 1
IP network "development
Figure 6. One IP
When A sends an IP packet to B, the IP header contains A's IP
as the source IP address, and the Ethernet header contains A'
Ethernet address as the source Ethernet address. Also, the IP
contains B's IP address as the destination IP address and
Ethernet header contains B's Ethernet address as the
Ethernet address
----------------------------------------
|address source destination
----------------------------------------
|IP header A B |
|Ethernet header A B |
----------------------------------------
TABLE 5. Addresses in an Ethernet frame for an IP
from A to
For this simple case, IP is overhead because the IP adds little
the service offered by Ethernet. However, IP does add cost:
extra CPU processing and network bandwidth to generate, transmit,
parse the IP header
When B's IP module receives the IP packet from A, it checks
destination IP address against its own, looking for a match, then
passes the datagram to the upper-level protocol
This communication between A and B uses direct routing
5.2 Indirect
The figure below is a more realistic view of an internet. It
composed of 3 Ethernets and 3 IP networks connected by an IP-
called computer D. Each IP network has 4 computers; each
has its own IP address and Ethernet address
Socolofsky & Kale [Page 13]
RFC 1180 A TCP/IP Tutorial January 1991
A B C ----D---- E F
| | | | | | | | |
--o------o------o------o- | -o------o------o------o--
Ethernet 1 | Ethernet 2
IP network "development" | IP network "accounting
|
|
| H I
| | | |
--o-----o------o------o--
Ethernet 3
IP network "factory
Figure 7. Three IP Networks; One
Except for computer D, each computer has a TCP/IP protocol stack
that in Figure 1. Computer D is the IP-router; it is connected
all 3 networks and therefore has 3 IP addresses and 3
addresses. Computer D has a TCP/IP protocol stack similar to that
Figure 3, except that it has 3 ARP modules and 3 Ethernet
instead of 2. Please note that computer D has only one IP module
The network manager has assigned a unique number, called an
network number, to each of the Ethernets. The IP network numbers
not shown in this diagram, just the network names
When computer A sends an IP packet to computer B, the process
identical to the single network example above. Any
between computers located on a single IP network matches the
routing example discussed previously
When computer D and A communicate, it is direct communication.
computer D and E communicate, it is direct communication.
computer D and H communicate, it is direct communication. This
because each of these pairs of computers is on the same IP network
However, when computer A communicates with a computer on the far
of the IP-router, communication is no longer direct. A must use D
forward the IP packet to the next IP network. This communication
called "indirect".
This routing of IP packets is done by IP modules and
transparently to TCP, UDP, and the network applications
If A sends an IP packet to E, the source IP address and the
Ethernet address are A's. The destination IP address is E's,
because A's IP module sends the IP packet to D for forwarding,
destination Ethernet address is D's
Socolofsky & Kale [Page 14]
RFC 1180 A TCP/IP Tutorial January 1991
----------------------------------------
|address source destination
----------------------------------------
|IP header A E |
|Ethernet header A D |
----------------------------------------
TABLE 6. Addresses in an Ethernet frame for an IP
from A to E (before D
D's IP module receives the IP packet and upon examining
destination IP address, says "This is not my IP address," and
the IP packet directly to E
----------------------------------------
|address source destination
----------------------------------------
|IP header A E |
|Ethernet header D E |
----------------------------------------
TABLE 7. Addresses in an Ethernet frame for an IP
from A to E (after D
In summary, for direct communication, both the source IP address
the source Ethernet address is the sender's, and the destination
address and the destination Ethernet address is the recipient's.
indirect communication, the IP address and Ethernet addresses do
pair up in this way
This example internet is a very simple one. Real networks are
complicated by many factors, resulting in multiple IP-routers
several types of physical networks. This example internet might
come about because the network manager wanted to split a
Ethernet in order to localize Ethernet broadcast traffic
5.3 IP Module Routing
This overview of routing has shown what happens, but not how
happens. Now let's examine the rules, or algorithm, used by the
module
For an outgoing IP packet, entering IP from an upper layer, IP
decide whether to send the IP packet directly or indirectly, and
must choose a lower network interface. These choices are made
consulting the route table
For an incoming IP packet, entering IP from a lower interface,
must decide whether to forward the IP packet or pass it to an
layer. If the IP packet is being forwarded, it is treated as
Socolofsky & Kale [Page 15]
RFC 1180 A TCP/IP Tutorial January 1991
outgoing IP packet
When an incoming IP packet arrives it is never forwarded back
through the same network interface
These decisions are made before the IP packet is handed to the
interface and before the ARP table is consulted
5.4 IP
The network manager assigns IP addresses to computers according
the IP network to which the computer is attached. One part of a 4-
byte IP address is the IP network number, the other part is the
computer number (or host number). For the computer in table 1,
an IP address of 223.1.2.1, the network number is 223.1.2 and
host number is number 1.
The portion of the address that is used for network number and
host number is defined by the upper bits in the 4-byte address.
example IP addresses in this tutorial are of type class C,
that the upper 3 bits indicate that 21 bits are the network
and 8 bits are the host number. This allows 2,097,152 class
networks up to 254 hosts on each network
The IP address space is administered by the NIC (Network
Center). All internets that are connected to the single world-
Internet must use network numbers assigned by the NIC. If you
setting up your own internet and you are not intending to connect
to the Internet, you should still obtain your network numbers
the NIC. If you pick your own number, you run the risk of
and chaos in the eventuality that your internet is connected
another internet
5.5
People refer to computers by names, not numbers. A computer
alpha might have the IP address of 223.1.2.1. For small networks
this name-to-address translation data is often kept on each
in the "hosts" file. For larger networks, this translation data
is stored on a server and accessed across the network when needed.
few lines from that file might look like this
223.1.2.1
223.1.2.2
223.1.2.3
223.1.2.4
223.1.3.2
223.1.4.2
Socolofsky & Kale [Page 16]
RFC 1180 A TCP/IP Tutorial January 1991
The IP address is the first column and the computer name is
second column
In most cases, you can install identical "hosts" files on
computers. You may notice that "delta" has only one entry in
file even though it has 3 IP addresses. Delta can be reached
any of its IP addresses; it does not matter which one is used.
delta receives an IP packet and looks at the destination address,
will recognize any of its own IP addresses
IP networks are also given names. If you have 3 IP networks,
"networks" file for documenting these names might look something
this
223.1.2
223.1.3
223.1.4
The IP network number is in the first column and its name is in
second column
From this example you can see that alpha is computer number 1 on
development network, beta is computer number 2 on the
network and so on. You might also say that alpha is development.1,
Beta is development.2, and so on
The above hosts file is adequate for the users, but the
manager will probably replace the line for delta with
223.1.2.4 devnetrouter
223.1.3.1
223.1.4.1
These three new lines for the hosts file give each of delta's
addresses a meaningful name. In fact, the first IP address
has 2 names; "delta" and "devnetrouter" are synonyms. In
"delta" is the general-purpose name of the computer and the other 3
names are only used when administering the IP route table
These files are used by network administration commands and
applications to provide meaningful names. They are not required
operation of an internet, but they do make it easier for us
5.6 IP Route
How does IP know which lower network interface to use when
out a IP packet? IP looks it up in the route table using a
key of the IP network number extracted from the IP
Socolofsky & Kale [Page 17]
RFC 1180 A TCP/IP Tutorial January 1991
address
The route table contains one row for each route. The primary
in the route table are: IP network number, direct/indirect flag
router IP address, and interface number. This table is referred
by IP for each outgoing IP packet
On most computers the route table can be modified with the "route
command. The content of the route table is defined by the
manager, because the network manager assigns the IP addresses to
computers
5.7 Direct Routing
To explain how it is used, let us visit in detail the
situations we have reviewed previously
--------- ---------
| alpha | | beta |
| 1 | | 1 |
--------- ---------
| |
--------o---------------o
Ethernet 1
IP network "development
Figure 8. Close-up View of One IP
The route table inside alpha looks like this
--------------------------------------------------------------
|network direct/indirect flag router interface number
--------------------------------------------------------------
|development direct 1 |
--------------------------------------------------------------
TABLE 8. Example Simple Route
This view can be seen on some UNIX systems with the "netstat -r
command. With this simple network, all computers have
routing tables
For discussion, the table is printed again without the network
translated to its network name
Socolofsky & Kale [Page 18]
RFC 1180 A TCP/IP Tutorial January 1991
--------------------------------------------------------------
|network direct/indirect flag router interface number
--------------------------------------------------------------
|223.1.2 direct 1 |
--------------------------------------------------------------
TABLE 9. Example Simple Route Table with
5.8 Direct
Alpha is sending an IP packet to beta. The IP packet is in alpha'
IP module and the destination IP address is beta or 223.1.2.2.
extracts the network portion of this IP address and scans the
column of the table looking for a match. With this network a
is found on the first entry
The other information in this entry indicates that computers on
network can be reached directly through interface number 1. An
table translation is done on beta's IP address then the
frame is sent directly to beta via interface number 1.
If an application tries to send data to an IP address that is not
the development network, IP will be unable to find a match in
route table. IP then discards the IP packet. Some computers
a "Network not reachable" error message
5.9 Indirect Routing
Now, let's take a closer look at the more complicated
scenario that we examined previously
Socolofsky & Kale [Page 19]
RFC 1180 A TCP/IP Tutorial January 1991
--------- --------- ---------
| alpha | | delta | |epsilon
| 1 | |1 2 3| | 1 |
--------- --------- ---------
| | | | |
--------o---------------o- | -o----------------o--------
Ethernet 1 | Ethernet 2
IP network "Development" | IP network "accounting
|
| --------
| | iota |
| | 1 |
| --------
| |
--o--------o--------
Ethernet 3
IP network "factory
Figure 9. Close-up View of Three IP
The route table inside alpha looks like this
---------------------------------------------------------------------
|network direct/indirect flag router interface number
---------------------------------------------------------------------
|development direct 1 |
|accounting indirect devnetrouter 1 |
|factory indirect devnetrouter 1 |
---------------------------------------------------------------------
TABLE 10. Alpha Route
For discussion the table is printed again using numbers instead
names
--------------------------------------------------------------------
|network direct/indirect flag router interface number
--------------------------------------------------------------------
|223.1.2 direct 1 |
|223.1.3 indirect 223.1.2.4 1 |
|223.1.4 indirect 223.1.2.4 1 |
--------------------------------------------------------------------
TABLE 11. Alpha Route Table with
The router in Alpha's route table is the IP address of delta'
connection to the development network
Socolofsky & Kale [Page 20]
RFC 1180 A TCP/IP Tutorial January 1991
5.10 Indirect
Alpha is sending an IP packet to epsilon. The IP packet is
alpha's IP module and the destination IP address is
(223.1.3.2). IP extracts the network portion of this IP
(223.1.3) and scans the first column of the table looking for
match. A match is found on the second entry
This entry indicates that computers on the 223.1.3 network can
reached through the IP-router devnetrouter. Alpha's IP module
does an ARP table translation for devnetrouter's IP address and
the IP packet directly to devnetrouter through Alpha's
number 1. The IP packet still contains the destination address
epsilon
The IP packet arrives at delta's development network interface and
passed up to delta's IP module. The destination IP address
examined and because it does not match any of delta's own
addresses, delta decides to forward the IP packet
Delta's IP module extracts the network portion of the destination
address (223.1.3) and scans its route table for a matching
field. Delta's route table looks like this
----------------------------------------------------------------------
|network direct/indirect flag router interface number
----------------------------------------------------------------------
|development direct 1 |
|factory direct 3 |
|accounting direct 2 |
----------------------------------------------------------------------
TABLE 12. Delta's Route
Below is delta's table printed again, without the translation
names
----------------------------------------------------------------------
|network direct/indirect flag router interface number
----------------------------------------------------------------------
|223.1.2 direct 1 |
|223.1.3 direct 3 |
|223.1.4 direct 2 |
----------------------------------------------------------------------
TABLE 13. Delta's Route Table with
The match is found on the second entry. IP then sends the IP
directly to epsilon through interface number 3. The IP
contains the IP destination address of epsilon and the
Socolofsky & Kale [Page 21]
RFC 1180 A TCP/IP Tutorial January 1991
destination address of epsilon
The IP packet arrives at epsilon and is passed up to epsilon's
module. The destination IP address is examined and found to
with epsilon's IP address, so the IP packet is passed to the
protocol layer
5.11 Routing
When a IP packet travels through a large internet it may go
many IP-routers before it reaches its destination. The path it
is not determined by a central source but is a result of
each of the routing tables used in the journey. Each
defines only the next hop in the journey and relies on that
to send the IP packet on its way
5.12 Managing the
Maintaining correct routing tables on all computers in a
internet is a difficult task; network configuration is being
constantly by the network managers to meet changing needs.
in routing tables can block communication in ways that
excruciatingly tedious to diagnose
Keeping a simple network configuration goes a long way towards
a reliable internet. For instance, the most straightforward
of assigning IP networks to Ethernet is to assign a single IP
number to each Ethernet
Help is also available from certain protocols and
applications. ICMP (Internet Control Message Protocol) can
some routing problems. For small networks the route table is
manually on each computer by the network administrator. For
networks the network administrator automates this manual
with a routing protocol to distribute routes throughout a network
When a computer is moved from one IP network to another, its
address must change. When a computer is removed from an IP
its old address becomes invalid. These changes require
updates to the "hosts" file. This flat file can become difficult
maintain for even medium-size networks. The Domain Name System
solve these problems
6. User Datagram
UDP is one of the two main protocols to reside on top of IP.
offers service to the user's network applications. Example
applications that use UDP are: Network File System (NFS) and
Socolofsky & Kale [Page 22]
RFC 1180 A TCP/IP Tutorial January 1991
Network Management Protocol (SNMP). The service is little more
an interface to IP
UDP is a connectionless datagram delivery service that does
guarantee delivery. UDP does not maintain an end-to-end
with the remote UDP module; it merely pushes the datagram out on
net and accepts incoming datagrams off the net
UDP adds two values to what is provided by IP. One is
multiplexing of information between applications based on
number. The other is a checksum to check the integrity of the data
6.1
How does a client on one computer reach the server on another
The path of communication between an application and UDP is
UDP ports. These ports are numbered, beginning with zero.
application that is offering service (the server) waits for
to come in on a specific port dedicated to that service. The
waits patiently for any client to request service
For instance, the SNMP server, called an SNMP agent, always waits
port 161. There can be only one SNMP agent per computer
there is only one UDP port number 161. This port number is
known; it is a fixed number, an internet assigned number. If an
client wants service, it sends its request to port number 161 of
on the destination computer
When an application sends data out through UDP it arrives at the
end as a single unit. For example, if an application does 5
to the UDP port, the application at the far end will do 5 reads
the UDP port. Also, the size of each write matches the size of
read
UDP preserves the message boundary defined by the application.
never joins two application messages together, or divides a
application message into parts
6.2
An incoming IP packet with an IP header type field indicating "UDP
is passed up to the UDP module by IP. When the UDP module
the UDP datagram from IP it examines the UDP checksum. If
checksum is zero, it means that checksum was not calculated by
sender and can be ignored. Thus the sending computer's UDP
may or may not generate checksums. If Ethernet is the only
between the 2 UDP modules communicating, then you may not
Socolofsky & Kale [Page 23]
RFC 1180 A TCP/IP Tutorial January 1991
checksumming. However, it is recommended that checksum
always be enabled because at some point in the future a route
change may send the data across less reliable media
If the checksum is valid (or zero), the destination port number
examined and if an application is bound to that port, an
message is queued for the application to read. Otherwise the
datagram is discarded. If the incoming UDP datagrams arrive
than the application can read them and if the queue fills to
maximum value, UDP datagrams are discarded by UDP. UDP will
to discard UDP datagrams until there is space in the queue
7. Transmission Control
TCP provides a different service than UDP. TCP offers a connection
oriented byte stream, instead of a connectionless datagram
service. TCP guarantees delivery, whereas UDP does not
TCP is used by network applications that require guaranteed
and cannot be bothered with doing time-outs and retransmissions.
two most typical network applications that use TCP are File
Protocol (FTP) and the TELNET. Other popular TCP
applications include X-Window System, rcp (remote copy), and the r
series commands. TCP's greater capability is not without cost:
requires more CPU and network bandwidth. The internals of the
module are much more complicated than those in a UDP module
Similar to UDP, network applications connect to TCP ports. Well
defined port numbers are dedicated to specific applications.
instance, the TELNET server uses port number 23. The TELNET
can find the server simply by connecting to port 23 of TCP on
specified computer
When the application first starts using TCP, the TCP module on
client's computer and the TCP module on the server's computer
communicating with each other. These two end-point TCP
contain state information that defines a virtual circuit.
virtual circuit consumes resources in both TCP end-points.
virtual circuit is full duplex; data can go in both
simultaneously. The application writes data to the TCP port,
data traverses the network and is read by the application at the
end
TCP packetizes the byte stream at will; it does not retain
boundaries between writes. For example, if an application does 5
writes to the TCP port, the application at the far end might do 10
reads to get all the data. Or it might get all the data with
single read. There is no correlation between the number and size
Socolofsky & Kale [Page 24]
RFC 1180 A TCP/IP Tutorial January 1991
writes at one end to the number and size of reads at the other end
TCP is a sliding window protocol with time-out and retransmits
Outgoing data must be acknowledged by the far-end TCP
Acknowledgements can be piggybacked on data. Both receiving ends
flow control the far end, thus preventing a buffer overrun
As with all sliding window protocols, the protocol has a window size
The window size determines the amount of data that can be
before an acknowledgement is required. For TCP, this amount is not
number of TCP segments but a number of bytes
8. Network
Why do both TCP and UDP exist, instead of just one or the other
They supply different services. Most applications are implemented
use only one or the other. You, the programmer, choose the
that best meets your needs. If you need a reliable stream
service, TCP might be best. If you need a datagram service,
might be best. If you need efficiency over long-haul circuits,
might be best. If you need efficiency over fast networks with
latency, UDP might be best. If your needs do not fall nicely
these categories, then the "best" choice is unclear. However
applications can make up for deficiencies in the choice.
instance if you choose UDP and you need reliability, then
application must provide reliability. If you choose TCP and you
a record oriented service, then the application must insert
in the byte stream to delimit records
What network applications are available
There are far too many to list. The number is growing continually
Some of the applications have existed since the beginning of
technology: TELNET and FTP. Others are relatively new: X-Windows
SNMP. The following is a brief description of the
mentioned in this tutorial
8.1
TELNET provides a remote login capability on TCP. The operation
appearance is similar to keyboard dialing through a telephone switch
On the command line the user types "telnet delta" and receives
login prompt from the computer called "delta".
TELNET works well; it is an old application and has
interoperability. Implementations of TELNET usually work
different operating systems. For instance, a TELNET client may be
Socolofsky & Kale [Page 25]
RFC 1180 A TCP/IP Tutorial January 1991
VAX/VMS and the server on UNIX System V
8.2
File Transfer Protocol (FTP), as old as TELNET, also uses TCP and
widespread interoperability. The operation and appearance is as
you TELNETed to the remote computer. But instead of typing
usual commands, you have to make do with a short list of commands
directory listings and the like. FTP commands allow you to
files between computers
8.3
Remote shell (rsh or remsh) is one of an entire family of remote
style commands. The UNIX copy command, cp, becomes rcp. The
"who is logged in" command, who, becomes rwho. The list
and is referred to collectively to as the "r" series commands or
"r*" (r star) commands
The r* commands mainly work between UNIX systems and are designed
interaction between trusted hosts. Little consideration is given
security, but they provide a convenient user environment
To execute the "cc file.c" command on a remote computer called delta
type "rsh delta cc file.c". To copy the "file.c" file to delta,
"rcp file.c delta:". To login to delta, type "rlogin delta", and
you administered the computers in a certain way, you will not
challenged with a password prompt
8.4
Network File System, first developed by Sun Microsystems Inc,
UDP and is excellent for mounting UNIX file systems on
computers. A diskless workstation can access its server's hard
as if the disk were local to the workstation. A single disk copy
a database on mainframe "alpha" can also be used by mainframe "beta
if the database's file system is NFS mounted on "beta".
NFS adds significant load to a network and has poor utility
slow links, but the benefits are strong. The NFS client
implemented in the kernel, allowing all applications and commands
use the NFS mounted disk as if it were local disk
8.5
Simple Network Management Protocol (SNMP) uses UDP and is
for use by central network management stations. It is a well
fact that if given enough data, a network manager can detect
Socolofsky & Kale [Page 26]
RFC 1180 A TCP/IP Tutorial January 1991
diagnose network problems. The central station uses SNMP to
this data from other computers on the network. SNMP defines
format for the data; it is left to the central station or
manager to interpret the data
8.6 X-
The X Window System uses the X Window protocol on TCP to draw
on a workstation's bitmap display. X Window is much more than
utility for drawing windows; it is entire philosophy for designing
user interface
9. Other
Much information about internet technology was not included in
tutorial. This section lists information that is considered the
level of detail for the reader who wishes to learn more
o administration commands: arp, route, and
o ARP: permanent entry, publish entry, time-out entry,
o IP route table: host entry, default gateway,
o IP: time-to-live counter, fragmentation,
o RIP, routing
o Domain Name
10.
[1] Comer, D., "Internetworking with TCP/IP Principles, Protocols
and Architecture", Prentice Hall, Englewood Cliffs, New Jersey
U.S.A., 1988.
[2] Feinler, E., et al, DDN Protocol Handbook, Volume 2 and 3,
Network Information Center, SRI International, 333
Avenue, Room EJ291, Menlow Park, California, U.S.A., 1985.
[3] Spider Systems, Ltd., "Packets and Protocols", Spider
Ltd., Stanwell Street, Edinburgh, U.K. EH6 5NG, 1990.
11. Relation to other
This RFC is a tutorial and it does not UPDATE or OBSOLETE any
RFC
12. Security
There are security considerations within the TCP/IP protocol suite
To some people these considerations are serious problems, to
they are not; it depends on the user requirements
Socolofsky & Kale [Page 27]
RFC 1180 A TCP/IP Tutorial January 1991
This tutorial does not discuss these issues, but if you want to
more you should start with the topic of ARP-spoofing, then use
"Security Considerations" section of RFC 1122 to lead you to
information
13. Authors'
Theodore John
Spider Systems
Spider
Stanwell
Edinburgh EH6 5
United
Phone
from UK 031-554-9424
from USA 011-44-31-554-9424
Fax
from UK 031-554-0649
from USA 011-44-31-554-0649
EMail: TEDS@SPIDER.CO.
Claudia Jeanne
12 Gosford
Edinburgh EH6 4
United
Phone
from UK 031-554-7432
from USA 011-44-31-554-7432
EMail: CLAUDIAK@SPIDER.CO.
Socolofsky & Kale [Page 28]
if you see any problems within the linking, don't worry be happy,
this is version 0.1 of the Relevance System and you gotta expect some crappy subroutines sometimes,
just be content we did not write this in Java, which would have made this "bigger and better" HAHAHHA.
RFC documents can be found at I.E.T.F.
Relevance System Copyright © 2002 Spectrum WorldResearch
other technical nosh by ServerMasters Corporation
collaboration of BobX