{"id":514,"date":"2026-06-21T20:42:44","date_gmt":"2026-06-21T20:42:44","guid":{"rendered":"https:\/\/paknoteshub.online\/?page_id=514"},"modified":"2026-06-21T20:43:25","modified_gmt":"2026-06-21T20:43:25","slug":"computer-network","status":"publish","type":"page","link":"https:\/\/paknoteshub.online\/?page_id=514","title":{"rendered":"Computer Network"},"content":{"rendered":"\t\t<div data-elementor-type=\"wp-page\" data-elementor-id=\"514\" class=\"elementor elementor-514\">\n\t\t\t\t<div class=\"elementor-element elementor-element-1484c93 e-flex e-con-boxed e-con e-parent\" data-id=\"1484c93\" data-element_type=\"container\" data-e-type=\"container\">\n\t\t\t\t\t<div class=\"e-con-inner\">\n\t\t\t\t<div class=\"elementor-element elementor-element-746c875 elementor-widget elementor-widget-html\" data-id=\"746c875\" data-element_type=\"widget\" data-e-type=\"widget\" data-widget_type=\"html.default\">\n\t\t\t\t\t<!DOCTYPE html>\r\n<html lang=\"en\">\r\n<head>\r\n  <meta charset=\"UTF-8\"\/>\r\n  <meta name=\"viewport\" content=\"width=device-width, initial-scale=1.0\"\/>\r\n  <title>Computer Networks \u2013 University Level \u2013 Pak Notes Hub<\/title>\r\n  <link href=\"https:\/\/fonts.googleapis.com\/css2?family=Inter:wght@400;500;600;700&family=Fira+Code:wght@400;500&display=swap\" rel=\"stylesheet\"\/>\r\n  <style>\r\n    *, *::before, *::after { box-sizing: border-box; margin: 0; padding: 0; }\r\n    :root {\r\n      --green: #1a7a4a; --green-dark: #145f38; --green-light: #e8f5ee;\r\n      --teal: #17a589; --accent: #f0b127; --dark: #1c2833; --mid: #566573;\r\n      --light: #f4f6f7; --code-bg: #f0f4f8; --code-border: #2e86c1;\r\n      --note-bg: #fef9e7; --note-border: #f0b127; --white: #ffffff;\r\n      --radius: 10px; --shadow: 0 4px 24px rgba(26,122,74,.10);\r\n    }\r\n    html { scroll-behavior: smooth; }\r\n    body { font-family: 'Inter', sans-serif; background: #f2f6f3; color: var(--dark); line-height: 1.7; font-size: 15px; }\r\n\r\n    \/* NAV *\/\r\n    nav { position: sticky; top: 0; z-index: 100; background: var(--green-dark); padding: 0 2rem; display: flex; align-items: center; justify-content: space-between; height: 56px; box-shadow: 0 2px 12px rgba(0,0,0,.25); }\r\n    .nav-brand { color: #fff; font-weight: 700; font-size: 1.05rem; }\r\n    .nav-brand span { color: #a9dfbf; }\r\n    .nav-links { display: flex; gap: 1.2rem; }\r\n    .nav-links a { color: #d5f5e3; font-size: .85rem; font-weight: 500; text-decoration: none; transition: color .2s; }\r\n    .nav-links a:hover { color: #fff; }\r\n\r\n    \/* HERO *\/\r\n    .hero { background: linear-gradient(135deg, var(--green) 0%, #145f38 60%, #0d4527 100%); padding: 5rem 2rem 4rem; text-align: center; position: relative; overflow: hidden; }\r\n    .hero::before { content: '\ud83c\udf10'; position: absolute; right: 6%; top: 50%; transform: translateY(-50%); font-size: 9rem; font-family: 'Times New Roman', serif; color: rgba(255,255,255,.06); font-weight: 700; pointer-events: none; }\r\n    .hero-tag { display: inline-block; background: rgba(255,255,255,.12); color: #a9dfbf; font-size: .78rem; font-weight: 600; letter-spacing: 1.5px; text-transform: uppercase; padding: .35rem 1rem; border-radius: 100px; margin-bottom: 1.2rem; border: 1px solid rgba(169,223,163,.3); }\r\n    .hero h1 { color: #fff; font-size: clamp(1.8rem, 5vw, 3rem); font-weight: 700; line-height: 1.15; margin-bottom: .8rem; }\r\n    .hero h1 span { color: #a9dfbf; }\r\n    .hero p { color: #d5f5e3; font-size: 1.05rem; max-width: 600px; margin: 0 auto 2rem; }\r\n    .hero-pills { display: flex; flex-wrap: wrap; justify-content: center; gap: .7rem; }\r\n    .pill { background: rgba(255,255,255,.13); color: #e8f5ee; padding: .45rem 1.1rem; border-radius: 100px; font-size: .82rem; font-weight: 500; border: 1px solid rgba(255,255,255,.18); }\r\n\r\n    \/* LAYOUT *\/\r\n    .page-wrap { max-width: 940px; margin: 0 auto; padding: 2.5rem 1.5rem 4rem; display: grid; grid-template-columns: 235px 1fr; gap: 2.5rem; align-items: start; }\r\n\r\n    \/* SIDEBAR *\/\r\n    .sidebar { position: sticky; top: 72px; background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); overflow: hidden; }\r\n    .sidebar-title { background: var(--green); color: #fff; font-size: .75rem; font-weight: 700; letter-spacing: 1.2px; text-transform: uppercase; padding: .85rem 1.1rem; }\r\n    .toc-list { list-style: none; padding: .5rem 0; max-height: calc(100vh - 130px); overflow-y: auto; }\r\n    .toc-list li a { display: flex; align-items: center; gap: .55rem; padding: .4rem 1.1rem; color: var(--mid); font-size: .81rem; font-weight: 500; text-decoration: none; transition: all .18s; border-left: 3px solid transparent; }\r\n    .toc-list li a:hover, .toc-list li a.active { color: var(--green); background: var(--green-light); border-left-color: var(--green); }\r\n    .toc-num { display: inline-flex; align-items: center; justify-content: center; min-width: 20px; height: 20px; border-radius: 4px; background: var(--green-light); color: var(--green); font-size: .7rem; font-weight: 700; flex-shrink: 0; }\r\n    .toc-list li a.active .toc-num { background: var(--green); color: #fff; }\r\n\r\n    \/* UNIT CARD *\/\r\n    .unit { background: var(--white); border-radius: var(--radius); box-shadow: var(--shadow); margin-bottom: 2.5rem; overflow: hidden; scroll-margin-top: 72px; }\r\n    .unit-header { background: linear-gradient(100deg, var(--green) 0%, #1d9560 100%); padding: 1.4rem 1.8rem; }\r\n    .unit-num-badge { background: rgba(255,255,255,.18); color: #a9dfbf; font-size: .72rem; font-weight: 700; letter-spacing: 1px; text-transform: uppercase; padding: .3rem .75rem; border-radius: 100px; }\r\n    .unit-header h2 { color: #fff; font-size: 1.25rem; font-weight: 700; line-height: 1.25; margin-top: .35rem; }\r\n    .unit-header p { color: #c8f0d8; font-size: .85rem; margin-top: .2rem; }\r\n    .unit-body { padding: 1.8rem; }\r\n\r\n    \/* HEADINGS & TEXT *\/\r\n    .unit-body h3 { font-size: 1rem; font-weight: 700; color: var(--green); margin: 1.6rem 0 .7rem; padding-left: .85rem; border-left: 3px solid var(--green); line-height: 1.3; }\r\n    .unit-body h3:first-child { margin-top: 0; }\r\n    .unit-body p { color: var(--dark); margin-bottom: .7rem; }\r\n    .unit-body ul { list-style: none; padding: 0; margin: .5rem 0 1rem; }\r\n    .unit-body ul li { padding: .3rem 0 .3rem 1.5rem; position: relative; color: var(--dark); font-size: .93rem; }\r\n    .unit-body ul li::before { content: '\u27a4'; position: absolute; left: 0; color: var(--teal); font-size: .75rem; top: .45rem; }\r\n\r\n    \/* CODE BLOCK *\/\r\n    .code-block { background: var(--code-bg); border-left: 4px solid var(--code-border); border-radius: 6px; padding: 1.1rem 1.3rem; margin: .9rem 0 1rem; overflow-x: auto; }\r\n    .code-block pre { font-family: 'Fira Code', monospace; font-size: .83rem; color: #1a3a54; line-height: 1.75; white-space: pre; }\r\n    .cm { color: #7f8c8d; } .kw { color: #1a5276; font-weight: 600; } .st { color: #1e8449; }\r\n\r\n    \/* TABLES *\/\r\n    .data-table { width: 100%; border-collapse: collapse; margin: .9rem 0 1.2rem; font-size: .87rem; border-radius: 8px; overflow: hidden; box-shadow: 0 1px 6px rgba(0,0,0,.06); }\r\n    .data-table thead th { background: var(--green); color: #fff; padding: .7rem 1rem; text-align: left; font-weight: 600; font-size: .82rem; }\r\n    .data-table tbody tr:nth-child(even) { background: var(--green-light); }\r\n    .data-table tbody tr:hover { background: #d4efdf; }\r\n    .data-table td { padding: .6rem 1rem; border-bottom: 1px solid #dce8e0; vertical-align: top; }\r\n    .data-table td:first-child { font-weight: 600; color: var(--green-dark); }\r\n\r\n    \/* BOXES *\/\r\n    .info-box { background: var(--note-bg); border: 1px solid var(--note-border); border-radius: 7px; padding: .85rem 1.1rem; margin: .9rem 0; font-size: .88rem; line-height: 1.6; color: #7d6608; display: flex; align-items: flex-start; gap: .7rem; }\r\n    .practice { background: var(--green-light); border: 1.5px dashed var(--green); border-radius: 8px; padding: .85rem 1.1rem; margin-top: 1.4rem; color: var(--green-dark); font-size: .88rem; font-weight: 500; }\r\n\r\n    \/* PROGRESS + BACK TOP *\/\r\n    .progress-bar { position: fixed; top: 0; left: 0; height: 3px; background: var(--accent); z-index: 200; transition: width .1s linear; width: 0%; }\r\n    #back-top { position: fixed; bottom: 2rem; right: 2rem; background: var(--green); color: #fff; width: 42px; height: 42px; border-radius: 50%; border: none; cursor: pointer; font-size: 1.1rem; box-shadow: 0 4px 14px rgba(26,122,74,.35); display: flex; align-items: center; justify-content: center; opacity: 0; transition: opacity .25s, transform .25s; pointer-events: none; }\r\n    #back-top.visible { opacity: 1; pointer-events: auto; }\r\n    #back-top:hover { transform: translateY(-2px); }\r\n\r\n    \/* CONGRATS *\/\r\n    .congrats { background: linear-gradient(135deg, var(--green) 0%, #145f38 100%); border-radius: var(--radius); padding: 2.5rem 2rem; text-align: center; color: #fff; margin-bottom: 2.5rem; box-shadow: var(--shadow); }\r\n    .congrats h2 { font-size: 1.8rem; margin-bottom: .5rem; }\r\n    .congrats p { color: #d5f5e3; font-size: 1rem; }\r\n\r\n    @media (max-width: 720px) { .page-wrap { grid-template-columns: 1fr; } .sidebar { position: static; display: none; } .hero::before { display: none; } nav .nav-links { display: none; } }\r\n  <\/style>\r\n<\/head>\r\n<body>\r\n\r\n<div class=\"progress-bar\" id=\"progress\"><\/div>\r\n\r\n<nav>\r\n  <div class=\"nav-brand\">Pak <span>Notes Hub<\/span><\/div>\r\n  <div class=\"nav-links\">\r\n    <a href=\"#unit-1\">Basics<\/a>\r\n    <a href=\"#unit-5\">Transport<\/a>\r\n    <a href=\"#unit-9\">Security<\/a>\r\n  <\/div>\r\n<\/nav>\r\n\r\n<section class=\"hero\">\r\n  <div class=\"hero-tag\">\ud83c\udf10 University Level \u2014 BS CS \/ BS IT<\/div>\r\n  <h1>Computer Networks<br\/><span>Complete Notes<\/span><\/h1>\r\n  <p>OSI Model \u00b7 TCP\/IP \u00b7 Routing \u00b7 Switching \u00b7 DNS \u00b7 Security \u00b7 All in Easy English<\/p>\r\n  <div class=\"hero-pills\">\r\n    <div class=\"pill\">OSI Model<\/div>\r\n    <div class=\"pill\">Protocols<\/div>\r\n    <div class=\"pill\">Network Security<\/div>\r\n  <\/div>\r\n<\/section>\r\n\r\n<div class=\"page-wrap\">\r\n\r\n  <!-- SIDEBAR -->\r\n  <aside class=\"sidebar\">\r\n    <div class=\"sidebar-title\">\ud83d\udcda Table of Contents<\/div>\r\n    <ul class=\"toc-list\">\r\n      <li><a href=\"#unit-1\"><span class=\"toc-num\">1<\/span> Basics<\/a><\/li>\r\n      <li><a href=\"#unit-2\"><span class=\"toc-num\">2<\/span> OSI Model<\/a><\/li>\r\n      <li><a href=\"#unit-3\"><span class=\"toc-num\">3<\/span> Data Link Layer<\/a><\/li>\r\n      <li><a href=\"#unit-4\"><span class=\"toc-num\">4<\/span> Network Layer<\/a><\/li>\r\n      <li><a href=\"#unit-5\"><span class=\"toc-num\">5<\/span> Transport Layer<\/a><\/li>\r\n      <li><a href=\"#unit-6\"><span class=\"toc-num\">6<\/span> Application Layer<\/a><\/li>\r\n      <li><a href=\"#unit-7\"><span class=\"toc-num\">7<\/span> Routing<\/a><\/li>\r\n      <li><a href=\"#unit-8\"><span class=\"toc-num\">8<\/span> Switching<\/a><\/li>\r\n      <li><a href=\"#unit-9\"><span class=\"toc-num\">9<\/span> Network Security<\/a><\/li>\r\n      <li><a href=\"#unit-10\"><span class=\"toc-num\">10<\/span> Wireless Networks<\/a><\/li>\r\n    <\/ul>\r\n  <\/aside>\r\n\r\n  <main>\r\n\r\n    <!-- UNIT 1 -->\r\n    <div class=\"unit\" id=\"unit-1\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 1<\/div>\r\n        <h2>Computer Networks Basics<\/h2>\r\n        <p>Introduction to Networking Concepts<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>What is a Network?<\/h3>\r\n        <p>A <strong>computer network<\/strong> is a collection of interconnected computers that communicate and share resources through communication protocols.<\/p>\r\n\r\n        <h3>Types of Networks<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Type<\/th><th>Range<\/th><th>Examples<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>PAN<\/td><td>Few meters<\/td><td>Bluetooth devices, Smartphone connections<\/td><\/tr>\r\n            <tr><td>LAN<\/td><td>Single building<\/td><td>Office networks, Schools<\/td><\/tr>\r\n            <tr><td>MAN<\/td><td>City-wide<\/td><td>City WiFi networks<\/td><\/tr>\r\n            <tr><td>WAN<\/td><td>Worldwide<\/td><td>Internet, Intercontinental links<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>Network Models<\/h3>\r\n        <ul>\r\n          <li><strong>Peer-to-Peer (P2P):<\/strong> All computers equal, no central server<\/li>\r\n          <li><strong>Client-Server:<\/strong> Central server serves multiple clients<\/li>\r\n          <li><strong>Hybrid:<\/strong> Combination of P2P and client-server<\/li>\r\n        <\/ul>\r\n\r\n        <h3>Network Topologies<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Topology<\/th><th>Structure<\/th><th>Pros\/Cons<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>Bus<\/td><td>All connected to single cable<\/td><td>Simple but failure prone<\/td><\/tr>\r\n            <tr><td>Star<\/td><td>All connected to central hub<\/td><td>Reliable but single point of failure<\/td><\/tr>\r\n            <tr><td>Ring<\/td><td>Circular connection<\/td><td>Fair but complex<\/td><\/tr>\r\n            <tr><td>Mesh<\/td><td>Multiple connections<\/td><td>Reliable but expensive<\/td><\/tr>\r\n            <tr><td>Tree<\/td><td>Hierarchical<\/td><td>Scalable and organized<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Compare advantages of different network topologies<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 2 -->\r\n    <div class=\"unit\" id=\"unit-2\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 2<\/div>\r\n        <h2>OSI Model<\/h2>\r\n        <p>Seven Layers of Network Communication<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>OSI Model Overview<\/h3>\r\n        <p>The <strong>Open Systems Interconnection (OSI)<\/strong> model is a 7-layer framework that standardizes network communication.<\/p>\r\n\r\n        <h3>The 7 Layers<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>#<\/th><th>Layer<\/th><th>Function<\/th><th>Devices<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>7<\/td><td>Application<\/td><td>User apps - HTTP, FTP, DNS<\/td><td>Browser, Mail client<\/td><\/tr>\r\n            <tr><td>6<\/td><td>Presentation<\/td><td>Data formatting, encryption<\/td><td>Encryption software<\/td><\/tr>\r\n            <tr><td>5<\/td><td>Session<\/td><td>Establishes connections<\/td><td>Session manager<\/td><\/tr>\r\n            <tr><td>4<\/td><td>Transport<\/td><td>Reliable delivery - TCP, UDP<\/td><td>Gateway<\/td><\/tr>\r\n            <tr><td>3<\/td><td>Network<\/td><td>Routing - IP addresses<\/td><td>Router<\/td><\/tr>\r\n            <tr><td>2<\/td><td>Data Link<\/td><td>Framing - MAC addresses<\/td><td>Switch, Bridge<\/td><\/tr>\r\n            <tr><td>1<\/td><td>Physical<\/td><td>Cables, voltages, signals<\/td><td>Hub, Modem<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>Data Encapsulation<\/h3>\r\n        <div class=\"code-block\"><pre>Application Layer (Data)\r\n        \u2193 Adds header\r\nTransport Layer (Segment)\r\n        \u2193 Adds header\r\nNetwork Layer (Packet)\r\n        \u2193 Adds header\r\nData Link Layer (Frame)\r\n        \u2193 Adds header\r\nPhysical Layer (Bits)\r\n\r\nOn receiving: Remove headers layer by layer (decapsulation)<\/pre><\/div>\r\n\r\n        <div class=\"info-box\">\ud83d\udca1 <strong>Mnemonic:<\/strong> Please Do Not Throw Sausage Pizza Away = Presentation, Data Link, Network, Transport, Session, Physical, Application<\/div>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Trace data through OSI model from user to network<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 3 -->\r\n    <div class=\"unit\" id=\"unit-3\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 3<\/div>\r\n        <h2>Data Link Layer<\/h2>\r\n        <p>Managing Frame Transmission and MAC Addresses<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>Data Link Layer Functions<\/h3>\r\n        <ul>\r\n          <li><strong>Framing:<\/strong> Group bits into frames<\/li>\r\n          <li><strong>MAC Addressing:<\/strong> Identify devices on LAN<\/li>\r\n          <li><strong>Error Detection:<\/strong> CRC (Cyclic Redundancy Check)<\/li>\r\n          <li><strong>Media Access Control:<\/strong> Decide who sends next<\/li>\r\n        <\/ul>\r\n\r\n        <h3>MAC Address<\/h3>\r\n        <p>48-bit address identifying devices on local network. Format: 6 pairs of hexadecimal (e.g., 00:1A:2B:3C:4D:5E)<\/p>\r\n        <div class=\"code-block\"><pre>First 3 octets (24 bits): Manufacturer ID (OUI)\r\nLast 3 octets (24 bits): Device-specific ID\r\n\r\nExample: 08:00:27:2C:2F:65\r\n08:00:27 = Oracle VirtualBox\r\n2C:2F:65 = Individual device<\/pre><\/div>\r\n\r\n        <h3>Ethernet Protocol<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Type<\/th><th>Speed<\/th><th>Distance<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>10BaseT<\/td><td>10 Mbps<\/td><td>100m<\/td><\/tr>\r\n            <tr><td>100BaseT (Fast Ethernet)<\/td><td>100 Mbps<\/td><td>100m<\/td><\/tr>\r\n            <tr><td>1000BaseT (Gigabit)<\/td><td>1 Gbps<\/td><td>100m<\/td><\/tr>\r\n            <tr><td>10GbE<\/td><td>10 Gbps<\/td><td>Limited<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>Media Access Control (MAC)<\/h3>\r\n        <ul>\r\n          <li><strong>CSMA\/CD:<\/strong> Listen before sending, back off if collision<\/li>\r\n          <li><strong>Token Ring:<\/strong> Pass token to decide who sends<\/li>\r\n          <li><strong>Wireless (CSMA\/CA):<\/strong> Collision avoidance<\/li>\r\n        <\/ul>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Explain ARP protocol and MAC address resolution<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 4 -->\r\n    <div class=\"unit\" id=\"unit-4\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 4<\/div>\r\n        <h2>Network Layer<\/h2>\r\n        <p>Routing and IP Addressing<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>Network Layer Functions<\/h3>\r\n        <ul>\r\n          <li><strong>Routing:<\/strong> Find best path from source to destination<\/li>\r\n          <li><strong>IP Addressing:<\/strong> Logical addresses for networks<\/li>\r\n          <li><strong>Forwarding:<\/strong> Move packets along the route<\/li>\r\n          <li><strong>Congestion Control:<\/strong> Manage network traffic<\/li>\r\n        <\/ul>\r\n\r\n        <h3>IPv4 Addressing<\/h3>\r\n        <div class=\"code-block\"><pre>IPv4 Address: 192.168.1.1\r\nEach octet: 0-255 (8 bits)\r\nTotal: 32 bits = 2^32 = 4.3 billion addresses\r\n\r\nClasses:\r\nClass A: 1-126 (16.7 million hosts per network)\r\nClass B: 128-191 (65,000 hosts)\r\nClass C: 192-223 (256 hosts)\r\nClass D: 224-239 (Multicast)\r\nClass E: 240-255 (Reserved)<\/pre><\/div>\r\n\r\n        <h3>Subnetting<\/h3>\r\n        <p>Divide large network into smaller subnets using subnet mask.<\/p>\r\n        <div class=\"code-block\"><pre>IP: 192.168.1.100 \/ 24\r\nSubnet Mask: 255.255.255.0\r\nNetwork Address: 192.168.1.0\r\nBroadcast: 192.168.1.255\r\nUsable IPs: 192.168.1.1 - 192.168.1.254<\/pre><\/div>\r\n\r\n        <h3>IPv6<\/h3>\r\n        <p>128-bit address (2^128 addresses). Format: xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx:xxxx<\/p>\r\n        <div class=\"code-block\"><pre>Example: 2001:0db8:85a3:0000:0000:8a2e:0370:7334\r\nShorthand: 2001:db8:85a3::8a2e:370:7334<\/pre><\/div>\r\n\r\n        <h3>ICMP & Ping<\/h3>\r\n        <p>Internet Control Message Protocol for diagnostics. Ping tests reachability.<\/p>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Calculate network address and broadcast from given IP and subnet mask<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 5 -->\r\n    <div class=\"unit\" id=\"unit-5\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 5<\/div>\r\n        <h2>Transport Layer<\/h2>\r\n        <p>TCP and UDP Protocols<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>Transport Layer Functions<\/h3>\r\n        <ul>\r\n          <li><strong>End-to-end communication<\/strong><\/li>\r\n          <li><strong>Port numbers<\/strong> (0-65535) identify applications<\/li>\r\n          <li><strong>Reliability<\/strong> (TCP) or Speed (UDP)<\/li>\r\n          <li><strong>Flow control<\/strong> and error handling<\/li>\r\n        <\/ul>\r\n\r\n        <h3>TCP vs UDP<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Feature<\/th><th>TCP<\/th><th>UDP<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>Connection<\/td><td>Establishes connection<\/td><td>Connectionless<\/td><\/tr>\r\n            <tr><td>Reliability<\/td><td>Guaranteed delivery<\/td><td>No guarantee<\/td><\/tr>\r\n            <tr><td>Ordering<\/td><td>In-order delivery<\/td><td>Out-of-order possible<\/td><\/tr>\r\n            <tr><td>Speed<\/td><td>Slower (overhead)<\/td><td>Faster (minimal)<\/td><\/tr>\r\n            <tr><td>Uses<\/td><td>HTTP, FTP, Email, SSH<\/td><td>DNS, Video, VoIP, Gaming<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>TCP 3-Way Handshake<\/h3>\r\n        <div class=\"code-block\"><pre>Client                      Server\r\n  |------ SYN (seq=x) ----->|\r\n  |<---- SYN-ACK (seq=y) ----|\r\n  |---- ACK (seq=x+1) ----->|\r\n  |\r\n  [Connection Established]<\/pre><\/div>\r\n\r\n        <h3>Well-Known Ports<\/h3>\r\n        <ul>\r\n          <li>20\/21: FTP<\/li>\r\n          <li>22: SSH<\/li>\r\n          <li>23: Telnet<\/li>\r\n          <li>25: SMTP (Email)<\/li>\r\n          <li>53: DNS<\/li>\r\n          <li>80: HTTP<\/li>\r\n          <li>443: HTTPS<\/li>\r\n          <li>3306: MySQL<\/li>\r\n        <\/ul>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> When would you use TCP vs UDP? Give examples<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 6 -->\r\n    <div class=\"unit\" id=\"unit-6\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 6<\/div>\r\n        <h2>Application Layer<\/h2>\r\n        <p>User Applications and Services<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>Common Application Protocols<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Protocol<\/th><th>Purpose<\/th><th>Port<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>HTTP\/HTTPS<\/td><td>Web browsing<\/td><td>80\/443<\/td><\/tr>\r\n            <tr><td>FTP<\/td><td>File transfer<\/td><td>20\/21<\/td><\/tr>\r\n            <tr><td>SMTP<\/td><td>Send email<\/td><td>25\/587<\/td><\/tr>\r\n            <tr><td>POP3\/IMAP<\/td><td>Receive email<\/td><td>110\/143<\/td><\/tr>\r\n            <tr><td>DNS<\/td><td>Name resolution<\/td><td>53<\/td><\/tr>\r\n            <tr><td>SSH<\/td><td>Secure shell<\/td><td>22<\/td><\/tr>\r\n            <tr><td>Telnet<\/td><td>Remote login<\/td><td>23<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>DNS (Domain Name System)<\/h3>\r\n        <p>Converts domain names to IP addresses. Hierarchical distributed system.<\/p>\r\n        <div class=\"code-block\"><pre>Query Flow:\r\nUser \u2192 Local DNS Resolver \u2192 Root Nameserver\r\n        \u2192 TLD Nameserver (.com, .org)\r\n        \u2192 Authoritative Nameserver\r\n        \u2192 IP Address returned<\/pre><\/div>\r\n\r\n        <h3>HTTP Methods<\/h3>\r\n        <ul>\r\n          <li><strong>GET:<\/strong> Retrieve data<\/li>\r\n          <li><strong>POST:<\/strong> Submit data<\/li>\r\n          <li><strong>PUT:<\/strong> Update resource<\/li>\r\n          <li><strong>DELETE:<\/strong> Remove resource<\/li>\r\n          <li><strong>HEAD:<\/strong> Like GET but no body<\/li>\r\n        <\/ul>\r\n\r\n        <h3>Email Protocols<\/h3>\r\n        <ul>\r\n          <li><strong>SMTP:<\/strong> Sending mail (port 25)<\/li>\r\n          <li><strong>POP3:<\/strong> Receiving (deletes after download)<\/li>\r\n          <li><strong>IMAP:<\/strong> Receiving (keeps on server)<\/li>\r\n        <\/ul>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Trace steps of DNS query and HTTP request<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 7 -->\r\n    <div class=\"unit\" id=\"unit-7\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 7<\/div>\r\n        <h2>Routing Algorithms<\/h2>\r\n        <p>Finding Optimal Paths in Networks<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>Routing Types<\/h3>\r\n        <ul>\r\n          <li><strong>Static:<\/strong> Manually configured routes<\/li>\r\n          <li><strong>Dynamic:<\/strong> Automatically adjusts to network changes<\/li>\r\n        <\/ul>\r\n\r\n        <h3>Routing Algorithms<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Algorithm<\/th><th>Type<\/th><th>How It Works<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>Dijkstra<\/td><td>Link-state<\/td><td>Find shortest path, calculates all routes<\/td><\/tr>\r\n            <tr><td>Bellman-Ford<\/td><td>Distance-vector<\/td><td>Iterative, handles negative weights<\/td><\/tr>\r\n            <tr><td>RIP<\/td><td>Distance-vector<\/td><td>Hop count, simple but limited<\/td><\/tr>\r\n            <tr><td>OSPF<\/td><td>Link-state<\/td><td>Most popular, hierarchical<\/td><\/tr>\r\n            <tr><td>BGP<\/td><td>Path-vector<\/td><td>Internet backbone routing<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>Routing Table<\/h3>\r\n        <div class=\"code-block\"><pre>Destination | Netmask       | Gateway    | Interface | Metric\r\n10.0.0.0    | 255.255.255.0 | 0.0.0.0    | eth0      | 0\r\n10.0.1.0    | 255.255.255.0 | 10.0.0.1   | eth0      | 1\r\n192.168.0.0 | 255.255.0.0   | 10.0.0.1   | eth0      | 2<\/pre><\/div>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Apply Dijkstra's algorithm to find shortest path<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 8 -->\r\n    <div class=\"unit\" id=\"unit-8\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 8<\/div>\r\n        <h2>Switching<\/h2>\r\n        <p>Forwarding Frames Within LANs<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>Switching Basics<\/h3>\r\n        <p>Switches forward frames based on MAC addresses. Build MAC address table dynamically.<\/p>\r\n\r\n        <h3>MAC Address Table<\/h3>\r\n        <div class=\"code-block\"><pre>MAC Address        | Port | TTL\r\n00:11:22:33:44:55 | 1    | 300\r\nAA:BB:CC:DD:EE:FF | 3    | 300\r\n11:22:33:44:55:66 | 2    | 300\r\n\r\nSwitch learns addresses by observing source MACs\r\nAges out entries after timeout (usually 5 min)<\/pre><\/div>\r\n\r\n        <h3>Switching Methods<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Method<\/th><th>Latency<\/th><th>Error Detection<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>Cut-through<\/td><td>Low<\/td><td>None<\/td><\/tr>\r\n            <tr><td>Store-and-forward<\/td><td>Higher<\/td><td>CRC check<\/td><\/tr>\r\n            <tr><td>Fragment-free<\/td><td>Medium<\/td><td>Partial check<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>VLAN (Virtual LAN)<\/h3>\r\n        <p>Logically segment network into separate VLANs. Same physical switch, different networks.<\/p>\r\n\r\n        <h3>Spanning Tree Protocol (STP)<\/h3>\r\n        <p>Prevents loops in switched networks. Blocks redundant paths.<\/p>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Trace frame forwarding through multi-switch network<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 9 -->\r\n    <div class=\"unit\" id=\"unit-9\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 9<\/div>\r\n        <h2>Network Security<\/h2>\r\n        <p>Protecting Networks from Threats<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>Security Goals<\/h3>\r\n        <ul>\r\n          <li><strong>Confidentiality:<\/strong> Keep data private<\/li>\r\n          <li><strong>Integrity:<\/strong> Ensure data not modified<\/li>\r\n          <li><strong>Authentication:<\/strong> Verify identity<\/li>\r\n          <li><strong>Non-repudiation:<\/strong> Can't deny sending<\/li>\r\n        <\/ul>\r\n\r\n        <h3>Common Attacks<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Attack<\/th><th>How It Works<\/th><th>Prevention<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>Eavesdropping<\/td><td>Listen to traffic<\/td><td>Encryption (SSL\/TLS)<\/td><\/tr>\r\n            <tr><td>DDoS<\/td><td>Flood server with traffic<\/td><td>Firewalls, Rate limiting<\/td><\/tr>\r\n            <tr><td>Phishing<\/td><td>Fake emails trick users<\/td><td>User education<\/td><\/tr>\r\n            <tr><td>Man-in-the-Middle<\/td><td>Intercept communications<\/td><td>Digital certificates<\/td><\/tr>\r\n            <tr><td>Malware<\/td><td>Malicious software<\/td><td>Antivirus, Firewalls<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>Encryption Methods<\/h3>\r\n        <ul>\r\n          <li><strong>Symmetric:<\/strong> Same key to encrypt\/decrypt (AES, DES)<\/li>\r\n          <li><strong>Asymmetric:<\/strong> Public key to encrypt, private to decrypt (RSA)<\/li>\r\n          <li><strong>Hash:<\/strong> One-way function (MD5, SHA-256)<\/li>\r\n        <\/ul>\r\n\r\n        <h3>Firewalls & VPN<\/h3>\r\n        <ul>\r\n          <li><strong>Firewall:<\/strong> Filters traffic based on rules<\/li>\r\n          <li><strong>VPN:<\/strong> Encrypted tunnel for secure communication<\/li>\r\n          <li><strong>IDS\/IPS:<\/strong> Intrusion detection\/prevention<\/li>\r\n        <\/ul>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Explain how HTTPS secures data transmission<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- UNIT 10 -->\r\n    <div class=\"unit\" id=\"unit-10\">\r\n      <div class=\"unit-header\">\r\n        <div class=\"unit-num-badge\">Unit 10<\/div>\r\n        <h2>Wireless Networks<\/h2>\r\n        <p>WiFi and Mobile Communications<\/p>\r\n      <\/div>\r\n      <div class=\"unit-body\">\r\n\r\n        <h3>Wireless Standards<\/h3>\r\n        <table class=\"data-table\">\r\n          <thead>\r\n            <tr><th>Standard<\/th><th>Frequency<\/th><th>Speed<\/th><th>Range<\/th><\/tr>\r\n          <\/thead>\r\n          <tbody>\r\n            <tr><td>802.11a<\/td><td>5 GHz<\/td><td>54 Mbps<\/td><td>35m<\/td><\/tr>\r\n            <tr><td>802.11b<\/td><td>2.4 GHz<\/td><td>11 Mbps<\/td><td>100m<\/td><\/tr>\r\n            <tr><td>802.11g<\/td><td>2.4 GHz<\/td><td>54 Mbps<\/td><td>100m<\/td><\/tr>\r\n            <tr><td>802.11n (WiFi 4)<\/td><td>2.4\/5 GHz<\/td><td>300 Mbps<\/td><td>150m<\/td><\/tr>\r\n            <tr><td>802.11ac (WiFi 5)<\/td><td>5 GHz<\/td><td>1.3 Gbps<\/td><td>100m<\/td><\/tr>\r\n            <tr><td>802.11ax (WiFi 6)<\/td><td>2.4\/5 GHz<\/td><td>9.6 Gbps<\/td><td>100m<\/td><\/tr>\r\n          <\/tbody>\r\n        <\/table>\r\n\r\n        <h3>WiFi Security<\/h3>\r\n        <ul>\r\n          <li><strong>WEP:<\/strong> Deprecated, easily cracked<\/li>\r\n          <li><strong>WPA:<\/strong> Improved encryption<\/li>\r\n          <li><strong>WPA2\/WPA3:<\/strong> Current standard, AES encryption<\/li>\r\n        <\/ul>\r\n\r\n        <h3>Wireless Channels<\/h3>\r\n        <p>2.4 GHz: 13 channels (1-13), overlapping. Non-overlapping: 1, 6, 11<\/p>\r\n        <p>5 GHz: Many non-overlapping channels for less interference<\/p>\r\n\r\n        <h3>Mobile Networks<\/h3>\r\n        <ul>\r\n          <li><strong>3G:<\/strong> Mobile broadband (WCDMA, CDMA2000)<\/li>\r\n          <li><strong>4G\/LTE:<\/strong> High speed (100+ Mbps)<\/li>\r\n          <li><strong>5G:<\/strong> Ultra high speed, low latency<\/li>\r\n        <\/ul>\r\n\r\n        <div class=\"practice\"><strong>\u270f\ufe0f Practice:<\/strong> Compare WiFi vs cellular networks<\/div>\r\n      <\/div>\r\n    <\/div>\r\n\r\n    <!-- CONGRATS -->\r\n    <div class=\"congrats\">\r\n      <h2>\ud83c\udf89 Congratulations!<\/h2>\r\n      <p>You've completed the Computer Networks course! Master these concepts for networking excellence!<\/p>\r\n    <\/div>\r\n\r\n    <p style=\"text-align: center; color: var(--mid); font-size: .85rem; padding-bottom: 1rem;\">\r\n      \ud83d\udcda Pak Notes Hub \u2014 Computer Networks Complete Notes | University Level | BS CS \/ BS IT<br>\r\n      For corrections and suggestions: support@paknoteshub.com\r\n    <\/p>\r\n  <\/main>\r\n<\/div>\r\n\r\n<button id=\"back-top\" onclick=\"window.scrollTo({top:0,behavior:'smooth'})\">\u2191<\/button>\r\n\r\n<script>\r\n  const progress = document.getElementById('progress');\r\n  window.addEventListener('scroll', () => {\r\n    const scrollPercent = (window.scrollY \/ (document.documentElement.scrollHeight - window.innerHeight)) * 100;\r\n    progress.style.width = scrollPercent + '%';\r\n    document.getElementById('back-top').classList.toggle('visible', window.scrollY > 400);\r\n  });\r\n  \r\n  document.querySelectorAll('.unit').forEach(unit => {\r\n    const observer = new IntersectionObserver(entries => {\r\n      entries.forEach(entry => {\r\n        if(entry.isIntersecting) {\r\n          const id = entry.target.id;\r\n          document.querySelectorAll('.toc-list a').forEach(a => {\r\n            a.classList.toggle('active', a.href.endsWith(id));\r\n          });\r\n        }\r\n      });\r\n    }, { rootMargin: '-20% 0px -70% 0px' });\r\n    observer.observe(unit);\r\n  });\r\n<\/script>\r\n<\/body>\r\n<\/html>\t\t\t\t<\/div>\n\t\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t\t\t<\/div>\n\t\t","protected":false},"excerpt":{"rendered":"<p>Computer Networks \u2013 University Level \u2013 Pak Notes Hub Pak Notes Hub Basics Transport Security \ud83c\udf10 University Level \u2014 BS CS \/ BS IT Computer NetworksComplete Notes OSI Model \u00b7 TCP\/IP \u00b7 Routing \u00b7 Switching \u00b7 DNS \u00b7 Security \u00b7 All in Easy English OSI Model Protocols Network Security \ud83d\udcda Table of Contents 1 Basics [&hellip;]<\/p>\n","protected":false},"author":1,"featured_media":0,"parent":0,"menu_order":0,"comment_status":"closed","ping_status":"closed","template":"","meta":{"_angie_page":false,"footnotes":""},"class_list":["post-514","page","type-page","status-publish","hentry"],"_hostinger_reach_plugin_has_subscription_block":false,"_hostinger_reach_plugin_is_elementor":false,"_links":{"self":[{"href":"https:\/\/paknoteshub.online\/index.php?rest_route=\/wp\/v2\/pages\/514","targetHints":{"allow":["GET"]}}],"collection":[{"href":"https:\/\/paknoteshub.online\/index.php?rest_route=\/wp\/v2\/pages"}],"about":[{"href":"https:\/\/paknoteshub.online\/index.php?rest_route=\/wp\/v2\/types\/page"}],"author":[{"embeddable":true,"href":"https:\/\/paknoteshub.online\/index.php?rest_route=\/wp\/v2\/users\/1"}],"replies":[{"embeddable":true,"href":"https:\/\/paknoteshub.online\/index.php?rest_route=%2Fwp%2Fv2%2Fcomments&post=514"}],"version-history":[{"count":4,"href":"https:\/\/paknoteshub.online\/index.php?rest_route=\/wp\/v2\/pages\/514\/revisions"}],"predecessor-version":[{"id":518,"href":"https:\/\/paknoteshub.online\/index.php?rest_route=\/wp\/v2\/pages\/514\/revisions\/518"}],"wp:attachment":[{"href":"https:\/\/paknoteshub.online\/index.php?rest_route=%2Fwp%2Fv2%2Fmedia&parent=514"}],"curies":[{"name":"wp","href":"https:\/\/api.w.org\/{rel}","templated":true}]}}