如何从IP地址和子网掩码中确定网络和广播地址? [英] How can I determine network and broadcast address from the IP address and subnet mask?
本文介绍了如何从IP地址和子网掩码中确定网络和广播地址?的处理方法,对大家解决问题具有一定的参考价值,需要的朋友们下面随着小编来一起学习吧!
问题描述
例如:
- IP地址:
130.45.34.36
- 面具:
255.255.240.0
- IP Address:
130.45.34.36
- Mask:
255.255.240.0
什么将是网络ID /子网地址,以及
广播地址?
What would be Net ID/Subnet Address, and Broadcast Address?
推荐答案
让我们用二进制写两个:
Let's write both in binary:
130.45.34.36 = 10000010.00101101.00100010.00100100
255.255.240.0 = 11111111.11111111.11110000.00000000
两者之间的按位 AND 将为我们提供网络地址:
A bitwise AND between the two would give us the network address:
10000010.00101101.00100010.00100100 (ip address)
AND
11111111.11111111.11110000.00000000 (subnet mask)
=
10000010.00101101.00100000.00000000 = 130.45.32.0 (the resulting network address)
网络地址与网络地址之间的按位 OR 反向子网掩码会为我们提供广播地址:
A bitwise OR between the network address and the inverted subnet mask would give us the broadcast address:
10000010.00101101.00100000.00000000 (netadress)
OR
00000000.00000000.00001111.11111111 (inverted subnet mask)
=
10000010.00101101.00101111.11111111 = 130.45.47.255 (broadcast address)
这篇关于如何从IP地址和子网掩码中确定网络和广播地址?的文章就介绍到这了,希望我们推荐的答案对大家有所帮助,也希望大家多多支持IT屋!
查看全文