Vous êtes sur la page 1sur 6

PROCEEDINGS OF THE 4TH PROGRESS SYMPOSIUM ON EMBEDDED SYSTEMS

Modeling and Performance Analysis of a Sliding


Window Protocol
1

Yong Deng1 and Zhangqin Huang2


Xian Jiaotong University, Institute of Software, Xian 710049, P.R. China
E-mail: yongde7110@sina.com
2
Eindhoven University of Technology, Faculty of Electrical Engineering
Section of Information and Communication Systems
P.O. Box 513, 5600 MB Eindhoven, The Netherlands
E-mail:Z.Huang@tue.nl

AbstractThe sliding window algorithm is widely used in


many standard network protocols. It can ensure a correct
data transfer over unreliable channels where packets may
be duplicated, lost, or re-ordered. By now only few papers
have presented the performance of the sliding window
protocol. A number of parameters affecting the overall
performance of the system still need to be investigated
systematically.
This paper introduces the sliding window protocol and
related parameters. An abstract executable performance
model of the protocol is created in POOSL. Several
simulation results can be derived from this model in
various network environments and different parameter
settings. When we design adaptive algorithms or novel
protocols with the sliding window algorithm, these results
are very helpful to identify optimal parameter settings and
to determine a number of key-parameters such as the
window size, the timeout period and the packet size before
the implementation of the protocols.
Keywordssliding window protocol, system level model,
performance analysis, POOSL

I.

INTRODUCTION

The Sliding Window (SW) protocol has been widely


used in many popular communication protocols such as
TCP, HDLC and SPX. The protocol can ensure a correct
data transfer over very poor quality communication
channels where the packets may be duplicated, lost, or
re-ordered [1,2,3,4]. A number of parameters affect the
performance characteristics of the SW protocol. Usually,
these performance characteristics cannot be determined
analytically. However, we need to study these key
performance characteristics and to identify optimal
This research is supported by PROGRESS project EES5202,
Modeling and Performance analysis of telecommunication systems.

PROGRESS/STW 2003, ISBN 90-73461-37-5

parameter settings in the early design phases when


designing an adaptive algorithm or novel protocols for
specific computing environments. Such information is
helpful for the designer to work out a product.
In this paper we introduce the sliding window protocol
generally, describe the communication procedure of the
protocol, and conclude some related parameters affecting
the overall performance of the system. In order to
estimate the performance of the SW protocol
systematically, as an exercise, an abstract executable
performance model of the protocol using go back n is
created in POOSL. The model allows us to present and
analyze some performance characteristics. These
performance characteristics include the throughput (the
bandwidth utilization) of the protocol and the delay of
the acknowledgement. Some key-parameters such as the
window size, the timeout period, the round trip time, the
packet size, and the probability of packets loss are
investigated in several network environments and
different parameter settings as well.
The remainder of this paper is organized as follows.
The next section gives an overview of the SW protocol
generally. In section III, we will present an abstract
performance model of the protocol in the modeling
language POOSL. The simulation results derived from
the model are illustrated in section IV. A simple
performance analysis is also presented in the same
section. Finally, conclusions are summarized in the last
section.
II. SLIDING WINDOW PROTOCOL DESCRIPTION
Sender and receiver. In a SW protocol, there are two
main components in the data link layer: the sender and
the receiver. The sender obtains an input sequence of
data frames from the network layer in our model. Each

OCTOBRE 22, 2003, NBC NIEUWEGEIN, NL

PROCEEDINGS OF THE 4TH PROGRESS SYMPOSIUM ON EMBEDDED SYSTEMS


