Skip to contentSkip to conversation

GPRS support for Ofono

PATCH Ismo Puustinen 7 participants 42 messages Sep 1, 2009 – Sep 2, 2009 Kbuild

lore
Share & tools
lore
#0 lore raw

Hello List,

I started working on Ofono GPRS support.

The patch set contains:

1) Documentation describing how an Ofono GPRS D-Bus API would look like.
2) Common Ofono GPRS support.
3) Ofono GPRS ISI driver.
4) Test script for trying out the GPRS functionality.

Note that the GPRS support is in no way completed -- many things are still TODO or have rough edges. However, I thought that it would be a good idea to send the patches to the mailing list to gather comments and improvement suggestions before finalizing the work.

PS. A disclaimer: I'm a Nokia engineer, even though I'm sending this email from my personal email account (due to incompatibilities with Nokia email servers). If you need to contact me off-the-list, please use the email address ismo.h.puustinen(a)nokia.com .

Signature · 1 line
Ismo Puustinen <[email protected]>

From 77d342e3404f5ba7374505f5a65191fa200f52cc Mon Sep 17 00:00:00 2001
From: Ismo Puustinen <[email protected]>
Date: Mon, 31 Aug 2009 13:40:22 +0300
Subject: [PATCH] GPRS API documentation

---
 doc/gprs-api.txt        |   69 +++++++++++++++++++++++++++++++++++++++++++
 doc/gprsmanager-api.txt |   74 +++++++++++++++++++++++++++++++++++++++++++++++
 2 files changed, 143 insertions(+), 0 deletions(-)
 create mode 100644 doc/gprs-api.txt
 create mode 100644 doc/gprsmanager-api.txt
doc/gprs-api.txt new file +69 -0
new file mode 100644
index 0000000..15daaae
@@ -0,0 +1,69 @@
+GPRS context hierarchy
+======================
+
+Service     org.ofono
+Interface   org.ofono.GprsContext
+Object path [variable prefix]/{modem0,modem1,...}/{context0,context1,...}
+
+Methods     dict GetProperties()
+
+            Returns all global system properties. See the
+            properties section for available properties.
+
+Signals     PropertyChanged(string property, variant value)
+
+            Signal is emitted whenever a property has changed.
+            The new value is passed as the signal argument.
+
+        ConnectionStatistics(dict statistics)
+
+            Signal is emitted whenever a connection has ended. The
+            signal argument contains a dict with the connection
+            statistics (connection time, transferred bytes).
+
+Properties  string State [readonly]
+
+            Contains the state of the current GPRS context. The state
+            can be one of:
+                - "connecting" - The context is being connected
+                - "connected" - The context is connected
+                - "disconnected" - The context is disconnected, further
+                    use forbidden, since the context will be destroyed
+                    shortly.
+
+        string Type [readonly]
+
+            Contains the connection type ("IPv4" or "IPv6").
+
+        string Address [readonly]
+
+            Contains the IPv4 or IPv6 address of the connection.
+
+        string PrimaryDNSAddress [readonly]
+
+            Contains the primary DNS address returned by the network.
+
+        string SecondaryDNSAddress [readonly]
+
+            Contains the secondary DNS address returned by the network.
+
+        string Interface [readonly]
+
+            Contains the network interface name for the GPRS connection.
+
+        uint32 TransmittedBytes [readonly]
+
+            Contains the amount of bytes transmitted with this GPRS
+            context. This property is not sent with the PropertyChanged
+            signal.
+
+        uint32 ReceivedBytes [readonly]
+
+            Contains the amount of bytes transmitted with this GPRS
+            context. This property is not sent with the PropertyChanged
+            signal.
+
+        uint32 ConnectionTime [readonly]
+
+            Contains the duration of the connection in seconds. This
+            property is not sent with the PropertyChanged signal.
doc/gprsmanager-api.txt new file +74 -0

74 lines not on this page · raw message

Signature · 1 line
1.6.0.4

From a5239566e9283657326177fd87fc11b127f73328 Mon Sep 17 00:00:00 2001
From: Ismo Puustinen <[email protected]>
Date: Tue, 1 Sep 2009 12:05:21 +0300
Subject: [PATCH] GPRS Atom

---
 Makefile.am    |    5 +-
 include/gprs.h |  151 ++++++++++
 src/gprs.c     |  854 ++++++++++++++++++++++++++++++++++++++++++++++++++++++++
 src/ofono.h    |    1 +
 4 files changed, 1009 insertions(+), 2 deletions(-)
 create mode 100644 include/gprs.h
 create mode 100644 src/gprs.c
Makefile.am +3 -2
index 7ee6536..8b53e78 100644
@@ -9,7 +9,8 @@ include_HEADERS = include/log.h include/plugin.h include/history.h \
 			include/call-meter.h include/call-settings.h \
 			include/phonebook.h include/ssn.h include/ussd.h \
 			include/sms.h include/sim.h include/message-waiting.h \
-			include/netreg.h include/voicecall.h include/devinfo.h
+			include/netreg.h include/voicecall.h include/devinfo.h \
+			include/gprs.h
 
 nodist_include_HEADERS = include/version.h
 
@@ -94,7 +95,7 @@ src_ofonod_SOURCES = $(gdbus_sources) $(builtin_sources) \
 			src/call-meter.c src/smsutil.h src/smsutil.c \
 			src/ssn.c src/call-barring.c src/sim.c \
 			src/phonebook.c src/history.c src/message-waiting.c \
-			src/simutil.h src/simutil.c
+			src/simutil.h src/simutil.c src/gprs.c
 
 src_ofonod_LDADD = $(builtin_libadd) \
 			@GLIB_LIBS@ @GTHREAD_LIBS@ @DBUS_LIBS@ -ldl
include/gprs.h new file +151 -0

151 lines not on this page · raw message

src/gprs.c new file +854 -0

854 lines not on this page · raw message

src/ofono.h +1 -0
index bf31531..5eda013 100644
@@ -82,6 +82,7 @@ enum ofono_atom_type {
 	OFONO_ATOM_TYPE_HISTORY = 11,
 	OFONO_ATOM_TYPE_SSN = 12,
 	OFONO_ATOM_TYPE_MESSAGE_WAITING = 13,
+	OFONO_ATOM_TYPE_GPRS = 14,
 };
 
 enum ofono_atom_watch_condition {
Signature · 1 line
1.6.0.4

From 38760be738440f047b28f0d274d15a0990e3c6e4 Mon Sep 17 00:00:00 2001
From: Ismo Puustinen <[email protected]>
Date: Mon, 31 Aug 2009 13:49:07 +0300
Subject: [PATCH] GPRS ISI modem driver

---
 Makefile.am                 |    1 +
 drivers/isimodem/gprs.c     | 1759 +++++++++++++++++++++++++++++++++++++++++++
 drivers/isimodem/isi.h      |    4 +
 drivers/isimodem/isimodem.c |    4 +
 4 files changed, 1768 insertions(+), 0 deletions(-)
 create mode 100644 drivers/isimodem/gprs.c
Makefile.am +1 -0
index 8b53e78..a5d8c32 100644
@@ -52,6 +52,7 @@ builtin_sources += $(gisi_sources) drivers/isimodem/isi.h \
 				drivers/isimodem/sim.c \
 				drivers/isimodem/ssn.c \
 				drivers/isimodem/ussd.c \
+				drivers/isimodem/gprs.c \
 				drivers/isimodem/call-forwarding.c \
 				drivers/isimodem/call-settings.c \
 				drivers/isimodem/call-barring.c \
drivers/isimodem/gprs.c new file +1759 -0

1,759 lines not on this page · raw message

drivers/isimodem/isi.h +4 -0
index 89ed534..bb73f12 100644
@@ -105,3 +105,7 @@ extern void isi_call_barring_exit();
 
 extern void isi_call_meter_init();
 extern void isi_call_meter_exit();
+
+extern void isi_gprs_init();
+extern void isi_gprs_exit();
+
drivers/isimodem/isimodem.c +4 -0
index 3f3d179..8d032be 100644
@@ -49,6 +49,7 @@
 #include <ofono/call-settings.h>
 #include <ofono/call-barring.h>
 #include <ofono/call-meter.h>
+#include <ofono/gprs.h>
 
 #include "isi.h"
 
@@ -161,6 +162,7 @@ static int isi_modem_populate(struct ofono_modem *modem)
 	ofono_call_settings_create(isi->modem, "isi", isi->idx);
 	ofono_call_barring_create(isi->modem, "isi", isi->idx);
 	ofono_call_meter_create(isi->modem, "isi", isi->idx);
+	ofono_gprs_create(isi->modem, "isi", isi->idx);
 
 	return 0;
 }
@@ -190,6 +192,7 @@ static int isimodem_init(void)
 	isi_call_settings_init();
 	isi_call_barring_init();
 	isi_call_meter_init();
+	isi_gprs_init();
 
 	ofono_modem_driver_register(&driver);
 
@@ -229,6 +232,7 @@ static void isimodem_exit(void)
 	isi_call_settings_exit();
 	isi_call_barring_exit();
 	isi_call_meter_exit();
+	isi_gprs_exit();
 }
 
 OFONO_PLUGIN_DEFINE(isimodem, "PhoNet / ISI modem driver", VERSION,
Signature · 1 line
1.6.0.4

From fedc35d4e10d063351ce23025c72742d5f095a55 Mon Sep 17 00:00:00 2001
From: Ismo Puustinen <[email protected]>
Date: Mon, 31 Aug 2009 14:35:07 +0300
Subject: [PATCH] Basic tests for GPRS D-Bus API

---
 test/test-gprs |   39 +++++++++++++++++++++++++++++++++++++++
 1 files changed, 39 insertions(+), 0 deletions(-)
 create mode 100755 test/test-gprs
test/test-gprs new file +39 -0
new file mode 100755
index 0000000..0e48f3c
@@ -0,0 +1,39 @@
+#!/usr/bin/python
+
+import gobject
+
+import dbus
+
+if __name__ == "__main__":
+
+	bus = dbus.SystemBus()
+
+	manager = dbus.Interface(bus.get_object('org.ofono', '/'),
+							'org.ofono.Manager')
+
+	try:
+		modems = manager.GetProperties()['Modems']
+	except dbus.DBusException, e:
+		print "Unable to get the Modems property %s" % e
+
+	manager = dbus.Interface(bus.get_object('org.ofono', modems[0]),
+				'org.ofono.GprsManager')
+
+	# TODO: get manager properties
+
+	manager.Attach()
+
+	variants = dbus.Dictionary(signature='sv')
+
[… more lines in the raw message]

Lines of this file are not shown. View the raw message.

The rest of this diff is not shown. View the raw message.

Signature · 1 line
1.6.0.4

Part of the diff is not shown here. View the raw message.

#1 lore raw
Quoted 1 line · Ismo Puustinen

I started working on Ofono GPRS support.

Hello,

With GPRS support, Ofono become very interesting!

I failed to understand how the "isi_gprs" code in your patch communicate with a PPP stack. For example, I currently use a project where the APN is configured and a connection open with it. Then a pppd process is started to establish the IP link. It seem that you make this in a other (and certainly better) way, but I missed the big picture.

Best Regards,

Jean-Christian de Rivaz

#2 lore raw

Le mardi 1 septembre 2009 22:02:43 Jean-Christian de Rivaz, vous avez écrit :

Quoted 4 lines

With GPRS support, Ofono become very interesting!

I failed to understand how the "isi_gprs" code in your patch communicate with a PPP stack.

That would be because it does NOT use a PPP stack.

ISI modems have their own IP path using a dedicated kernel driver (net/phonet/pep-gprs.c in Linux 2.6.28 amd later). There is no point in using the PPP line discipline.

Signature · 2 lines
Rémi Denis-Courmont
http://www.remlab.net/
#3 lore raw
Quoted 11 lines · Rémi Denis-Courmont

Le mardi 1 septembre 2009 22:02:43 Jean-Christian de Rivaz, vous avez écrit :

Quoted 4 lines

With GPRS support, Ofono become very interesting!

I failed to understand how the "isi_gprs" code in your patch communicate with a PPP stack.

That would be because it does NOT use a PPP stack.

ISI modems have their own IP path using a dedicated kernel driver (net/phonet/pep-gprs.c in Linux 2.6.28 amd later). There is no point in using the PPP line discipline.

Thanks for the explanation. I will start learning how phonet works. But I expect there exists a PPP stack somewhere in phonet because the modem I use don't have one. And I don't think it's possible to have a IP link over GPRS without the PPP protocol between them.

Jean-Christian de Rivaz

#4 lore raw

Le mardi 1 septembre 2009 23:17:36 Jean-Christian de Rivaz, vous avez écrit :

Quoted 3 lines

Thanks for the explanation. I will start learning how phonet works. But I expect there exists a PPP stack somewhere in phonet because the modem I use don't have one.

ISI modems have a PPP "server-side" implementation to handle USB CDC ACM and BlueTooth DUN. But there is only one instance per modem, so we reserve it for the dumb Windows PC that we may be connected to ;)

