Unit 2: Physical and Data Link Layers
I. Orientation — Layered Communication
Data communication is the exchange of information between devices through a transmission medium. The physical layer carries raw bits as signals, while the data link layer organizes those bits into frames and provides dependable node-to-node delivery.
- Core components:
- Sender: Device that originates data.
- Receiver: Device that accepts data.
- Message: Information being communicated, such as text, audio, or video.
- Medium: Physical or wireless path followed by the signal.
- Protocol: Rules governing representation, timing, delivery, and interpretation.
- Physical layer role: Defines signal encoding, bit rate, connectors, frequencies, media, and transmission modes.
- Data link layer role: Performs framing, addressing, flow control, medium access, and error control between directly connected nodes.
- Delivery requirements: An effective system aims for correct destination delivery, accuracy, acceptable delay, and low variation in packet delay called jitter.
- Layer relationship: The data link layer supplies frames to the physical layer, which converts frame bits into electrical, optical, or electromagnetic signals.
II. Data Communication Fundamentals — Information, Signals, and Transfer
A. Basics of Data Communications
Data communication depends on representing information as signals and coordinating how those signals travel between endpoints.
- Data and signals: Data is meaningful information; a signal is the electrical, optical, or electromagnetic representation used to carry it.
- Analog signal: Varies continuously over time and amplitude.
- Digital signal: Uses discrete levels, commonly representing binary
0and1.
- Signal characteristics:
- Amplitude: Signal strength, measured in volts for an electrical signal.
- Frequency: Cycles completed per second, measured in hertz (
Hz). - Phase: Position of a waveform relative to a time reference, measured in degrees or radians.
- Transmission modes:
- Simplex: Communication travels in one direction only, as in a keyboard sending input.
- Half-duplex: Both devices transmit, but not simultaneously, as with walkie-talkies.
- Full-duplex: Both devices transmit simultaneously, as in a telephone call.
- Connection organization:
- Point-to-point: A dedicated link joins exactly two devices.
- Multipoint: Several devices share one link.
- Bit rate and baud rate: Bit rate is bits transmitted per second (
bps); baud rate is signal units transmitted per second. If each signal element representsrbits:
Bit rate = Baud rate × r- Protocols: Syntax defines message format, semantics defines field meaning, and timing defines transmission order and speed.
III. Wired Channels — Signals Through Physical Paths
A. Guided Transmission Media
Guided media confine signals to a solid path, producing predictable propagation and physical security.
- Twisted-pair cable: Two insulated copper wires are twisted to reduce electromagnetic interference and crosstalk.
- UTP: Unshielded twisted pair is inexpensive and widely used in Ethernet and telephone networks.
- STP: Shielded twisted pair adds metallic shielding but costs more and requires proper grounding.
- Connector: Ethernet twisted-pair links commonly use an
8P8Cmodular connector, often called RJ45.
- Coaxial cable: A central conductor, dielectric insulation, metallic shield, and outer jacket provide better noise resistance than twisted pair.
- Applications: Cable television, broadband access, and legacy Ethernet.
- Impedance: Common systems use approximately
50 Ωor75 Ωcable, depending on application.
- Optical fiber: Light pulses travel through a glass or plastic core using total internal reflection.
- Single-mode fiber: Has a narrow core and supports long-distance, high-bandwidth links with little modal dispersion.
- Multimode fiber: Has a wider core, permits multiple light paths, and suits shorter distances.
- Comparison: Fiber offers the greatest bandwidth, low attenuation, and immunity to electromagnetic interference; copper is generally cheaper and easier to terminate.
- Limitations: Guided media require physical installation, can be damaged by cuts or bending, and may be costly across difficult terrain.
IV. Wireless Channels — Propagation Without Conductors
A. Unguided Transmission Media
Unguided media transmit electromagnetic waves through air, vacuum, or space without a physical conductor.
- Radio waves: Often propagate in many directions and can penetrate buildings, supporting broadcasting, mobile communication, and wireless networking.
- Microwaves: Usually provide directional, line-of-sight communication at higher frequencies.
- Terrestrial microwave: Uses aligned antennas and repeaters because Earth’s curvature limits range.
- Satellite microwave: Uses an orbiting satellite as a relay between ground stations; geostationary distance introduces noticeable delay.
- Infrared: Supports short-range, line-of-sight or reflected communication but generally does not pass through walls.
- Propagation methods:
- Ground propagation: Lower-frequency waves follow Earth’s surface.
- Sky propagation: Waves are refracted back toward Earth by the ionosphere.
- Line-of-sight propagation: High-frequency signals travel mainly along a direct path.
- Advantages: Wireless links enable mobility, rapid deployment, broadcasting, and coverage where cabling is impractical.
- Limitations: Interference, obstacles, shared spectrum, interception, weather, and regulatory frequency allocations affect performance.
V. Signal Quality — Limits on Reliable Communication
A. Transmission Impairments and Performance
Transmission quality declines when a received signal differs from the signal originally sent.
- Attenuation: Signal energy decreases with distance and is commonly expressed in decibels:
dB = 10 log10(Pout / Pin)Pinis input power andPoutis output power.- A negative result represents power loss; amplifiers or repeaters compensate for it.
- Distortion: Frequency components propagate at different speeds or experience different attenuation, changing the signal’s shape.
- Noise:
- Thermal noise: Random electron motion in conductive material.
- Induced noise: Interference from motors, power lines, or appliances.
- Crosstalk: Unwanted coupling between nearby channels.
- Impulse noise: Brief high-energy spikes that can corrupt multiple bits.
- Bandwidth: The frequency range a channel passes, measured in hertz; greater usable bandwidth generally permits a higher data rate.
- Throughput: The actual delivered data rate, usually below nominal bandwidth because of headers, contention, errors, and congestion.
- Latency:
Total delay = Transmission + Propagation + Processing + Queuing- Transmission delay equals frame size in bits divided by link rate in
bps. - Propagation delay equals distance divided by propagation speed.
- Shannon capacity:
C = B log2(1 + S/N)Cis maximum theoretical capacity inbps,Bis bandwidth inHz, andS/Nis the linear signal-to-noise ratio.
VI. Link-Level Communication — Reliable Frame Exchange
A. Elementary Data Link Protocols
Elementary protocols show how framing, flow control, acknowledgements, and retransmission create reliable communication over one link.
- Unrestricted simplex protocol: Assumes perfect transmission, an always-ready receiver, and one-way data flow; the sender transmits frames continuously.
- Simplex stop-and-wait protocol: The sender transmits one frame and waits until the receiver indicates readiness, preventing receiver-buffer overflow.
- Stop-and-wait ARQ: Adds automatic repeat request for unreliable channels.
- The sender starts a timer after transmitting.
- The receiver returns an acknowledgement (
ACK) for a valid frame. - A timeout or negative acknowledgement causes retransmission.
- Sequence numbers: Alternating
0and1distinguish a new frame from a duplicate created when an acknowledgement is lost. - Framing: The link layer marks frame boundaries using length fields, byte stuffing, bit stuffing, or coding violations.
- Flow versus error control: Flow control protects a slow receiver; error control handles damaged, lost, or duplicated frames.
- Efficiency limitation: Stop-and-wait wastes capacity on links with large propagation delay because only one frame can remain unacknowledged.
VII. Error Control — Identifying and Repairing Corruption
A. Error Detection and Correction
Error control adds redundancy so a receiver can detect corruption and, in some schemes, reconstruct the original data.
- Error types:
- Single-bit error: Exactly one bit changes value.
- Burst error: Two or more bits within a span are affected, although every bit in that span need not change.
- Redundancy: The sender computes check bits from the data; the receiver recomputes or verifies them.
- Detection: Parity, checksum, and CRC reveal likely corruption but normally require retransmission to recover.
- Forward error correction: The receiver corrects errors directly using sufficient redundant information, useful where retransmission is expensive.
- Code distance: Hamming distance is the number of differing bit positions between two codewords.
- Capability rules: A code with minimum distance
dmincan detect up todmin − 1errors and correct up to:
t = floor((dmin − 1) / 2)- Trade-off: More redundancy improves protection but consumes bandwidth and processing time.
VIII. Distance-Based Coding — Single-Bit Error Correction
A. Hamming code
Hamming code places parity bits at selected positions so the receiver can locate and correct a single-bit error.
- Parity positions: Redundant bits occupy positions
1, 2, 4, 8, ...; data bits occupy all remaining positions. - Required redundancy: For
mdata bits andrparity bits:
2^r ≥ m + r + 1- The right side represents all bit-error positions plus the no-error state.
- Parity coverage: Parity bit at position
2^kchecks positions whose binary position number contains1in bitk. - Syndrome: The receiver repeats parity checks and combines failed-check values; a nonzero syndrome gives the erroneous bit position.
- Worked example: For
m = 4, chooser = 3because2^3 = 8 ≥ 4 + 3 + 1. The resulting seven-bit Hamming code has parity at positions1,2, and4. - Capability: Standard Hamming code corrects one-bit errors. Adding an overall parity bit produces SECDED: single-error correction and double-error detection.
- Parity coverage: Parity bit at position
IX. Polynomial Error Detection — Strong Burst Protection
A. CRC
A cyclic redundancy check treats a bit sequence as a polynomial and appends the remainder from modulo-2 division.
- Generator: Sender and receiver agree on a generator polynomial
G(x)with degreer. - Encoding: Append
rzeros to dataD, divide byGusing XOR arithmetic, and replace those zeros with ther-bit remainderR.
Transmitted frame T = D × 2^r XOR R- Verification: The receiver divides
Tby the same generator; a zero remainder indicates that no detectable error occurred. - Modulo-2 arithmetic: Addition and subtraction both use XOR, with no carries or borrows.
- Detection strength: A suitable generator detects all single-bit errors, many multiple-bit errors, and every burst error shorter than or equal to
rbits. - Limitation: CRC detects rather than repairs corruption; recovery generally relies on retransmission.
X. Bit-Count Protection — Simple Error Detection
A. Parity
Parity adds one bit so the number of 1 bits follows an agreed even or odd rule.
- Even parity: The parity bit makes the total number of
1s even. - Odd parity: The parity bit makes the total number of
1s odd. - Example: Data
1011001contains four1s, so its even-parity bit is0and its odd-parity bit is1. - Detection ability: Single parity detects every odd number of bit changes.
- Limitation: An even number of changed bits preserves parity and may pass undetected.
- Two-dimensional parity: Arranging data in rows and columns and adding parity to both dimensions improves burst-error detection and may identify a single erroneous position.
- Use: Parity is inexpensive in hardware and suitable where low overhead matters more than strong protection.
XI. Word-Based Error Detection — End-Around-Carry Verification
A. Checksum
A checksum divides data into fixed-size words, adds them, and transmits the complement of the resulting sum.
- Sender operation:
- Split the message into
n-bit words. - Add them using one’s-complement arithmetic.
- Wrap any carry beyond
nbits around to the least significant bit. - Complement the final sum to form the checksum.
- Split the message into
- Receiver operation: Add all received words and the checksum using the same arithmetic; an all-
1result indicates acceptance. - Internet checksum: Internet protocols traditionally use
16-bit words and a16-bit one’s-complement checksum. - Strength: Checksums detect many common bit errors and are efficient in software.
- Limitation: Some compensating changes can preserve the sum, making checksums weaker against structured corruption than a well-designed CRC.
- Comparison: Parity provides minimal protection, checksums suit word-oriented software processing, and CRC provides stronger detection for frames and burst errors.
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 →