Вы находитесь на странице: 1из 44

Mobile Computing

Unit I Introduction
Mobile Computing Mobile Computing Vs wireless Networking Mobile Computing
Applications Characteristics of Mobile computing Structure of Mobile Computing
Application. MAC Protocols Wireless MAC Issues Fixed Assignment Schemes Random
Assignment Schemes Reservation Based Schemes.
Unit II Mobile Internet Protocol and Transport Layer
Overview of Mobile IP Features of Mobile IP Key Mechanism in Mobile IP route
Optimization. Overview of TCP/IP Architecture of TCP/IP- Adaptation of TCP Window
Improvement in TCP Performance.
Unit III Mobile Telecommunication System
Global System for Mobile Communication (GSM) General Packet Radio Service
(GPRS) Universal Mobile Telecommunication System (UMTS)
Unit IV Mobile Ad hoc Networks
Ad-Hoc Basic Concepts Characteristics Applications Design Issues Routing
Essential of Traditional Routing Protocols Popular Routing Protocols Vehicular Ad Hoc
networks ( VANET)MANET Vs VANET Security.
Unit V Mobile Platforms and Applications
Mobile Device Operating Systems Special Constrains & Requirements Commercial
MobileOperating Systems Software Development Kit: iOS, Android, BlackBerry, Windows
Phone-M-commerece- Structure Pros & Cons Mobile Payment System Security Issues.
References:
Prasant Kumar Pattnaik, Rajib Mall, Fundamentals of Mobile Computing, PHI Learning Pvt.
Ltd, New Delhi 2012.
Jochen H. Schller, Mobile Communications, Second Edition, Pearson Education, New Delhi,
2007.
Dharma Prakash Agarval, Qing and An Zeng, "Introduction to Wireless and Mobile systems",
Thomson Asia Pvt Ltd, 2005.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 1

Uwe Hansmann, Lothar Merk, Martin S. Nicklons and Thomas Stober, Principles of Mobile
Computing, Springer, 2003.
William.C.Y.Lee,Mobile Cellular Telecommunications-Analog and Digital Systems, Second
Edition,Tata Mc Graw Hill Edition ,2006.
C.K.Toh, AdHoc Mobile Wireless Networks, First Edition, Pearson Education, 2002.
Android Developers : http://developer.android.com/index.html
Apple Developer : https://developer.apple.com/
Windows Phone Dev Center : http://developer.windowsphone.com
BlackBerry Developer : http://developer.blackberry.com/

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 2

Unit I Introduction
1.1 Mobile Computing
Mobile Computing is a technology that allows transmission of data, voice and video via a
computer or any other wireless enabled device without having to be connected to a fixed
physical link.
The main concept involves Mobile communication, Mobile hardware, Mobile software.
Mobile communication

The mobile communication refers to the infrastructure put in place to ensure that
seamless and reliable communication goes on.

It include devices such as protocols, services, bandwidth, and portals necessary to


facilitate and support the stated services.

The data format is also defined at this stage. This ensures that there is no collision with
other existing systems which offer the same service.

Since the media is unguided/unbounded, the overlaying infrastructure is basically radio


wave-oriented. That is, the signals are carried over the air to intended devices that are
capable of receiving and sending similar kinds of signals.

Mobile Hardware

Mobile hardware includes mobile devices or device components that receive or access the
service of mobility.

It would range from portable laptops, smartphones, tablet PCs, Personal Digital
Assistants.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 3

Mobile software

Mobile software is the actual program that runs on the mobile hardware.

It deals with the characteristics and requirements of mobile applications.

This is the engine of the mobile device.

In other terms, it is the operating system of the appliance.

It is the essential component that operates the mobile device.

Since portability is the main factor, this type of computing ensures that users are not tied
or pinned to a single physical location, but are able to operate from anywhere.

It incorporates all aspects of wireless communications.

Evolution of communication networks


i.

ii.

iii.

Circuit switching network:


A dedicated channel has to be established before call is made. Channel is reserved
between two users till the connection is alive.
Packet switching network:
No need to establish the connection initially. Channel is available to use by many
users.
Mobile cellular network:
It is categorized into various generations such as 1g, 2g, 3g, etc.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 4

1g

It is the first generation of wireless telephone technology


Came during 1980 and 1990
Speed was up to 2.4kbps
Allows voice calls in one country
Use analog signal
Advanced mobile phone system (AMPS) was first launched in USA in 1g mobile systems

Drawbacks:

Poor voice quality


Poor battery life
No security
Limited capacity

It is based on GSM (Global System for Mobile communications)


Launched in Finland during 1991
Use digital signals
Data speed up to 64 kbps
Features: Enables text messages, picture messages and MMS, better quality and capacity

2g

Drawbacks:

Requires strong digital signals


No network coverage, digital signals would weak
Unable to handle complex data such as video

2.5g

It is the technology between 2g and 3g


It is called 2g cellular technology combined with GPRS (General packet radio service)

Features:

Send/receive email messages


Web browsing
Speed is 64 to 144 kbps
Camera phones

3g
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 5

During 2000
Data transmission speed is 144 Kbps to 2 Mbps

Features:

Faster communication
Send/receive large email messages
High speed web
TV streaming/mobile TV

Started from late 2000s


Basic term to describe it is MAGIC. M stands for mobile multimedia, A stands for
Anytime Anywhere, G stands for Global mobility support, I stands for Integrated
Wireless solution and C stands for Customized Personal Services.
High QoS and high security
Provide any kind of service at any time as per user requirements anywhere

4g

Drawbacks:

Battery usage is more


Hard to implement
Need complicated hardware
Expensive equipment required to implement next generation network

Started from late 2010s


Complete wireless communication with no limitations
Supportable to WWWW (wireless WWW)
Data rate is 1Gbps

5g

Example mobile devices


1. Pager:
Receiver only
Tiny displays
Used for simple text messages
2. Mobile phones:
Can transmit voice, data
Used for simple text displays
3. PDAs (Personal Digital Assistant):
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 6

Has simple graphical displays


Character recognition
Simplified www
4. Palmtop:
Tiny keyboard
Simple versions of standard applications
5. Laptop:
Fully functional
Standard applications

1.2 Mobile Computing Vs wireless Networking


Why we need mobile computing?

Enable anywhere/anytime connectivity


Bring computer communications to areas without pre-existing infrastructure
Enable mobility
Enable new applications
An exciting new research area