Quoted 2 lines

And I don't think it's possible to have a IP link
over GPRS without the PPP protocol between them.

It might be possible in the standard, but I have not found any network offering such a PP over GPRS data service.

Signature · 2 lines
Rémi Denis-Courmont
http://www.remlab.net/
#5 lore raw
In reply to Jean-Christian de Rivaz
Quoted 4 lines · Jean-Christian de Rivaz

Thanks for the explanation. I will start learning how phonet works. But I expect there exists a PPP stack somewhere in phonet because the modem I use don't have one. And I don't think it's possible to have a IP link over GPRS without the PPP protocol between them.

On most modern modems there is no need to have a PPP link between the Application Processor (AP) and the modem. They will often be able to transmit IP traffic directly to the AP.

Hence there is no PPP stack in phonet. If your modem does not support raw IP messaging (or any other datagram service) to the AP you will probably be stuck with good old PPP.

#6 lore raw
In reply to Jean-Christian de Rivaz
Quoted 6 lines · Jean-Christian de Rivaz

I failed to understand how the "isi_gprs" code in your patch communicate with a PPP stack. For example, I currently use a project where the APN is configured and a connection open with it. Then a pppd process is started to establish the IP link. It seem that you make this in a other (and certainly
better) way, but I missed the big picture.

The best way to do this is without PPP and this is probably what Ismo is doing. You would just create a new net_device like "eth0" and hide all the ISI and cellular messaging behind that interface providing a clean IP network device.

Best regards,
Mikkel Christensen

#7 lore raw
In reply to Ismo Puustinen

Everyone,

So as it happens I had also been brainstorming a GPRS API for the last several days. And somewhat spontaneously a GPRS api discussion happened on IRC between myself, Marcel and Ismo. The following GPRS API proposal is a result of this discussion. I'd like all interested to comment. What needs improvement? What is missing? What should be removed?

Please note that Secondary PDP contexts, Traffic Filters and Network Activated (Incoming) PDP contexts are not covered in this proposal. These features are not commonly used and none of us have real experience with them yet. However, we considered these features and have left room in the APIs for further expansion.

Data Connection Manager hierarchy
=================

Service org.ofono
Interface org.ofono.DataConnectionManager
Object path [variable]

Methods dict GetProperties()

Returns all global system properties. See the properties section for available properties.

Possible Errors: [service].Error.InvalidArguments

void SetProperty(string property, variant value)

Sets the property to a desired value

Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidFormat [service].Error.Failed

void DeactivateAll()

Deactivates all active contexts.

object CreateContext()

Creates a new Primary context. Returns the object path of the created context.

object RemoveContext()

Removes a primary context. All secondary contexts, if any, associated with the primary context are also removed.

Signals PropertyChanged(string property, variant value)

This signal indicates a changed value of the given property.

Properties array{object} PrimaryContexts [readonly]

List of all primary contexts objects.

boolean Attached [readonly]

Contains whether the Packet Radio Service is attached. The attach state might change dynamically based on availability of network resources. If this value changes to false, the user can assume that all contexts have been deactivated.

If the modem is detached, certain features will not be available, e.g. receiving SMS over packet radio or network initiated PDP activation.

boolean RoamingAllowed [readwrite]

Contains whether data roaming is allowed. In the off setting, if the packet radio registration state indicates that the modem is roaming, oFono will automatically detach and no further connection establishment will be possible.

boolean Powered [readwrite]

Controls whether packet radio use is allowed. Setting this value to off detaches the modem from the Packet Domain network.

string Status [readonly]

The current packet radio registration status of a modem.

The possible values are:
"unregistered" Not registered to any network
"registered" Registered to home network
"searching" Not registered, but searching
"denied" Registration has been denied
"unknown" Status is unknown
"roaming" Registered, but roaming

uint16 LocationAreaCode [readonly, optional]

Contains the current location area code.

uint32 CellId [readonly, optional]

Contains the current network cell id.

string Technology [readonly, optional]

Contains the technology of the current network.

The possible values are: "GSM", "GSMCompact", "UTRAN",
"GSM+EGPS", "UTRAN+HSDPA", "UTRAN+HSUPA", "UTRAN+HSDPA+HSUPA", "E-UTRAN"

Primary Data Context hierarchy
=================

Service org.ofono
Interface org.ofono.PrimaryDataContext
Object path [variable]

Methods dict GetProperties()
Returns all properties for the context object.

Possible Errors: [service].Error.InvalidArguments

void SetProperty(string property, variant value)

Sets the property to a desired value

Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidFormat [service].Error.Failed

Signals PropertyChanged(string property, variant value)

This signal indicates a changed value of the given property.

Properties boolean Activated [readwrite]

Holds whether the context is activated. This value can be set to activate / deactivate the context.

string AccessPointName [readwrite]

Holds the name of the access point. This is abbreviated as APN. This value cannot be changed when the context is active.

string Username [readwrite]

Holds the username to be used for authentication purposes. This value cannot be changed when the context is active.

string Password [readwrite]

Holds the password to be used for authentication purposes. This value cannot be changed when the context is active.

string Interface [readonly, optional]

Holds the interface of the network interface created by this context (e.g. "ppp0")

array{string} DomainNameServers [readonly, optional]

Holds the list of domain name servers for this context.

Regards,
-Denis

#8 lore raw

Hi Denis,

Quoted 12 lines

So as it happens I had also been brainstorming a GPRS API for the last several days. And somewhat spontaneously a GPRS api discussion happened on IRC between myself, Marcel and Ismo. The following GPRS API proposal is a result of this discussion. I'd like all interested to comment. What needs improvement? What is missing? What should be removed?

Please note that Secondary PDP contexts, Traffic Filters and Network Activated (Incoming) PDP contexts are not covered in this proposal. These features are not commonly used and none of us have real experience with them yet. However, we considered these features and have left room in the APIs for further expansion.

Quoted 5 lines

Data Connection Manager hierarchy
=================

Service org.ofono
Interface org.ofono.DataConnectionManager

I think this should be GPRSManager or something to clearly separate between GRPS connections and actual data connection,

Quoted 23 lines

Object path [variable]

Methods dict GetProperties()

Returns all global system properties. See the properties section for available properties.

Possible Errors: [service].Error.InvalidArguments

void SetProperty(string property, variant value)

Sets the property to a desired value

Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidFormat [service].Error.Failed

void DeactivateAll()

Deactivates all active contexts.

object CreateContext()

Quoted 8 lines

Creates a new Primary context. Returns the object path of the created context.

object RemoveContext()

Removes a primary context. All secondary contexts, if any, associated with the primary context are also removed.

I assume this is void RemoveContext(object context)

Quoted 8 lines

Signals PropertyChanged(string property, variant value)

This signal indicates a changed value of the given property.

Properties array{object} PrimaryContexts [readonly]

List of all primary contexts objects.

Calling this just Contexts seems to more reasonable. See comment about interface name below.

Quoted 56 lines

boolean Attached [readonly]

Contains whether the Packet Radio Service is attached. The attach state might change dynamically based on availability of network resources. If this value changes to false, the user can assume that all contexts have been deactivated.

If the modem is detached, certain features will not be available, e.g. receiving SMS over packet radio or network initiated PDP activation.

boolean RoamingAllowed [readwrite]

Contains whether data roaming is allowed. In the off setting, if the packet radio registration state indicates that the modem is roaming, oFono will automatically detach and no further connection establishment will be possible.

boolean Powered [readwrite]

Controls whether packet radio use is allowed. Setting this value to off detaches the modem from the Packet Domain network.

string Status [readonly]

The current packet radio registration status of a modem.

The possible values are:
"unregistered" Not registered to any network
"registered" Registered to home network
"searching" Not registered, but searching
"denied" Registration has been denied
"unknown" Status is unknown
"roaming" Registered, but roaming

uint16 LocationAreaCode [readonly, optional]

Contains the current location area code.

uint32 CellId [readonly, optional]

Contains the current network cell id.

string Technology [readonly, optional]

Contains the technology of the current network.

The possible values are: "GSM", "GSMCompact", "UTRAN",
"GSM+EGPS", "UTRAN+HSDPA", "UTRAN+HSUPA", "UTRAN+HSDPA+HSUPA", "E-UTRAN"

Quoted 5 lines

Primary Data Context hierarchy
=================

Service org.ofono
Interface org.ofono.PrimaryDataContext

I would prefer if we just call this GRPSContext and explain that this is for the primary context. The confusion between primary context and secondary context is some GSM specific non-sense.

Quoted 39 lines

Object path [variable]

Methods dict GetProperties()
Returns all properties for the context object.

Possible Errors: [service].Error.InvalidArguments

void SetProperty(string property, variant value)

Sets the property to a desired value

Possible Errors: [service].Error.InvalidArguments
[service].Error.InvalidFormat [service].Error.Failed

Signals PropertyChanged(string property, variant value)

This signal indicates a changed value of the given property.

Properties boolean Activated [readwrite]

Holds whether the context is activated. This value can be set to activate / deactivate the context.

string AccessPointName [readwrite]

Holds the name of the access point. This is abbreviated as APN. This value cannot be changed when the context is active.

string Username [readwrite]

Holds the username to be used for authentication purposes. This value cannot be changed when the context is active.

string Password [readwrite]

Quoted 8 lines

Holds the password to be used for authentication purposes. This value cannot be changed when the context is active.

string Interface [readonly, optional]

Holds the interface of the network interface created by this context (e.g. "ppp0")

Our current assumption is that the basic setup of IP address, netmask and broadcast are done by oFono. Only routing and DNS are up to other programs like ConnMan for example.

Quoted 4 lines

array{string} DomainNameServers [readonly, optional]

Holds the list of domain name servers for this context.

What about the gateway value. In theory we can just route it to the interface, but if the device fakes a real Ethernet interface and the gateway is in a different subnet we need a proper host route first.