data frame is composed of an embedded packet and some
control information. Control information includes a
number of fields such as the frame kind, the input
sequence number and the acknowledgement. Each
outbound frame is assigned a sequence number, ranging
from 0 up to some maximum number (usually 2n-1, n>0).
The input sequence must be transmitted by the sender to
the receiver via an unreliable channel. After receiving the
frames from the network, the receiver should deliver
them to the network layer in the same order in which
they appear in the input sequence.
Sending and receiving windows. At any instant of
time, the sender maintains a sending window of
consecutive sequence numbers corresponding to frames
it is permitted to send. These sequence numbers within
the sending window represent frames sent but not yet
acknowledged. Similarly, the receiver maintains a
receiving window, corresponding to the number of out of
order frames it is permitted to accept. Any frames falling
outside the receiving window are discarded without
comment. In our model we give an assumption of the
same window size in the sender and the receiver.
Channels. The communication channels connect the
sender and the receiver. Usually, the channels are
unreliable and bi-directional. The packets may be
duplicated, lost, or re-ordered in the channels, and will be
delayed a time through the channels. In the SW protocol,
the data frames are sent by the sender to the frame
channel, and the acknowledgement frames are sent by
the receiver to the another channel: the acknowledgement channel.
Communication procedure. In the beginning of
communication between the sender and receiver, the
sending window and the receiving window are empty.
The sender is starting to send data frames to the receiver
via the frame channel. On the other side, the receiver is
waiting for receiving data frames from the network.
Whenever a new packet arrives at the sender from the
network layer, the next highest sequence number
according to the sending window is given, and the upper
edge of the sending window is advanced by one. The
sender puts the packet and the sequence number with
some other control information into a frame, and then
sends the frame to the frame channel.
After transmitting a frame, the sender starts a new
timer running for the corresponding to this frame in the
sending window in our model. The timeout period of the
timers must be chosen to allow enough time for the
frame to get to the receiver, for the receiver to process it
in the worst case, and for the acknowledgement frame to
propagate back to the sender.

PROGRESS/STW 2003, ISBN 90-73461-37-5

After transmitting a frame and starting a timer, the


sender will transmit the next data frame to the frame
channel until the sending window is filled up. In the
same time, the sender is waiting for the acknowledgement arriving from the network. There are three
possibilities: an acknowledgement frame arrives
undamaged, a damaged acknowledgement frame staggers
in, and the timer goes off. If a valid acknowledgement
comes in, the sender fetches the next packet from the
network layer and put it in the buffer, overwriting the
previous packet. It also advanced the input sequence
number. If a damaged frame arrives or a timer goes off, a
duplicate should be sent. In [5] many different policies
for sending and resending of data frames exist. In this
paper, as an exercise, we only focus on the SW protocol
using go back n. The sender will send all unacknowledged frames in order, starting with the damaged or lost
one.
At the receiver, when a valid frame arrives, its
sequence number is checked to see if it is the next one. If
it is the next one, it is accepted, passed to the network
layer, and an acknowledgement frame generated.
Otherwise, it will be discard and is not passed to the
network layer.
Performance parameters. A number of parameters
affect the performance of the SW protocol. Here we
conclude some key-parameters in our model.
Packet size (S): the size of the embedded packet in a
frame. A packet is the unit of information exchanged
between the network layer and the data link layer in the
same machine, or between network layer peers. In our
model, we give an assumption that the packet size is
fixed.
Maximum window size (w): window size is the
number of the unacknowledged frames in the sending
window or in the receiving window. The sender and the
receiver are of the same maximum window size w in our
model. Each of the sender and the receiver needs w
buffers to hold the unacknowledged frames.
Timeout period (Tt): a timer will go off within the
timeout period.
Bandwidth (B): it is the maximum amount of data
passing the channel at a given time. Usually, it depends
on the medium capacity of the communication channels
itself.
Process time of a packet (Ts): it is the time it takes
for a packet to send/receive to/from the channel, so
Ts=S/B.
Channel delay and round trip time (Tr): channel
delay is the time it takes for data to travel across the
channel. Round trip time is the time it takes for data to
travel across the channel from the sender to the receiver
and then back. In our model, we suppose that the channel

OCTOBRE 22, 2003, NBC NIEUWEGEIN, NL

PROCEEDINGS OF THE 4TH PROGRESS SYMPOSIUM ON EMBEDDED SYSTEMS