Mobile computing is defined as the technology that allows transmission of data, voice and video
via computer or wireless devices. The main advantage of mobile computing is users no need to
sit in a particular place or location. Mobile computing denotes accessing information and
services while we are on move. Wireless networking provides basic communication
infrastructure to make mobile computing possible. Mobile computing is based on wireless
networking. Wireless networking forms one of the necessary components of mobile computing.
Wireless networks appear in various forms such as: i) WLANs, ii) mobile cellular networks, iii)
Personal Area Networks, iv) Adhoc networks.
Wireless networks appear in two forms such as: i) extension of wired networks with the existing
wired infrastructure, ii) ad hoc networks also known as MANET (Mobile Ad hoc Networks).
WSNS (Wireless Sensor Networks) are special type of wireless ad hoc networks.
Wireless networking
X
X

Mobile computing
X

Example
Stationary computers
Notebook in a hotel
Wireless LAN building
PDAs

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 7

1.3 Mobile Computing Applications


Applications of wireless and mobile devices
1. Transmission of news, road condition and weather
2. Personal communication
3. Position via GPS
4. Local adhoc network with vehicles to prevent accidents and act as a guidance system
5. Vehicle data (train) can be transmitted in advance for maintenance and controls
6. Early transmission of patient data to hospital, current status, first diagnosis
7. Replacement of fixed infrastructure in case of earthquakes, fire, etc
8. Mobile office
9. Direct access to customer files stored in a central location
10. Wireless LANs in buildings
11. Outdoor internet access
12. Ad hoc networks for multi user games
13. Automatic call forwarding, transmission of actual workspace to current location
14. Mobile information services such as current special offers, etc.
Limitations of mobile devices
1.
2.
3.
4.
5.
6.
7.

Battery backup is low, limited computing power and low quality


Not efficient keyboard
Can prove to theft due to its size
Higher loss rates due to interference
Limited user interfaces and limited memory
Higher delays (low downloads for Internet)
Lower security and simpler active attacking since i) medium is accessible for everyone,
ii) base station can be simulated and attract calls from mobile phones

1.4 Characteristics of Mobile computing


The important characteristics of mobile computing are:
1. Ubiquity:

The dictionary meaning of ubiquity is present everywhere.

In the context of mobile computing, ubiquity means the ability of a user to


perform computations from anywhere and at anytime.

2. Local awareness:
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 8

A hand-held device equipped with global positioning system can transparently


provide information about the current location of a user to a tracking station.

3. Adaptation:

It implies the ability of a system to adjust to bandwidth fluctuation without


inconveniencing the user.

In mobile computing environment, adaptation is crucial because of intermittent


disconnections and bandwidth fluctuations that can arise due to a number of
factors such as handoff, obstacles, environment noise, etc.

4. Broadcast:

Due to this characteristic, mobile computing environment can efficiently deliver


data simultaneously to hundreds of mobile users.

5. Personalization:

Services in a mobile environment can be easily personalized according to a users


profile.

This is required to let the users easily avail information with their hand held
devices.

1.5 Structure of Mobile Computing Application


Three layered architecture diagram:

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 9

1. Presentation tier:

The topmost level of a mobile computing application concerns the user interface.

A good user interface facilitates the users to issue requests and to present the
results to them meaningfully.

The programs at this layer run on the client machine.

This layer usually includes web browsers and customized client programs for
dissemination of information and for collection of data from the user.

2. Application tier:

This layer has the vital responsibility of making logical decisions and performing
calculations.

It also moves and processes data between the presentation and data layers.

It performs the processing of user input, obtaining information and then making
decisions.

This layer is implemented using technology like Java, .NET services, cold fusion,
etc.

The implementation of this layer and the functionality provided by this layer
should be database independent.

This layer of functionalities is usually implemented on a fixed server.

3. Data tier:

It is responsible for providing the basic facilities of data storage, access, and
manipulation.

Often this layer contains a database.

The information is stored and retrieved from this database.

This layer is also implemented on a fixed server.

1.6 MAC Protocols


The MAC layer is the "low" part of the second OSI layer, the layer of the "data link". In fact, the
IEEE divided this layer into two layers "above" is the control layer the logical connection
(Logical Link Control, LLC) and "down" the control layer, the medium access (MAC).
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 10

The MAC layer is the "low" part of the second OSI layer, the layer of the "data link". In fact, the
IEEE divided this layer into two layers "above" is the control layer the logical connection
(Logical Link Control, LLC) and "down" the control layer, the medium access (MAC).
IEEE 802 refers to a family of IEEE standards dealing with LAN and MAN. It includes various
groups and some of them are active and some of them are inactive. It provides standard for
physical and data link layer in OSI model.
Some of the IEEE standards used for MAC are:
IEEE 802.3 Ethernet
IEEE 802.4 Token Bus
IEEE 802.5 Token Ring
IEEE 802.11 Wireless LAN and Wi-Fi
IEEE 802.15 Wireless PAN, Bluetooth and Zigbee Technologies
IEEE 802.15.1 Wireless PAN or Bluetooth operates under 3 classes: 100 mts, 10 mts
and 1 mt
7. IEEE 802.15.4 Zigbee
8. IEEE 802.15.6 Body Area networks
9. IEEE 802.15.7 Visible light communications
10. IEEE 802.16 WiMAX (World wide Interoperability for Microwave access)
1.
2.
3.
4.
5.
6.

For WAN, we have the standard named X.25 by ITU (International Telecommunication Union).
It relates to the lower three layers. X.25 at the physical layer denotes the specification for
electrical, mechanical, etc. At data link layer, it covers link access protocol i.e. LAPB (Link
Access Protocol Balanced) that defines how two devices establish error-free connection. At
network layer, it specifies packet format, routing and multiplexing of transmission between
communicating devices.
We are having two categories of network according to the medium it is used namely: i) networks
that use dedicated link between one node to another, ii) networks that use shared communication
medium between them.
When we are using dedicated link between source and destination system, then there is no
problem. But when we use shared communication medium among multiple systems, the there
arise lot of issues: i) which device will have control over the shared medium, ii) how much time
the device will take control over the shared medium, iii) when two or more devices trying to use
the shared medium at the same time, what is the output?
MAC protocol will take care of these issues. The major classification of MAC protocols are:
i.
ii.

Random assignment scheme


Reservation based scheme

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 11

iii.

Fixed assignment scheme

1.7 Wireless MAC Issues


MAC Issues

MAC protocol in wireless channel is much more complex than wired channel.

A collision detection scheme is much more difficult to implement in a wireless


environment since collisions are hard to detect by the transmitting nodes.

In infrastructure-less networks the issue of hidden and exposed terminals make MAC
protocol inefficient unless special care is taken.

