Exercises
Use the following exercises to consolidate what you have learned about the physical layer.
1. Basic Concept Questions
1.1 Multiple Choice
-
A channel is ( ) A. the physical path over which data travels B. the logical path over which data travels C. the virtual path over which data travels D. the software path over which data travels
-
The unit of bandwidth is ( ) A. bps B. Hz C. dB D. m
-
A symbol is ( ) A. the smallest unit of a signal B. the smallest unit of data C. the smallest unit of transmission D. the smallest unit of a network
-
A baud is ( ) A. the number of bits transmitted per second B. the number of symbols transmitted per second C. the number of bytes transmitted per second D. the number of packets transmitted per second
1.2 Fill in the Blanks
-
Signals can be divided into two types: ( ) and ( ).
-
The source is the ( ) of the information, and the sink is the ( ).
-
The basic components of a communication system are ( ), ( ), ( ), ( ), ( ), and ( ).
-
The larger the bandwidth, the ( ) the transmission rate.
Approach
For the multiple choice items, identify the definition each term actually denotes: a channel is a physical path, bandwidth is measured in hertz, a symbol is a unit of a signal, and a baud counts symbols per second. For the fill-in-the-blanks, recall the two signal types, the roles of the source and the sink, the six stages of the communication system, and the direction of the bandwidth–rate relationship.
Steps
- Read each option as a stand-alone definition rather than as a plausible-sounding phrase.
- For the bandwidth item, separate the two meanings of bandwidth and pick the unit that belongs to the physical one.
- For the symbol item, keep the unit of the signal distinct from the unit of the data.
- For the baud item, remember that a baud counts symbols, not bits.
- Write the fill-in-the-blanks from the definitions given earlier in the chapter.
Answer
- B — the unit of bandwidth is Hz
- A — a symbol is the smallest unit of a signal
- B — a baud is the number of symbols transmitted per second
- A — a channel is the physical path over which data travels
Fill in the blanks:
- Analog signal, digital signal
- Sender, receiver
- Source, transmitting device, channel, receiving device, sink, noise source
- Higher
2. Transmission Theory Questions
2.1 Calculation
-
Nyquist theorem calculation
Suppose a noiseless channel has a bandwidth of 4000 Hz and carries a quaternary signal. Find the maximum symbol rate.
-
Shannon theorem calculation
Suppose a channel has a bandwidth of 3000 Hz and a signal-to-noise ratio of 30 dB. Find the maximum data rate.
-
Real transmission rate calculation
If the theoretical transmission rate is 10000 bps, the encoding efficiency is 80%, and the protocol overhead is 10%, find the real transmission rate.
2.2 Analysis
-
Compare the situations in which the Nyquist theorem and the Shannon theorem apply.
-
Analyse the main factors that affect channel capacity.
-
Explain why the real transmission rate is usually below the theoretical limit.
Approach
Apply each theorem to the situation it describes: Nyquist gives the symbol rate of an ideal noiseless channel, Shannon gives the data rate of a noisy channel. For the analysis items, separate the factors that are fixed by the path from the factors that vary with load, and then account for the overhead that the two theorems ignore.
Steps
- For the Nyquist calculation, substitute and into .
- For the Shannon calculation, first convert the SNR from decibels to a ratio, then substitute into .
- For the real rate, apply real rate = theoretical rate × encoding efficiency × (1 − overhead ratio).
- For the comparison item, note that Nyquist assumes no noise while Shannon includes it, and that they differ in output unit.
- For the capacity factors, list bandwidth, SNR, and encoding scheme.
- For the last item, list protocol overhead, encoding efficiency, equipment limits, and network congestion.
Answer
-
Nyquist theorem calculation:
-
Shannon theorem calculation:
-
Real transmission rate calculation:
For the analysis items:
- The Nyquist theorem applies to ideal channels with little or no noise and gives the symbol rate in baud; the Shannon theorem applies to real noisy channels and gives the data rate in bps, and its limit is always the tighter of the two.
- The main factors affecting channel capacity are the bandwidth, the signal-to-noise ratio, and the encoding scheme, since a wider bandwidth, a higher SNR, and a more efficient encoding all raise the capacity.
- The real rate is lower because the theorems ignore protocol overhead such as frame headers and checksums, the redundancy of error-correcting codes, the processing limits of the equipment, and the loss of throughput under congestion.
3. Encoding and Modulation Questions
3.1 Multiple Choice
-
The characteristic of Manchester encoding is ( ) A. one transition in the middle of every bit period B. one transition at the start of every bit period C. one transition at the end of every bit period D. no transition within a bit period
-
ASK modulation is ( ) A. amplitude shift keying B. frequency shift keying C. phase shift keying D. quadrature amplitude modulation
-
QPSK modulation transmits ( ) bits of data per symbol A. 1 B. 2 C. 4 D. 8
3.2 Fill in the Blanks
-
The main purpose of encoding is to improve the ( ) and the ( ) of transmission.
-
Modulation is the process of converting a ( ) signal into a ( ) signal.
-
BPSK modulation represents 0 with a phase of ( ) degrees and 1 with a phase of ( ) degrees.
-
QAM modulates the ( ) and the ( ) of the carrier at the same time.
Approach
Match each scheme to the physical property it varies: Manchester encoding is defined by where the transition occurs, ASK by the amplitude, FSK by the frequency, PSK by the phase, and QAM by the amplitude and phase together. The number of bits per symbol follows from .
Steps
- For the Manchester item, recall that the transition sits in the middle of the bit period, which is what carries the clock.
- For the ASK item, match the abbreviation to the property it varies.
- For the QPSK item, count the phases: four phases, so bits per symbol.
- For the fill-in-the-blanks, fill in the two goals of encoding, the direction of the conversion, the two BPSK phases, and the two QAM properties.
Answer
- A — one transition in the middle of every bit period
- A — amplitude shift keying
- B — 2 bits of data
Fill in the blanks:
- Reliability, efficiency
- Digital, analog
- 0, 180
- Amplitude, phase
4. Switching Technique Questions
4.1 Multiple Choice
-
The characteristic of circuit switching is ( ) A. high resource utilisation B. low transmission delay C. suitable for bursty data D. short connection setup time
-
The advantage of packet switching is ( ) A. low transmission delay B. high resource utilisation C. high transmission quality D. short connection setup time
-
The characteristic of a datagram is ( ) A. every packet takes the same path B. packets arrive in order C. every packet chooses its route independently D. a connection has to be set up
4.2 Fill in the Blanks
-
Circuit switching suits ( ) traffic, and packet switching suits ( ) data transfer.
-
A virtual circuit has to be ( ) and ( ).
-
A datagram does not need to be ( ), and packets may arrive ( ).
Approach
Compare the three techniques on how a path is obtained and what that costs. Circuit switching reserves a path for the whole session, so its delay is small but its resource use is poor; packet switching shares the network, so its resources are used efficiently but its delay is unpredictable. The datagram and the virtual circuit are the two modes of packet switching.
Steps
- For the first item, pick the property that follows from reserving a dedicated path.
- For the second item, pick the property that follows from statistical multiplexing across many users.
- For the third item, apply the definition of a datagram: independent routing, so no connection and no ordering guarantee.
- For the fill-in-the-blanks, fill in the traffic types, the two phases of a virtual circuit, and the missing connection and the arrival order.
Answer
- B — low transmission delay
- B — high resource utilisation
- C — every packet chooses its route independently
Fill in the blanks:
- Real-time, bursty
- Established, released
- A connection established, out of order
5. Transmission Media Questions
5.1 Multiple Choice
-
The transmission distance of twisted pair is about ( ) A. 50 metres B. 100 metres C. 500 metres D. 1000 metres
-
The bandwidth of optical fibre is ( ) A. low B. moderate C. high D. extremely high
-
The characteristic of wireless transmission is ( ) A. short transmission distance B. easily affected by interference C. low cost D. complex installation
5.2 Fill in the Blanks
-
By shielding, twisted pair is divided into ( ) and ( ).
-
By transmission mode, optical fibre is divided into ( ) and ( ).
-
The performance metrics of a transmission medium include ( ), ( ), ( ), and ( ).
Approach
Recall the figures and the classification for each medium. Twisted pair is limited to about 100 metres, optical fibre reaches the highest bandwidth, and wireless is the medium most exposed to interference.
Steps
- For the first item, use the 100-metre figure given for twisted pair.
- For the second item, note that fibre reaches the THz range, which puts it far above the other media.
- For the third item, pick the property that follows from propagating through the air.
- For the fill-in-the-blanks, list the shielding classes of twisted pair, the mode classes of fibre, and the four performance metrics.
Answer
- B — 100 metres
- D — extremely high
- B — easily affected by interference
Fill in the blanks:
- UTP, STP
- Single-mode fibre, multi-mode fibre
- Bandwidth, attenuation, delay, interference resistance
6. Physical Layer Device Questions
6.1 Multiple Choice
-
A repeater operates at the ( ) layer A. physical layer B. data link layer C. network layer D. transport layer
-
A hub is ( ) A. a multi-port repeater B. a multi-port switch C. a multi-port router D. a multi-port gateway
-
A physical layer device cannot ( ) A. amplify signals B. forward signals C. filter data D. extend the distance
6.2 Fill in the Blanks
-
The main functions of a repeater are ( ) and ( ).
-
A hub implements a ( ) topology.
-
The limitations of physical layer devices include the inability to ( ), to ( ), and to ( ).
Approach
Identify the layer each device works at, then apply what a physical layer device is allowed to do: it handles the signal, not the data.
Steps
- For the first item, recall that a repeater regenerates the signal at the physical layer.
- For the second item, note that a hub is a multi-port repeater wired as a star.
- For the third item, pick the capability that requires an address, which physical layer devices do not have.
- For the fill-in-the-blanks, list the two repeater functions, the hub topology, and the three limitations.
Answer
- A — the physical layer
- A — a multi-port repeater
- C — filter data
Fill in the blanks:
- Amplifying signals, forwarding signals
- Star
- Filter data, route data, convert data
7. Comprehensive Application Questions
7.1 Network Design
Problem: design an office network with the following requirements:
- Connect 10 computers
- Keep the transmission distance within 100 metres
- Keep the cost low
- Keep the performance stable
Questions:
- Which transmission medium should be used?
- Which network device should be used?
- Which topology should be used?
- How should the performance of the network be guaranteed?
7.2 Fault Diagnosis
Problem: a network shows the following symptoms:
- The transmission rate drops
- Connections are frequently interrupted
- Signal quality is poor
Questions:
- What are the possible causes?
- How should the problem be diagnosed?
- How should the problem be solved?
- How can similar problems be prevented?
Approach
Work from the requirements to the design: the distance limit rules out fibre and picks twisted pair, the device count and the low budget point to a hub or a switch, and the star topology keeps any single link failure from taking the network down. For the diagnosis, turn each symptom into a set of candidate causes, then work through detection, repair, and prevention.
Steps
- Match the 100-metre distance limit against the reach of each medium.
- Match the number of devices against the port count of the available equipment.
- Choose the topology that isolates link failures.
- List the causes behind each symptom: damaged cables, loose connectors, electromagnetic interference, and device faults.
- For each cause, give the detection step, the repair step, and the preventive measure.
Answer
Network design:
- Transmission medium: twisted pair (Cat5e or Cat6)
- Network device: a hub or a switch
- Topology: star topology
- Performance guarantee: use high-quality cabling, lay it out carefully, and keep it away from interference sources
Fault diagnosis:
- Possible causes: damaged cables, loose connectors, electromagnetic interference, device faults
- Diagnostic methods: test with a tester, check the connection state, monitor the signal quality
- Solutions: replace the damaged cable, reconnect the connectors, remove the sources of interference, replace the faulty device
- Preventive measures: inspect regularly, lay the cabling out carefully, use shielded cable, and maintain the equipment on a schedule
8. Programming Exercises
8.1 Signal Processing Program
Problem: write a simple signal processing program that implements:
- The generation of an analog signal
- The amplification of a signal
- The shaping of a signal
- The forwarding of a signal
Requirements:
- Use Python or C
- Include the basic signal processing functions
- Provide test cases
8.2 Network Simulation Program
Problem: write a simple network simulation program that simulates:
- Packet transmission
- Signal attenuation
- The effect of noise
- Error detection
Requirements:
- Use object-oriented programming
- Support several transmission media
- Provide a performance analysis function
Approach
Model each stage of the signal path as a separate method so that the stages can be tested one at a time, and model each transmission medium as a table of parameters so that the same simulation can be run over different media.
Steps
- Create a class that holds the original, the amplified, and the reshaped signal.
- Implement a generator that samples a sine wave, an amplifier that applies a gain, a reshaping step that adds noise, and a forwarding method that returns the processed signal.
- Cover the four stages with a test run that prints each intermediate result.
- For the simulation, create a class that holds a dictionary of media, each with its attenuation and noise parameters.
- Implement a transmission method that applies attenuation, adds noise, and detects errors, and an analysis method that reports the success rate.
- Run the simulation over twisted pair, fibre, and wireless.
Answer
For the signal processing program, build a SignalProcessor class whose constructor keeps three fields — the original signal, the amplified signal, and the reshaped signal — and give it four methods:
generate_signal(frequency, duration, sample_rate)samples a sine wave with NumPy and stores it as the original signal.amplify_signal(gain)multiplies the original signal by the gain and stores the result.reshape_signal(noise_level)adds normally distributed noise to the amplified signal and stores the result.forward_signal()returns the reshaped signal.
Each method returns None when the stage it depends on has not run yet, and the test code calls the four methods in order, then plots the original, the amplified, the reshaped, and the forwarded signal.
For the network simulation program, build a NetworkSimulator class whose constructor holds a dictionary of transmission media, each with an attenuation and a noise value, and give it two methods:
transmit_packet(packet, medium, distance)returnsNonefor an unknown medium, otherwise attenuates the packet byattenuation × distance, adds noise proportional to the medium’snoisevalue, and returnsNonewhen the simulated 10% error rate triggers.analyze_performance(packets, medium, distance)runs every packet throughtransmit_packet, counts the successful transmissions, and returns the success rate together with the total and successful packet counts.
The test code generates 100 random packets and runs the analysis over twisted pair, fibre, and wireless, printing the success rate for each medium.
The complete listings of both programs are given in the answer key at the end of this page.
Approach:
This block consolidates the answers to every physical-layer exercise, covering eight groups in turn: basic concepts, transmission theory, encoding and modulation, switching techniques, transmission media, physical-layer devices, comprehensive application and programming practice. Within each group the multiple-choice, fill-in-the-blank, calculation and design questions are answered in order, and the capacity limits are obtained from the Nyquist and Shannon theorems.
Steps:
1. Answers to the Basic Concept Questions
1.1 Multiple Choice Answers
- A — a channel is the physical path over which data travels
- B — the unit of bandwidth is Hz
- A — a symbol is the smallest unit of a signal
- B — a baud is the number of symbols transmitted per second
1.2 Fill in the Blanks Answers
- Analog signal, digital signal
- Sender, receiver
- Source, transmitting device, channel, receiving device, sink, noise source
- Higher
2. Answers to the Transmission Theory Questions
2.1 Calculation Answers
-
Nyquist theorem calculation:
-
Shannon theorem calculation:
-
Real transmission rate calculation:
3. Answers to the Encoding and Modulation Questions
3.1 Multiple Choice Answers
- A — one transition in the middle of every bit period
- A — amplitude shift keying
- B — 2 bits of data
3.2 Fill in the Blanks Answers
- Reliability, efficiency
- Digital, analog
- 0, 180
- Amplitude, phase
4. Answers to the Switching Technique Questions
4.1 Multiple Choice Answers
- B — low transmission delay
- B — high resource utilisation
- C — every packet chooses its route independently
4.2 Fill in the Blanks Answers
- Real-time, bursty
- Established, released
- A connection established, out of order
5. Answers to the Transmission Media Questions
5.1 Multiple Choice Answers
- B — 100 metres
- D — extremely high
- B — easily affected by interference
5.2 Fill in the Blanks Answers
- UTP, STP
- Single-mode fibre, multi-mode fibre
- Bandwidth, attenuation, delay, interference resistance
6. Answers to the Physical Layer Device Questions
6.1 Multiple Choice Answers
- A — the physical layer
- A — a multi-port repeater
- C — filter data
6.2 Fill in the Blanks Answers
- Amplifying signals, forwarding signals
- Star
- Filter data, route data, convert data
7. Answers to the Comprehensive Application Questions
7.1 Network Design Answers
- Transmission medium: twisted pair (Cat5e or Cat6)
- Network device: a hub or a switch
- Topology: star topology
- Performance guarantee: use high-quality cabling, lay it out carefully, and keep it away from interference sources
7.2 Fault Diagnosis Answers
- Possible causes: damaged cables, loose connectors, electromagnetic interference, device faults
- Diagnostic methods: test with a tester, check the connection state, monitor the signal quality
- Solutions: replace the damaged cable, reconnect the connectors, remove the sources of interference, replace the faulty device
- Preventive measures: inspect regularly, lay the cabling out carefully, use shielded cable, and maintain the equipment on a schedule
8. Answers to the Programming Exercises
8.1 Signal Processing Program Example
import numpy as np
import matplotlib.pyplot as plt
class SignalProcessor:
def __init__(self):
self.signal = None
self.amplified_signal = None
self.reshaped_signal = None
def generate_signal(self, frequency, duration, sample_rate):
"""Generate an analog signal"""
t = np.linspace(0, duration, int(sample_rate * duration))
self.signal = np.sin(2 * np.pi * frequency * t)
return self.signal
def amplify_signal(self, gain):
"""Amplify the signal"""
if self.signal is not None:
self.amplified_signal = self.signal * gain
return self.amplified_signal
return None
def reshape_signal(self, noise_level=0.1):
"""Shape the signal"""
if self.amplified_signal is not None:
noise = np.random.normal(0, noise_level, len(self.amplified_signal))
self.reshaped_signal = self.amplified_signal + noise
return self.reshaped_signal
return None
def forward_signal(self):
"""Forward the signal"""
if self.reshaped_signal is not None:
return self.reshaped_signal
return None
# Test code
processor = SignalProcessor()
signal = processor.generate_signal(10, 1, 1000)
amplified = processor.amplify_signal(2)
reshaped = processor.reshape_signal(0.05)
forwarded = processor.forward_signal()
# Plot the results
plt.figure(figsize=(12, 8))
plt.subplot(4, 1, 1)
plt.plot(signal)
plt.title('Original signal')
plt.subplot(4, 1, 2)
plt.plot(amplified)
plt.title('Amplified signal')
plt.subplot(4, 1, 3)
plt.plot(reshaped)
plt.title('Reshaped signal')
plt.subplot(4, 1, 4)
plt.plot(forwarded)
plt.title('Forwarded signal')
plt.tight_layout()
plt.show()8.2 Network Simulation Program Example
import random
import time
class NetworkSimulator:
def __init__(self):
self.transmission_media = {
'twisted_pair': {'attenuation': 0.1, 'noise': 0.05},
'fiber': {'attenuation': 0.01, 'noise': 0.01},
'wireless': {'attenuation': 0.3, 'noise': 0.2}
}
def transmit_packet(self, packet, medium, distance):
"""Transmit a packet"""
if medium not in self.transmission_media:
return None
# Calculate the attenuation
attenuation = self.transmission_media[medium]['attenuation'] * distance
attenuated_packet = packet * (1 - attenuation)
# Add the noise
noise = self.transmission_media[medium]['noise'] * random.random()
noisy_packet = attenuated_packet + noise
# Error detection
if random.random() < 0.1: # 10% error rate
return None
return noisy_packet
def analyze_performance(self, packets, medium, distance):
"""Analyse the performance"""
successful_transmissions = 0
total_packets = len(packets)
for packet in packets:
result = self.transmit_packet(packet, medium, distance)
if result is not None:
successful_transmissions += 1
success_rate = successful_transmissions / total_packets
return {
'success_rate': success_rate,
'total_packets': total_packets,
'successful_packets': successful_transmissions
}
# Test code
simulator = NetworkSimulator()
packets = [random.random() for _ in range(100)]
# Test the different transmission media
for medium in ['twisted_pair', 'fiber', 'wireless']:
performance = simulator.analyze_performance(packets, medium, 100)
print(f"{medium}: success rate {performance['success_rate']:.2%}")Answer:
The answers listed above cover concept identification, channel-capacity computation, encoding and modulation, switching and media selection, physical-layer device functions, network design and programming examples.
