Network Performance Analysis
In questa pagina 9
Units: the first trap
- bit/s (also bps): bits sent or received per second. kbit/s bit/s, Mbit/s bit/s, Gbit/s bit/s, Tbit/s bit/s. In networks prefixes are powers of 10, not of 2.
- byte/s (B/s): B bit, so kB/s 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 MB (megabyte) file is Mbit; at Mbit/s it takes s, not 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, [Hz]: range of frequencies of a modulated signal, or range of frequencies a channel passes with acceptable attenuation;
- bitrate (also loosely "bandwidth"), [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 . Example: MHz and SNR dB (linear): Mbit/s. To get more bitrate one needs more bandwidth or more SNR.
Throughput and goodput
Definition (throughput). The throughput [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 .
Why is below :
- the user may not saturate the link (sends less than it could);
- the link may be congested or shared among several flows;
- there may be retransmissions of packets already sent (for reliability): retransmitted bits occupy the link but carry no new information;
- 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 bit/s; if it detects errors and asks to retransmit bits every , the throughput drops to 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 B packet every ms; lower layers add B, so B go to the physical layer every ms. Throughput at the PHY Mbit/s; goodput at the application kbit/s; overhead .
Bottleneck
Property (throughput of a path). On a path with links of bitrates in series, the throughput is that of the bottleneck link.
Why: if the bits pushed by the server (at ) pass through the router and reach the client at . If the router cannot forward bits as fast as it receives them: they leave at and what does not leave builds up in the queue.
Example. Server Mbit/s, client Mbit/s: throughput Mbit/s.
Beware of shared links. If servers and clients download through a common link of capacity Mbit/s, with Mbit/s and Mbit/s, the answer "the bottleneck is the client access because " is wrong: the common link splits its capacity equally among the downloads, so each gets Mbit/s Mbit/s, and the shared link is the bottleneck: each download gets 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:
Each has a different cause and remedy.
Processing delay : 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 : 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 on the line (one bit after the other) at bitrate :
Example. A kbit packet on Fast Ethernet at Mbit/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 over distance : In vacuum m/s; in cables m/s (copper and fibre: light in the medium goes at with refractive index ).
Example. A km transoceanic cable: 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 and are neglected.
- 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.
Crossing several links
With 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 :
Example. links of km at Mbit/s, packet B (with m/s). On one link:
- the packet is bit;
- transmission: s;
- propagation: s;
- one link: s; ten in series, since each router waits for the whole packet: s.
The delay grows linearly with the number of links, with slope per link.
Jitter
Definition (jitter). The jitter [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 is the time from when a packet leaves to when the corresponding acknowledgment (ACK) returns to : Neglecting processing and queueing, with the frame transmission time, the ACK one and the one-way propagation: . With small ACK () and small frame: .
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 kbit on a Mbit/s link ( ms), ACK of bit (s), propagation ms: 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: 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: (pipe capacity).
Picture: bitrate bit/s and delay s; after s the first group of bits arrives and the pipe holds .
Example. A Mbit/s link with ms ( ms s): bit kbit; with kbit packets the pipe capacity is packets. To keep the channel full 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 bits are transmitted before an acknowledgment is received, the efficiency (link utilization) is the fraction of the pipe filled:
Example. If the pipe holds kbit and kbit are sent before waiting for the ACK: .
The efficiency of a stop-and-wait protocol follows. The sender sends a frame (occupying the channel for ) and waits for the ACK: in each cycle of duration (ACK neglected) the channel is used only for . Dividing numerator and denominator by and setting (normalized propagation): It collapses when the link is "long" compared with the transmission time. It is the same : indeed and , and 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 (bit error rate, depending on the SNR), independently of the others, a packet of bits is correct only if all bits are: .
- PDR or PRR (Packet Delivery/Reception Rate): packets delivered successfully / packets transmitted; .
- PLR (Packet Loss Rate): fraction of transmitted packets not delivered for any reason (errors or buffer overflow).
Example (from bit to packet). and bit ( B): , i.e. of packets have errors although only one bit in a hundred thousand is wrong (for small , ).
Example. Out of packets, arrive with errors and are dropped for full buffer: , (counting only errors), .
Versione ripasso
Units. B bit. Prefixes are powers of 10: kbit/s bit/s, Mbit/s bit/s, Gbit/s bit/s. Convert everything to bits and seconds before computing.
- Example: a MB file is Mbit; at Mbit/s it takes s, not s.
Traffic.
- Bitrate [bit/s]: maximum transmission speed of the link. Not the bandwidth in hertz .
- Throughput : bits of PDUs successfully delivered to the peer entity. It drops for non-saturated, shared or congested links, for retransmissions and for access-protocol 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 bit/s protocol retransmitting bits per gives bit/s.
- Goodput: throughput at the application layer, without headers and retransmissions. Overhead header bits useful bits.
- Example: B packet every ms with B of headers: at the PHY Mbit/s; goodput kbit/s; overhead .
Bottleneck.
- Links in series: .
- Example: server Mbit/s, client Mbit/s: Mbit/s.
- Shared link: with flows each gets about . If downloads share Mbit/s each gets kbit/s: the bottleneck is the common link, not the client access, even if suggests the opposite.
End-to-end delay.
- Formula: . Usually and are neglected ( depends on traffic: 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 →).
- Transmission: , packet length, bitrate.
- Example: kbit at Mbit/s: s. Grows as decreases.
- Propagation: , with m/s in vacuum and m/s in cables. Cannot be reduced.
- Example: km transoceanic cable: ms.
- Rule: if the text gives the distance or the propagation delay, include . It matters for satellites and long cables, less for short radio networks.
- equal links in series with store-and-forward: .
- Example: links of km, Mbit/s, B packet: each hop s s, in total s.
Jitter. [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).
- , with frame transmission time, ACK one, one-way propagation. With small frame and ACK .
- Example: ms, s, ms: ms.
- RTT is round trip (request and acknowledgment). It is not the end-to-end delay, which is one-way.
Pipe capacity (BDP).
- maximum throughput delay [bit]: the bits that fill the link. With the RTT it is the number of bits in flight without acknowledgment. In packets: .
- Efficiency : fraction of the pipe filled before the acknowledgment.
- Example: pipe of kbit, kbit sent then wait for the ACK: .
- Stop-and-wait with (ACK negligible): . Collapses when the link is long compared with the transmission time.
Reliability.
- = packets delivered with errors packets transmitted; with independent bit errors .
- = packets delivered successfully transmitted.
- = fraction not delivered for any reason, errors or full buffer.
- Example: packets, with errors and dropped for full buffer: , , .
Typical mistakes:
- forgetting when the text gives the distance;
- confusing RTT and end-to-end delay;
- writing MB instead of Mb (factor );
- picking the slowest access as bottleneck, forgetting that a shared link splits among the flows.