4AID4-07 · RTU · 2nd Year
Data Communication and Computer Networks
A comprehensive study of data communication protocols, network architectures, and the layers of the OSI and TCP/IP models.
Last time you stopped at card —. ·
- 34cards
- 5units
- 0nailed
- 29diagrams
34/34
-
Network Topology is the physical or logical layout of how devices (nodes) are connected in a network. Think of it as the city planning map for data.
1. Star Topology (The Hub & Spoke):
All devices connect to a central Hub or Switch.
- Pros: Easy to add nodes; if one cable breaks, only that PC goes offline.
- Cons: If the central Hub dies, the entire network collapses.
2. Mesh Topology (The Spiderweb):
Every single device is connected directly to every other device.
- Pros: Highly reliable; practically impossible to take down. Used in military/critical infrastructure.
- Cons: Incredibly expensive and messy to wire.
3. Ring Topology (The Circle):
Devices are connected in a closed loop. Data travels in one direction passing a 'Token'.
4. Bus Topology (The Shared Highway):
All devices share a single main backbone cable. Very cheap but suffers from heavy collisions.
-
The OSI Model (The Theoretical 7-Layer Cake):
A conceptual framework to standardize how different computer systems communicate.
- 1. Physical (Cables)
- 2. Data Link (MAC addresses)
- 3. Network (IP addresses)
- 4. Transport (TCP/UDP)
- 5. Session (Managing connections)
- 6. Presentation (Encryption/Data Formatting)
- 7. Application (HTTP/Browser)
The TCP/IP Model (The Practical 4-Layer Standard):
This is what the actual Internet runs on today. It collapsed the top 3 OSI layers into one because they often overlap.
- 1. Network Access (Matches OSI 1 & 2)
- 2. Internet (Matches OSI 3)
- 3. Transport (Matches OSI 4)
- 4. Application (Combines OSI 5, 6, & 7)
-
Signals are how data travels over a wire or through the air (like Wi-Fi).
1. Analog Signals (The Smooth Wave):
- Visual: Looks like a continuous sine wave, like water ripples.
- Trait: Can have an infinite number of values within a range.
- Example: The human voice or old FM radio.
- Weakness: Highly prone to "Noise" (static). When amplified, the static gets amplified too!
2. Digital Signals (The Stepped Ladder):
- Visual: Looks like square blocks (discrete steps).
- Trait: Only has two specific states: High (1) or Low (0).
- Example: Computer data, HDMI, Fiber Optics.
- Strength: High immunity to noise. The computer can easily tell the difference between a high voltage and a low voltage, even if there's a little static.
-
Computers speak in digital 1s and 0s, but to send data over long distances (like radio towers), we must attach those 1s and 0s onto an Analog "Carrier" wave. This is called Modulation.
1. ASK (Amplitude Shift Keying):
We change the Height (loudness) of the wave.
- Binary 1 = High amplitude wave.
- Binary 0 = Low (or zero) amplitude wave.
2. FSK (Frequency Shift Keying):
We change the Speed/Pitch of the wave.
- Binary 1 = High frequency (waves tightly packed).
- Binary 0 = Low frequency (waves spread out).
3. PSK (Phase Shift Keying):
We change the Starting Point (angle) of the wave.
- Binary 1 = Wave starts normally at 0 degrees.
- Binary 0 = Wave shifts sharply and starts at 180 degrees. (This is highly resistant to noise!).
-
When data travels across physical media (like copper wire or air), electromagnetic noise can alter the signal. This flips bits (0 becomes 1, or 1 becomes 0).
1. Single-Bit Error:
- Definition: Exactly ONE bit in a given data unit (like a byte or frame) is flipped.
- Cause: Short-duration white noise.
- Commonality: Rare in serial data transmission, more common in parallel transmission.
2. Burst Error:
- Definition: Two or more bits in a data unit are changed. They don't have to be consecutive, but the "burst" is measured from the first corrupted bit to the last.
- Cause: High-impulse noise, or a scratch on a CD.
- Commonality: Extremely common in serial transmission. If a noise spike lasts 1/100th of a second on a fast network, hundreds of bits will be wiped out!
-
Error Detection:
The receiver simply figures out if an error occurred. If it detects an error, it usually throws the packet away and asks the sender to retransmit it.
- Cost: Cheap and fast. Uses simple redundant bits like Parity.
Error Correction:
The receiver not only detects the error but mathematically figures out which exact bit was corrupted, and flips it back to fix it without asking for a retransmission.
- Cost: Very expensive. Requires complex math and many redundant bits.
Forward Error Correction (FEC):
This is the process where the sender adds enough redundant code (like a Hamming Code) so that the receiver can correct errors automatically. It's used in Deep Space communication or live video streaming where waiting for a retransmission would take too long.
-
To detect or correct errors, we add redundant bits to our data.
Block Coding:
We divide our raw message into blocks of
kbits, called Datawords.We add
rredundant bits to each block.The result is an
n-bit block (wheren = k + r) called a Codeword.- The sender sends the Codeword. The receiver checks it against a list of "valid" codewords. If the received word isn't on the list, it's invalid (corrupted).
Linear Block Coding:
A specific, mathematical type of block coding. In a linear block code, the Exclusive-OR (XOR) of any two valid codewords creates another valid codeword. This mathematical relationship makes it incredibly fast for hardware to check for errors.
-
A simple Parity Check adds one bit to the end of a block to make the total number of 1s "Even". However, if two bits flip, a simple parity check will miss the error completely.
Two-Dimensional Parity Check (Matrix Parity):
Instead of checking one row of data, we arrange multiple blocks of data into a grid (like a spreadsheet).
- 1. Row Parities: We calculate a parity bit for every row.
- 2. Column Parities: We calculate a parity bit for every column.
- 3. The Magic: If a single bit flips, exactly ONE row parity and exactly ONE column parity will fail.
The intersection of the failing row and failing column pinpoints the exact corrupted bit! Because we know exactly which bit is wrong, we can instantly correct it by flipping it back. It can detect burst errors and correct single-bit errors.
-
Cyclic Codes are a special type of linear block code. The rule is: if you take a valid codeword and cyclically shift it (rotate the bits left or right), the result is another valid codeword.
CRC (Cyclic Redundancy Check) & Polynomials:
CRC is the most powerful and widely used cyclic code (used in Ethernet and Wi-Fi). Instead of basic binary math, CRC treats the data like an algebraic polynomial (e.g.,
x^3 + x + 1).- 1. The sender divides the data polynomial by a Standardized Generator Polynomial.
- 2. The remainder of this division is the CRC bits, which are attached to the data.
- 3. The receiver does the exact same division. If the remainder is exactly zero, the data is error-free.
CRC is legendary because it can detect 99.99% of all burst errors.
-
Checksum is widely used in the upper layers (like IP and TCP) rather than hardware. It is based on addition.
The Process:
- 1. Divide: The sender divides the message into equal-sized segments (e.g., 16-bit blocks).
- 2. Add: It adds all the segments together using "1s complement arithmetic". If a carry bit overflows, it gets added back into the sum.
- 3. Complement: The sender takes the 1s complement (flips 0s to 1s and 1s to 0s) of the final sum. This is the Checksum.
- 4. Verify: The receiver adds all the data blocks plus the Checksum.
If the result is all 1s (or 0s after complement), the data is accepted. If there's a mix, it's rejected.
-
Flow Control stops a fast sender from overwhelming a slow receiver.
Sliding Window Protocol:
Instead of sending one frame and waiting for an ACK (which is slow), the sender maintains a "Window" (e.g., size 5). It can fire off 5 frames instantly. As ACKs come back, the window "slides" forward, allowing new frames to be sent. It keeps the network pipe full and highly efficient.
Piggybacking:
Networks usually have two-way traffic. Instead of the receiver sending a tiny, dedicated frame just to say "ACK", it attaches (piggybacks) the ACK onto an outgoing Data frame it was already planning to send back to the sender. This saves massive amounts of bandwidth.
-
Automatic Repeat Request (ARQ) handles retransmitting lost frames.
1. Stop-and-Wait ARQ:
The sender fires one frame, starts a timer, and stops completely. If the ACK arrives, it sends frame 2. If the timer expires, it retransmits frame 1. Extremely slow and inefficient.
2. Go-Back-N ARQ:
Uses a sliding window. Sender fires multiple frames. If Frame 3 is lost, the receiver discards everything after it (4, 5, 6...). The sender "Goes Back" to N (3) and retransmits 3, 4, 5, and 6 all over again. Wastes bandwidth on retransmitting good frames.
3. Selective Repeat ARQ:
The smartest method. The receiver has its own window and buffers out-of-order frames. If Frame 3 is lost but 4 and 5 arrive, it keeps 4 and 5 and sends a NACK specifically for 3. The sender only retransmits Frame 3. Highly efficient!
-
ALOHA was the first multiple access protocol, invented for radio networks in Hawaii.
1. Pure ALOHA:
- Rule: When a station has data, it transmits immediately.
- Result: Total chaos. Since everyone can broadcast at any time, data frequently collides in the air and gets destroyed. The stations wait a random time and try again.
- Efficiency: Very poor (max 18.4%).
2. Slotted ALOHA:
- Rule: Time is divided into strict, synchronized "Slots". A station can only begin transmitting at the exact beginning of a slot.
- Result: Highly organized. Because everyone starts exactly on the beat, a station either successfully uses the whole slot, or collides cleanly at the very start. It cuts the vulnerable collision time in half.
- Efficiency: Doubled! (max 36.8%).
-
CSMA/CD (Collision Detection):
- Used in wired networks (Ethernet).
- The computer listens to the cable. If it's quiet, it transmits. While transmitting, it continues listening. If it hears a collision, it aborts immediately, sends a Jam signal, and waits a random backoff time.
- Why it works: It's easy to detect voltage spikes from collisions on a copper wire.
CSMA/CA (Collision Avoidance):
- Used in wireless networks (Wi-Fi).
- It's impossible to listen and transmit on the same radio antenna simultaneously, so a Wi-Fi router can't detect a collision. Therefore, it must avoid it.
- How: Device A sends an RTS (Request to Send) to the Router. If the router is free, it replies with a CTS (Clear to Send). Every other device hears the CTS and mutes themselves. Device A then transmits its data safely without fear of collision.
-
The Network Layer is responsible for getting packets from the source to the final destination across multiple networks.
Key Design Issues:
- 1. Routing packets through the subnet.
- 2. Controlling congestion.
- 3. Internetworking (connecting different types of networks).
Store-and-Forward Packet Switching:
A core mechanism where a host sends a packet to the nearest router. The router receives the entire packet into its buffer, stores it, checks the checksum for errors, and then forwards it to the next router. It ensures data integrity hop-by-hop.
-
Internetworking is the process of connecting multiple, heterogeneous (different) networks together to form a single, massive logical network (like the Internet).
Challenge: Different networks have different physical cables, different maximum packet sizes (MTU), and different protocols (e.g., Ethernet vs Token Ring vs Wi-Fi).
Solution: The Network Layer (specifically the IP protocol) abstracts these differences away, allowing a computer on an Ethernet LAN in Tokyo to seamlessly send packets to a smartphone on a 5G network in New York.
-
Routing is the process of selecting paths in a network.
1. Unicast Routing (One-to-One):
The router sends a packet to one specific destination address. Example: A private email to a friend.
2. Multicast Routing (One-to-Group):
The router sends a packet to a specific, subscribed group of receivers. Example: A live video stream sent only to premium subscribers.
3. Broadcast Routing (One-to-All):
The router sends the packet to EVERY single node in the network. Example: ARP requests asking "Who has this IP?"
-
Link State Routing (The GPS Map Strategy):
- Every router discovers its immediate neighbors and their link costs.
- It then "Floods" a Link State Packet (LSP) containing this info to every router in the entire network.
- Result: Every router builds an identical, complete map of the entire network topology.
- Finally, each router runs Dijkstra's Algorithm locally to find the absolute shortest path to all destinations.
- Strength: Fast convergence and avoids routing loops.
Distance Vector Routing (The Rumor Mill):
- Routers only know their neighbors. They share their entire routing table only with their immediate neighbors periodically.
- Weakness: Slow to converge and suffers from the "Count-to-Infinity" problem.
-
IP Fragmentation is the process of breaking a single, large IP datagram into several smaller fragments.
Why it's necessary:
Every network link (like Ethernet vs Wi-Fi) has a Maximum Transmission Unit (MTU)—the absolute largest packet it can carry. For example, Ethernet's MTU is usually 1500 bytes.
If a router receives a 4000-byte datagram from a Token Ring network and needs to forward it onto an Ethernet network, the datagram simply won't fit.
The Process:
The router chops the 4000-byte datagram into smaller fragments (e.g., three fragments of 1500, 1500, and 1040 bytes). Each fragment gets its own IP header. They travel independently across the internet and are only reassembled when they reach the final Destination Host.
-
IPv4 (The Old Standard):
- Uses a 32-bit address space, allowing for roughly 4.3 billion unique addresses.
- Formatted in decimals (e.g.,
192.168.1.1). - We ran out of these addresses due to the explosion of mobile devices.
IPv6 (The Future Standard):
- Uses a massive 128-bit address space, allowing for 340 undecillion addresses.
- Formatted in hexadecimal (e.g.,
2001:0db8:85a3::8a2e:0370:7334). - Features a simpler, fixed-length header for much faster router processing.
-
The Network Layer uses Logical Addresses (IP), but the physical cables use Physical Addresses (MAC). We need protocols to translate between them.
ARP (Address Resolution Protocol):
- Maps a known IP address to an unknown MAC address.
- Process: A computer broadcasts "Who has IP 192.168.1.5?" The device with that IP replies "I do, and my MAC is 00:1A:2B..."
RARP (Reverse ARP):
- Maps a known MAC address to an unknown IP address.
- Process: Used mostly by diskless workstations when they boot up. The station broadcasts its MAC and asks a server, "What is my assigned IP address?"
-
Congestion occurs when too many packets are present in the network, causing router buffers to overflow, packets to be dropped, and performance to collapse.
Approaches to Control:
1. Open-Loop (Prevention): Policies implemented to prevent congestion before it happens. Examples include admission control (refusing new connections if the network is busy) or traffic shaping.
2. Closed-Loop (Removal): Mechanisms that react to congestion after it starts. For example, a router experiencing congestion might send "Choke Packets" back to the source, explicitly demanding that the source slow down its transmission rate immediately.
-
While the Network Layer handles Node-to-Node (Host-to-Host) delivery, the Transport Layer handles Process-to-Process delivery.
Even if a packet correctly reaches your laptop (via IP address), the laptop runs multiple processes (Chrome, Spotify, Zoom). The Transport Service uses Port Numbers (e.g., Port 80 for HTTP, Port 443 for HTTPS) to guarantee the incoming data is delivered to the correct application.
-
Key Elements:
- 1. Addressing: Using Ports and Sockets to identify applications.
- 2. Connection Establishment: Handshaking before sending data.
- 3. Connection Release: Tearing down the connection cleanly.
- 4. Flow & Error Control: Ensuring data isn't lost or sent too fast.
Connection Establishment (3-Way Handshake):
To prevent confusion from old, delayed packets, TCP uses a strict 3-way handshake to open a connection:
- 1. Host A sends a
SYN(Synchronize) packet to initiate. - 2. Host B replies with a
SYN + ACK(Acknowledge) packet. - 3. Host A replies with an
ACKpacket.
The connection is now fully established and data transfer begins.
-
**1. TCP (Transmission Control Protocol) — The Solid Pipe:**
- Connection-Oriented: Establishes a strict 3-way handshake before sending data.
- Reliable: Guarantees every single packet arrives. If one is lost, it retransmits it.
- Ordered: Reassembles packets in the exact correct order.
- Use Case: Web browsing (HTTP), Email, File transfers. (You can't afford a missing pixel in a bank statement).
**2. UDP (User Datagram Protocol) — The Scattered Spray:**
- Connectionless: Just starts blasting data at the receiver immediately.
- Unreliable: Does not care if packets get lost. No retransmissions.
- Fast: Because there's no overhead or waiting for Acknowledgements, it's incredibly fast.
- Use Case: Live Video Streaming, Voice calls, Multiplayer Gaming. (If a frame drops, it's better to skip it than wait and cause lag!).
-
Quality of Service (QoS) is the ability of a network to provide better, prioritized service to selected network traffic.
Key Parameters:
- 1. Reliability: How often are packets lost? (Critical for banking, less critical for video).
- 2. Delay (Latency): The time it takes a packet to travel from source to destination.
- 3. Jitter: The variation in delay. If packets arrive at wildly uneven intervals, a video stream will stutter horribly. Smooth, consistent arrival (low jitter) is required for voice/video calls.
- 4. Bandwidth: The maximum rate of data transfer across a given path (like the width of a water pipe).
-
Both algorithms are used for Traffic Shaping—controlling the rate of data injected into the network to prevent congestion.
1. Leaky Bucket Algorithm (Constant Output):
Imagine a physical bucket with a hole in the bottom.
- Data pours into the bucket at erratic, bursty rates.
- But the data leaks out of the hole at a strictly constant, uniform rate.
- If the bucket overflows, the arriving packets are thrown away.
- Purpose: Smooths out bursty traffic into a steady stream.
2. Token Bucket Algorithm (Allows Bursts):
Imagine a bucket that slowly fills with "Tokens" at a constant rate.
- To transmit a packet, the sender MUST grab a token from the bucket.
- If the bucket is full of tokens, the sender can transmit a massive burst of data all at once (consuming all the tokens).
- Purpose: Allows sudden bursts of traffic, but still enforces an average rate limit over time.
-
Concept:
- WWW (World Wide Web): A vast, interconnected space of documents and resources linked by URLs.
- HTTP (HyperText Transfer Protocol): The vehicle (protocol) used to transport those web documents across the internet.
How it Works (Request-Response Cycle):
- 1. The Client (Web Browser) opens a TCP connection to the Server and sends an HTTP GET Request asking for a specific file (e.g.,
index.html). - 2. The Web Server locates the file and sends an HTTP Response containing a status code (e.g.,
200 OK) along with the HTML content. - 3. The Browser renders the HTML into a visual webpage.
Real-World Use Case:
Every time you type a URL into Chrome and hit enter, you are triggering this exact HTTP Request/Response cycle to load the webpage.
-
Concept:
FTP is a standard network protocol used for the reliable transfer of computer files between a client and server on a computer network.
How it Works (Out-of-Band Control):
Unlike most protocols that use one connection, FTP uniquely uses TWO parallel TCP connections:
- 1. Control Connection (Port 21): Stays open the entire time. Used ONLY for sending commands (like
login,ls,get,put). - 2. Data Connection (Port 20): Opens dynamically only when a file needs to be transferred. It closes immediately after the file finishes transferring.
Real-World Use Case:
A Web Developer downloading massive website backup archives from a remote hosting server to their local machine.
- 1. Control Connection (Port 21): Stays open the entire time. Used ONLY for sending commands (like
-
Concept:
Computers route traffic using numerical IP Addresses (like
142.250.190.46), but humans prefer names (likegoogle.com). DNS acts as the Internet's Phonebook to translate names to IPs.How it Works (Hierarchical Resolution):
If a browser doesn't know the IP, it performs a DNS Lookup:
- 1. Local DNS: Asks your ISP's server.
- 2. Root Server: If Local doesn't know, it asks the Root Server (which points to TLDs).
- 3. TLD Server: Top-Level Domain server (e.g.,
.com) points to the specific domain's server. - 4. Authoritative Server: The final server (Google's DNS) provides the exact IP address back to the client.
Real-World Use Case:
Allowing users to type
youtube.cominstead of memorizing complex strings of numbers. -
Concept:
Email is an asynchronous message delivery architecture. SMTP (Simple Mail Transfer Protocol) is the protocol used exclusively for pushing (sending) emails.
How it Works (The Architecture):
- 1. Sender writes an email and clicks send. Their email client uses SMTP to push the message to their local Mail Server.
- 2. The Sender's Mail Server acts as a middleman, using SMTP to push the email across the internet to the Receiver's Mail Server.
- 3. The email sits in a queue. Later, the Receiver opens their app, which uses POP3 or IMAP (pull protocols) to download the email from their server.
Real-World Use Case:
Sending a formal business proposal document to a client across the world instantaneously.
-
Concept:
POP3 (Post Office Protocol version 3) is an internet standard protocol used by local email clients to retrieve (pull) e-mails from a remote server over a TCP/IP connection.
How it Works (Download-and-Delete):
POP3 is extremely simple and assumes you are accessing email from only one device. Its working mechanism follows three distinct phases:
- 1. Authorization: The client connects and provides credentials (username/password).
- 2. Transaction: The client explicitly requests the server to download the emails to the local hard drive.
- 3. Update: Crucially, once the client successfully downloads the emails and issues a quit command, the server deletes the emails from the central server.
Real-World Use Case:
A highly secure corporate environment where emails must be downloaded to a single local, encrypted workstation and completely wiped from the internet-facing server.
-
Concept:
Multimedia networking involves transmitting audio and video over the internet. Unlike text, multimedia requires strict timing but can tolerate some packet loss.
How it Works:
- Because TCP's reliable retransmissions cause delays (buffering/lag), multimedia usually relies on UDP for fast, connectionless delivery.
- It uses specialized protocols like RTP (Real-Time Transport Protocol) to add sequence numbers and timestamps to UDP packets, allowing the receiver to reorder packets and play them back smoothly.
Real-World Use Case:
Streaming a live sports match or conducting a Zoom video conference call without severe audio-desync.
-
Concept:
Network Security aims to protect data in transit from being intercepted or modified. The core foundation is the CIA Triad:
- 1. Confidentiality: Only authorized people can read the data.
- 2. Integrity: The data was not altered in transit.
- 3. Availability: The service remains accessible.
How it Works (Cryptography):
To achieve Confidentiality, we use Encryption.
- 1. A readable message (Plaintext) is passed through a mathematical formula (Encryption Algorithm) using a secret Key.
- 2. It turns into scrambled gibberish (Ciphertext) which travels safely across the internet.
- 3. The receiver uses a matching key and a Decryption Algorithm to turn it back into Plaintext.
Real-World Use Case:
Securing your credit card details while shopping online (HTTPS/SSL).
No card matches that search.
1/34
0
0:00
Question
Click the card or press Space to flip
Answer
Diagram for this card
Run complete
0 nailed · 0 in the pile · 0:00 · best combo 0
Scroll to zoom · drag to pan · Esc to close
Shortcuts
- S
- Start the run
- Space
- Show me the answer
- ← →
- Previous / next card
- 1 2
- Not yet / Nailed it
- D
- Open the diagram
- F
- Diagram full screen
- /
- Search the deck
- Esc
- Close whatever is open