Hidden terminal problem


The hidden terminal problem arises when at least three nodes communicate among each other.
Consider nodes A, B and C. A and B are in same range of medium to communicate. B and C are
in same range of medium to communicate. Here A can communicate with B, C can communicate
with B, B can communicate with A and B. Also C cannot be reach from A and A cannot be
reached from C.
Consider A and C wants to communicate with B at the same time. Then there is collision occurs.
Here C does not know As transmission since A is hidden for C and also A does not know Cs
transmission since C is hidden for A. This problem is referred as hidden terminal problem.

Exposed terminal problem


The hidden terminal problem arises when at least three nodes communicate among each other.
Consider nodes A, B and C. A and B are in same range of medium to communicate. B and C are
in same range of medium to communicate. Here A can communicate with B, C can communicate
with B, B can communicate with A and B. Also C cannot be reach from A and A cannot be
reached from C.
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 12

MAC protocols usually inhibit transmission when transmission from another terminal is
detected. Consider another node D comes in the range of C. i.e. D and C are in same range of
medium to communicate. Now C can able to reach B and D.
Consider B transmit data to A. During this time, C cannot be transmit to any other node since C
and B shares the same communication medium or in other words, B and C using same range of
medium to communicate. Even if node D wants to transmit to node C and it can be received
properly without any collision, the transmission cannot be happened. This is due to the
knowledge of C that B is communicating to A. The data transmission from B and A is exposed to
C and thus the transmission from C and D cannot be occur. This problem is referred as exposed
terminal problem.

1.8 Fixed Assignment Schemes


The fixed assignment schemes are usually called circuit-switched scheme. In this scheme, the
resources required for a call are assigned for the entire duration of the call. There are three
categories for fixed assignment scheme. They are:
a. FDMA (Frequency Division Multiple Access)
b. TDMA (Time Division Multiple Access)
c. CDMA (Code Division Multiple Access)
a. FDMA (Frequency Division Multiple Access)
Frequency is defined as the number of cycles per unit time. Usually the time unit referred is in
terms of seconds. The unit of frequency is Hertz. If we have 2 cycles per second, the frequency is
2 Hz. The range of frequencies human can hear is 12 to 14 Kilo Hertz.
Example: FM radios are come under this category. If we want to divide the frequency range of
20Hz to 120Hz into five divisions, then the frequency division is calculated and divide it by the
number of channels required. i.e. here frequency division is (120-20 = 100 Hz) / 5 = 20 Hz.
Hence the partition of the channel according to frequency is 20-40 Hz, 40-60 Hz, 60-80 Hz, 80100 Hz, 100-120 Hz.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 13

The graph is plotted with frequency in y axis and time in x axis for FDMA. The available
bandwidth of the channel is divided into many narrower frequency bands called channels. Each
user is allotted for a particular range of frequency. if we want to use full duplex communication,
then each user is allotted with two different frequencies, one for sending and the other for
receiving. When a call is undertaken by the user, the frequency used by that user will not be
allotted for other user. Hence it does not achieve high channel utilization. In the wired telephone
transmission system, this scheme is used.
Advantages of FDMA
Channel bandwidth is relatively narrow
Simple algorithmically, and from a hardware standpoint
Fairly efficient when the number of stations is small and the traffic is uniformly constant
Capacity increase can be obtained by reducing the information bit rate and using efficient
digital code
No need for network timing
No restriction regarding the type of baseband or type of modulation

Disadvantages of FDMA
If channel is not in use, it sits idle
The presence of guard bands
Maximum bit rate per channel is fixed
Does not differ significantly from analog system

b. TDMA (Time Division Multiple Access)


The graph is plotted with frequency in y axis and time in x axis for TDMA. In TDMA, the same
physical channel is allotted for different users in different time slot. Each user is allocate to use
the channel in a round robin fashion. It is easily adapt to transmission of data and voice
communication. Example: GSM (Global System for Mobile Communications) used this
technique.
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 14

Advantages of TDMA
Flexible bit rate
No frequency guard band required
Easy for mobile or base stations to initiate and execute hands off
Extended battery life
TDMA installations offer savings in base station equipment, space and maintenance
The most cost-effective technology for upgrading a current analog system to digital

Disadvantages of TDMA
Requires network-wide timing synchronization
Requires signal processing for matched filtering and correlation detection
Demands high peak power on uplink in transient mode
Multipath distortion

c. Code Division Multiple Access


In this technique, the graph is plotted with frequency in y axis and time in x axis and code in z
axis. Hence all the users can use the same physical medium at the same time. To differentiate
among them, a special code of signals is used for every user who are using the channel.
CDMA uses different codes for different users and all are multiplexed over the same physical
channel. Example: All mobile applications where we use encryption in the sending end and
decryption in the receiving end come under this type.
Advantages of CDMA
Many users of CDMA use the same frequency, TDD or FDD may be used
No absolute limit on the number of users
Easy addition of more users
Impossible for hackers to decipher the code sent
Better signal quality

Disadvantages of CDMA
As the number of users increases, the overall quality of service decreases
Self-jamming

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 15

1.9 Random Assignment Schemes


Random assignment schemes are called packet-switched schemes. Here no resource reservation
is made. The nodes simply start to transmission as soon as they have packet to send.
The various random access MAC schemes are:
i.
ii.
iii.
iv.
v.

ALOHA
Slotted ALOHA
CSMA
CSMA/CD
CSMA/CA

i. ALOHA: It is the simplest scheme. It is free for all. When a node needs to send, it does so. If a
frame successfully reaches the destination, then it sends the next frame. It listens for an amount
of time equal to the maximum round trip delay plus a fixed increment. If it hears an
acknowledgement, then there is no problem i.e. the packets are reached without any problem.
Otherwise, it resends after waiting a random amount of time. This type is suitable when small
number of users send data infrequently.
ii. Slotted ALOHA: It is similar to ALOHA, the exception is that the time is divided into equalsized slots in which a packet can be sent. Thus, the size of the packet is restricted. The slotted
ALOHA system employs beacon signals that are sent at precise intervals that mark the beginning
of a slot, at which point the nodes having data to send can start to transmit. This scheme also
does not work well when the number of stations used to send data is high.
iii. CSMA: CSMA stands for Carrier Sense Multiple Access. Every node attached to the system
that implements CSMA is capable of sensing whether the communication medium is free to
transmit or not. Hence this scheme is called LBT (Listen Before Talking) i.e. the node senses the
medium before starting to transmit. If the node senses that some transmission is going on, then it
will not start its transmission.
iv. CSMA/CD: CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection. In
this scheme, the sender starts to transmit if it senses the channel to be free. Even if it senses the
channel to be free, there can be a collision during transmission. This can be happens when two or
more nodes start sending the data at the same time. After sending data, node will sense whether
there is any collision. If there is any collision, then it will stop its transmission. Hence it is also
called LAT (Listen After Talking).
v. CSMA/CA: CSMA/CA stands for Carrier Sense Multiple Access with Collision Avoidance.
There are a multiple number of nodes want to transmit data at the same time whenever the
channel is free to transmit. But more than two systems want to use the shared communication
channel, then there will be a collision and hence the receiver cannot able to receive proper data.
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 16

