返回列表 发帖

[玩意] IMAP IDLE 才是最好的PUSH方案?

From http://www.isode.com/whitepapers/imap-idle.html

使用了Profimail后对这种IDLE的PUSH很感兴趣,查到这样的资料,请达人解疑。。。

IMAP IDLE: The best approach for 'push' email.
27th June 2006

The concept of "push email" has been widely marketed as a desirable feature of mobile email services, to enable users to get immediate notification of and access to new messages. This paper looks at various approaches to meeting user requirements, and concludes that the Internet Standard IMAP (Internet Message Access Protocol) IDLE command is the best way to achieve this service.

What are the User Requirements?

"Push Email" is an unfortunate choice of terminology, as it implies a specific technical solution to a more generic user requirement. The primary user requirement described by "push email" is:

"Whenever a new message is delivered to my mailbox, I want to be notified 'immediately' that the message has arrived."

'Immediately' in the context of store and forward messaging would typically be interpreted as "a few seconds", rather than hours and minutes. There are some associated secondary requirements that should be addressed by a good solution:

The user should have control over message download to the mobile device. A typical choice would be to automatically download small messages, and to download larger messages under user control.
The user should be able to turn off notifications when desired.
The user should have control over which messages lead to notifications (e.g., only messages from the boss!).

Polling is a Poor Solution

The basic approach used by many email devices is to connect to the server to access new messages. This is a good model for many uses of mobile email, where access to email is under user control – the user checks email when the user wants to.

In order achieve automatic notification of new messages, a simple approach is to use 'polling' where the mobile client automatically connects to the server at intervals to check for new messages. However, there are two main problems with this approach:

Frequent polling is an inefficient use of network and mobile device resources, increasing the cost to the user.
New mail notification is only as frequent at the polling, and not 'immediate'.
Polling is a poor solution for a user needing immediate notification.

What is IMAP IDLE?

IMAP (Internet Message Access Protocol) is the best open standard for accessing mobile email. It handles immediate notification as part of general operations and by the IDLE command, which is a widely implemented standard extension to the core IMAP protocol.

How IDLE Works

IMAP works by the software on the mobile device (the client) issuing commands to the server. An IMAP server provides two things in response to a client command:

An answer to the request.
Information on any new messages.
This means that where a client is actively doing things with an IMAP server, it will be told immediately about new messages. The client can then get summary information on the message to present to the user, and can (automatically) download the message when appropriate.

This means that an active client will always be kept up to date. The IDLE command deals with the situation where the client has no more requests to make. The server responds to the idle command when there is a new message (or messages) which indicates to the client that there are new messages.

When the user is inactive, and does not wish to receive notifications, the client simply stops using IDLE, which is very efficient.

Performance

The basic network use of the IDLE command is very small, and so it makes very efficient use of bandwidth. In practice things are made more complex by the problem of timeouts occuring when there is no activity keeping the connection open. The main timeouts that will occur are:

IMAP server timeout: Typically occurs after 30 minutes with no activity.
NAT Gateway timeout: Most mobile devices access the Internet through a device operated by the mobile service provider called a NAT (Network Address Translation) gateway. These will typically time out an idle connection after 15 minutes.
The solution to this is for the IMAP client to issue a NOOP (No Operation) command at intervals, typically every 15 minutes. This will exchange a few bytes of data, and keep everything active. The impact of holding an IMAP connection open on the client, server and intermediate components should be considered:

IMAP Server. A good IMAP server will have minimal overhead for an Idle connection, and should be able to support 10’s or 100’s of thousands of connections.
IP Routers and other network components. Negligible impact.
Phone. For older phones there could be an issue of increased battery usage due to holding the connection open. This is unlikely to be a problem on a modern phone.
Another practical problem is that current phone networking technology will lose IP network connectivity from time to time, and this will need to be automatically re-established, and the IMAP connection re-established if this is lost due to a long network failure.

In summary, the overall IMAP IDLE architecture has good performance.

'True' Push

An alternative to the IMAP IDLE approach is for a mechanism whereby the server pushes something to the client when a new message arrives, without there being an open connection from the client to the server. This section looks at this approach.

Alert vs Message Send

There are two variants of the 'true' push approach:

Push the new message.
Push a short generic message alert, prompting the client to connect to the server in order to retrieve the message.
Using approach 1 leads to three problems:

The mechanism will need to deal with security and data confidentiality, which leads to a lot of additional complexity.
The data being pushed becomes larger, which reduces the options for sending the data (e.g., SMS could not be used).
There is no client control on the choice to download.
For these reasons, the second approach is generally better, and this is the one considered here.