delay of the data frames and acknowledgement frames
have the same normal distribution with =Tr/2 for
various variance . Let has different values such as
0.1*Ts, 0.2*Ts or 0.5*Ts.
Probability of packets loss (Pl): it is the probability
of packets loss in the data frame channel or in the
acknowledgement frame channel. In our model, we will
study various situations such as packets lossless and
different probabilities of packets loss (e.g. 1%, 2% or
5%).
III. MODELING OF THE SW PROTOCOL
In this section, we create an abstract performance
model of the sliding window protocol using go back n in
POOSL. The POOSL language has a small set of very
powerful language primitives that it allows us to
represent a complex system in a concise and compact
way with a mathematically defined semantics [6,7]. The
remainder of this section is organized as follows. A
framework of the model is presented in the next
sub-section. A number of processors such as the network
layer processor, the SW protocol processor, the timer
processor and the physical layer processor in our model
are introduced after sub-section B.
A. Abstract Performance Model
Figure 1 shows a model of the SW protocol in POOSL.
The bigger window (above) in this figure presents a
general frame of the protocol. The left is the side of the
sender and the right is the receiver. Each side consists of
three processors (or cluster), i.e. a network layer
processor, a data link layer cluster and a physical layer
processor. The data link layer cluster shown in the
smaller window (below) in figure 1 contains a SW
protocol processor and a timer processor.
The model can present all the behavior of the protocol.
The sender in the left data link layer cluster fetches a
packet from the network layer processor via the channel
NLtoDLL, put it to a frame with some control
information such as frameKind, seqNum and enterTime,
and then sends it to the physical layer processor via the
channel DLLtoPL. In the mean time, the receiver in the
right data link layer cluster is waiting for receiving
frames from the physical layer processor. After receiving
a frame, the receiver checks the seqNum of the frame,
delivers the packet to the network layer processor via the
channel DLLtoNL, and generates an piggybacking
acknowledgement frame with a new packet from the
receiver to reply to the sender if the frame is in the
correct order. The whole communication procedure of
the protocol is already described in section II.

PROGRESS/STW 2003, ISBN 90-73461-37-5

Figure 1. A performance model of the sliding window


protocol in POOSL

B. Network Layer Processor


In our model, the network layer processor has two main
functions. It sends and counts the packets to the data link
layer cluster via a channel NLtoDLL. In the same time,
it is waiting for receiving packets from the data link layer
cluster through a port conDLL. We give a specification
of the functions in a method, for example,
startSendAndReceive()() in POOSL.
startSendAndReceive()() |p:Packet|
/*Check enableNetworkLayer Status before sending a packet */
conDLL?enableNetworkLayer(enableSendStatus);
sel
/* Sending packets to the data link layer */
[enableSendStatus]
conDLL!networkLayerReadyEnvet;
conDLL!packet(new(Packet)) setValueTo
(packetInfo+counter printString);
counter:=counter+1;
or
/* Waiting for receiving packets from the data link layer */
conDLL?packet(p) abort delay acceptPacketTime;
les;
startSendAndReceiver()().

C. Sliding Window Protocol Processor


The SW protocol processor is the core in our model. In
this processor, we model the sender, receiver, the sending
window and the receiving window described in section II.
We conclude four main functions as follows.
1) Fetches/delivers packets from/to the network layer
processor via the channel NLtoDLL;
2) Forms data frames with some control information,
and generates the acknowledgement frame;
3) Manages the sending/receiving windows in the SW

OCTOBRE 22, 2003, NBC NIEUWEGEIN, NL

PROCEEDINGS OF THE 4TH PROGRESS SYMPOSIUM ON EMBEDDED SYSTEMS


protocol processor;
4) Sends and resends the data/acknowledgement
frames using go back n to the physical layer processor
via the channel DLLtoPL.

E. Physical Layer Processor


We model the physical layer processor as two
directional channels. One channel is used to send the data
frames from the sender to the receiver. Another one is for
the piggybacked acknowledgement frames from the
receiver to the sender.
The packets in these channels will be delay a time. We
model the delay time as a normal distribution with =Tr/2
for various variance . We set as a different values such
as 0.1*Ts, 0.2*Ts or 0.5*Ts. The packets may be also lost
in these channels. We model the different loss
probabilities as a normal distribution with parameter
and . Here is set to be a value of 1%, 2% or 5%.
IV. PERFORMANCE ANALYSIS
We illustrate simulation results derived from the
performance model in this section. Our experiments
concentrate on the impacts of a number of parameters of
the protocol on the bandwidth utilization and on the
delay of the acknowledgements. These parameters
include the medium bandwidth, the window size, the
timeout period, the packet size and the probability of
packets loss.
A. Medium Bandwidth
In order to present the performance of the SW protocol,
we ignore the possibility of data error in the beginning.
Figure 2, 3 and 4 illustrate three simulation results in
different medium bandwidth environments. If we do the
same with the SW protocols, the behavior of the protocol
is determined entirely by the window size w in the sender
and the receiver.
In figure 2, we draw the curves of the bandwidth vs.
the window size on a 10 Mbps Ethernet LAN. We
suppose that the packet size S=1024 bytes, the round trip
time Tr=100 ms, the timeout period Tt=120 ms and no
packet loss. We can learn some experiences from this
simulation as follows.