To avoid this occurrence of collision, in this scheme, every node will follow a random amount of
time delay to sense the channel is free or not after a particular wait time while checking for the
channel to be free. Hence this scheme is called as collision avoidance.

1.10 Reservation Based Schemes


Reservation based schemes are also known as packet-switched schemes. In this scheme, a node
makes explicit reservation of the channel for an entire call before transmitting. Hence it is
suitable for handling calls with widely varying traffic characteristics.
The basic form of the reservation scheme is the RTS/CTS scheme. In RTS/CTS scheme, a sender
transmits an RTS (Request To Send) packet to the receiver before the actual data transmission.
On receiving, the receiver sends a CTS (Clear To Send) packet and the actual data transfer will
commence only after that process.
A node wants to send a message first reserves the medium by using appropriate control message
(RTS) and the corresponding destination node accepting this request answers with a control
message to the sender (CTS). Every other nodes which senses these control messages in the
network will not perform data transmission. One of the examples of RTS-CTS based MAC
protocols is MACA.
MACA
MACA stands for Multiple Access Collision Avoidance. It solves the hidden and exposed
terminal problems. A node running MACA requests to use the medium by sending RTS to
receiver.
Consider three systems A, B and C such that A and B are in same communication range, B and C
are in same communication range. Similarly A can reach only to B, C can reach only to B, B can
reach to A and B.
Solution to Hidden terminal problem
The steps to be followed under MACA to avoid hidden terminal problem are:
i.
ii.
iii.
iv.
v.

A sends RTS (with some information) to B


B receives RTS that contains senders name, receivers name (here it is A and B) and
the length of future transmission.
CTS is sent to A and C which contains senders name, receivers name (here it is A
and B) and the length of transmission.
C understood now that B is sending CTS to A. Hence C will not start its transmission
for the time given in CTS.
Collision cannot occur for the time mentioned in CTS.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 17

Thus here hidden terminal problem is solved. But collision can occur during the sending of RTS.
i.e. A and C send RTS to B at the same time. In this case, B can resolve this problem by
acknowledging only for one station with CTS. No transmission will occur without an appropriate
CTS.
Solution to Exposed terminal problem
The steps to be followed under MACA to avoid exposed terminal problem are:
i.
ii.
iii.
iv.
v.

B needs to transmit to A and thus transmit RTS to A and C.


RTS contains name of the sender and receiver, length of data transmission in time.
C does not response to this RTS since it represents A only in the RTS message. But A
will respond with CTS to B.
C does not receive this CTS, and conclude that A is outside the detection range.
C can start its transmission assuming that no collision would occur at A.

Here exposed terminal problem is solved.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 18

Unit II Mobile Internet Protocol and Transport Layer

2.1 Overview of Mobile IP


Mobile IP (Internet Protocol) enables the transfer of information to and from mobile computers,
such as laptops and wireless communications. The mobile computer can change its location to a
foreign network and still access and communicate with and through the mobile computer's home
network.
When a mobile node moves from one network to another, it has to reconfigure its IP according to
the new network. It is a complicated task. i.e. whenever the mobile node moves, it has to
reconfigure its IP address according to the newer network it is added now. If it is done, then it
may lose its connectivity to the already existing network connection. To solve this issue, we have
to use mobile IP.
Mobile IP uses two IP addresses: i) fixed home address, ii) care-of address. Mobile IP enables
computer to roam freely on the Internet or organizations network while maintaining the same
home address.
Figure: Mobile IP Topology

Using Mobile IP topology, the following scenario shows how a datagram moves from
one point to another within the Mobile IP framework.

1. The Internet host sends a datagram to the mobile node using the mobile node's home
address (normal IP routing process).

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 19

2. If the mobile node is on its home network, the datagram is delivered through the normal
IP process to the mobile node. Otherwise, the home agent picks up the datagram.
3. If the mobile node is on a foreign network, the home agent forwards the datagram to the
foreign agent.
4. The foreign agent delivers the datagram to the mobile node.
5. Datagrams from the mobile node to the Internet host are sent using normal IP routing
procedures.
6. If the mobile node is on a foreign network, the packets are delivered to the foreign agent.
The foreign agent forwards the datagram to the Internet host.
Mobile IP Functional Entities
Mobile IP introduces the following new functional entities:
1.

Mobile Node (MN)Host or router that changes its point of attachment from one
network to another.

2.

Home Agent (HA)Router on a mobile node's home network that intercepts datagrams
destined for the mobile node, and delivers them through the care-of address. The home
agent also maintains current location information for the mobile node.

3.

Foreign Agent (FA)Router on a mobile node's visited network that provides routing
services to the mobile node while the mobile node is registered.

How Mobile IP Works

Mobile IP enables routing of IP datagrams to mobile nodes.

The mobile node's home address always identifies the mobile node, regardless of its
current point of attachment to the Internet or an organization's network.

When away from home, a care-of address associates the mobile node with its home
address by providing information about the mobile node's current point of attachment to
the Internet or an organization's network.

Mobile IP uses a registration mechanism to register the care-of address with a home
agent.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 20

The home agent redirects datagrams from the home network to the care-of address by
constructing a new IP header that contains the mobile node's care-of address as the
destination IP address.

This new header then encapsulates the original IP datagram, causing the mobile node's
home address to have no effect on the encapsulated datagram's routing until it arrives at
the care-of address.

This type of encapsulation is also called tunneling. After arriving at the care-of address,
each datagram is de-encapsulated and then delivered to the mobile node.

