Click here to Skip to main content
15,897,704 members
Articles / Desktop Programming / MFC
Article

The Ultimate TCP/IP Home Page

Rate me:
Please Sign up or sign in to vote.
4.98/5 (77 votes)
25 Aug 2007CPOL13 min read 2.6M   45.4K   267   544
Ultimate TCP-IP is now Open Source

Introduction

Welcome!

We are very happy to announce that we have made the decision to offer our commercial lineup of MFC libraries, including Ultimate Toolbox, Ultimate Grid, and Ultimate TCP/IP to the CodeProject.com community free of charge.

These are the full and complete libraries including source code, documentation, samples and examples.

Ultimate Toolbox, Ultimate Grid and Ultimate TCP/IP come with full source code, and are compatible with Microsoft Visual Studio versions 6.0 through 2005.

The Ultimate Toolbox and line of related MFC libraries products have been powering professional MFC applications for more than 10 years. We realize that there is a very large number of users who are still coding new applications in Visual C++ and MFC and who are looking for effective and proven libraries to enhance their applications, as well as those with legacy code to maintain and update.

By releasing these long standing MFC libraries to the CodeProject.com community we hope that the libraries will continue to grow, evolve and provide a library of useful controls to the development community through the auspices of The Code Project and its members.

Contents

Ultimate TCP-IP Features

Easy To Use, Powerful Framework

  • Includes both high-level and low-level APIs.
  • No need to know Winsock programming. Work with the high level APIs to perform complex tasks with just a few lines of code.
  • Works with MFC, ATL and Windows SDK applications.
  • Fully object oriented, letting you create your own specialized Internet classes with ease.
  • The library is 100% royalty free.
  • Unlike other development components this framework is designed to work on all Win32 versions of Windows (i.e. not only NT).
  • Create highly scalable servers (hundreds of connections per CPU) using our multi-threaded server framework.
  • Create customized protocols for highly efficient data transfer.

Includes Servers For The Most Popular Protocols

The Server edition of Ultimate TCP/IP includes the server-side implementations for the following protocols:

  • Web Server (HTTP protocol).
  • Finger server.
  • Fully functional Email and relay server (SMTP, POP3, DNS)
  • File transfer server (FTP)
  • Echo server.

*full source for each of the protocols is included

Design Your Own Custom Protocol

  • Create modified protocols by deriving from our base protocol classes.
  • Create entirely new protocols by deriving from our client and server framework classes. This is very easy since the product comes with complete source code for all of the included protocols, which you can then use as a guideline.
  • Our customers have found that source code availability drastically cuts down on time spent debugging .

Maximum Access Control

  • The framework includes functionality that lets you grant, suspend and/or deny user access based on their IP address or network range.
  • The server framework also monitors every single command sent from the server.
  • Allows you to grant, deny and modify client requests based on your own custom protocol logic.
  • In conjunction with the secure version you can make sure that both the server and the client use a certificate for authentication.
  • Includes Brute-Force attack prevention.

Includes Full Source Code

  • Unlike other competing products Ultimate TCP/IP Server edition includes 100% of it's source code, including its framework, protocols and utility classes (no special licensing required).
  • Designed specifically for Visual C++ developers.
  • No need to worry about compiler settings or conflicts with other libraries.
  • You can easily debug and profile your code.

Includes ActiveX Wrappers Written Using ATL

  • Includes the ActiveX wrappers for each of the supported protocols, letting you customize your applications for a COM compliant environment.
  • Each ATL component supports both synchronous and asynchronous modes, so you can use them in non-event driven environments such as ASP.

No External Dependencies On WinInet Or MFC

  • Ultimate TCP/IP does not use WinInet in any way, so it does not suffer any of the performance issues associated with WinInet.
  • Works perfectly with MFC, but does not depend on any of the MFC classes. Applications written using Ultimate TCP/IP are extremely light weight and have superb performance.

