Unit 3: MAC Sublayer and IP Addressing - Subjective Questions
CSE306 — Computer Networks • Practice Questions with Detailed Answers
20 questions
Define multiple access protocols. Explain their major classifications with suitable examples.
Multiple access protocols are rules that coordinate the transmission of multiple stations sharing a common communication channel. Their purpose is to determine which station may access the medium at a given time and to minimize collisions.
Major classifications
-
Random access protocols:
- Stations compete for access without centralized control.
- Collisions may occur and are handled through retransmission mechanisms.
- Examples: Pure ALOHA, Slotted ALOHA, CSMA, and CSMA/CD.
-
Controlled access protocols:
- Access is coordinated so that only one station transmits at a time.
- Common techniques include reservation, polling, and token passing.
- These protocols reduce collisions but introduce coordination overhead.
-
Channelization protocols:
- The available channel is divided among multiple users.
- Division may be based on frequency, time, or code.
- Examples: FDMA, TDMA, and CDMA.
Thus, multiple access protocols improve fairness and utilization when many devices share the same transmission medium.
Explain the working of Pure ALOHA. Discuss its vulnerable period, throughput, advantages, and limitations.
In Pure ALOHA, a station transmits a frame whenever it has data to send. It does not first check whether the channel is idle.
Working
- A station transmits a frame immediately.
- It waits for an acknowledgment.
- If an acknowledgment is received, transmission is successful.
- If no acknowledgment is received before timeout, a collision is assumed.
- The station waits for a random backoff period and retransmits.
Vulnerable period
If the frame transmission time is , another frame can collide by beginning within one frame time before or after the start of the original frame. Therefore, the vulnerable period is:
Throughput
If is the average number of transmission attempts per frame time, the normalized throughput is:
The maximum throughput occurs at :
Thus, the maximum channel utilization is approximately 18.4%.
Advantages
- Simple and decentralized.
- Does not require synchronization.
- Suitable for systems with low traffic.
Limitations
- High collision probability.
- Poor channel utilization under heavy load.
- Random retransmissions can cause large delays.
Compare Pure ALOHA and Slotted ALOHA. Derive their maximum normalized throughputs.
Both protocols allow stations to transmit over a shared channel, but Slotted ALOHA restricts transmissions to slot boundaries.
Pure ALOHA
- A frame can be transmitted at any instant.
- Vulnerable period is , where is the frame transmission time.
- A transmission succeeds only when no other attempt occurs during this period.
Its throughput is:
To obtain the maximum, differentiate with respect to :
Setting the derivative to zero gives:
Therefore:
Slotted ALOHA
- Time is divided into slots of duration .
- A station may transmit only at the beginning of a slot.
- Its vulnerable period is .
Its throughput is:
Differentiating gives:
The maximum occurs at :
Comparison
- Pure ALOHA utilization: approximately 18.4%.
- Slotted ALOHA utilization: approximately 36.8%.
- Slotted ALOHA requires time synchronization.
- Pure ALOHA is simpler but has twice the vulnerable period.
Therefore, Slotted ALOHA approximately doubles the maximum efficiency of Pure ALOHA.
What is the vulnerable period in a random access protocol? Explain it for Pure ALOHA and Slotted ALOHA.
The vulnerable period is the time interval during which another frame transmission can overlap with a given frame and cause a collision.
Assume that the time required to transmit one frame is .
Pure ALOHA
- A station may begin transmission at any instant.
- A second frame can collide if it starts during the interval of length before the first frame or during the interval of length after it starts.
- Therefore, the vulnerable period is:
This long vulnerable period produces a high collision probability.
Slotted ALOHA
- Time is divided into fixed slots of duration .
- Frames can begin only at slot boundaries.
- A collision occurs only when two or more stations select the same slot.
- Therefore, the vulnerable period is:
Since Slotted ALOHA has half the vulnerable period of Pure ALOHA, its maximum throughput is twice as large.
Explain the basic operation of Carrier Sense Multiple Access (CSMA). Why does carrier sensing not eliminate collisions completely?
CSMA is a random access protocol in which a station listens to the shared channel before transmitting. This principle is commonly described as listen before talk.
Operation
- A station senses the carrier to determine whether the channel is idle or busy.
- If the channel is idle, it transmits according to its persistence rule.
- If the channel is busy, it waits or reschedules its attempt.
- If a collision occurs, the frame is retransmitted after a random delay.
Why collisions still occur
Carrier sensing cannot eliminate collisions because signals require time to propagate through the network. Suppose stations A and B are far apart:
- A senses an idle channel and begins transmission.
- Before A's signal reaches B, B also senses the channel as idle.
- B begins transmitting.
- The two signals overlap, causing a collision.
The likelihood of collision depends on the ratio of propagation time to frame transmission time . A smaller value of generally results in better CSMA performance.
Thus, CSMA reduces collisions compared with ALOHA, but propagation delay prevents it from eliminating them entirely.
Distinguish among 1-persistent, non-persistent, and -persistent CSMA.
The CSMA variants differ in how a station behaves after sensing the shared channel.
1-persistent CSMA
- If the channel is idle, the station transmits immediately with probability .
- If the channel is busy, it continuously senses the channel.
- It offers low delay under light traffic.
- Multiple waiting stations may transmit simultaneously when the channel becomes idle, causing a collision.
Non-persistent CSMA
- If the channel is idle, the station transmits immediately.
- If the channel is busy, it waits for a random period before sensing again.
- It reduces the chance that several waiting stations transmit together.
- It may produce higher delay because a station does not continuously monitor the channel.
-persistent CSMA
- It is generally used with slotted channels.
- When the channel is idle, the station transmits in the next slot with probability .
- It defers to the following slot with probability .
- The process is repeated until the frame is transmitted or another station occupies the channel.
Summary
- 1-persistent: aggressive and low-delay, but collision-prone.
- Non-persistent: fewer collisions, but potentially greater delay.
- -persistent: balances collision probability and delay through the value of .
Describe the complete working of CSMA/CD, including collision detection, jam signal, and retransmission.
CSMA/CD stands for Carrier Sense Multiple Access with Collision Detection. It was used in traditional shared, half-duplex Ethernet.
Working procedure
- Carrier sensing: The station listens to the medium.
- Channel decision:
- If the channel is busy, the station waits.
- If the channel is idle, it begins transmitting.
- Collision detection: While transmitting, the station continues monitoring the medium.
- Jam signal: If the detected signal differs from the transmitted signal, a collision is identified. The station sends a jam signal so that every station becomes aware of the collision.
- Transmission termination: The colliding stations stop transmitting their current frames.
- Binary exponential backoff: After the th collision, a station selects a random integer from a permitted contention range and waits for:
- Retransmission: The station senses the channel again and retransmits when allowed.
In classic Ethernet, the slot time is 512 bit times. After repeated collisions, the backoff range increases, reducing the chance of another collision. After 16 unsuccessful attempts, the frame transmission is abandoned and an error is reported.
CSMA/CD is unnecessary in modern full-duplex switched Ethernet because each link is collision-free.
Derive the minimum frame-size requirement of a CSMA/CD network. Why does traditional Ethernet use a minimum frame size of 64 bytes?
For collision detection, a transmitting station must still be sending when a worst-case collision signal returns to it.
Let:
- be the frame length in bits.
- be the transmission rate in bits per second.
- be the maximum one-way propagation delay.
The frame transmission time is:
In the worst case, a signal travels from one end of the network to the other, a collision occurs, and the effect travels back. Therefore, the round-trip propagation delay is:
For reliable collision detection:
Substituting :
Therefore:
Classic Ethernet defines its slot time as 512 bit times. Hence, the minimum Ethernet frame size is:
The 64 bytes are counted from the destination MAC address through the frame check sequence, excluding the preamble and start frame delimiter. If the data field is too short, padding is added to meet this minimum.
Without a minimum frame size, a station might finish transmitting before a distant collision returns and could incorrectly assume that the frame was delivered successfully.
Describe the Ethernet frame format and explain the function of each field.
A standard Ethernet frame contains the following fields:
-
Preamble — 7 bytes:
- Contains an alternating bit pattern.
- Allows the receiver to synchronize its clock with the sender.
-
Start Frame Delimiter — 1 byte:
- Marks the end of the preamble and the beginning of the frame.
-
Destination MAC address — 6 bytes:
- Identifies the intended receiver.
- It may be a unicast, multicast, or broadcast address.
-
Source MAC address — 6 bytes:
- Identifies the network interface that transmitted the frame.
-
Type/Length — 2 bytes:
- Indicates either the upper-layer protocol, such as IPv4, or the length of the payload, depending on the Ethernet standard.
-
Data and padding — 46 to 1500 bytes:
- Carries the encapsulated upper-layer packet.
- Padding is added if the payload is less than 46 bytes.
-
Frame Check Sequence — 4 bytes:
- Contains a cyclic redundancy check value.
- It enables the receiver to detect transmission errors.
The frame from destination address through FCS has a minimum size of 64 bytes and a normal maximum size of 1518 bytes, excluding VLAN tagging, preamble, and start frame delimiter.
Explain the binary exponential backoff algorithm used by Ethernet after a collision.
The binary exponential backoff algorithm determines how long an Ethernet station should wait before retransmitting after a collision.
Algorithm
- Let be the number of collisions experienced by the current frame.
- The station selects a random integer from a contention range.
- For the early attempts, the range is:
- The station waits for:
- It then senses the channel again and attempts retransmission.
- The exponent is normally capped after the tenth collision, so the largest usual range is based on possibilities.
- After 16 failed transmission attempts, Ethernet abandons the frame and reports a failure.
Example
- After the first collision, is selected from .
- After the second collision, is selected from .
- After the third collision, is selected from .
The increasing random range reduces repeated collisions during congestion, while the random choice prevents all colliding stations from retransmitting at exactly the same time.
Compare shared half-duplex Ethernet with switched full-duplex Ethernet in terms of collisions, bandwidth, and CSMA/CD.
Shared half-duplex Ethernet
- Multiple devices share the same physical communication medium.
- A hub repeats incoming signals to all connected ports.
- All connected stations belong to one collision domain.
- Only one station can transmit successfully at a time.
- Simultaneous transmissions cause collisions.
- CSMA/CD is required to detect and recover from collisions.
- The available bandwidth is shared among all stations.
Switched full-duplex Ethernet
- Each device has a dedicated point-to-point link to a switch port.
- The device and switch can transmit simultaneously.
- Each switch port forms a separate collision domain.
- Collisions do not occur on a properly configured full-duplex link.
- CSMA/CD is disabled and is not required.
- Each device can use the full link bandwidth.
- Switching also reduces unnecessary frame delivery by forwarding unicast frames only through the required port.
Thus, switched full-duplex Ethernet offers better throughput, scalability, and collision isolation than shared half-duplex Ethernet.
Explain classful IPv4 addressing. Describe Classes A, B, C, D, and E with their address ranges and default masks.
In classful IPv4 addressing, the address space is divided into fixed classes according to the leading bits of the address. For Classes A, B, and C, the class determines the boundary between the network and host portions.
Class A
- First-octet range: 1 to 126.
- Leading bit: .
- Default prefix: /8.
- Default mask: 255.0.0.0.
- Intended for very large networks.
Class B
- First-octet range: 128 to 191.
- Leading bits: .
- Default prefix: /16.
- Default mask: 255.255.0.0.
- Intended for medium-sized networks.
Class C
- First-octet range: 192 to 223.
- Leading bits: .
- Default prefix: /24.
- Default mask: 255.255.255.0.
- Intended for small networks.
Class D
- First-octet range: 224 to 239.
- Used for multicast addressing.
- It has no conventional network-host division.
Class E
- First-octet range: 240 to 255.
- Reserved for experimental or special purposes.
The block beginning with 127 is reserved for loopback, while addresses beginning with 0 have special meanings. Classful addressing has largely been replaced by CIDR because fixed class sizes waste address space.
For the classful IPv4 address 172.20.14.5, determine its class, default subnet mask, network address, broadcast address, and usable host range.
The first octet of the address is 172.
Step 1: Determine the class
Class B addresses have a first octet from 128 to 191. Therefore, 172.20.14.5 is a Class B address.
Step 2: Apply the default mask
The default Class B subnet mask is:
- Dotted-decimal mask: 255.255.0.0
- Prefix length: /16
Step 3: Find the network address
The first two octets are the network part and the last two octets are the host part. Setting all host bits to zero gives:
172.20.0.0
Step 4: Find the broadcast address
Setting all host bits to one gives:
172.20.255.255
Step 5: Find the usable host range
- First usable host: 172.20.0.1
- Last usable host: 172.20.255.254
There are 16 host bits, so the traditional number of usable host addresses is:
The subtraction excludes the network and broadcast addresses.
Discuss the limitations of classful IP addressing and explain why classless addressing became necessary.
Classful addressing uses fixed network sizes: Class A uses /8, Class B uses /16, and Class C uses /24. This fixed structure creates several problems.
Limitations
- Address wastage: An organization needing slightly more than 254 hosts could not use one Class C network and might receive a Class B network with 65,534 usable addresses.
- Inflexible allocation: Network sizes could not be selected according to actual requirements.
- Rapid IPv4 exhaustion: Large unused portions of assigned blocks accelerated address consumption.
- Large routing tables: Organizations were often assigned multiple Class C networks, each potentially requiring a separate routing-table entry.
- No explicit prefix in early routing: Traditional classful protocols inferred the mask from the address class and could not easily support variable-length subnet masks.
Need for classless addressing
Classless Inter-Domain Routing, or CIDR, introduced variable-length prefixes such as /20, /27, and /30. CIDR provides:
- More precise address allocation.
- Better utilization of IPv4 address space.
- Support for variable-length subnet masks.
- Route aggregation or supernetting.
- Smaller and more scalable routing tables.
Therefore, classless addressing replaced rigid class boundaries with a flexible prefix-based system.
Define classless addressing and CIDR notation. Explain how the prefix length determines the network size.
Classless addressing treats an IPv4 address as a sequence of 32 bits without assigning it to a fixed Class A, B, or C boundary. The network portion is identified by an explicitly specified prefix length.
CIDR notation
CIDR writes an address followed by a slash and the number of network bits. For example:
192.168.4.0/22
Here:
- The first 22 bits identify the network prefix.
- The remaining bits identify addresses within the block.
Number of addresses
For a prefix of length , the block contains:
addresses. For /22:
addresses.
Subnet mask
A /22 prefix corresponds to:
255.255.252.0
The prefix bits are consecutive ones, and the remaining bits are zeros. The block size in the third octet is:
Therefore, valid /22 network boundaries in the third octet occur at 0, 4, 8, 12, and so on.
CIDR permits efficient address allocation and allows multiple contiguous networks to be represented by one aggregated route.
For the CIDR block 192.168.10.64/26, calculate the subnet mask, total addresses, network address, broadcast address, and usable host range.
The prefix length is /26, so 26 bits are network bits and 6 bits are host bits.
Subnet mask
The binary mask ends with two network bits in the fourth octet:
Therefore, the subnet mask is:
255.255.255.192
Number of addresses
The traditional number of usable hosts is:
Address range
The block size is:
Thus, fourth-octet boundaries occur at 0, 64, 128, and 192. The given address begins the second block.
- Network address: 192.168.10.64
- First usable host: 192.168.10.65
- Last usable host: 192.168.10.126
- Broadcast address: 192.168.10.127
The complete block ranges from 192.168.10.64 to 192.168.10.127.
Differentiate between classful and classless IP addressing.
Classful addressing
- Divides IPv4 unicast addresses into Classes A, B, and C.
- Uses fixed default prefixes: /8, /16, and /24.
- The network boundary is inferred from the first few address bits.
- Does not provide flexible allocation based on the exact number of required hosts.
- Often wastes a large number of addresses.
- Classful routing protocols do not carry subnet masks in their routing updates.
- Route aggregation is restricted by class boundaries.
Classless addressing
- Does not depend on Classes A, B, or C.
- Uses an explicit prefix length such as /19, /27, or /30.
- Supports subnet blocks of many different sizes.
- Allocates addresses according to actual organizational requirements.
- Supports Variable-Length Subnet Masking, or VLSM.
- Enables route aggregation and reduces routing-table size.
- Classless routing protocols carry prefix-length information.
For example, 192.168.1.0 would traditionally be a Class C /24 network, but classless addressing allows it to be divided into /25, /26, /27, or other valid subnet sizes.
Subnet the network 192.168.1.0/24 into eight equal-sized subnets. Find the new prefix, subnet mask, and address range of each subnet.
Eight equal subnets are required. The number of borrowed bits must satisfy:
Therefore:
The original prefix is /24, so the new prefix is:
New subnet information
- Prefix: /27
- Subnet mask: 255.255.255.224
- Addresses per subnet:
- Traditional usable hosts per subnet:
- Block size:
Subnets
-
192.168.1.0/27
- Hosts: 192.168.1.1 to 192.168.1.30
- Broadcast: 192.168.1.31
-
192.168.1.32/27
- Hosts: 192.168.1.33 to 192.168.1.62
- Broadcast: 192.168.1.63
-
192.168.1.64/27
- Hosts: 192.168.1.65 to 192.168.1.94
- Broadcast: 192.168.1.95
-
192.168.1.96/27
- Hosts: 192.168.1.97 to 192.168.1.126
- Broadcast: 192.168.1.127
-
192.168.1.128/27
- Hosts: 192.168.1.129 to 192.168.1.158
- Broadcast: 192.168.1.159
-
192.168.1.160/27
- Hosts: 192.168.1.161 to 192.168.1.190
- Broadcast: 192.168.1.191
-
192.168.1.192/27
- Hosts: 192.168.1.193 to 192.168.1.222
- Broadcast: 192.168.1.223
-
192.168.1.224/27
- Hosts: 192.168.1.225 to 192.168.1.254
- Broadcast: 192.168.1.255
An organization has the network 10.0.5.0/24 and requires subnets supporting at least 50 hosts each. Determine the appropriate subnet mask and describe the resulting subnets.
Let be the number of host bits. A traditional subnet must satisfy:
Testing the possible values:
- For : , which is insufficient.
- For : , which is sufficient.
Therefore, 6 host bits are needed. The prefix length is:
Subnet information
- New prefix: /26
- Subnet mask: 255.255.255.192
- Addresses per subnet: 64
- Usable hosts per subnet: 62
- Number of /26 subnets within a /24: 4
Resulting subnets
-
10.0.5.0/26
- Hosts: 10.0.5.1 to 10.0.5.62
- Broadcast: 10.0.5.63
-
10.0.5.64/26
- Hosts: 10.0.5.65 to 10.0.5.126
- Broadcast: 10.0.5.127
-
10.0.5.128/26
- Hosts: 10.0.5.129 to 10.0.5.190
- Broadcast: 10.0.5.191
-
10.0.5.192/26
- Hosts: 10.0.5.193 to 10.0.5.254
- Broadcast: 10.0.5.255
Each subnet can support the required 50 hosts.
Using VLSM, allocate address blocks from 192.168.1.0/24 to departments requiring 120, 60, and 30 hosts. Show the allocation and remaining address space.
In VLSM, requirements are arranged from largest to smallest to avoid fragmentation.
Department requiring 120 hosts
The host-bit requirement is:
Therefore, it needs a /25 subnet.
- Network: 192.168.1.0/25
- Mask: 255.255.255.128
- Usable hosts: 192.168.1.1 to 192.168.1.126
- Broadcast: 192.168.1.127
Department requiring 60 hosts
The host-bit requirement is:
Therefore, it needs a /26 subnet.
- Network: 192.168.1.128/26
- Mask: 255.255.255.192
- Usable hosts: 192.168.1.129 to 192.168.1.190
- Broadcast: 192.168.1.191
Department requiring 30 hosts
The host-bit requirement is:
Therefore, it needs a /27 subnet.
- Network: 192.168.1.192/27
- Mask: 255.255.255.224
- Usable hosts: 192.168.1.193 to 192.168.1.222
- Broadcast: 192.168.1.223
Remaining address space
The unused range is:
- Network: 192.168.1.224/27
- Addresses: 192.168.1.224 to 192.168.1.255
- Usable hosts if treated as a subnet: 192.168.1.225 to 192.168.1.254
- Broadcast: 192.168.1.255
VLSM allocates differently sized subnets according to need and uses the original /24 block more efficiently than fixed-length subnetting.
Define multiple access protocols. Explain their major classifications with suitable examples.
Multiple access protocols are rules that coordinate the transmission of multiple stations sharing a common communication channel. Their purpose is to determine which station may access the medium at a given time and to minimize collisions.
Major classifications
-
Random access protocols:
- Stations compete for access without centralized control.
- Collisions may occur and are handled through retransmission mechanisms.
- Examples: Pure ALOHA, Slotted ALOHA, CSMA, and CSMA/CD.
-
Controlled access protocols:
- Access is coordinated so that only one station transmits at a time.
- Common techniques include reservation, polling, and token passing.
- These protocols reduce collisions but introduce coordination overhead.
-
Channelization protocols:
- The available channel is divided among multiple users.
- Division may be based on frequency, time, or code.
- Examples: FDMA, TDMA, and CDMA.
Thus, multiple access protocols improve fairness and utilization when many devices share the same transmission medium.
Did this save you a night before the exam?
LPU Notes is free, and it stays free. Ads cover part of the server bill. The rest comes out of a student's own pocket: the domain, the storage, and keeping the site up through the weeks everyone needs it at once.
The payment button didn't load. An ad blocker or a filtered network is the usual reason. to try again.
Nothing here is ever locked, and nothing unlocks. Chip in only if it was worth it. What it pays for →