Implementation Options

A clean way to send data from the server to the mobile device would be for the server to open a TCP connection. This would give a lot of flexibility in protocol choice and deployment. Unfortunately, this is impractical because most mobile devices do not have registered IP addresses to which a server can connect. They are also generally connected through a NAT gateway that will prevent connections being made to the phone. This means that use of a TCP connection is not generally a viable option.

This means that another mechanism needs to be used to do the 'push'. There are various options to do this. SMS is a good candidate, as it is widely supported as a data listening mechanism on most mobile devices. SMS is used as an example interconnect mechanism in this paper. The use of SMS as the mechanism to carry messaging alerts leads to two integration problems:

Phone. SMS is a general purpose service, not specific to email. There are two integration approaches:
Use a "you’ve got mail" message to the human user, who will then connect with the email application. This crude approach would only be suitable for very basic use.
Standardize how SMS is used, so that phones can detect email notifications and pass them to the email client for automatic processing.
Messaging server. There are two deployment scenarios:
Messaging server deployed by a mobile operator. In this scenario integration with SMS is straightforward.
Messaging server deployed by the end organization or independent service provider. Typically such a deployment will rely on Internet access. Integration with SMS would provide both technical problems (how to make it happen) and commercial problems (who pays for the SMS message, and how to prevent abuse).
These problems are not insurmountable, but will be a barrier to widespread adoption.

Performance

The response time and data use of this push approach are contrasted to IMAP IDLE,
A messaging server offering both approaches would be able to send the push notification and IDLE response at the same time. The IDLE response is immediate, and it will initiate the client to deal with the new messages. The push notification will have two delays:

Time for the SMS message to reach the phone. This may be a few seconds, but could take longer.
Time for the client to connect to the server. This will typically be a few seconds.
True push will be somewhat slower than IMAP IDLE, but in practice this is not likely to be a big problem.
Data usage for IMAP IDLE is essentially the 15 minute NOOP to keep the connection alive, plus a small amount of data to do the notification. The true push will have the cost of the SMS notification. The data for connection establishment is more significant, typically including TCP Connection; TLS (for data confidentiality); client authentication; client (re) synchronization.

It can be seen that for frequent message arrival, that IMAP IDLE is more efficient and that for longer intervals between notifications that true push has better data efficiency. The details will depend on many parameters. A rough calculation suggests that a typical break-even point would be around two days. This suggests that for a typical user receiving and getting notifications for 10 messages per day, that IMAP IDLE has significantly better data performance.

When the user does not want to receive notifications, there is a need to change server configuration (which causes extra complexity and network activity).

Conclusions

IMAP + IMAP IDLE is a good approach for providing the immediate email notification and delivery service of "push email". It has substantial implementation, deployment and performance advantages over a "true push" approach.
>*#[》,`《]#·<  
关注我们的新浪微博!
"Without leaps of imagination, or dreaming, we lose the excitement of possibilities. Dreaming, after all, is a form of planning."-- Gloria Steinem

在缺少运营商支持的情况下,IMAP IDLE应该是最好的解决方案。emoze和profimail都是。

TOP

在缺少运营商支持的情况下,IMAP IDLE应该是最好的解决方案。emoze和profimail都是。
Steven 发表于 2009-7-15 23:34


但是这篇文章的意思似乎是在技术上IMAP IDLE就强:

数据流量小
更快更实时。
>*#[》,`《]#·<  
关注我们的新浪微博!
"Without leaps of imagination, or dreaming, we lose the excitement of possibilities. Dreaming, after all, is a form of planning."-- Gloria Steinem

TOP

IMAP IDLE 模式是 IMAP 协议的一项高级功能,在这种模式下,客户端登录连接服务器后并无主动查询新邮件的动作,而是停留在 IDLE(空闲) 状态,当服务器接收到新邮件后通知客户端,客户端再开始查询新邮件的动作,此动作完成后,客户端重新回到空闲状态。使用 IMAP IDLE 模式的好处是,服务器收到新邮件时客户端马上就会收到通知
不支持 IMAP IDLE 的客户端或者服务器,检查新邮件是靠客户端手动刷新或者定期查询(比如每5分钟),这种方式查询新邮件会有时间延迟,如果新邮件没有赶上上次查询,必须等到客户端下次查询时才能收到通知
IMAP IDLE 和 Push email 还是有区别的,Push email 是服务器主动把邮件推送到客端;而 IMAP IDLE 是客端主动登录服务器并保持连接才可以,用电话作例子来说,IMAP IDLE 就像是客户端打电话到服务器后进入待机状态等待服务器回答,而 Push email 则是服务器直接打电话给客户端
Gmail 目前并不支持 Push email,需要通过第三方支持才能实现 Push email 的功能,这是因为 Gmail 在客户端没有登录的情况下不知道如何把邮件推送到你的手机;如果使用 IMAP IDLE 功能,服务器只会通知客户端有新邮件,而下载新邮件的工作还是客户端完成的,并且这个过程中客端必须一直保持与服务器的连接才能收到通知进而完成下载邮件的工作,严格说这并不是 Push————这是我几个月前发现Profimail有这个功能时查到的
[手机3G坛发帖]
@lucyfour

