You are on page 1of 19

t1-1

Test1: Solutions
Silvia Giordano
ICA, EPFL
t1-2
EX1: Delay
Consider sending two large files File1 and File2
from host A to host B. The size of the files is F1
and F2=3*F1 bits, respectively. The two hosts are
connected by two single point-to-point links both of
m meters. Suppose that the propagation speed
along both links is s meters/sec. Suppose that the
links are uncongested (that is, no queuing delays),
and that the link rate of link1 is R1 bps, and the link
rate of link2 is R2 bps. A can transmit on both links
in parallel. Answer the following questions:
A B
link 1
link 2
A B
link 1
link 2
t1-3
EX1: Delay
1) Suppose there is no segmentation (the
transmission unit is the entire file). If A starts at
time t=t
0
at what time, at earliest, B can receive
the whole File1?
The fastest way is to send File 1 on the link with
larger rate, max(R1,R2). The File 1 is received, at
earliest, at:
t = t0 + m/s + F1/(max(R1,R2))
F1
max(R1,R2))
A B
File1
t
0
transmission delay
F1/(max(R1,R2))
propagation
delay m/s
t1-4
EX1: Delay
2) If A starts at time t=t
0
at what time, at
earliest, B can receive the whole File2?
t = t0 + m/s + F2/(max(R1,R2))
F2
max(R1,R2))
A B
File2
t
0
transmission delay
F2/(max(R1,R2))
propagation
delay m/s
t1-5
EX1: Delay
3) If A starts at time t=t
0
at what time, at
earliest, B can receive the whole File1 and the
whole File2?
t = t0 + m/s + min{ P1, P2)}
P1= max{ F1/min(R1,R2) , F2/max(R1,R2) }
P2 = (F1+F2)/max(R1,R2)
A B
A B
File1+ File2
t
0
transmission delay
P2=(F1+F2)/(max(R1,R2))
propagation
delay m/s
File1
t
0
transmission delay
P1 = max{F1/min(R1,R2) , F2/max(R1,R2) }
propagation
delay m/s
File2
t=t0 + m/s +
min{ P1, P2)}
t1-6
EX1: Delay
4)Suppose that host A segments the file into
segments of S=F1 bits each and adds h bits
of header to each segment, forming packets
of L = h + S bit. In this question, we suppose
R1=R2=R. Which is the best transmission
strategy for transmitting both File1 and
File2? Sequential (first one file, and, when
possible, the other one) or parallel (start to
transmit the two files at the same time)?
Why?
t1-7
EX1: Delay
As S=F1 and R1=R2=R, the 2 strategies are
equivalent:
Sequential: start sending File 1. As S=F1, there
is only one segment, which is sent on one link.
Thus, the other link can be used to start sending
File 2. When File 1 ends, we can start using the
2 links in parallel:
t = 2L/R + t0 + m/s
link1
link2
t1-8
EX1: Delay
As S=F1 and R1=R2=R, the 2 strategies are
equivalent:
Parallel: start sending File 1 on one link and File 2
on the other link. When File 1 ends, we can start
using both links for File 2:
t = 2L/R + to + m/s
link1
link2
t1-9
EX2: JAVA
Consider the Intranet INTRA007 in the diagram
3, with addresses 111.1.1.0/24. Security is a
high concern of INTRA007 and people from
inside can go out only with SMTP protocol (email).
A
B
G
INTERNET
INTRA007
A
B
G
INTERNET
INTRA007
t1-10
EX2: JAVA
The gateway G is the access node to/from the
Internet. When a person from inside wants to send
an email, he accesses the INTRA007-userinterface
that passes the users data to the INTRA007-
emailClient. The INTRA007-emailClient builds, with
the user data, the following packet, and then it
sends it.
A
B
G
INTERNET
INTRA007
A
B
G
INTERNET
INTRA007
T
o
G
e
m
a
i
l
t1-11
EX2: JAVA
1) Describe what happens to the mail written by
the users before eventually getting to the
Internet.
The mail is controlled by G. It checks both the
recipients and the data of the mail.
2) Describe what is G.
G is a controller working on UDP. Technically, it is
called an application gateway (will see it next week).
t1-12
EX2: JAVA
3) Suppose A, B and C clients contact G at the
same time and they enter as following in the
incoming request queue on the host that runs G:
[A, C, B]. At time t, when G receives the first
packet, what is going on at A, B and C?
A, B and C have sent their packet to G. They have
closed the UDP socket and they will not wait for
any ACK. The packet from A is being received.
After the execution of the datagrampacket.receive
for packet sent by A, the packet the packet sent
by C is received, and finally, so is the one sent by B.
t1-13
EX2: JAVA
4) How would you introduce the access to the Web
(HTTP), respecting the same security-based
philosophy? (You are not required to write any
code, just to describe the architecture and how
it works).
When a user wants to access a web page from/at
INTRA007, he accesses the
INTRA007.userInterface that passes the users
data to INTRA007.web. This controls the data and
check whether the client/server are authorised.
If so, the connection is started.
t1-14
EX3: GBN and SR
Consider the Go-back-N and Selective Repeat
protocols. Suppose the sequence number space is,
for both, of size k. Assume that the round-trip-
time between the sender S and the receiver R is
constant and equal to RTT seconds.
sender S receiver R
pkt0
pkt1
constant RTT
t1-15
EX3: GBN and SR
1) What is the largest allowable sender window for
Go-back-N that will avoid the problem of
understanding if a packet is a new packet or a
retransmission, as we analyzed in class?
The sender window has to be smaller than k/2.
2) What is the largest allowable sender window for
Selective Repeat that will avoid the same
problem?
k/2
t1-16
EX3: GBN and SR
3)Suppose that the whole session consists of h
packets and that the sender S starts to send the
first packet at time t=t
0
. Suppose that the
packet pkt2 is lost, and that there are no other
losses afterwards. In this question, we suppose
that the transmission delay of a packet is
seconds and that the retransmission timer
(timeout) starts when sender S starts
transmitting the packet. At what time, at
earliest, the receiver R can receive the last
packet pkth if Go-Back-N protocol is used?
t1-17
EX3: GBN and SR
The pkt0 and pkt1 are correctly transmitted, with
pkt2, the timer is started at time t=2. When it
expires, all packets from pkt2 must be
retransmitted. To this time we must add the time
for propagating a packet to B (rtt/2):
t = t0 + rtt/2 + 2 + timeout + (h-2)
= t0 + rrt/2 + timeout + h
S R
pkt0
pkt1
t
i
m
e
o
u
t

p
k
t
2
pkt2
pkt3
t1-18
EX3: GBN and SR
4) Suppose that the whole session consists of h
packets and that the sender S starts to send the
first packet at time t=t
0
. Suppose that the packet
pkt2 is lost, and that there are no other losses
afterwards. At what time, at earliest, the receiver
R can receive the last packet pkth if Selective
Repeat protocol is used?
t1-19
EX3: GBN and SR
All packets, but pkt2, are correctly transmitted.
When timer expires, only pkt2 is retransmitted. To
this time we must add the time for propagating a
packet to B (rtt/2):
t = t0 + rtt/2 + 2 + max(timeout,(h-2) ) +
S R
pkt0
pkt1
t
i
m
e
o
u
t

p
k
t
2
pkt2
pkt3
pkt4
pkt5
S R
pkt0
pkt1
t
i
m
e
o
u
t

p
k
t
2
pkth
pkt3
pkt4
pkt5
pktk
pkt2
pkt(k+1)

You might also like