0% found this document useful (0 votes)
7 views

Unit 7

The document discusses various transport layer protocols used in mobile computing. It describes UDP and TCP protocols, including their features, packet structure, and use cases. It also covers concepts like indirect TCP, snooping TCP, and mobile TCP.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
7 views

Unit 7

The document discusses various transport layer protocols used in mobile computing. It describes UDP and TCP protocols, including their features, packet structure, and use cases. It also covers concepts like indirect TCP, snooping TCP, and mobile TCP.
Copyright
© © All Rights Reserved
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 11

Mobile Computing

UNIT 7 MOBILE TRANSPORT LAYER


Structure
7.0 Introduction
7.1 Objectives
7.2 UDP and TCP
7.2.1 UDP
7.2.2 TCP
7.3 Indirect TCP
7.4 Snooping TCP
7.5 Mobile TCP
7.6 Summary
7.7 Solutions/Answers
7.8 Further Readings

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.

7.2 UDP AND TCP


User datagram protocol (UDP) and Transmission control protocol (TCP) are the main
transmission protocols for data transmission.

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 –

 Source Port provides details of source port in 16-bit field.

 Destination Port provides details of destination port in 16-bit field.

 Length provides length of the UPD in 16-bit field.

 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

 DNS servers rely on UDP for faster data transmission.

 DHCP (Dynamic Host Configuration Protocol), NTP, DNS use UDP protocol.

 Real time application such as stock ticker application also uses UDP

 Multi-cast application such as trading platforms use 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

Transmission Control Protocol (TCP) is a connection oriented, full-duplex data


transmission protocol that provides assured delivery, reliability. As TCP is connection
oriented, the connection between the sender and receiver has to be established prior to the
data transmission. TCP breaks down the message in various packets and sends them to
the destination. TCP ensures the correct ordering of the data and identifies each machine
on the network with a unique IP address. TCP guarantees the delivery of the packets. In
the Open Systems Interconnection (OSI) model, TCP covers the layer 4, transport layer
and layer 5, session layer.

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.

2. TCP transmits these packets to the destination.

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

Given below are the main 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 Packet Structure

We have depicted the TCP packet structure in Figure 1

Figure 1 TCP Packet Structure

The TCP header has following details –


 Source port address provides the address of the source port that sends the data.
 Destination port address provides the address of the destination port that receives the
data.
 Sequence number specifies the sequence of the data bytes for a specific session.
 Acknowledgement number specifies the next sequence number by the receiver. For
instance when the receiver receives the data with sequence number ‘A’, then the
receiver responds with ‘A+1’ as the acknowledgement number.
4
Mobile Computing

 HLEN specifies the header length.


 URG, ACK, PSH, RST, SYN, FIN are the six control flags that control the
connection and data transmission.
 Window size specifies the data size that receiver can accept. It is used in flow
control.
 Checksum is the mandatory field for TCP and is used for error checking of TCP
header, TCP payload and IP pseudo-header.
 Urgent pointer indicates the last urgent data byte.

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 –

 Secure shell (SSH) for doing remote secure login

 File transfer protocol (FTP) for securely and reliably transferring the files

 Simple mail transfer protocol (SMTP) for sending out emails

 HTTP/HTTPS for viewing web data securely.

Differences between TCP and UDP

The table 1 provides the key differences between TCP and UDP

TCP UDP

Reliability Reliable due to the handshake, Unreliable as there is no


acknowledgement, acknowledgement, retransmission
retransmission and timeout. and timeout.
Message Messages are ordered The delivery message order is not
ordering guaranteed.
Bandwidth Heavyweight as TCP needs Lightweight as there is no
requirement three packets to setup the acknowledgement or ordering
connection
Broadcast and Not supported Supported
multicast
Speed Relatively slow due to three- Faster
way handshake

 Check Your Progress 1


1. ____ is a connectionless transport layer protocol.
2. UDP header consists of ______ .
3. Streaming applications use _________ protocol.
4. When the data packets are lost or garbled, TCP performs _______.
5. In TCP, the transmitted or received segments are tracked by ______
6. ______ is used for error checking in TCP header.

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.

Figure 2 Indirect TCP

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 connection is segmented at access point.

 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.

Figure 3 Location change of mobile host

Advantages of Indirect TCP

Given below are the main advantages of indirect TCP –

 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.

 Existing TCP protocol can be used without any changes.

7.4 SNOOPING TCP


One of the main challenges with the indirect TCP is that the TCP connection is
segmented in the end to end network. As the mobile host uses wireless
connection to access point and then access point uses wired connection to the
fixed computer, the end to end TCP semantics is impacted.
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. We have depicted the snooping TCP
in Figure 4.

7
Mobile Transport Layer

Figure 4 Snooping TCP

Given below are the steps of snooping TCP –

 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 mobile host then retransmits the missing packets

 The packets are ordered at the fixed computer by TCP.

Snooping TCP advantages

Given below are the main advantages of the snooping TCP –

 The end to end TCP connection is preserved.

 The access point transparently handles migration of mobile to the new location.

 The enhancements can be transparently handled at the access point level.


 The timeout of access point is handled by the corresponding node.
8
Mobile Computing

7.5 MOBILE TCP


The mobile TCP aims to make the window size to zero and handle the mobile host
getting disconnected. Mobile TCP targets to improve the overall throughput and reduce
the overall latency and to provide efficient handover while maintaining the end to end
TCP semantics. Mobile TCP also addresses the problem with lengthy disconnections.

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.

Figure 5 Mobile TCP

The steps of the mobile TCP are as follows -

 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

Given below are the main 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.

 Check Your Progress 2


1. Indirect TCP segments the TCP connection into __________
2. Mobile host is connected to the access point through _______ in indirect TCP.
3. _____ acts as proxy in indirect TCP.
4. In the snooping TCP, the data is _______ at access point which is retransmitted
during packet loss.
5. In the mobile TCP, ___________ is used between mobile host and the
supervisory host.

7.7 SOLUTIONS/ANSWERS

Check Your Progress 1


1. UDP
10
Mobile Computing

2. source port, destination port, length and checksum


3. UDP
4. packet retransmission
5. segment numbers
6. checksum
Check Your Progress 2
1. wireless and fixed parts
2. wireless TCP
3. Access point
4. Buffered
5. optimized TCP

7.8 FURTHER READINGS


References

Mobile Computing 3rd Edition by Raj Kamal - https://www.amazon.in/Mobile-


Computing-Raj-Kamal/dp/0199455414

11

You might also like