Hello friends, Welcome to Gate Smashers The topic is Bridges We use bridges in computer networks to connect two LANs So if we'd talk about hubs, as I said in Hub's video, we can use hub also to connect two LANs But in bridges case, remember that bridges are used to connect two different LANs So the important point here is "Two different LANs" Means If I'm using the bridge, then it may be possible that we are using token ring LAN at one side, where there is a ring topology And on the other side, we are using token bus i.e. ethernet, In token Bus, we have Bus topology, so we can connect two different LANs with the bridges, and keep the other point in mind i.e. "Two", means we generally use bridges to connect two LANs And why is it named Bridge?... Generally, if you'd talk about the bridge so if you want to connect two areas then we use bridges like we generally use flyover, so we use the bridges there The second point is forwarding... Forwarding means that if a packet arrives towards bridges, then does the bridge forward it ahead? Yess As you can see here I've made a bridge, M1 and M4 are on the left with the P1 interface... P1 is the bridge's interface or port and P2 is also the bridge's port So these 4 devices are connected to P2 and these 4 with P1 If M1 is sending a packet to M7, then what would be written in that packet? Important point there is the MAC Address of the source and destination So bridges work on the physical layer and data link layer, so data link layer means that bridges can check MAC address Checking MAC address means that they can decide if they have to send the packet ahead or no Let's say if M1 is sending the packet to M6... When M1 sent data to M6 Then the bridge will check if the destination Mac address is on the left or right... If the MAC address is on the right side then it'll forward ahead Then bridges can definitely forward the packet But let me tell you how they can check the MAC address in the case of filtering Filtering is like if I want to block or stop the packet Let's say M1 is sending the packet to M3 If M1 is sending the packet to M3, then the message will reach the bridge also... But in this case, the bridge can also recognize that M3 is on the left side, so it doesn't have to send the packet ahead This concept was not in repeater or hub But in the bridge, because there is a data link layer that's why MAC address gets checked here Now here we'll talk about how to check them Bridges are of generally two types... Static and dynamic There are two types... Static bridges and dynamic bridges Static bridge means that bridges generally maintain a table like routers maintain a routing table... Same way bridges also manages a table including MAC address and port number So static means fix... In this case, the network administrator manually types which machine is connected to which port How?... As you can see M1, M2, M3, M4 all four machines are with port P1 Then the administrator will type manually that all four are connected with P1 And M5, M6, M7, M8 are connected with port P2 then the administrator will type manually that these machines are connected with P2 Now the bridge has this table... Now if M1 wants to send a message to M5, then that message will include source address M1, destination address M5, and many other things But for us, only this main address is important that source address M1, destination address M5 When it reached the bridge then the bridge will check that destination is M5 and M5 is on the P2 side P2 means it will forward this packet to go on the other side... So this is actually called forwarding so forwarding is done according to this table Filtering means, let's say M1 is sending the packet or message to M3 When M1 is sending the packet to M3 so when that message will go and reached the bridge, then the bridge saw that the destination address is M3 Then it checked in its table that M3 is connected to the P1 port, then it'll observe that M3 is on the same side, so it'll not forward the packet and filter it... Filtering means stopping or blocking We obviously have to block this packet because M1 wants to send it to M3 then why would I forward it ahead we don't have to create unnecessary traffic Then bridge stops these types of the packet... this concept is not available in repeater or hub We are able to block because of the data link layer and MAC address But if we'd talk about static bridge then there is a lot of problem in it, problem is that if the MAC address of this device got changed Generally, MAC addresses do not change like this, but in our system, there are multiple MAC addresses Wifi has its own MAC address, the wire has its own MAC address, or even we can change Generally, we don't change the MAC address but we can change the MAC address Or if I changed the MAC address, let's say if I changed the MAC address of M2 to 20, then I have to manually type again that M2 has become M20 So there is no learning, here always network administrator come and change the data Or if some machine changes the interface... Because we are talking about LAN then let's say there was a PC in a lab, then I plugged out that PC and shifted to some other lab then in this case interface got changed So M2 was connected to P1 first and now maybe it's connected to P2 Then in this case we have to change again by typing manually We have to type here manually again and again then it's a very big problem because the bridge is not learning it on y its own So we generally use static bridge less, we use dynamic or transparent bridges more Transparent bridges learn... Now, how they learn is a very important concept If we'd talk about dynamic bridges then in the starting there is nothing, it means the whole table is empty Empty means there's nothing typed until now, then, in this case, let's say M1 sent a packet to M6 M1 is here and M1 sent a packet to M6 So when it will send this packet and it reached the bridge, then bridge observed that M1 is the source address and M6 is the destination address, but there is no entry Then how it'll do the task? So the first time it'll broadcast... Broadcast means it will forward ahead and these in the backward will obviously get it Means this packet will reach everyone When this packet will reach everyone, then first of all it made an entry that a packet came from M1 and M6 is the destination address Then it will find out that the packet from M1 came through the P1 port so it made an entry i.e. M1, P1 But it does not know about M6, whether it is connected to P1 or P2, so it forwarded it to all and broadcasted the packet When M6 got this packet and when it'll send the reply that it got the packet then it'll send the acknowledgment that it got the packet So when M6 sent the reply, then there'll be source address M6 and destination address M1 So when this packet reached the bridge, then the bridge will say okay... M6 is the source address So source means it is on this side, so the message from this side came from P2 Then it'll mention the entry here that M6 is connected to P2 So this is how it learns, so whenever the bridge is not able to decide where to send then it generally broadcasts it But as it'll get replies then it'll keep maintaining its table So maintaining a table means that it'll keep creating the table like this like, let's say M7 is connected to P2, M4 is connected to P1, etc... This way it will keep maintaining its table So if we'd compare static and dynamic, then dynamic will take some time in the starting... It'll take time initially Because it will take some time to create and maintain this table But it's better to use this in real life because there is no interference of network administrators in it, The bridge keeps changing the data again and again on its end... As it is learning, it keeps changing the data Surely it's taking time in the starting but later it'll perform better as compared to the static so if any machine changed then it won't be able to take the decision, if any address got changed then it won't be able to make a decision, but the first time it'll forward or broadcast, but the second time it can filter because the second time it has a table of addresses ready So this concept is used by the dynamic bridges and in that case, they can do forwarding or filtering Next is the collision domain, if we'd find a collision domain... We are finding collision domain in the bridge Can collision occur in the bridge?... No A Collision can occur in bridges and repeaters but it won't occur in bridges... The reason is that bridge use the store and forward strategy The store and forward strategy means that it stores the packet and forwards it after processing So store and forward means that bridge has its own buffer or memory So if a packet arrived then it stores it in the buffer... At the same time, another packet arrived, then it stored it also in the buffer There will be no collision So if we'd talk comparatively, In repeater or hub where a collision can be maximum "N", N means maximum collision can occur, but in bridges, collision will be very rare as compared to that because the bridge has its own buffer which used the store and forward technique And the last one here is, the Bridges data unit protocol Bridges use the data unit protocol... And the reason is that it is used to remove the loops Loops means that many times packet gets stuck in the loops, when there will be multiple paths then it'll get stuck in the loops Then to remove this loop we have a TTL field in the router i.e. Time to Live field But in the bridge, there is no such field... So bridges create spanning tree And they create a spanning tree based on this protocol, and spanning tree makes them find out on which side to forward the packet And there occurs no loop in spanning tree, So with the help of those spanning trees, they remove the loops so that the packet won't stay stuck in the loops permanently So these are the major points about bridges They are important for UGC NET especially if you are preparing for any PSU exam or there is an exam of IT officer in the bank if we'd talk about such kinds of exams There are very low chances of getting this in GATE, but there are so many chances of getting this in UGC NET or PSU So make sure to definitely memorize these points before the exam There are so many chances of getting questions from these points Thank You!