PROGRESS/STW 2003, ISBN 90-73461-37-5

Bandwidth (M)

8
7
6
5
4
3
2
1
0
0

25

50

75
Window Size

100

125

150

Figure 2. Simulation results of the bandwidth


utilization on a 10Mbps Ethernet LAN: impact on the
bandwidth utilization as a function of the window size
with S=1024 bytes, Tr=100 ms, Tt=120 ms and no
packet loss
transmitted
acknowledged

Bandwidth(M)

After the sender transmits a frame, the timer processor


receives an event of starting a new timer from the SW
protocol processor, and then it starts the new timer
running.
When a timer goes off, the timer processor in our
model produces a timeout message to inform the SW via
an internal channel.

LAN 10M

LAN 100M

100
90
80
70
60
50
40
30
20
10
0
0

25

50

75
Window Size

100

125

150

Figure 3. Simulation results of the bandwidth


utilization on a 100Mbps Ethernet LAN with S=1024
bytes, Tr=10 ms, Tt=12 ms and no packet loss
transmitted
acknowledged

Wireless channel

0.6
0.5

Bandwidth (M)

D. Timer Processor

transmitted
acknowledged
10

0.4
0.3
0.2
0.1
0
0

10

15

20
Window Size

25

30

35

40

Figure 4. Simulation results of the bandwidth


utilization on a wireless channel with B=50 kbps,
S=100 bytes, Tr=500 ms, Tt=600 ms and no packet
loss

1) In order to keep the pipeline busy, we can set the


maximum window size as
w =Tr/Ts= Tr/(S/B)=122.
When the window size is round 122, the throughput of
the SW protocol is growing to maximum.
2) When the window size increases to

OCTOBRE 22, 2003, NBC NIEUWEGEIN, NL

PROCEEDINGS OF THE 4TH PROGRESS SYMPOSIUM ON EMBEDDED SYSTEMS

B. Window size
Figure 5 describes the curves of the bandwidth
utilization vs. the window size in the sender and receiver.
In the same figure, we show the impacts of the different
probabilities of packets loss on the bandwidth utilization.
Lossless

Loss 1%

Loss 2%

Lossless

25

50

75
WindowSize

100

125

150

Figure 5. The bandwidth utilization vs. window size


curves, and impact of different probabilities of
packets loss in the channels on the bandwidth
utilization in a 100M Ethernet LAN with S=1024 bytes,
Tr=10 ms, Tt=12 ms

We can get some conclusions from this exercise. In no


packet loss channels, the window size have a dramatic
effect on the throughput of the protocol as we described
in sub-section A. However, with the increase of the
probabilities of packets loss in the channel, the
throughput becomes insensitive about the window size. If
we set the window size exceeding a number which is
smaller than the maximum window size, the throughput
is not growing. Figure 6 can give us an overview of the

PROGRESS/STW 2003, ISBN 90-73461-37-5

Loss 2%

Loss 5%

100000
80000
60000
40000
20000
0
0

25

50

75
Window Size

100

125

150

Figure 6. The delay of the acknowledgements vs. the


window size curves on a 100M Ethernet LAN with
S=1024 bytes, Tr=10 ms, Tt=12 ms

C. Timeout period
Timeouts play a crucial role in the network performance.
Figure 7 illustrates the impacts of timeout periods on the
bandwidth utilization in a 100M Ethernet LAN. For
reliable communication channels, a high timeout value
doesnt appear to reduce throughput. But for unreliable
channels, a high timeout period will affect the
performance unfavorably.
Transmitted

Loss 5%

100
90
80
70
60
50
40
30
20
10
0

Loss 1%

120000

Bandwidth(M)

Bandwidth(M)

transmitted

delay of acknowledgements. The probabilities of packets


loss will affect the delay of acknowledgements
dramatically.

Acknowledgement Delay(s)

