7.8 无线与移动性:对高层协议的影响#
7.8 Wireless and Mobility: Impact on Higher-Layer Protocols
在本章中,我们已经看到无线网络在链路层(由于无线信道特性如衰落、多路径传播和隐藏终端)和网络层(由于移动用户更换其在网络中的连接点)与有线网络有显著差异。但在传输层和应用层是否也存在重要差异呢?人们很容易认为这些差异是微小的,因为网络层在有线和无线网络中都向上层提供相同的尽力而为的传输服务模型。同样,如果像TCP或UDP这样的协议在有线和无线网络中都用于向应用提供传输层服务,那么应用层也应该不受影响。从某种意义上来说,这种直觉是正确的——TCP和UDP确实能够(并且确实)在具有无线链路的网络中工作。但另一方面,从性能角度来看,传输协议,特别是TCP,在有线和无线网络中的表现可能大相径庭,差异正体现在这一层。让我们来看原因。
回顾一下,TCP在发送方与接收方之间的路径中某个段丢失或损坏时会重传该段。对于移动用户而言,丢失可能由于网络拥塞(路由器缓存溢出)或由于切换(例如,在将段重新路由至移动用户的新连接点时的延迟)造成。在所有情况下,TCP的接收方向发送方发送ACK只是表示某个段未被完整接收;发送方并不知道该段是因拥塞、切换,还是检测到的比特错误而丢失的。在所有情况下,发送方的响应都是相同的——重传该段。TCP的拥塞控制响应也在所有情况下相同——TCP减少其拥塞窗口,如 第3.7节 所讨论的那样。通过无条件减少其拥塞窗口,TCP隐含地假设段的丢失源于拥塞,而非损坏或切换。如我们在 第7.2节 所看到的,无线网络中的比特错误远比有线网络中常见。当这种比特错误或切换丢失发生时,其实并没有必要让TCP发送方减少其拥塞窗口(进而降低发送速率)。事实上,很可能路由器的缓存是空的,数据包在端到端路径上畅通无阻。
研究人员在1990年代初中期意识到,考虑到无线链路上的高比特错误率以及可能的切换丢包,TCP的拥塞控制响应在无线环境中可能存在问题。为了解决这个问题,有三大类方法可以考虑:
本地恢复。本地恢复协议在比特错误发生的地方(例如无线链路)进行恢复,例如我们在 第7.3节 中研究的802.11 ARQ协议,或者使用ARQ与FEC相结合的更复杂方法 [Ayanoglu 1995]。
TCP发送方感知无线链路。在本地恢复方法中,TCP发送方对其段正通过无线链路传输一无所知。另一种方法是让TCP发送方和接收方能够感知无线链路的存在,区分有线网络中的拥塞丢包和无线链路上的损坏/丢包,仅在响应有线网络中的拥塞丢包时启动拥塞控制。[Balakrishnan 1997] 探讨了多种类型的TCP,假设终端系统可以做出这种区分。[Liu 2003] 研究了区分端到端路径中有线段和无线段上丢包的技术。
连接分离方法。在连接分离方法中 [Bakre 1995],移动用户与另一端之间的端到端连接被分为两个传输层连接:一个从移动主机到无线接入点,另一个从无线接入点到通信另一端点(这里假设是有线主机)。因此,端到端连接由无线段和有线段串联组成。无线段上的传输层可以是标准的TCP连接 [Bakre 1995],也可以是在UDP之上的专用错误恢复协议。[Yavatkar 1994] 探讨了在无线连接上使用传输层选择重传协议。[Wei 2006] 中的测量结果表明,在蜂窝数据网络中广泛使用了连接分离TCP,并且通过使用连接分离TCP确实可以实现显著的性能提升。
我们在此对无线链路上的TCP处理进行了简要讨论。关于无线网络中TCP挑战与解决方案的深入综述可见 [Hanabali 2005;Leung 2006]。我们鼓励读者查阅这些参考文献,了解这一研究领域的详细内容。
在讨论完传输层协议之后,让我们看看无线与移动性对应用层协议的影响。这里的一个重要考虑是,如我们在 图 7.2 中所见,无线链路通常带宽较低。因此,运行在无线链路(特别是蜂窝无线链路)上的应用必须将带宽视为一种稀缺资源。例如,一个Web服务器在为运行在4G手机上的Web浏览器提供内容时,可能无法提供与为有线连接上的浏览器提供的图像丰富内容相同的服务。尽管无线链路在应用层带来了挑战,但它所支持的移动性也使得丰富的基于位置和上下文感知的应用成为可能 [Chen 2000;Baldauf 2007]。更广泛地说,无线与移动网络将在实现未来无处不在的计算环境方面发挥关键作用 [Weiser 1991]。可以公平地说,我们至今仅看到无线与移动网络对网络应用及其协议影响的冰山一角!
In this chapter, we’ve seen that wireless networks differ significantly from their wired counterparts at both the link layer (as a result of wireless channel characteristics such as fading, multipath, and hidden terminals) and at the network layer (as a result of mobile users who change their points of attachment to the network). But are there important differences at the transport and application layers? It’s tempting to think that these differences will be minor, since the network layer provides the same best-effort delivery service model to upper layers in both wired and wireless networks. Similarly, if protocols such as TCP or UDP are used to provide transport-layer services to applications in both wired and wireless networks, then the application layer should remain unchanged as well. In one sense our intuition is right—TCP and UDP can (and do) operate in networks with wireless links. On the other hand, transport protocols in general, and TCP in particular, can sometimes have very different performance in wired and wireless networks, and it is here, in terms of performance, that differences are manifested. Let’s see why.
Recall that TCP retransmits a segment that is either lost or corrupted on the path between sender and receiver. In the case of mobile users, loss can result from either network congestion (router buffer overflow) or from handoff (e.g., from delays in rerouting segments to a mobile’s new point of attachment to the network). In all cases, TCP’s receiver-to-sender ACK indicates only that a segment was not received intact; the sender is unaware of whether the segment was lost due to congestion, during handoff, or due to detected bit errors. In all cases, the sender’s response is the same—to retransmit the segment. TCP’s congestion-control response is also the same in all cases—TCP decreases its congestion window, as discussed in Section 3.7. By unconditionally decreasing its congestion window, TCP implicitly assumes that segment loss results from congestion rather than corruption or handoff. We saw in Section 7.2 that bit errors are much more common in wireless networks than in wired networks. When such bit errors occur or when handoff loss occurs, there’s really no reason for the TCP sender to decrease its congestion window (and thus decrease its sending rate). Indeed, it may well be the case that router buffers are empty and packets are flowing along the end-to-end path unimpeded by congestion.
Researchers realized in the early to mid 1990s that given high bit error rates on wireless links and the possibility of handoff loss, TCP’s congestion-control response could be problematic in a wireless setting. Three broad classes of approaches are possible for dealing with this problem:
Local recovery. Local recovery protocols recover from bit errors when and where (e.g., at the wireless link) they occur, e.g., the 802.11 ARQ protocol we studied in Section 7.3, or more sophisticated approaches that use both ARQ and FEC [Ayanoglu 1995].
TCP sender awareness of wireless links. In the local recovery approaches, the TCP sender is blissfully unaware that its segments are traversing a wireless link. An alternative approach is for the TCP sender and receiver to be aware of the existence of a wireless link, to distinguish between congestive losses occurring in the wired network and corruption/loss occurring at the wireless link, and to invoke congestion control only in response to congestive wired-network losses. [Balakrishnan 1997] investigates various types of TCP, assuming that end systems can make this distinction. [Liu 2003] investigates techniques for distinguishing between losses on the wired and wireless segments of an end-to-end path.
Split-connection approaches. In a split-connection approach [Bakre 1995], the end-to-end connection between the mobile user and the other end point is broken into two transport-layer connections: one from the mobile host to the wireless access point, and one from the wireless access point to the other communication end point (which we’ll assume here is a wired host). The end-to-end connection is thus formed by the concatenation of a wireless part and a wired part. The transport layer over the wireless segment can be a standard TCP connection [Bakre 1995], or a specially tailored error recovery protocol on top of UDP. [Yavatkar 1994] investigates the use of a transport-layer selective repeat protocol over the wireless connection. Measurements reported in [Wei 2006] indicate that split TCP connections are widely used in cellular data networks, and that significant improvements can indeed be made through the use of split TCP connections.
Our treatment of TCP over wireless links has been necessarily brief here. In-depth surveys of TCP challenges and solutions in wireless networks can be found in [Hanabali 2005; Leung 2006]. We encourage you to consult the references for details of this ongoing area of research.
Having considered transport-layer protocols, let us next consider the effect of wireless and mobility on application-layer protocols. Here, an important consideration is that wireless links often have relatively low bandwidths, as we saw in Figure 7.2. As a result, applications that operate over wireless links, particularly over cellular wireless links, must treat bandwidth as a scarce commodity. For example, a Web server serving content to a Web browser executing on a 4G phone will likely not be able to provide the same image-rich content that it gives to a browser operating over a wired connection. Although wireless links do provide challenges at the application layer, the mobility they enable also makes possible a rich set of location-aware and context-aware applications [Chen 2000; Baldauf 2007]. More generally, wireless and mobile networks will play a key role in realizing the ubiquitous computing environments of the future [Weiser 1991]. It’s fair to say that we’ve only seen the tip of the iceberg when it comes to the impact of wireless and mobile networks on networked applications and their protocols!