Docsity

Computer Networks in a Nutshell, Cheat Sheet of Computer Networks

Toggle sidebar
bg1
Guided Transmission Media
Guided media means the data signals are transmitted through a physical medium (cables/wires).
It provides a guided path for data, unlike unguided media (like radio waves).
Types of Guided Media
1. Twisted Pair Cable
o Two insulated copper wires twisted together.
o Types:
▪ UTP (Unshielded Twisted Pair): Cheaper, used in LANs (Ethernet).
▪ STP (Shielded Twisted Pair): Has shielding, less noise.
o Use: Telephone lines, Ethernet networks.
2. Coaxial Cable
o Central copper conductor with insulation, metallic shield, and outer cover.
o Less noise than twisted pair.
o Use: Cable TV, broadband internet.
3. Optical Fiber Cable
o Transmits data as light signals through glass or plastic fibers.
o Very high bandwidth, low attenuation, immune to electromagnetic interference.
o Types:
▪ Single Mode Fiber (SMF): Long-distance, high capacity.
▪ Multi Mode Fiber (MMF): Short-distance, cheaper.
o Use: Internet backbone, long-distance communication.
Comparison Table
Medium
Bandwidth
Distance
Cost
Noise
Immunity
Use
Twisted Pair
Low to
medium
Short
Low
Low
LAN, phones
Coaxial
Cable
Medium
Medium
Medium
Better than TP
TV, internet
Optical
Fiber
Very High
Long
High
Excellent
WAN, backbone, high-speed
internet
One line summary:
Guided Media = Twisted Pair (cheap), Coaxial (medium), Optical Fiber (fastest & long
distance).
Data Link Layer Services (Detailed + Examples)
1. Framing
o Definition: Converts raw bit stream into structured frames so receiver knows where
one frame ends and the next begins.
o How: Uses methods like Character Count, Character Stuffing, Bit Stuffing.
o Example: In Ethernet, each frame starts with a preamble and ends with CRC,
marking boundaries clearly.
2. Physical Addressing
o Definition: Adds MAC addresses (source & destination) to each frame for local
delivery.
o Example: Your PC with MAC A1-B2-C3 sends a frame to your router’s MAC D4-
E5-F6.
3. Flow Control
pf3
pf4
pf5
pf8

Partial preview of the text

Download Computer Networks in a Nutshell and more Cheat Sheet Computer Networks in PDF only on Docsity!

Guided Transmission Media Guided media means the data signals are transmitted through a physical medium (cables/wires). It provides a guided path for data, unlike unguided media (like radio waves). Types of Guided Media

  1. Twisted Pair Cable o Two insulated copper wires twisted together. o Types : ▪ UTP (Unshielded Twisted Pair): Cheaper, used in LANs (Ethernet). ▪ STP (Shielded Twisted Pair): Has shielding, less noise. o Use : Telephone lines, Ethernet networks.
  2. Coaxial Cable o Central copper conductor with insulation, metallic shield, and outer cover. o Less noise than twisted pair. o Use : Cable TV, broadband internet.
  3. Optical Fiber Cable o Transmits data as light signals through glass or plastic fibers. o Very high bandwidth, low attenuation, immune to electromagnetic interference. o Types : ▪ Single Mode Fiber (SMF): Long-distance, high capacity. ▪ Multi Mode Fiber (MMF): Short-distance, cheaper. o Use : Internet backbone, long-distance communication. Comparison Table Medium Bandwidth Distance Cost Noise Immunity Use Twisted Pair Low to medium Short Low Low LAN, phones Coaxial Cable Medium Medium Medium Better than TP TV, internet Optical Fiber Very High Long High Excellent WAN, backbone, high-speed internet One line summary: Guided Media = Twisted Pair (cheap), Coaxial (medium), Optical Fiber (fastest & long distance). Data Link Layer Services (Detailed + Examples)
  4. Framing o Definition : Converts raw bit stream into structured frames so receiver knows where one frame ends and the next begins. o How : Uses methods like Character Count, Character Stuffing, Bit Stuffing. o Example : In Ethernet , each frame starts with a preamble and ends with CRC , marking boundaries clearly.
  5. Physical Addressing o Definition : Adds MAC addresses (source & destination) to each frame for local delivery. o Example : Your PC with MAC A1-B2-C3 sends a frame to your router’s MAC D4- E5-F6.
  6. Flow Control