w =Tt/Ts= Tt/(S/B)=146,
the throughput will be dropped rapidly.
3) Due to the receiver uses the policy of the
piggybacked acknowledgement in our model, when a
data frame arrives to the receiver, the acknowledgement
cannot generated immediately and should wait to the
next data frame which is sent by the receiver. The
half-bandwidth capacity is wasted in this case when we
set the window size not bigger enough.
Figure 3 presents the simulation results on a 100 Mbps
Ethernet LAN. In this case we can also get w =122 and
w =146. Figure 4 presents some results on the wireless
channel. The medium bandwidth capacity is 50 kbps, the
packet size S=100 bytes, the round trip time Tr=500 ms,
the timeout period Tt=600 ms and no packet loss. In the
same way, we can get w=31 and w=38.
This exercise is shown that we can derive similar
performance results in different medium bandwidth
environments with no packet loss. It is significant for the
high performance network. In many network, errors are
very rare so these simulation results is close to reality.

Lossless

Loss 1%

Loss 2%

Loss 5%

100
90
80
70
60
50
40
30
20
10
0
10

15

20
Timeout Period (ms)

25

30

Figure 7. Impact of the timeout periods on the


bandwidth utilization in a 100M Ethernet LAN with
S=1024 bytes, Tr=10 ms, Tt=12 ms and the different
probabilities of packets loss in the channels

D. Packet size
The simulation results of curves of the bandwidth
utilization vs. the packet sizes shown in figure 8 are
derived on a 100Mbps Ethernet LAN. A bigger enough
packet generally gives better performance. However, too
bigger packet size fills up the pipeline, the performance
will be drop off.

OCTOBRE 22, 2003, NBC NIEUWEGEIN, NL

PROCEEDINGS OF THE 4TH PROGRESS SYMPOSIUM ON EMBEDDED SYSTEMS

Transmittedl

Lossless

Loss 1%

Loss 2%

Loss 5%

100
90

[7] L.J. van Bokhoven. Constructive Tool Design for Formal


Languages: From Semantics to Executing Models. PhD thesis,
Eindhoven University of Technology, Department of Electrical
Engineering, 2002.

Bandwidth (M)

80
70
60
50
40
30
20
10
0
0

5000

10000
15000
Packet Size (bytes)

20000

25000

Figure 8. Impact of the packet sizes on the bandwidth


utilization in a 100M Ethernet LAN with S=1024 bytes,
Tr=10 ms, Tt=12 ms and the different probabilities of
packets loss in the channels

V. CONCLUSIONS
In this paper we have presented an abstract executable
performance model of the sliding window protocol in the
modeling language POOSL. Some simulation results can be
derived from the model. These results illustrated a number
of key-parameters affecting the overall performance of the
protocol. We have discussed that the impacts of the
key-parameters on the bandwidth utilization and the delay
of the acknowledgement in several network environments
and different parameter settings. It is shown that the
window size, the timeout period and the probability of
packets loss are effect on the performance characteristics of
the protocol dramatically.
For our future work, we would like to extend the model to
the sliding window protocol using selective repeat. More
parameters and complex network environments should be
investigated in our model. We are also interested in the
comparison between the simulation results and the
measurements in a real network.

REFERENCES
[1] N.V. Stenning. A data transfer protocol. Computer Networks,
1(2):99-110,1976.
[2] Eric Madelaine and Didier Vergamini. Specification and
Verification of a Sliding Window Protocol in LOTOS. FORTE
'91, Sydney, Australia, November 1991, pages 495-510.
[3] Mark A. Smith and Nils Klarlund. Verification of a Sliding
Window Protocol Using IOA and MONA. FORTE/PSTV 2000,
Pisa, Italy, October 2000, pages 19-34.
[4] Dmitri Chkliaev, Jozef Hooman and Erik de Vink. Formal
Verification of an Improved Sliding Window Protocol. In
proceeding of the PROGRESS 2002, Utrecht, The Nethelands,
October 2002, pages 18-27.
[5] A.S. Tanenbaum. Computer Networks. Prentice-Hall International, Inc., 1996.
[6] P.H.A.van der Putten and J.P.M. Voeten. Specification of
Reactive Hardware/Software Systems. PhD thesis, Eindhoven
University of Technology, Department of Electrical Engineering,
1997.

PROGRESS/STW 2003, ISBN 90-73461-37-5

OCTOBRE 22, 2003, NBC NIEUWEGEIN, NL

Vous aimerez peut-être aussi