SEN2008 · Week 1 · Course Outline

Networks and security: the big picture

What the Internet is, the difference between packet switching and circuit switching, and the four kinds of delay (transmission, propagation, queuing, processing). Every calculation in the rest of the course builds on these formulas.

Internethost / end systempacket switchingcircuit switchingstore-and-forwardtransmission delaypropagation delayqueuing delayprocessing delaytraffic intensitythroughputbottleneck linkTDMFDMbandwidth-delay product

This course is a journey in two parts. In the first half you learn how the Internet works: layers, links, routers, TCP. In the second half you see where this structure is open to attack and how to write software securely. You can’t understand security without knowing the network. An attacker forges an IP header (spoofing), abuses the TCP handshake (SYN flood) or fills the queues (DoS). All of that is the subject of these first weeks.

This page teaches two things: the big picture of the Internet and delay calculation. An exam almost certainly includes a “how long does it take?” question. These rules are enough:

  1. Transmission delay is L/RL/R, propagation delay is d/sd/s. Don’t mix them up.
  2. Convert units. Bytes to bits (×8), km to metres, Mbps to 10610^6 bit/s.
  3. Store-and-forward: a router does not forward a packet before it has received all of it. Each link adds its own L/RL/R.
  4. Throughput is the bottleneck link: the slowest link on the path.
  5. If La/R>1La/R > 1, the queue grows without bound.

What is the Internet?

There are two ways to look at it.

The hardware (“nuts and bolts”) view. The Internet is a network of networks that connects billions of end systems (hosts). A laptop, a phone and a server are each a host. Hosts are connected by communication links (fiber, copper, wireless) and packet switches (routers and link-layer switches). Hosts reach the Internet through an ISP (Internet Service Provider); ISPs in turn connect to each other hierarchically (access ISP, regional ISP, tier-1 ISP, IXP points).

The service view. The Internet is an infrastructure that provides communication services to distributed applications (web, email, video). The application programmer says “send this data reliably to that address” and the network handles the rest. This service is offered through a socket interface.

A protocol is a set of rules that defines the format and order of the messages exchanged between two or more parties, and the actions taken when a message is received. TCP, IP, HTTP and Ethernet are protocols. Standards are written in the IETF’s RFC documents.

The network edge and the network core

RegionWhat is in it?Example
Network edgeHosts, applicationsLaptop, web server
Access networkThe link that connects a host to the first routerDSL, cable, FTTH, Wi-Fi, 4G/5G
Network coreA mesh of routersISP backbone

Packet switching and circuit switching

In the core, data can be moved in two basic ways.

Circuit switching. Before communication starts, a path is set up from source to destination, and resources are reserved on every link for this connection. The classic telephone network works this way. Link capacity is shared either by frequency (FDM, frequency-division multiplexing) or by time (TDM, time-division multiplexing). In TDM, time is divided into frames and frames into slots; each circuit gets one slot in every frame.

  • Advantage: guaranteed rate, no queuing, predictable delay.
  • Disadvantage: setup time; when a user goes silent, the reserved slot is wasted.

Packet switching. The message is divided into packets. Each packet is forwarded individually by routers that know the way. No resources are reserved; the link belongs to whoever has a packet at that moment. So packets may wait in a queue, and if the buffer fills up they may be lost (packet loss).

  • Advantage: far more efficient for bursty traffic, no setup, simple.
  • Disadvantage: delay and loss vary.

Worked example: file time in circuit switching

A 1,200,000-bit file is sent over a circuit that uses TDM on a 2.4 Mbps link with 30 slots. Setup takes 250 ms.

Rate per circuit   = 2.4 Mbps / 30 = 80,000 bps
Transmission time  = 1,200,000 / 80,000 = 15 s
Total              = 15 + 0.25 = 15.25 s

PITFALL · the whole link is not yours. In TDM your rate is R/number of slotsR/\text{number of slots}. If you divide the file by 2.4 Mbps and get 0.5 s, you lose the question.

