http://www.brutman.com/mTCP/mTCP.html
mTCP DOS Logo
TCP/IP applications for your PC compatible [IBM_PC_AT_]
retro-computers
Current version: July 1st, 2022
---------------------------------------------------------------------
2022-07-01: Good news everyone! A new mTCP is available!
Friends don't let friends run old code so help me
spread the word! Tweet, post on Reddit, perform an
interpretive dance, or do whatever you do to let people
know a new mTCP is available.
[Professor-]
* 2022-07-01 Release Notes
* Download
* Support and mailing list
Thanks, Mike
---------------------------------------------------------------------
Overview
mTCP is a set of TCP/IP applications for personal computers running
PC-DOS, MS-DOS, FreeDOS, and other flavors of DOS. The applications
include:
* DHCP: a DHCP client for auto-configuring your machine for use on
your network.
* FTP: an FTP client for transferring files across the network at
high speed.
* FTPSRV: a high performance FTP server that allows multiple
connected clients, a sandbox area for untrusted users, etc.
* HTGET: the HTGet program for downloading files/content from web
(HTTP) servers
* HTTPSERV: an HTTP server supporting HTTP 0.9, 1.0, 1.1
* IRCJR: the IRCjr IRC (Internet Relay Chat) client for chatting on
IRC networks.
* NC: the Netcat command which can be used to send and receive data
easily across a network.
* PING: the Ping command for checking basic network connectivity.
* PKTTOOL: A packet sniffer and diagnostic tool for packet drivers
* SNTP: an SNTP client for getting the current date and time from
public servers on the Internet.
* TELNET: a Telnet client for connecting to Unix systems, BBS
systems, or any computer that supports Telnet.
mTCP runs on all variants of DOS including IBM PC-DOS, Microsoft
MS-DOS, DR-DOS and FreeDOS. All of these applications will run well
on the oldest, slowest PC that you can find - I routinely use them on
an IBM PCjr made in 1983 because nothing beats the fun of putting a
38 year old computer on the Internet.
People are using mTCP for goofing off and for real work. If you have
a DOS machine that needs to send data across the network mTCP can
help you get that done. Besides its utility to vintage computers I
have heard of people using it to transfer lab data from dedicated
industrial PCs, allowing backups to be run on old machines, and
sending sales reports from the branch offices of a retail store to a
central server.
Don't have a vintage computer laying around? No problem! mTCP
applications will run in a variety of virtual and emulated
environments. It has been tested with modified DOSBox builds,
VirtualBox, VMWare, and QEMU. See the documentation for the details.
Requirements
mTCP applications should work on any IBM PC compatible personal
computer running DOS. To be more specific:
* An IBM PC compatible with an 8088 or better CPU
* 96KB to 256KB of system memory depending on the application
* DOS 2.1 or newer
* A network card (Ethernet adapter, or a device emulating Ethernet)
that has a "packet driver" (see below).
A packet driver is a utility that lets a program send and receive
Ethernet packets using your network card. The packet driver
specification is widely supported by both old and new Ethernet cards.
If your Ethernet card does not have a packet driver available an NDIS
or ODI driver with a "shim" to convert to the packet specification
should work but that will require more memory and be slower than
having a real packet driver. SLIP and PPP connections are also
supported if they use a packet driver that emulates Ethernet. See
http://crynwr.com/packet_driver.html for more information on the
packet driver specification.
My personal testing includes:
Machines:
* 8088 class: IBM PC, IBM PC XT, IBM PCjr, IBM Portable PC, IBM
Convertible, IBM PS/2 Model 25, Compaq Portable
* 80286/80386/80486: IBM PC AT, generic 80386-40, several generic
80486 systems, Compaq Deskpro 433i
* Pentium and better: generic Pentium 1, IBM Aptiva (AMD), generic
Pentium II
* Virtual machines: VMWare, VirtualBox. (QEMU is also known to
work.)
Ethernet adapters:
* Xircom PE3-10BT
* Novell NE1000, NE2000 and clones
* 3Com 3C503
* WD/SMC 8003 series
* Intel EtherExpress 8/16
* Davicom DM9008F
* LinkSys PCI
* SLIP using "EtherSLIP" (emulates Ethernet using a serial
connection.)
* PPP using DOSPPPD (emulates Ethernet using a serial connection)
Hundreds (thousands?) of people are using mTCP on a diverse set of
hardware. If your machine runs DOS and you have a packet driver for
your Ethernet card, then mTCP will probably work for you. SLIP and
PPP are also supported via EtherSLIP, so any machine with a serial
port can work too. (Even Token Ring using a packet driver that
emulates Ethernet has been demonstrted to work.)
Downloads
This is the official mTCP home page. There are other sites that
mirror mTCP but only this page guaranteed to have the original,
unmodified binaries. Anything you find on github, ibiblio or other
sites is not verified by me.
+-------------------------------------------------------------------+
| Current version: Binaries and source code available under the |
| GPLv3 license |
|-------------------------------------------------------------------|
| mTCP_2022-07-01.zip | Standard | The mTCP applications |
| | binaries | and sample files. |
|-------------------------+---------------+-------------------------|
| | | The same as above, but |
| | UPX | the EXEs are compressed |
| mTCP_2022-07-01_upx.zip | compressed | to take less disk |
| | binaries | space. Ideal for floppy |
| | | based systems. |
|-------------------------+---------------+-------------------------|
| | User | The one true PDF file |
| mTCP_2022-07-01.pdf | documentation | that will answer all of |
| | | your questions. |
|-------------------------+---------------+-------------------------|
| | | Source code and |
| mTCP-src_2022-07-01.zip | Source code | developer documentation |
| | | for this release. |
+-------------------------------------------------------------------+
Release notes can be found at mTCP_2022-07-01_Release_Notes.html.
Known problems / Errata
Yes, it happens ... But nothing yet!
Consider joining the mailing list so that you will know if something
does come up.
Support and mailing list
mTCP is a hobby project that I started in 2005. While it is only a
hobby project, I take pride in my work. If you have a comment, bug,
or suggestion for a feature please email me at mbbrutman at
gmail.com. I might ask for further information or a trace from the
program you are having trouble with. Your bug reports help me make
mTCP better for everybody else.
mTCP now has a mailing list! I plan on using it for announcements
about new releases, taking bug reports, and general mTCP support. The
mailing list has both an email interface and a web interface. You can
view it or sign up at https://groups.google.com/g/mtcp. (Non-Gmail
users can also participate using email; see the instructions here.)
If you need a change to make mTCP work better for you I am interested
in hearing your requirements. I am willing to write custom code if
needed, but instead of charging for that service I suggest making a
donation to a local animal shelter of your choice. (I have never seen
an over-funded animal shelter.) Contact me with what you need and
I'll see what I can do. (And thank you to those who have taken me up
on this offer!)
Recent changes
* July 2022: TCP library improvements, HOSTS file support, some new
features, bug fixes.
* January 2020: Improved flow control to make TCP more reliable
when packets are lost, HTGet significantly improved, Telnet ANSI
emulation improvements, the FTP client will try to automatically
set BIN mode to prevent accidental file corruption, CGA "snow"
work-arounds, and many small tweaks and fixes.
* July 2015: Added the HTTPSERV and PKTTOOL programs; moved
documentation to a PDF file; many small improvements and some bug
fixes
* April 2013: IRCjr, Telnet client, FTP client, FTP server, and TCP
/IP stack improvements
* May 2012: Power awareness, Xmodem and Ymodem transfers in Telnet,
faster FTP client sends, etc.
* October 2011: Upgrades and fixes for the FTP server; added user
input editing to IRCjr, fix Telnet options negotiation
* July 2011: HTGet added
Interested in seeing the source code that lets you talk directly to a
packet driver? I have taken the lowest layer of the mTCP code and
packaged it with a sample application that shows you how to interface
a C program with the software interrupt mechanism used by packet
drivers. Check it out here: mTCP_tcpacket.html
Related projects
People have been extending mTCP and sharing their code. Here are some
of the mTCP inspired projects that I know of:
* https://github.com/retrohun/mTCP: Modified to use DOS STDIO calls
instead of direct screen writes or BIOS calls, making the
programs useful over serial connections.
* https://github.com/jhpyle/mTCP: Telnet modified to support
Unicode, a mouse, extended keyboards and Sixel graphics.
* https://github.com/jhhoward/MicroWeb: A DOS web browser built on
top of mTCP.
* https://github.com/yamori813/mTCP: A TFTP client using mTCP.
* https://github.com/mikechambers84/ngIRCd-DOS: ngIRCd IRC server
ported to DOS/mTCP
Related resources
DOS TCP/IP Networking A detailed tutorial on packet drivers and
with Packet Drivers how they work.
Wireless Networking Use a small travel router to get your old
for Classic Machines machines using wired Ethernet onto WiFi.
Packet Driver The PC/TCP Packet Driver Specification
specification hosted by Crynwr Software.
Crynwr Software Packet A large collection of open source packet
Drivers drivers.
Georg Potthast's
collection of Packet A collection of more recent packet drivers.
Drivers
OpenWatcom C/C++ The compiler used to build mTCP; runs on
Compiler several platforms and cross-compiles to 16
bit DOS.
Videos and Blogs!
* Voidstar: 5150: SETTING UP NIC (NETWORK INTERFACE CARD) AND MTCP
(Blog)
* Alistair Ross: How to set up a retro DOS PC to use the web, IRC
chat, email, twitter, connect to BBS's and more! (YouTube)
* DaveJustDave: Ethernet the Easy Way on your Vintage DOS PC
(YouTube)
* lquessenberry: Eureka! The IBM 5150 is on the internet! (Blog)
* Adam Pachulski: Connecting a 286 DOS PC to the Internet Through a
Serial Connection ... in 2019 (Blog)
* PhilsComputerLab: MS-DOS networking with mTCP (YouTube)
* Alistair Ross: The Internet connected Hot Rod IBM PC XT!
(YouTube)
* compu85: Compaq Portable and mTCP (YouTube)
* Alistair Ross: How to use a DOS PC for web, email, twitter, IRC &
more! (YouTube)
* DaveJustDave: IBM 5170 AT Upgrade Part 2 - Ethernet Turns My AT
Into a 30 Year Old Web Server! (YouTube)
* fragglet: Connecting to the Internet via DOSbox's IPX emulation
(YouTube)
* RetroTech Chris: RetroTour: A Brand New DOS Web Browser??
Introducing MicroWeb (YouTube)
* RetroTech Chris: RetroTutorial: Using Facebook Messenger and
Discord in MS-DOS! (YouTube)
* digital diggings: mTCP using SLIP on DECserver 900TM (YouTube)
* The Old Net: Wireless MS-DOS Networking using a Serial Port and
an ESP8266!> (YouTube)
For developers
Jump in! See the mTCP Programming Sample!
All of the applications use the mTCP TCP/IP library which is designed
for high performance even on small, slower machines. The code is
written in a combination of C++ and assembler. The style of coding is
more like "C with classes" to improve the structure of the code with
assembler being used in limited areas to improve the performance. The
source code is fairly well commented. You can look at it as a
framework for writing TCP/IP applications for DOS, complete with
plenty of examples.
Features include ARP, UDP, DNS, IP fragments, listen and accept calls
for server applications, configurable buffer sizes, automatic
retransmit using Karne's algorithm, and run-time switchable tracing
for helping you debug. Features may be compiled in or out as needed
so that you can minimize the overhead of the TCP/IP library and
include only the features that you need. mTCP does not use floating
point operations, avoiding the code bloat of the floating point
emulation library.
mTCP is designed to be robust. DOS is a challenging environment to
work in because quite frankly, it is not much of an operating system.
mTCP attempts to minimize problems by using defensive programming
techniques. Not every programming error can be prevented, but the
library tries to help you where it can. For example, to prevent
fragmentation in the DOS heap mTCP generally preallocates pools of
objects and manages the objects instead of repeatedly allocating and
freeing memory using the DOS heap. The FTP server and the IRC client
have been demonstrated to run for days without leaking memory or
crashing the machine. The HTTP server has run for months at a time.
High performance is a key feature of mTCP. The library is written to
avoid excess memory copying wherever possible. Assembler is used on
some code for both performance and to avoid making expensive library
calls that will just invoke BIOS or DOS routines anyway. For the
ultimate in performance you can choose to handle raw packets directly
in your application layer code, or you can use higher level "send"
and "recv" type calls instead. The ability to adjust buffer sizes
allows you to balance speed versus memory footprint. Want to see how
fast mTCP is? Here are some performance measurements for FTP and for
raw socket performance: mTCP Performance notes
mTCP is only available as a library that you link with your
application. A TSR version that can be used by software interrupt is
not available. While a TSR version would allow more programming
environments access to TCP/IP services, it is a much more difficult
environment to work in and debug. Performance would also suffer too.
It would be an interesting project though - if you want to
collaborate on the design for a TSR version of mTCP please contact
me.
(For a TCP/IP stack that loads as a TSR see Trumpet by Peter Tattam.
Trumpet can usually be found by searching for TCPDRV or NTCPDRV.
WATTCP is an older, more widespread TCP/IP stack that can be used as
an alternative to mTCP. Neither Trumpet or WATTCP are actively
maintained.)
mTCP is developed using Open Watcom, an open source tool chain that
supports C, C++, and assembler. Open Watcom is flexible and generates
reasonably optimized code. Open Watcom also runs under modern
environments such as Windows and Linux so you can develop in the
environment of your choice while still generating 16 bit DOS
executables. Open Watcom is regularly updated; mTCP is using version
1.9 which was released in June 2010. Porting to other environments
such as Borland Turbo C++ for DOS is possible without too much pain.
(mTCP originally started with Borland Turbo C++ for DOS.)
Older versions
These are obsolete and have been replaced with newer versions that
have more features and less bugs. They are posted here for archival
purposes - please don't use them.
+-------------------------------------------------------------------+
| (Obsolete) 2020-03-07 version: Binaries and source code released |
| under the GPLv3 license; Release Notes |
|-------------------------------------------------------------------|
| mTCP_2020-03-07.zip | Standard | The mTCP applications |
| | binaries | and sample files. |
|-------------------------+---------------+-------------------------|
| | | The same as above, but |
| | UPX | the EXEs are compressed |
| mTCP_2020-03-07_upx.zip | compressed | to take less disk |
| | binaries | space. Ideal for floppy |
| | | based systems. |
|-------------------------+---------------+-------------------------|
| | User | The one true PDF file |
| mTCP_2020-03-07.pdf | documentation | that will answer all of |
| | | your questions. |
|-------------------------+---------------+-------------------------|
| | | Source code and |
| mTCP-src_2020-03-07.zip | Source code | developer documentation |
| | | for this release. |
|-------------------------------------------------------------------|
| |
| (Obsolete) 2020-01-01 version: Binaries and source code released |
| under the GPLv3 license; Release Notes |
|-------------------------------------------------------------------|
| mTCP_2020-01-01.zip | Standard | The mTCP applications |
| | binaries | and sample files. |
|-------------------------+---------------+-------------------------|
| | | The same as above, but |
| | UPX | the EXEs are compressed |
| mTCP_2020-01-01_upx.zip | compressed | to take less disk |
| | binaries | space. Ideal for floppy |
| | | based systems. |
|-------------------------+---------------+-------------------------|
| | User | The one true PDF file |
| mTCP_2020-01-01.pdf | documentation | that will answer all of |
| | | your questions. |
|-------------------------+---------------+-------------------------|
| | | Source code and |
| mTCP-src_2020-01-01.zip | Source code | developer documentation |
| | | for this release. |
|-------------------------------------------------------------------|
| |
| (Obsolete) 2015-07-05 version: Binaries only, source code not |
| distributed |
|-------------------------------------------------------------------|
| mTCP_2015-07-05.zip | Standard | The mTCP applications |
| | binaries | and sample files. |
|-------------------------+---------------+-------------------------|
| | | The same as above, but |
| | UPX | the EXEs are compressed |
| mTCP_2015-07-05_upx.zip | compressed | to take less disk |
| | binaries | space. Ideal for floppy |
| | | based systems. |
|-------------------------+---------------+-------------------------|
| | | A single PDF file with |
| mTCP_2015-07-05.pdf | Documentation | all of the |
| | | documentation. |
|-------------------------------------------------------------------|
| |
| (Obsolete) 2013-05-23 version: Binaries and source code released |
| under the GPLv3 license |
|-------------------------------------------------------------------|
| | Standard | The mTCP applications, |
| mTCP_2013-05-23.zip | binaries | sample files and user |
| | | documentation. |
|-------------------------+---------------+-------------------------|
| | | The same as above, but |
| | UPX | the EXEs are compressed |
| mTCP_2013-05-23_upx.zip | compressed | to take less disk |
| | binaries | space. Ideal for floppy |
| | | based systems. |
|-------------------------+---------------+-------------------------|
| | | The source code to mTCP |
| mTCP-src_2013-05-23.zip | Source code | with design |
| | | documentation and |
| | | notes. |
+-------------------------------------------------------------------+
---------------------------------------------------------------------
Created July 29th, 2008, Last updated July 1st, 2022
(C)opyright Michael B. Brutman, mbbrutman at gmail.com