TOP

IMAP IDLE诞生已久, 对于手机来说, 这是不需要运营商或第三方介入最佳的移动邮件解决方案之一. 但是IMAP IDLE主要有3个缺点:
1. 效率不高, IDLE只是起到通知的作用, 具体的邮件体收取动作仍然由手机发起完成. IMAP在邮件收取上没有一些Pushmail服务提供商的私有协议高效, 主要表现在传输过程的数据包压缩率上.
2. 在3G之前的网络中, 长时间保持在线会影响用户的通话以及短信收发, 因此Pushmail服务提供商所提供的短信触发功能更加实用.
3. IMAP IDLE会对邮件服务器造成巨大的压力.
Failure: The Secret to Success

TOP

但是这篇文章的意思似乎是在技术上IMAP IDLE就强:

数据流量小
更快更实时。
streetsmart 发表于 2009-7-15 23:46


真正的push应该在省电方面要强些

TOP

本帖最后由 lucyfour 于 2009-7-16 00:38 编辑

对于这个技术,我发现很多索爱的非智能机的参数上都写有支持IMAP IDLE这个协议,这两年我没用过索爱的机,不知道是不是真的也能实现这样收邮件。楼上说的第二个缺点,确实是,只有属于GPRS A类型的手机才能同时上网和电话短信两不误,也就是说电话短信的时候上网连接不断开(≠)。而现在的手机大多数是GPRS B类型的,就算手机是GPRS A类,运营商的通讯基站只不支持GPRS A的话,也是不能做到的。我平时上网时就经常有朋友说打不进我电话。
[手机3G坛发帖]
@lucyfour

TOP

还是很不错的服务。真想转到wcdma去,可惜不能保号。
遗憾目前网络状态下这种idle肯定会影响电话及短信
[手机3G坛发帖]
泡MM就像挂QQ一样,每天至少两小时,达到一定的天数后就可以太阳了!

TOP

目前支持IMAP IDLE协议的手机很多, S60基本上都支持, 只是自带的邮件使用界面实在简陋到令人发指的地步.
Failure: The Secret to Success

TOP

运营商支持的还是最理想的。实际上就是来了邮件给手机一个短信,手机收到后连接邮件服务器收信。
非短信通知的方案,如果可以idle,有可能接近这个效果。
但是在省电和实时这两方面,应该不会超越。

TOP

IMAP idle肯定不是最好的pushmail方案。短信触发的最优,如Blackberry,139邮箱,省电推送速度快,而且不影响电话接入。其次是心跳音,如Exchange Activesync,接下来才是IMAP IDLE。
此人很懒,什么也没留下

TOP

这个解疑了。
另,3G上网时或是有数据流量时应该就不影响通话吧?
>*#[》,`《]#·<  
关注我们的新浪微博!
"Without leaps of imagination, or dreaming, we lose the excitement of possibilities. Dreaming, after all, is a form of planning."-- Gloria Steinem

TOP

IDLE是非运营商或第三方中转的最佳方案之一, Exchange搭建成本太高.
短信触发一般都会需要通过运营商或第三方服务, 这个在大规模运营的时候是一块不小的成本.
考虑到3G下便宜的流量资费, 在国外多数第三方中转都避免使用短信触发方式, 来降低用户的使用成本. 这么说吧, Nokia Messaging也支持短信触发, 只是你不知道而已.

3G下语音和数据有单独的信道, 互不干扰, 也就是说你在打电话的同时照样能够上网.
Failure: The Secret to Success

TOP

对了, 补充一下, 如果碰到某些邮件达人, 每天邮件超多的那种, 譬如我的Gmail每天的邮件数量都在100以上, 那么短信触发不见得就比IDLE好用.
Failure: The Secret to Success

TOP

