Salta al contenuto
Note per Studenti Network Performance Analysis Report

Network Performance Analysis

In questa pagina 9

Units: the first trap

  • bit/s (also bps): bits sent or received per second. 11 kbit/s =103=10^3 bit/s, 11 Mbit/s =106=10^6 bit/s, 11 Gbit/s =109=10^9 bit/s, 11 Tbit/s =1012=10^{12} bit/s. In networks prefixes are powers of 10, not of 2.
  • byte/s (B/s): 11 B =8=8 bit, so 11 kB/s =8=8 kbit/s.

In exercises capital or lowercase in the unit is often the trap (MB versus Mb, kB versus kbit): always convert everything to bits and seconds before computing.

Example. A 2525 MB (megabyte) file is 25⋅8=20025\cdot8=200 Mbit; at 100100 Mbit/s it takes 200/100=2200/100=2 s, not 0.250.25 s.

The main metrics

Family Metrics
Traffic bitrate, throughput, goodput
Delay end-to-end delay, jitter, RTT
Pipe capacity bandwidth-delay product (BDP)
Reliability PER, PDR, PLR

Bitrate and bandwidth

The word "bandwidth" has two meanings, not to be confused:

  • bandwidth in hertz, WW [Hz]: range of frequencies of a modulated signal, or range of frequencies a channel passes with acceptable attenuation;
  • bitrate (also loosely "bandwidth"), R0R_0 [bit/s]: maximum bit-level transmission speed of a link, i.e. the best rate it can offer to the upper layers; typically the maximum of the physical or MAC layer.

They are tied by the channel capacity: on a channel with white Gaussian noise and signal-to-noise ratio SNR (a linear ratio, not dB), error-free transmission is possible only if R0<C=Wlog⁡2(1+SNR)R_0<C=W\log_2(1+\text{SNR}). Example: W=1W=1 MHz and SNR =30=30 dB =103=10^{3} (linear): C=106log⁡2(1001)=9.97C=10^{6}\log_2(1001)=9.97 Mbit/s. To get more bitrate one needs more bandwidth WW or more SNR.

Throughput and goodput

Definition (throughput). The throughput SS [bit/s, packets/s, packets/slot] is the average rate at which the user's information units (PDUs) are successfully delivered to the destination peer entity. It depends on the time interval over which it is computed. Always S≤R0S\le R_0.

Why SS is below R0R_0:

  1. the user may not saturate the link (sends less than it could);
  2. the link may be congested or shared among several flows;
  3. there may be retransmissions of packets already sent (for reliability): retransmitted bits occupy the link but carry no new information;
  4. medium access protocols introduce dead times (Multiple Access Protocols - ALOHA and CSMAWhen several stations share a medium a medium access (MAC) protocol must decide who transmits. Random access: pure ALOHA (transmit immediately, vulnerable time 2 t_F), slotted ALOHA (start only at slot boundaries, vulnerable t_F), CSMA (listen before talking, vulnerable tau_p) with 1-persistent, non-persistent and p-persistent variants, CSMA/CD (detects collisions while transmitting: needs t_F >= 2 tau_p, hence a minimum frame) and the Wi-Fi CSMA/CA (IFS, contention window with backoff, ACK, RTS/CTS and NAV). Controlled access: reservation, polling, token. Channelization: FDMA, TDMA, OFDMA, CDMA, SDMA.Multiple Access Protocols - ALOHA and CSMA →).

Example. A protocol over the physical layer offers 10001000 bit/s; if it detects errors and asks to retransmit 1010 bits every 10001000, the throughput drops to 990990 bit/s.

Definition (goodput). The goodput is the throughput at the application layer: it counts only the useful bits delivered to the application, without the headers added by the lower layers and without retransmissions. The ratio between header bits and useful bits is the overhead.

