=============================================================================================
The Intercom programs are Copyright (C) 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 and Intercom Software 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 the basics of Internet communications but have no previous knowledge of Internet software and protocols. INTERCOM uses PPP and TCP/IP to connect to an Internet server and runs a simple application (receiving 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. The trade off is that not all network types are covered but in exchange, one can see the entire process of Internet communications. INTERCOM does not require any DLL's and does not change your computer settings.
These programs can be useful for people who design software for embedded systems which require 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 in addition, it shows you how to:
	Use Win32 programming to setup your modem and serial port
	Use Win32 programming to write a simple WINSOCK application

	


INTERCOM  FILES 

ppp.exe		configures the serial port and the modem, makes the connection to the ISP			(Internet Service Provider) and implements the PPP protocol.
udp.exe		performs a DNS search for a specified server using UDP.
tcp.exe		a manual communication with a server using the keyboard to send 			and receive TCP/IP packets.
pop3.exe		POP3 protocol implementation, reads e-mail.
Set_up.txt		contains data necessary to connect to the ISP.
ppp.txt		stores the communication packets, headers and events during PPP.
udp.txt		stores the communication packets, headers and events during DNS. 
tcp.txt		stores the communication packets, headers and events during TCP. 
mail.txt		stores e-mail.
modem.txt		contains modem initializing strings.
wincom.exe		a simple WINSOCK application.
setupwsk.txt 	setup file for wincom.exe.
	

INSTALLING INTERCOM 

1.	Create a directory called INTERCOM
2.	Copy all the files from the INTERCOM diskette into this directory.

 

CONNECTING TO THE INTERNET 

Note: you can run INTERCOM 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.

To connect to an ISP 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 (application) 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.

To set-up the COM port and phone number:
1.	Using Notepad, open Set_up.txt and enter the COM port number available to your computer. 	This should be the serial port were your modem is connected. If you don't know what 	serial port is used by your modem, click on Start/Control Panel/Modem/Properties.
2.	If you use the phone number shown in the Set_up.txt, 365-2500 and your area code is 714 	don't include the area code in the phone number. To keep the phone expenses low it is 	better to find a local number for the ISP.

Changing the modem initializing strings:
The file modem.txt contains typical Hayes "at" commands used by the majority of modems. If these don't work with your modem you should enter your specific commands. 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:
1.	Type  "no"  on the line "Manual Login" in the Set_up.txt file.
2.	Run ppp.exe.
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, starts PPP. 	
	Otherwise,
		Waits for the server greeting and sends the username.
		Waits for "Password" and sends the password.
		Receive the first PPP packet from the server.
		Run PPP.

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 ppp.exe.
3.	Enter from the keyboard "atdt" followed by the phone number.
4.	Wait for the ISP greeting, type your username and hit Return.
5.	Wait for the "Password", type your password and hit Return.
6.	When you see lines of characters on the screen (PPP packets) hit the Esc key.



RUNNING A DNS SEARCH 

1.	Select UDP (option 1) from the menu displayed at the end of the PPP transaction.
2.	A new window will be created which displays the UDP-IP headers and data.
3.	The search looks for addresses and aliases of the hosts specified in the Set_up.txt under 	Server Name and Service Name.



RUNNING A TCP SESSION 

1.	Select TCP (option 2) from the menu displayed at the end of the PPP transaction.
2.	A new window will be created which displays the TCP/IP headers and data.
3.	The first connection step which involves sending a SYN packet, receiving an ACK SYN and c	checking for errors is done automatically.
4.	After this, you can enter data from the keyboard and receive TCP packets from the ISP.



The following commands can be typed from the keyboard:
	"SYN"				sends a SYN packet
	"ACK" or Return		sends an ACK packet
	"FIN"				sends a ACK FIN packet
	"RST"				sends a RST packet
	"R"				receive a packet
	"EXIT"			returns to the PPP window (without closing the TCP connection)
	Any other key		sends an ACK PSH packet including the data that you typed.

After each command, TCP returns whatever message is received from the ISP and checks for errors. If the connection is made with the POP3 server and POP commands are typed, TCP also checks for POP errors.

Example of a TCP session to the POP server:
Make sure the name of your POP server is listed in the Set_up.txt under the Service Name and TCP port 110 is selected.
1.	Make a connection to your ISP and select TCP at the end of the PPP transaction.
2.	After receiving the correct SYN ACK packet press Return to send an acknowledge (ACK) 	packet.
3.	After receiving the POP greeting message type "user "username.
4.	After receiving the POP message type "pass "password. 
5.	After receiving the POP message type "list". 
6.	The return message will show the number of messages you have.
7.	Type "retr "number of message to retrieve.
8.	When you want to exit type "quit".
9.	After receiving the response type "R" to receive the server's ACK FIN packet.
10.	Type "FIN" to send your ACK FIN packet and wait for response.
11.	Type "EXIT" to return to the PPP window.

You can open multiple TCP windows to simultaneously communicate with different ports of your server. 



READING E-MAIL

Make sure the name of your POP server is listed in the Set_up.txt under the Service Name and TCP port 110 is selected.
1.	Make a connection to your ISP and select pop3 at the end of the PPP 	transaction. 
2.	A new window will be created which displays the TCP/IP headers and POP data.
3.	Pop3.exe will read all the mail from your POP server and return to the PPP window.
4.	Mail is stored in mail.txt file. You can use WordPad (preferred) or Notepad to read the 	mail.txt file. 







OTHER THINGS YOU CAN DO
	
Using the TCP program you can implement other Internet protocols which can accept data entered from the keyboard. One of the protocols which can be easily implemented is SMTP (Simple Mail Transfer Protocol) which utilizes TCP port 25. 


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 (Microsoft Developer). INTERCOM doesn't run in MS-DOS mode.  




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 UDP. Some times 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 TCP.
		UDP did not find the service address. Try the steps indicated above.
		The server does not support TCP/IP protocols.




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



					

SHIPMENT

When you order the source code for the Intercom software we send you a diskette including the following:

1.	Source code for all executable files compiled with MS Visual C (Microsoft Developer).
2.	Full description of the protocol implementation and Internet communication processes.
3.	Copies of RFC's utilized.
4.	References.


To receive your copy(s) please fill in the Registration form, on the next page. 























































			
				Registration	Form


Company:_______________________________________________________________

Mailing address:_______________________________________________________

                _______________________________________________________

                _______________________________________________________

Contact name:__________________________________________________________

e-mail:___________________________

fax:______________________________

Number of copies to register:_________         Total Price:_________ 
(US$25 per copy)

Ship (check number of):  ___ diskette(s)


Date:________________


======================================================================
Intercom Software, Inc.
27402 Via Caudaloso
Mission Viejo, CA 92691
alexur@ix.netcom.com
fax: 714-454-2920
