IPv4 Address
Format
由四個 byte 組成 (AAA.BBB.CCC.DDD),其被分為兩個部分
- network address
- host address
Network Address
用來識別特定網路區段的部分,透過這個,我們可以理解某一 host 是否和我們在同個 subnet 中
Host Address
用來識別 network address 下唯一個別 host 的部分,他的大小決定了這個網路區段能夠容納下的主機數量
Netmask
32-bit number with leading 1’s + trailing 0’s,我們將 IP address 和 netmask 做 AND 操作得到 network address
- Digit mapped to 1’s → network address
- Digit mapped to 0’s → host address
Two Special Addresses
Network Address
- “network address” + “host address all set to zero”
This is reserved IP address, it represent the whole subnet and not any specific device under the subnet
Broadcast Address
- “network address” + “host address all set to one”
This is reserved IP address, we use it as destination IP when we want to send this packet to every device in the subnet