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.
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:
- Transmission delay is , propagation delay is . Don’t mix them up.
- Convert units. Bytes to bits (×8), km to metres, Mbps to bit/s.
- Store-and-forward: a router does not forward a packet before it has received all of it. Each link adds its own .
- Throughput is the bottleneck link: the slowest link on the path.
- If , 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
| Region | What is in it? | Example |
|---|---|---|
| Network edge | Hosts, applications | Laptop, web server |
| Access network | The link that connects a host to the first router | DSL, cable, FTTH, Wi-Fi, 4G/5G |
| Network core | A mesh of routers | ISP 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 . 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:
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:
| Delay | What is it? | Formula | Typical size |
|---|---|---|---|
| Processing | Reading the header, checking for bit errors, choosing the output link | (given) | microseconds |
| Queuing | Waiting for a turn in the output queue | depends on traffic | 0 to ms |
| Transmission | Pushing all the bits of the packet onto the link | ms at Mbps rates | |
| Propagation | A bit travelling to the other end of the link | ~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.
Worked example: a single link
bytes, Mbps, link 2000 km, 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 ? When . For bits and Mbps, km. On a shorter link the first bit reaches the far end before the last bit has even left the sender.
Store-and-forward and multiple links
A router must receive the whole packet before it starts forwarding it. For links and a single packet (ignoring propagation):
If packets are sent back to back, the first packet arrives after , and each following packet arrives one behind it:
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 too: for a single packet.
Queuing delay and traffic intensity
Suppose packets arrive at an average of per second, each bits. The traffic intensity is:
- : the queue is almost empty, delay is small.
- : delay grows rapidly (not linearly, it blows up).
- : bits arrive faster than they can be sent. The queue grows without bound; in reality the buffer overflows and packet loss begins.
Example: packets/s, bits, Mbps gives .
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 . With ms that is ms.
PITFALL · packet loss is also a security topic. If an attacker fills the queue on purpose (), 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:
If a link is shared equally among flows, it gives each flow , 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: Mbps, time 8 s.
Bandwidth-delay product
is the number of bits that can be inside the link at the same time. For 10 Mbps and 10 ms it is 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:
| Property | Meaning | Example network threat |
|---|---|---|
| Confidentiality | Only authorized parties read the data | Packet sniffing |
| Integrity | Data is not changed without being noticed | Man-in-the-middle |
| Availability | The service works when it is needed | DoS / 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 idea | Correct |
|---|---|
| A long link increases transmission delay | No, is independent of distance. Length only increases . |
| A fast link reduces propagation | No, is independent of link rate. |
| Dividing 1500 bytes directly by | Multiply by 8 first: 12,000 bits. |
| 1 Mbps = bit/s | In networking it is bit/s. |
| Time over multiple links is | Store-and-forward: ; for packets . |
| In TDM the file goes at the full link rate | Your rate is /slots. |
| is a safe limit | Delay blows up near 1; above 1 the queue is unbounded. |
| Throughput is the average of the fast links | It is the slowest link (min). A shared link gives . |
Test yourself
Exam-style questions. Solve them on paper first, then reveal the answer.
A router must send a 1000-byte packet onto an 8 Mbps link. What is the transmission delay?
Show answer
Transmission delay . First convert bytes to bits: bits. s = 1 ms. Distance does not enter this calculation at all.
A link is 3000 km long and the signal propagates at m/s. What is the propagation delay?
Show answer
s = 12 ms.
Don't forget to convert kilometres to metres. Packet size and link rate do not enter this calculation.
Which statement about transmission delay and propagation delay is correct?
- Both depend on the length of the link
- Transmission delay depends on packet length and link rate; propagation delay depends on distance and signal speed
- Propagation delay decreases when the link rate increases
- Transmission delay depends only on the distance between routers
Show answer
: the time to "push" the packet onto the wire, independent of distance.: the time for one bit to reach the other end, independent of packet size and .
Increasing the link rate only reduces the transmission delay.
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
There are two links, and the router forwards the packet only after it has received it completely (store-and-forward).
For each link: ms, ms.
Total: ms.
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
In TDM each circuit gets one slot: bps.
Transmission: s. Add the setup time: s.
Pitfall: if you use the full link rate (1.92 Mbps) you get 0.5 s, which is wrong.
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?
- 0.12; queuing delay is negligible
- 0.8; queuing delay is moderate
- 1.2; the queue grows without bound and delay goes to infinity
- 1.2; queuing delay is exactly 1.2 ms
Show answer
Traffic intensity .
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: must never exceed 1; as it approaches 1, the delay grows rapidly.
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
The shared link gives each flow Mbps. The end-to-end throughput is the bottleneck link: Mbps. Time: s.
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
The transmission time of one packet on one link: ms.
For packets and links the formula is . ms.
Reasoning: the first packet arrives after , and each following packet arrives one behind it.
A 100 Mbps link is 4000 km long with propagation speed 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
s = 20 ms.
Bandwidth-delay product bits.
This number is how many bits fit inside the cable at the same time.
A packet is bits and the link rate is 1 Mbps; the signal speed is m/s. For what link length (in km) is the propagation delay equal to the transmission delay?
Show answer
ms.
We need ms: 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.
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
Circuit switching supports at most 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 ..
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.
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
The transmission time of one packet: ms.
The work to wait for: the remaining 60% of the packet being transmitted + 3 full packets packets.
Queuing delay 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.