Mesh topology
Every node has a dedicated point-to-point link to every other node. That is why it costs so much: it needs a lot of wiring and N − 1 I/O ports on each device.
Every formula, counting rule and number to memorise from the CS331 slides, one tab per chapter. Each one comes with what the symbols mean, the unit of the answer, and the slide example worked out. The course has no chapter 5, so the tabs jump from 04 to 06.
Chapter 1 has only a few formulas, all about counting links and ports in each physical topology. N is the number of devices (nodes) every time.
Every node has a dedicated point-to-point link to every other node. That is why it costs so much: it needs a lot of wiring and N − 1 I/O ports on each device.
| Topology | Number of links | Notes |
|---|---|---|
| Star | N | One dedicated link from each node to the central hub/switch. If the hub fails, the whole network fails. |
| Bus | 1 main + N drop lines | One backbone cable; each node taps in with a drop line. Less cabling than mesh or star. |
| Ring | N | Each node is linked to the two nodes on either side of it. |
| Mesh | N(N − 1)/2 | Most secure and robust, most expensive. |
Encapsulation: layer N − 1 carries the whole PDU of layer N in its data part without looking inside it. Layer n − 1 provides a service to layer n through the interface between them.
The number of bits sent per second. Defined by the physical layer, along with bit synchronisation between the sender and receiver clocks.
Unit: bits per second (bps)This is the chapter the original PDF covers, and it has the most calculation questions. Almost every mistake here comes from units, so read the conversions section before the formulas.
Frequency and period are the inverse of each other.
The second form comes from substituting T = 1/f. Wavelength depends on both the frequency and the medium.
Unit: metresHow long one bit takes to travel from one node to the other.
The propagation speed depends on the medium. Light travels at about 3 × 108 m/s in a vacuum, slower in air, and at about 2/3 of that (≈ 2 × 108 m/s) in a cable.
How long it takes to push the entire message onto the link.
The number of bits that can fill the link at one time: the length of the link measured in bits.
Unit: bits2.5-kbyte e-mail, bandwidth 1 Gbps, distance 12,000 km, light travels at 2.4 × 108 m/s.
The message is short and the bandwidth is high, so propagation time dominates and transmission time can be ignored.
5-Mbyte image, bandwidth 1 Mbps, distance 12,000 km, light travels at 2.4 × 108 m/s.
The message is very long and the bandwidth is not very high, so transmission time dominates and propagation time can be ignored.
Check your own answers. Sizes use decimal prefixes (1 kbyte = 1000 bytes), as the slides do. It opens with the 2.5-kbyte e-mail example.
| Prefix | Value | Used for |
|---|---|---|
| milli (m) | 10⁻³ | ms |
| micro (μ) | 10⁻⁶ | μs |
| nano (n) | 10⁻⁹ | ns |
| kilo (k) | 10³ | kbps, kHz, km, kbyte |
| mega (M) | 10⁶ | Mbps, MHz, Mbyte |
| giga (G) | 10⁹ | Gbps, GHz |
When a formula needs the message size in bits:
| Category | Bandwidth | Max data rate | Shielding |
|---|---|---|---|
| CAT5e | 100 MHz | 1000 Mbps | UTP or STP |
| CAT6 | 250 MHz | 1000 Mbps | UTP or STP |
| CAT6a | 500 MHz | 10 Gbps | UTP or STP |
| CAT7 | 600 MHz | 10 Gbps | Shielded only |
| CAT8 | 2000 MHz | 25 or 40 Gbps | Shielded only (40 Gbps up to 24 m) |
| Wave | Range | Direction and use |
|---|---|---|
| Radio | < 300 MHz | Omnidirectional, long distance. Multicast: AM/FM radio, TV. |
| Microwave | 300 MHz – 300 GHz | Line of sight. Unicast: cellular, satellite, wireless LANs. |
| Infrared | 300 GHz – 400 THz | Line of sight, cannot pass walls. Short range: remotes, keyboards (IrDA). |
| Medium | Distance | Rate |
|---|---|---|
| UTP | 1 – 100 m | 10 Mb/s – 10 Gb/s |
| Fiber | 1 – 100,000 m; 50 km or more without repeaters | 10 Mb/s – 100 Gb/s |
| IrDA | up to 8 m / 1 m | 75 kbps / 1.15 – 4 Mbps |
A twisted-pair twist length is 7.5–10 cm (lower quality) or 0.6–0.85 cm (better quality): more twists mean less interference.
Part 1 is framing and error detection (burst errors, parity, CRC, checksum). Part 2 is media access: who gets to send on a shared link, and how much throughput each node gets.
Burst length is counted from the first corrupted bit to the last corrupted bit, so the bits in between need not all be wrong. Higher data rates mean longer bursts.
Simple parity check is C(5, 4): 4 data bits + 1 parity bit.
Data goes into a table. The last column holds a parity bit for each row and the last row a parity bit for each column.
Each power of x that is present becomes a 1, and each missing power a 0, starting from the highest power.
| Burst length | Missed (slips by) |
|---|---|
| ≤ r | Never: all detected |
| = r + 1 | (1/2)r − 1 |
| ≥ r + 2 | (1/2)r |
Send the codewords with the extra block R. Any one corrupted block can be rebuilt without a retransmission. Chunk interleaving works on the same idea: multimedia can afford to lose one chunk from each packet.
The sender stuffs one extra 0 after every five consecutive 1s in the data, so the data can never look like the flag. When the receiver sees five 1s, it checks the next bit: a 0 is removed (unstuffed), and a 1 means the flag has arrived.
Byte-oriented framing: put an ESC byte before any flag byte or ESC byte that appears in the data. The receiver removes each ESC and treats the next byte as plain data.
| Method | Throughput per node |
|---|---|
| Random access, only one node sending | R (full rate) |
| Random access, M nodes sending | Less than R/M, because of collisions |
| Controlled access (reservation, polling, token) | R/M, fair and no collisions |
| FDMA / TDMA | R/M, even when it is the only node sending |
| CDMA | One channel carries everyone at once; codes separate the stations |
Tprop, max is the time a bit takes to travel between the two stations that are furthest apart. The longer it is, the worse CSMA performs.
On a collision, stop sending, transmit the 48-bit jam signal, back off for a random time, then rerun the persistence method. CSMA/CD is used by Ethernet (IEEE 802.3) on a bus or a star built around a hub.
One minislot per station. Stations that reserved a slot then send their frames at the full rate R, in order, after the reservation frame.
Ethernet questions are mostly arithmetic on the frame: field sizes, padding, minimum and maximum length, and reading a MAC address.
| Field | Size | Notes |
|---|---|---|
| Preamble + SFD | 7 + 1 bytes | 10101010 … then 10101011. Synchronises clocks. Not counted in the frame length. |
| Destination address | 6 bytes | Unicast, multicast or broadcast |
| Source address | 6 bytes | Always unicast |
| Type / Length | 2 bytes | See 4.3 |
| Data (+ pad) | 46 – 1500 bytes | Padded with zeros up to 46 |
| CRC (FCS) | 4 bytes | CRC-32. On an error, the frame is discarded. |
Type codes: IP 0800, ARP 0806, Novell IPX 8137, AppleTalk 809B.
Flat (not hierarchical) and burned into the NIC's ROM. Vendor prefixes on the slides: Cisco 00-00-0C, Juniper 00-05-85.
That digit holds the least significant bit of the first byte. All F's (all 1s) is broadcast, a special case of multicast.
Full duplex needs full-duplex NICs, two wire pairs, a switch (not a hub) and point-to-point links. Each station is then its own collision domain, so CSMA/CD is not needed.
| Standard | Rate | Media |
|---|---|---|
| Traditional (10Base-T / 10Base-F) | 10 Mbps | Twisted pair / fiber |
| Fast (100Base-T / F) | 100 Mbps | Twisted pair or fiber, star |
| Gigabit (1000Base-T / F) | 1000 Mbps | Twisted pair or fiber, star |
| 10 Gigabit | 10,000 Mbps | Fiber only, star |
No equations here. Instead, there are counting rules for collision and broadcast domains, and a few distance and bandwidth numbers.
| Device | Layer | Collision domains | Broadcast domains |
|---|---|---|---|
| Hub | 1 (bits) | Does not split: the whole hub is 1 | Does not split |
| Switch | 2 (frames) | Splits: every port is 1 | Does not split, unless VLANs are used |
| Router | 3 (packets) | Splits: every interface is 1 | Splits: every interface is 1 |
| VLAN | 2 (software) | As a switch | Each VLAN is 1 |
Count each link once, even when a switch port meets a router interface. Everything hanging off one hub (or a chain of hubs) is a single collision domain together with the port it plugs into.
| Switch | Router | |
|---|---|---|
| Unknown destination | Floods | Drops |
| Table | MAC address table | Routing table |
| Setup | Plug and play | Needs configuration |
| Cut-through | Yes (no buffering, no error check) | No |
This is the biggest calculation chapter after chapter 2. Almost every subnetting question uses the same three facts: the mask length n, the host bits 32 − n, and an AND with the mask.
32 bits = 4 octets. Each octet is 0–255 in dotted-decimal notation.
Subtract 2 because the first address (host bits all 0) is the network address and the last (host bits all 1) is the broadcast address.
| Address | Host bits | 192.168.10.0/24 |
|---|---|---|
| Network | all 0s | 192.168.10.0 |
| First host | all 0s, then a 1 | 192.168.10.1 |
| Last host | all 1s, then a 0 | 192.168.10.254 |
| Directed broadcast | all 1s | 192.168.10.255 |
Limited broadcast is 255.255.255.255. Routers never forward it. A directed broadcast (network ID + host bits all 1s) is forwarded to the target network.
| Class | First bits | First byte | Default mask | Blocks | Addresses per block |
|---|---|---|---|---|---|
| A | 0 | 0 – 127 (valid 1 – 126) | 255.0.0.0 /8 | 2⁷ = 128 (126 usable) | 2²⁴ − 2 = 16,777,214 |
| B | 10 | 128 – 191 | 255.255.0.0 /16 | 2¹⁴ = 16,384 | 2¹⁶ − 2 = 65,534 |
| C | 110 | 192 – 223 | 255.255.255.0 /24 | 2²¹ = 2,097,152 | 2⁸ − 2 = 254 |
| D | 1110 | 224 – 239 | Multicast, no network/host split | ||
| E | 1111 | 240 – 255 | Reserved | ||
0.x.x.x is reserved (0.0.0.0 is the default route) and 127.x.x.x is loopback, which is why class A has only 126 valid blocks.
| Range | Total |
|---|---|
| 10.0.0.0 – 10.255.255.255 | 2²⁴ |
| 172.16.0.0 – 172.31.255.255 | 2²⁰ |
| 192.168.0.0 – 192.168.255.255 | 2¹⁶ |
Internet routers do not forward packets addressed to these ranges. NAT maps them to the public address on the router (its translation table has 65,536 entries).
Shortcut: where the mask octet is 255, copy the IP octet; where it is 0, write 0. Only convert the one octet in between to binary.
| Binary | Decimal | Block size |
|---|---|---|
| 10000000 | 128 | 128 |
| 11000000 | 192 | 64 |
| 11100000 | 224 | 32 |
| 11110000 | 240 | 16 |
| 11111000 | 248 | 8 |
| 11111100 | 252 | 4 |
| 11111110 | 254 | 2 |
| 11111111 | 255 | 1 |
Slash to decimal: /12 = 255.240.0.0, /18 = 255.255.192.0, /26 = 255.255.255.192, /30 = 255.255.255.252.
A valid subnet mask is longer than the class's default mask and no longer than /30.
Enter any address and mask length to check a network, broadcast or host-range answer.
So data = total length − header length. The header checksum covers the header only and is recomputed at every router, because fields such as the TTL change.
Stops lost packets from looping between routers forever.
| Flag | Meaning |
|---|---|
| M = 1 | More fragments follow (not the last) |
| M = 0 | Last fragment |
| D = 1 | Do not fragment. If the packet is bigger than the link's MTU, it is dropped. |
Fragmentation happens at the source or at any router; reassembly happens only at the destination. The packet must fit the next link's MTU.
Routing reduces to two calculations: the least-cost path through a weighted graph, and matching a destination address against a forwarding table.
The best path is the one with the minimum total cost from source to destination. The cost metric can be hops, distance, delay, capacity, reliability, or a mix of these.
In round one a router knows only its direct neighbours, and every other entry is ∞ (unreachable). It updates whenever a neighbour's vector changes or a link goes up or down.
| Distance vector | Link state | |
|---|---|---|
| Sends to | Neighbours only | All routers in the area (flooding) |
| Sends what | Estimated cost to every destination | Exact cost of its own links |
| When | Periodically, every 30 s | When a link changes |
| Failure reaction | Slow | Fast |
| Algorithm | Bellman–Ford | Dijkstra |
| Examples | RIP, EIGRP | OSPF |
Inside one AS (interior): RIP, OSPF, EIGRP. Between ASs (exterior): BGP.
0.0.0.0/0: everything else.Source and destination hosts need no forwarding table: they use their default router.
TCP numbers bytes, not segments, and almost every calculation question here depends on that one fact.
The first segment's sequence number is the initial sequence number (ISN), which is chosen at random when the connection is set up.
ACKs are cumulative: ACK = X means every byte up to X − 1 arrived, and the receiver expects byte X next. If the timer runs out before the ACK arrives, the sender retransmits.
5000 bytes ÷ 1000 bytes = 5 segments (example 9.8).
Windows are announced during the three-way handshake (SYN, SYN+ACK, ACK) and can change at any time. Both sides have their own windows because TCP is full duplex.
Well-known ports 0–1023 are assigned by IANA and given to servers. A connection is identified by the pair of socket addresses (source IP, source port, destination IP, destination port), so two clients can both use source port 49888 to reach port 80.
TCP is 20 bytes by default and up to 60 with options. UDP's checksum covers the whole segment and is optional.
| Port | Protocol | Over |
|---|---|---|
| 20, 21 | FTP (data, control) | TCP |
| 23 | TELNET | TCP |
| 25 | SMTP | TCP |
| 53 | DNS | UDP and TCP |
| 67 | DHCP | UDP |
| 69 | TFTP | UDP |
| 80 | HTTP | TCP |
| 123 | NTP | UDP |
| 161, 162 | SNMP (server, client) | UDP |
The DNS chapter has no equations. These are the numbers and step orders that come up as short-answer questions.
DNS normally uses UDP because a request and its response each fit in one datagram.
The root's label is the empty dot. Only an FQDN can be resolved to an IP address. A PQDN (partial name) is completed by the resolver, which adds the local suffix.
The primary server loads its zone from a disk file. The secondary server loads everything from the primary; this copy is called a zone transfer.
Caching saves the result of a lookup so the next query for a name outside the server's domain is answered faster.
| Recursive | Iterative | |
|---|---|---|
| Who asks the next server | Each server asks the next one itself | The local server asks every server in turn |
| A server without the answer sends back | Nothing yet: it forwards the query and waits | A referral: the IP address of the next server |
| The answer travels | Back down the chain to the host | Straight to the local server, then to the host |
| Label | Used by |
|---|---|
| com | Commercial organisations |
| edu | Educational institutions |
| gov | Government institutions |
| org | Nonprofit organisations |
| net | Network support centres |
| int / mil | International organisations / military |
| aero, biz, coop, info, museum, name, pro | Aerospace, businesses, cooperatives, information services, museums, individuals, professionals |