Supported Protocol Standards

  • The Email sending protocol (Simple Mail Transfer Protocol -SMTP ) as Outlined by The Internet standard RFC 821.
  • Email retrieving protocol (Post office Protocol version 3 - POP3) as outlined by the request for comments RFC 1460, RFC 937, RFC 918, and RFC 1725, RFC 1939, and Internet Standard 53.
  • Internet Message Access Protocol - Version 4 ( IMAP4) As Outlined by the standard Track RFC 1730.
    Internet messages formats; Standard for the message format of the ARPA internet text message (RFC 822) and Standard for Interchange of USENET Messages (RFC 850 and RFC 1036 ).
  • Newsreaders protocols (Network News Transfer Protocol -NNTP) as described by RFC 977.
  • Message encoding protocol, MIME (Multipurpose Internet Mail Extensions), as described in RFC (1341, 1521, 1522, 2045, RFC 2045 (Format of Internet Message Bodies), RFC 2046 (Media Types), RFC 2047 (Message Header Extensions for Non-ASCII Text), RFC 2048 and 2049.
  • Domain Name Service, DNS (RFC 973, 1034 and RFC 1035).
  • Finger protocol.
  • Ping and TraceRoute and ICMP (RFC 792 and 1393).
  • Hypertext Transfer Protocol - HTTP and (RFC 1945 and RFC 2068).
  • HTTP Authentication: Basic and Digest Access Authentication - RFC 2617.
  • The MD5 Message-Digest Algorithm - RFC 1321.
  • HMAC: Keyed-Hashing for Message Authentication - RFC 2104.
  • File Transfer Protocol (FTP) -RFC 959
  • Add TLS/SSL support to applications written using Ultimate TCP/IP client or enterprise editions with just a couple lines of code.
  • The encryption and decryption is totally encapsulated so you can concentrate on your application's business logic.
  • Enabling/disabling a secure connection is as easy as a single function call.
  • There's no need to know security or encryption details, you can use high level APIs to perform complex tasks with just a few lines of code.
  • Works with MFC, ATL and Windows SDK applications.
  • Fully object oriented, so it's easy to build your own specialized Internet classes.
  • The product is 100% royalty free.
  • Comes as a plug-in .DLL with full C++ source code.

Programmatic And Interactive Certificate Management

  • Powerful object-oriented certificate management API.
  • Ready-to-use certificate management wizard (interactive mode).
  • Unlike other products the certificate management wizard can be integrated with your own application, without having to run as a separate application.
  • You can search, view, select, install, and/or delete a certificate programmatically or interactively.
  • Generating a certificate-signing request (CSR) can be done with a single function call (programmatic mode). You can also do this in interactive mode by integrating the ready-to-use certificate management wizard into your application.

Security Features

  • Fully Supports PCT, SSL v2.0, SSL v3.0, and TLS v1.0.
  • The certificate validation process is fully automated, and you can configure this process to: deny access for all errors; allow access regardless of an error (ideal for testing); or build your own authentication logic based on the occurrence of certain errors.
  • When used in conjunction with the enterprise edition you can ensure that both the server and the client use a certificate for authentication.

Included SSL/TLS Servers

  • Secure Web Server (HTTPS): can be used by all browsers that support SSL/TLS (e.g. Netscape and Internet Explorer).
  • Secure Mail server: can be used by all clients that support SSL/TLS (e.g. Outlook Express and MS Outlook).
  • Secure FTP Server: can be used by all clients that support SSL/TLS (e.g. WS_FTP and Cute FTP).
  • Secure Echo: can be used as the basis for building a secure custom protocol that takes advantage of the well-known, secure SSL/TLS protocol.

Configuration

Layout

We've split up the components of the Ultimate TCP-IP into separate source code, samples and documentation files for the initial deployment.

In general, for a code library such as the Ultimate TCP-IP, installation files are a cumbersome nuisance. While they do allow the formality of license agreement acceptance, and are expected of a commercial offering, for our purposes it would be too much trouble to update an entire install in order to accommodate a small update to a core source file or sample, and if the CP community finds this offering useful (and we hope they do) we expect that there will be updates and patches in various forms - for now, we'll keep it simple and see how it evolves.

The samples and library projects all reference relative paths with respect to source and include files, and should compile 'out of the box' if the ZIP files are extracted to a common directory - your installation should look more or less like this:

Community Support

Support for the products will be community based, and will include participation from core developers of the products, long standing and informed users of the products, and other members of the CodeProject.com community.

Please also make note of our FAQ page.

Licensing

It is our intention that you be able to use the libraries in any manner you wish however specific details of licensing rights, limitation of liability, and other details are included both here, and in a license.txt file included with the downloadable packages

History

August 2007 - Ultimate TCP-IP version 4.2 - Initial CodeProject release.

The main focus of Ultimate TCP/IP Version 4.2 has been to update the source code for use with Microsoft Visual Studio 2005, while maintaining compatibility with Visual Studio 6.0. This section contains an overview of the various impacts of the version 4.2 revisions:

Unicode builds:

  • New Visual C++ 8.0 projects now default to Unicode compilation.

Much of the Ultimate TCP/IP code is char based, having its origins in the implementation of several DOD RFCs dealing primarily with transmission protocols using 7 and 8 bit ASCII based command sets and data formats. For this reason updating the code to support compilation under unicode constitutes a special case, in that unlike most Windows libraries it is desirable to maintain the core code as char based while providing a unicode interface where necessary for ease of use within a wide char build.

In some cases, it made sense to rework the classes for full unicode compatibility substituting _TCHAR for char and using the generic text mappings. Other classes (especially those encapsulating ANSI based internet protocols) were modified to provide the user with wide char overloads when used in a unicode build. This was especially important for those classes where a wide char version of a function might be convenient for the user, but the char equivalent will still be called from char based internal code.

Some functions (overrides) that act as notification callbacks concerning events where protocol data is returned will still return ANSI text.

Warnings:

  • A primary goal of the Ultimate TCP/IP 4.2 release was clean compilation at Warning Level 4 in both VS2005 and VS6.0.

There were several issues to be addressed here. It was found that many areas of the code files evoked warnings at level 3 in VS8 that are either new to VS7/8 or VC6 level 4 warnings re-classified as level 3. Also, there are new warnings dealing with 64 bit portability (on by default in new VS2005 projects).

Level 4 warnings invoked by the STL code that were present in VC6 builds have been addressed.

With regard to 64 bit portability, Ultimate TCP/IP 4.2 is not intended to provide full 64 bit compilation, though some changes were made to suppress these warnings. In some cases functions taking integer parameters to designate buffer sizes have been updated to take size_t, which should help users of the class using values returned from strlen etc. to avoid warnings when calling the UT code. Future releases may address this issue more fully.

Note: Some portions of the code using static functions may give rise to warning C4710 (function not inlined). This warning occurs after the compiler has read the last line of code in the compiland, and can only be discarded on a per-project basis.

Updates to the C Run Time:

  • With the introduction of VC8, many CRT string handling functions are deprecated in favor of their safe equivalents.

Version 4.2 only partially addresses this issue, preferring to retain (for now) the non-safe string functions. Pragmas are provided to disable this warning in the core Ultimate TCP/IP code on a per file basis - these pragmas should not affect warning settings beyond the scope of each compiland. Future versions of Ultimate TCP/IP should address this issue more fully, as do Ultimate Toolbox and Ultimate Grid.

We have tried to limit the use of pragmas in disabling warnings for the Ultimate TCP/IP code. Beyond the safe string warnings, most pragmas dealing with warnings should be disabling warnings arising from the STL or SDK.

  • Several POSIX function names were deprecated in favor of their ISO equivalents.

All functions generating warning C4996 related to their POSIX name declarations were changed to use their ISO name declaration. This change is backward compatible to VC6. Some of these functions remain deprecated in favor of their safe counterparts.

  • Files referencing headers no longer included in VC8 were updated (e.g. iostream vs iostream.h). This is change does not break VC6.0 compatibility.

Changes to the Platform SDK

  • There have been changes to the Platfom SDK with the release of Visual Studio 2005 and the Platform SDK 2003.

If you are using the Ultimate TCP/IP secure client and server classes with 2005 it is no longer necessary to install a separate version of the Platform SDK to compile the UTSecureLayer.DLL. However, some key headers and lib files required by Visual Studio 6.0 are no longer contained in the revised Platform SDK 2003. VC6.0 users compiling the secure code will need to access a previous version of the Platform SDK. (PSDK from February 2003 recommended)

UTSecureLayer.DLL builds:

  • With version 4.2, the UTSecureLayer builds have been renamed based on character set and release/debug version.

Where previously code built against the secure DLL had to assume that the build was compatible with the current settings, we've separated it into UTSecureLayer.DLL, UTSecureLayerU.DLL, UTSecureLayerD.DLL, UTSecureLayerUD.DLL based on Unicode / Debug settings. Some project settings may need to be reset to reflect this.

Breaking Changes:

  • CUT_DataSource and derived classes

In preparing the Ultimate TCP/IP for wide char compilation, most file names and paths were changed to use _TCHAR strings, and this is reflected in the interfaces to the datasouces which take file names.

The interfaces that were specifying buffer or data lengths as unsigned int now take size_t, which may require changes to existing derived classes.

The datasource classes themselves remain primarily char based, as they are mostly used internally by ANSI based protocol classes. In future we may provide wide char or _TCHAR based classes.

The strings returned in the UT_ARTICLEINFO structure will be wide char for _UNICODE builds. This may break code that was attempting to decode strings with calls to CUT_HeaderEncoding methods, which take only char. For this reason, and added convenience, the strings returned in this structure will have been decoded if necessary, and the structure now contains a text representation of the associated character set for the applicable fields. Note that only Author and Subject are routinely encoded in an NNTP header.

  • CUT_Msg, CUT_HeaderEncoding - decoding functions that previously took a reference to an LPCTSTR to return the charset now take an LPSTR that should be declared/allocated with space to receive the charset.

Miscellaneous Fixes:

  • CUT_SMTPClient: Was failing to include Reply-To header if set in CUT_Msg when sending.
  • CUT_NNTPClient: UT_ARTICLEINFO now returns correct References header string.

License

This article, along with any associated source code and files, is licensed under The Code Project Open License (CPOL)


Written By
Web Developer
Canada Canada
In January 2005, David Cunningham and Chris Maunder created TheUltimateToolbox.com, a new group dedicated to the continued development, support and growth of Dundas Software’s award winning line of MFC, C++ and ActiveX control products.

Ultimate Grid for MFC, Ultimate Toolbox for MFC, and Ultimate TCP/IP have been stalwarts of C++/MFC development for a decade. Thousands of developers have used these products to speed their time to market, improve the quality of their finished products, and enhance the reliability and flexibility of their software.
This is a Organisation

476 members

Comments and Discussions

 
QuestionCreate highly scalable servers (hundreds of connections per CPU) ?? Pin
Ahmed Charfeddine4-Oct-07 1:48
Ahmed Charfeddine4-Oct-07 1:48 
AnswerRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Tim Deveaux4-Oct-07 3:55
Tim Deveaux4-Oct-07 3:55 
AnswerRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Mike Dimmick13-Oct-07 2:04
Mike Dimmick13-Oct-07 2:04 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
KenThompson14-Oct-07 2:50
KenThompson14-Oct-07 2:50 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Tim Deveaux14-Oct-07 5:28
Tim Deveaux14-Oct-07 5:28 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
KenThompson14-Oct-07 6:40
KenThompson14-Oct-07 6:40 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Tim Deveaux14-Oct-07 9:12
Tim Deveaux14-Oct-07 9:12 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Ahmed Charfeddine15-Oct-07 22:27
Ahmed Charfeddine15-Oct-07 22:27 
Dear M.Tim I read your previous discusions with M.Ken: not only we can write an IOCP model : we already have many here at CodeProject we may adapt one to the Ultimate TCP/IP paradigms. I personaly have one within a chess server project I have developed and trying to deploy it in the internet by the end of this year if I make it with the resources. M. Mark Russinovich already explained the internals of IOCPs at OSR I think. But M. Tim other people simulated the mechanism with their own code using semaphore for the main events queu and separate/ fixed number of threads fetching events and processing them, etc. I don’t know where I saw it but I remember somebody did it in the context of a SIP stack at the server side (SIP proxy application). Also I think Apache has something of its own, ie some model similar to IOCPs for servicing the browsers requests Thus Apache does not create a separate thread for evry connection (this is for sure if I am wrong with the IOCP similar model).But of course I will go with M. Mike and M. Ken with the option just to reuse the IOCP api and not reinvent a model if we want to integrate that model into your very powerful Ultimate TCP/IP . I remember myself last year when I shifted all the code of my chess server into IOCP: first of all I was using multiple asynchronous sockets, then Select, then I was not understanding IOCPs for many times while suddenly I found it obvious and representing the right model (yes a right model): in fact first of all I was getting nightmares with the old code while trying to foresee the scenario that can happen to my server if suddenly 2000 users connect at the same time.I was tortured with the funny picture that when I deploy the server I will need to look after it all the time when it crashes so to restart it for the other players to connect again (Humm!) and play with the program.but I was remebering good terms said about IOCPs wich led me to try understand it again and again utill I implemented it and regained confidence that my application can run one day on the internet.
M. Tim, I already tested my server with special client application that simulates many connecting chess players. With 2000 sim. connections it still runs at constant performances !. There are two points : first with the IOCP being in place, when there’s high number of connections, we don’t hit the wall of nothing it only about many socket handles, but if those high-number connection become simultaneously intensive (ie we receive big flow of request per connection also we don’t hit the wall of performance : it is only we need to be careful about RAM in case we create outstanding data answers and that data get’s not liberated fast as the seding flow per user is weak. With my chess server yes I want to be able to manage 2000 players at the same time : the limit does not need be on that number and I don’t need to have an equal number of threads at the server side : with those 2000 players may be I have 800 players idle : thinking on their moves so the server is not receiving much load but from the other 1200: the others are sending chat and sending moves and when things come together my server is just processing the number of request it can process (imagine you have 2000 thread: do you control the moment or prevent it when all of them are awaiked from waiting status and get running to service the correponding requests, and can 2000 do execute without causing the application to crash ?) the more important thing M.Tim is that in case with IOCPs and that all get together at the same time, then you can percieve/detect that load moment and hence put dynamic code so to do somthings about it, for example in my case, I disregard the chat messages and only let the chess move requests pass (so those who play will still be able to play and see each others’ moves on the chessboards but only chat get’s disabled it is not a priority against chess moves ) and when the load goes off, then I release that particular behaviour.
I am eagerly wanting to my application to be a good experience of servers models as I spent tremdous time on its server architecture,and I’ll be releasing the IOCP parts of it as open source and of course I would not say I’ll be glad to bring my additions to this powerful ToolBox because I think many people will soon be able to integrate IOCPs into it by the time I release myself from my project and try to do something else.
Ken Tompson, I think I remember I read in a paper two years ago when I was at university that it is a person with the same name as yours who wrote the first GM chess engine.Can it be you ? Otherwise forgive me I am always speaking the chess langage.
M. Tim please where does the Anti-Brute Force Attack code reside ? I found the code after the accept moment, which checks the clients ip address and looks if it is permitted or blocked(Access Control) but I expected there is a code that detect when somebody is automatically firing many SYN packets and blocks him so that it does not cause the server to create 1000 unuseful socket references for example(ouufff again this will be much dangerous with the one thread/per socket mechanism as the attack will cause the creation of 1000 thread !).Does your code calculate the rate of incoming connection requests for example (the number of SYNs per seconds, or other thing) so to prevent the attack ?
Ahmed, 24 Tunisia.

GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? [modified] Pin
Tim Deveaux17-Oct-07 4:55
Tim Deveaux17-Oct-07 4:55 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Paul Sanders (the other one)29-Oct-07 21:38
Paul Sanders (the other one)29-Oct-07 21:38 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Tim Deveaux30-Oct-07 12:42
Tim Deveaux30-Oct-07 12:42 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Paul Sanders (the other one)30-Oct-07 23:32
Paul Sanders (the other one)30-Oct-07 23:32 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Tim Deveaux31-Oct-07 13:09
Tim Deveaux31-Oct-07 13:09 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
KenThompson22-Apr-08 14:35
KenThompson22-Apr-08 14:35 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Ahmed Charfeddine20-Jun-08 0:02
Ahmed Charfeddine20-Jun-08 0:02 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Ghazi H. Wadi16-Oct-07 16:09
Ghazi H. Wadi16-Oct-07 16:09 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Tim Deveaux17-Oct-07 4:57
Tim Deveaux17-Oct-07 4:57 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Ghazi H. Wadi19-Oct-07 11:53
Ghazi H. Wadi19-Oct-07 11:53 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Ghazi H. Wadi19-Oct-07 21:55
Ghazi H. Wadi19-Oct-07 21:55 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Paul Sanders (the other one)3-Nov-07 7:45
Paul Sanders (the other one)3-Nov-07 7:45 
GeneralRe: Create highly scalable servers (hundreds of connections per CPU) ?? Pin
Tim Deveaux5-Nov-07 12:54
Tim Deveaux5-Nov-07 12:54 
GeneralThe TCP/IP samples only contain the help files Pin
mhorowit16-Sep-07 9:45
mhorowit16-Sep-07 9:45 
GeneralRe: The TCP/IP samples only contain the help files Pin
Tim Deveaux19-Sep-07 7:23
Tim Deveaux19-Sep-07 7:23 
GeneralRe: The TCP/IP samples only contain the help files Pin
mhorowit19-Sep-07 7:41
mhorowit19-Sep-07 7:41 
GeneralExcellent job, but I have remarks and patch Pin
Sergey Kolomenkin13-Sep-07 0:33
Sergey Kolomenkin13-Sep-07 0:33 

General General    News News    Suggestion Suggestion    Question Question    Bug Bug    Answer Answer    Joke Joke    Praise Praise    Rant Rant    Admin Admin   

Use Ctrl+Left/Right to switch messages, Ctrl+Up/Down to switch threads, Ctrl+Shift+Left/Right to switch pages.