Consider a mobile node is currently in network A, it has its associated network IP address. The
network is called home network. If the mobile node changes its position to any other network,
this new network is called foreign network and to get the connectivity to the new network, the
mobile node should be associated with new networks associated IP address. If we change the
mobile nodes IP address according to the new network position, then it will lose its previous
connectivity. To solve these problems, mobile IP is used for mobile nodes. According to the
mobile IP, each mobile node is associated with a pair of IP address namely: i) home address and
ii) care-of-address.
Mobile IP agents
Mobile IP agents are routers that have been given additional programming to make them
Mobile IP aware. The communication between a mobile node and the agent on its local
network is basically the same as the normal communication required between a device on an IP
network and its local router, except more information needs to be sent when the router is an
agent. The router in the home network called home agent and the router in the foreign network
called foreign agent are commonly called mobile IP agents. These home and foreign agents are
used to route the packets for mobile node.
Care-of address
There are two types of care-of addresses. They are:
i.

Foreign agent care-of address: When the mobile node is in foreign network
and if the mobile node is not having its own IP address, then it should use IP
address of the foreign agent itself. Thus foreign agents IP address is used as a
care-of address for mobile node. This type of care-of address is called foreign
agent care-of address. In this case, the mobile node is connected to the foreign
agent using the layer 2 protocol only. Any packets routing from home agent
will reach the foreign agent, then from foreign agent, it uses layer 2 protocol
to reach the mobile node. Consider the figure below for example.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 21

ii.

Co-located care-of address: When the mobile node has its own IP address in
its foreign network, this address is referred as co-located care-of address. Any
packet to be routed to the mobile node in the foreign network, then it will be
routed to the mobile nodes co-located care-of address. The mobile node can
obtain this address by two methods: i) manually by enquiring the admin to
provide IP, ii) using DHCP protocol. Consider the figure below for example.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 22

2.2 Features of Mobile IP


1. Transparency:

During its movement mobile end systems communication should not be disrupted.

The IP address is to be managed transparently and there should not be effect of mobility
on any ongoing communication.

2. Compatibility:

Mobile IP should be compatible with the existing Internet protocols.

3. Security:

Mobile IP should as far as possible, provide users with secure communications over
Internet.

4. Efficiency and Scalability:

There can be a large number of mobile systems in the whole Internet.

This should be results in large number of messages or it should not incur too much
computational overhead.

It should also be scalable to support billions of moving hosts worldwide.

2.3 Key Mechanism in Mobile IP


Agent discovery
When a mobile node is first turned on, it cannot assume that it is still at home the way normal
IP devices do. It must first determine where it is, and if it is not at home, begin the process of
setting up datagram forwarding from its home network. This process is accomplished by
communicating with a local router serving as an agent, through the process called agent
discovery.
The main goals of agent discovery include the following:
o

Agent/Node Communication: Agent discovery is the method by which a mobile node


first establishes contact with an agent on the local network to which it is attached.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 23

i.

Messages are sent from the agent to the node containing important
information about the agent. These messages are called agent advertisement
messages.

ii.

A message can also be sent from the node to the agent asking for this
information to be sent. This message is called agent solicitation message (i.e.
request for agent advertisement).

Orientation: The node uses the agent discovery process to determine where it is.
Specifically, it learns whether it is on its home network or a foreign network by
identifying the agent that sends it messages.

Care-Of Address Assignment: The agent discovery process is the method used to tell a
mobile node the care-of address it should use, when foreign agent care-of addressing is
used.

The messages used in the agent discovery process are:


o

Agent Advertisement: This is a message transmitted regularly by a router acting as a


Mobile IP agent. It consists of a regular Router Advertisement message that has one or
more extensions added that contain Mobile-IP-specific information for mobile nodes.

Agent Solicitation: This message can be sent by a mobile IP device to nudge a local
agent to send an Agent Advertisement.

Agent Registration
Once a mobile node has completed agent discovery, it knows whether it is on its home network
or a foreign network. If on its home network it communicates as a regular IP device, but if on a
foreign network it must activate Mobile IP. This requires that it communicate with its home
agent so information and instructions can be exchanged between the two. This process is called
home agent registration, or more simply, just registration.
The main purpose of registration is to actually start Mobile IP working. The mobile node must
contact the home agent and tell it that it is on a foreign network and request that datagram
forwarding be turned on. It also must let the home agent know its care-of address so the home
agent knows where to send the forwarded datagrams. The home agent in turn needs to
communicate various types of information back to the mobile node when registration is
performed. Note that the foreign agent is not really involved in registration, except perhaps to
relay messages, as we will see.
Mobile Node Registration Events
Successful registration establishes what is called in the standard a mobility binding between a
home agent and a mobile node. For the duration of the registration, the mobile node's regular
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 24

home address is tied to its current care-of address and the home agent will encapsulate and
forward datagrams addressed to the home address over to the care-of address. The mobile node is
supposed to manage its registration and handle various events using several actions:
o

Registration: The mobile node initiates a registration when it first detects it has moved
from its home network to a foreign network.

Deregistration: When the mobile node returns home, it should tell the home agent to
cancel forwarding, a process called deregistration.

Reregistration: If the mobile node moves from one foreign network to another, or if its
care-of address changes, it must update its registration with the home agent. It also must
do so if its current registration is about to expire, even if it remains stationary on one
foreign network.

Each registration is established only for a specific length of time, which is why regular
reregistration is required whether the device moves or not. Registrations are time-limited to
ensure that they do not become stale. If, for example, a node forgets to de-register when it returns
home, the datagram forwarding will eventually stop when the registration expires.
Mobile IP Data encapsulation and Tunneling
Once a mobile node on a foreign network has completed a successful registration with its home
agent, the Mobile IP datagram forwarding process will be fully activated. The home agent will
intercept datagrams intended for the mobile node as they are routed to its home network, and
forward them to the mobile node. This is done by encapsulating the datagrams and then sending
them to the node's care-of address.
Mobile IP Data Encapsulation Techniques
Encapsulation is required because each datagram we intercept and forward needs to be resent
over the network to the device's care-of address. The default encapsulation process used in
Mobile IP is called IP Encapsulation Within IP, defined in RFC 2003 and commonly abbreviated
IP-in-IP. It is a relatively simple method that describes how to take an IP datagram and make it
the payload of another IP datagram. In Mobile IP, the new headers specify how to send the
encapsulated datagram to the mobile node's care-of address.
In addition to IP-in-IP, two other encapsulation methods may be optionally used: Minimal
Encapsulation Within IP, defined in RFC 2004, and Generic Routing Encapsulation (GRE),
defined in RFC 1701.
The Mobile IP Data Delivery Tunnel
The encapsulation process creates a logical construct called a tunnel between the device that
encapsulates and the one that decapsulates. This is the same idea of a tunnel used in discussions
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 25