o Definition : Prevents sender from overwhelming the receiver. o Techniques : Stop-and-Wait, Sliding Window. o Example : In Wi-Fi , if the buffer is full, receiver sends a control frame (pause signal) to slow down the sender.

  1. Error Control o Definition : Ensures error-free delivery of frames by detecting & retransmitting lost/corrupted ones. o Techniques : CRC (Cyclic Redundancy Check), ARQ (Automatic Repeat reQuest). o Example : In Ethernet, if a frame has CRC error, it’s discarded and sender retransmits.
  2. Access Control o Definition : Controls which device can transmit when multiple share the same link. o Example : ▪ Ethernet (LAN) uses CSMA/CD → devices sense channel, transmit, detect collisions. ▪ Wi-Fi uses CSMA/CA → avoids collisions using acknowledgments and random back-off. Summary Line: DLL Services = Framing (boundaries), Addressing (MAC), Flow Control (pace), Error Control (retransmit), Access Control (who uses channel).

Advantages of Fiber Optic Cable

  1. High Bandwidth o Can carry far more data than twisted pair or coaxial. o Supports Gbps to Tbps speeds.
  2. Long Distance Transmission o Very low signal loss ( low attenuation ). o Can transmit over tens of kilometers without repeaters.
  3. Immunity to Electromagnetic Interference (EMI) o Unlike copper, it does not get affected by electrical noise or lightning. o Very reliable in industrial or noisy environments.
  4. Security o Very difficult to tap without being detected. o Safer for confidential data transmission.
  5. Light Weight & Small Size o Much thinner and lighter than copper cables. o Easier to install and saves space.
  6. Durability & Reliability o Resistant to temperature changes, water, and harsh conditions.
  7. Future Proof o Supports modern high-speed internet, video streaming, cloud, and IoT needs. Example
  • Your home FTTH (Fiber to the Home) broadband → allows super-fast internet (like 1 Gbps) with no interference compared to old copper cables. One line: Fiber optics = High speed, long distance, secure, light, reliable, and future-proof.

o Common in noisy channels like wireless or satellite links (where retransmission is expensive). Example: Hamming Codes , Reed-Solomon codes.

  1. Retransmission (ARQ – Automatic Repeat Request) o The receiver detects an error and asks the sender to retransmit the data. o Common in less noisy channels (like fiber optics), since errors are rare. Example: Stop-and-Wait ARQ, Go-Back-N ARQ, Selective Repeat ARQ. Key idea:
  • Error Detection = “Something went wrong.”
  • Error Correction = “Here’s the fixed message.”

1. What is Hamming Code?

It’s an error-correcting code invented by Richard Hamming.

  • It adds extra redundant bits (parity bits) to data.
  • These parity bits let the receiver detect AND correct single-bit errors.
  • It can also detect (but not correct) two-bit errors. 2. How does it work? Suppose you have m data bits. To protect them, you need r parity bits , chosen such that: 2r≥m+r+12^r \geq m + r + 12r≥m+r+ This formula ensures the code can uniquely identify error positions. 3. Positioning the parity bits
  • Place parity bits at positions that are powers of 2 (1, 2, 4, 8, …).
  • Data bits fill the other positions. Example: For 4 data bits (m=4) , we need 3 parity bits (r=3). So, total bits = 7 (positions 1–7). Positions: 1 2 3 4 5 6 7 P1 P2 D1 P4 D2 D3 D 4. Setting the parity bits Each parity bit checks certain positions:
  • P1 checks bits 1,3,5,
  • P2 checks bits 2,3,6,
  • P4 checks bits 4,5,6, Parity rule: Even parity (commonly used) → total number of 1s must be even. 5. Example Say data bits = 1011 Place them: 1 2 3 4 5 6 7 P1 P2 1 P4 0 1 1 Now calculate parity:
  • P1 (1,3,5,7 → 1,1,0,1 → three 1s → needs 1 to make it even → P1=1)
  • P2 (2,3,6,7 → ?,1,1,1 → three 1s → needs 1 → P2=1)
  • P4 (4,5,6,7 → ?,0,1,1 → two 1s → already even → P4=0) Final Hamming code: 1110011

