=======================================================================
The INTERCOM programs are Copyright (1998 by Alex Urich. All Rights Reserved. They are provided as shareware with the following limitations: These programs are not to be copied, resold or distributed. There is no warranty or claim of fitness or reliability. The author shall not be held liable for any loss of data, down time, loss of revenue or any other direct or indirect damage or claims caused by these programs.
=======================================================================


THE INTERCOM

INTERCOM is a software package designed for people who need to understand in detail the basics of Internet communications. INTERCOM uses PPP and TCP/IP to connect to an Internet server and runs a simple application, retrieving e-mail. It displays all the packets transmitted and received, the protocol headers and data. The information is stored in text files for further analysis. 
INTERCOM creates all packets from scratch, without using BSD or WINSOCK libraries. It doesn't utilize any DLL's and does not change your computer settings. The program can be useful for people who design software for embedded systems with TCP/IP capabilities or for anybody who needs to know more details about Internet communications. 

INTERCOM shows you how to implement the following protocols: 
	Point to Point Protocol (PPP)
	Link Control Protocol (LCP)
	Password Authentication Protocol (PAP) 
	Internet Protocol Control Protocol (IPCP)
	Domain Name System (DNS)
	Transport Control Protocol (TCP)
	Internet Protocol (IP)
	User Datagram Protocol (UDP) 
	Post Office Protocol (POP3)
	
In addition, it shows you practical examples of how to:
	Create PPP packets and compute the frame check sequence (FCS) 
	Implement PPP state machine 
	Create TCP, IP and UDP packets	
	Compute TCP and UDP checksum
	Implement TCP state machine and check for transmission errors.


INTERCOM  FILES 
intercom.exe	configures the serial port and the modem, makes the connection to 		the Internet Service Provider and implements the PPP, DNS (UDP), 		TCP/IP and POP3 protocols. Displays all the packets transmitted 		and received, the protocol headers and data and stores the 		information in a text file for further analysis.
set_up.txt	contains data necessary to make the connection and retrieve mail.
mail.txt		stores mail.
modem.txt	contains modem initializing strings.
tcp.txt		stores all data transmitted and received in text format.
	

INSTALLING INTERCOM 
1. Create a directory called INTERCOM.
2. Copy all unzipped files into this directory.




CONNECTING TO THE INTERNET 
Note: you can run intercom.exe and connect to NETCOM Internet Service Provider (ix.netcom.com) using the username and password given in set_up.txt or you can connect to other Internet providers using the appropriate names and addresses. NETCOM telephone number is 949-365-2500.

To connect to an ISP (Internet Service Provider) you need:
1. The telephone number.
2. Username and password.

To run a TCP/IP application you need:
1. The exact name of the service you want to access (i.e. popd.ix.netcom.com for reading mail, smtp.ix.netcom.com for sending mail, etc).
2. The Primary or Secondary DNS Address (also called IP Address). If you subscribe to an ISP, the IP Address can be found in your Control Panel /  Internet / Connection / Properties / Server Type / TCP/IP Settings.
3. You can also use the DNS Address given in set-up.txt for any ISP.

Set-up the COM port:
Using Notepad, open set_up.txt and enter the COM port number available to your computer. This must be the serial port were your modem is connected. If you don't know what serial port to use click on Start/Control Panel / Modem / Properties.

Changing the modem initializing strings:
The file modem.txt contains typical Hayes "at" commands used by the majority of modems. You can change them with other "at" commands specific to your modem. Only three commands, starting with the "at" string are accepted. They must be placed on the first three lines of the file. 

To connect automatically to the server:
Type  "no"  on the line "Manual Login" in the set_up.txt file.

INTERCOM goes through the following steps for an automatic login:
* Dials the number.
* After the modem message "CONNECT" sends a CRLF (Carriage Return-Line Feed) string. 
* If the character received is 7E (hex), the beginning of a PPP packet, runs PPP. 	
* If not,
	Waits for the server greeting (words that sound like "login", "username", 	"password".
	Runs PPP.

Password Authentication Protocol (PAP) is always implemented for an automatic login.
 
Since the greeting messages and in general the connection procedure may be different from one ISP to another, you can use a manual login.

To connect manually:
1. Type  "yes"  on the line "Manual Login" in the set_up.txt file.
2. Run intercom.exe.
3. Type "at" followed by Return and wait for the modem response "OK".
4. Type "atdt" followed by the phone number and hit Return.
5. Wait for the ISP greeting, type your username and hit Return.
6. Wait for the "Password", type your password and hit Return.

In this case, the Password Authentication Protocol is not implemented.




HOW IT WOKS
1. If the serial port name, the modem initializing strings and the telephone number are correct the modem will connect to the server and the message CONNECT followed by the baud rate will be displayed.
2. Run Point to Point Protocol (PPP)
	2.1 Run Link Control Protocol (CO21) which checks the quality of the 	transmission line.
	2.2 Run Password Authentication Protocol (CO23) which negotiates the 	username and password. 
	2.3 Run Internet Protocol Control Protocol (8021) which assigns your IP 	Address and establishes the data format for the TCP/IP and UDP messages.
3. Run the Domain Name Search protocol  (DNS),
to find the DNS Address corresponding to the name of the service you requested (in this case, the address of the service for retrieving mail specified under POP Name). The Domain Name Search utilizes UDP (User Datagram Protocol) to transmit and receive data.
4. Run TCP/IP,
to implement the POP3 protocol for retrieving mail.
IP utilizes the DNS Address as the source address and the IP Address as the destination address. 
TCP utilizes an arbitrarily chosen number (greater than 1000) as the source port and TCP port 110 as the destination port.

You can exit the program at any time by pressing Ctrl-C.

RFC's 
The protocols implemented by INTERCOM are described in the following RFC's:

1.	PPP	RFC 1661 and RFC 1548
2.	DNS	RFC 1034 and RFC 1035
3.	TCP	RFC 793
4.	UDP	RFC 768
5.	IP	RFC 791
6.	POP3	RFC 1725
7.	SMTP	RFC 1725

THE set_up.txt FILE
1. The Username and Password are those required to connect to the ISP
2. The IP Address is utilized by the DNS search and TCP/IP as the source address.
3. TCP Port 110 is specific for the e-mail retrieving service using POP3 protocol. If you enter a different port number you will get a TCP error since the protocol is not implemented.
4. Any baud rate allowed by your modem can be utilized however, lower rates (9600) should be used in case of trouble. 
5. TCP MSG Size is the maximum number of data octets transmitted by the server in one TCP packet. Choose either 512 or 1024 although it does not necessarily mean the server will comply. Maximum message size allowed is 1460.
6. POP parameters (port, name, user, pass) must be the exact ones. The name of your POP server can be found from your ISP provider. Keep in mind that your e-mail username and password could be different than those used for connection.
7. Use WordPad to read the data specified by either one of the Show commands.  
8. Do not change the text placed in front of the semicolons.
9. Do not delete the semicolons.
10. Do not delete the line of stars at the end of file.
11. Save the original set_up.txt file as a reference.




THINGS TO DO IF SOMETHING GOES WRONG
1.	The modem could not make a connection to the ISP
		Re-dial the number.
		Check the phone number.
		Check the modem instruction manual and find the correct initializing commands.
2.	PPP transaction was unsuccessful
		Check your username and password. 
	 	Try the manual connection.
		The server does not support PPP protocol (AOL).
3.	UDP could not find the host address
		Re-run the program. Sometime servers are slow to respond to DNS queries.
		The IP address is incorrect.
		Try the Secondary DNS address.
		The Service Name doesn't exit.
4.	TCP could not read mail 
		Re-run the program.
		UDP did not find the service address. Try the steps indicated above.
		The server does not support TCP/IP protocols


Using WordPad
WordPad provided by Windows is utilized to read the mail. Wordpad.exe must be in the Windows directory.

INTERCOM SOFTWARE
INTERCOM is written in C. Some Win32 programming is utilized for setting up the serial port and creating the child processes. The structure of the program is very simple which makes it easy to understand and add on. The code can be compiled using Visual C++ 5.0 (Microsoft Developer).
INTERCOM doesn't run in MS-DOS mode.  

Updated versions of INTERCOM can be downloaded from:

http://www2.netcom.com/~alexur/intersoft.html

YOUR SHARE 
INTERCOM is not freeware !
If you use it you must pay your $25 share.

SOURCE CODE
The source code is also available. 
When you order the source code for the Intercom software ($50 per copy) you receive a diskette including the following:

1. Source code for all executable files compiled with MS Visual C++ 5.0. (Microsoft Developer).
2.  Most recent version of Intercom.zip

Please e-mail or fax your order to:

alexur@ix.netcom.com
fax: 949-454-2920
