Working of Switch

Working of Switch

Working of Switch



Switch:

           Switch is the data link layer. It just forwards the packet from one device to another based on MAC-address. Switch works on layer 2 of OSI model.

What is a MAC-Address?

MAC Is Abbreviated as Media access control address

       Every device consists of a NIC (network interface card) and a hardware component. Without NIC, computer could able to communicate or connect over to a network.

Mac-address consists of 48, It is usually split into two equal halves it’s first 24 bits denotes the vendor (NIC manufacture) and second 24 bit denotes serial number (unique number representation for MAC address)

                          CC: 54:9A: representation of vendor

                          88: FF: FF: unique number

 NIC (Network Interface Card) is used to convert data into a digital signal. In the OSI model, NIC uses a physical layer to transmit signals and the network layer to transmit data packets.

Note: MAC-address (CC: 54:9A:88: FF: FF) is like a name, every NIC device must have a MAC-address for the communication.

Working of switch:

                   Initially networks Hubs are most commonly used in the world. Hub simply forward the packets to all the devices connected to it. This leads to a security problem. Switch can forward the packet from one device to particular device with help of MAC-address. Switch maintains a MAC-address table, in that it stores Mac-address of the device

 

Let’s take the picture as an example:

 





 

Four devices are connected to the switch. I hope you can seen switch0

 it’s the console of the switch in that there will be a MAC-address table 

initially, it’s doesn’t store any MAC-address connected to it.  In Switch0 

we have network PC2 which will try to communicate with PC0 with help 

of ping command, you can be able to see a blue packet that is created 

in PC2 and is ready to move forward.

Note:

In PC2 two packets are created first packet is used to find the MAC-address of the communication device (PC0). Second packet it consist of the information in your example the information is ICMP (ping command work on ICMP protocol).

 



 

                In this picture PC2 device generate some packets in out layers PC2 (0001. 42AE.CE21) sent to  FFFF.FFFF. FFFF.FFFF.FFFF. FFFF is the broadcast address. Once switch receives it just forwards that packet to all the devices connected towards it. In this example it forwards to all 4 device (4 PC). 

Why we use broadcast address:

                             Imagine if you need to send a courier to your friend order  to send the courier you must  mention from and to address in this example from address is PC2's  IP address it must send a packet to is friend  PC0, but it does not  know the TO address (ip of PC0) so it approaches the switch. Once a switch receives that packet it detects the broadcast address(FFFF.FFFF.FFFF) it broadcast the packet and questions “who has have this IP address ex:(192.168.10.1)” this message will  received by all the devices. The device which has that particular  Ip  address (192.168.10.1)  will respond to that switch (ex: hey switch that’s my IP) and it also sends the MAC-address to the switch and switch will update to its MAC-address-table.



In this picture, PC1 and PC3 rejects the packet (because IP address (192.168.10.1) does not belong to them).



PC0 will accept it and send it’s MAC-address to switch. Now switch will store the MAC-address of PC0 and send to the PC2.

 


 




We can see that the PC0’s MAC-address will get collected and stored in PC2.Wait does PC (personal computer) can store MAC address of other address? The answer is yes. PC can store the mac address of the other device like your home router’s MAC-address. Once the process is complete the PC0 and PC2 start communicating.

NOTE: By using “arp -a” in CMD you can see some MAC-address details etc:



Note: Switch reads only MAC-address, it does not know about IP address (except multilevel switch). Switch uses the ARP (Address resolution protocol) to find the MAC-address connected to it.

ARP: The ARP program is used to find the MAC address, which matches with the IP address. An ARP is a broadcast, and also its reply is unicast response.

Conclusion:

The switch allows each and every connected device to communicate with each other.so In our case PC2 and PC0 will communicate securely.

 


0 Response to "Working of Switch"

Post a Comment

Iklan Atas Artikel

Iklan Tengah Artikel 1

Iklan Tengah Artikel 2

Iklan Bawah Artikel