Statistical multiplexing

A 1 Mbps link; each user wants 100 kbps while active and is active only 10% of the time. Circuit switching admits at most 10 users. With packet switching and 35 users, the probability that more than 10 are active at the same time follows from the binomial distribution:

P(X≥11)=∑k=1135(35k)(0.1)k(0.9)35−k≈4.24×10−4P(X \ge 11) = \sum_{k=11}^{35}\binom{35}{k}(0.1)^k(0.9)^{35-k} \approx 4.24\times10^{-4}

The problem is very rare. Packet switching carries 3.5 times as many users on the same link. This is why the Internet uses packet switching.

The four kinds of delay

When a packet goes from one router to the next, four delays add up:

dnodal=dproc+dqueue+dtrans+dpropd_{nodal} = d_{proc} + d_{queue} + d_{trans} + d_{prop}

DelayWhat is it?FormulaTypical size
Processing dprocd_{proc}Reading the header, checking for bit errors, choosing the output link(given)microseconds
Queuing dqueued_{queue}Waiting for a turn in the output queuedepends on traffic0 to ms
Transmission dtransd_{trans}Pushing all the bits of the packet onto the linkL/RL/Rms at Mbps rates
Propagation dpropd_{prop}A bit travelling to the other end of the linkd/sd/s~5 µs per km

Analogy: a convoy on a highway. A convoy of 10 cars passing through a toll booth is the transmission delay (convoy length / booth speed). One car covering the road between two booths is the propagation delay (distance / car speed). The two depend on completely different things.

L=1500L = 1500 bytes, R=10R = 10 Mbps, link 2000 km, s=2×108s = 2\times10^8 m/s.

L = 1500 x 8 = 12,000 bit
dtrans = 12,000 / 10^7      = 0.0012 s = 1.2 ms
dprop  = 2 x 10^6 / 2 x 10^8 = 0.01 s  = 10 ms
if dproc = 0.02 ms and dqueue = 2.4 ms are given:
dnodal = 0.02 + 2.4 + 1.2 + 10 = 13.62 ms

On a long link propagation dominates; on a slow link transmission dominates.

TIP · when is dprop=dtransd_{prop} = d_{trans}? When d=s⋅L/Rd = s \cdot L/R. For L=12000L = 12000 bits and R=1R = 1 Mbps, d=2×108×0.012=2400d = 2\times10^8 \times 0.012 = 2400 km. On a shorter link the first bit reaches the far end before the last bit has even left the sender.

A router must receive the whole packet before it starts forwarding it. For NN links and a single packet (ignoring propagation):

dend-to-end=N⋅LRd_{end\text{-}to\text{-}end} = N \cdot \frac{L}{R}

If PP packets are sent back to back, the first packet arrives after NL/RN L/R, and each following packet arrives one L/RL/R behind it:

d=(N+P−1)LRd = (N + P - 1)\frac{L}{R}

L = 12,000 bit, R = 10 Mbps -> L/R = 1.2 ms
N = 3 links, P = 1 packet : 3 x 1.2 = 3.6 ms
N = 3 links, P = 4 packets: (3 + 4 - 1) x 1.2 = 6 x 1.2 = 7.2 ms

If propagation is present, add each link’s dpropd_{prop} too: N(L/R+dprop)N(L/R + d_{prop}) for a single packet.

Queuing delay and traffic intensity

Suppose packets arrive at an average of aa per second, each LL bits. The traffic intensity is:

I=LaRI = \frac{La}{R}

  • I≈0I \approx 0: the queue is almost empty, delay is small.
  • I→1I \to 1: delay grows rapidly (not linearly, it blows up).
  • I>1I > 1: bits arrive faster than they can be sent. The queue grows without bound; in reality the buffer overflows and packet loss begins.