Regards

Marcel

#9 lore raw

Hi Marcel,

Quoted 5 lines
Quoted 2 lines

Service org.ofono
Interface org.ofono.DataConnectionManager

I think this should be GPRSManager or something to clearly separate between GRPS connections and actual data connection,

Two reasons for this:
- Purpose of DataConnectionManager is easier to understand for people new to
GSM. Whereas GPRSManager really doesn't tell them anything. Everywhere else we tend to use more easily understood terminology than what is used in the specifications.

- GPRS is not easily Carmel-cased. E.g. we'd have to name it GprsManager.

Quoted 7 lines
Quoted 5 lines

object RemoveContext()

Removes a primary context. All secondary contexts, if any, associated with the primary context are also removed.

I assume this is void RemoveContext(object context)

You're absolutely correct.

Quoted 6 lines
Quoted 3 lines

Properties array{object} PrimaryContexts [readonly]

List of all primary contexts objects.

Calling this just Contexts seems to more reasonable. See comment about interface name below.

That sounds fine to me.

Quoted 9 lines
Quoted 5 lines

Primary Data Context hierarchy
=================

Service org.ofono
Interface org.ofono.PrimaryDataContext

I would prefer if we just call this GRPSContext and explain that this is for the primary context. The confusion between primary context and secondary context is some GSM specific non-sense.

Should we just simply name this 'Context' and name the secondary pdp context 'SubContext'?

Quoted 8 lines
Quoted 4 lines

array{string} DomainNameServers [readonly, optional]

Holds the list of domain name servers for this context.

What about the gateway value. In theory we can just route it to the interface, but if the device fakes a real Ethernet interface and the gateway is in a different subnet we need a proper host route first.

Yes, this one needs to be added. Good catch.

Regards,
-Denis

#10 lore raw
In reply to Marcel Holtmann
Quoted 3 lines · Marcel Holtmann

Our current assumption is that the basic setup of IP address, netmask and broadcast are done by oFono. Only routing and DNS are up to other programs like ConnMan for example.

WHAAAAAAAAAAT? No way. There is just no way.

We need to support letting the calling program configure the routing parameters manually. For instance, if we want to connect to multiple primary access points, it simply won't work if Ofono configures everything. Instead, we need to either setup source routing or separate network name-spaces. Ofono does not know what the caller intends to do with the APN (and should not need to), so it cannot configure IP parameters. Besides, it makes very little if any sense to configure IP parameters but not DNS.

Signature · 1 line
Rémi Denis-Courmont
#11 lore raw

Hi Remi,

Quoted 6 lines
Quoted 3 lines

Our current assumption is that the basic setup of IP address, netmask and broadcast are done by oFono. Only routing and DNS are up to other programs like ConnMan for example.

WHAAAAAAAAAAT? No way. There is just no way.

Quoted 7 lines

We need to support letting the calling program configure the routing parameters manually. For instance, if we want to connect to multiple primary access points, it simply won't work if Ofono configures everything. Instead, we need to either setup source routing or separate network name-spaces. Ofono does not know what the caller intends to do with the APN (and should not need to), so it cannot configure IP parameters. Besides, it makes very little if any sense to configure IP parameters but not DNS.

personally I don't care who finally sets the IP for the interface. It really just makes no difference. What problem do you see if oFono would set the IP address on that newly created interface that is up and running now?

My point is that gateway and DNS is out of the question for oFono.

Regards

Marcel

#12 lore raw
Quoted 15 lines · Marcel Holtmann

Hi Remi,

Quoted 9 lines
Quoted 3 lines

Our current assumption is that the basic setup of IP address, netmask and broadcast are done by oFono. Only routing and DNS are up to other programs like ConnMan for example.

WHAAAAAAAAAAT? No way. There is just no way.

We need to support letting the calling program configure the routing parameters manually. For instance, if we want to connect to multiple primary access points, it simply won't work if Ofono configures

everything.

Quoted 2 lines

Instead, we need to either setup source routing or separate network name-spaces. Ofono does not know what the caller intends to do with the

APN

Quoted 8 lines
Quoted 1 line

(and should not need to), so it cannot configure IP parameters. Besides,

it

Quoted 1 line

makes very little if any sense to configure IP parameters but not DNS.

personally I don't care who finally sets the IP for the interface. It really just makes no difference. What problem do you see if oFono would set the IP address on that newly created interface that is up and running now?

Then the application cannot influence the way it's done. That's the whole point. Maybe I want to migrate the interface in a new namespace. For that, it must (1) create the interface, (2) migrate it, (3) configure it, in that order. So Ofono cannot do (3) if it cannot do (2), and it certainly should not do (2) by itself. So it has to stick to (1).

Signature · 1 line
Rémi Denis-Courmont
#13 lore raw

2009/9/2 Rémi Denis-Courmont <[email protected]>:

Quoted 10 lines
Quoted 4 lines

personally I don't care who finally sets the IP for the interface. It really just makes no difference. What problem do you see if oFono would set the IP address on that newly created interface that is up and running now?

Then the application cannot influence the way it's done. That's the whole point. Maybe I want to migrate the interface in a new namespace. For that, it must (1) create the interface, (2) migrate it, (3) configure it, in that order. So Ofono cannot do (3) if it cannot do (2), and it certainly should not do (2) by itself. So it has to stick to (1).

And this generally applies to services that operators have decided to run behind a dedicated APN, such as WAP, MMS, Push over Cellular (PoC) and others. For example, Elisa in Finland seems to be running their MMSC behind an "mms" APN, with public IP address space, but firewalled from the rest of the Internet. oFono should isolate such an access from the rest of the system, since only the MMS client would know how to work with it properly.

Cheers,
Aki

#14 lore raw

Hi Aki,

Quoted 11 lines
Quoted 10 lines
Quoted 4 lines

personally I don't care who finally sets the IP for the interface. It really just makes no difference. What problem do you see if oFono would set the IP address on that newly created interface that is up and running now?

Then the application cannot influence the way it's done. That's the whole point. Maybe I want to migrate the interface in a new namespace. For that, it must (1) create the interface, (2) migrate it, (3) configure it, in that order. So Ofono cannot do (3) if it cannot do (2), and it certainly should not do (2) by itself. So it has to stick to (1).

Quoted 7 lines

And this generally applies to services that operators have decided to run behind a dedicated APN, such as WAP, MMS, Push over Cellular (PoC) and others. For example, Elisa in Finland seems to be running their MMSC behind an "mms" APN, with public IP address space, but firewalled from the rest of the Internet. oFono should isolate such an access from the rest of the system, since only the MMS client would know how to work with it properly.

if they are doing something nasty like that, then the only real solution is network namespaces. This means we can just bring the interface up and then have to give all networking details via D-Bus properties. Actually we might should not even bring the network interface up, but it might be tricky with PPP or the HSO point-to-point stuff.

Regards

Marcel

#15 lore raw
Quoted 11 lines · Marcel Holtmann
Quoted 7 lines

And this generally applies to services that operators have decided to run behind a dedicated APN, such as WAP, MMS, Push over Cellular (PoC) and others. For example, Elisa in Finland seems to be running their MMSC behind an "mms" APN, with public IP address space, but firewalled from the rest of the Internet. oFono should isolate such an access from the rest of the system, since only the MMS client would know how to work with it properly.

if they are doing something nasty like that, then the only real solution is network namespaces. This means we can just bring the interface up and then have to give all networking details via D-Bus properties.

Yes. That's what I was saying, or at least trying to say.

Signature · 1 line
Rémi Denis-Courmont
#16 lore raw
In reply to Denis Kenzior
Quoted 2 lines · Denis Kenzior

of this discussion. I'd like all interested to comment. What needs improvement? What is missing? What should be removed?

Here are some comments. Some of the comments were already present in the IRC discussion, but I'll repeat them here anyway. First of all, the both Denis's proposal and mine look quite much the same -- the basic objects are the GPRS manager and the PDP contexts, and they offer quite the same functionality. Please correct me if I understood some parts of Denis's proposal incorrectly. The big differences between the API proposals are the creation and connecting of the contexts and the handling of the attached/detached state. I'll try to address the both issues below.

In this proposal the contexts PDP contexts are persistent on the device, meaning that they stay there also when Ofono is shut down. The idea is that the contexts are made to Ofono by the GPRS provisioning programs or by the UI, and then ConnMan or another upper layer needs just to activate the context to actually do the connection. In my proposal I thought that the higher layer components would keep track of the access points and call the Connect() method with the suitable connection parameters.

This is a philosophical difference from the provisioning point of view. An operator will likely support multiple configured access points, and the provisioning program should know their purpose from the configuration file (internet/MMS/WAP/...). This metadata is not there in the Ofono context, meaning that the provisioning program needs to store somewhere else the mapping between Ofono context object paths and the neccessary metadata. This begs the question: why not store all connection data (APN, authentication data, other metadata) to this external store in the first place?

The attachment to the GPRS network in this proposal is bit vague. To my understanding, to attach the GPRS you need to set "Powered" property on and "RoamingAllowed" on. To detach you need to set the "Powered" property off. Since attaching can take a long time (or fail), does this mean that the attach errors are handled in the "Powered" property setter callback? Or what happens when (during roaming) the "Powered" is already on and the user puts the "RoamingAllowed" on -- where are the attach errors handled? I kind of think that it might be a better idea to just expose the GPRS registration status and the attach status, and let a higher level component explicitly set the attach/detach with either a readwrite property or Attach() and Detach() methods.

In my proposal the "Status" variable was a three-state variable, having the states "attached", "detached" and "suspended". "Suspended" was specified to mean that the GPRS was attached, but temporarily not available (for instance because of a 2G phone call or temporary loss of cellular connectivity). In the IRC discussion someone said that this property would not be part of Denis's API because the tri-state variables were bad and the "suspended" status was not supported by spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

Still one difference to my proposal was the dropping of the TX and RX byte counts, and the explanation that those statistics would be handled by the upper layers by reading the values from the network interface. I mentioned the problem where the connection was terminated by the network and the network interface was brought down before the upper layer had a chance to read the values. After giving the matter some thought, I still feel that for this reason the modem driver would need to get the TX/RX data and send it to the upper levels, if at all possible. Since many operators charge by the amount of data transferred, not losing the TX/RX data is quite crucial. At least Nokia phones have a GPRS data counter feature, that is supposed to show the transferred data. This said, I know that not all modem drivers can get the data from a connection that has been terminated by the network, but that does not mean that the modem drivers that can get the data should just discard it.

Btw, is the context API missing the PDP type (IPv4 or IPv6)?

As I said, I think that the differences between this proposal and mine are mostly philosophical -- should the context data be stored in Ofono or in the upper layers of the stack? And should Ofono set the policies (for instance the roaming case) or just act as a low-level interface to the GPRS functionality?

By looking at Denis's proposal it is easy to see that my proposal wasn't perfect either. ;-) At least the GPRS registration state and possibly other properties need to be added to the D-Bus interface, and the API also needs to be made more future-proof by thinking how the network-initiated connections and the secondary contexts would be made.

Signature · 1 line
Ismo Puustinen <[email protected]>
#17 lore raw

Hi Ismo,

Quoted 22 lines
Quoted 2 lines

of this discussion. I'd like all interested to comment. What needs improvement? What is missing? What should be removed?

