Switches

Switches intelligent devices होते है। Switches को intelligent इसलिए माना जाता है क्योंकि switches में memory होती है जिससे switches hardware address tables maintain करते है। इन tables में सभी hosts का address store होता है और साथ ही कौनसा host किस port के माध्यम से switch से जुड़ा हुआ है ये भी store रहता है।
एक switch LAN के अंतर्गत hosts को आपस में connect करने के लिए यूज़ किया जाता है। Switch से आप 2 networks को आपस में connect नहीं कर सकते है। अलग अलग networks को आपस में connect करने के लिए router का यूज़ किया जाता है।

एक switch की hardware address table इस प्रकार हो सकती है-

Working Of Switch :- जब भी कोई host किसी दूसरे host को कोई frame send करता है तो source host का MAC address switch की address table में port के साथ store हो जाता है। एक switch हमेशा source का address ही table में store करता है। मेरा मतलब जब तक की कोई host कुछ data send नहीं करेगा तब तक उसका MAC address और port number switch की table में store नहीं होगा।
जब आप शुरू में switch को setup करते है तो switch को किसी भी host और उसके address की कोई जानकारी नहीं होती है। ऐसी situation में जब कोई host frame send करता है तो उसका MAC address तो table में store हो जाता है लेकिन destination की कोई भी जानकारी नहीं होने की वजह से switch उस frame को सभी hosts को send कर देता है।
ऐसे ही जब दूसरा host कुछ data send करता है तो उसका address भी table में store हो जाता है। ऐसे जब भी कोई host frames भेजता है और यदि उसका address पहले से table में मौजूद नहीं है तो switch उसे store कर लेता है। इस प्रकार एक switch अपनी table build करता है।
जब सभी hosts के addresses और port numbers switch में आ जाते है तो switch बिना सभी hosts को frame भेजे केवल जिस host के लिए data भेजा गया है उसी host को deliver करता है।

Hubs एक half duplex communication करते है। Hubs के साथ या तो आप send कर सकते है या केवल receive कर सकते है। लेकिन switches के साथ ऐसा नहीं है switches के साथ आप एक साथ data send भी कर सकते है और receive भी कर सकते है।
Hubs एक single collision domain को represent करते है लेकिन स्विच में हर port एक separate collision domain होता है। इससे दूसरे hosts पर कोई फर्क नहीं पड़ता है।

Layer 2 Switching :- hubs intelligent devices नहीं होते है। जब भी कोई hub एक frame receive करता है तो वह frame को सभी ports में broadcast कर देता है। साथ ही hub एक single collision domain को represent करते है यानी जब कोई भी 2 hosts एक साथ frames send करते है तो collision होता है। Hubs की इन्हीं limitations की वजह से network में broadcast storm जैसी समस्याएँ आती है।
Hubs की limitations को overcome करने के लिए bridges का निर्माण किया गया। Bridges hubs से better होते है। Bridges 2 local area networks को आपस में जोड़ने के लिए use किये जाते है। यदि आप अपने local area network को और अधिक फैलाना चाहते है तो ऐसा आप bridges के माध्यम से कर सकते है। एक bridge single collision domain को 2 collision domains में divide कर देता है। Bridges frames को forward करने के लिए MAC address use करते है। लेकिन क्योंकि bridges में केवल 2 ही port होते है इसलिए bridges भी एक reliable और scalable network provide करने में सक्षम नहीं थे।
:- Hubs और bridges की limitations को overcome करने के लिए switches को use किया जाता है। एक switch का हर port single collision domain होता है। इसलिए एक switch multiple collision domains और single broadcast domain को represent करता है। Switches intelligent device होते है।
Layer 2 switching में destination को determine करने के लिए switches MAC (Media Access Control) addresses की table को use करते है। इस table को CAM table भी कहा जाता है। MAC address हर host के NIC (Network Interface Card) पर manufacturer द्वारा hardcode किया जाता है। Layer 2 switches MAC addresses की table build और maintain करने के लिए Application Specific Integrated Circuits (ASIC) use किये जाते है।

Functions of Switches :- Layer 2 पर switches 3 important functions perform करते है।

  1. Hardware Address Learning
  2. Forwarding of Frames
  3. Loop Avoidance

Hardware Address Learning :- जब switch को पहली बार on किया जाता है तो CAM table खाली होती है। जब कोई host frame send करता है तो switch frame के source address को CAM table में store कर लेता है। क्योंकि इस समय switch को destination host का ज्ञान नहीं है इसलिए switch इस frame को source port के आलावा बाकी सभी ports को broadcast कर देता है।
जिस host के लिए इस frame को send किया गया है उसे छोड़कर सभी hosts इस frame को discard कर देते है। जो host frame को receive करता है वह source host को acknowledgment frame भेजता है। अब switch इस frame के source address को अपनी CAM table में store कर लेता है।
Network में जब भी कोई frame send किया जाता है तो switch उसके source address को अपनी CAM table में store कर लेता है। इस प्रकार एक switch अपनी CAM table build करता है। एक बार जब switch सभी hosts के MAC addresses को store कर लेता है तो उसे किसी frame को पहली बार की तरह broadcast करने की आवश्यकता नहीं होती है। अब frames किसी point to point connection की तरह source से destination तक भेजे जाते है।

Forwarding of Frames :- जैसे ही कोई frame switch interface पर आता है तो उसके destination MAC address को CAM table के MAC addresses से compare किया जाता है। यदि frame का destination address match हो जाता है तो frame को केवल उसी MAC address से सम्बंधित port को forward कर दिया जाता है।
यदि किसी frame का destination address CAM table से match नहीं करता है तो उस frame को broadcast किया जाता है। यदि कोई host frame को receive करता है और उसका acknowledgment frame भेजता है तो उस frame के source address को switch CAM table में store कर लेता है।
यदि कोई host या server frames को broadcast करता है तो switch ऐसे frames को सभी hosts को send करता है।
Switches frames को forward करने के लिए 3 methods provide करते है।

  1. Store and Forward - इस method में complete frame को memory में copy किया जाता है। Frame को copy करने के बाद उस पर Cyclic Redundancy Check (CRC) perform किया जाता है।
  2. Cut Through - इस method में frame की header से शुरआती 6 bytes को copy किया जाता है ताकि destination host को identify किया जा सके। इस method में किसी भी प्रकार की error checking नहीं perform की जाती है।
  3. Fragment Free - इस method में frame की शुरआती 64 bytes को copy किया जाता है ताकि error checking perform की जा सके।

Loop Avoidance :- Switches के बीच multiple links होना बहुत ही important रहता है। क्योंकि यदि किसी कारणवश एक link down हो जाए तो दूसरी link द्वारा frames को send किया जा सकता है। लेकिन कई बार इन्हीं mulitple links की वजह से network में कई समस्याएँ उत्पन्न हो जाती है।
Switches के बीच एक से अधिक link होने की वजह से network में loops create हो सकते है। यदि कोई loop avoidance technique ना use की जाए तो network में broadcast storm create हो जाता है। Network में loops की वजह से एक host frames की एक से अधिक copies receive कर सकता है।
Layer 2 switching में loops को avoid करने के लिए Spanning Tree Protocol use किया जाता है।

Post a Comment

If you have any doubts,Please let me know

close