TCP/IP Networking on
Why on Earth would anybody want
to do that?
Table of Contents
For most uses DOS is obsolete and it has been so for close to twenty
years. Even though it is obsolete, machines running DOS can still
benefit from being connected to a network for the same reasons that
modern machines benefit from it - transferring data though a network is
usually far faster than any other method. Putting a DOS machine on
a network is not that hard to do, but it does require a little effort.
Even the slowest DOS machines dating back to the early 1980s can do the following once networked:
Those three basic functions give you basic data transfer to other
machines on your network, or to countless other machines on the
Internet. And in addition to those basic functions you can:
- Get a network address automatically using DHCP
- Set their date and time from a network time server
- Send and receive files using FTP
DOS was designed and was popular long before personal computers
were expected to be on a network. Back 20 or 30 years ago if you wanted
to do electronic data transfer you usually used a modem and software
that let you connect to a specific machine, which was also usually
isolated and not networked to anything else. If you could connect to a
machine on a network you usually did it as a terminal to that machine,
not as a networked machine with equal access to the network. As a
result, DOS has very little support for networking - anything you want
to do requires installing additional software.
- Connect to Internet Relay Chat (IRC) servers
- Use Telnet to access some online services
- Serve files using FTP
- Do some limited web browsing
Long before there were Windows or Macs there was DOS. And even before
DOS there was TCP/IP. And even before that there was a desire for
DOS is a pretty limited environment. Most DOS machines do not have a
lot of memory and the software is pretty simple. If you needed to
communicate with a DOS machine you generally loaded up a special
program (a terminal emulator) and dialed to another system
using a modem. Although Ethernet has existed for many years, it almost
never appeared in the home until the mid to late 1990s when people
finally got tired of walking around with floppy disks. And by then,
Windows had firmly replaced DOS.
Even though DOS is obsolete you can still use it to run TCP/IP and
communicate with other machines. TCP/IP takes quite a bit more memory
and CPU than a plain old terminal emulator using a modem but when used
with an Ethernet card it can be far far faster than the old modem
technique. Just to illustrate that point: a serial port on an old
machine might be able to transfer anywhere from 9600 to 115200 bits per
second, while an Ethernet card on the oldest PC I can find can transfer
over 50,000 bytes per second!
DOS is probably not what you want to 'surf the web' with although there
are bragging rights associated with having an old IBM PC XT directly
connected to the Internet via a cable modem or firewall. You can still
use telnet and FTP, but web browsing is going to be painful ... save
that for the bigger machines.
Networking with DOS satisfies the urge to do something that wasn't
meant to be done. And at least for file transfers within the home, it
sure beats walking around with 5.25 inch floppies!
What is TCP/IP?
TCP/IP is a collection of protocols designed to allow higher level
applications to send and receive data over a network. At a
very high level, it allows programs to open connections to other
programs on different machines across the network. At a very
low level it is just a mechanism for sending data across hardware.
TCP/IP is layered into several parts:
- IP: This is the lowest layer. IP packets
transmitted over your networking hardware. IP packets are not
guaranteed to arrive in the order they were transmitted, or arrive at
all! IP packets are sent to machines or groups of machines.
- UDP: UDP is a higher level protocol that uses IP
UDP adds the concept of 'ports' to the communications stack
so that a packet doesn't just target a machine anymore, it can target
an application running on that machine listening to a specific port.
UDP packets are not guaranteed to arrive in order or arrive
at all either. Each UDP packet is a self contained unit, like
a single piece of mail.
- TCP: TCP is another high level protocol that uses IP
packets. TCP uses ports to establish a 'connection' between
applications on two different machines, each using a port.
Packets are guaranteed to arrive, and in order too.
TCP can be thought of more like a telelphone call, as opposed
to UDP which behaves more like a posted letter.
TCP/IP is fairly complicated, especially the TCP part. A full blown
implementation requires more memory than is usual on an old DOS PC.
With some limitations and some features cut out, you can get a
reasonable amount of TCP/IP to operate on an old DOS PC with good
performance. If you cut a lot of corners you can squeeze TCP/IP into a
very small amount of memory, but the performance will suffer.
On a DOS PC there are generally two ways to run TCP/IP:
- TCP/IP is built into an application, such as with NCSA
Telnet or Minuet.
- TCP/IP is a TSR (Terminate and Stay Resident) program
loaded as a separate piece of software from the final application. The
application accesses TCP/IP through a software interrupt. (Trumpet)
The first approach works well for 'all-in-one' programs like NCSA
Telnet, which also has an FTP server built into it. The second approach
is more flexible and lets you right your own TCP/IP applications
because the TCP/IP part is a separate entity.
Warning About DOS
If you are not comfortable installing new hardware into your machine,
editing config.sys, or trying to debug hardware that hasn't been
supported in 15 years, then TCP/IP in DOS is not for you. At
a minimum you are going to have to:
On the other hand, the rewards are well worth it. Blasting files around
the house at speeds ranging from 20KB per second (on a slow machine
with a parallel-port Ethernet adapter) to 600KB per second (on a high
end 386 with a 16 bit NE2000 compatible adapter) sure beats the heck
out of 'sneakernet.'
- Install your Ethernet hardware. This implies successfully
avoiding IRQ and port conflicts
- Find the right packet driver and parameters
- Possibly debug your network setup
and Packet drivers
TCP/IP is a general protocol that can run over many types of networks:
In general, we will restrict this discussion to the more conventional
To connect to a network you need hardware. There are lots of
solutions out there - here are a few examples:
- A network card. This is a card that plugs
the bus on your machine. There are many manufacturers and
varieties of cards. Ethernet is the most popular type of
network card. Token Ring was quite capable but has been
abandoned because Ethernet hardware is so prevalent. Earlier
networking technologies such as Arcnet, IBM Cluster, IBM PC Network,
etc. are possible too but might not be supported for what you are
trying to do.
- Serial or parallel port: The serial or parallel port
you to connect directly to another machine, which makes a very small
network of two machines. Dial-up internet services basically
work this way. (The machine you are dialing to is a gateway
to other machines, which broadens your perceived network.)
- Parallel port-to-Ethernet adapters: These are real
adapters that attach using your machine's parallel port instead of
plugging into a bus slot. These are useful if your need is
temporary or you have no available slots to use.
Any hardware that you choose should have a 'packet driver'. A
packet driver is a DOS terminate and stay resident program that
provides a standard programming API for using a specific ethernet card.
If you have TCP/IP software that works with the packet
interface, then it will work with any hardware that has a packet
driver. If your network hardware does not have a packet
driver, you need to find software that knows how to talk directly to
Click here for a
detailed discussion of packet drivers.
There are lots of factors that go into choosing networking hardware.
Here is my set of criteria:
- Can I get the hardware for my machine? A
with a 16 bit ISA bus or PCI bus is easy to find hardware for.
A machine with 8 bit PC bus slots or non-standard slots is
much more difficult to find networking hardware for.
- Does the selected hardware have a good packet driver?
A good packet driver not only makes the card work, but it
affects performance. Many packet drivers can be found here.
The packet driver programming specification can be found here.
Finally, older hardware might come with packet drivers on a diskette
included with the hardware.
- Can I connect it to my network? Newer cards
twisted pair wiring with the familiar RJ45 connector. Before
twisted pair was standardized there were non-standard cards that used
twisted pair, there was 'Thinnet', and there was 'Thicknet'.
Be prepared to dive into the world of AUI adapters, BNC
jacks, transceivers, hubs and switches.
For 16 bit ISA bus machines you can use nearly anything. I
would look for a card from a well-known manufacturer with an RJ45
connector and a good packet driver. 3Com, Intel, and
NE2000 compatible cards are safe bets.
For 8 bit ISA bus machines your choices are more limited. The 3Com
3C503 based cards are usable. Western Digital/SMC 8003 based
cards and NE1000 cards are good as well. I have not experienced
one but I have read in many places that if you find a 3Com
3C501 based card
that you should burn it and bury it. Some 16 bit cards might
be able to function in an 8 bit slot, but you will have to experiment
For machines without slots or where you want a temporary solution I
would use a parallel-port to Ethernet adapter. The Xircom
PE3-10BT is a good example of this type of adapter. It
connects to the machine using the parallel port and the packet driver
makes it look just like a real Ethernet card. But the
overhead of the parallel port does hurt performance, so while it is a
good basic solution it will never beat the performance of a real
Of course you might have a machine new enough to have PCI slots. If you
are running DOS on such a high powered machine, I applaud you. :-)
Look for an older model Ethernet card with DOS packet drivers
and you will be fine.
last updated July 31st, 2008