Example. The application generates a 12001200 B packet every 1010 ms; lower layers add 6060 B, so 12601260 B go to the physical layer every 1010 ms. Throughput at the PHY =1260⋅8/0.01=1.008=1260\cdot8/0.01=1.008 Mbit/s; goodput at the application =1200⋅8/0.01=960=1200\cdot8/0.01=960 kbit/s; overhead =60/1200=5 %=60/1200=5\,\%.

Bottleneck

Property (throughput of a path). On a path with links of bitrates R1,…,RnR_1,\dots,R_n in series, the throughput is S=min⁡{R1,…,Rn},S=\min\{R_1,\dots,R_n\}, that of the bottleneck link.

Why: if Rs<RcR_s<R_c the bits pushed by the server (at RsR_s) pass through the router and reach the client at RsR_s. If Rc<RsR_c<R_s the router cannot forward bits as fast as it receives them: they leave at RcR_c and what does not leave builds up in the queue.

Example. Server Rs=2R_s=2 Mbit/s, client Rc=1R_c=1 Mbit/s: throughput =min⁡{2,1}=1=\min\{2,1\}=1 Mbit/s.

Beware of shared links. If 1010 servers and 1010 clients download through a common link of capacity R=5R=5 Mbit/s, with Rs=2R_s=2 Mbit/s and Rc=1R_c=1 Mbit/s, the answer "the bottleneck is the client access because Rc<Rs<RR_c<R_s<R" is wrong: the common link splits its capacity equally among the 1010 downloads, so each gets 5/10=0.55/10=0.5 Mbit/s <Rc=1<R_c=1 Mbit/s, and the shared link is the bottleneck: each download gets 500500 kbit/s.

End-to-end delay

Formula (end-to-end delay). The time to deliver a message to the destination, from the instant the first bit leaves the source, is the sum of four contributions: dtot=dproc+dqueue+dtrans+dprop.d_{tot}=d_{proc}+d_{queue}+d_{trans}+d_{prop}.

Each has a different cause and remedy.

Processing delay dprocd_{proc}: time for a router or the destination host to take the packet from the input port, strip the header (PCI), run the error check and hand it to the output port (router) or the upper layer (host). Varies per packet but is computed on average and is often negligible. Reduced by efficient routing mechanisms.

Queueing delay dqueued_{queue}: time a packet spends in the input and output queues of a router. It depends on the traffic intensity, not only on link characteristics. Only partly controllable (traffic priorities, scheduling, call admission control). It is computed by modelling the link as a queueing system: Introduction to Queueing TheoryA queueing system is made of an arrival process (Poisson, rate lambda), a queue and one or more servers with service rate mu. Offered load G = lambda/mu, load factor rho = lambda/(m mu): the system is stable only if rho < 1, and then the throughput is lambda (otherwise m mu). Little's law E[x] = lambda E[s] holds for any discipline. M/M/1: E[x] = rho/(1-rho), E[s] = (1/mu)/(1-rho), E[w] = (rho/mu)/(1-rho). With deterministic service (M/D/1, a special case of Pollaczek-Khinchin): E[w] = rho/(2 mu (1-rho)). The delay grows without bound as rho tends to 1.Introduction to Queueing Theory →.

Formula (transmission delay). To put all bits of a packet of length LL on the line (one bit after the other) at bitrate RR: dtrans=LR.d_{trans}=\frac{L}{R}.

Example. A 1010 kbit packet on Fast Ethernet at 100100 Mbit/s: dtrans=104/108=100 μsd_{trans}=10^4/10^8=100\ \mu\text{s}. Reduced by raising the link bitrate.

Formula (propagation delay). Time for a bit to go from one end of the medium to the other, at speed vv over distance dd: dprop=dv.d_{prop}=\frac{d}{v}. In vacuum v=c=3⋅108v=c=3\cdot10^{8} m/s; in cables v≈2⋅108v\approx2\cdot10^{8} m/s (copper and fibre: light in the medium goes at c/nc/n with refractive index n≈1.5n\approx1.5).

