0

It is my understanding that the main difference between a network hub and a network switch is that the hub always sends out all packets to all (other?) hosts while the switch is smart about it and keeps track of which port belongs to which MAC address via ARP tables and whatnot. If a packet is addressed to a host which is connected to the switch but have never sent or received anything, the switch acts like a hub would. But every subsequent packet addressed to that host is not broadcast to the other hosts but forwarded only to that specific host. Please correct me if I got something wrong.

Does a network bridge in Linux act like a hub would, or like a switch?

  • A bridge is a special case of a switch in the network theory, no matter what tech you are using. This does not seems a Unix doubt. – Rui F Ribeiro Mar 15 '18 at 14:12
  • The reason I posted it here was because I suspect that a bridge net device might be implemented differently on different platforms/paradigms. – lindhe Mar 15 '18 at 14:16
7

A bridge is a network aggregation device, similar in practice to a switch. The bridges implemented in the Linux kernel follow this model. Like any bridge, they forward traffic based on destination MAC addresses, once the MAC address mapping is known. They are actually more featureful than most switches, since they also support firewalling, traffic shaping etc., using ebtables.

See the bridge documentation for details.

  • 1
    (I implemented bridges in DOS and Cisco in the 90s supporting port-based firewalling ;) in Linux too later on, but honestly cant remember for what. Protecting the gateway of a wifi network? Cant remember. I also have a Linux bridge at home because of Apple multicast protocols ) – Rui F Ribeiro Mar 15 '18 at 14:17
-1

actually there is a small difference between the switch and hub.hub don't store the mac of connected devices,so the packets received from any host reaches every other connected hosts .Where as switch stores the mac of connected devices and send the packet to respective receiver whose details(like mac,ip) mentioned in packet headers....

  • 2
    I don't think I understand what you mean I got wrong. To me, it seems like I described it similar to what you say. Also, I think this is not an anser to my question, but rather a comment (which I appreciate, btw). Also also, when talking about switches, it's usually implied that it is L2 switches, and they do not care about any packet header, only the frame header (so no IP). – lindhe Mar 15 '18 at 20:00

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.