CONTENTS:

1. FILES INCLUDED IN THE TEST PROTOCOL
2. DESCRIPTION OF THE PROTOCOL
3. USE INSTRUCTIONS
    3.1. RUNNING THE PROGRAM
    3.2. LOOKING AT THE KED SPECIFICATION OF THE PROTOCOL
4. KNOWN BUGS
5. REFERENCES



------------------------------------------------------------------------------



1. FILES INCLUDED IN THE TEST PROTOCOL

Test protocol GoBackN includes the following files:


FILE		DESCRIPTION
----------------------------------------------------------
README 		this file
gbn.ked 	KED specification of the protocol
 gbn.k 		Kannel specification, generated by KED
 gbn.prj	project file, generated by KED
messages.k	definitions for message types
if_q.k		implementation of queue for iframes
if_q_it.k	implementation of iframe queue iterator
*.trc		trace files generated by KANA
gbn_00/		generated partition 0
gbn_01/		generated partition 1


2. DESCRIPTION OF THE PROTOCOL

This implementation of goback-n protocol is based on the description in 
[Hal92]. In addition to that specification we have included processes for 
connection management and user io. Flow control is handled with the sliding
window method.

The protocol has three layers. The highest layer (user) contains the user
processes which are responsible for the io with the human users. 

The intermediate layer handles the connection management. It includes
connection states for both sending and receiving.

The lowest layer (data transfer) includes the processes for sending and
receiving messages in goback-n fashion. The basic idea in this lowest layer is
that the sender is continuously sending numbered packets to the receiver and if
the receiver gets a packet with a wrong number (or otherwise corrupted packet)
the receiver asks the sender to retransmit the packets onward from the number
which the receiver expected. Both sender and receiver have timers.

- Messages between user and connection management layers:
   - user -> connection management:
      1) ConnReq (request for making a send connection)
      2) SendReq (request for sending an integer)
      3) DiscReq (request for closing the send connection)    
   - connection management -> user:
      1) ConnSendInd (indicates that a send connection is established)
      2) ConnRecInd (indicates that a receive connection is established)
      3) IncDataInd (indication about incoming integer message)
      4) DiscSendInd (send connection is closed)
      5) DiscRecInd (receive connection is closed)
      6) SendLostInd (sender is not reponding)
      7) RecLostInd (receiver is not responding)

- Messages between connection management and data transfer layers:
   - connection manager -> data transfer:
       1) SendFrameReq
   - data transfer -> connection manager
       1) ConnConf (from sender process: receiver has accepted connection)
       2) DiscConf (from sender process: receiver has accepted disconnection)
       3) RecLost (from sender process: receiver is not responding)
       4) SendLost (from receiver process: sender is not responding)
       5) DataInd (from receiver process: indication of incoming message)
       6) ConnInd (from receiver process: indication of connect request)
       7) DiscInd (from receiver process: indication of disconnet request)

- Messages in the lowest level between sender and receiver processes:
   - sender -> receiver:
       1) IFrame(n) (numbered data packet)
   - receiver -> sender:
       1) Ack(n) (numbered acknowledgement)
       2) Nak(n) (numbered negative acknowledgement = go back n) 



3. USE INSTRUCTIONS

3.1. RUNNING THE PROGRAM

***** NOTE: the example can also be compiled and run via the KED tool *****

Start the distributed components with commands

	gbn_00/gbn_00 source-port host target-port
	gbn_01/gbn_01 source-port host target-port

where 'source-port' and 'target-port' are the port numbers for connection
and 'host' is the target host name. For example, on a single machine 'alpha'
the following would work:

	gbn_00/gbn_00 12001 alpha 12002
	gbn_01/gbn_01 12002 alpha 12001

When the components start you will able to make a send connection
with your parner. This is done by entering integer 1 to the 'action' prompt.
After that you must wait for connection acceptance from your opponent. You 
can enter number 0 (=do nothing) to the prompt while waiting. The opponent
has no way of refusing from connection, so message 'Send connection
established' will soon appear to you. The opponent will get a notification
'Receive connection established'.

Now you are able to send integer values 3-10 to your partner, just enter an 
integer to the action prompt. The opponent will get a message saying 'Received
integer x'. Disconnecting is done with command 2 (=disconnect). The whole 
program can be killed with control-c.

The program will also display information about the messages that are sent 
between the protocol layers. These internal messages will have '--' as 
their prefix. The information about a message is always printed in a statement
just before sending the message.

To demostrate the full behaviour of the protocol, the sender process randomly
sends IFrames with a wrong frame number (i.e. -1). This illustrates the 
corrupting of frames. Disappearance of frames is demostrated by the receiver 
process: it randomly "forgets" to send acknoledgements about the received 
iframes. When this happens, receiver gives a warning 'OOPS, forgot to send 
Ack' to the user.


3.2. LOOKING AT THE KED SPECIFICATION OF THE PROTOCOL

Start KED tool by entering command 'ked gbn.ked' at the directory where file 
gbn.ked exists. The specification of goback-n protocol will be loaded into
a window named 'View 0'.

Choose 'Zoom' tool from the left side of 'Edit tree' window. With this tool 
you can set focus on different items in the specification. For example if 
you want to see the statemachine for connection management more closely, just
click the left mouse button on top of ConnectionManager process. You can zoom
out by clicking an area outside of the process.

After you have focused into a process, you can look at the kannel code 
written to the state transitions by moving the mouse cursor on top of a 
transition. If you want to edit the code then press the right mouse button on
top of a transition and choose command 'Edit' from appearing menu.


4. KNOWN BUGS

Since the transfer syntax feature of Kannel is not yet implemented,
communication between machines that have different archtitecture (e.g.
a Linux host and a Sun host) doesn't work properly. 


5. REFERENCES

[Hal92]  Halsall F., Data Communications, Computer Networks and Open Systems,
         Addison-Wesley, 1992.