of virtual private networks (VPNs), IPSec tunnel mode, or the various other tunneling protocols
used for security.
The tunnel represents a conduit over which datagrams are forwarded across an arbitrary
internetwork, with the details of the encapsulated datagram (meaning the original IP headers)
temporarily hidden.
In Mobile IP, the start of the tunnel is the home agent, which does the encapsulation. The end of
the tunnel depends on what sort of care-of address is being used:
o

Foreign Agent Care-Of Address: The foreign agent is the end of the tunnel. It receives
encapsulated messages from the home agent, strips off the outer IP header and then
delivers the datagram to the mobile node. This is generally done using layer two, because
the mobile node and foreign agent are on the same local network, and of course, the
mobile node does not have its own IP address on that network (it is using that of the
foreign agent.)

Co-Located Care-Of Address: The mobile node itself is the end of the tunnel and strips
off the outer header.

Key mechanisms in mobile IP


Mobile IP is associated with the following three basic mechanisms:
i.
ii.
iii.

Discovering the care-of address


Registering the care-of address
Tunneling to the care-of address

i. Discovering the care-of address


Each mobile node uses a discovery protocol to identify the respective home and foreign agents.
The discovery of the care-of address consists of the following steps:
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 26

a. Mobile agents advertise their presence by periodically broadcasting the


agent advertisement messages.
b. The mobile node receiving the agent advertisement message observes
whether the message is from its own home agent and determines whether
it is on the home network or on a foreign network.
c. If a mobile node does not wish to wait for the periodic advertisement, it
can send out agent solicitation messages that will be responded to by a
mobility agent.
Agent advertisement involves the following activities:
a.
b.
c.
d.

Foreign agents send messages to advertise the available care-of addresses.


Home agents send advertisements to make themselves known.
Mobile hosts can issue solicitations to actively seek information.
If a mobile host has not heard from the foreign agent to which its current care-of address
belongs, it takes up another care-of address.

ii. Registering the care-of address


If the mobile node discovers that it is on the home network, it operates in a normal IP routing
process. If the mobile node is in foreign network, then it had to register the care-of address of the
mobile node to the home agent and then only the home agent can able to redirect the packets
which are coming for mobile node to the home agent.
The registration process consists of the following steps:
a. If the mobile node is on the foreign network, it registers with the foreign agent by
sending a registration request message which includes the permanent IP address of the
mobile host and the IP address of its home agent.
b. The FA (foreign agent) send the registration request containing the permanent IP address
of the mobile node and the IP address of the foreign agent to the home agent.
c. When the HA (home agent) receives the registration request, it updates the mobility
binding by associating the care-of address of the mobile node with its home address. The
HA then sends an acknowledgement to the FA.
d. The FA in turn updates its visitors list by inserting the entry for the mobile node and
relays the reply to the mobile node.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 27

iii. Tunneling to the care-of address


In computer networks, a tunneling protocol allows a network user to access or provide a
network service that the underlying network does not support or provide directly. One important
use of a tunneling protocol is to allow a foreign protocol to run over a network that does not
support that particular protocol; for example, running IPv6 over IPv4. Simply, tunneling is a
technology that enables one network to send its data via another networks connections.

Tunneling takes place to forward the datagram from the HA to the mobile node. The packets are
coming from the remote host to the mobile node. if the mobile node is in home network, then it
will follow the normal IP routing process. If the mobile node is in foreign network, then the
packets or datagrams from the remote host will reach to the HA, where it will tunnel the packets
to the foreign network. The tunneling is of two ways:
1. If the mobile node follows co-located care-of address, then the tunneling path is from
HA to the mobile node. Thus the packets are routed through the tunnel from HA to
the mobile node directly.
2. If the mobile node follows FA care-of address, then the tunneling path is from HA to
the FA. Thus the packets from HA will tunnel from HA to FA and from the FA, it

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 28

will follows the Layer2 protocol to reach the mobile agent. Here tunneling can be
done from HA to FA only.
The steps involved in tunneling process are:
a. When a HA receives a packet addressed to a mobile host, it forwards the packet to the
care-of address using IP-within-IP.
b. Using IP-within-IP, the HA inserts new IP header in front of the IP header of any
datagram.
c. Destination address is set to the care-of-address.
d. Source address is set to the HAs address.
e. After stripping out the first header, IP processes the packet again.

Overview and Architecture of TCP/IP


OSI Reference Model

Most network protocol suites are viewed as structured in layers.

This is a result of the Open Systems Interconnect (OSI) Reference Model designed by the
International Standards Organization (ISO).

The OSI model describes network activities as having a structure of seven layers, each of
which has one or more protocols associated with it.

The layers represent data transfer operations common to all types of data transfers among
cooperating networks.

The protocol layers of the OSI Reference Model are traditionally listed from the top
(layer 7) to the bottom (layer 1) up, as shown in the following table.

The operations defined by the OSI model are conceptual and not unique to any particular
network protocol suite.

For example, the OSI network protocol suite implements all seven layers of the OSI
Reference Model.

TCP/IP uses some of OSI model layers and combines others. Other network protocols,
such as SNA, add an eighth layer.

Table: The Open Systems Interconnect Reference Model

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 29

Layer
No.

Layer Name

Description

Application

Consists of standard communication services and applications


that everyone can use

Presentation

Ensures that information is delivered to the receiving machine


in a form that it can understand

Session

Manages the connections


cooperating computers

Transport

Manages the transfer of data and assures that received and


transmitted data are identical

Network

Manages data addressing and delivery between networks

Data Link

Handles the transfer of data across the network media

Physical

Defines the characteristics of the network hardware

and

terminations

between

TCP/IP Protocol Architecture Model

The OSI model describes an idealized network communications protocol family.

TCP/IP does not correspond to this model directly, as it either combines several OSI
layers into a single layer, or does not use certain layers at all.

The following table shows the layers of TCP/IP, listed from topmost layer (application)
to lowest (physical network).

The table shows the TCP/IP protocol layers, their OSI Model equivalents, and examples
of the protocols available at each level of the TCP/IP protocol stack.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 30

Each host involved in a communication transaction runs its own implementation of the
protocol stack.

Table: TCP/IP Protocol Stack


OSI Ref.
Layer No.

OSI
Equivalent

Layer

TCP/IP
Layer

5,6,7

Application, Session,
Presentation

Application

NFS, NIS+, DNS, telnet, ftp, rlogin,


rsh, rcp, RIP, RDISC, SNMP, and
others

Transport

Transport

TCP, UDP

Network

Internet

IP, ARP, ICMP

Data Link

Data Link

PPP, IEEE 802.2

Physical

Physical
Network

Ethernet (IEEE 802.3) Token Ring,


