SME
Computer Networks
TCP/IP
Use this for “Find the network and broadcast address of 192.168.10.77/26.”
Diagram
network 26 + host 6 = 32 bits, the whole 32-bit word.
Network’s last octet network = 64
Broadcast’s last octet broadcast = 127
Usable hosts hosts = 62
This is an example. Type your own values to start a new problem.
n
Prefix length
example
block
Block size
calculated
m
Mask’s last octet
calculated
a
Address’s last octet
example
network
Network’s last octet
worked out (not typed)
broadcast
Broadcast’s last octet
worked out (not typed)
hosts
Usable hosts
calculated
Formulas
block
=
2
32 −
n
64
=
2
32 − 26
m
=
256
−
block
192 = 256 − 64
network
=
⌊
a
block
⌋
×
block
64
=
⌊
77
64
⌋
×
64
broadcast = network + block − 1
127 = 64 + 64 − 1
hosts = block − 2
62 = 64 − 2
Assumptions
•
The address is 192.168.10.a: the first three octets are all network bits, so the prefix n runs from 24 to 30.
•
The mask is n 1s then 0s, so it reads 255.255.255.m.
•
Host bits all 0 name the network and all 1 are the broadcast, so neither goes to a host.
Step-by-step
WE KNOW
n = /26, a = 77
FIND
block size (block), mask’s last octet (m), network’s last octet (network), broadcast’s last octet (broadcast), usable hosts (hosts)
Step 1 · Find block size (block)
Use block = 2³²⁻ⁿ
The
32
−
n
host
bits
count
the
addresses
in
one
block.
block
=
2
32 − 26
block
=
2
6
block = 64
Step 2 · Find mask’s last octet (m)
Use m = 256 − block
The mask’s last octet keeps the 1s above the host bits: 256 less one block.
m
=
256
−
64
m
=
192
Step 3 · Find network’s last octet (network)
Use network = ⌊a ÷ block⌋ × block
Round the address down to a whole number of blocks: that sets every host bit to 0.
network
=
⌊
77
64
⌋
×
64
⌊
77
64
⌋
=
⌊1.2031⌋
=
1
network = 1 × 64
network = 64
Step 4 · Find broadcast’s last octet (broadcast)
Use broadcast = network + block − 1
The last address of the block: every host bit set to 1.
broadcast = 64 + 64 − 1
broadcast = 127
Step 5 · Find usable hosts (hosts)
Use hosts = block − 2
Every address of the block but the network and the broadcast.
hosts = 64 − 2
hosts = 62
Check
Put the numbers back in. Both sides should match.
64
=
2
32 − 26
✓
192 = 256 − 64 ✓
64
=
⌊
77
64
⌋
×
64
✓
127 = 64 + 64 − 1 ✓
62 = 64 − 2 ✓
Topic check
See what you know: 5 questions on this topic
New questions each time. Pass to mark it complete.
More problem types
Split a block into subnets
Use this for “Split a /24 block into 5 equal subnets. What is their prefix, and how many hosts does each hold?”
Throughput limited by the window
Use this for “A TCP connection has a 64 KiB window and a 50 ms round-trip time. What is its highest throughput?”
Sequence and acknowledgment numbers
Use this for “A segment with sequence number 1000 carries 500 bytes. What acknowledgment number does the receiver send?”
The TCP handshake
Use this for “Put the segments that open, use and close a TCP connection in order.”