Example. A 60006000 km transoceanic cable: dprop=6⋅106/2⋅108=30d_{prop}=6\cdot10^{6}/2\cdot10^{8}=30 ms. Propagation delay cannot be reduced ("it is physics"); it is negligible only in short terrestrial networks, not on satellite links, long cables and very high-speed links.

Which terms to keep (rule of thumb)

  • Usually dprocd_{proc} and dqueued_{queue} are neglected.
  • dpropd_{prop} is neglected for short-range terrestrial radio networks, not for satellites and long cables.
  • If the text gives the link length or the propagation delay, that term must be included.

With kk equal links in series and a single packet, every router receives the whole packet before forwarding it (store-and-forward, see Circuit Switching and Packet SwitchingA switching node can connect input to output in three ways. Circuit switching sets up a dedicated physical connection first (telephone network), delivery time T = 3N t_p + N t_s + M/R. Datagram packet switching splits the message into K packets with a header, each routed independently with store-and-forward, T = N t_p + (N+K-1)(M/K+H)/R, with optimal K = sqrt((N-1)M/H). Virtual circuit has three phases (setup, data, teardown): a dedicated logical connection without dedicated resources, with a local identifier that changes at each hop.Circuit Switching and Packet Switching →), so each link adds dtrans+dpropd_{trans}+d_{prop}: dtot=k(LR+dv)(no processing or queueing).d_{tot}=k\left(\frac LR+\frac dv\right)\quad(\text{no processing or queueing}).

Example. k=10k=10 links of 1010 km at 100100 Mbit/s, packet 12601260 B (with v=2⋅108v=2\cdot10^{8} m/s). On one link:

  • the packet is 1260⋅8=10 0801260\cdot8=10\,080 bit;
  • transmission: dtrans=L/R=10 080/108=100.8 μd_{trans}=L/R=10\,080/10^{8}=100.8\ \mus;
  • propagation: dprop=d/v=104/(2⋅108)=50 μd_{prop}=d/v=10^{4}/(2\cdot10^{8})=50\ \mus;
  • one link: 100.8+50=150.8 μ100.8+50=150.8\ \mus; ten in series, since each router waits for the whole packet: dtot=10⋅150.8=1508 μd_{tot}=10\cdot150.8=1508\ \mus.

The delay grows linearly with the number of links, with slope dtrans+dpropd_{trans}+d_{prop} per link.

Jitter

Definition (jitter). The jitter JJ [s] is the variation of delay between packets of the same flow: different packets meet different delays (different queues), and a time-sensitive application at the receiver suffers.

A constant delay is no problem for video streaming, but freezing the picture halfway is very annoying. With large jitter a long playout delay and large playout buffers are needed: the content is buffered for a while before starting.

Round Trip Time (RTT)

Definition (RTT). The round trip time of a connection A→BA\to B is the time from when a packet leaves AA to when the corresponding acknowledgment (ACK) returns to AA: RTT=dproc+dqueue+dtrans+dprop⏟A→B, data+dproc+dqueue+dtrans+dprop⏟B→A, ACK.RTT=\underbrace{d_{proc}+d_{queue}+d_{trans}+d_{prop}}_{A\to B,\ \text{data}}+\underbrace{d_{proc}+d_{queue}+d_{trans}+d_{prop}}_{B\to A,\ \text{ACK}}. Neglecting processing and queueing, with tFt_F the frame transmission time, tAt_A the ACK one and τp\tau_p the one-way propagation: RTT=tF+tA+2τpRTT=t_F+t_A+2\tau_p. With small ACK (tA≈0t_A\approx0) and small frame: RTTmin≈2τpRTT_{min}\approx2\tau_p.

The ACK is generally much smaller than the data. RTT is not the end-to-end delay: the end-to-end delay is the time something takes to go from source to destination; the RTT is the time of a request and its response.

