Show Menu
Cheatography

Physical and Data Link Layer Cheat Sheet (DRAFT) by

Data Communication & Computer Network

This is a draft cheat sheet. It is a work in progress and is not finished yet.

Cyclic Redundancy Check (CRC)

Uses polynomial division to generate a checksum (CRC code).
Steps:
1. Choose a predefined generator polynomial (e.g., x³ + x + 1 → 1011).
2. Append n zeros to data (where n = degree of polyno­mial).
3. Divide modified data by polynomial (using XOR).
4. Append remainder (CRC) to original data.
Advantage: Detects all single­-bit, double­-bit, and odd-length burst errors.

Transm­ission Media

Transm­ission media is a commun­ication channel that transmits inform­ation from the source­/tr­ans­mitter to the receiver

Wired Media

Type
 
Speed
Cost
Use Case
Twisted Pair
 
Up to 10 Gbps
Low
LANs, Telephone
Coaxial Cable
 
Up to 1 Gbps
Medium
Cable TV, broadband
Fiber Optic
 
Up to 100+ Gbps
High
High-speed backbone, ISPs

Wireless Media

Type
Range
Speed
Use Cases
Radio Waves
Short to Medium
Medium
WLANs, mobile phones
Microwaves Unidir­ect­ional
Long
High
Satellite links, cellular
Infrared (IR)
Very short
Low
Remote controls
Satellite
Global
Medium to High
Global commun­ication

Types of Parity

Even Parity
Odd Parity
Total number of 1s (including parity bit) must be even.
Total number of 1s (including parity bit) must be odd.
Limita­tion: Detects only odd number of bit errors (fails if two bits flip).
 

Switching Techniques

Switching is a technique used to transmit data across a network from source to destin­ation. It determines how data is routed and delivered between network devices

Comparison of Switching Techniques

Circuit
Packet
Message
Dedicated commun­ication path,b­efore data transfer.
Data is divided into packets sent indepe­ndently
Entire message is stored and forwarded.
Consistent and reliable
Efficient use of bandwidth.
No need for a dedicated path.
Wastes bandwidth when idle.
Packets may arrive out of order.
Delays due to store-­and­-fo­rward.
Telephone networks
Internet, VoIP
Email systems
Technique Descri­ption Advantage Disadv­antage Use Case

Hamming Code

Adds redundant bits to detect and correct single-bit errors.
Steps:
1. Insert parity bits at positions that are powers of 2 (1, 2, 4, 8...).
2. Calculate parity for overla­pping bit groups.
Example:
1. Data: 1001
2. }Encoded: _ _ 1 _ 0 0 1 (positions 1,2,4 are parity bits)
Calculate parity:
P1 (positions 1,3,5,7): ? + 1 + 0 + 1 → Even parity → 0
P2 (positions 2,3,6,7): ? + 1 + 0 + 1 → Even parity → 0
P4 (positions 4,5,6,7): ? + 0 + 0 + 1 → Odd parity → 1
Final Hamming code: 0011001
Error Correc­tion: Receiver recalc­ulates parity to locate and flip the erroneous bit.
 

Framing

Framing is the process of dividing a continuous stream of data into manageable chunks called frames for transm­ission.

Framing Techniques

Technique
Descri­ption
Character Count
Frame starts with a count of the number of characters in the frame.
Byte Stuffing
Special characters added to distin­guish data from control info (e.g., FLAG -> ESC FLAG).
Bit Stuffing
Inserts 0 after a sequence of 5 continuous 1s to avoid confusion with frame delimi­ters.
Clock-­based (SONET)
Uses synchr­oni­zation signals to mark frame bounda­ries.

Common Error Detection Techniques

Parity Check
Adds an extra bit (parity bit) to make the total number of 1s even (even parity) or odd (odd parity).

Error Detection

Error Type
Descri­ption
Example
Single-bit
One bit is flipped (0→1 or 1→0)
010 → 011
Burst Error
Multiple consec­utive bits are corrupted
001100 → 110011
Types of Errors in Networking

Checksum

Sender computes a checksum (sum of data bytes) and appends it to the data. Receiver recalc­ulates and compares.
Steps:
1. Divide data into fixed-size segments (e.g., 16-bit words).
2. Sum all segments (ignore overflow).
3. Take 1’s complement (invert bits) → Checksum.
4. Append checksum to data.
Limita­tion: Weak against certain errors (e.g., reordered data).