Hi,

I was pondering for a while how the session connection management
algorithm could work. The below proposal is after the KISS method. Any
comments before I start to implement it? Missing things? Stupid ideas?

cheers,
daniel


/*
 * How the session connection management works
 * ------------------------------------------
 *
 * When a session is created, a sorted list of services (service_list)
 * is added to the session. The services are filtered and stable
 * sorted according following rules:
 *
 *  - AllowedBearer (filter and sort)
 *  - RoamingPolicy (filter and sort)
 *  - Realtime (order)
 *
 * A stable sorting algorithms maintains the relative order of records
 * with equal keys. If a service is removed or added all sessions
 * service list is updated and refiltered and sorted according the
 * above rules.
 *
 * There are three triggers which lead to evalute the connect
 * algorithm:
 *
 *  - Session.Connect()
 *  - PeriodicTimer
 *  - Offline
 *
 * Connect algorithm:
 *
 *               Session.Connect()     Offline
 *               PeriodicConnect        |
 *                        | Yes  +------+-------+  No
 *                        +------+StayConnected?+------ Do nothing
 *                        |      +--------------+
 *                        |
 *                        |
 *                 +------+-------+
 *           +-----+EmergencyCall?+-----+
 *        Yes|     +--------------+     |No
 *           |                          |
 *         Connect to            +--------------+
 *         first available   +---+AvoidHandover?+---+
 *         Service           |   +--------------+   |
 *                        Yes|                      |No
 *                  +----------------+              |
 *              +---+In service_list +---+          |
 *           Yes|   |and online?     |   |No        |
 *              |   +----------------+   |          |
 *              |                        |          |
 *          Take that one                Take first in
 *                                       service_list
 *
 * There are two triggers which lead to evalut the disconnect
 * algorithm
 *
 *  - Session.Disconnect()
 *  - IdleTimeout()
 *
 * Disconnect algorithm:
 *
 *   IdleTimeout()
 *   Session.Disconnect()
 *        |
 *        |
 *        |
 * +-----------------+    Yes
 * |service not used +-------------+
 * |by other session?|             |
 * +------.----------+             |
 *        |No                      |
 *        |                        |
 *     Service.disconnect()   Do nothing
 *
 */














_______________________________________________
connman mailing list
[email protected]
http://lists.connman.net/listinfo/connman

Reply via email to