Hub, bridge, switch, router, gateway的區別


這些概念性的東西,其實,有的區別不是很大,有的區別很大。

Hub

就是一個重復轉發器,就是從一個port接受到數據后,就會原樣的向其他的所有端口發送剛才收到的數據。個人理解為是工作在物理層的東西。但是,后來發展中,出現了些所謂的智能hub,就是可以做簡單的配置,實現端口管理。這個所謂的智能的hub,和后續的bridge/switch的差別貌似小了一步。下面參考外文網站上的介紹:

A hub is a repeater, which is a OSI model device, the simplest possible. Hubs are a common connection point for devices in a network and are commonly used to connect segments of a LAN. A hub takes the incoming data packet that comes into a port and copies it out to all the other ports in the hub.  It doesn't perform any filtering or redirection of data. Although it's actually a little more complicated, a good analogy might be that of an Internet Chat room.  Everything that everyone types in the chat room is seen by everyone else.  If there are too many people trying to chat things get bogged down. 

A passive hub serves simply as a conduit for the data, enabling it to go from one device (or segment) to another. So-called intelligent hubs include additional features that enables an administrator to monitor the traffic passing through the hub and to configure each port in the hub. Intelligent hubs are also called manageable hubs.  A third type of hub, called a switching hub, actually reads the destination address of each packet and then forwards the packet to the correct port. 

 Hub有個最大的問題就是從一個端口進來的數據,會毫無保留的向其他端口發送,不管其他端口連接的LAN是否是該數據包的真正去向。所以,就存在嚴重的沖突問題,這就造成嚴重的帶寬損耗。但是,這個玩意簡單便宜,有一定的使用價值。

 

Bridge

是一個工作在二層的數據轉發設備,端口數量比較少,有端口學習,STP/RSTP協議,基於MAC地址實現數據轉發。

Bridges (sometimes called "Transparent bridges") work at OSI model Layer 2. This means they don't know anything about protocols, but just forward data depending on the destination address in the data packet.  This address is not the IP address, but the MAC (Media Access Control) address that is unique to each network adapter card. The bridge is the device which is used to connect two local-area networks (LANs), or two segments of the same LAN that use the same protocol.

With a Bridge, all your computers are in the same network subnet, so you don't have to worry about not being able to communicate between computers or share an Internet connection. DHCP servers will work fine across Bridges, or if you assign your own IP addresses, you'll use the same first 3 "octets" of the IP address (Example: 192.168.0.X)

However, the only data that is allowed to cross the bridge is data that is being sent to a valid address on the other side of the bridge.  No valid address, no data across the bridge.  Bridges don't require programming.  They learn the addresses of the computers connected to them by listening to the data flowing through them.

Bridges are very useful for joining networks made of different media types together into larger networks, and keeping network segments free of data that doesn't belong in a particular segment.

 

Switch

這個估計是很多人都比較熟悉的,端口比較多,數據傳送速率也比bridge相對快,支持的管理能力也比較強,也是工作在2層的協議,同樣也是基於MAC實現數據轉發。但是個人覺得,和bridge沒有太多本質區別。有點類似增強版的bridge。

Switches are the same thing as Bridges, but usually have multiple ports with the same "flavor" connection (Example: 10/100BaseT).  

Switches can be used in heavily loaded networks to isolate data flow and improve performance.  In a switch, data between two lightly used computers will be isolated from data intended for a heavily used server, for example.  Or in the opposite case, in "auto sensing" switches that allow mixing of 10 and 100Mbps connections, the slower 10Mbps transfer won't slow down the faster 100Mbps flow.

Although switch prices are dropping so that there is very little difference from hub prices, most home users get very little, if any, advantage from switches, even when sharing broadband Internet connections.  Broadband connections for most users are in the 1-2Mbps range, far below even 10Mbps speeds.  Since you share that bandwidth, you can see that your speedy 100BaseT connection isn't even breaking a sweat when you're using the Internet.

 

bridge和switch都有端口學習的功能,所以,在很大程度上,從某個口進來的數據,他們知道要向那個端口發出去,所以,大大降低了數據沖突的可能性,從而提高帶寬利用率! 

 

Router

這個,大家應該最容易接受了,他是工作在3層的網絡設備,基於IP地址實現數據轉發,鏈接不同的子網,實現大的網絡互聯,今天的互聯網通信,跨地域的連接,都離不開它的功勞。相對來說,其原理也比其他的要復雜!

Routers forward data packets from one place to another, too!  However routers are OSI model Layer 3 devices, and forward data depending on the Network address, not the Hardware (MAC) address.  For TCP/IP networks, this means the IP address of the network interface.  

Routers isolate each LAN into a separate subnet, so each network adapter's IP address will have a different third "octet" (Example: 192.168.1.1 and 192.168.2.1 are in different subnets).  They are necessary in large networks because the TCP/IP addressing scheme allows only 254 addresses per (Class C) network segment.

Routers, like bridges, provide bandwidth control by keeping data out of subnets where it doesn't belong.   However, routers need to be set up before they can get going, although once set up, they can communicate with other routers and learn the way to parts of a network that are added after a router is initially configured.

Routers are also the only one of these four devices that will allow you to share a single IP address among multiple network clients.

 

Gateway

這個就是我們常說的網關,他的主要作用是連接兩個不同的網絡,這兩個網絡可能采用了不同的網絡協議在通訊。又稱網間連接器、協議轉換器。網關在網絡層以上實現網絡互連,是最復雜的網絡互連設備,僅用於兩個高層協議不同的網絡互連。網關既可以用於廣域網互連,也可以用於局域網互連。由於現在的網絡基本都是基於TCP/IP的協議進行通信的,所以,當前常見的路由器,也就充當了網關的角色。

網關不僅僅具有路由器的路由選擇功能,更重要的是能夠完成兩個不同網絡(主要是基於不同的網絡協議,例如:OSI 7層模型網絡,和基於TCP/IP的網絡)之間的協議轉換。

 


免責聲明!

本站轉載的文章為個人學習借鑒使用,本站對版權不負任何法律責任。如果侵犯了您的隱私權益,請聯系本站郵箱yoyou2525@163.com刪除。



 
粵ICP備18138465號   © 2018-2025 CODEPRJ.COM