Computer Networks Lab:

Computer Networks ki lab mein har practical ek step-by-step method se karna aasan hota hai: devices lo, bottom to top connect karo, IP do, phir routing lagao. Is post mein Cisco Packet Tracer ke 8 practicals hain, sab GUI se (CLI ki zaroorat nahi). Har practical mein pehle chhoti theory, phir steps, phir viva points.
Common Setup (har practical ke liye)
- Devices: Router 1841, Switch 2960-24TT, PC-PT, Hub-PT.
- Cables: Copper Straight-Through (solid line), Copper Cross-Over (dashed line).
- Connection rule: Bottom to top. Pehle PC0 click karke switch se jodo, phir PC1, phir switch ko router se.
- PC ka IP: PC click → Desktop → IP Configuration → IP Address, Subnet Mask, Default Gateway.
- Router ka IP: Router click → Config → INTERFACE → FastEthernet0/0 → Port Status ON → IP Address aur Subnet Mask. Doosre interface pe same.
- Routing: Router → Config → ROUTING → Static (ya RIP).
- Check: Wire ke dono end pe green triangle aaye to link up hai. Message ke liye Add Simple PDU (envelope) ya PC ke Command Prompt mein
ping.
Naming: Is post mein 2 router wale labs mein routers ka naam Router0 aur Router1 hai, jaisa Packet Tracer khud deta hai.
Practical 1: Basic Working of Hub, Switch and Router
Theory
| Hub | Switch | Router | |
|---|---|---|---|
| OSI Layer | Layer 1 (Physical) | Layer 2 (Data Link) | Layer 3 (Network) |
| Kaam | Data sab ports pe bhej deta hai | MAC table dekh ke sirf sahi port pe bhejta hai | IP address dekh ke alag networks ke beech path chunta hai |
| Address | Koi nahi | MAC address | IP address |
| Collision domain | Poora hub ek | Har port alag | Har port alag |
| Broadcast domain | Ek | Ek (VLAN ke bina) | Har interface alag |
| Duplex | Half | Full | Full |
Yaad rakhne ka trick: Hub = sabko bol do. Switch = sirf us bande ko bolo. Router = doosre mohalle ka raasta batao.
Part A: Hub
Step 1: 1 Hub-PT (Network Devices → Hubs) aur 4 PC lo.
Step 2: Bottom to top: PC0, PC1, PC2, PC3 → Hub (Straight-Through).
Step 3: IP do, sab ek hi network mein.
| PC | IP Address | Subnet Mask |
|---|---|---|
| PC0 | 192.168.1.2 | 255.255.255.0 |
| PC1 | 192.168.1.3 | 255.255.255.0 |
| PC2 | 192.168.1.4 | 255.255.255.0 |
| PC3 | 192.168.1.5 | 255.255.255.0 |
Step 4: Neeche right corner se Simulation mode on karo. Add Simple PDU se PC0 se PC3 ko message bhejo aur Capture/Forward dabate jao.
Observation: Hub ne packet PC1, PC2 aur PC3 teeno ko bhej diya. PC1 aur PC2 ne use drop kar diya, sirf PC3 ne reply diya. Ye hub ka broadcast behaviour hai.
Part B: Switch
Step 1: Hub hata ke 1 Switch (2960-24TT) lo.
Step 2: Wahi connection: PC0 se PC3 → Switch.
Step 3: IP wahi rakho jo Part A mein diye.
Step 4: Simulation mode mein PC0 se PC3 ko message bhejo.
Observation:
- Pehli baar: PC0 ne ARP request bheji. Switch ko PC3 ka MAC pata nahi tha, to usne sab ports pe flood kiya. Reply aate hi switch ne MAC table bana li.
- Dobara bhejo: ab packet sirf PC3 ke port pe gaya.
Part C: Router
Step 1: 1 Router (1841), 2 Switch (2960-24TT) aur 4 PC lo.
Step 2: PC0, PC1 → Switch0 → Router Fa0/0. PC2, PC3 → Switch1 → Router Fa0/1.
Step 3a: PC ka IP
| PC | IP Address | Subnet Mask | Default Gateway |
|---|---|---|---|
| PC0 | 192.168.1.2 | 255.255.255.0 | 192.168.1.1 |
| PC1 | 192.168.1.3 | 255.255.255.0 | 192.168.1.1 |
| PC2 | 192.168.2.2 | 255.255.255.0 | 192.168.2.1 |
| PC3 | 192.168.2.3 | 255.255.255.0 | 192.168.2.1 |
Step 3b: Router ka IP
- Router click → Config → FastEthernet0/0 → Port Status ON → IP 192.168.1.1, Mask 255.255.255.0.
- FastEthernet0/1 → Port Status ON → IP 192.168.2.1, Mask 255.255.255.0.
Step 4: PC0 se PC2 ko message bhejo, Successful aayega. Ab PC0 ka Default Gateway hata ke dobara bhejo, Failed aayega. Isse samajh aata hai ki router alag networks ko jodta hai aur gateway kyun zaroori hai.
Viva points
- Hub kaun si layer pe kaam karta hai? Layer 1.
- Switch MAC table kaise banata hai? Source MAC address seekh ke.
- Router kyun chahiye? Alag networks ke beech communication ke liye.
Practical 2: IP Addressing Basics
Theory
- IP address: Network pe har device ki unique pehchaan. IPv4 mein 32 bit hote hain, 4 octets mein likhe jaate hain (jaise 192.168.1.2), har octet 0 se 255.
- Subnet mask: Batata hai ki IP ka kitna hissa network ka hai aur kitna host ka.
IP Classes
| Class | Pehla octet | Default Mask | Prefix | Network / Host bits | Use |
|---|---|---|---|---|---|
| A | 1 se 126 | 255.0.0.0 | /8 | 8 / 24 | Bade networks |
| B | 128 se 191 | 255.255.0.0 | /16 | 16 / 16 | Medium networks |
| C | 192 se 223 | 255.255.255.0 | /24 | 24 / 8 | Chhote networks |
| D | 224 se 239 | - | - | - | Multicast |
| E | 240 se 255 | - | - | - | Research |
127.x.x.x loopback ke liye reserved hai (127.0.0.1 = apna hi system).
Private IP ranges
| Class | Range |
|---|---|
| A | 10.0.0.0 se 10.255.255.255 |
| B | 172.16.0.0 se 172.31.255.255 |
| C | 192.168.0.0 se 192.168.255.255 |
Important terms
- Network address: Host bits sab 0 (jaise 192.168.1.0). Ye kisi device ko nahi diya jaata.
- Broadcast address: Host bits sab 1 (jaise 192.168.1.255).
- Usable hosts: 2^n minus 2, jahan n = host bits. Class C mein 2^8 minus 2 = 254.
- Default gateway: Apne network mein router ka IP. Doosre network ka message isi se bahar jaata hai.
Example: IP 192.168.1.2, mask 255.255.255.0 → Class C, Network 192.168.1.0, Broadcast 192.168.1.255, Hosts 192.168.1.1 se 192.168.1.254.
Practical Steps
Step 1: 1 Switch (2960-24TT) aur 4 PC lo.
Step 2: Bottom to top: PC0, PC1, PC2, PC3 → Switch.
Step 3a: Same network ka IP do.
- PC click → Desktop → IP Configuration.
- PC0 = 192.168.1.2, PC1 = 192.168.1.3, PC2 = 192.168.1.4, PC3 = 192.168.1.5.
- Subnet mask sab pe 255.255.255.0.
PC0 se PC3 ko ping karo, Successful aayega.
Step 3b: PC3 ka IP badal ke 192.168.2.5 kar do. PC0 se ping karo, Failed aayega.
Result: Same network ke devices bina router ke baat kar sakte hain. Alag network ke liye router chahiye.
Step 4 (Class A aur B): Sab PC ko 10.0.0.2, 10.0.0.3 ... (mask 255.0.0.0) do, ping karo. Phir 172.16.0.2, 172.16.0.3 ... (mask 255.255.0.0) do, ping karo. Same class aur same network ho to kaam karta hai.
Viva points
- IPv4 mein kitne bit? 32.
- Class B ka default mask? 255.255.0.0.
- Private IP kya hai? Wo IP jo internet pe route nahi hote, sirf LAN mein use hote hain.
Practical 3: Creation of Cross and Straight Cables
Theory
- UTP cable: 4 twisted pair (8 wires). Cat5e ya Cat6, connector RJ45, maximum length 100 meter.
- Straight-Through: Dono taraf same colour order (T568B).
- Cross-Over: Ek taraf T568B, doosri taraf T568A.
Colour codes
| Pin | T568B | T568A |
|---|---|---|
| 1 | White-Orange | White-Green |
| 2 | Orange | Green |
| 3 | White-Green | White-Orange |
| 4 | Blue | Blue |
| 5 | White-Blue | White-Blue |
| 6 | Green | Orange |
| 7 | White-Brown | White-Brown |
| 8 | Brown | Brown |
Cross mein pin 1, 2 aur pin 3, 6 aapas mein swap hote hain.
Kahan kaunsi cable
| Straight-Through (alag type ke device) | Cross-Over (same type ke device) |
|---|---|
| PC se Switch | PC se PC |
| PC se Hub | Switch se Switch |
| Router se Switch | Router se Router |
| Router se Hub | PC se Router |
| Hub se Switch |
Aajkal ke devices mein Auto MDI-X hota hai, to kai baar galat cable bhi chal jaati hai. Exam ke liye upar wali table hi yaad rakho.
Cable banane ka procedure (hardware)
Saman: UTP cable, 2 RJ45 connector, crimping tool, cable tester.
- Cable ke ek end se lagbhag 1.5 inch bahar ka cover strip karo, andar ke wires ko nuksan na pahunche.
- 4 twisted pair ko kholo aur 8 wires seedhe karo.
- Wires ko T568B colour order mein line se lagao.
- Barabar kaat do, lagbhag 1.2 cm bahar rahe.
- Wires ko RJ45 mein dalo (clip neeche, pin upar). Har wire connector ke end tak pahunchni chahiye.
- Crimping tool mein rakh ke dabao.
- Doosre end pe Straight ke liye T568B dohrao, Cross ke liye T568A lagao.
- Cable tester mein test karo. Straight mein LED 1 se 8 ek hi order mein jalengi. Cross mein 1-3, 2-6, 3-1, 6-2 order mein.
Packet Tracer practical
Step 1: 2 PC aur 1 Switch lo.
Step 2: Connections:
- PC0 → Switch: Copper Straight-Through
- PC0 → PC1: Copper Cross-Over (dashed)
Step 3: IP do: PC0 = 192.168.1.2, PC1 = 192.168.1.3, mask 255.255.255.0.
Step 4: PC0 se PC1 ko message bhejo. Cross-Over se successful aayega. PC to PC ko Straight se jodoge to link red rahegi aur message fail hoga.
Viva points
- Straight aur cross mein fark? Wire ka order.
- Cross cable kab? Same type devices ke liye.
- Crimping tool kyun? RJ45 ko cable pe fix karne ke liye.
Practical 4: Topologies (Bus, Star, Ring, Mesh, Tree, Hybrid)
Theory
| Topology | Kaise juda hota hai | Fayda | Nuksan |
|---|---|---|---|
| Bus | Ek main cable (backbone) se sab | Sasta, aasan | Cable kharab to poora network band |
| Star | Sab ek central device se | Fault dhundna aasan | Central device kharab to sab band |
| Ring | Har device apne 2 padosi se | Data order mein jaata hai | Ek link tootne se poora ring prabhavit |
| Mesh | Har device dusre har device se | Sabse reliable | Bahut cables, mehenga |
| Tree | Star topologies ko ek root se jodna | Scalable | Root kharab to bada hissa band |
| Hybrid | Do ya zyada topology ka mix | Flexible | Complex, mehenga |
Mesh formula: Full mesh mein links = n(n-1)/2, har device pe ports = n-1. 4 device = 6 links, har device pe 3 ports.
Bus
- 3 Hub aur 3 PC lo.
- Hubs ko ek line mein Cross-Over se jodo: Hub0 — Hub1 — Hub2 (ye backbone hai).
- PC0 → Hub0, PC1 → Hub1, PC2 → Hub2 (Straight-Through).
- IP: 192.168.1.2, .3, .4 (mask 255.255.255.0). PC0 se PC2 ko ping karo.
Asli bus mein coaxial cable hoti hai. Packet Tracer mein hubs ki line se bus ka kaam dikhaya jaata hai.
Star
- 1 Switch aur 4 PC lo.
- Har PC ko Straight-Through se Switch ke alag port se jodo.
- IP: 192.168.1.2 se 192.168.1.5. Ping karke check karo.
Ring
- 4 Switch aur 4 PC lo (har switch pe 1 PC).
- PC ko apne switch se jodo (Straight). Switches ko Cross-Over se gol shape mein jodo: S0 — S1 — S2 — S3 — S0.
- IP: 192.168.1.2 se 192.168.1.5.
- Ping karo. Ek link kuch der amber rahega kyunki switch loop rokne ke liye (STP) ek port block kar deta hai. Thodi der baad green ho jaata hai.
Mesh
- 4 Switch aur 4 PC lo. PC ko apne switch se jodo (Straight).
- Har switch ko baaki sab switches se Cross-Over se jodo, total 6 links: S0-S1, S0-S2, S0-S3, S1-S2, S1-S3, S2-S3.
- IP: 192.168.1.2 se 192.168.1.5. Ping karo. Koi ek link hata ke bhi ping chalega, yehi mesh ka fayda hai.
Tree
- 3 Switch aur 4 PC lo.
- Switch0 root hai. Switch0 → Switch1 aur Switch0 → Switch2 (Cross-Over).
- PC0, PC1 → Switch1. PC2, PC3 → Switch2 (Straight).
- IP: 192.168.1.2 se 192.168.1.5. Ping se check karo.
Hybrid (Star + Ring)
- 4 Switch aur 6 PC lo.
- Switch0, Switch1, Switch2 ko ring mein jodo (Cross-Over). Switch3 ko Switch0 se jodo.
- PC0, PC1 → Switch0. PC2 → Switch1. PC3 → Switch2. PC4, PC5 → Switch3.
- IP: 192.168.1.2 se 192.168.1.7. Kisi bhi PC se kisi bhi PC ko message bhejo.
Viva points
- Sabse reliable topology? Mesh.
- Sabse sasti? Bus.
- Star ka single point of failure? Central switch ya hub.
Practical 5: Static Routing using Classful Addressing
Theory
- Static routing: Admin har router mein route manually likhta hai. Router khud kuch seekhta nahi.
- Classful addressing: IP ka default class mask hi use hota hai (Class C = 255.255.255.0), koi subnetting nahi. Isliye har network ka IP same class ka rakhte hain.
- Fayda: Simple, router pe load kam, secure. Nuksan: Network badhe to har route haath se likhna padta hai, link tootne par khud nahi badalta.
- Rule: Router ko sirf apne directly connected networks pata hote hain. Doosre network ke liye static route chahiye.
Topology: 2 Router, 2 Switch, 4 PC
.
Step 1: 2 Router (1841), 2 Switch (2960-24TT) aur 4 PC lo.
Step 2: Bottom to top: PC0, PC1 → Switch0 → Router0. PC2, PC3 → Switch1 → Router1. Phir Router0 aur Router1 ko Cross-Over (dashed) se jodo.
Step 3: Har alag network ka IP do, teeno Class C.
| Network | Device | IP Address | Mask |
|---|---|---|---|
| Network 1 | PC0 | 192.168.1.2 | 255.255.255.0 |
| PC1 | 192.168.1.3 | 255.255.255.0 | |
| Router0 Fa0/0 | 192.168.1.4 | 255.255.255.0 | |
| Network 2 | PC2 | 192.168.2.2 | 255.255.255.0 |
| PC3 | 192.168.2.3 | 255.255.255.0 | |
| Router1 Fa0/0 | 192.168.2.4 | 255.255.255.0 | |
| Network 3 | Router0 Fa0/1 | 192.168.3.2 | 255.255.255.0 |
| Router1 Fa0/1 | 192.168.3.3 | 255.255.255.0 |
Step 3a: PC ka IP
- PC pe click → Desktop → IP Configuration.
- IP address, mask aur default gateway bharo. Gateway = apne router ka IP: PC0, PC1 ke liye 192.168.1.4. PC2, PC3 ke liye 192.168.2.4.
Step 3b: Router ka IP
- Router click → connected wire pe hover karke dekho ki Fa0/0 hai ya Fa0/1.
- Config → FastEthernet0/0: Port Status ON, IP aur Subnet Mask.
- FastEthernet0/1: Port Status ON, IP aur Subnet Mask.
Ab sirf apne network ke andar message jayega. Doosre network ke liye static route chahiye.
Step 5: Router0 pe static route
- Router0 click → Config → ROUTING → Static.
- Network: 192.168.2.0 (doosre network ka address, last digit 0)
- Mask: 255.255.255.0
- Next Hop: 192.168.3.3 (agle router ka IP)
- Add dabao.
Step 6: Router1 pe static route
- Router1 click → Config → ROUTING → Static.
- Network: 192.168.1.0
- Mask: 255.255.255.0
- Next Hop: 192.168.3.2
- Add dabao.
PC0 se PC3 ko message bhejo, Successful aana chahiye.
3 Router, 3 Switch, 6 PC version
Router0 → Router1 → Router2 ki chain banti hai, to beech wale Router1 mein 2 router-links ke liye extra port chahiye: router off karo, WIC-1T drag karo, router on karo.
Networks: PC0, PC1 = 192.168.1.0. PC2, PC3 = 192.168.2.0. PC4, PC5 = 192.168.3.0. Router0–Router1 link = 192.168.4.0. Router1–Router2 link = 192.168.5.0.
| Router | Network | Mask | Next Hop |
|---|---|---|---|
| Router0 | 192.168.2.0 | 255.255.255.0 | 192.168.4.3 |
| Router0 | 192.168.5.0 | 255.255.255.0 | 192.168.4.3 |
| Router0 | 192.168.3.0 | 255.255.255.0 | 192.168.4.3 |
| Router1 | 192.168.1.0 | 255.255.255.0 | 192.168.4.2 |
| Router1 | 192.168.3.0 | 255.255.255.0 | 192.168.5.3 |
| Router2 | 192.168.1.0 | 255.255.255.0 | 192.168.5.2 |
| Router2 | 192.168.4.0 | 255.255.255.0 | 192.168.5.2 |
| Router2 | 192.168.2.0 | 255.255.255.0 | 192.168.5.2 |
Router1 ke do sides ke IP: 192.168.4.3 (Router0 ki taraf) aur 192.168.5.2 (Router2 ki taraf). Router0 ka link IP 192.168.4.2, Router2 ka 192.168.5.3.
Viva points
- Static routing kab? Chhote aur fixed networks mein.
- Next hop kya hai? Agla router jahan packet bhejna hai.
- Network ID mein last digit 0 kyun? Route poore network ka hota hai, ek host ka nahi.
Practical 6: Dynamic Routing using Classful Addressing (RIP)
Theory
- Dynamic routing: Routers routing protocol se ek doosre ke routes khud seekhte hain.
- RIP (Routing Information Protocol): Distance vector protocol.
| Point | RIP |
|---|---|
| Metric | Hop count |
| Maximum hop | 15 (16 = unreachable) |
| Update time | Har 30 second mein poori routing table |
| Administrative Distance | 120 |
| Port | UDP 520 |
| RIPv1 | Classful, update mein mask nahi, broadcast |
| RIPv2 | Classless, mask bhejta hai, multicast 224.0.0.9 |
Yahan classful /24 networks hain, to RIP ka default version 1 kaam karta hai.
- Fayda: Config aasan, network badalne par khud update hota hai. Nuksan: Bade network mein slow, 15 hop limit.
- Rule: RIP mein sirf apne directly connected networks add karte hain.
Topology: 2 Router, 2 Switch, 4 PC
Step 1 se 3b bilkul Practical 5 jaise hain: same topology, same IP table, PC ka IP aur gateway, router ke interfaces (Port Status ON).
Step 5: Router0
- Router0 click → Config → ROUTING → RIP.
- Directly connected networks add karo: 192.168.1.0 aur 192.168.3.0. Har ek ke baad Add.
Step 6: Router1
- Router1 click → Config → ROUTING → RIP.
- Add karo: 192.168.2.0 aur 192.168.3.0.
Static mein doosre network ka address aur next hop dete the. RIP mein apne connected networks add karte hain, baaki router khud seekh leta hai.
30 second ruko taaki routers routes seekh lein, phir PC0 se PC3 ko message bhejo. Pehla message ARP ki wajah se kabhi fail ho sakta hai, dobara bhejo.
3 Router, 3 Switch, 6 PC version
Same IP table jo Practical 5 ke 3 router version mein hai.
| Router | RIP mein add karne wale networks |
|---|---|
| Router0 | 192.168.1.0, 192.168.4.0 |
| Router1 | 192.168.2.0, 192.168.4.0, 192.168.5.0 |
| Router2 | 192.168.3.0, 192.168.5.0 |
Static vs Dynamic
| Static | Dynamic (RIP) | |
|---|---|---|
| Route kaun likhta hai | Admin | Router khud seekhta hai |
| Config | Har doosre network ka entry | Sirf connected networks |
| Link tootne pe | Khud nahi badalta | Khud update hota hai |
| Bandwidth | Koi nahi | Updates mein lagta hai |
| Best for | Chhota network | Medium network |
Viva points
- RIP ka metric? Hop count.
- Max hop? 15.
- RIPv1 aur v2 mein fark? v1 classful, v2 classless.
Practical 7: Static Routing using Classless Addressing (FLSM)
Theory
- Classless addressing: Class ki restriction nahi. Mask kuch bhi ho sakta hai (/26, /27 ...). Ek bade network ko chhote hisson (subnets) mein baantna subnetting hai.
- FLSM (Fixed Length Subnet Mask): Saare subnets ka mask aur size same.
- Nuksan: Router-to-router link ko bhi poora block milta hai (/26 mein 62 hosts), jabki sirf 2 chahiye. Address waste hote hain. Ise VLSM solve karta hai (Practical 8).
Subnetting kaise karein
- Kitne subnet chahiye? 3 (2 LAN + 1 link). 2^n barabar ya bada 3 se, to n = 2 bits borrow karo.
- Class C /24 mein 2 bit borrow karne se mask /26 = 255.255.255.192.
- Block size = 256 minus 192 = 64.
- Har subnet mein hosts = 2^6 minus 2 = 62.
Subnet table: 192.168.10.0/26
| Subnet | Network ID | Usable host range | Broadcast |
|---|---|---|---|
| 1 | 192.168.10.0 | .1 se .62 | 192.168.10.63 |
| 2 | 192.168.10.64 | .65 se .126 | 192.168.10.127 |
| 3 | 192.168.10.128 | .129 se .190 | 192.168.10.191 |
| 4 | 192.168.10.192 | .193 se .254 | 192.168.10.255 |
Pehle 3 subnet use honge, chautha khali rahega.
Topology: 2 Router, 2 Switch, 4 PC
Step 1: 2 Router (1841), 2 Switch (2960-24TT) aur 4 PC lo.
Step 2: Bottom to top: PC0, PC1 → Switch0 → Router0. PC2, PC3 → Switch1 → Router1. Router0 aur Router1 ko Cross-Over (dashed) se jodo.
Step 3: Har network ko alag subnet, teeno ka mask 255.255.255.192.
| Network | Device | IP Address | Mask |
|---|---|---|---|
| Network 1 (192.168.10.0/26) | PC0 | 192.168.10.2 | 255.255.255.192 |
| PC1 | 192.168.10.3 | 255.255.255.192 | |
| Router0 Fa0/0 | 192.168.10.1 | 255.255.255.192 | |
| Network 2 (192.168.10.64/26) | PC2 | 192.168.10.66 | 255.255.255.192 |
| PC3 | 192.168.10.67 | 255.255.255.192 | |
| Router1 Fa0/0 | 192.168.10.65 | 255.255.255.192 | |
| Network 3 (192.168.10.128/26) | Router0 Fa0/1 | 192.168.10.129 | 255.255.255.192 |
| Router1 Fa0/1 | 192.168.10.130 | 255.255.255.192 |
Step 3a: PC ka IP
- PC click → Desktop → IP Configuration.
- IP address bharo.
- Subnet Mask khud badlo. Packet Tracer 192.168.x.x pe apne aap 255.255.255.0 bhar deta hai. Use 255.255.255.192 karna zaroori hai.
- Default gateway: PC0, PC1 ke liye 192.168.10.1. PC2, PC3 ke liye 192.168.10.65.
Step 3b: Router ka IP
- Router click → Config → FastEthernet0/0 → Port Status ON → IP aur mask 255.255.255.192.
- FastEthernet0/1 ke liye same. (Yahan bhi default mask khud badalna padega.)
Step 5: Router0 pe static route
- Router0 → Config → ROUTING → Static.
- Network: 192.168.10.64
- Mask: 255.255.255.192
- Next Hop: 192.168.10.130
- Add.
Step 6: Router1 pe static route
- Router1 → Config → ROUTING → Static.
- Network: 192.168.10.0
- Mask: 255.255.255.192
- Next Hop: 192.168.10.129
- Add.
PC0 se PC3 ko message bhejo, Successful aana chahiye.
Mask kyu badla?
Router aur PC check karte hain: IP AND mask = Network ID.
- 192.168.10.2 AND 255.255.255.192 = 192.168.10.0
- 192.168.10.66 AND 255.255.255.192 = 192.168.10.64
Network ID alag hai, to PC samajhta hai ki ye doosre network mein hai aur gateway ko bhejta hai. Mask /24 rehta to dono ek hi network lagte aur ping fail ho jati.
Practical 5 se fark: Wahan last digit 0 karte the aur mask 255.255.255.0 tha. Yahan Network ID block ka start hota hai (0, 64, 128, 192) aur mask 255.255.255.192.
Common galtiyan
- PC ya router pe mask 255.255.255.0 reh gaya.
- Gateway doosre subnet ka daal diya.
- Network ID ki jagah host IP likh diya.
Viva points
- FLSM kya hai? Sab subnets ka mask barabar.
- 255.255.255.192 ka prefix? /26.
- FLSM ka nuksan? IP waste hote hain.
Practical 8: Static Routing using Classless Addressing (VLSM)
Theory
- VLSM (Variable Length Subnet Mask): Har subnet ko uski zaroorat ke hisaab se alag size ka mask milta hai, to IP waste nahi hote.
- Rule: Sabse bade requirement wale subnet ko pehle allocate karo, phir chhote ko.
Cheat table
| Prefix | Mask | Block size | Usable hosts |
|---|---|---|---|
| /24 | 255.255.255.0 | 256 | 254 |
| /25 | 255.255.255.128 | 128 | 126 |
| /26 | 255.255.255.192 | 64 | 62 |
| /27 | 255.255.255.224 | 32 | 30 |
| /28 | 255.255.255.240 | 16 | 14 |
| /29 | 255.255.255.248 | 8 | 6 |
| /30 | 255.255.255.252 | 4 | 2 |
Problem
Base network 192.168.20.0/24. Zaroorat: LAN1 = 50 hosts, LAN2 = 20 hosts, router-to-router link = 2 hosts.
Subnetting (bade se chhota)
| Network | Zaroorat | Block | Mask | Network ID | Usable range | Broadcast |
|---|---|---|---|---|---|---|
| LAN1 | 50 hosts | 64 (/26) | 255.255.255.192 | 192.168.20.0 | .1 se .62 | 192.168.20.63 |
| LAN2 | 20 hosts | 32 (/27) | 255.255.255.224 | 192.168.20.64 | .65 se .94 | 192.168.20.95 |
| Link | 2 hosts | 4 (/30) | 255.255.255.252 | 192.168.20.96 | .97 se .98 | 192.168.20.99 |
LAN2 LAN1 ke broadcast (.63) ke theek baad .64 se shuru hota hai. Link .96 se, kyunki LAN2 .95 pe khatam hua. 192.168.20.100 se aage ka hissa future ke liye bacha hai.
Topology: 2 Router, 2 Switch, 4 PC
Step 1: 2 Router (1841), 2 Switch (2960-24TT) aur 4 PC lo.
Step 2: Bottom to top: PC0, PC1 → Switch0 → Router0. PC2, PC3 → Switch1 → Router1. Router0 aur Router1 ko Cross-Over (dashed) se jodo.
Step 3: Har network ka mask alag.
| Network | Device | IP Address | Mask | Gateway |
|---|---|---|---|---|
| LAN1 | PC0 | 192.168.20.2 | 255.255.255.192 | 192.168.20.1 |
| PC1 | 192.168.20.3 | 255.255.255.192 | 192.168.20.1 | |
| Router0 Fa0/0 | 192.168.20.1 | 255.255.255.192 | - | |
| LAN2 | PC2 | 192.168.20.66 | 255.255.255.224 | 192.168.20.65 |
| PC3 | 192.168.20.67 | 255.255.255.224 | 192.168.20.65 | |
| Router1 Fa0/0 | 192.168.20.65 | 255.255.255.224 | - | |
| Link | Router0 Fa0/1 | 192.168.20.97 | 255.255.255.252 | - |
| Router1 Fa0/1 | 192.168.20.98 | 255.255.255.252 | - |
Step 3a: PC ka IP
- PC click → Desktop → IP Configuration.
- IP, subnet mask (khud badlo, default mat chhodo) aur gateway bharo.
- PC0, PC1 mask 255.255.255.192. PC2, PC3 mask 255.255.255.224.
Step 3b: Router ka IP
- Router0 → Config → Fa0/0 → Port Status ON → 192.168.20.1, mask 255.255.255.192.
- Router0 → Fa0/1 → Port Status ON → 192.168.20.97, mask 255.255.255.252.
- Router1 → Fa0/0 → Port Status ON → 192.168.20.65, mask 255.255.255.224.
- Router1 → Fa0/1 → Port Status ON → 192.168.20.98, mask 255.255.255.252.
Step 5: Router0 pe static route
- Router0 → Config → ROUTING → Static.
- Network: 192.168.20.64 (LAN2), Mask: 255.255.255.224, Next Hop: 192.168.20.98.
- Add.
Step 6: Router1 pe static route
- Router1 → Config → ROUTING → Static.
- Network: 192.168.20.0 (LAN1), Mask: 255.255.255.192, Next Hop: 192.168.20.97.
- Add.
PC0 se PC3 ko message bhejo, Successful aana chahiye. Fail ho to sabse pehle mask check karo.
FLSM vs VLSM
| FLSM | VLSM | |
|---|---|---|
| Mask | Sab subnets ka same | Har subnet ka alag |
| IP waste | Zyada | Kam |
| Link ke liye | /26 (62 host, chahiye sirf 2) | /30 (2 host) |
| Planning | Aasan | Thodi mushkil |
| Routing | Classless | Classless |
Viva points
- VLSM kya hai? Alag alag size ke subnet.
- Allocation order? Bade se chhota.
- Point-to-point link ke liye mask? /30.
Quick Revision
| Practical | Topic | Yaad rakhne wali baat |
|---|---|---|
| 1 | Hub, Switch, Router | Layer 1, 2, 3. Hub broadcast, switch MAC, router IP |
| 2 | IP addressing | Class A/B/C, hosts = 2^n minus 2 |
| 3 | Cables | Same device = Cross, different device = Straight |
| 4 | Topologies | Mesh links = n(n-1)/2 |
| 5 | Static classful | Network last digit 0, mask 255.255.255.0, next hop |
| 6 | RIP classful | Sirf connected networks add karo |
| 7 | Static FLSM | Same mask /26, Network ID block ke hisaab se |
| 8 | Static VLSM | Bade se chhota allocate, link /30 |
Koi step atke to comment mein batao. Agar notes kaam aaye to share karna! 🙌
Comments
Join the discussionThese notes are really helpful

