Questions tagged [ipv4]

IPv4 is the "old style" IP protocol currently used in most circumstances.

IPv4 is the protocol which has been in use since the early 1980s, described in IETF publication RFC791. It gets gradually replaced with nowadays as the IPv4 addresses become exhausted.

More information at http://en.wikipedia.org/wiki/Ipv4

953 questions
219
votes
11 answers

What is the largest Safe UDP Packet Size on the Internet

I've read a number of articles about UDP packet sizes but have been unable to come to a conclusion on whats correct. A number of services restrict the largest UDP packet to 512 bytes (like dns) Given the minimum MTU on the internet is 576 , and the…
K M
  • 2,924
  • 3
  • 19
  • 17
117
votes
5 answers

What is IPV6 for localhost and 0.0.0.0?

As we all know the IPv4 address for localhost is 127.0.0.1 (loopback address). What is the IPv6 address for localhost and for 0.0.0.0 as I need to block some ad hosts.
Killerbeans
  • 1,303
  • 2
  • 6
  • 6
113
votes
37 answers

Validating IPv4 addresses with regexp

I've been trying to get an efficient regex for IPv4 validation, but without much luck. It seemed at one point I had had it with (25[0-5]|2[0-4][0-9]|[01]?[0-9][0-9]?(\.|$)){4}, but it produces some strange results: $ grep --version grep (GNU grep)…
Matthieu Cartier
  • 1,481
  • 4
  • 13
  • 15
111
votes
22 answers

How to convert an IPv4 address into a integer in C#?

I'm looking for a function that will convert a standard IPv4 address into an Integer. Bonus points available for a function that will do the opposite. Solution should be in C#.
GateKiller
  • 68,419
  • 71
  • 167
  • 203
68
votes
5 answers

How do I choose a multicast address for my application's use?

How should I choose an IPv4 multicast address for my application's use? I may need more than one (a whole range perhaps ultimately) but just want to avoid conflicts with other applications. Packets will be entirely contained within an…
MarkR
  • 59,334
  • 14
  • 109
  • 144
66
votes
13 answers

What is the most appropriate data type for storing an IP address in SQL server?

What should be the most recommended datatype for storing an IPv4 address in SQL server? Or maybe someone has already created a user SQL data-type (.Net assembly) for it? I don't need sorting.
Shimmy Weitzhandler
  • 92,920
  • 119
  • 388
  • 596
58
votes
4 answers

How to support both IPv4 and IPv6 connections

I'm currently working on a UDP socket application and I need to build in support so that IPV4 and IPV6 connections can send packets to a server. I was hoping that someone could help me out and point me in the right direction; the majority of the…
Charles
  • 2,457
  • 3
  • 27
  • 34
56
votes
5 answers

What is the total amount of public IPv4 addresses?

Yes, I am needing to know what the total number possible IPs in the public IPv4 space. I'm not sure where to even get a neat list of all the IP address ranges, so could someone point me to a resource to calculate this myself or calculate the total…
Earlz
  • 57,517
  • 89
  • 275
  • 484
51
votes
7 answers

Get IPv4 addresses from Dns.GetHostEntry()

I've got some code here that works great on IPv4 machines, but on our build server (an IPv6) it fails. In a nutshell: IPHostEntry ipHostEntry = Dns.GetHostEntry(string.Empty); The documentation for GetHostEntry says that passing in string.Empty…
zombat
  • 87,352
  • 23
  • 152
  • 163
44
votes
9 answers

Get local network interface addresses using only proc?

How can I obtain the (IPv4) addresses for all network interfaces using only proc? After some extensive investigation I've discovered the following: ifconfig makes use of SIOCGIFADDR, which requires open sockets and advance knowledge of all the…
Matt Joiner
  • 100,604
  • 94
  • 332
  • 495
36
votes
6 answers

How to set java.net.preferIPv4Stack=true at runtime?

I need to disable IPv6. For that the java documentation indicates setting jvm property java.net.preferIPv4Stack=true. But I don't understand how to do it from the code itself. Many forums demonstrated doing it from the command prompt, but I need to…
Caffeinated Coder
  • 642
  • 1
  • 8
  • 22
36
votes
5 answers

Configure git to use IPv4 instead of IPv6 by default

Checking the environment variables and also HTTP configuration options does not reveal something. Is there a way to do this?
nobeh
  • 8,930
  • 5
  • 46
  • 63
34
votes
4 answers

How can I verify that a string is a valid IPv4 or IPv6 address in batch?

I need to verify if a string is a valid IPv4 or IPv6 address in a Batch script, but apparently Batch doesn't have an easy way to parse an IP address. How can I do this in Batch without using external tools? By "external tools" I mean things that…
ThePirate42
  • 783
  • 4
  • 18
31
votes
3 answers

IIS Request.UserHostAddress returning IPV6 (::1), even when IPV6 disabled

In the properties section of my network card, on windows server 2008, i have IPV6 disabled, leaving only IPV4 enabled. However in ASP.NET, Request.UserHostAddress returns '::1', an IPV6 address. Has anyone got any idea how to revert back to IPV4?
maxp
  • 21,629
  • 35
  • 115
  • 191
31
votes
8 answers

How to configure a static IP address, netmask, gateway programmatically on Android 3.x or 4.x

I have checked in Stack Overflow question API for configuring static IP addresses in an Android application. It works until Android 2.3. However, there is no luck on a higher API level. For example, I put the…
Yeung
  • 2,022
  • 1
  • 24
  • 46
1
2 3
63 64