Example. Frame of 1010 kbit on a 1010 Mbit/s link (tF=1t_F=1 ms), ACK of 100100 bit (tA=10 μt_A=10\ \mus), propagation τp=5\tau_p=5 ms: RTT=1+0.01+2⋅5=11.01RTT=1+0.01+2\cdot5=11.01 ms.

Pipe capacity: bandwidth-delay product

Definition (BDP). The bandwidth-delay product is the maximum average number of bits that can be transferred in an interval equal to the delay, i.e. the bits that "fill" the link: BDP [bit]=maximum throughput [bit/s]⋅delay [s].\text{BDP [bit]}=\text{maximum throughput [bit/s]}\cdot\text{delay [s]}. It is often defined with the RTT: then it is the number of bits that can be transmitted without having yet received an acknowledgment. In packets: BDP/F\text{BDP}/F (pipe capacity).

Picture: bitrate 55 bit/s and delay 55 s; after 55 s the first group of 55 bits arrives and the pipe holds 5⋅5=255\cdot5=25.

Example. A 1010 Mbit/s link with τp=5\tau_p=5 ms (RTT≈2τp=10RTT\approx2\tau_p=10 ms =0.01=0.01 s): BDP=107⋅0.01=105BDP=10^{7}\cdot0.01=10^{5} bit =100=100 kbit; with 1010 kbit packets the pipe capacity is 1010 packets. To keep the channel full 1010 packets must be sent before the first ACK returns: this is the link with the window of the protocols in ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective RepeatARQ (Automatic Repeat reQuest) makes an error-prone link reliable: the receiver acknowledges (ACK) frames received correctly and the sender retransmits when the timeout expires. Timeouts (against deadlock) and sequence numbers (against duplicates) are needed. With t_G = t_F + 2 tau_p + t_A and error probability p: Stop-and-Wait rho = t_F(1-p)/t_G; Go-Back-N with window N >= t_G/t_F rho = (1-p)/(1+(N-1)p); Selective Repeat rho = 1-p. Efficiency eta = rho I/F. The optimal window is the pipe capacity in packets. For Selective Repeat there is also an optimal frame length: with overhead o and bit error probability P_b, x_opt is about o/2 + sqrt(o/P_b) (shorter frames when the channel errs more).ARQ Protocols - Stop-and-Wait, Go-Back-N and Selective Repeat →.

Definition (link efficiency). If BsentB_{sent} bits are transmitted before an acknowledgment is received, the efficiency (link utilization) is the fraction of the pipe filled: η=BsentBDP(≤1).\eta=\frac{B_{sent}}{BDP}\quad(\le1).

Example. If the pipe holds 100100 kbit and 1010 kbit are sent before waiting for the ACK: η=10/100=10 %\eta=10/100=10\,\%.

The efficiency of a stop-and-wait protocol follows. The sender sends a frame (occupying the channel for tFt_F) and waits for the ACK: in each cycle of duration tF+2τpt_F+2\tau_p (ACK neglected) the channel is used only for tFt_F. Dividing numerator and denominator by tFt_F and setting a=τp/tFa=\tau_p/t_F (normalized propagation): η=tFtF+2τp=11+2τp/tF=11+2a.\eta=\frac{t_F}{t_F+2\tau_p}=\frac{1}{1+2\tau_p/t_F}=\frac1{1+2a}. It collapses when the link is "long" compared with the transmission time. It is the same η=Bsent/BDP\eta=B_{sent}/BDP: indeed Bsent=RtFB_{sent}=Rt_F and BDP=R(tF+2τp)BDP=R(t_F+2\tau_p), and RR cancels.

Grafico interattivo: Stop-and-wait efficiency eta = 1/(1+2a) versus a = tau_p/t_F: it is 1 for a = 0, 1/3 for a = 1, about 0.05 for a = 10

Reliability

