TCP/IP Networking on DOS

Why on Earth would anybody want to do that?

Table of Contents


Introduction
What is TCP/IP?
A Warning About DOS
Hardware and Packet Drivers
Choosing Hardware

Packet Drivers (In depth, separate page)
Software (In depth, separate page)

mTCP TCP/IP Stack including IRCjr and Netcat


Introduction

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 communication.

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:

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:

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.

A 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.'

Hardware 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 networks.

To connect to a network you need hardware. There are lots of solutions out there - here are a few examples:

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 the hardware.

Click here for a detailed discussion of packet drivers.

Choosing Hardware

There are lots of factors that go into choosing networking hardware. Here is my set of criteria:

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 with that.

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 Ethernet card.

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.



Created August 13th 2007 last updated July 31st, 2008
(C)opyright Michael B. Brutman, mbbrutman@yahoo.com