diff options
| author | mo khan <mo@mokhan.ca> | 2025-09-08 20:23:32 -0600 |
|---|---|---|
| committer | mo khan <mo@mokhan.ca> | 2025-09-08 20:23:32 -0600 |
| commit | 88087a9b1a52d0eccbdec9ba3b05dadddc5c3e0e (patch) | |
| tree | c156e6aaec975028548fe1b77b5f06391fdcfe6c | |
| parent | 606cc6185def827cdceafd804f0b56df2fc32fad (diff) | |
Capture notes from textbook
| -rw-r--r-- | NOTES.md | 1190 |
1 files changed, 1190 insertions, 0 deletions
diff --git a/NOTES.md b/NOTES.md new file mode 100644 index 0000000..08c05e2 --- /dev/null +++ b/NOTES.md @@ -0,0 +1,1190 @@ +# COMP-347: Computer Networks - Final Exam Study Notes + +**Based on:** Computer Networking: A Top-Down Approach, 8th Edition +**Course Units:** 1-7 covering all major networking concepts +**Prepared for:** Final Examination + +--- + +## Table of Contents + +1. [Unit 1: Introduction to Computer Networks](#unit-1-introduction-to-computer-networks) +2. [Unit 2: Application Layer](#unit-2-application-layer) +3. [Unit 3: Transport Layer](#unit-3-transport-layer) +4. [Unit 4: Network Layer - Data Plane](#unit-4-network-layer---data-plane) +5. [Unit 5: Network Layer - Control Plane](#unit-5-network-layer---control-plane) +6. [Unit 6: Link Layer and LANs](#unit-6-link-layer-and-lans) +7. [Unit 7: Wireless and Mobile Networks](#unit-7-wireless-and-mobile-networks) +8. [Key Formulas and Calculations](#key-formulas-and-calculations) +9. [Protocol Comparison Tables](#protocol-comparison-tables) +10. [Common Exam Topics](#common-exam-topics) + +--- + +## Unit 1: Introduction to Computer Networks + +### 1.1 What is the Internet? + +**Key Concepts:** +- **Internet**: Global network of interconnected computers using TCP/IP protocols +- **Network Edge**: End systems (hosts) that connect to the Internet +- **Network Core**: Routers and switches that forward data +- **ISP Hierarchy**: Tier-1, Regional, and Local ISPs + +**Components:** +- **Hosts/End Systems**: Computers, smartphones, IoT devices +- **Communication Links**: Fiber, copper, radio, satellite +- **Packet Switches**: Routers and link-layer switches +- **Protocols**: Rules for communication (TCP, IP, HTTP, etc.) + +### 1.2 Network Edge + +**Access Technologies:** +- **DSL**: Digital Subscriber Line over telephone lines +- **Cable Internet**: Over cable TV infrastructure +- **FTTH**: Fiber to the Home +- **Ethernet**: Wired LAN connections +- **Wi-Fi**: Wireless LAN (802.11) +- **Cellular**: 3G, 4G/LTE, 5G mobile networks + +**Physical Media:** +- **Guided Media**: Twisted pair, coaxial cable, fiber optic +- **Unguided Media**: Terrestrial radio, satellite, microwave + +### 1.3 Network Core + +**Switching Techniques:** + +| Aspect | Circuit Switching | Packet Switching | +|--------|------------------|------------------| +| **Connection** | Dedicated path | Store-and-forward | +| **Resources** | Reserved for entire call | Shared dynamically | +| **Efficiency** | Poor for bursty data | Good for bursty data | +| **Delay** | Consistent | Variable | +| **Examples** | Traditional telephony | Internet | + +**Packet Switching Concepts:** +- **Store-and-Forward**: Entire packet received before forwarding +- **Queuing Delay**: Waiting in output buffer +- **Packet Loss**: Buffer overflow causes dropped packets + +### 1.4 Delay, Loss, and Throughput + +**Types of Delay:** + +1. **Processing Delay (d_proc)**: Router processing time +2. **Queuing Delay (d_queue)**: Waiting in output queue +3. **Transmission Delay (d_trans)**: Time to push packet onto link + - Formula: d_trans = L/R (L = packet length, R = transmission rate) +4. **Propagation Delay (d_prop)**: Time for signal to travel + - Formula: d_prop = d/s (d = distance, s = propagation speed) + +**Total Nodal Delay:** +``` +d_nodal = d_proc + d_queue + d_trans + d_prop +``` + +**Throughput:** +- **Instantaneous**: Rate at a given instant +- **Average**: Long-term average rate +- **Bottleneck Link**: Link with minimum transmission rate + +**Traffic Intensity:** +- Formula: La/R (L = avg packet length, a = avg arrival rate, R = transmission rate) +- If La/R > 1: Queues grow without bound +- If La/R ≈ 1: Large delays +- If La/R << 1: Small delays + +--- + +## Unit 2: Application Layer + +### 2.1 Principles of Network Applications + +**Application Architectures:** + +1. **Client-Server Model**: + - Server: Always-on, permanent IP address + - Clients: Communicate with server, may be intermittently connected + +2. **Peer-to-Peer (P2P)**: + - Minimal/no dedicated servers + - End systems communicate directly + - Self-scalability + +**Transport Services:** +- **Reliable Data Transfer**: TCP provides, UDP does not +- **Throughput**: Minimum guaranteed vs best-effort +- **Timing**: Low-delay guarantees +- **Security**: Encryption, authentication + +### 2.2 Web and HTTP + +**HTTP (HyperText Transfer Protocol):** +- **Stateless**: Server maintains no client state +- **TCP-based**: Uses reliable transport +- **Methods**: GET, POST, HEAD, PUT, DELETE + +**HTTP Connections:** +- **Non-persistent**: Separate TCP connection for each object +- **Persistent**: Multiple objects over single TCP connection + - Without pipelining: Wait for response before next request + - With pipelining: Send requests back-to-back + +**Response Codes:** +- 200 OK: Request succeeded +- 301 Moved Permanently: Object moved +- 400 Bad Request: Request not understood +- 404 Not Found: Requested document not found +- 505 HTTP Version Not Supported + +**Web Caching:** +- **Proxy Server**: Acts as intermediary +- **Benefits**: Reduced response time, reduced traffic +- **Conditional GET**: If-Modified-Since header + +### 2.3 Electronic Mail + +**Email System Components:** +- **User Agents**: Mail readers (Outlook, Gmail) +- **Mail Servers**: Store and forward messages +- **SMTP**: Simple Mail Transfer Protocol + +**Email Protocols:** + +| Protocol | Purpose | Port | Characteristics | +|----------|---------|------|-----------------| +| **SMTP** | Sending mail | 25 | Push protocol, ASCII-based | +| **POP3** | Retrieving mail | 110 | Download-and-delete | +| **IMAP** | Retrieving mail | 143 | Server-side storage | + +**SMTP Process:** +1. Client establishes TCP connection to server port 25 +2. Client sends commands, server responds with status codes +3. Transfer message using DATA command +4. Close connection + +### 2.4 Domain Name System (DNS) + +**DNS Functions:** +- **Hostname-to-IP translation** +- **Host aliasing** (canonical vs alias names) +- **Mail server aliasing** +- **Load distribution** (replicated web servers) + +**DNS Hierarchy:** +- **Root DNS Servers**: Top level (13 logical servers worldwide) +- **TLD DNS Servers**: .com, .org, .net, country codes +- **Authoritative DNS Servers**: Organization's own servers +- **Local DNS Server**: ISP's default name server + +**DNS Record Types:** +- **A**: Hostname to IPv4 address +- **AAAA**: Hostname to IPv6 address +- **CNAME**: Alias to canonical hostname +- **MX**: Mail exchange server +- **NS**: Authoritative name server + +**DNS Queries:** +- **Recursive**: DNS server queries on behalf of client +- **Iterative**: DNS server returns next server to query + +### 2.5 P2P File Distribution + +**Scalability Comparison:** + +**Client-Server File Distribution:** +- Distribution time: D_cs ≥ max{NF/u_s, F/d_min} +- Grows linearly with N (number of clients) + +**P2P File Distribution:** +- Distribution time: D_P2P ≥ max{F/u_s, F/d_min, NF/(u_s + Σu_i)} +- Self-scaling: upload capacity increases with peers + +**BitTorrent Protocol:** +- **Torrent**: Group of peers sharing same file +- **Tracker**: Infrastructure node tracking participating peers +- **Chunks**: File divided into 256KB pieces +- **Tit-for-tat**: Trade pieces with neighbors + +--- + +## Unit 3: Transport Layer + +### 3.1 Transport Layer Principles + +**Transport vs Network Layer:** +- **Network Layer**: Logical communication between hosts +- **Transport Layer**: Logical communication between processes + +**Multiplexing/Demultiplexing:** +- **Multiplexing**: Gathering data from multiple sockets +- **Demultiplexing**: Delivering received segments to correct socket +- **Socket Identification**: (source IP, source port, dest IP, dest port) + +### 3.2 UDP (User Datagram Protocol) + +**UDP Characteristics:** +- **Connectionless**: No handshaking +- **Unreliable**: No delivery guarantee +- **No congestion control**: Sends at desired rate +- **Small header**: 8 bytes only + +**UDP Header:** +- Source port (16 bits) +- Destination port (16 bits) +- Length (16 bits) +- Checksum (16 bits) + +**UDP Checksum:** +- **Purpose**: Error detection +- **Calculation**: 1's complement of 1's complement sum +- **Receiver**: Adds all 16-bit words including checksum + - No errors: Result = 1111111111111111 + - Errors detected: Result ≠ 1111111111111111 + +### 3.3 TCP (Transmission Control Protocol) + +**TCP Characteristics:** +- **Connection-oriented**: Three-way handshake +- **Reliable**: Guarantees delivery +- **Flow control**: Receiver controls sender rate +- **Congestion control**: Network-aware rate control +- **Full-duplex**: Bidirectional data flow + +**TCP Segment Structure:** +- **Header Length**: 20-60 bytes (options) +- **Sequence Number**: Byte stream number +- **Acknowledgment Number**: Next expected sequence number +- **Window Size**: Flow control (bytes) +- **Flags**: SYN, FIN, RST, PSH, URG, ACK + +**TCP Reliable Data Transfer:** + +1. **Sequence Numbers**: Byte-stream numbers +2. **Acknowledgments**: Cumulative ACKs +3. **Retransmission Timer**: Single timer for oldest unACKed segment +4. **Fast Retransmit**: 3 duplicate ACKs trigger immediate retransmission + +**TCP Connection Management:** + +**Three-Way Handshake (Connection Establishment):** +1. Client sends SYN segment +2. Server responds with SYN-ACK +3. Client sends ACK + +**Connection Termination:** +1. Client sends FIN +2. Server sends ACK and FIN +3. Client sends ACK +4. Connection closed + +### 3.4 TCP Congestion Control + +**Congestion Control Principles:** +- **End-to-end**: TCP infers congestion from loss/delay +- **Network-assisted**: Routers provide feedback + +**TCP Congestion Control Algorithm:** + +**Slow Start:** +- cwnd starts at 1 MSS +- cwnd doubles each RTT until loss or threshold +- Exponential growth + +**Congestion Avoidance:** +- cwnd increases by 1 MSS per RTT +- Linear growth (additive increase) + +**Fast Recovery:** +- On 3 duplicate ACKs: cwnd = ssthresh + 3 +- Multiplicative decrease on timeout + +**TCP Tahoe vs Reno:** +- **Tahoe**: Always goes to slow start on loss +- **Reno**: Fast recovery on 3 duplicate ACKs + +**Congestion Window Evolution:** +- **Sawtooth Pattern**: Linear increase, multiplicative decrease +- **Average Throughput**: ~0.75 × W/RTT (W = max window size) + +--- + +## Unit 4: Network Layer - Data Plane + +### 4.1 Network Layer Overview + +**Network Layer Functions:** +- **Forwarding**: Move packets from input to output port +- **Routing**: Determine path from source to destination + +**Data Plane vs Control Plane:** +- **Data Plane**: Per-router forwarding function +- **Control Plane**: Network-wide routing logic + +### 4.2 Router Architecture + +**Router Components:** +- **Input Ports**: Physical layer, link layer, lookup/forwarding +- **Switching Fabric**: Transfer packets from input to output +- **Output Ports**: Store and forward packets +- **Routing Processor**: Control plane functions + +**Input Port Processing:** +- **Line Termination**: Physical layer +- **Link Layer Protocol**: Data link layer +- **Lookup/Forwarding**: Destination-based forwarding + +**Switching Fabric Types:** +- **Memory**: Via system bus (slowest) +- **Bus**: Via shared bus +- **Crossbar**: Interconnection network (fastest) + +**Output Port Processing:** +- **Queuing**: When arrival rate > transmission rate +- **Packet Scheduler**: FIFO, priority, weighted fair queuing + +### 4.3 Internet Protocol (IP) + +**IPv4 Header Format:** +- **Version** (4 bits): IP version +- **Header Length** (4 bits): 32-bit words +- **Type of Service** (8 bits): Priority, delay, throughput +- **Total Length** (16 bits): Header + data +- **Identification** (16 bits): Fragmentation +- **Flags** (3 bits): Don't fragment, more fragments +- **Fragment Offset** (13 bits): Fragment position +- **Time to Live** (8 bits): Max hops +- **Protocol** (8 bits): Upper layer protocol +- **Header Checksum** (16 bits): Error detection +- **Source Address** (32 bits): Sender IP +- **Destination Address** (32 bits): Receiver IP + +**IPv4 Addressing:** + +**Classful Addressing (Historical):** +- **Class A**: 1.0.0.0 to 126.0.0.0 (/8) +- **Class B**: 128.0.0.0 to 191.255.0.0 (/16) +- **Class C**: 192.0.0.0 to 223.255.255.0 (/24) + +**CIDR (Classless Inter-Domain Routing):** +- **Format**: a.b.c.d/x (x = number of network bits) +- **Subnet Mask**: Network portion identification +- **Longest Prefix Matching**: Most specific route wins + +**Subnetting Example:** +- Network: 192.168.1.0/24 +- Subnet 1: 192.168.1.0/26 (hosts .1-.62) +- Subnet 2: 192.168.1.64/26 (hosts .65-.126) +- Subnet 3: 192.168.1.128/26 (hosts .129-.190) +- Subnet 4: 192.168.1.192/26 (hosts .193-.254) + +**Special IP Addresses:** +- **Loopback**: 127.0.0.0/8 +- **Private**: 10.0.0.0/8, 172.16.0.0/12, 192.168.0.0/16 +- **Link-Local**: 169.254.0.0/16 +- **Multicast**: 224.0.0.0/4 +- **Broadcast**: 255.255.255.255 + +**NAT (Network Address Translation):** +- **Purpose**: Share single IP among multiple hosts +- **NAT Table**: (internal IP, port) ↔ (external IP, port) +- **Problems**: Violates end-to-end principle, complicates P2P + +### 4.4 IPv6 + +**IPv6 Motivation:** +- **Address Space**: 128-bit addresses (vs 32-bit IPv4) +- **Header Simplification**: Fixed 40-byte header +- **Flow Labeling**: Quality of service +- **Built-in Security**: IPSec integration + +**IPv6 Header:** +- **Version** (4 bits): IP version (6) +- **Traffic Class** (8 bits): QoS +- **Flow Label** (20 bits): Flow identification +- **Payload Length** (16 bits): Data length +- **Next Header** (8 bits): Protocol type +- **Hop Limit** (8 bits): TTL equivalent +- **Source Address** (128 bits) +- **Destination Address** (128 bits) + +**IPv6 Address Types:** +- **Unicast**: Single interface +- **Multicast**: Group of interfaces +- **Anycast**: Nearest of group + +**IPv4 to IPv6 Transition:** +- **Dual Stack**: Run both protocols +- **Tunneling**: Encapsulate IPv6 in IPv4 +- **Translation**: Convert between protocols + +### 4.5 Generalized Forwarding (SDN) + +**Traditional Forwarding:** +- **Destination-based**: Forward based on destination IP +- **Fixed Function**: Hardware-based lookup + +**Generalized Forwarding:** +- **Flow-based**: Forward based on header fields +- **Programmable**: Software-defined rules + +**OpenFlow Protocol:** +- **Flow Table**: Match + Action + Stats +- **Match Fields**: 12-tuple (IPs, ports, protocol, etc.) +- **Actions**: Forward, drop, modify, send to controller +- **Controller**: Centralized control plane + +**SDN Benefits:** +- **Centralized Control**: Global network view +- **Programmability**: Custom forwarding logic +- **Separation**: Control plane from data plane +- **Innovation**: Rapid protocol development + +--- + +## Unit 5: Network Layer - Control Plane + +### 5.1 Routing Algorithms + +**Graph Abstraction:** +- **Nodes**: Routers +- **Edges**: Physical links +- **Edge Costs**: Delay, congestion, monetary cost + +**Routing Algorithm Classification:** +- **Global vs Decentralized**: Complete topology knowledge +- **Static vs Dynamic**: Route changes over time +- **Load-sensitive vs Load-insensitive**: Cost reflects traffic load + +### 5.2 Link State Routing (Dijkstra's Algorithm) + +**Algorithm Steps:** +1. **Initialization**: Distance to source = 0, others = ∞ +2. **Find minimum**: Select unvisited node with minimum distance +3. **Update neighbors**: Relax edge weights +4. **Repeat**: Until all nodes visited + +**Dijkstra's Complexity:** +- **Time**: O(n²) with simple implementation, O(n log n) with heap +- **Space**: O(n) for distance and predecessor arrays + +**Link State Protocol Features:** +- **Flooding**: Broadcast link state to all routers +- **LSDB**: Link State Database at each router +- **SPF**: Shortest Path First calculation +- **Convergence**: Fast when topology changes + +### 5.3 Distance Vector Routing + +**Bellman-Ford Equation:** +- d_x(y) = min_v{c(x,v) + d_v(y)} +- Distance from x to y = minimum over neighbors v + +**Distance Vector Algorithm:** +1. **Initialize**: Distance vector at each node +2. **Periodic Updates**: Send DV to neighbors +3. **Update**: Recalculate using Bellman-Ford +4. **Notify**: Send updates if changes occur + +**Problems:** +- **Count-to-Infinity**: Bad news travels slowly +- **Routing Loops**: Temporary loops during convergence +- **Solution**: Split horizon, poison reverse + +### 5.4 OSPF (Open Shortest Path First) + +**OSPF Characteristics:** +- **Link State Protocol**: Uses Dijkstra's algorithm +- **Area Concept**: Hierarchical routing +- **Authentication**: Secure routing updates +- **Load Balancing**: Multiple equal-cost paths + +**OSPF Areas:** +- **Backbone Area**: Area 0, connects all other areas +- **Regular Areas**: Connected to backbone +- **Stub Areas**: No external routes +- **NSSA**: Not-So-Stubby Areas + +**LSA Types:** +- **Type 1**: Router LSA +- **Type 2**: Network LSA +- **Type 3**: Summary LSA +- **Type 4**: ASBR Summary LSA +- **Type 5**: External LSA + +### 5.5 BGP (Border Gateway Protocol) + +**BGP Purpose:** +- **Inter-domain Routing**: Between autonomous systems +- **Policy-based**: Economic and political considerations +- **Path Vector Protocol**: Maintains entire AS path + +**BGP Attributes:** +- **AS-PATH**: Sequence of ASs through which route passed +- **NEXT-HOP**: IP address of next-hop router +- **LOCAL-PREF**: Degree of preference (higher = better) +- **MED**: Multi-Exit Discriminator (lower = better) + +**BGP Route Selection:** +1. **Highest LOCAL-PREF** +2. **Shortest AS-PATH** +3. **Closest NEXT-HOP** (hot potato routing) +4. **Additional tie-breakers** + +**BGP Loop Prevention:** +- **AS-PATH Attribute**: Contains list of ASs +- **Loop Detection**: Reject routes containing own AS number + +**BGP Policy Examples:** +- **Customer-Provider**: Provider advertises customer routes +- **Peer-Peer**: Peers exchange customer routes +- **Valley-Free**: No provider pays another provider + +### 5.6 SDN Control Plane + +**SDN Architecture:** +- **Data Plane**: Network switches +- **Control Plane**: SDN controller +- **Management Plane**: Network operating system + +**OpenFlow Protocol:** +- **Southbound API**: Controller to switch +- **Flow Tables**: Match-action rules +- **Reactive vs Proactive**: On-demand vs pre-installed rules + +**SDN Controller Functions:** +- **Topology Discovery**: Learn network topology +- **Routing Calculations**: Compute paths +- **Flow Installation**: Program switch flow tables +- **Load Balancing**: Distribute traffic + +**Benefits:** +- **Centralized Control**: Global optimization +- **Programmability**: Custom applications +- **Vendor Independence**: Open standards + +### 5.7 Network Management + +**SNMP (Simple Network Management Protocol):** +- **Manager**: Monitoring system +- **Agent**: Managed device +- **MIB**: Management Information Base +- **Operations**: GET, SET, TRAP + +**SNMP Messages:** +- **GetRequest**: Retrieve variable value +- **SetRequest**: Set variable value +- **GetResponse**: Response to Get/Set +- **Trap**: Asynchronous notification + +**Why UDP for SNMP:** +- **Simplicity**: Minimal overhead +- **Reliability**: Application-level retransmission +- **Efficiency**: Small message sizes +- **Availability**: Works during network problems + +--- + +## Unit 6: Link Layer and LANs + +### 6.1 Link Layer Introduction + +**Link Layer Services:** +- **Framing**: Encapsulate network layer packets +- **Link Access**: Coordinate access to shared medium +- **Reliable Delivery**: Error detection and correction +- **Flow Control**: Pace between sender and receiver +- **Error Detection**: Detect bit errors in frames +- **Error Correction**: Correct bit errors +- **Half-duplex/Full-duplex**: Bidirectional communication + +**Where is Link Layer Implemented:** +- **Network Interface Card (NIC)**: Hardware + software +- **Network Adapter**: Ethernet card, Wi-Fi card + +### 6.2 Error Detection and Correction + +**Error Types:** +- **Single Bit Error**: One bit flipped +- **Burst Error**: Multiple consecutive bits flipped + +**Detection vs Correction:** +- **Detection**: Identify presence of errors +- **Correction**: Fix errors without retransmission + +### Parity Checking + +**Single Bit Parity:** +- **Even Parity**: Even number of 1s (including parity bit) +- **Odd Parity**: Odd number of 1s (including parity bit) +- **Detection**: Single bit errors only + +**Two-Dimensional Parity:** +- **Row and Column Parity**: Arrange bits in matrix +- **Detection**: Single bit errors +- **Correction**: Single bit errors (locate intersection) + +### Checksums + +**1's Complement Checksum:** +1. **Sum**: Add all 16-bit words +2. **Wraparound**: Add carry to result +3. **Complement**: Flip all bits +4. **Check**: Add all words + checksum = all 1s + +**Internet Checksum Algorithm:** +- Used in IP, TCP, UDP headers +- Relatively weak error detection +- Fast computation in software + +### Cyclic Redundancy Check (CRC) + +**CRC Process:** +1. **Generator**: Agreed upon r+1 bit pattern G +2. **Remainder**: R = remainder of (D×2^r) ÷ G +3. **Transmitted**: D concatenated with R +4. **Check**: (D||R) divisible by G + +**CRC Properties:** +- **Detection**: All single bit errors +- **Detection**: All double bit errors +- **Detection**: Odd number of bit errors (if G has factor (x+1)) +- **Detection**: All burst errors of length ≤ r + +**Common CRC Standards:** +- **CRC-8**: 8-bit remainder +- **CRC-16**: 16-bit remainder +- **CRC-32**: 32-bit remainder (Ethernet, Wi-Fi) + +### 6.3 Multiple Access Protocols + +**Multiple Access Problem:** +- **Shared Medium**: Single broadcast channel +- **Collision**: Two or more simultaneous transmissions +- **Goal**: Coordinate access to avoid/handle collisions + +**Protocol Categories:** +1. **Channel Partitioning**: Divide channel +2. **Random Access**: Allow collisions, recover +3. **Taking Turns**: Pass token or poll + +### Channel Partitioning Protocols + +**TDMA (Time Division Multiple Access):** +- **Time Slots**: Each node gets fixed time slot +- **Advantages**: No collisions, fair +- **Disadvantages**: Unused slots wasted + +**FDMA (Frequency Division Multiple Access):** +- **Frequency Bands**: Each node gets frequency band +- **Advantages**: No collisions +- **Disadvantages**: Limited frequency spectrum + +**CDMA (Code Division Multiple Access):** +- **Unique Codes**: Each sender assigned unique code +- **Advantages**: Simultaneous transmission +- **Applications**: Cellular networks + +### Random Access Protocols + +**ALOHA:** +- **Pure ALOHA**: Transmit immediately + - **Efficiency**: 18.4% maximum +- **Slotted ALOHA**: Synchronize to time slots + - **Efficiency**: 36.8% maximum + +**CSMA (Carrier Sense Multiple Access):** +- **Listen Before Talk**: Sense channel before transmit +- **Collisions Still Possible**: Propagation delay +- **1-Persistent**: Always transmit when idle +- **p-Persistent**: Transmit with probability p + +**CSMA/CD (Collision Detection):** +- **Listen While Talk**: Detect collisions during transmission +- **Jam Signal**: Alert other stations of collision +- **Binary Exponential Backoff**: Exponentially increase backoff time +- **Minimum Frame Size**: Ensure collision detection + +**CSMA/CD Algorithm:** +1. **Sense**: Is channel idle? +2. **Transmit**: If idle, start transmission +3. **Collision Detection**: Monitor for collisions +4. **Jam**: If collision, send jam signal +5. **Backoff**: Wait random time, go to step 1 + +**CSMA/CA (Collision Avoidance):** +- **Used in Wi-Fi**: Can't detect collisions reliably +- **RTS/CTS**: Request to Send / Clear to Send +- **ACK**: Explicit acknowledgments +- **Backoff**: Random backoff before each transmission + +### 6.4 Ethernet + +**Ethernet Evolution:** + +| Standard | Year | Speed | Cable | Max Distance | +|----------|------|-------|-------|--------------| +| **10BASE-T** | 1990 | 10 Mbps | UTP Cat3 | 100m | +| **100BASE-TX** | 1995 | 100 Mbps | UTP Cat5 | 100m | +| **1000BASE-T** | 1999 | 1 Gbps | UTP Cat5e | 100m | +| **10GBASE-T** | 2006 | 10 Gbps | UTP Cat6a | 100m | + +**Ethernet Frame Format:** +- **Preamble** (8 bytes): Synchronization (10101010...) +- **Destination Address** (6 bytes): MAC address +- **Source Address** (6 bytes): MAC address +- **Type** (2 bytes): Higher layer protocol +- **Data** (46-1500 bytes): Payload +- **CRC** (4 bytes): Error detection + +**MAC Addresses:** +- **48-bit**: Unique identifier (e.g., 1A-2F-BB-76-09-AD) +- **OUI**: Organizationally Unique Identifier (first 24 bits) +- **NIC**: Network Interface Card specific (last 24 bits) +- **Broadcast**: FF-FF-FF-FF-FF-FF +- **Multicast**: First bit = 1 + +### 6.5 Link Layer Switches + +**Switch Functions:** +- **Learning**: Build MAC address table +- **Flooding**: Forward to all ports if unknown destination +- **Filtering**: Drop frames destined for same segment +- **Forwarding**: Send to specific port + +**Switch Learning Algorithm:** +1. **Record**: Source MAC and input port +2. **Age**: Remove old entries +3. **Lookup**: Check destination in table +4. **Forward**: Send to appropriate port or flood + +**Spanning Tree Protocol (STP):** +- **Purpose**: Prevent loops in switched networks +- **Root Bridge**: Elected based on lowest bridge ID +- **Port States**: Blocking, listening, learning, forwarding +- **BPDU**: Bridge Protocol Data Units + +**VLANs (Virtual LANs):** +- **Purpose**: Logically separate broadcast domains +- **Trunk Links**: Carry multiple VLAN traffic +- **802.1Q**: VLAN tagging standard +- **Benefits**: Security, traffic management, flexibility + +--- + +## Unit 7: Wireless and Mobile Networks + +### 7.1 Wireless Networking Fundamentals + +**Wireless Challenges:** +- **Signal Strength**: Decreases with distance +- **Interference**: Other sources in same frequency +- **Multipath Propagation**: Signal reflection/scattering +- **Hidden Terminal**: Can't detect all collisions + +**Wireless Network Elements:** +- **Wireless Hosts**: Laptops, smartphones +- **Base Station**: Access point, cell tower +- **Wireless Link**: Radio spectrum connection + +### 7.2 Wi-Fi (802.11 Wireless LANs) + +**802.11 Architecture:** +- **BSS (Basic Service Set)**: Wireless hosts + AP +- **ESS (Extended Service Set)**: Multiple interconnected BSSs +- **Ad Hoc Network**: No access point + +**802.11 Standards:** + +| Standard | Year | Frequency | Max Speed | Range | +|----------|------|-----------|-----------|-------| +| **802.11a** | 1999 | 5 GHz | 54 Mbps | ~35m | +| **802.11b** | 1999 | 2.4 GHz | 11 Mbps | ~100m | +| **802.11g** | 2003 | 2.4 GHz | 54 Mbps | ~100m | +| **802.11n** | 2009 | 2.4/5 GHz | 600 Mbps | ~70m | +| **802.11ac** | 2013 | 5 GHz | 6.93 Gbps | ~35m | +| **802.11ax** | 2019 | 2.4/5/6 GHz | 9.6 Gbps | ~35m | + +**802.11 Frame Structure:** +- **Frame Control** (2 bytes): Frame type, flags +- **Duration** (2 bytes): Time to transmit frame +- **Address Fields**: Up to 4 MAC addresses +- **Sequence Control** (2 bytes): Fragment/sequence numbers +- **Data**: Payload (0-2312 bytes) +- **CRC** (4 bytes): Error detection + +**802.11 MAC Protocol (CSMA/CA):** +1. **DIFS**: Distributed Inter-Frame Space wait +2. **Random Backoff**: If channel busy +3. **Transmission**: Send frame +4. **SIFS**: Short Inter-Frame Space +5. **ACK**: Acknowledgment frame + +**RTS/CTS Protocol:** +- **Purpose**: Solve hidden terminal problem +- **RTS**: Request to Send (small frame) +- **CTS**: Clear to Send (broadcast response) +- **Collision Avoidance**: Reserves channel + +**802.11 Power Management:** +- **Sleep Mode**: Node can sleep +- **Beacon Frames**: AP announces sleeping nodes +- **TIM**: Traffic Indication Map + +### 7.3 Cellular Networks + +**Cellular Concept:** +- **Cell**: Geographic area served by base station +- **Frequency Reuse**: Same frequencies in distant cells +- **Handoff**: Transfer between cells +- **Roaming**: Service outside home network + +**1G Networks:** +- **Technology**: Analog, FDMA +- **Service**: Voice only +- **Example**: AMPS (Advanced Mobile Phone System) + +**2G Networks:** +- **Technology**: Digital, TDMA/CDMA +- **Services**: Voice, SMS, low-speed data +- **Examples**: GSM, IS-95 CDMA + +**3G Networks:** +- **Technology**: CDMA-based +- **Services**: Voice, data up to 2 Mbps +- **Examples**: UMTS/WCDMA, CDMA2000 + +**4G/LTE Networks:** +- **Technology**: OFDMA, all-IP +- **Services**: High-speed data (100+ Mbps) +- **Architecture**: Evolved Packet Core (EPC) + +**5G Networks:** +- **Technology**: Massive MIMO, mmWave +- **Services**: Ultra-low latency, IoT, enhanced mobile broadband +- **Speeds**: Up to 20 Gbps + +### 7.4 Mobility Management + +**Mobility Challenges:** +- **Addressing**: How to find mobile user? +- **Routing**: How to route to mobile user? +- **Handoff**: Seamless connectivity during movement + +**Mobile IP (IPv4):** +- **Home Network**: Permanent network +- **Foreign Network**: Visited network +- **Home Agent**: Router in home network +- **Foreign Agent**: Router in foreign network +- **Care-of-Address**: Temporary address in foreign network + +**Mobile IP Process:** +1. **Registration**: Mobile node registers with foreign agent +2. **Tunneling**: Home agent tunnels packets to care-of-address +3. **Delivery**: Foreign agent delivers to mobile node +4. **Reverse**: Direct routing or via home agent + +**GSM Mobility Management:** +- **HLR (Home Location Register)**: User's home database +- **VLR (Visitor Location Register)**: Current location database +- **MSC (Mobile Switching Center)**: Call switching +- **Authentication**: Challenge-response with shared secret + +--- + +## Key Formulas and Calculations + +### Delay Calculations + +**Transmission Delay:** +``` +d_trans = L / R +where: L = packet length (bits), R = transmission rate (bps) +``` + +**Propagation Delay:** +``` +d_prop = d / s +where: d = distance (m), s = propagation speed (m/s) +``` + +**Total Delay:** +``` +d_total = d_proc + d_queue + d_trans + d_prop +``` + +**Round-Trip Time (RTT):** +``` +RTT = 2 × d_prop (assuming negligible other delays) +``` + +### Throughput Calculations + +**Throughput:** +``` +Throughput = min(R1, R2, ..., Rn) for bottleneck link +``` + +**File Transfer Time:** +``` +Transfer Time = File Size / Throughput +``` + +### Queuing Theory + +**Traffic Intensity:** +``` +ρ = λa / μ = La / R +where: λ = arrival rate, a = avg packet size, μ = service rate, R = link capacity +``` + +**Average Queue Length (M/M/1):** +``` +L = ρ / (1 - ρ) +``` + +**Average Waiting Time (M/M/1):** +``` +W = ρ / (μ(1 - ρ)) +``` + +### TCP Congestion Control + +**TCP Throughput Approximation:** +``` +Throughput ≈ (3/4) × (MSS / RTT) × (1 / √p) +where: MSS = maximum segment size, p = loss probability +``` + +**TCP Sawtooth Average:** +``` +Average Window = (3/4) × W_max +where: W_max = maximum window size before loss +``` + +### Subnet Calculations + +**Number of Subnets:** +``` +Number of Subnets = 2^n +where: n = number of borrowed bits +``` + +**Number of Hosts per Subnet:** +``` +Hosts per Subnet = 2^h - 2 +where: h = number of host bits, -2 for network and broadcast +``` + +**Subnet Address Range:** +``` +Network Address = IP & Subnet Mask +Broadcast Address = Network Address | (~Subnet Mask) +First Host = Network Address + 1 +Last Host = Broadcast Address - 1 +``` + +### Error Detection + +**1's Complement Checksum:** +1. Sum all 16-bit words +2. Add carry to result +3. Take 1's complement +4. Append to data + +**CRC Polynomial Division:** +``` +Transmitted = Data || CRC +where: CRC = remainder of (Data × 2^r) ÷ Generator +``` + +### Wireless Calculations + +**Path Loss (Free Space):** +``` +Path Loss (dB) = 20 log10(d) + 20 log10(f) + 32.44 +where: d = distance (km), f = frequency (MHz) +``` + +**Signal-to-Noise Ratio:** +``` +SNR (dB) = 10 log10(Signal Power / Noise Power) +``` + +**Shannon Capacity:** +``` +C = B log2(1 + SNR) +where: C = capacity (bps), B = bandwidth (Hz) +``` + +--- + +## Protocol Comparison Tables + +### Transport Protocols + +| Feature | TCP | UDP | +|---------|-----|-----| +| **Connection** | Connection-oriented | Connectionless | +| **Reliability** | Reliable, ordered delivery | Unreliable, no ordering | +| **Flow Control** | Yes (sliding window) | No | +| **Congestion Control** | Yes | No | +| **Header Size** | 20-60 bytes | 8 bytes | +| **Speed** | Slower (overhead) | Faster (minimal overhead) | +| **Applications** | HTTP, FTP, SMTP, SSH | DNS, DHCP, streaming, games | + +### Routing Protocols + +| Aspect | Link State (OSPF) | Distance Vector (RIP) | Path Vector (BGP) | +|--------|-------------------|----------------------|------------------| +| **Algorithm** | Dijkstra's | Bellman-Ford | Path vector | +| **Convergence** | Fast | Slow | Slow | +| **Scalability** | Good (areas) | Poor | Excellent | +| **Loop Prevention** | SPF tree | Split horizon | AS-PATH | +| **Metric** | Cost | Hop count | Policy-based | +| **Updates** | Event-triggered | Periodic | Incremental | + +### Ethernet Standards + +| Standard | Speed | Cable | Distance | Collision Domain | +|----------|-------|-------|-----------|-----------------| +| **10BASE-T** | 10 Mbps | Cat3 UTP | 100m | Per segment | +| **100BASE-TX** | 100 Mbps | Cat5 UTP | 100m | Per segment | +| **1000BASE-T** | 1 Gbps | Cat5e UTP | 100m | Per link | +| **10GBASE-T** | 10 Gbps | Cat6a UTP | 100m | Per link | + +### Wi-Fi Standards + +| Standard | Frequency | Max Speed | Range | MIMO | +|----------|-----------|-----------|-------|------| +| **802.11n** | 2.4/5 GHz | 600 Mbps | 70m | 4×4 | +| **802.11ac** | 5 GHz | 6.93 Gbps | 35m | 8×8 | +| **802.11ax** | 2.4/5/6 GHz | 9.6 Gbps | 35m | 8×8 | + +### Multiple Access Protocols + +| Protocol | Efficiency | Delay | Complexity | Use Case | +|----------|------------|-------|------------|----------| +| **TDMA** | High | Low | Medium | Cellular | +| **FDMA** | High | Low | Medium | Radio | +| **CSMA/CD** | Medium | Variable | Low | Ethernet | +| **CSMA/CA** | Low | High | Medium | Wi-Fi | + +--- + +## Common Exam Topics + +### Calculation Problems + +1. **Delay and Throughput** + - Calculate transmission, propagation, and total delay + - Determine bottleneck links and end-to-end throughput + - File transfer time calculations + +2. **Subnet Design** + - CIDR notation and subnet masks + - Number of subnets and hosts + - IP address ranges and broadcast addresses + +3. **TCP Performance** + - Congestion window evolution + - Throughput estimation + - Connection establishment time + +4. **Checksum Calculations** + - 1's complement arithmetic + - Error detection probability + - Two-dimensional parity + +5. **Routing Algorithm Execution** + - Dijkstra's shortest path + - Distance vector updates + - BGP path selection + +### Conceptual Questions + +1. **Protocol Comparison** + - TCP vs UDP characteristics + - Circuit vs packet switching + - Link state vs distance vector routing + +2. **Network Architecture** + - OSI vs Internet protocol stack + - Client-server vs P2P applications + - SDN vs traditional networking + +3. **Error Control** + - Detection vs correction + - ARQ protocols (Stop-and-wait, Go-back-N, Selective Repeat) + - Forward error correction + +4. **Multiple Access** + - Hidden and exposed terminal problems + - CSMA/CD vs CSMA/CA + - Random access vs controlled access + +5. **Wireless Networking** + - Wi-Fi architecture and protocols + - Cellular network evolution + - Mobility management + +### Design Problems + +1. **Network Topology Design** + - Subnet planning and addressing + - Router placement and configuration + - QoS and traffic engineering + +2. **Protocol Selection** + - Application requirements analysis + - Transport protocol choice + - Routing protocol selection + +3. **Performance Optimization** + - Bottleneck identification + - Capacity planning + - Load balancing strategies + +### Security Considerations + +1. **Network Attacks** + - DoS and DDoS attacks + - Man-in-the-middle attacks + - Packet sniffing and spoofing + +2. **Security Mechanisms** + - Encryption and authentication + - Firewalls and intrusion detection + - VPNs and secure tunneling + +--- + +## Final Exam Preparation Tips + +### Study Strategy + +1. **Review assignments** - Your completed assignments cover key exam topics +2. **Practice calculations** - Master delay, throughput, and subnetting problems +3. **Understand protocols** - Know when and why different protocols are used +4. **Create comparison tables** - Organize similar technologies and protocols +5. **Draw diagrams** - Visualize network architectures and protocol operations + +### Key Areas to Focus + +1. **Fundamentals** (Unit 1): Delay calculations, throughput, switching +2. **Application Layer** (Unit 2): HTTP, DNS, P2P file sharing +3. **Transport Layer** (Unit 3): TCP reliability and congestion control +4. **Network Layer** (Units 4-5): IP addressing, routing algorithms +5. **Link Layer** (Unit 6): Error detection, Ethernet, switching +6. **Wireless** (Unit 7): Wi-Fi protocols, cellular networks + +### Problem-Solving Approach + +1. **Read carefully** - Identify what's given and what's asked +2. **Draw diagrams** - Visualize the network or protocol operation +3. **Show work** - Step-by-step calculations with units +4. **Check answers** - Verify reasonableness and units +5. **Explain reasoning** - Justify protocol choices and design decisions + +**Good luck with your final exam!**
\ No newline at end of file |