Here are some comments. Some of the comments were already present in the IRC discussion, but I'll repeat them here anyway. First of all, the both Denis's proposal and mine look quite much the same -- the basic objects are the GPRS manager and the PDP contexts, and they offer quite the same functionality. Please correct me if I understood some parts of Denis's proposal incorrectly. The big differences between the API proposals are the creation and connecting of the contexts and the handling of the attached/detached state. I'll try to address the both issues below.

In this proposal the contexts PDP contexts are persistent on the device, meaning that they stay there also when Ofono is shut down. The idea is that the contexts are made to Ofono by the GPRS provisioning programs or by the UI, and then ConnMan or another upper layer needs just to activate the context to actually do the connection. In my proposal I thought that the higher layer components would keep track of the access points and call the Connect() method with the suitable connection parameters.

Quoted 9 lines

This is a philosophical difference from the provisioning point of view. An operator will likely support multiple configured access points, and the provisioning program should know their purpose from the configuration file (internet/MMS/WAP/...). This metadata is not there in the Ofono context, meaning that the provisioning program needs to store somewhere else the mapping between Ofono context object paths and the neccessary metadata. This begs the question: why not store all connection data (APN, authentication data, other metadata) to this external store in the first place?

I mentioned that already. We do wanna store something like Type that says internet, mms, wap etc. The only comment here was that for network initiated context we have no idea of its intent.

Quoted 4 lines

The attachment to the GPRS network in this proposal is bit vague. To my understanding, to attach the GPRS you need to set "Powered" property on and "RoamingAllowed" on. To detach you need to set the "Powered" property off. Since attaching can take a long time (or

Quoted 8 lines

fail), does this mean that the attach errors are handled in the "Powered" property setter callback? Or what happens when (during roaming) the "Powered" is already on and the user puts the "RoamingAllowed" on -- where are the attach errors handled? I kind of think that it might be a better idea to just expose the GPRS registration status and the attach status, and let a higher level component explicitly set the attach/detach with either a readwrite property or Attach() and Detach() methods.

Powered = on and RoamingAllowed = yes and Roaming = true will lead to auto-attach.

Powered = on and RoamingAllowed = no and Roaming = true will lead to detach.

Powered = on and Roaming = false will lead to auto-attach.

Powered = off will lead to detach.

We are not going to expose Attach() or Detach() method. As explained there are global anyway and so pointless to expose. This can be handled in the background without bothering the higher level application with these details.

Quoted 4 lines

In my proposal the "Status" variable was a three-state variable, having the states "attached", "detached" and "suspended". "Suspended" was specified to mean that the GPRS was attached, but temporarily not available (for instance because of a 2G phone call or temporary loss

Quoted 8 lines

of cellular connectivity). In the IRC discussion someone said that this property would not be part of Denis's API because the tri-state variables were bad and the "suspended" status was not supported by spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

I am still not seeing the point in what suspended will do for us and the UI. And that Maemo 5 exposed such a state in the UI is not an argument to keep doing it. I asked this before, what are we suppose to be doing when we get signaled suspended?

Quoted 7 lines

Still one difference to my proposal was the dropping of the TX and RX byte counts, and the explanation that those statistics would be handled by the upper layers by reading the values from the network interface. I mentioned the problem where the connection was terminated by the network and the network interface was brought down before the upper layer had a chance to read the values. After giving the matter some thought, I still feel that for this reason the modem driver would

Quoted 8 lines

need to get the TX/RX data and send it to the upper levels, if at all possible. Since many operators charge by the amount of data transferred, not losing the TX/RX data is quite crucial. At least Nokia phones have a GPRS data counter feature, that is supposed to show the transferred data. This said, I know that not all modem drivers can get the data from a connection that has been terminated by the network, but that does not mean that the modem drivers that can get the data should just discard it.

This is for ConnMan or similar to figure out. And we can always count via netfilter or some other facility. Counting inside oFono makes no sense. However we could send out a statistics signal before taking the interface down if it would be really needed. Making it part of the properties and having to poll for it is wrong.

Quoted 1 line

Btw, is the context API missing the PDP type (IPv4 or IPv6)?

I keep forgetting these since so far I haven't seen any provider giving me IPv6, but you are correct, we need to be able to handle this.

Quoted 5 lines

As I said, I think that the differences between this proposal and mine are mostly philosophical -- should the context data be stored in Ofono or in the upper layers of the stack? And should Ofono set the policies (for instance the roaming case) or just act as a low-level interface to the GPRS functionality?

While oFono is sort of low-level, it is not that low-level. If it would we could expose the native AT commands. So in summary the PDP context are stored persistently in oFono. Like BlueZ remember paired devices.

And for data roaming, we make it as simple as allowed = yes/no. This is all the upper layer need to configure.

Not exposing method for attach/detach is a logical consequence as explained above. It is a global per modem detail and thus there is not point in exposing it. Also there is not point in having ConnMan and some other potential application fighting for it. We do auto-attach if available and tell the applications the status. If Attached = yes, then the application can connect/disconnect contexts. As simple as that.

Quoted 6 lines

By looking at Denis's proposal it is easy to see that my proposal wasn't perfect either. ;-) At least the GPRS registration state and possibly other properties need to be added to the D-Bus interface, and the API also needs to be made more future-proof by thinking how the network-initiated connections and the secondary contexts would be made.

I prefer start simple and add more details later. Removing details is more complicated than adding them.

Regards

Marcel

#18 lore raw

2009/9/2 Marcel Holtmann <[email protected]>:

Quoted 9 lines

Powered = on and RoamingAllowed = yes and Roaming = true will lead to auto-attach.

Powered = on and RoamingAllowed = no and Roaming = true will lead to detach.

Powered = on and Roaming = false will lead to auto-attach.

Powered = off will lead to detach.

Why is auto-attach dependent on roaming?

Quoted 4 lines

We are not going to expose Attach() or Detach() method. As explained there are global anyway and so pointless to expose. This can be handled in the background without bothering the higher level application with these details.

AFAIK, attach status of GPRS has both regulatory aspects to consider (some operators require always attached vs. some prohibit it) as well as power consumption issues (auto-attach might draw more power than on-demand, although there's an inverse effect on latency). These are issues you need to take into account, and higher layers in the stack definitely *need* to be aware of as well. Also, I don' t think oFono is the correct place for these decisions -> better expose a necessary API and let upper layers deal with it.

In general, I appreciate the attempt to hide ugly details from applications, but unfortunately some things can't well be hidden. Another unrelated, but similar issue is network scanning. It just isn't going to work without us exposing it in the D-Bus API explicitly.

The reason is simple, Nokia modems suspend GPRS when scanning (or registering), simply because the operation will take roughly three times as long with GPRS attached. You will find this feature in current phones, too.

Now, there is no way we can have GPRS suspend without warning just because the stack deems it necessary to scan for networks. Again the intention is good, but the end result not so good. I don't want to start patching oFono to support this type of basic stuff.

Quoted 13 lines
Quoted 4 lines

In my proposal the "Status" variable was a three-state variable, having the states "attached", "detached" and "suspended". "Suspended" was specified to mean that the GPRS was attached, but temporarily not available (for instance because of a 2G phone call or temporary loss

Quoted 8 lines

of cellular connectivity). In the IRC discussion someone said that this property would not be part of Denis's API because the tri-state variables were bad and the "suspended" status was not supported by spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

Quoted 4 lines

I am still not seeing the point in what suspended will do for us and the UI. And that Maemo 5 exposed such a state in the UI is not an argument to keep doing it. I asked this before, what are we suppose to be doing when we get signaled suspended?

You will find that practically every Nokia phone behaves this way, i.e., you make a call in 2G, and the UI will inform you that GPRS is suspended while on call.

Quoted 16 lines
Quoted 7 lines

Still one difference to my proposal was the dropping of the TX and RX byte counts, and the explanation that those statistics would be handled by the upper layers by reading the values from the network interface. I mentioned the problem where the connection was terminated by the network and the network interface was brought down before the upper layer had a chance to read the values. After giving the matter some thought, I still feel that for this reason the modem driver would

Quoted 8 lines

need to get the TX/RX data and send it to the upper levels, if at all possible. Since many operators charge by the amount of data transferred, not losing the TX/RX data is quite crucial. At least Nokia phones have a GPRS data counter feature, that is supposed to show the transferred data. This said, I know that not all modem drivers can get the data from a connection that has been terminated by the network, but that does not mean that the modem drivers that can get the data should just discard it.

Quoted 5 lines

This is for ConnMan or similar to figure out. And we can always count via netfilter or some other facility. Counting inside oFono makes no sense. However we could send out a statistics signal before taking the interface down if it would be really needed. Making it part of the properties and having to poll for it is wrong.

I believe emitting a signal was Ismo's original proposal.

Quoted 7 lines

While oFono is sort of low-level, it is not that low-level. If it would we could expose the native AT commands. So in summary the PDP context are stored persistently in oFono. Like BlueZ remember paired devices.

And for data roaming, we make it as simple as allowed = yes/no. This is all the upper layer need to configure.

Quoted 6 lines

Not exposing method for attach/detach is a logical consequence as explained above. It is a global per modem detail and thus there is not point in exposing it. Also there is not point in having ConnMan and some other potential application fighting for it. We do auto-attach if available and tell the applications the status. If Attached = yes, then the application can connect/disconnect contexts. As simple as that.

Then expose an AutoAttach = true/false property. That would work.

Quoted 9 lines
Quoted 6 lines

By looking at Denis's proposal it is easy to see that my proposal wasn't perfect either. ;-) At least the GPRS registration state and possibly other properties need to be added to the D-Bus interface, and the API also needs to be made more future-proof by thinking how the network-initiated connections and the secondary contexts would be made.

I prefer start simple and add more details later. Removing details is more complicated than adding them.

For some of these features, there is no question whether or not we need them. I think you should be listening closely for the requirements we post, because this isn't something we *think* might be needed some day -- this is stuff that we've implemented and will ship, and expect to ship in the future.

Cheers,
Aki

#19 lore raw

Hi Aki,

Quoted 11 lines
Quoted 9 lines

Powered = on and RoamingAllowed = yes and Roaming = true will lead to auto-attach.

Powered = on and RoamingAllowed = no and Roaming = true will lead to detach.

Powered = on and Roaming = false will lead to auto-attach.

Powered = off will lead to detach.

Why is auto-attach dependent on roaming?

power consumption. No need to attach if you don't wanna allow data roaming.

Quoted 5 lines
Quoted 4 lines

We are not going to expose Attach() or Detach() method. As explained there are global anyway and so pointless to expose. This can be handled in the background without bothering the higher level application with these details.

Quoted 8 lines

