UNIVERSITY OF SCIENCE, VNU-HCM
FACULTY OF ELECTRONICS AND TELECOMMUNICATIONS
DEPARTMENT OF TELECOMMUNICATIONS AND NETWORKS
COURSE
BASIC COMPUTER NETWORK
Chapter 1 Packet Delay
Packet
03
Editor: Nguyen Viet Ha, Ph.D.
Reference: Peter L Dordal, “An Introduction to Computer Networks,” Aug. 20, 2022
February 7, 2023
Lecturer: Nguyen Viet Ha, Ph.D. Email: nvha@[Link] 2
1. Packet Delay 1. Packet Delay
❖Bandwidth delay
Medium Propagation speed
➢The time needed for a sender to get the packet onto the wire.
Thick Coax 0.77c (231,000 km/sec)
➢Ex: 1500-byte packet on 100 Mbps Ethernet,
Thin Coax 0.65c (195,000 km/sec)
o Bandwidth delay = = 120 𝜇𝑠.
Twisted Pair 0.59c (177,000 km/sec)
Fiber 0.66c (198,000 km/sec)
❖Propagation delay ❖Propagation delay
➢The time it takes for the head of the signal to travel from the sender ➢Ex: 100 of Ethernet using twisted pair
to the receiver.
➢The distance divided by the 𝑥 speed of light. o Propagation delay = = 𝜇𝑠.
3/23
/50 4/23
/50
1. Packet Delay 1. Packet Delay
Assume:
❖Store-and-forward delay ❖Delay examples. • Queuing delay = 0
➢The time spent reading in the entire packet before any of it can be ➢Case 1: A------------------B • Store-and-forward delay = 0
retransmitted. o Propagation delay is 40 µsec
o Bandwidth is 1 byte/µsec (1 MB/sec, 8 Mbit/sec)
o Packet size is 200 bytes (200 µsec bandwidth delay)
→One-way transmit time = µsec
❖Queuing delay A B
➢Depend on competing traffic and/or the system specifications.
o Other words, is a delay based on how long the packet has to stay
around in the intermediate device (e.g., router).
5/23
/50 6/23
/50
1. Packet Delay 1. Packet Delay
Assume: Assume:
❖Delay examples. • Queuing delay = 0 ❖Delay examples. • Queuing delay = 0
➢Case 2: A --------- R ---------- B • Store-and-forward delay = 0 ➢Case 3: A --------- R ---------- B • Store-and-forward delay = 0
o Two links, each with propagation delay 40 µsec; bandwidth and o The same as 2, but with data sent as two 100-byte packets.
packet size as in Case 1. o →One-way transmit time = µsec
o →One-way transmit time = µsec
A R B A R B
7/23
/50 8/23
/50
1. Packet Delay 1. Packet Delay
❖Round-trip time (RTT) ❖Bandwidth x Delay
➢At most non-LAN scales, the delay is typically simplified to the RTT. ➢Represents how much we can send before we hear anything back.
o The time between sending a packet and receiving a response. ➢(Delay: usually involving RTT)
➢Different delay scenarios have implications for protocols: ➢Ex:
o If a network is bandwidth-limited then protocols are easier to
design. Extra RTTs do not cost much, so we can build in a
considerable amount of back-and-forth exchange.
o However, if a network is delay-limited, the protocol designer must
focus on minimizing extra RTTs.
▪ As an extreme case, consider wireless transmission to the
moon (0.3 sec RTT), or to Jupiter (1 hour RTT).
9/23
/50 10/23
/50
1. Packet Delay 1. Packet Delay
❖Packet Delay Variability ❖Link’s bandwidth, too, can vary dynamically.
➢RTT is variable. ➢Shared bandwidth
o On Ethernet and Wi-Fi networks there is an initial “contention ➢QoS (Quality of Service)
period” before transmission actually begins. o E.g., routers reserve a varying amount of bandwidth for
▪ High-priority traffic
o Different packets are routed via slightly different paths. ▪ Depending on demand
▪ Best-effort traffic
o Different packets are handled differently by different queues of a
parallel-processing switch.
o Mobile nodes are involved, then the distance and thus the
propagation delay can change. ➢ to be the time it takes to transmit a packet from A to B,
and receive an acknowledgment back, with no queuing delay.
➢We will usually assume that is fixed and well-defined
11/23
/50 12/23
/50
2. Packet Size
❖How big should packets be?
➢Should they be large ( 64 kB)
➢or small ( 48 bytes)?
2 Packet Size ➢Large packets would not allow other senders timely access to
transmit.
➢Large packets waste a smaller percentage of bandwidth on headers.
➢In store-and-forward switches, smaller packets have much better
throughput.
13 14/23
/50
2. Packet Size 2. Packet Size
❖Packet Size vs. Error Rates ❖Packet Size vs. Real-Time Traffic
➢For relatively high error rates, it turns out to be better to send ➢It is common to commingle bulk traffic on the same links with real-
smaller packet, because when an error does occur then the entire time traffic.
packet containing it is lost. o Real-time traffic has higher priority than bulk traffic.
o Choose the packet size small enough that most packets do not ▪ Router does not begin forwarding a bulk-traffic packet if there
encounter errors. are any real-time packets waiting.
▪ However, once a bulk-traffic packet has begun transmission, it
is impractical to interrupt it.
➢To be fair, very large packets can be sent reliably on most cable links
(e.g., TDM and SONET). ❖Limited to the maximum Ethernet packet size.
➢Wireless, however, is more of a problem. o IPv4: 1500 bytes
o IPv6: 2000 bytes
15/23
/50 16/23
/50
3. Error Detection
❖Packet error detection is to add some extra bits (or called error-
detection code)
➢Allow the receiver to determine if the packet has been corrupted in
transit.
➢A corrupted packet will then be discarded by the receiver.
3 Error Detection
❖Reasons:
➢Low-frequency bit errors due to things like
cosmic rays.
➢Interference errors, typically generated by
nearby electrical equipment.
17 18/23
/50
3. Error Detection 3. Error Detection
❖Single parity bit: this will catch all one-bit errors. ❖Internet checksum: used by IP, TCP and UDP
➢Ex: ➢Taking the one’s-complement sum of the 16-bit words of the
o Data: 1001 message.
▪ → parity bit = 1^0^0^1 = 0 o One’s-complement sum:
▪ Take the sum A+B.
o Send: 10010 ▪ If there is an overflow bit, add it back in as low-order bit.
o Receive: 10110
➢A weakness of any error-detecting code based on sums is that
→ Check: 1^0^1^1^0 = 1 ≠ 0 transposing words leads to the same sum, and the error is not
→ Data is corrupted. detected.
o In particular, if a message is fragmented and the fragments are
reassembled in the wrong order, the ones-complement sum will
likely not detect it.
19/23
/50 20/23
/50
3. Error Detection 3. Error Detection
❖Cyclical Redundancy Check (CRC) ❖Error-Correcting Codes (also called forward error correction)
➢Ethernet frame. ➢That allows the receiver in many cases to figure out which bits are
corrupted, and fix them.
➢Mostly used in the Physical layer.
21/23
/50 22/23
/50
THANK YOU FOR YOUR ATTENTION
Nguyen Viet Ha, Ph.D.
Department of Telecommunications and Networks
Faculty of Electronics and Communications
University of Science, Vietnam National University, Ho Chi Minh City
Email: nvha@[Link]