Example: a=100a = 100 packets/s, L=12000L = 12000 bits, R=2R = 2 Mbps gives I=1.2×106/2×106=0.6I = 1.2\times10^6 / 2\times10^6 = 0.6.

If a question asks for the queuing delay of a specific packet, count the work ahead of it: if 4 packets are waiting ahead and half of the packet being sent remains, the delay is 4.5×L/R4.5 \times L/R. With L/R=1.2L/R = 1.2 ms that is 5.45.4 ms.

PITFALL · packet loss is also a security topic. If an attacker fills the queue on purpose (I≫1I \gg 1), legitimate packets are dropped. This is the network-layer counterpart of the DoS attack you will see later.

Throughput and the bottleneck

Throughput is the number of bits per second that reach the receiver. On links in series, the end-to-end throughput is the rate of the slowest link:

throughput=min⁡(R1,R2,…,RN)\text{throughput} = \min(R_1, R_2, \ldots, R_N)

If a link is shared equally among nn flows, it gives each flow R/nR/n, and that goes into the min. Example: a 40 Mbit file passing through links of 5, 20 and a 100 Mbps link shared by 10 flows: min⁡(5,20,10)=5\min(5, 20, 10) = 5 Mbps, time 8 s.

Bandwidth-delay product

R⋅dpropR \cdot d_{prop} is the number of bits that can be inside the link at the same time. For 10 Mbps and 10 ms it is 107×0.01=100,00010^7 \times 0.01 = 100{,}000 bits. You will meet this number again in sliding-window efficiency in week 3 and in the TCP window in week 8.

A first look at security

The Internet was originally designed for “mutually trusting users”. Security was added later. That is why many protocols do not authenticate by default. The basic framework of the second half of the course is the CIA triad:

PropertyMeaningExample network threat
ConfidentialityOnly authorized parties read the dataPacket sniffing
IntegrityData is not changed without being noticedMan-in-the-middle
AvailabilityThe service works when it is neededDoS / DDoS

As you learn each layer, ask: “Who can forge, read or modify the header at this layer?” This question ties the two halves of the course together.

Common mistakes

Wrong ideaCorrect
A long link increases transmission delayNo, L/RL/R is independent of distance. Length only increases dpropd_{prop}.
A fast link reduces propagationNo, d/sd/s is independent of link rate.
Dividing 1500 bytes directly by RRMultiply by 8 first: 12,000 bits.
1 Mbps = 2202^{20} bit/sIn networking it is 10610^6 bit/s.
Time over multiple links is L/RL/RStore-and-forward: N⋅L/RN \cdot L/R; for PP packets (N+P−1)L/R(N+P-1)L/R.
In TDM the file goes at the full link rateYour rate is RR/slots.
La/R=1La/R = 1 is a safe limitDelay blows up near 1; above 1 the queue is unbounded.
Throughput is the average of the fast linksIt is the slowest link (min). A shared link gives R/nR/n.

Test yourself

Exam-style questions. Solve them on paper first, then reveal the answer.

Question 1easy

A router must send a 1000-byte packet onto an 8 Mbps link. What is the transmission delay?

Show answer
1 ms

Transmission delay dtrans=L/Rd_{trans} = L/R. First convert bytes to bits: L=1000×8=8000L = 1000 \times 8 = 8000 bits.dtrans=8000/(8×106)=10−3d_{trans} = 8000 / (8 \times 10^6) = 10^{-3} s = 1 ms. Distance does not enter this calculation at all.

Question 2easy

A link is 3000 km long and the signal propagates at 2.5×1082.5 \times 10^8 m/s. What is the propagation delay?

Show answer
12 ms

dprop=d/s=(3000×103)/(2.5×108)=0.012d_{prop} = d/s = (3000 \times 10^3) / (2.5 \times 10^8) = 0.012 s = 12 ms.
Don't forget to convert kilometres to metres. Packet size and link rate do not enter this calculation.

Question 3easy