AFAIK, attach status of GPRS has both regulatory aspects to consider (some operators require always attached vs. some prohibit it) as well as power consumption issues (auto-attach might draw more power than on-demand, although there's an inverse effect on latency). These are issues you need to take into account, and higher layers in the stack definitely *need* to be aware of as well. Also, I don' t think oFono is the correct place for these decisions -> better expose a necessary API and let upper layers deal with it.

I disagree. We can have a config option that always attaches or attached on demand, but this should not be exposed to any higher level applications.

Quoted 11 lines

In general, I appreciate the attempt to hide ugly details from applications, but unfortunately some things can't well be hidden. Another unrelated, but similar issue is network scanning. It just isn't going to work without us exposing it in the D-Bus API explicitly.

The reason is simple, Nokia modems suspend GPRS when scanning (or registering), simply because the operation will take roughly three times as long with GPRS attached. You will find this feature in current phones, too.

Quoted 4 lines

Now, there is no way we can have GPRS suspend without warning just because the stack deems it necessary to scan for networks. Again the intention is good, but the end result not so good. I don't want to start patching oFono to support this type of basic stuff.

I mentioned this before. We might need to add a config option to allow integrators choose different behavior.

Quoted 13 lines
Quoted 13 lines
Quoted 12 lines

In my proposal the "Status" variable was a three-state variable, having the states "attached", "detached" and "suspended". "Suspended" was specified to mean that the GPRS was attached, but temporarily not available (for instance because of a 2G phone call or temporary loss of cellular connectivity). In the IRC discussion someone said that this property would not be part of Denis's API because the tri-state variables were bad and the "suspended" status was not supported by spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

Quoted 8 lines
Quoted 4 lines

I am still not seeing the point in what suspended will do for us and the UI. And that Maemo 5 exposed such a state in the UI is not an argument to keep doing it. I asked this before, what are we suppose to be doing when we get signaled suspended?

You will find that practically every Nokia phone behaves this way, i.e., you make a call in 2G, and the UI will inform you that GPRS is suspended while on call.

So what is the difference signaling a disconnect and re-connect to the application?

Quoted 16 lines
Quoted 16 lines
Quoted 15 lines

Still one difference to my proposal was the dropping of the TX and RX byte counts, and the explanation that those statistics would be handled by the upper layers by reading the values from the network interface. I mentioned the problem where the connection was terminated by the network and the network interface was brought down before the upper layer had a chance to read the values. After giving the matter some thought, I still feel that for this reason the modem driver would need to get the TX/RX data and send it to the upper levels, if at all possible. Since many operators charge by the amount of data transferred, not losing the TX/RX data is quite crucial. At least Nokia phones have a GPRS data counter feature, that is supposed to show the transferred data. This said, I know that not all modem drivers can get the data from a connection that has been terminated by the network, but that does not mean that the modem drivers that can get the data should just discard it.

Quoted 7 lines
Quoted 5 lines

This is for ConnMan or similar to figure out. And we can always count via netfilter or some other facility. Counting inside oFono makes no sense. However we could send out a statistics signal before taking the interface down if it would be really needed. Making it part of the properties and having to poll for it is wrong.

I believe emitting a signal was Ismo's original proposal.

I will talk with Stephen and David about this and what it a proper way to collect statistics even if the interface goes away. They might have some ideas. Changing the kernel and adding proper support for statistics collection is not out the question here.

Quoted 7 lines
Quoted 7 lines

While oFono is sort of low-level, it is not that low-level. If it would we could expose the native AT commands. So in summary the PDP context are stored persistently in oFono. Like BlueZ remember paired devices.

And for data roaming, we make it as simple as allowed = yes/no. This is all the upper layer need to configure.

Quoted 8 lines
Quoted 6 lines

Not exposing method for attach/detach is a logical consequence as explained above. It is a global per modem detail and thus there is not point in exposing it. Also there is not point in having ConnMan and some other potential application fighting for it. We do auto-attach if available and tell the applications the status. If Attached = yes, then the application can connect/disconnect contexts. As simple as that.

Then expose an AutoAttach = true/false property. That would work.

I prefer these details as configuration option that integrators set when building the actual device. No need to have higher application change it.

Quoted 7 lines
Quoted 7 lines
Quoted 6 lines

By looking at Denis's proposal it is easy to see that my proposal wasn't perfect either. ;-) At least the GPRS registration state and possibly other properties need to be added to the D-Bus interface, and the API also needs to be made more future-proof by thinking how the network-initiated connections and the secondary contexts would be made.

Quoted 8 lines
Quoted 2 lines

I prefer start simple and add more details later. Removing details is more complicated than adding them.

For some of these features, there is no question whether or not we need them. I think you should be listening closely for the requirements we post, because this isn't something we *think* might be needed some day -- this is stuff that we've implemented and will ship, and expect to ship in the future.

Then please give examples. I asked this on IRC. I have never used Secondary PDP Context before. Same goes for network initiated contexts. I would really like to know which networks use what. And I think we need to start collecting these information somewhere. It is important to know what is used in production.

Regards

Marcel

#20 lore raw
Quoted 6 lines · Marcel Holtmann
Quoted 3 lines

You will find that practically every Nokia phone behaves this way, i.e., you make a call in 2G, and the UI will inform you that GPRS is suspended while on call.

So what is the difference signaling a disconnect and re-connect to the application?

It's like pausing or stopping your media player.

Quoted 8 lines
Quoted 5 lines

For some of these features, there is no question whether or not we need them. I think you should be listening closely for the requirements we post, because this isn't something we *think* might be needed some day -- this is stuff that we've implemented and will ship, and expect to ship in the future.

Then please give examples. I asked this on IRC. I have never used Secondary PDP Context before. Same goes for network initiated contexts.

Neither did I.

OTOH, I did see annoying data counter requirements, and I did see suspended mode.

Signature · 1 line
Rémi Denis-Courmont
#21 lore raw
In reply to Aki Niemi

Hi Aki,

Quoted 5 lines
Quoted 4 lines

We are not going to expose Attach() or Detach() method. As explained there are global anyway and so pointless to expose. This can be handled in the background without bothering the higher level application with these details.

Quoted 8 lines

AFAIK, attach status of GPRS has both regulatory aspects to consider (some operators require always attached vs. some prohibit it) as well as power consumption issues (auto-attach might draw more power than on-demand, although there's an inverse effect on latency). These are issues you need to take into account, and higher layers in the stack definitely *need* to be aware of as well. Also, I don' t think oFono is the correct place for these decisions -> better expose a necessary API and let upper layers deal with it.

I know you guys are coming from mobile phone perspective, but that one isn't the only scenario. We have netbooks/laptops with gprs data cards to consider as well. Hardcoding operator requirements is also not an option, since SIM cards can be changed.

I fundamentally disagree that the logic should be in the higher layers. oFono has all the information to handle this, and can be hinted on what is appropriate behavior easily enough. oFono should simply store the auto-attach preferences in its IMSI-indexed preference store. The operator can bootstrap these preferences if required.

Quoted 7 lines

In general, I appreciate the attempt to hide ugly details from applications, but unfortunately some things can't well be hidden. Another unrelated, but similar issue is network scanning. It just isn't going to work without us exposing it in the D-Bus API explicitly.

Modem drivers will have some control over whether the scan is performed automatically, but denying the capability for everyone is not the right thing to do either.

Quoted 4 lines

The reason is simple, Nokia modems suspend GPRS when scanning (or registering), simply because the operation will take roughly three times as long with GPRS attached. You will find this feature in current phones, too.

Then ideally you should have two scan modes, periodic and user initiated. For periodic mode we don't care how long it takes.

Regards,
-Denis

#22 lore raw

2009/9/2 Denis Kenzior <[email protected]>:

Quoted 14 lines
Quoted 8 lines

AFAIK, attach status of GPRS has both regulatory aspects to consider (some operators require always attached vs. some prohibit it) as well as power consumption issues (auto-attach might draw more power than on-demand, although there's an inverse effect on latency). These are issues you need to take into account, and higher layers in the stack definitely *need* to be aware of as well. Also, I don' t think oFono is the correct place for these decisions -> better expose a necessary API and let upper layers deal with it.

I know you guys are coming from mobile phone perspective, but that one isn't the only scenario.  We have netbooks/laptops with gprs data cards to consider as well.  Hardcoding operator requirements is also not an option, since SIM cards can be changed.

Quoted 5 lines

I fundamentally disagree that the logic should be in the higher layers.  oFono has all the information to handle this, and can be hinted on what is appropriate behavior easily enough.  oFono should simply store the auto-attach preferences in its IMSI-indexed preference store.  The operator can bootstrap these preferences if required.

Operator requirements were only half of the story. You need to be able to disable auto-attach in low power conditions, and this logic definitely doesn't belong in oFono. This applies equally well to mobile phones as it does to laptops/netbooks.

Quoted 10 lines
Quoted 6 lines

In general, I appreciate the attempt to hide ugly details from applications, but unfortunately some things can't well be hidden. Another unrelated, but similar issue is network scanning. It just isn't going to work without us exposing it in the D-Bus API explicitly.

Modem drivers will have some control over whether the scan is performed automatically, but denying the capability for everyone is not the right thing to do either.

Agree, and I don't think that was what I was suggesting either.

Quoted 7 lines
Quoted 4 lines

The reason is simple, Nokia modems suspend GPRS when scanning (or registering), simply because the operation will take roughly three times as long with GPRS attached. You will find this feature in current phones, too.

Then ideally you should have two scan modes, periodic and user initiated.  For periodic mode we don't care how long it takes.

+1

Cheers,
Aki

#23 lore raw

Hi Aki,

Quoted 20 lines
Quoted 14 lines
Quoted 8 lines

AFAIK, attach status of GPRS has both regulatory aspects to consider (some operators require always attached vs. some prohibit it) as well as power consumption issues (auto-attach might draw more power than on-demand, although there's an inverse effect on latency). These are issues you need to take into account, and higher layers in the stack definitely *need* to be aware of as well. Also, I don' t think oFono is the correct place for these decisions -> better expose a necessary API and let upper layers deal with it.

I know you guys are coming from mobile phone perspective, but that one isn't the only scenario. We have netbooks/laptops with gprs data cards to consider as well. Hardcoding operator requirements is also not an option, since SIM cards can be changed.

Quoted 5 lines

I fundamentally disagree that the logic should be in the higher layers. oFono has all the information to handle this, and can be hinted on what is appropriate behavior easily enough. oFono should simply store the auto-attach preferences in its IMSI-indexed preference store. The operator can bootstrap these preferences if required.

Quoted 4 lines

Operator requirements were only half of the story. You need to be able to disable auto-attach in low power conditions, and this logic definitely doesn't belong in oFono. This applies equally well to mobile phones as it does to laptops/netbooks.

this a different requirement. Where do you get your low power information from? I would prefer that we add a plugin that gets informed of this low power situation and then is able to adjust such things.

I am against exposing this in user application/UI API. I am with you that such requirements have to be met, but not via the D-Bus API. So these kind of policy details are device/manufacturer specific and having a custom plugins that can be enabled by the integrator sounds best to me if a config file is not flexible enough.

Quoted 18 lines
Quoted 10 lines
Quoted 6 lines

In general, I appreciate the attempt to hide ugly details from applications, but unfortunately some things can't well be hidden. Another unrelated, but similar issue is network scanning. It just isn't going to work without us exposing it in the D-Bus API explicitly.

Modem drivers will have some control over whether the scan is performed automatically, but denying the capability for everyone is not the right thing to do either.

Agree, and I don't think that was what I was suggesting either.

Quoted 5 lines
Quoted 4 lines

The reason is simple, Nokia modems suspend GPRS when scanning (or registering), simply because the operation will take roughly three times as long with GPRS attached. You will find this feature in current phones, too.

Quoted 4 lines
Quoted 2 lines

Then ideally you should have two scan modes, periodic and user initiated. For periodic mode we don't care how long it takes.

+1

Sounds like a plan. So we do need an /etc/ofono/main.conf :)

Regards

Marcel

#24 lore raw

Hi Marcel,

Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

The reason is simple, Nokia modems suspend GPRS when scanning (or registering), simply because the operation will take roughly three times as long with GPRS attached. You will find this feature in current phones, too.

Then ideally you should have two scan modes, periodic and user initiated. For periodic mode we don't care how long it takes.

+1

Sounds like a plan. So we do need an /etc/ofono/main.conf :)

So my current thinking is to introduce a method to NetworkRegistration property called 'ProposeOperatorScan' and a new property called 'OperatorScanInterval'. The driver api can then support a (non-standard *gasp*) option to say whether this scan was initiated actively or not.

Maybe the Nokia modems can use this information not to drop the GPRS link if it isn't an active scan being performed.

Regards,
-Denis

#25 lore raw

Hi Denis,

Quoted 12 lines
Quoted 11 lines
Quoted 9 lines
Quoted 7 lines
Quoted 4 lines

The reason is simple, Nokia modems suspend GPRS when scanning (or registering), simply because the operation will take roughly three times as long with GPRS attached. You will find this feature in current phones, too.

Then ideally you should have two scan modes, periodic and user initiated. For periodic mode we don't care how long it takes.

+1

Sounds like a plan. So we do need an /etc/ofono/main.conf :)

