Unit 7
Unit 7
7.0 INTRODUCTION
Mobile devices provide many services to the end user such as email, messages, apps,
navigation, online gaming, online trading and such. All the mobile apps that interact over
the network is facilitated by the transport layer which manages the data transmission
from source port to the destination port.
In this unit we describe the transport layer protocols such as TCP and UDP.
7.1 OBJECTIVES
After going through this unit, you should be able to
understand key concepts of UDP and TCP,
understand the main use cases for UDP and TCP,
understand the concepts and use cases for Indirect TCP,
understand the concepts and use cases for snooping TCP,
understand the concepts and use cases for mobile TCP.
In this section we examine the key features, use cases and differences between UDP and
TCP.
7.2.1 UDP
UDP is a connectionless transport layer protocol. UDP is used for faster transmission of
data across two computers. It is unreliable as it does not wait for acknowledgement from
the receiver. UDP also saves the bandwidth as it does not depend on the
acknowledgement. Each of the UDP segments are handled individually and use
independent paths to reach the destination.
UDP is faster as it starts transmitting the data packets (called datagrams) to the target
computer without waiting for the handshake and acknowledgement. This process makes
the UDP faster but unreliable.
1
Mobile Transport Layer We have depicted the UDP data transmission in Figure 1.
As depicted in Figure 1, the requestor sends the request and sender sends the response
data continuously. As the missed datagrams are not re-transmitted, the requestor has to
devise methods to handle the data loss or duplicate data.
UDP Packet
We have depicted a UDP packet in Figure 2. The UDP header is 8 bytes long and has
following details –
Checksum provides metadata of header and UDP data and is used for checking data
integrity.
UDP Scenarios
Given below are the use cases and scenarios where UDP is used –
The time sensitive applications such as video streaming apps (such as video
broadcast applications), audio streaming apps, Voice Over IP (VoIP), live
conference, screen sharing applications, and others rely on UDP as the minor data
loss is acceptable in such scenarios.
High speed, low latency applications such as online gaming applications use UDP.
2
Mobile Computing
DHCP (Dynamic Host Configuration Protocol), NTP, DNS use UDP protocol.
Real time application such as stock ticker application also uses UDP
Risks
UDP can also be exploited by hackers for Denial of service (DoS) attack wherein they
flood the target computers to exhaust its resources.
7.2.2 TCP
We have given the detailed steps of how TCP works in transmitting the data –
1. TCP segregates the data into various packets and provides a sequence number to the
packets.
3. At the destination, the packets are re-assembled based on the sequence number and
transmits it further. TCP acknowledges the arrived packets.
4. TCP handles re-transmission of the lost packets, dropped packets or garbled packets
to provide error-free transmission.
We have depicted the TCP handshake in Figure 3. Post passive open the active open
connection involves three-way handshake –
1. The client sends its data segment with the sequence number (for instance A).
2. The server then sends its sequence number with the acknowledgement. (for instance
A+1)
3. Once the client receives the acknowledgement for its segment, the client sends the
acknowledgement to the server.
3
Mobile Transport Layer
TCP specifies the order in which the data packets need to be sent. If any of the packets
are missed out, then TCP requests for the packet to be resent and hence it is more
reliable than UDP.
Features of TCP
Segment number – All the transmitted or received segments are tracked by TCP
using segment numbers.
Flow control – The data transfer rate of the sender is controlled by flow control. The
receiver uses sliding window to specify the data transfer for the reliable delivery.
Error control – Each of the transferred segments are checked for errors to ensure
reliable delivery. Duplicate segments, lost segment or out of order segments are
detected using error control.
Congestion control – TCP considers the network congestion during routing. TCP
eliminates the network congestion using congestion avoidance algorithms such as
Slow Start, Timeout React, Additive increase, Multiplicative Decrease and such.
TCP scenarios
TCP is used for use cases that require secure and reliable data transmission. Given below
are the ideal TCP use cases and workload scenarios –
File transfer protocol (FTP) for securely and reliably transferring the files
The table 1 provides the key differences between TCP and UDP
TCP UDP
5
Mobile Transport Layer
7.3 INDIRECT TCP
Traditional TCP does not perform well on the wireless network. In addition to that we
cannot change a TCP within a fixed network. Indirect TCP addresses these two issues.
Indirect TCP segments the TCP connection into wireless and fixed parts as depicted in
figure 2.
Given below are the salient features of the Indirect TCP as depicted in Figure 2 –
The mobile host is connected via wireless TCP to access point and access point is
connected through wired connection to the host.
The access point is also connected to the fixed computer through standard TCP as
well. The fixed computer acts as corresponding host.
The access point terminates the standard TCP and acts as proxy for fixed computer to
the mobile host. The access point relays information in both the directions (from
mobile host to the fixed computer and from the fixed computer to the mobile host.)
The access point manages the mobility of the mobile device. It hands over the mobile
host to the next access point when the mobile host changes location.
The fixed computer is not aware of the segmentation as the access point acts as a
proxy.
When the fixed computer sends the data packet, the access point acknowledges it and
relays it to the mobile host. The mobile host sends the acknowledgement which is
received by the access point.
If the data packet is lost between mobile host and the access point, the access point
retransmits the packet (when it does not receive the acknowledgement from the
mobile host).
When the mobile host sends the data packet to the access point the access point sends
the acknowledgement to the mobile host. When a transmission error happens, the
mobile host notices it and resends the packet.
The access point forwards the data packet to the fixed computer through the wired
network. Any transmission errors in this delivery is handled by the access point.
6
Mobile Computing
During the handover of the mobile host from one access point to another, the state
(sequence number, acknowledgement and others) is migrated to the new access point.
The fixed computer does not see any changes. We have depicted the process in figure 3.
The corresponding host (fixed computer) is abstracted from the changes to the
mobile host and hence can work seamlessly.
The indirect TCP is easy to manage and control as there is a single hop between
mobile host and the access point.
The indirect TCP is fault tolerant as the transmission error between mobile host and
the access point does not propagate to the wired connection. When the transmission
error happens between mobile host and the access point, the mobile host detects it
quickly and retransmits the packet.
7
Mobile Transport Layer
The access point (foreign agent) buffers all the data that needs to be sent to the
mobile host.
The access point also snoops the acknowledgments and data packet flow in both the
directions.
The access point buffers each data packet till an acknowledgement is received.
If the access point does not receive the acknowledgement from the mobile host, it
retransmits the data packet from the buffer. The buffering improves the data
transmission performance as compared to the retransmission from the corresponding
node.
The access point does not acknowledge the transmission to the corresponding node
but filters the duplicate acknowledgements to avoid the duplicate data transmission
from the corresponding node.
In case of failure of access point, the corresponding node triggers the data packet
retransmission when the access point times out.
When the mobile host transmits the data to the corresponding node, the flow is as
follows :
The access point snoops the packets transmitted from the mobile host.
If the sequence number is not correct or if any of the data packets is missing, the
access point sends negative acknowledgement to the mobile host.
The access point transparently handles migration of mobile to the new location.
Mobile TCP splits the traffic into two parts. The standard TCP is used for connection
between supervisory host and the corresponding node. The optimized TCP is used
between mobile host and the supervisory host. In the mobile TCP the supervisory host
assumes the role of a proxy in the Indirect TCP by transmitting the data on both the ends.
We have depicted the mobile TCP in Figure 5.
As the wireless link has low bit error rate, the supervisory host does not cache or
buffer the data.
When the packet is lost during transmission to the mobile host, the corresponding
node has to retransmit the data packet.
The supervisory host monitors the packets sent to the mobile host. The supervisory
host forwards the acknowledgements to the mobile host.
If the supervisory host does not receive an acknowledgement from the mobile host, it
is assumed that mobile host is disconnected.
The supervisory host sets the corresponding node’s window size to 0 to make the
sender go into persistent state. This ensures that sender’s state will not change even
though the mobile host is disconnected for extended duration.
In the persistent state, the sender will not retransmit the data when the mobile host is
disconnected for extended duration.
When the mobile host becomes active, the supervisory host reopens the window and
sets it to the old value of the corresponding node.
The corresponding node can start transmitting the data to the mobile host.
The mobile host uses optimized TCP to recover from packet loss quickly.
9
Mobile Transport Layer Advantages of mobile TCP
The mobile TCP maintains the end to end TCP semantics as the supervisory host
does not send any acknowledgement itself but forwards the acknowledgement to the
mobile host.
When the mobile host is disconnected, the mobile TCP eliminates unnecessary data
retransmissions by setting the sender’s window to 0.
As the supervisory host does not buffer any data, there is no need to migrate the
buffer data to the new supervisory host.
7.6 SUMMARY
UDP is a connectionless transport layer protocol. UDP is unreliable as it does not wait
for acknowledgements and is used for faster transmission of data. In UDP, the requestor
sends the request and sender sends the response data continuously. UDP header consists
of source port, destination port, length and checksum. Streaming, low latency
applications, multicast, DNS servers, DHCP are use cases for UDP. Transmission
Control Protocol (TCP) is a connection oriented, full-duplex data transmission protocol
that provides assured delivery, reliability. TCP handles re-transmission of the lost
packets, dropped packets or garbled packets to provide error-free transmission. The
three-way handshake of TCP involves Syn, Syn ack and ack. Segment number, flow
control, error control, congestion control are key advantages of TCP. TCP header
consists of Source port address, destination port address, sequence number,
acknowledgement number, HLEN, control flags, window size, checksum and urgent
pointer. SSH, File transfer protocol (FTP), SMTP, HTTP are main scenarios for TCP.
Indirect TCP segments the TCP connection into wireless and fixed parts. The snooping
TCP that enhances the TCP maintains the end to end TCP connection intact. Snooping
TCP buffers the data at the access point and retransmits the data during the packet loss.
In snooping TCP, the access point snoops the acknowledgments and data packet flow in
both the directions. The mobile TCP aims to make the window size to zero and handle
the mobile host getting disconnected. Mobile TCP splits the traffic into two parts. The
standard TCP is used for connection between supervisory host and the corresponding
node.
7.7 SOLUTIONS/ANSWERS
11