Important Formulas for Networking Numericals
1. Subnetting & IP Addressing
- Subnet Mask Calculation:
To divide a network into subnets, you need to borrow bits from the host part of the address.
New subnet mask = Original subnet mask + Number of borrowed bits
- Number of Subnets:
The number of subnets created by borrowing n bits is:
Number of subnets = 2^n
- Number of Hosts per Subnet:
The number of hosts in each subnet is:
Number of hosts = 2^h - 2
where h is the number of host bits (total bits - network bits). Subtract 2 for the network and
broadcast addresses.
- Subnet Increment:
The increment between consecutive subnets is:
Subnet increment = 2^h
2. Transmission Time & Propagation Delay
- Transmission Time:
The time required to send a frame is given by:
T_trans = Frame Size (in bits) / Transmission Speed (in bps)
- Propagation Delay:
The time taken for a signal to travel through the medium:
T_prop = Distance (in meters) / Propagation Speed (in m/s)
- Round-Trip Time (RTT):
The time it takes for a signal to travel from the sender to the receiver and back:
RTT = 2 * Distance / Propagation Speed
3. CSMA/CD
- Minimum Frame Size in CSMA/CD:
To detect collisions, the minimum frame size must ensure the sender detects collisions before it
finishes transmitting. The frame size is:
Frame size >= Bandwidth * Round-trip Time
- Efficiency of CSMA/CD:
Efficiency is determined by the ratio of time spent transmitting data to the total time for
transmission and propagation delays:
Efficiency = Transmission Time / (Transmission Time + Propagation Delay)
4. TCP Throughput & Performance
- TCP Throughput:
The throughput is influenced by the sender's window size and the round-trip time:
Throughput = Window Size (in bits) / RTT
- Maximum Window Size (TCP):
TCP uses a sliding window to determine how much data can be sent before receiving an
acknowledgment. The maximum window size in TCP is determined by the Bandwidth-Delay
Product:
Maximum Window Size = Bandwidth * RTT
- TCP Maximum Segment Size (MSS):
Throughput = MSS / (RTT + Transmission Time)
5. Sliding Window Protocol
- Throughput with Sliding Window:
The maximum throughput for a sliding window protocol is determined by the window size and RTT:
Throughput = Window Size / RTT
- Efficiency of Sliding Window Protocol:
The efficiency of a sliding window protocol depends on the round-trip time and window size:
Efficiency = Window Size / (Window Size + 2 * RTT * Transmission Rate)
6. Bandwidth-Delay Product (BDP)
The Bandwidth-Delay Product gives the maximum amount of data that can be "in transit" at one
time. It's used to determine the optimal window size for a TCP connection:
BDP = Bandwidth * RTT
Where:
- Bandwidth is in bps.
- RTT is in seconds.
7. Token Ring Utilization
- Token Ring Utilization:
The maximum utilization of a token ring network is given by the ratio of the transmission time to the
sum of transmission time and propagation delay:
Utilization = T_trans / (T_trans + T_prop)
8. Network Performance (Link Utilization & Efficiency)
- Link Utilization:
The link utilization can be calculated as the ratio of transmission time to the total time (transmission
time + propagation delay):
Utilization = T_trans / (T_trans + T_prop)
9. Ethernet & Transmission Calculations
- Ethernet Frame Size:
The minimum Ethernet frame size is calculated by ensuring that the transmission time is long
enough to detect collisions:
S = Bandwidth * Round-trip Time
Where bandwidth is in bps, and round-trip time is in seconds.
10. Link Layer Flow Control
- Sliding Window Efficiency:
The efficiency of the sliding window protocol is:
Efficiency = Window Size / (Window Size + 2 * RTT * Transmission Rate)
11. Bandwidth and Link Calculations
- Total Data Transferred:
To calculate the total data transferred in a given time:
Total Data = Bandwidth * Time
12. Sliding Window Protocol for Flow Control
- Maximum Window Size:
For efficient sliding window protocol operation, the maximum window size is calculated based on
the Bandwidth-Delay Product:
Maximum Window Size = Bandwidth * RTT
13. Link Layer Calculations (Token Bucket/Leaky Bucket)
- Token Bucket Algorithm: Used to control the data rate.
Token generation rate = Maximum Token Bucket Size / Time Period
- Leaky Bucket Algorithm: Ensures that data is sent at a constant rate, even if the incoming data rate
is bursty.
14. Data Link Layer Performance
- Utilization in Token Ring or Bus Topology:
Utilization = Transmission Rate / (Transmission Rate + Propagation Delay)