A lot of networks nowadays still use a flat network design. A flat topology is an OSI Layer 2 " switch-connected network where all devices see all the broadcasts in the Layer 2 broadcast domain. In such a network, all devices can reach each other by broadcast. Flat network design is easy to implement and manage, reducing cost, maintenance, and administration.
現今仍有許多網路使用扁平式網路設計。扁平拓樸是一種 OSI 第 2 層以交換器連接的網路,網路中所有裝置都能看到同一第 2 層廣播網域內的所有廣播。在這樣的網路中,所有裝置都能透過廣播互相到達。扁平式網路設計容易實作與管理,可降低成本、維護與管理的負擔。
However, such design also brings some concerns:
然而,這種設計也帶來一些疑慮:
- Security: Because the network is not segmented, you can not apply security policies adapted to individual segments. If one device is compromised, it can quickly affect the whole network.安全性:由於網路未區隔,你無法針對個別區段套用適合的安全政策。若有一部裝置遭入侵,可能很快就會影響整個網路。
- Troubleshooting: Isolation of network faults is more challenging, especially in bigger flat networks, because there is no logical separation or hierarchy.疑難排解:隔離網路故障更加困難,尤其是在較大型的扁平網路中,因為缺乏邏輯區隔或層級架構。
- Address space utilization: In a large flat network, you can end up with a lot of wasted IP addresses. You cannot use addresses from this network anywhere else.位址空間利用率:在大型扁平網路中,可能會浪費許多 IP 位址,而且這個網路的位址無法用在其他地方。
- Scalability and speed: A flat network represents a single Layer 2 broadcast domain. If there is a large amount of broadcast traffic, this can impose considerable pressure on the available resources. A single broadcast domain typically should not include more than a couple of hundred devices.可擴充性與速度:扁平網路是單一的第 2 層廣播網域。如果廣播流量很大,將會對可用資源造成相當大的壓力。單一廣播網域通常不應包含超過數百部裝置。

Network administrators can segment their networks, especially large networks, by using subnetworks or subnets to tackle those challenges. Although subnets were initially designed to solve the shortage of IPv4 addresses, they are used to address administrative, organizational, security, and scalability considerations in today's networks. If you break a bigger network into smaller subnetworks, you can create a network of interconnected subnetworks.
網路管理員可以透過子網路將網路(尤其是大型網路)進行區隔,以因應這些挑戰。雖然子網路最初是為了解決 IPv4 位址不足的問題而設計,但如今也用來處理管理、組織、安全性與可擴充性等考量。如果你把一個較大的網路拆分成數個較小的子網路,就能建立由多個互連子網路組成的網路。
Imagine a company that occupies a 30-story building divided into departments. Such a company could prepare one large network to address all the IPv4 devices. But putting a couple of hundred or even thousands of devices into one IPv4 network would make such a network unusable because of the broadcast traffic, security, and troubleshooting issues. A better approach is to create a larger number of smaller networks, such as department, functional or spatial separation. For example, think of the company as a group of networks, the departments being used as subnets and the devices in the departments as the individual host addresses belonging to these smaller subnets. This process of creating smaller networks out of a bigger one is called subnetting.
想像一家公司佔用一棟 30 層樓的建築,並依部門分區。這家公司可以建立一個大型網路來處理所有 IPv4 裝置,但將數百甚至數千部裝置放入單一 IPv4 網路,會因廣播流量、安全性與疑難排解問題而使該網路難以使用。較好的做法是建立較多數量的小型網路,例如依部門、功能或空間分隔。舉例來說,把公司想像成一群網路,各部門作為子網路,部門內的裝置則作為屬於這些較小子網路的個別主機位址。這種將大型網路拆分成較小網路的過程稱為子網路劃分(subnetting)。
A subnet segments the hosts within the network. Without subnets, the network has a flat topology. You use routers to separate networks by breaking the network into multiple subnets or multiple OSI Layer 3 broadcast domains.
子網路會將網路內的主機加以區隔。若無子網路,網路即為扁平拓樸。你可以使用路由器將網路拆分成多個子網路或多個 OSI 第 3 層廣播網域,以此區隔網路。
Segmenting your network using subnets brings several advantages:
使用子網路區隔你的網路能帶來多項優點:
- Smaller networks are easier to manage and map to geographical or functional requirements.較小的網路更容易管理,也更能對應地理或功能上的需求。
- Better utilization of IP addressing space, because you can adapt subnets sizes.能更妥善利用 IP 定址空間,因為你可以調整子網路大小。
- Subnetting enables you to create multiple logical networks from a single network prefix.子網路劃分讓你能從單一網路前綴建立多個邏輯網路。
- Overall, network traffic is reduced, which can improve performance.整體而言可減少網路流量,進而改善效能。
- You can more easily apply network security measures at the interconnections between subnets than within a single large network.你可以更輕鬆地在子網路之間的連接點套用網路安全措施,而不必在單一大型網路內部套用。
In multiple-subnetwork environments, each subnetwork may be connected to the internet by a single router. The figure shows one router connecting multiple subnetworks to the internet. The details of the internal network environment and how the network is divided into multiple subnetworks are inconsequential to other IP networks.
在多子網路環境中,每個子網路可能透過單一路由器連接到網際網路。此圖顯示一部路由器將多個子網路連接到網際網路。至於內部網路環境的細節及網路如何劃分為多個子網路,對其他 IP 網路而言並不重要。
As you already know, an IP address has two components: the network part and the host part. In a flat network, all device IP addresses have the same network part. When the network is broken into subnets, the IP addressing must be modified to accommodate the required segmentation. The IP address of each device on a newly created subnetwork has the same network part and the same subnet part. The subnet part is borrowed from the host part of the address.
如你所知,IP 位址由兩部分組成:網路部分與主機部分。在扁平網路中,所有裝置的 IP 位址都具有相同的網路部分。當網路被拆分成子網路後,IP 定址方式必須修改以配合所需的區隔。新建立的子網路上每部裝置的 IP 位址都具有相同的網路部分與相同的子網路部分,此子網路部分是從位址的主機部分借用而來。

