[Search for users] [Overall Top Noters] [List of all Conferences] [Download this site]

Conference rusure::math

Title:Mathematics at DEC
Moderator:RUSURE::EDP
Created:Mon Feb 03 1986
Last Modified:Fri Jun 06 1997
Last Successful Update:Fri Jun 06 1997
Number of topics:2083
Total number of notes:14613

1950.0. "Collisions" by ULYSSE::ZITTA (ENOC OPS SUPPORT-VBO ,828-5657) Wed Mar 08 1995 11:54

    
	How would you approach this problem ? 

	Suppose you have 2 telephone switches ,.

			n voice channels maximum
		A ====================================== B

	What are the odds of collision (i.e a user on site A tries to
	call somebody in site B,and somebody in site B starts to call
	somebody in site A at the same time and both switches select the
	same voice channel)
	
	What would be the best algorithms to choose on each switch to
	minimize the chance of collisions ?
	For instance, some switches can be programmed to select channel 1
	then 2,etc , or in reverse order, or go back to 1 and look for the
	next free channel ; etc.
	The algorithm can be the same or different on both side.

	Thanks,
	Gerard
	
    
T.RTitleUserPersonal
Name
DateLines
1950.1POLAR::WALSHMWed Mar 08 1995 14:4916
    These probably aren't the most efficient algorithms timewise, but you'd
    only get a collision if all lines were full.
    
    Algorithm A: x = 1
    		 repeat until connected:
    		 if channel #x if free
    		 then connect to #x
    		 else increment x (if x == n+1 then x = 1)
    		 end repeat.
    
    Algorithm B: x = n
    		 repeat until connected:
    		 if channel #x is free
    		 then connect to #x
    		 else decrement x (if x == 0 then x = n)
    		 end repeat.
1950.2precisionsULYSSE::ZITTAENOC OPS SUPPORT-VBO ,828-5657Thu Mar 09 1995 03:2911
    
    OK but maybe my question wasn't clear enough. I am looking for the
    probabilities of collisions.
    The channel selection choice is one of the variables but I think there
    are other ones like traffic,number of channels,average calls durations,
    etc. Also,I forgot to mention that the switches are part of a private
    network (e.g DTN ...) and if all the channels are busy,the traffic will 
    automatically overflow to the PSTN where we will assume that the
    probability of collisions is zero.
    
    Gerard
1950.3RTL::GILBERTFri Mar 10 1995 14:1222
.2>  OK but maybe my question wasn't clear enough. I am looking for the
.2>  probabilities of collisions.

.1>  [You] only get a collision if all lines were full.

     Actually, as given in .1, the algorithms don't detect when all lines
     are full, and the 'collision' occurs when A and simultaneously connect
     to the last (only) free channel.

     In any case, the approach is optimal.  Assuming you want to allow either
     A or B to connect to the last free channel(1), then M.Walsh's solution
     avoids a collision except when one is unavoidable.

     You could estimate the probability of a collision to be half the
     probability that exactly n (or perhaps n-1) channels are in use.
     This should be directly available from your knowledge of the traffic.

					- Gilbert

(1)  Alternatively, you could decide that when only one channel is free, only
     A may connect to it -- this drops the probability of collision to zero,
     but the channels may be underutilized if B needs that last channel.
1950.4FORTY2::PALKAMon Mar 13 1995 06:0917
    The probability of a collision must depend somehow on how long it takes
    to set up a call, and the rate at which calls are coming in.
    
    There are 2 problems with the suggestion in .3 about reserving the last
    channel for A.
    
    1) It will only work if A and B only attempt to set up one call at a
    time. If they can be attempting more calls then you need to reserve
    more channels to system A.
    
    2) Suppose that system B takes the higher numbers, and that channel 12
    is the only one free. Now, channel 3 becomes free at system B shortly
    before it becomes free at system A. In the mean time both systems
    receive a new call. Both systems will feel able to use channel 12, and
    a collision results.
    
    Andrew
1950.5ULYSSE::ZITTAENOC OPS SUPPORT-VBO ,828-5657Mon Mar 13 1995 11:2512
    
    Hmmm ..getting complicated . What about approaching the problem with 
    only one channel (and then 2 etc.)
    
    			n=1	
    	Switch A ----------------------Switch B
    
    Let's assume there are C calls per minute and the call setup time is T
    on both switches to start with. Maybe we need other parameters ?
    Any idea on how to evaluate the probability with a formula?
    
    Gerard
1950.6FORTY2::PALKATue Mar 14 1995 04:446
    re .5
    
    You also need to know the average call duration. May be the distribution
    of call durations would affect things as well.
    
    Andrew
1950.7let n = 0NETCAD::ROLKEI had THREE teapots!Tue Mar 14 1995 17:3034
Hi Gerard,

If you have

	Ts  = call setup time (during which collisions happen)
	Rc  = number of calls per time interval

then you could get the probability of a collision as:

	Ts * Rc

For example, if the call setup time is one second and you make five calls
per minute then you have

	(1 sec) * (5 / 60 sec) = 5/60 = 8.3%

Callers from side A, making 5 calls per minute will be vulnerable to 
collisions 8.3% of the time.  A random caller from side B will collide
with A's call setups at that rate.  However, it'll never be this easy.  

What if the average call lasts one  minute?  Now, in the one line case,
you will only have a chance of 1/60 of a collision since you only make one
call per minute.  Unfortunately, there will be a good chance that A and B
will both want to make another call immediately after the first call is 
over.  So you are virtually guaranteed to get a collision.

In short, you need to characterize the behavior of your system in very
fine detail before you can "write a formula" for it.

Good luck,
Chuck

If you let n=0 then all calls would go the the PSDN and your problem is
solved! ;-)