RS-232, others

TCP/IP Protocol Examples

Physical Network Layer

The physical network layer specifies the characteristics of the hardware to be used for the
network.

For example, it specifies the physical characteristics of the communications media.

The physical layer of TCP/IP describes hardware standards such as IEEE 802.3, the
specification for Ethernet network media, and RS-232, the specification for standard pin
connectors.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 31

Data-Link Layer

The data-link layer identifies the network protocol type of the packet, in this case TCP/IP.

It also provides error control and "framing."

Examples of data-link layer protocols are Ethernet IEEE 802.2 framing and Point-toPoint Protocol (PPP) framing.

Internet Layer

This layer, also known as the network layer, accepts and delivers packets for the network.

It includes the powerful Internet protocol (IP), the Address Resolution Protocol (ARP)
protocol, Reverse Address Resolution Protocol (RARP), Internet Group Message
Protocol (IGMP), and the Internet Control Message Protocol (ICMP) protocol.

IP Protocol
The IP protocol and its associated routing protocols are possibly the most significant of the entire
TCP/IP suite. IP is responsible for:

IP addressing - The IP addressing conventions are part of the IP protocol.

Host-to-host communications - IP determines the path a packet must take, based on the
receiving host's IP address.

Packet formatting - IP assembles packets into units known as IP datagrams.

Fragmentation - If a packet is too large for transmission over the network media, IP on
the sending host breaks the packet into smaller fragments. IP on the receiving host then
reconstructs the fragments into the original packet.

ARP Protocol

The Address Resolution Protocol (ARP) conceptually exists between the data link and
Internet layers.

ARP assists IP in directing datagrams to the appropriate receiving host by mapping


Ethernet addresses (48 bits long) to known IP addresses (32 bits long).

RARP protocol
It is used by IP to find the IP address based on the physical address of a computer. The operation
is reverse process of the ARP protocol.
Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 32

ICMP Protocol
Internet Control Message Protocol (ICMP) is the protocol responsible for detecting network error
conditions and reporting on them. ICMP reports on:

Dropped packets (when packets are arriving too fast to be processed)

Connectivity failure (when a destination host can't be reached)

Redirection (which tells a sending host to use another router)

Transport Layer

The TCP/IP transport layer protocols ensure that packets arrive in sequence and without
error, by swapping acknowledgments of data reception, and retransmitting lost packets.

This type of communication is known as "end-to-end." Transport layer protocols at this


level are Transmission Control Protocol (TCP) and User Datagram Protocol (UDP).

TCP Protocol

TCP enables applications to communicate with each other as though connected by a


physical circuit.

TCP sends data in a form that appears to be transmitted in a character-by-character


fashion, rather than as discreet packets.

This transmission consists of a starting point, which opens the connection, the entire
transmission in byte order, and an ending point, which closes the connection.

TCP attaches a header onto the transmitted data. This header contains a large number of
parameters that help processes on the sending machine connect to peer processes on the
receiving machine.

TCP confirms that a packet has reached its destination by establishing an end-to-end
connection between sending and receiving hosts.

TCP is therefore considered a "reliable, connection-oriented" protocol.

UDP Protocol

UDP, the other transport layer protocol, provides datagram delivery service.

It does not provide any means of verifying that connection was ever achieved between
receiving and sending hosts. Because UDP eliminates the processes of establishing and

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 33

verifying connections, applications that send small amounts of data use it rather than
TCP.
Application Layer

The application layer defines standard Internet services and network applications that
anyone can use. These services work with the transport layer to send and receive data.

There are many applications layer protocols, some of which you probably already use.

Some of the protocols include:

1.

Standard TCP/IP services such as the ftp, tftp, and telnet commands

2.

UNIX "r" commands, such as rlogin and rsh

3.

Name services, such as NIS+ and Domain Name System (DNS)

4.

File services, such as the NFS service

5.

Simple Network Management Protocol (SNMP), which enables network management

6.

RIP and other routing protocols

Adaptation of TCP Window


TCP window

TCP is a connection-oriented protocol; both ends of a connection keep strict track of all
data transmitted, so that any lost or jumbled segments can be retransmitted or reordered
as necessary to maintain reliable transport.

To compensate for limited buffer space (where received data is temporarily stored until
the appropriate application can process it), TCP hosts agree to limit the amount of
unacknowledged data that can be in transit at any given time.

This is referred to as the window size, and is communicated via a 16-bit field in the TCP
header.

Suppose we have two hosts, A and B, that form a TCP connection.

At the start of the connection, both hosts allocate 32 KB of buffer space for incoming
data, so the initial window size for each is 32,768.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 34

Host A needs to send data to host B. It can tell from host B's advertised window size that
it can transmit up to 32,768 bytes of data (in intervals of the maximum segment size, or
MSS) before it must pause and wait for an acknowledgment.

Assuming an MSS of 1460 bytes, host A can transmit 22 segments before exhausting
host B's receive window.

When acknowledging receipt of the data sent by host A, host B can adjust its window
size.

For example, if the upper-layer application has only processed half of the buffer, host B
would lower its window size to 16 KB.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 35

If the buffer was still entirely full, host B would set its window size to zero, indicating
that it cannot yet accept more data.

On a LAN with high bandwidth and extremely low delay, windows are rarely stressed as
there are typically very few segments in transit between two endpoints at any given time.

On a high-bandwidth, high-delay network, however, an interesting phenomenon occurs:


it is possible to max out the receive window of the destination host before receiving an
acknowledgment.

As an example, let's assume a TCP connection is established between two hosts


connected by a dedicated 10 Mbps path with a one-way delay of 80ms.

Both hosts advertise the maximum window size of 65,535 bytes (the maximum value of a
16-bit unsigned integer).

We can calculate the potential amount of data in transit in one direction at one point in
time as bandwidth * delay: 10,000,000 bps divided by 8 bits per byte, multiplied by 0.08
seconds equals 100,000 bytes.

In other words, if host A begins transmitting to host B continuously, it will have sent
100,000 bytes before host B receives the first byte transmitted.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 36

However, because our maximum receive window is only 65,535 bytes, host A must stop
transmitting once this number has been reached and wait for an acknowledgment from
host B.

2.8 Improvement in TCP Performance


Congestion in a network may occur if the load on the network i.e. the number of packets sent to
the network is greater than the capacity of the network i.e. the number of packets a network can
handle.
Congestion control refers to the mechanisms and techniques to control the congestion and keeps
the load below the capacity.
Congestion

Congestion in a network occurs because routers and switches have queues-buffers that
hold the packets before and after processing.

A router for example, has an input queue and an output queue for each interface. When a
packet arrives at the incoming interface, it undergoes three steps before departing as:

i.

The packet is put at the end of the input queue while waiting to be checked.

ii.

The processing module of the router removes the packet from the input queue once it
reaches the front of the queue and uses its routing table and the destination address to
find the route.

iii.

The packet is put in the appropriate output queue and waits its turn to be send.

There are 2 issues: i) if the rate of packet arrival is higher than the packet processing rate,
the input queues become longer and longer, ii) if the packet departure rate is less than the
packet processing rate, the output queues become longer and longer.

