Options

hub, swithc, router, bridge ang gateway

pengbinpengbin Member Posts: 5 ■□□□□□□□□□
Can someone explain in detail the difference between hub, swithc, router, bridge ang gateway?

Comments

  • Options
    Danman32Danman32 Member Posts: 1,243
    In a nutshell:

    A hub could be thought as layer 1 in the OSI model, but many senses, it is a layer 2 device. Ethernet frames coming in to one port are sent out to all other ports, regardless if the devices at the other ports need it or not. Think of it as a multi-segment repeater.

    A switch is in many ways like a hub in that it is a level 2 device. However, instead of blindly sending frames to all other ports, it learns of the mac addresses of the devices attached to each port and only sends the frames to the port with the destination mac address.

    To compare a hub to a switch, think of the old time partly line phones versus today's modern switched phone system. When you call someone, you get a direct connection to that person. No one else gets a connection.

    A router operates at the layer 2 of the OSI model. It routes packets from one network segment to another. In the case of TCP/IP, which is what you'll see the most nowadays, it routes IP networks versus forwarding ethernet frames that a switch or hub does.

    A gateway operates above the network layer of the OSI model, usually at the topmost layers. An example would be a web proxy that receives web requests from the client, then relays that request to the actual website, the proxy receives that request as if it initiated the request, and if allowed, will present the page to the client as if the proxy actually hosted the page. While it did this, it can cache the page in case another client or even the same client requests the page or part of the page again.

    Another distinction between hubs, switches and routers is the breakup of collision and broadcast domains. Hubs cannot prevent ethernet collisions, collisions being when 2 hosts try to talk on the ethernet at the same time.
    Switches can prevent this since they make virtual connections between hosts for each frame, so potentially several frames can be forwarded at the same time. Port A can send a frame to port B, and port C can send a frame to port D at the same time with no collisions occuring.

    Broadcasts have to be sent to everyone, but broadcasts are usually limited in scope to a specific IP network. IP broadcasts normally do not cross IP networks, as the routers generally do not allow it. Ethernet broadcasts certainly do not cross routers. Thus each IP network segment is its own broadcast domain and routers bridge broadcast domains, only allowing packets specifically destined for another network different from the source network to be routed.
  • Options
    dmafteidmaftei Member Posts: 83 ■■□□□□□□□□
    Danman32 wrote:
    A router operates at the layer 2 of the OSI model. It routes packets from one network segment to another. In the case of TCP/IP, which is what you'll see the most nowadays, it routes IP networks versus forwarding ethernet frames that a switch or hub does.
    I think you meant layer 3, not 2; and a router routes datagrams (or, if you prefer, layer 3 PDUs), not networks.
    BSEE, MSCS
    www.maftei.net
  • Options
    Danman32Danman32 Member Posts: 1,243
    Yes I certainly did mean layer 3. icon_redface.gif

    I also should have said routers route packets between IP networks, not the networks themselves.
  • Options
    WebmasterWebmaster Admin Posts: 10,292 Admin
Sign In or Register to comment.