Quoted 7 lines

So my current thinking is to introduce a method to NetworkRegistration property called 'ProposeOperatorScan' and a new property called 'OperatorScanInterval'. The driver api can then support a (non-standard *gasp*) option to say whether this scan was initiated actively or not.

Maybe the Nokia modems can use this information not to drop the GPRS link if it isn't an active scan being performed.

I really prefer if we put this into /etc/ofono/main.conf since the UI should not configure this at all. It is more a one time setting based on what the integrator expects as a behavior.

Regards

Marcel

#26 lore raw
In reply to Marcel Holtmann
Quoted 3 lines · Marcel Holtmann

I mentioned that already. We do wanna store something like Type that says internet, mms, wap etc. The only comment here was that for network initiated context we have no idea of its intent.

And we do not want to.

Quoted 13 lines
Quoted 4 lines

The attachment to the GPRS network in this proposal is bit vague. To my understanding, to attach the GPRS you need to set "Powered" property on and "RoamingAllowed" on. To detach you need to set the "Powered" property off. Since attaching can take a long time (or

Quoted 8 lines

fail), does this mean that the attach errors are handled in the "Powered" property setter callback? Or what happens when (during roaming) the "Powered" is already on and the user puts the "RoamingAllowed" on -- where are the attach errors handled? I kind of think that it might be a better idea to just expose the GPRS registration status and the attach status, and let a higher level component explicitly set the attach/detach with either a readwrite property or Attach() and Detach() methods.

Quoted 2 lines

Powered = on and RoamingAllowed = yes and Roaming = true will lead to auto-attach.

That's just _idiotic_ from the naming perspective.

A modem can have radio on or off. Whether this is done by completely powering the modem off, or by going into some kind of flight mode, is driver-specific. Hence the "powered" name is semantically wrong. When possible, it's actually best to keep the modem in flight mode, so that e.g. the SIM is still usable.

The story is basically the same with roaming. Roaming means you are outside your home network. It does not mean that you want to auto-attach or not. Some people _never_ want to auto-attach, and some people _always_ want to auto-attach. In fact, different operators have different requirements with that regard. Sure, some people want to auto-attach if and only if not roaming. Given that roaming is not just about GPRS, the name is wrong and confusing. But more importantly, we need t support turning the radio on while in the home network yet _not_ attach automatically. This has operator requirements as well as power saving implications.

Quoted 1 line

We are not going to expose Attach() or Detach() method.

And we are going to expose it.

Quoted 4 lines

I am still not seeing the point in what suspended will do for us and the UI. And that Maemo 5 exposed such a state in the UI is not an argument to keep doing it. I asked this before, what are we suppose to be doing when we get signaled suspended?

User, as well as intelligent (connectivity-aware) applications, need to know about this so that they understand why "Internet" is momentarily broken. It's as simple as that.

Oh we could also use the network device carrier flag, and then use Netlink (and we probably should do that too), but we all know how horrible Netlink is from userland.

(...)

Quoted 5 lines

This is for ConnMan or similar to figure out. And we can always count via netfilter or some other facility. Counting inside oFono makes no sense. However we could send out a statistics signal before taking the interface down if it would be really needed. Making it part of the properties and having to poll for it is wrong.

This has legal(ish) implications related to charging. Skipping this is not exactly an option (for a device vendor). I actually agree that this is ugly in some ways. In theory, I don't really care if Ofono or the over-lying connection manager takes care of it. *But* we even need to collect statistics for contexts not handled in Ofono (e.g. Windows PC tethering). And I doubt that Connman would be able to do that properly.

It's ugly and annoying, but we have to suck it up.

Quoted 9 lines
Quoted 5 lines

As I said, I think that the differences between this proposal and mine are mostly philosophical -- should the context data be stored in Ofono or in the upper layers of the stack? And should Ofono set the policies (for instance the roaming case) or just act as a low-level interface to the GPRS functionality?

While oFono is sort of low-level, it is not that low-level. If it would we could expose the native AT commands. So in summary the PDP context are stored persistently in oFono. Like BlueZ remember paired devices.

I fail to see how providing a direct low-level interface would prevent us from providing _also_ a higher-level interface. The later can handle provisioning and data persistence.

Signature · 1 line
Rémi Denis-Courmont
#27 lore raw

Hi Remi,

Quoted 30 lines
Quoted 3 lines

I mentioned that already. We do wanna store something like Type that says internet, mms, wap etc. The only comment here was that for network initiated context we have no idea of its intent.

And we do not want to.

Quoted 13 lines
Quoted 4 lines

The attachment to the GPRS network in this proposal is bit vague. To my understanding, to attach the GPRS you need to set "Powered" property on and "RoamingAllowed" on. To detach you need to set the "Powered" property off. Since attaching can take a long time (or

Quoted 8 lines

fail), does this mean that the attach errors are handled in the "Powered" property setter callback? Or what happens when (during roaming) the "Powered" is already on and the user puts the "RoamingAllowed" on -- where are the attach errors handled? I kind of think that it might be a better idea to just expose the GPRS registration status and the attach status, and let a higher level component explicitly set the attach/detach with either a readwrite property or Attach() and Detach() methods.

Quoted 2 lines

Powered = on and RoamingAllowed = yes and Roaming = true will lead to auto-attach.

That's just _idiotic_ from the naming perspective.

A modem can have radio on or off. Whether this is done by completely powering the modem off, or by going into some kind of flight mode, is driver-specific. Hence the "powered" name is semantically wrong. When possible, it's actually best to keep the modem in flight mode, so that e.g. the SIM is still usable.

Quoted 9 lines

The story is basically the same with roaming. Roaming means you are outside your home network. It does not mean that you want to auto-attach or not. Some people _never_ want to auto-attach, and some people _always_ want to auto-attach. In fact, different operators have different requirements with that regard. Sure, some people want to auto-attach if and only if not roaming. Given that roaming is not just about GPRS, the name is wrong and confusing. But more importantly, we need t support turning the radio on while in the home network yet _not_ attach automatically. This has operator requirements as well as power saving implications.

you did read the API docs Denis send around? These are not global Powered and RoamingAllowed properties. They are specific to the GPRS Manager and thus have specific meaning in that context. It has nothing to do with flight mode or radio off.

And for the different operator policy/behavior, that should be configured via config option and not via D-Bus. The integrator should make a choice. It it is a list of mappings of operator = attach policy, then that is also fine.

Quoted 3 lines
Quoted 1 line

We are not going to expose Attach() or Detach() method.

And we are going to expose it.

And for what good is this. So we have two applications fighting about Attach and Detach and some weird policy somewhere upper in the stack with no real sense on what is happening. Sorry but I am not buying this at all.

If the only argument is that different providers require different auto-attach policies then we have that as described via a config option and be done with it.

Otherwise I like to see real examples where something like ConnMan, an MMS application or any other application need control over the attach status.

Quoted 5 lines
Quoted 4 lines

I am still not seeing the point in what suspended will do for us and the UI. And that Maemo 5 exposed such a state in the UI is not an argument to keep doing it. I asked this before, what are we suppose to be doing when we get signaled suspended?

Quoted 7 lines

User, as well as intelligent (connectivity-aware) applications, need to know about this so that they understand why "Internet" is momentarily broken. It's as simple as that.

Oh we could also use the network device carrier flag, and then use Netlink (and we probably should do that too), but we all know how horrible Netlink is from userland.

Using IFF_RUNNING and IFF_LOWER_UP sounds more reasonable then some suspended state.

Quoted 7 lines

(...)

Quoted 5 lines

This is for ConnMan or similar to figure out. And we can always count via netfilter or some other facility. Counting inside oFono makes no sense. However we could send out a statistics signal before taking the interface down if it would be really needed. Making it part of the properties and having to poll for it is wrong.

Quoted 8 lines

This has legal(ish) implications related to charging. Skipping this is not exactly an option (for a device vendor). I actually agree that this is ugly in some ways. In theory, I don't really care if Ofono or the over-lying connection manager takes care of it. *But* we even need to collect statistics for contexts not handled in Ofono (e.g. Windows PC tethering). And I doubt that Connman would be able to do that properly.

It's ugly and annoying, but we have to suck it up.

As I mentioned it before. We figure something out. We do have the same problem for all hotplug network devices. Especially with hotplug 3G dongles, we need to do something better than counting by ourself. The kernel should do it for us. If you yank the dongle, then oFono is even lost and the accounting is not accurate.

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

As I said, I think that the differences between this proposal and mine are mostly philosophical -- should the context data be stored in Ofono or in the upper layers of the stack? And should Ofono set the policies (for instance the roaming case) or just act as a low-level interface to the GPRS functionality?

Quoted 7 lines
Quoted 3 lines

While oFono is sort of low-level, it is not that low-level. If it would we could expose the native AT commands. So in summary the PDP context are stored persistently in oFono. Like BlueZ remember paired devices.

I fail to see how providing a direct low-level interface would prevent us from providing _also_ a higher-level interface. The later can handle provisioning and data persistence.

I don't see the need for the low-level interface in this context. What do you expect it to do? I might be missing something here, but where do we actually use dynamic one-time PDP contexts. These all look like configured or provisioned settings to me.

Regards

Marcel

#28 lore raw
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

I am still not seeing the point in what suspended will do for us and the UI. And that Maemo 5 exposed such a state in the UI is not an argument to keep doing it. I asked this before, what are we suppose to be doing when we get signaled suspended?

User, as well as intelligent (connectivity-aware) applications, need to know about this so that they understand why "Internet" is momentarily broken. It's as simple as that.

+1

Quoted 6 lines
Quoted 3 lines

Oh we could also use the network device carrier flag, and then use Netlink (and we probably should do that too), but we all know how horrible Netlink is from userland.

Using IFF_RUNNING and IFF_LOWER_UP sounds more reasonable then some suspended state.

IF_OPER_DORMANT seems a more accurate reflection of the state.

Cheers,
Waldo

#29 lore raw

Hi Waldo,

Quoted 10 lines
Quoted 8 lines
Quoted 8 lines
Quoted 4 lines

I am still not seeing the point in what suspended will do for us and the UI. And that Maemo 5 exposed such a state in the UI is not an argument to keep doing it. I asked this before, what are we suppose to be doing when we get signaled suspended?

User, as well as intelligent (connectivity-aware) applications, need to know about this so that they understand why "Internet" is momentarily broken. It's as simple as that.

+1

they need to know if they can do something useful with this information. If not, then this state is just pointless. However the D-Bus API is the wrong location for this detail.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

