You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
Copy file name to clipboardExpand all lines: README.md
+83-18Lines changed: 83 additions & 18 deletions
Display the source diff
Display the rich diff
Original file line number
Diff line number
Diff line change
@@ -94,22 +94,17 @@ Hosts: 254
94
94
**JSON mode** (`--json`):
95
95
```json
96
96
{
97
-
"Network": "192.168.1.0",
98
-
"Prefix": "/24",
99
-
"Netmask": "255.255.255.0",
100
-
"Broadcast": "192.168.1.255",
101
-
"Hostmin": "192.168.1.1",
102
-
"Hostmax": "192.168.1.254",
103
-
"Hosts": "254"
97
+
"network": "192.168.1.0",
98
+
"prefix": "/24",
99
+
"netmask": "255.255.255.0",
100
+
"broadcast": "192.168.1.255",
101
+
"hostmin": "192.168.1.1",
102
+
"hostmax": "192.168.1.254",
103
+
"hosts": "254",
104
+
"comment": ""
104
105
}
105
106
```
106
107
107
-
### Special Cases
108
-
109
-
-**/31 networks**: Show `2*` in Hosts field - both addresses are usable (RFC 3021)
110
-
-**/32 networks**: Show `1*` in Hosts field - single host network
111
-
- The asterisk (*) indicates special network types where all addresses are usable
112
-
113
108
### Uninstall
114
109
115
110
```bash
@@ -197,18 +192,88 @@ Distributed under the MIT License. See LICENSE for more information.
197
192
## Notes
198
193
199
194
A /31 mask allows the use of 2 addresses. The first will be the network address, the last the broadcast address, and for connecting hosts we use these same addresses.
200
-
201
195
Limitations when using a /31 prefix:
202
-
203
196
Protocols that use L3 broadcast stop working.
204
197
In fact, at present there are almost no protocols left that rely on L3 broadcast in their operation. The main currently relevant protocols, such as OSPF, IS-IS, EIGRP, and BGP, use multicast or unicast addresses instead.
205
198
This limitation can even be seen as an advantage, because it increases resistance to DoS attacks based on broadcast traffic distribution.
206
-
207
-
Not all devices support /31 prefixes.
199
+
But not all devices support /31 prefixes.
208
200
On Juniper and Cisco devices, you can safely use a /31 mask, although Cisco will issue a warning (% Warning: use /31 mask on non point-to-point interface cautiously).
209
201
ZyXEL, however, does not allow you to select a /31 mask at all.
210
202
As a result, there are additional limitations in network operation — from using equipment of different manufacturers to even using equipment from the same vendor but with different firmware versions.
211
-
212
203
If you are not concerned by the above limitations, you can confidently save addresses by using the /31 prefix.
213
204
214
205
The use of the /31 prefix is described in detail in RFC 3021 — Using 31-Bit Prefixes on IPv4 Point-to-Point Links.
206
+
207
+
208
+
## Special IPv4 Ranges and Cases
209
+
210
+
### Special Network Types
211
+
212
+
-**/31 networks**: Show `2*` in Hosts field - both addresses are usable (RFC 3021)
213
+
-**/32 networks**: Show `1*` in Hosts field - single host network
214
+
- The asterisk (*) indicates special network types where all addresses are usable
215
+
216
+
### Special IPv4 Address Ranges
217
+
218
+
LanCalc automatically detects and handles special IPv4 address ranges according to RFC specifications. For these ranges, host-related fields show "*" and a message field indicates the range type with RFC reference.
219
+
220
+
#### Supported Special Ranges
221
+
222
+
| Range | Type | RFC | Description |
223
+
|-------|------|-----|-------------|
224
+
|**127.0.0.0/8**| Loopback |[RFC 3330](docs/RFC.md#rfc-3330---loopback-addresses)| Loopback addresses - not routable on the Internet |
225
+
|**169.254.0.0/16**| Link-local |[RFC 3927](docs/RFC.md#rfc-3927---link-local-addresses)| Link-local addresses - not routable |
226
+
|**224.0.0.0/4**| Multicast |[RFC 5771](docs/RFC.md#rfc-5771---multicast-addresses)| Multicast addresses - not for host addressing |
227
+
|**0.0.0.0/8**| Unspecified |[RFC 1122](docs/RFC.md#rfc-1122---unspecified-addresses)| Unspecified addresses - not for host addressing |
228
+
|**255.255.255.255/32**| Broadcast |[RFC 919](docs/RFC.md#rfc-919---broadcast-address)| Limited broadcast address - not for host addressing |
The loopback address range 127.0.0.0/8 is reserved for communication within the same host. These addresses are not routable on the Internet and are used for internal host-to-host communication, typically for testing and diagnostics.
- Loopback addresses show actual host range calculations for subnet analysis
44
+
- The entire 127.0.0.0/8 range is reserved, not just 127.0.0.1
45
+
- Commonly used for localhost communication and application testing
46
+
47
+
48
+
---
49
+
50
+
## RFC 3927 - Link-Local Addresses
51
+
52
+
### Official IETF Document
53
+
54
+
[RFC 3927 - Dynamic Configuration of IPv4 Link-Local Addresses](https://tools.ietf.org/html/rfc3927)
55
+
56
+
### Description
57
+
58
+
The link-local address range 169.254.0.0/16 is used for automatic IP address configuration when no DHCP server is available. These addresses are not routable beyond the local network segment and are typically assigned automatically by the operating system.
- Host-related fields show "*" because link-local addresses have special automatic assignment behavior
79
+
- Commonly seen on Windows systems when DHCP fails (APIPA - Automatic Private IP Addressing)
80
+
- Used for local communication only, not routable through gateways
81
+
82
+
---
83
+
84
+
## RFC 5771 - Multicast Addresses
85
+
86
+
### Official IETF Document
87
+
88
+
[RFC 5771 - IANA Guidelines for IPv4 Multicast Address Assignments](https://tools.ietf.org/html/rfc5771)
89
+
90
+
### Description
91
+
92
+
The multicast address range 224.0.0.0/4 (224.0.0.0 - 239.255.255.255) is reserved for IP multicast communication. These addresses are used to send data to multiple hosts simultaneously and are not intended for traditional unicast host addressing.
- Host-related fields show "*" because multicast addresses are not used for individual host identification
113
+
- Used for protocols like IGMP, streaming media, and group communication
114
+
- Different from broadcast as they require explicit group membership
115
+
116
+
---
117
+
118
+
## RFC 1122 - Unspecified Addresses
119
+
120
+
### Official IETF Document
121
+
122
+
[RFC 1122 - Requirements for Internet Hosts -- Communication Layers](https://tools.ietf.org/html/rfc1122)
123
+
124
+
### Description
125
+
126
+
The unspecified address range 0.0.0.0/8 contains addresses that have special meaning in network protocols. The address 0.0.0.0 is used to indicate "this host on this network" and should not be used for regular host addressing. Note that 0.0.0.0/0 (the default route) is treated as normal unicast.
- Host-related fields show "*" because these addresses have special protocol meanings
147
+
- 0.0.0.0 is used in DHCP and routing protocols to indicate "this network"
148
+
- The default route 0.0.0.0/0 is treated as normal unicast, not unspecified
149
+
150
+
---
151
+
152
+
## RFC 919 - Broadcast Address
153
+
154
+
### Official IETF Document
155
+
156
+
[RFC 919 - Broadcasting Internet Datagrams](https://tools.ietf.org/html/rfc919)
157
+
158
+
### Description
159
+
160
+
The limited broadcast address 255.255.255.255 is used to send packets to all hosts on the local network segment. This address is never forwarded by routers and is used for network-wide announcements and discovery protocols.
0 commit comments