Hacker Read top | best | new | newcomments | leaders | about | bookmarklet login

I think you have missed that a IP4.4 packet would be a valid IP4 packet. The first 4 octets of the 4.4 address are where IP4 expects them to be. The router at this IP4 address needs to understand IP4.4, but routers before do not. The additional octets are smuggled within the IP4 options header.


sort by: page size:

Are you saying a valid IPv4 address can not have a value of 0 in the 4th octet? That is not true at all.

Their test cases don’t include alternative ipv4 representations, e.g 127.1 is a valid IP address.

From wikipedia: “When fewer than four numbers are specified in the address in dotted notation, the last value is treated as an integer of as many bytes as are required to fill out the address to four octets. (https://en.wikipedia.org/wiki/Internet_Protocol_version_4)


An IPv4 address is a 32 bit number. The 4 octet representation is just meant for humans, it doesn't even look like that in an IPv4 packet header.

That’s correct behaviour fwiw - there are many ways to write valid IPv4 addresses which aren’t necessarily intuitive

An IPv4 address isn't A.B.C.D though. That's just a shorthand way for us write it down because those chunks are easier for us to deal with. An IPv4 address is an unsigned 32 bit integer.

The address is not the real issue. An IPv4 header contains 32 bits for the source address and 32 bits for the destination address. That's what needed to be extended. IPv4 implementations expect the destination address to be 32 bits after the source address.

Any fix you can think of to extend the address fields in the header will fall into the situation of having an additional protocol. Because changing the v4 header and calling it a v4 header would probably get your packet dropped as bad. Or have it being sent to somewhere else. Or some other undefined behavior.

So your best option is to have it identify as a new version. Yes, v4 implementations will reject your packet, but that's what you want in this case.


Still makes a little sense as IPv4 addresses are 32 bytes and we break them down into 4 parts of 8 bits each. No one ever uses the 32 byte number, which will resolve.

IPv4 addresses are 32 bits, or 4 bytes. "octet" still isn't useful there.

I understand what you're saying, but isn't IP supposed to be about routing things around failure points? So routers that "know" IP 4.4 would "know" what routers aren't 4.4.

Routers just need to treat packets to 8.8.8.8 as "send this to the DNS server".

Seriously. IPv4=8.8.8.8 means "this goes to the DNS server". The DNS server helps you find all the other IP addresses you need, which is why this one is special. One DNAT rule, one SNAT rule, and you're done.

IMO IP should have had this feature from day one.


Yes that's what I meant. The best size from Ipv4 is 4 bytes. Its better instead of using 111.111.111.111

Ethernet frames start with the destination mac address, IP payloads start with the version. It appears that in some networking equipment, there are places where it may have a ethernet frame or an IP playload and uses the first four bits to determine: if it starts with 4, it treats it as IPv4, and 6, IPv6.

So if it gets an ethernet frame destined for your address starting with 4 or 6, it will think it's actually an IP payload, and discard it because it doesn't validate as a IP packet or otherwise misdirect it.

Edit to add: In MPLS networks, 'P routers' (core routers) by design don't know if the payload is Ethernet or IP; but may want to peak into the payload to do hashed traffic balancing or validating packets before forwarding. Hashing the packet as an IP packet when it's an ethernet packet is problematic because you want all packets on a given TCP connection to have the same hash value -- but since you misidentified the type of packet, the bytes used as input to the hash aren't static for a given connection so different packets in the connection may take different paths and may arrive out of order.


I guess because it's not simply a text address, it's a protocol where a specific number of bytes in the packet (4 in this case) are dedicated for IP, you can't just simply modify this.

I expected IPv4 addresses

Integers are valid representations of the IP address. Why is this a shock to anyone? Most IPv4 software also still accepts dotted quads in a string...

That article is focused on ping and glibc but the reason why this works is fundamental to IPv4 itself.

All IPv4 address are 32 bit addresses. That's why each number of an IPv4 address that people are familiar with are called octets. They represent 8 bits of the 32 bit address. So if you have 127.0.0.1, then the first octet is 127, the second is 0 and so on.

Any representation of this 32 bit number (including the most familiar A.B.C.D format) is a kind of short-hand for representing that 32 bit number.

I tried finding a link to a particular site that was phenomenal for learning the entire TCP/IP stack but I haven't seen that site since at least 1998.

But basically, if you want to spend time learning about IPv4 right before IPv6 becomes the dominant standard, then look into how hosts use the combination of IP address and subnet mask to determine if something is on the local network, how hosts use ARP to translate a 32 bit IP address into a MAC address and all the other low level protocols.


An IPv4 address is a 32 bit integer. It's a number that can be represented in various ways. Been that way for decades now.

As I understand IPv4+ concept in this article, your router gets address 1.2.3.4 then every device behind it gets 1.2.3.4.0.0.0.1, etc.

This is the bit that wasn't in djb's original article AFAIR. My take was that 1.2.3.4 and 1.2.3.4.0.0.0.1 would be the same machine -- or at least allocated to the same entity.


IPv4 addresses are written in base 10 for human users.

The "special" case is supporting network addresses to be written as 10.2932832 ("convenient" for class A's), 172.16.61031 (ditto for B's), or just one big address like 39282329, when we're used to 4 octets separated by dots.

Not every bit of host software supports these cases anymore, as basically their sole remaining use case is as a curiosity or to circumvent bad security controls.


I'll be that guy. Glad to know I'm not the only one who just wants ipv4 with extra octets.

Edit: An aside, these addresses are different in both text or binary representation, but the article doesn't provide many details, so I can't entirely follow.

next

Legal | privacy