Which statement about transmission delay and propagation delay is correct?

  1. Both depend on the length of the link
  2. Transmission delay depends on packet length and link rate; propagation delay depends on distance and signal speed
  3. Propagation delay decreases when the link rate increases
  4. Transmission delay depends only on the distance between routers
Show answer
B) Transmission delay depends on packet length and link rate; propagation delay depends on distance and signal speed

dtrans=L/Rd_{trans} = L/R: the time to "push" the packet onto the wire, independent of distance.dprop=d/sd_{prop} = d/s: the time for one bit to reach the other end, independent of packet size and RR.
Increasing the link rate only reduces the transmission delay.

Question 4medium

Host A sends one 4000-bit packet to host B through one router (two links, store-and-forward). Each link has rate 2 Mbps and propagation delay 5 ms. Ignore processing and queuing. What is the end-to-end delay?

Show answer
14 ms

There are two links, and the router forwards the packet only after it has received it completely (store-and-forward).
For each link: dtrans=4000/(2×106)=2d_{trans} = 4000 / (2 \times 10^6) = 2 ms, dprop=5d_{prop} = 5 ms.
Total: 2×(2+5)=142 \times (2 + 5) = 14 ms.

Question 5medium

A 960,000-bit file is sent over a circuit-switched network. The link rate is 1.92 Mbps and uses TDM with 24 slots. Setting up the circuit takes 0.5 s. How long does it take to send the file?

Show answer
12.5 s

In TDM each circuit gets one slot: 1.92×106/24=80,0001.92 \times 10^6 / 24 = 80{,}000 bps.
Transmission: 960,000/80,000=12960{,}000 / 80{,}000 = 12 s. Add the setup time: 12+0.5=12.512 + 0.5 = 12.5 s.
Pitfall: if you use the full link rate (1.92 Mbps) you get 0.5 s, which is wrong.

Question 6medium

Packets of 8000 bits arrive at a router queue at an average rate of 150 packets/s. The outgoing link rate is 1 Mbps. What is the traffic intensity, and what happens to the queuing delay?

  1. 0.12; queuing delay is negligible
  2. 0.8; queuing delay is moderate
  3. 1.2; the queue grows without bound and delay goes to infinity
  4. 1.2; queuing delay is exactly 1.2 ms
Show answer
C) 1.2; the queue grows without bound and delay goes to infinity

Traffic intensity =La/R=8000×150/106=1.2= La/R = 8000 \times 150 / 10^6 = 1.2.
If it is greater than 1, bits arrive faster than the link can send them. The queue keeps growing and the average delay goes to infinity (in practice the buffer fills up and packets are lost).
Rule: La/RLa/R must never exceed 1; as it approaches 1, the delay grows rapidly.

Question 7medium

A server sends a 40 Mbit file to a client over three links in series with rates 5 Mbps, 20 Mbps and 100 Mbps. The 100 Mbps link is shared equally by 10 such flows. How long does the transfer take (ignore delays other than throughput)?

Show answer
8 s

The shared link gives each flow 100/10=10100/10 = 10 Mbps. The end-to-end throughput is the bottleneck link:min⁡(5,20,10)=5\min(5, 20, 10) = 5 Mbps. Time: 40/5=840 / 5 = 8 s.

Question 8hard

Ten packets, each 1500 bytes, are sent back to back over a path of 4 store-and-forward links, each 1.5 Mbps. Ignoring propagation, processing and queuing, when has the last packet fully arrived at the destination?

Show answer
104 ms

The transmission time of one packet on one link: L/R=12000/(1.5×106)=8L/R = 12000 / (1.5 \times 10^6) = 8 ms.
For PP packets and NN links the formula is (N+P−1) L/R(N + P - 1)\,L/R.(4+10−1)×8=13×8=104(4 + 10 - 1) \times 8 = 13 \times 8 = 104 ms.
Reasoning: the first packet arrives after N⋅L/RN \cdot L/R, and each following packet arrives one L/RL/R behind it.

