CS331 Formulas
CS331 · Computer Networks

Formula sheet, every chapter

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.

Formula to memorise
Slide example, worked
Common mistake
Way to remember it
CHAPTER 01

Introduction: networks, topologies and layers

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.

Topology counts

1.1

Mesh topology

Links = N(N − 1)2
Ports (NICs) per device = N − 1
Cables = Links

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.

Example
N = 6 devices Links = 6 × 5 / 2 = 15 Ports = 6 − 1 = 5 per device (30 in total) Cables = 15
Watch out Total ports = N(N − 1), which is twice the number of links, because each link uses one port at each end.
1.2

Star, bus and ring

TopologyNumber of linksNotes
StarNOne dedicated link from each node to the central hub/switch. If the hub fails, the whole network fails.
Bus1 main + N drop linesOne backbone cable; each node taps in with a drop line. Less cabling than mesh or star.
RingNEach node is linked to the two nodes on either side of it.
MeshN(N − 1)/2Most secure and robust, most expensive.

Layering

1.3

Protocol data unit (PDU)

PDU of layer n = data from layer n + 1 + header of layer n

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.

Remember Going down the stack adds headers (the data link layer also adds a trailer); going up removes them.
1.4

Data rate

Data rate = transmission rate = bandwidth

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)