what is switch ? And How switch works ?

Image could not load

Switch Image by pixabay

Switch एक data link layer (layer - 2) networking device है जिसका use किसी network में multiple devices को connect करने के लिए किया जाता है। यह OSI model के layer 2 पर work करती है , और जिसमे multiple switching ports होते हैं। जब भी किसी PC को इसके port से connect किया जाता है ,तो वह PC उस network से connect हो जाती है।

Switch , Actually में network से connected सभी machines के physical addresses को learn करती है इसलिए इसे Learning Device भी कहते हैं। machines के physical addresses को MAC Address कहते हैं जिन्हे store करने के लिए switch एक table maintain करता है।

switch एक Intelligence device है क्योंकि इसमें memory होती है जहाँ यह एक table manage करता है , जिस table को CAM (Content Accessible Memory) कहते हैं। जिसका use यह MAC addresses और Ports को table में store करने के लिए करता है , जिससे किसी network में devices को identify किया जा सके।

How switch works?

यह star topology पर work करता है , जहाँ सभी devices किसी central node से connected होती हैं , send किया गया data सबसे पहले switch तक पहुँचता है उसके destination device तक।

किसी network में जब कोई device first time switch से connect होती है तो यह message को broadcast करता है जहाँ उस device को identify करके Ports और MAC Address को CAM Table में store करता है। इस information की help से ही destination को identify करके direct destination तक data को transmit करता है।

Broadcast के बाद अब switch को हर device के बारे में information होती है , तो next time जब कोई data send किया जाता है तो यह broadcast नहीं करता है सिर्फ select किये गए destination को data receive होता है।

Example के लिए अगर किसी network में switch से 4 device 6 devices pc1, pc2, pc3, pc4 , pc5 , pc6 connected हैं और pc1 pc2 को कोई message send करता है तो सबसे पहले यह switch device पर पहुँचता है। जहां switch device destination port को अपनी CAM table में match करके उस message को transmit करता है।

it solves the problem of hub

So , Hub के साथ दो problems थी -

  1. Hub , सिर्फ half duplex communication कर सकता है मतलब कोई किसी particular time पर कोई एक device ही data को send कर सकता है अगर बाकी computer को data send करना है तो , उन्हें wait करना पड़ेगा। और अगर same time पर data send किया तो दोनों computers से data collide / loss होगा।

  2. HUB किसी network में सभी ports के लिए message broadcast करता था जिसका सीधा सा मतलब है कि अगर किसी hub में 8 ports (devices) connected हैं और उनमे से port 1 के लिए data send किया जाता है तो वो data बाकी सभी port के लिए भी transmit होगा।

इन दोनों problems को switch ने दूर किया , क्योंकि यह full duplex mode में work करता है और यह सिर्फ उसे port को data transmit करेगा जहाँ send किया जाना चाहिए।

Advantages of switch

  • switch का use करके multiple devices connect होकर एक दूसरे से communicate कर सकते हैं।

  • यह एक Intelligence device है क्योंकि यह connected devices के MAC और Port को table में maintain करता है।

  • switch Full duplex mode में work करता है है मतलब , same time पर एक से ज्यादा devices को data send और receive कर सकता है।

  • switch device use किये गए किसी network में frame collision (data - frame confliction) का chance कम रहता है क्योंकि switch के हर port का collision domain separate होता है।

  • अब चूंकि frame collision का chance बहुत कम रहता है तो इससे network की performance increase होती है।

  • Hub के use में आयी problems को solve करता है।

Difference Between Hub and Switch

HubSwitch

Hub , हमेशा data (frame) को जुड़े हुए सभी devices के लिए broadcast करता है , चाहे वो frame किसी particular port के लिए ही क्यों न हो

यह network में हर device को identify करने के लिए सिर्फ first time message को broadcast करता , उसके बाद unicast ही करता है।

यह एक Dumb device है क्योंकि MAC और Port को table में maintain करने के लिए इसमें कोई memory नहीं होती है।

यह एक Intelligence device है क्योंकि यह connected devices के MAC और Port को table में maintain करता है।

यह half-duplex mode में operate होता है।

यह full-duplex mode में operate होता है। जिससे same time पर एक से ज्यादा devices को data send और receive कर सकता है।

इसमें collision detect करने कोई mechanisms नहीं है , जिससे data frames कभी कभी lost हो जाते हैं।

switch device किसी network में frame collision कम करता है क्योंकि switch के हर port का collision domain separate होता है।

Difference Between Switch and Router

SwitchRouter

switch का use करके multiple devices connect करते हैं।

Router different - different computer networks को आपस में connect करते हैं।

Switch , OSI model की data link layer (layer - 2) पर work करती है।

Router OSI Model की layer - 3 (Networking Layer) पर work करता है।

Switch connected devices के MAC और Port को table में maintain करता है।

Router अपनी routing table में destination की IP addresses को store करता है।

data को send करने के लिए MAC Address और Port का use करता है।

Router data को send करने के लिए IP Adderss का use करता है।

इसे सिर्फ LAN में ही use कर सकते हैं ।

इसे LAN, MAN, and WAN में कहीं भी use कर सकते  हैं।

data send करने के लिए यह data-frames को read करता है।

data send करने के लिए यह data-packets को read करता है।

Recent Blogs

Loading ...

Rahul Kumar

Rahul Kumar

Hi ! I'm Rahul Kumar Rajput founder of learnhindituts.com. I'm a software developer having more than 4 years of experience. I love to talk about programming as well as writing technical tutorials and blogs that can help to others. I'm here to help you navigate the coding cosmos and turn your ideas into reality, keep coding, keep learning :)

Get connected with me. :) LinkedIn Twitter Instagram Facebook