Oh we could also use the network device carrier flag, and then use Netlink (and we probably should do that too), but we all know how horrible Netlink is from userland.

Using IFF_RUNNING and IFF_LOWER_UP sounds more reasonable then some suspended state.

IF_OPER_DORMANT seems a more accurate reflection of the state.

Yep. That sounds good. We don't use that in ConnMan right now, but that can be fixed of course. I still need to figure out what we are suppose to do when this gets signaled to us.

Regards

Marcel

#30 lore raw
In reply to Ismo Puustinen

Hi Ismo,

Quoted 9 lines

This is a philosophical difference from the provisioning point of view. An operator will likely support multiple configured access points, and the provisioning program should know their purpose from the configuration file (internet/MMS/WAP/...). This metadata is not there in the Ofono context, meaning that the provisioning program needs to store somewhere else the mapping between Ofono context object paths and the neccessary metadata. This begs the question: why not store all connection data (APN, authentication data, other metadata) to this external store in the first place?

Actually this one is missing from the API proposal. Marcel already wanted the context type (internet, mms, wap, etc) information. I've updated the proposed API in git.

As discussed previously, we want oFono to manage this data, since it can do this by using the IMSI. So if you insert a different operator SIM your APN settings are magically updated for that operator.

Quoted 7 lines

In my proposal the "Status" variable was a three-state variable, having the states "attached", "detached" and "suspended". "Suspended" was specified to mean that the GPRS was attached, but temporarily not available (for instance because of a 2G phone call or temporary loss of cellular connectivity). In the IRC discussion someone said that this property would not be part of Denis's API because the tri-state variables were bad and the "suspended" status was not supported by

So the general rule is that if a feature isn't explicitly allowed in 27.007, we do not support it. There are exceptions to this of course. 27.007 only supports two states for context: activated and deactivated.

Quoted 5 lines

spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

I'd rather not.

If this feature is really required, then some sort of heuristic can be applied. (e.g. Powered on, Attached on, but context is deactivated most likely means temporary unavailability of resources)

Quoted 16 lines

Still one difference to my proposal was the dropping of the TX and RX byte counts, and the explanation that those statistics would be handled by the upper layers by reading the values from the network interface. I mentioned the problem where the connection was terminated by the network and the network interface was brought down before the upper layer had a chance to read the values. After giving the matter some thought, I still feel that for this reason the modem driver would need to get the TX/RX data and send it to the upper levels, if at all possible. Since many operators charge by the amount of data transferred, not losing the TX/RX data is quite crucial. At least Nokia phones have a GPRS data counter feature, that is supposed to show the transferred data. This said, I know that not all modem drivers can get the data from a connection that has been terminated by the network, but that does not mean that the modem drivers that can get the data should just discard it.

This really belong in the kernel. Only the kernel can reliably know when a network interface has been brought down and notify the interested applications with the statistics. Nokia hardware supports this explicitly, but many others don't. I don't want nasty kludges inside oFono to enable this.

Quoted 2 lines

Btw, is the context API missing the PDP type (IPv4 or IPv6)?

I left this out explicitly since I've never seen anything besides "IP" being used. But we can add this easily enough if there's need.

Regards,
-Denis

#31 lore raw

Hi Denis,

2009/9/2 Denis Kenzior <[email protected]>:

Quoted 3 lines

So the general rule is that if a feature isn't explicitly allowed in 27.007, we do not support it.  There are exceptions to this of course.  27.007 only supports two states for context: activated and deactivated.

Ahem. Just like access selection mode is not in 27.007, yet Nokia has it, and most AT modems have proprietary commands to query and set it [1]. Maybe you call that the necessary exception to the rule, but I think we might as well change the rule to:

"If a feature is explicitly requested by users of oFono, and can be reasonably provided by modems that have it without braking those that don't have it, it will be supported. And 27.007 can go fsck itself." ;-)

Quoted 11 lines
Quoted 5 lines

spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

I'd rather not.

If this feature is really required, then some sort of heuristic can be applied.  (e.g. Powered on, Attached on, but context is deactivated most likely means temporary unavailability of resources)

You want the UI to implement this heuristic, when the modem plugin has explicit knowledge of that state, but isn't telling? Please explain how that makes the UI simpler?

Cheers,
Aki

[1] http://blogs.gnome.org/dcbw/2009/03/20/thats-when-i-reach-for-my-revolver/

#32 lore raw

Hi Aki,

Quoted 11 lines

Hi Denis,

2009/9/2 Denis Kenzior <[email protected]>:

Quoted 3 lines

So the general rule is that if a feature isn't explicitly allowed in 27.007, we do not support it. There are exceptions to this of course.
27.007 only supports two states for context: activated and deactivated.

Ahem. Just like access selection mode is not in 27.007, yet Nokia has it, and most AT modems have proprietary commands to query and set it [1]. Maybe you call that the necessary exception to the rule, but I think we might as well change the rule to:

So my stance on BandSelection is that we want a standard interface _if and only if_ we can support it reliably across the majority of modems. You might still find me telling every modem manufacturer to simply implement their own BandSelection interface if this cannot be done.

The same goes for Neighbor Cell Info or any other stuff that isn't mandated by 27.007.

Quoted 9 lines
Quoted 9 lines
Quoted 6 lines

spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

I'd rather not.

Quoted 7 lines
Quoted 3 lines

If this feature is really required, then some sort of heuristic can be applied. (e.g. Powered on, Attached on, but context is deactivated most likely means temporary unavailability of resources)

You want the UI to implement this heuristic, when the modem plugin has explicit knowledge of that state, but isn't telling? Please explain how that makes the UI simpler?

Then expose this signal on Nokia-only interface and be done with it. Why does everything have to be part of the oFono official APIs?

Regards,
-Denis

#33 lore raw
In reply to Denis Kenzior

Le mercredi 2 septembre 2009 18:00:22 Denis Kenzior, vous avez écrit :

Quoted 3 lines

Actually this one is missing from the API proposal. Marcel already wanted the context type (internet, mms, wap, etc) information. I've updated the proposed API in git.

This is not going to work.

Depending on the operator, you may have more than one "type" for a single context (e.g. WAP+MMS), or worse, multiple contexts of the same type (e.g. Internet with only Web and Internet with full IP).

Quoted 3 lines

As discussed previously, we want oFono to manage this data, since it can do this by using the IMSI. So if you insert a different operator SIM your APN settings are magically updated for that operator.

I have a feeling this does not work either. If I upgrade my subscription, the APN may change while not the IMSI, no?

Quoted 11 lines
Quoted 7 lines

In my proposal the "Status" variable was a three-state variable, having the states "attached", "detached" and "suspended". "Suspended" was specified to mean that the GPRS was attached, but temporarily not available (for instance because of a 2G phone call or temporary loss of cellular connectivity). In the IRC discussion someone said that this property would not be part of Denis's API because the tri-state variables were bad and the "suspended" status was not supported by

So the general rule is that if a feature isn't explicitly allowed in 27.007, we do not support it. There are exceptions to this of course. 27.007 only supports two states for context: activated and deactivated.

Our general rule is that if we have a UI requirement, or better an actual use case for it, we support it. Suspended GPRS fits both.

Quoted 11 lines
Quoted 5 lines

spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

I'd rather not.

If this feature is really required, then some sort of heuristic can be applied. (e.g. Powered on, Attached on, but context is deactivated most likely means temporary unavailability of resources)

Is this some kind of joke? Don't you know the difference between pause and stop on your MP3 player and between suspend to memory and power off on your computer?

Second guessing does not fit in my definition of "easy to use self- documenting" for an API.

Quoted 3 lines

This really belong in the kernel. Only the kernel can reliably know when a network interface has been brought down and notify the interested applications with the statistics.

You're missing the point.

Yes, any body can extract the statistics for a running context. But data counters are cumulating. To compute the sum properly, there are but two options:
# Either the GPRS middleware requests kernel per-interface statistics right before destroying the interface, and sums with the earlier total. # Or the modem does it internally.

There is no way some random userland interface application can do it just by requesting the kernel, since it cannot know when to request those statistics.

Quoted 1 line

Nokia hardware supports this explicitly, but many others don't.

That's irrelevant. Hardware support helps in the sense that it can include statistics for contexts external to Ofono. If the hardware does not support it, then it needs to be done manually in the GPRS middleware.

That won't make the requirement go away.

Signature · 2 lines
Rémi Denis-Courmont
http://www.remlab.net/
#34 lore raw

Hi Remi,

Quoted 10 lines

Le mercredi 2 septembre 2009 18:00:22 Denis Kenzior, vous avez écrit :

Quoted 3 lines

Actually this one is missing from the API proposal. Marcel already wanted the context type (internet, mms, wap, etc) information. I've updated the proposed API in git.

This is not going to work.

Depending on the operator, you may have more than one "type" for a single context (e.g. WAP+MMS), or worse, multiple contexts of the same type (e.g. Internet with only Web and Internet with full IP).

Worst case we make the field completely freeform. Right now we really only care about "internet" type for connman.

Quoted 7 lines
Quoted 4 lines

As discussed previously, we want oFono to manage this data, since it can do this by using the IMSI. So if you insert a different operator SIM your APN settings are magically updated for that operator.

I have a feeling this does not work either. If I upgrade my subscription, the APN may change while not the IMSI, no?

Yes, but then you will probably receive an SMS/OTA message with new connection details. Which either oFono or some external application will apply to your GPRS settings.

Quoted 4 lines
Quoted 3 lines

This really belong in the kernel. Only the kernel can reliably know when a network interface has been brought down and notify the interested applications with the statistics.

Quoted 8 lines

You're missing the point.

Yes, any body can extract the statistics for a running context. But data counters are cumulating. To compute the sum properly, there are but two options:
# Either the GPRS middleware requests kernel per-interface statistics right before destroying the interface, and sums with the earlier total. # Or the modem does it internally.

I know why you want this, but I'm still against the counter being an oFono driver API. There needs to be a proper kernel interface that signals the application when an interface has gone away with the rx/tx details. This way we handle this generically for all modems without relying on some intrinsic hardware capabilities.

The rx/tx counter not being reported via PropertyChanged is also a bad idea since it breaks our API conventions. I can deal with a one-time signal being emitted when the interface has gone away though.

Regards,
-Denis

#35 lore raw
Quoted 13 lines
Quoted 4 lines
Quoted 3 lines

This really belong in the kernel. Only the kernel can reliably know when a network interface has been brought down and notify the interested applications with the statistics.

Quoted 8 lines

You're missing the point.

Yes, any body can extract the statistics for a running context. But data counters are cumulating. To compute the sum properly, there are but two options:
# Either the GPRS middleware requests kernel per-interface statistics right before destroying the interface, and sums with the earlier total. # Or the modem does it internally.

Quoted 5 lines

I know why you want this, but I'm still against the counter being an oFono driver API. There needs to be a proper kernel interface that signals the application when an interface has gone away with the rx/tx details. This way we handle this generically for all modems without relying on some intrinsic hardware capabilities.

This still doesn't solve the case where the modem is accessed from a PC client and forwards PPP data as that data will not go through any network interface, e.g. BT DUN or USB tethering.

The modem is really in the best position to provide the most reliable information on data usage. You can still use statistics from the network interfaces as a fall-back in case the modem can not provide this information.

Cheers,
Waldo

#36 lore raw

Hi Waldo,

Quoted 9 lines
Quoted 5 lines