6. Error detection & correction

  • At the receiver, parity checks are recomputed.
  • If all parities are fine → no error.
  • If some parity checks fail → their positions (added as binary) show exactly which bit is wrong, and it’s flipped to correct. That’s the power of Hamming Code: single-bit error correction, double-bit error detection. Block diagram of communication system Basics of Computer Networks
  • A computer network is a system of interconnected computers and devices (like printers, phones, servers) that can exchange information.
  • Nodes = devices on the network (computers, mobiles, printers, routers).
  • Communication medium = the physical path (cables, fiber optic, or even air with Wi-Fi signals).
  • Main goal = resource sharing (files, printers, applications, storage). Applications of Computer Networks
  1. Business Applications o Information sharing across branches/offices. o Shared resources (like high-speed printers). o Centralized company databases. o Communication tools (email, VoIP, video conferencing).
  2. Home Applications o Accessing online databases. o E-commerce (shopping, banking). o Entertainment (online movies, games, music). o Peer-to-peer file sharing.
  3. Mobile Users o Internet access via Wi-Fi hotspots. o Communication for vehicles (taxis, delivery, GPS). o Smartphones and mobile commerce (payments via mobile).
  4. Social Issues o Social media platforms, content sharing. o Concerns about privacy, piracy, and regulation. Quick way to remember:
  • Business → Sharing + Communication
  • Home → Shopping + Entertainment

o Efficiently sharing limited bandwidth (multiplexing, congestion control).

  1. Flow & Congestion Control o Preventing fast senders from overwhelming slow receivers or the network.
  2. Timeliness & Quality of Service (QoS) o Voice/video needs low delay, while email can tolerate it.
  3. Security o Confidentiality (privacy), Authentication (identity check), Integrity (no tampering). Quick way to remember: “RAS-FCTS” → Reliability, Addressing, Scalability, Flow control, Congestion, Timeliness/QoS, Security. Properties of Physical Media The physical medium is the actual path that carries signals (like copper wire, fiber optic, or air for wireless). When comparing different media, we look at these properties:
  4. Bandwidth o How much data it can carry (capacity). o Higher bandwidth → more data per second. o Fiber optic > Coaxial > Twisted pair.
  5. Transmission Impairments o Problems that distort or weaken the signal: ▪ Attenuation → loss of signal strength over distance. ▪ Distortion → change in signal shape. ▪ Noise → unwanted signals (thermal, crosstalk, impulse).
  6. Propagation Speed o How fast signals travel through the medium. o Fiber optic: speed of light, Copper: slower.
  7. Cost & Installation o Twisted pair = cheap, o Coaxial = moderate, o Fiber optic = expensive but very high performance.
  8. Error Rate / Reliability o Probability of signal getting corrupted. o Wireless has higher error rate than wired media.
  9. Security o Wired media (fiber, copper) harder to tap. o Wireless easier to intercept. In short: Physical media are judged by Bandwidth, Impairments, Speed, Cost, Reliability, Security. What is HDLC?
  • A bit-oriented protocol used in the data link layer.
  • Provides framing, error control, and flow control.
  • Every HDLC frame starts and ends with a special flag pattern 01111110. HDLC Frame Structure (Quick Recall)
  • Flag → marks start and end (01111110).
  • Address → identifies the destination station.
  • Control → tells the type of frame (this is where frame types come in!).
  • Information → the actual data (in some frames).
  • FCS (Frame Check Sequence) → error checking.
  • Flag → again at the end.

HDLC Frame Types There are three types of frames , each serving a different purpose:

  1. Information Frames (I-frames) o Carry user data (payload) from network layer. o Also carry control info for error and flow control (like sequence numbers). o Used for data transfer.
  2. Supervisory Frames (S-frames) o Do not carry user data. o Used for error control and flow control. o Examples: ACK (acknowledgement), NACK (negative acknowledgement).
  3. Unnumbered Frames (U-frames) o Used for control purposes like link setup, disconnection, mode settings. o Example: Request to establish connection, terminate connection. Quick Mnemonic:
  • I-frame → Information
  • S-frame → Supervisory (control/acknowledge)
  • U-frame → Unnumbered (special link management)