The physical layer may deliver packets with errors: low signal-to-noise ratio (SNR) at the receiver (attenuation), strong interference or collisions.

  • PER (Packet Error Rate): packets delivered with errors / packets transmitted. If each bit is wrong with probability pp (bit error rate, depending on the SNR), independently of the others, a packet of LL bits is correct only if all LL bits are: PER=1−(1−p)LPER=1-(1-p)^L.
  • PDR or PRR (Packet Delivery/Reception Rate): packets delivered successfully / packets transmitted; PDR=1−PERPDR=1-PER.
  • PLR (Packet Loss Rate): fraction of transmitted packets not delivered for any reason (errors or buffer overflow).

Example (from bit to packet). p=10−5p=10^{-5} and L=12 000L=12\,000 bit (15001500 B): PER=1−(1−10−5)12000≈1−e−0.12=0.113PER=1-(1-10^{-5})^{12000}\approx1-e^{-0.12}=0.113, i.e. 11 %11\,\% of packets have errors although only one bit in a hundred thousand is wrong (for small pp, (1−p)L≈e−pL(1-p)^L\approx e^{-pL}).

Example. Out of 10001000 packets, 3030 arrive with errors and 1010 are dropped for full buffer: PER=30/1000=3 %PER=30/1000=3\,\%, PDR=97 %PDR=97\,\% (counting only errors), PLR=(30+10)/1000=4 %PLR=(30+10)/1000=4\,\%.

Versione ripasso

Units. 11 B =8=8 bit. Prefixes are powers of 10: 11 kbit/s =103=10^3 bit/s, 11 Mbit/s =106=10^6 bit/s, 11 Gbit/s =109=10^9 bit/s. Convert everything to bits and seconds before computing.

  • Example: a 2525 MB file is 25⋅8=20025\cdot8=200 Mbit; at 100100 Mbit/s it takes 22 s, not 0.250.25 s.

Traffic.

Bottleneck.

  • Links in series: S=min⁡{R1,…,Rn}S=\min\{R_1,\dots,R_n\}.
    • Example: server 22 Mbit/s, client 11 Mbit/s: S=1S=1 Mbit/s.
  • Shared link: with nn flows each gets about R/nR/n. If 1010 downloads share R=5R=5 Mbit/s each gets 500500 kbit/s: the bottleneck is the common link, not the client access, even if Rc<Rs<RR_c<R_s<R suggests the opposite.

End-to-end delay.

Jitter. JJ [s] is the variation of delay between packets of the same flow. A constant delay does not hurt; large jitter needs a playout delay and larger buffers.

Round trip time (RTT).

  • RTT=tF+tA+2τpRTT=t_F+t_A+2\tau_p, with tFt_F frame transmission time, tAt_A ACK one, τp\tau_p one-way propagation. With small frame and ACK RTTmin≈2τpRTT_{min}\approx2\tau_p.
    • Example: tF=1t_F=1 ms, tA=10 μt_A=10\ \mus, τp=5\tau_p=5 ms: RTT=1+0.01+10=11.01RTT=1+0.01+10=11.01 ms.
  • RTT is round trip (request and acknowledgment). It is not the end-to-end delay, which is one-way.

Pipe capacity (BDP).

Reliability.

  • PERPER = packets delivered with errors // packets transmitted; with independent bit errors PER=1−(1−p)LPER=1-(1-p)^L.
  • PDR=1−PERPDR=1-PER = packets delivered successfully // transmitted.
  • PLRPLR = fraction not delivered for any reason, errors or full buffer.
    • Example: 10001000 packets, 3030 with errors and 1010 dropped for full buffer: PER=3 %PER=3\,\%, PDR=97 %PDR=97\,\%, PLR=4 %PLR=4\,\%.

Typical mistakes:

  • forgetting dpropd_{prop} when the text gives the distance;
  • confusing RTT and end-to-end delay;
  • writing MB instead of Mb (factor 88);
  • picking the slowest access as bottleneck, forgetting that a shared link splits RR among the flows.

Teoria collegata