Question 9medium

A 100 Mbps link is 4000 km long with propagation speed 2×1082 \times 10^8 m/s. How many bits are 'in flight' on the link at any time when it is fully used (the bandwidth-delay product)?

Show answer
2,000,000 bits

dprop=4×106/(2×108)=0.02d_{prop} = 4 \times 10^6 / (2 \times 10^8) = 0.02 s = 20 ms.
Bandwidth-delay product =R⋅dprop=108×0.02=2×106= R \cdot d_{prop} = 10^8 \times 0.02 = 2 \times 10^6 bits.
This number is how many bits fit inside the cable at the same time.

Question 10hard

A packet is L=12,000L = 12{,}000 bits and the link rate is 1 Mbps; the signal speed is 2×1082 \times 10^8 m/s. For what link length (in km) is the propagation delay equal to the transmission delay?

Show answer
2400 km

dtrans=12000/106=12d_{trans} = 12000 / 10^6 = 12 ms.
We need dprop=d/s=12d_{prop} = d/s = 12 ms: d=0.012×2×108=2.4×106d = 0.012 \times 2 \times 10^8 = 2.4 \times 10^6 m = 2400 km.
On a shorter link, the first bit of the packet reaches the far end before the last bit has left the sender.

Question 11hard

A 1 Mbps link is shared by users who each need 100 kbps while active and are active 10% of the time independently. With packet switching and 35 users, what is the probability (to 3 significant figures) that more than 10 users are active at the same time?

Show answer
4.24 × 10^-4

Circuit switching supports at most 1000/100=101000/100 = 10 users. With packet switching, a problem occurs only if more than 10 users are active at the same time.
The number of active users is X∼Binomial(35,0.1)X \sim \text{Binomial}(35, 0.1).P(X≥11)=∑k=1135(35k)0.1k 0.935−k≈4.24×10−4P(X \ge 11) = \sum_{k=11}^{35} \binom{35}{k} 0.1^k \, 0.9^{35-k} \approx 4.24 \times 10^{-4}.
So packet switching serves 3.5 times as many users on the same link, with a problem probability of about 4 in 10,000. This is the power of statistical multiplexing.

Question 12hard

A packet arrives at a router whose output link is 100 Mbps. Three 1500-byte packets are waiting in the queue, and a fourth 1500-byte packet is currently being transmitted, 40% done. What is the queuing delay of the arriving packet?

Show answer
0.432 ms

The transmission time of one packet: 12000/108=0.1212000 / 10^8 = 0.12 ms.
The work to wait for: the remaining 60% of the packet being transmitted + 3 full packets =3.6= 3.6 packets.
Queuing delay =3.6×0.12=0.432= 3.6 \times 0.12 = 0.432 ms.

Verification: All numerical answers were computed with node (verify/SEN2008/01.mjs): delay formulas, (N+P-1)L/R, circuit-switching time, binomial queue probability, traffic intensity, bottleneck throughput.

Review card

dtrans = L / R (bit / bps; multiply by 8 if bytes) INDEPENDENT of distance dprop = d / s (m / (m/s), s ≈ 2-3 x 10^8) INDEPENDENT of packet size dnodal = dproc + dqueue + dtrans + dprop N links, 1 packet: N L/R N links, P packets: (N+P-1) L/R (store-and-forward) traffic intensity = L a / R ~0 small delay, ->1 large, >1 infinite (loss) queuing delay = (number of packets ahead + remainder of the one being sent) x L/R throughput = min(R1, R2, ..., shared link R/n) bottleneck bandwidth-delay product = R x dprop (bits sitting in the cable at once) Circuit: resources reserved, guaranteed rate, setup delay; TDM slot rate = R/slots Packet: shared, queuing and loss possible, far more efficient for bursty traffic Mbps = 10^6 bit/s (not 2^20) 1 byte = 8 bits Security: CIA = Confidentiality, Integrity, Availability