2 performance-06

Transcript

2 performance-06
Prestazioni di un sistema di
comunicazione: metriche
Reti e Protocolli
rassegna (II)
• Throughput (larghezza di banda)
– analogico: range di frequenze ammissibili
– digitale (bps): numero di bit che possono essere trasmessi su
un canale nell’unità di tempo.
• ad esempio: 10Mbps => 0.1 microsec per ogni bit
– teorico vs. in pratica
– Larghezza di banda collegata a “larghezza di un bit”
• 1Mbps corrisponde a bit di larghezza 1!s
• 2Mbps corrisponde a bit di larghezza 0.5!s
Francesco Dalla Libera
[email protected]
• Latenza (ritardo): quanto tempo impiega un messaggio
a “viaggiare” da un estremo all’altro del canale
– Interessa a volte il tempo di Andata e Ritorno (RTT)
notazione: attenzione!
Prestazioni
• nel campo delle reti e comunicazioni
– 1K
– 1M
– 1G
:
:
:
103
106
109
• nel campo delle dimensioni (size)
– 1K
– 1M
– 1G
:
:
:
210 = 1024
220 = 1024 * 1024
230 = 1024 * 1024 * 1024
1. Latenza = Propagazione + Trasmissione + Coda
2. Propagazione = Distanza / VelocitàDellaLuce
3. Trasmissione = Dimensione / LarghezzaBanda
latenza vs. larghezza di banda
Prestazioni
Per qualche applicazione la latenza domina la larghezza di banda
1.
2.
Un client invia una richiesta di 1 byte ad un server e riceve una
response di 1 byte
=> domina RTT
un’applicazione recupera un’immagine da 25MB
=> la larghezza di banda domina.
–
–
–
–
•
Canale con banda da 10Mbps
Trasmissione = 25MB / 10Mbps ~ 20 sec
Latenza poco “pesante”
attenzione: trasmetto un file da 1MByte su di un canale da 1Mbps
• Trasmissione = 8 Mb / 1 Mbps = 8*220 b / 106 bps > 8 sec
in low-bandwidth network paths the transmission time of a
packet is a large portion of the round-trip time
• VelocitàDellaLuce
= 300,000 km/sec nel vuoto
– (3 microsec/km)
= 250,000 km/sec in cavo
= 200,000 km/sec in fibra
• Esempi:
– Satellite a 36,000 km di altezza
– RTT 500 msec tra due stazioni a terra connesse tramite il
satellite
Distanza piccola: software overhead può dominare
Stop and Wait Flow Control
Prestazioni
• Latenza x Larghezza_di_Banda:
– numero di bit che il canale può tenere
latenza
b
a
n
d
a
tframe
Data
tprop
Data
Ack
ad es. 100ms e 45Mbps = 560KB di dati
• RTT x Larghezza_di_Banda:
numero di bit che il Mittente deve trasmettere prima di ricevere
una risposta dal Ricevente
Ack
stop and wait protocol performance
•
•
•
•
•
•
Length of data packet (bits) = D
Number of overhead bits/packet = no
Frame size (nf) = D + no
Link Rate (bps) = R
Length of Ack Packet (bits)= na
One-way propagation delay = ! (RTT = 2!)
• Processing time = tproc
(in receiver and transmitter)
Error and Flow Control Performance-Stop & Wait
Effective rate and utilization
• tack = na/R ; tf = nf/R
• Time to transmit one frame = to
… waiting next transmission …
• to = tf + tack + 2 ! + 2 tproc =
2(! + tproc ) + (na + nf)/R
Protocolli Sliding Window
Example
tframe
Frame size = 1024 bytes
( Overhead = Ack = 8 bytes )
! = 50 ms
Data
tprop
Ack
Case 1: R = 30 Kbps => Efficiency = 73%
Case 2: R = 1.5 Mbps => Efficiency = 5%
Performance
Sliding Window Protocol
•
•
•
•
Case 1: Large window
Window Size = N
Transmit N packet and wait for Ack
Making the same assumption as before
• First Ack arrives at sender at:
2! + nf / R
Performance-2
• Case 1: Large window
If Nnf / R > 2! + nf / R
{ time to transmit N packets > time to get First Ack }
Then channel is always busy sending packets
Performance-3
• Case 2: Small Window
If Nnf / R < 2! + nf / R
{ time to transmit N packets < time to get First Ack }
Then channel is Not always busy sending packets:
Time is wasted waiting for an Ack
Example
• Frame size = 1024 bytes
• Overhead = Ack = 0 bytes
! = 1 ms
• Rate = 40 Mbps
• Case 1: N = 10 => Efficiency = 100% => 40 Mbps
• Case 2: N = 8 => Efficiency = ~75% => 30 Mbps
• Case 2: N = 4 => Efficiency = ~ 37% => 15 Mbps
Note you can control the rate by changing N
Performance-4
•
•
•
•
Time to transmit one window = Nnf / R
Number of bits sent = Nnf
Time to send Nnf bits = 2! + nf / R
Effective rate = Nnf /(2! + nf / R )
• Efficiency = Effective Rate / R =
= Nnf /(2!R + nf )
Ma … attenzione!
Nel fare i conti con i protocolli effettivi
TCP, UDP, HTTP, ecc
bisognerà attenersi con attenzione alla
specifica politica di trasmissione dei pacchetti!
home work
• Find three locations in the Internet where you can identify
their geographic location, such as universities.
• Pick institutions that are close by, across the Europe and as
far away as you can think of.
• Determine the physical distance between your location and
that university.
• Measure, using ping -s, the round-trip time to the
university and compare it with the geographical distance.
• How good a predictor is the geographical distance of the
network delay or vice versa?
homework
Calcolare il tempo totale necessario per trasferire un file di 1.5 MB
nei seguenti casi, ipotizzando un RTT di 80ms, una dimensione del
Pacchetto di 1KB e un tempo iniziale per il setup della connessione
(handshaking) pari a 2 RTT.
a)
Banda di 10Mbps: i pacchetti dati possono essere inviati uno dietro
l’altro
b) Banda di 10Mbps: trasmissione con stop-and-wait
c) Banda infinita (tempo di trasmissione uguale a zero): per ogni RTT
si possono inviare al più 20 pacchetti
d) Banda infinita: durante il primo RTT si può inviare un pacchetto,
durante il secondo RTT due pacchetti, durante il terzo RTT quattro
pacchetti e così via (al passo N: 2 N-1 pacchetti)