局域网中的局域网_什么是局域网? 用简单的英语解释局域网

局域网中的局域网

A local area network (LAN) is really nothing more than a structure for organizing and protecting network communications for all the devices running within a single home or office.

局域网(LAN)实际上只是用于组织和保护单个家庭或办公室中运行的所有设备的网络通信的结构。

Let me break that down a bit. When I say, within a single home or office, I mean all the devices that are connected through either a physical or wireless connection to a network router. That router might be a WiFi access point or the modem your internet service provider (ISP) gave you.

让我分解一下。 当我说在单个家庭或办公室内时 ,我指的是通过物理或无线连接连接到网络路由器的所有设备。 该路由器可能是WiFi接入点,也可能是Internet服务提供商(ISP)为您提供的调制解调器。

By organizing I mean each device is given an identifying address, and its access to the internet beyond your local network is defined.

通过组织,我的意思是为每个设备提供一个标识地址,并定义了它对本地网络以外的Internet的访问。

And by protecting I mean that, generally, traffic requests directed at your devices from external networks will be scanned and filtered to help prevent unauthorized and potentially dangerous access.

通过保护,我的意思是,通常,将对来自外部网络针对您设备的流量请求进行扫描和过滤,以帮助防止未经授权的访问和潜在的危险访问。

Based in part on content from my Linux in Action book, I'll try to explain how all that works.

部分基于我的《 Linux in Action》一书中的内容 ,我将尝试解释所有这些工作原理。

IPv4寻址 (IPv4 addressing)

Here's how that might look. The Router in this image has a public IP address of 183.23.100.34 to which all incoming and outgoing traffic is associated.

这是可能的样子。 此图像中的路由器具有一个公共 IP地址183.23.100.34,所有传入和传出流量都与该IP相关联。

At the same time, the router acts as a Dynamic Host Configuration Protocol (DHCP) server, assigning private IP addresses to all the PCs, laptops, smartphones, and servers in the house. The devices will use those addresses whenever they talk to each other.

同时,路由器充当动态主机配置协议(DHCP)服务器,将私有 IP地址分配给房屋中的所有PC,笔记本电脑,智能手机和服务器。 这些设备在彼此通信时将使用这些地址。

Notice how all the local devices are described as using something called "NAT IP addresses." NAT stands for Network Address Translation, and it's the method used for organizing devices within a private LAN.

注意如何将所有本地设备描述为使用“ NAT IP地址”。 NAT代表网络地址转换,它是在专用LAN中组织设备的方法。

But why? What's wrong with giving all devices the same kind of public IP address the router has?

但为什么? 为所有设备提供路由器具有相同类型的公用IP地址有什么问题?

In the beginning, there was IPv4. IPv4 addresses are 32-bit numbers made up of four 8-bit octets separated by dots. Here's what that might look like:

最初有IPv4。 IPv4地址是32位数字,由点分隔的四个8位八位字节组成。 可能是这样的:

192.168.1.10

子网符号 (Subnet notation)

Because it’s critically important to make sure systems know what kind of subnet a network address is on, we need a standard notation that can accurately communicate which octets are part of the network and which are available for devices.

因为确保系统知道网络地址所在的子网类型至关重要,所以我们需要一种标准符号,该符号可以准确地传达哪些八位位组是网络的一部分,哪些八位位组可用于设备。

There are two commonly used standards: Classless Inter-Domain Routing (CIDR) notation and netmask.

有两种常用的标准:无类域间路由(CIDR)表示法和网络掩码。

Using CIDR, one network might be represented as 192.168.1.0/24. The /24 tells you that the first three octets (8×3=24) make up the network portion, leaving only the fourth octet for device addresses. The second network (or subnet), in CIDR, would be described as 192.168.2.0/24.

使用CIDR,一个网络可能表示为192.168.1.0/24。 / 24告诉您,前三个八位位组(8×3 = 24)构成了网络部分,而只剩下了第四个八位位组作为设备地址。 CIDR中的第二个网络(或子网)将被描述为192.168.2.0/24。

These same two networks could also be described through a netmask of 255.255.255.0. That means all 8 bits of each of the first three octets are used by the network, but none of the fourth.

这两个相同的网络也可以通过255.255.255.0的网络掩码来描述。 这意味着前三个八位字节中的每一个的所有8位都被网络使用,但第四个八位字节都不使用。

了解专用网络 (Understanding private networks)

In theory, the IPv4 protocol allows for around four billion unique addresses, ranging from 1.0.0.0 to 255.255.255.255.

从理论上讲,IPv4协议允许大约40亿个唯一地址,范围从1.0.0.0到255.255.255.255。

But even if all four billion of those addresses were practically available, it still wouldn't come close to covering each of the billions of cell phones, billions of laptop and desktop computers, and billions more network-connected cars, appliances, and Internet of Things devices that are already out there. To say nothing of the billions more that're coming soon.