这个解疑了。
另,3G上网时或是有数据流量时应该就不影响通话吧?
streetsmart 发表于 2009-7-16 08:34
看precentral的反馈,大多数evdo(包括Pre)都没法在通话时保持数据连接

TOP

对了, 补充一下, 如果碰到某些邮件达人, 每天邮件超多的那种, 譬如我的Gmail每天的邮件数量都在100以上, 那么短信触发不见得就比IDLE好用.
handspring 发表于 2009-7-16 09:32
为什么这么说?bb定位的大多数都是重度邮件用户吧?但bes还是选择了通过运营商通知取信

TOP

HS现身,强烈反应:nokia messaging不能用了!!!!
紧密围绕在以老王为中心的玩JJ大旗下,保持可持续性发烧。

TOP

一直用E71内置邮件的IMAP IDLE 连接公司邮箱,非常好用。也不怎么发现有影响电话和短信,影响的时候都是在大数据下载或者听internet radio的时候

TOP

原帖由 billjin 于 09-7-16 11:45 发表
一直用E71内置邮件的IMAP IDLE 连接公司邮箱,非常好用。也不怎么发现有影响电话和短信,影响的时候都是在大数据下载或者听internet radio的时候
自带的那个也支持IDLE?不是定时查收?
[手机3G坛发帖]
@lucyfour

TOP

支持,不过没法直接浏览HTML文件·~
Nokia Massege现在下载了没激活跟自带的邮件系统一个样子!
天天喜欢泡堂会的男人~~任玩堂~!

TOP

3G下,相信非短信触发的push的效果,
可以优化到很接近短信触发的方式。

TOP

省电,快捷,安全~~~
还是Blackberry~~
目前还没见过有超过他的
天天喜欢泡堂会的男人~~任玩堂~!

TOP

看precentral的反馈,大多数evdo(包括Pre)都没法在通话时保持数据连接
logout 发表于 2009-7-16 10:38

Yes, 我说的3G是指WCDMA以及HSDPA, CDMA2000网络的机制不同, 从1x开始就存在此问题. 所以在CDMA网络上, 还是会延用短信触发的方式.
Failure: The Secret to Success

TOP

为什么这么说?bb定位的大多数都是重度邮件用户吧?但bes还是选择了通过运营商通知取信
logout 发表于 2009-7-16 10:40

BES的方式是从2G网络延用下来的, 但不论是短信触发还是用户长时间在线, 用户体验上差别不大. 只是使用短信触发成本较高, 也只有BB这么高的月费才能负担得起.
实际上你去看RIM的3G终端策略, 他是所有的手机厂商里推出3G手机最晚的之一, 大概就比iPhone 3G早一点. 因为单纯使用邮件的话, BB终端对3G的需求没那么大.
Failure: The Secret to Success

TOP

HS现身,强烈反应:nokia messaging不能用了!!!!
aseityleo 发表于 2009-7-16 11:10

这个嘛, 我可以去帮你问问.
不过Nokia Messaging未来的方向是和手机绑定的, 我猜测是因为Nokia没打算在中国推广这个服务, 所以相关的短信收不到了. 我记得先前激活的时候, 那些短信都是从HK发过来的, 成本叫那个高啊.
Failure: The Secret to Success

TOP

对于短信触发或保持连线方式电力消耗的对比, 内部曾经做过评估, 结论如下:
According to our past experience, because creating the PDP context is so power-hungry (about the same as establishing a call), a permanent TCP connection is more power-efficient for users who are getting about 15-20 emails per day.

Ideally, when SMS push is available for a carrier, users who have statistically sent/received more than 20 emails daily should automatically be switched to TCP push and vice-versa.
1

评分人数

Failure: The Secret to Success

TOP

对于短信触发或保持连线方式电力消耗的对比, 内部曾经做过评估, 结论如下:
According to our past experience, because creating the PDP context is so power-hungry (about the same as establishing a call), a  ...
handspring 发表于 2009-7-16 17:24
那每5分钟或10分钟建立一次连接pull邮件是不是消耗更多?Nokia Messaging除了及时更新以外最短只能以1小时为间隔收取邮件是不是出于这种考虑?

TOP

creating the PDP context
指的是什么动作?接受短信还是连接到3g网络?

TOP

PDP context是GPRS下的吧?

TOP

换句话说creat a PDP context connection指的是接受短信?

那日本的运营商在3g网络下用短信推送不是脑残吗?

换句话说说我停掉运营商的pushmail,打开gmail自带的push会更省电?

TOP

返回列表