TCP uses a sliding window to handle flow control.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 37

The sliding window of TCP is byte-oriented and is of variable size.

The window spans a portion of the buffer containing bytes received from the process.

The bytes inside the window are the bytes that can be in transit i.e. they can be sent
without worrying about acknowledgement.

The imaginary window has two walls named right and left.

The window is opened, closed or shrunk.

Opening a window means moving the right wall to the right. This allows more new bytes
in the buffer that are eligible for sending.

Closing the window means moving the left wall to right. This means that some bytes
have been acknowledged and the sender need not worry about them.

Shrinking the window means moving right wall to left. This should not be allowed since
it revoke the eligibility of some bytes for sending. The left wall is also cannot be moved
to left since that number of acknowledgement received already.

The size of the window at one end is determined by two values: receiver window (rwnd)
and the congestion window (cwnd).

The receiver window is the value advertised by the other end in a segment containing
acknowledgement. i.e. TCP segment header contains a field as window size.

In that field the receiver can set the number of bytes it can accept before its buffer
overflows. Congestion window value is determined by the network to avoid congestion.

Improvement in TCP performance for Traditional Networks

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 38

TCPs policy for handling congestion is based on three phases:


i.

Slow start: Sender starts with very slow rate of transmission, increases the rate rapidly
to reach a threshold.

ii.

Congestion avoidance: When the threshold is reached, the data rate is reduced to
avoid congestion.

iii.

Congestion detection: If congestion is detected, sender goes back to the slow-start or


congestion avoidance phase. Thus the congestion is detected.

1. Slow start Exponential increase:

Slow start is one of the algorithms used in TCP congestion control.

It is based on the idea that the size of the cwnd starts with one maximum segment size
(MSS). This means that the sender can send only one segment.

After receipt of the acknowledgement for segment 1, the size of the congestion window is
increased by 1, i.e. cwnd is now 2.

Now two segments can be sent. When each acknowledgement is received, the size of the
window is increased by 1 MSS.

When all seven segments are acknowledged, cwnd = 8.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 39

If we look at the size of cwnd in terms of rounds, we find that the rate is exponential as shown
below:
Initially,

cwnd = 1

After round1,

cwnd = 21 = 2

After round2,

cwnd = 22 = 4

After round3,

cwnd = 23 = 8

Slow start cannot continue indefinitely.

There must be a threshold to stop this phase.

The sender keeps track of a variable named ssthresh (slow-start threshold).

When the size of window in bytes reaches this threshold, slow start stops and the next
phase starts.

In most implementations the value of ssthresh is 65,535 bytes.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 40

2. Congestion avoidance Additive increase:

If we start with the slow-start algorithm, the size of the congestion window increases
exponentially.

To avoid congestion before it happens, we have to slow down this exponential growth.

TCP defines another algorithm called congestion avoidance, which undergoes an additive
increase instead of an exponential one.

When the size of the congestion window reaches the slow-start threshold, the slow-start
phase stops and the additive phase begins.

In this algorithm, each time the whole window of segments is acknowledged, the size of
the congestion window is increased by 1. It is shown in figure below.

In this case, after the sender has received acknowledgements for a complete window size
of segments, the size of the window is increased by one segment.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 41

If we look at the size of cwnd in terms of rounds, we find that the rate is additive as
shown below:

Initially,

cwnd = 1

After round1,

cwnd = 1+1 = 2

After round2,

cwnd = 2+1 = 3

After round3,

cwnd = 3+1 = 4

3. Congestion detection Multiplicative decrease:

If congestion occurs, the congestion window size must be decreased.

The only way the sender can guess that congestion has occurred is by the need to
retransmit a segment. However, retransmission can occur in one of the two cases: i) when
a timer times out, ii) when three ACKs are received.

In both the cases, the size of the threshold is dropped to one-half, a multiplicative
decrease.

If a time out occurs, there is a strong possibility of congestion, a segment has probably
been dropped in the network, and there is no news about the sent segments.

The steps taken are:

a. The value of threshold is set to one-half of the current window size.


b. cwnd is set to the size of one segment.
c. Starts the slow-start phase again.

If three ACKs are received, there is a weaker possibility of congestion, a segment may
have been dropped, but some segments after that may have arrived safely since three
ACKs are received.

This is called fast retransmission and fast recovery. The steps taken are:
a. The value of threshold is set to one-half of the current window size.
b. cwnd is set to the size of one segment.
c. Starts the congestion avoidance phase.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 42

When we receive three ACKs in TCP?

Every time data packet arrives at the receiving side, the receiver responds with an
acknowledgment, even if this sequence number has already been acknowledged.

Thus, when a packet arrives out of orderthat is, TCP cannot yet acknowledge the data
the packet contains because earlier data has not yet arrivedTCP resends the same
acknowledgment it sent the last time. This second transmission of the same
acknowledgment is called a duplicate ACK.

When the sending side sees a duplicate ACK, it knows that the other side must have
received a packet out of order, which suggests that an earlier packet might have been lost.

Since it is also possible that the earlier packet has only been delayed rather than lost, the
sender waits until it sees some number of duplicate ACKs and then retransmits the
missing packet.

In practice, TCP waits until it has seen three duplicate ACKs before retransmitting the
packet. It is shown in figure below.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 43

In this example, the destination receives packets 1 and 2, but packet 3 is lost in the
network.

Thus, the destination will send a duplicate ACK for packet 2 when packet 4 arrives, again
when packet 5 arrives, and so on. (To simplify this example, we think in terms of packets
1, 2, 3, and so on, rather than worrying about the sequence numbers for each byte.)

When the sender sees the third duplicate ACK for packet 2the one sent because the
receiver had gotten packet 6it retransmits packet 3. Note that when the retransmitted
copy of packet 3 arrives at the destination, the receiver then sends a cumulative ACK for
everything up to and including packet 6 back to the source.

Prepared by: Dr.A.Neela Madheswari, Asso Prof/CSE, MEC

Page 44

Вам также может понравиться