但是,即使实际上所有这些地址中的40亿都可用,它仍然无法覆盖数十亿部手机,数十亿部笔记本电脑和台式机以及数十亿部网络连接的汽车,家电和互联网。物联网设备已经存在。 更不用说即将到来的数十亿美元了。

So network engineers set aside three ranges of IPv4 addresses to be used exclusively in private networks. Devices using any address from those ranges will not be directly reachable from the public internet and will not be able to access internet resources. These are the three ranges:

因此,网络工程师留出了三个IPv4地址范围,专用于专用网络。 使用这些范围内任何地址的设备将无法从公共互联网直接访问,并且将无法访问互联网资源。 这是三个范围:

Between 10.0.0.0 and 10.255.255.255
Between 172.16.0.0 and 172.31.255.255
Between 192.168.0.0 and 192.168.255.255

Remember what the "T" in NAT stood for? It was "Translation." What that means is that a NAT-enabled router will take the private IP addresses used in traffic requests between the LAN and the internet and translate them to the router's own public address. The router, true to its name, will then route those requests to their appropriate destinations.

还记得NAT中的“ T”代表什么吗? 那是“翻译”。 这意味着启用了NAT的路由器将获取LAN和Internet之间的流量请求中使用的专用IP地址, 并将其转换为路由器自己的公共地址。 路由器将按照其名称,将这些请求路由到其适当的目的地。

This simple redesign of network addressing saved many billions of addresses for use with devices - like cell phones - that weren't part of a private network. All those laptops, PCs, and so on running in all those homes and offices would conveniently (and seamlessly) share their routers' public IPs.

网络地址的这种简单重新设计节省了数十亿个地址,可用于不属于专用网络的设备(例如手机)。 在所有这些家庭和办公室中运行的所有那些笔记本电脑,PC等,都可以方便地(无缝地)共享路由器的公共IP。

Problem solved? Well, not quite. You see, even with all that efficient use of addresses, there still won't be enough for the explosion of public-facing devices coming online. To manage that problem, more network engineers came up with the IPv6 protocol. Here's what an IPv6 address might look like:

问题解决了? 好吧,不完全是。 您会看到,即使对地址进行了所有有效利用,对于面向公众的在线设备爆炸式增长来说,仍然远远不够。 为了解决该问题,更多的网络工程师提出了IPv6协议。 这是IPv6地址的样子:

2002:0df6:0001:004b:0100:6c2e:0370:7234

That looks nasty, doesn't it? And it looks like it's a much bigger number than that wimpy IPv4 example from before.

看起来很讨厌,不是吗? 而且看起来它比以前的那个笨拙的IPv4示例要大得多。

Yup and yup. I've gotten pretty good at remembering some kinds of IPv4 addresses, but I've never even tried to "download" one of these monsters.

是的,是的。 我已经非常擅长记住某些类型的IPv4地址,但是我什至从未尝试过“下载”这些怪物之一。

For one thing, it's hexadecimal, meaning it uses the numbers between 0 and 9 and the first six letters of the alphabet (a-f)! Besides that, there are eight octets rather than four, and the address is 128-bit rather than 32-bit.

一方面,它的十六进制,这意味着它使用0 9字母表中的前六个字母的数字(AF)! 除此之外,还有八个八位位组而不是四个八位位组,并且地址是128位而不是32位。

All of which means that, once the protocol is fully implemented, we won't be at risk of running out of addresses for a very, very long time (meaning: forever). And what that means is that, from the perspective of address allocation, there's no longer any need for private NAT networks.

所有这些都意味着,一旦协议完全实施,我们将不会面临很长很长时间(即永远)耗尽地址的风险。 从地址分配的角度来看, 意味着不再需要专用NAT网络。

Although, for security considerations, you'll still want to give your devices some protection within your LAN.

尽管出于安全考虑,您仍然希望在局域网内为设备提供一些保护。

There's much more administration goodness in the form of books, courses, and articles available at my bootstrap-it.com.

我的bootstrap-it.com上提供了书籍,课程和文章形式的管理优势。

翻译自: https://www.freecodecamp.org/news/what-is-a-lan-local-area-network-explained-in-plain-english/

局域网中的局域网

  • 0
    点赞
  • 0
    收藏
    觉得还不错? 一键收藏
  • 0
    评论
评论
添加红包

请填写红包祝福语或标题

红包个数最小为10个

红包金额最低5元

当前余额3.43前往充值 >
需支付:10.00
成就一亿技术人!
领取后你会自动成为博主和红包主的粉丝 规则
hope_wisdom
发出的红包
实付
使用余额支付
点击重新获取
扫码支付
钱包余额 0

抵扣说明:

1.余额是钱包充值的虚拟货币,按照1:1的比例进行支付金额的抵扣。
2.余额无法直接购买下载,可以购买VIP、付费专栏及课程。

余额充值