I know why you want this, but I'm still against the counter being an oFono driver API. There needs to be a proper kernel interface that signals the application when an interface has gone away with the rx/tx details. This way we handle this generically for all modems without relying on some intrinsic hardware capabilities.

This still doesn't solve the case where the modem is accessed from a PC client and forwards PPP data as that data will not go through any network interface, e.g. BT DUN or USB tethering.

The cases you describe imply that oFono is not even in control of the gprs context. How would we track/report the tx/rx statistics in that case?

Quoted 5 lines

The modem is really in the best position to provide the most reliable information on data usage. You can still use statistics from the network interfaces as a fall-back in case the modem can not provide this information.

I don't disagree, but not every modem can track these statistics and this isn't described by 27.007. I suggest the initial support should be enabled by the modem driver implementing a custom D-Bus interface and expose these details however it wishes.

Regards,
-Denis

#37 lore raw
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

I know why you want this, but I'm still against the counter being an oFono driver API. There needs to be a proper kernel interface that signals the application when an interface has gone away with the rx/tx details. This way we handle this generically for all modems without relying on some intrinsic hardware capabilities.

Quoted 6 lines
Quoted 3 lines

This still doesn't solve the case where the modem is accessed from a PC client and forwards PPP data as that data will not go through any network interface, e.g. BT DUN or USB tethering.

The cases you describe imply that oFono is not even in control of the gprs context. How would we track/report the tx/rx statistics in that case?

It's probably difficult if the PC client is allowed to redefine GPRS contexts, but otherwise oFono should at least be able to report the total tx/rx for the context's it has defined. The BT DUN / USB bridge could call into oFono and trigger a poll of all the stats to update them, e.g. when a BT DUN connection is disconnected.

Quoted 9 lines
Quoted 4 lines

The modem is really in the best position to provide the most reliable information on data usage. You can still use statistics from the network interfaces as a fall-back in case the modem can not provide this information.

I don't disagree, but not every modem can track these statistics and this isn't described by 27.007. I suggest the initial support should be enabled by the modem driver implementing a custom D-Bus interface and expose these details however it wishes.

The modem driver has no desires of its own :-) It really comes down to what the UI needs and I doubt that the UI wants to deal with this on a modem by modem basis, but sure it's a possibility.

Cheers,
Waldo

#38 lore raw

Hi Waldo,

Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

I know why you want this, but I'm still against the counter being an oFono driver API. There needs to be a proper kernel interface that signals the application when an interface has gone away with the rx/tx details. This way we handle this generically for all modems without relying on some intrinsic hardware capabilities.

Quoted 8 lines
Quoted 6 lines
Quoted 3 lines

This still doesn't solve the case where the modem is accessed from a PC client and forwards PPP data as that data will not go through any network interface, e.g. BT DUN or USB tethering.

The cases you describe imply that oFono is not even in control of the gprs context. How would we track/report the tx/rx statistics in that case?

It's probably difficult if the PC client is allowed to redefine GPRS contexts, but otherwise oFono should at least be able to report the total tx/rx for the context's it has defined. The BT DUN / USB bridge could call into oFono and trigger a poll of all the stats to update them, e.g. when a BT DUN connection is disconnected.

how should it do this if oFono is not in the mix. If you are using Bluetooth DUN and point it to a virtual TTY, then you are out of look. If using USB CDC ACM then same applies.

The real solution here is Bluetooth PAN and USB CDC Ether which do properly interact with the networking stack.

Quoted 11 lines
Quoted 9 lines
Quoted 4 lines

The modem is really in the best position to provide the most reliable information on data usage. You can still use statistics from the network interfaces as a fall-back in case the modem can not provide this information.

I don't disagree, but not every modem can track these statistics and this isn't described by 27.007. I suggest the initial support should be enabled by the modem driver implementing a custom D-Bus interface and expose these details however it wishes.

The modem driver has no desires of its own :-) It really comes down to what the UI needs and I doubt that the UI wants to deal with this on a modem by modem basis, but sure it's a possibility.

The current consent is that we might send a one time signal with all statistics details once the interface goes away. Or we can make the kernel help us here.

However I prefer that we sit this out a little and play with what is possible before knocking down an API. I am not even sure what different hardware would give us and how things need to work. I don't see us having enough information to understand what is needed from a hardware, driver or oFono core point of view.

Regards

Marcel

#39 lore raw

Le jeudi 3 septembre 2009 00:01:03 Marcel Holtmann, vous avez écrit :

Quoted 6 lines
Quoted 5 lines

It's probably difficult if the PC client is allowed to redefine GPRS contexts, but otherwise oFono should at least be able to report the total tx/rx for the context's it has defined. The BT DUN / USB bridge could call into oFono and trigger a poll of all the stats to update them, e.g. when a BT DUN connection is disconnected.

Quoted 6 lines

how should it do this if oFono is not in the mix. If you are using Bluetooth DUN and point it to a virtual TTY, then you are out of look. If using USB CDC ACM then same applies.

The real solution here is Bluetooth PAN and USB CDC Ether which do properly interact with the networking stack.

When we have patched all the Windows PC of the world, we can consider it.

In the mean time, AT+PPP emulation is required. Some modems do provide data counters including that. I've seen it as a requirement that I would rather have avoided but could not. It's ugly and arguably stupid, but required anyway. In fact, if Ofono won't do it, ConnMan will have to, which is probably by all means worse.

You can argue that it should be a driver-specific feature, but it has to be there. Hence, I would guess that more than one driver will support eventually, at which point it should probably be in the common API.

Signature · 2 lines
Rémi Denis-Courmont
http://www.remlab.net/
#40 lore raw

Hi Remi,

Quoted 6 lines
Quoted 6 lines
Quoted 5 lines

It's probably difficult if the PC client is allowed to redefine GPRS contexts, but otherwise oFono should at least be able to report the total tx/rx for the context's it has defined. The BT DUN / USB bridge could call into oFono and trigger a poll of all the stats to update them, e.g. when a BT DUN connection is disconnected.

Quoted 8 lines
Quoted 6 lines

how should it do this if oFono is not in the mix. If you are using Bluetooth DUN and point it to a virtual TTY, then you are out of look. If using USB CDC ACM then same applies.

The real solution here is Bluetooth PAN and USB CDC Ether which do properly interact with the networking stack.

When we have patched all the Windows PC of the world, we can consider it.

my approach would be to try and see how far we get this pushing towards PAN and CDC Ether :)

Quoted 5 lines

In the mean time, AT+PPP emulation is required. Some modems do provide data counters including that. I've seen it as a requirement that I would rather have avoided but could not. It's ugly and arguably stupid, but required anyway. In fact, if Ofono won't do it, ConnMan will have to, which is probably by all means worse.

Actually it is worth for high-speed modems with a network interface and no internal PPP emulation, we would have to do that emulation somewhere in the host stack. And now my brain hurts :(

Quoted 3 lines

You can argue that it should be a driver-specific feature, but it has to be there. Hence, I would guess that more than one driver will support eventually, at which point it should probably be in the common API.

We have to figure something out, but right I would prefer if we GPRS up and running and after that tackle the statistics part. Since without GPRS, we don't need the statistics ;)

Regards

Marcel

#41 lore raw
In reply to Rémi Denis-Courmont

Hi Remi,

Quoted 9 lines
Quoted 3 lines

Actually this one is missing from the API proposal. Marcel already wanted the context type (internet, mms, wap, etc) information. I've updated the proposed API in git.

This is not going to work.

Depending on the operator, you may have more than one "type" for a single context (e.g. WAP+MMS), or worse, multiple contexts of the same type (e.g. Internet with only Web and Internet with full IP).

we might need some extra work here and define what we want. I am confident that we can break this down to something useful. Worst case we something free form.

Quoted 6 lines
Quoted 3 lines

As discussed previously, we want oFono to manage this data, since it can do this by using the IMSI. So if you insert a different operator SIM your APN settings are magically updated for that operator.

I have a feeling this does not work either. If I upgrade my subscription, the APN may change while not the IMSI, no?

We can update these details at any time. Storing them on a per ISMI basis is a good idea and something new that oFono does (as far as what I have seen). So if you switch SIM cards, then you don't have to worry about anything when traveling. It does the right thing you configured.

Especially with the devices like the Nokia netbook and the iPhone where you can easily switch SIM cards without power on/off this will come in handy.

If an upgrade of the subscription needs manual interaction from the user or an operator message to update the settings, then that is fine. Since the user did something to begin with. So they are aware of that something changed (hope the operator told them). While just switching a SIM card and by accident using a wrong APN and causing expensive roaming would be a worse thing. Especially since there is an expectation from the user when switching SIM cards.

Quoted 8 lines
Quoted 8 lines
Quoted 7 lines

In my proposal the "Status" variable was a three-state variable, having the states "attached", "detached" and "suspended". "Suspended" was specified to mean that the GPRS was attached, but temporarily not available (for instance because of a 2G phone call or temporary loss of cellular connectivity). In the IRC discussion someone said that this property would not be part of Denis's API because the tri-state variables were bad and the "suspended" status was not supported by

Quoted 6 lines
Quoted 3 lines

So the general rule is that if a feature isn't explicitly allowed in 27.007, we do not support it. There are exceptions to this of course. 27.007 only supports two states for context: activated and deactivated.

Our general rule is that if we have a UI requirement, or better an actual use case for it, we support it. Suspended GPRS fits both.

Can you share these UI requirements with us.

Quoted 32 lines
Quoted 11 lines
Quoted 5 lines

spec 27.007. However, the problem is that Maemo 5 already has UI support for indicating that the connection is suspended, and that makes it harder to drop the feature. Could the "suspended" status enum still be left there, and just have the modems that don't support the feature to never go to "suspended" mode?

I'd rather not.

If this feature is really required, then some sort of heuristic can be applied. (e.g. Powered on, Attached on, but context is deactivated most likely means temporary unavailability of resources)

Is this some kind of joke? Don't you know the difference between pause and stop on your MP3 player and between suspend to memory and power off on your computer?

Second guessing does not fit in my definition of "easy to use self- documenting" for an API.

Quoted 3 lines

This really belong in the kernel. Only the kernel can reliably know when a network interface has been brought down and notify the interested applications with the statistics.

You're missing the point.

Yes, any body can extract the statistics for a running context. But data counters are cumulating. To compute the sum properly, there are but two options:
# Either the GPRS middleware requests kernel per-interface statistics right before destroying the interface, and sums with the earlier total. # Or the modem does it internally.

Quoted 2 lines

There is no way some random userland interface application can do it just by requesting the kernel, since it cannot know when to request those statistics.

So my 2 cents here are that whatever so modem does for statistics it should match the details its exports via the networking interface.

And on the kernel part and destroyed interface, as I mentioned, we need to discuss this with the kernel guys. I wanna get an answer what can be done to help us. We have most kernel guys at netconf in Portland in three weeks and I gonna check with them.

Quoted 7 lines
Quoted 1 line

Nokia hardware supports this explicitly, but many others don't.

That's irrelevant. Hardware support helps in the sense that it can include statistics for contexts external to Ofono. If the hardware does not support it, then it needs to be done manually in the GPRS middleware.

That won't make the requirement go away.

What do you expect middleware to do exactly. Our problem is that we loose the latest state of statistics when interface destroyed. If that can be fixed inside the kernel, why work around in user space. In case it can not be fixed and solved to what we need then we revisit this proposal. Until then we should put this on hold.

Regards

Marcel