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

1045 questions
6
votes
1 answer

IPv6 lookup data structure

A patricia trie is the well-know, recommended data structure for storing IPv4 allocations/assignments and performing lookup. Is this true for IPv6 adddresses too? Just a deeper/taller trie to accommodate the extra 96 bits? Is the trie still…
SnickersAreMyFave
  • 5,047
  • 8
  • 26
  • 24
6
votes
3 answers

Java application wanting to use both Inet4Address and Inet6Address at the same time

I have a Java application that needs to connect via sockets to two different servers on two separate machines. One server has been configured to listen on IPv4 connections, while the other has been configured to listen on IPv6 connections. Now,…
His
  • 5,891
  • 15
  • 61
  • 82
6
votes
4 answers

Convert IP between IPv4 and numerical format in java

An IPv4 can have more representations: as string (a.b.c.d) or numerical (as an unsigned int of 32 bits). (Maybe other, but I will ignore them.) Is there any built in support in Java (8), simple and easy to use, without network access, to convert…
Costin
  • 2,699
  • 5
  • 25
  • 43
6
votes
1 answer

Any better way to check string for valid IPv4 and IPv6?

I have the following task: Identify if the string has a valid IPv4 or IPv6 address using just the default modules. I've found an interesting method using socket module here it is: import socket ip = '10.1.0.10' try: # test for IPv4 …
Attila
  • 87
  • 1
  • 7
6
votes
1 answer

Getting the ip address of eth0 interface in java only return IPv6 address and not IPv4

I wrote the following code to get the IPv4 address of the eth0 interface I am using on a machine. However the code only finds fe80:x:x:x:xxx:xxxx:xxxx:xxxx which is not returned since I am looking for the IPv4 address. Here is the code. …
jgr208
  • 2,896
  • 9
  • 36
  • 64
6
votes
4 answers

Converting an IP address to a number:

Question: When I convert the IP address 192.168.115.67 to a number, is it done like this: 192*2563 + 168*2562+115*2561+67*2560 = 3232265027 or like this: 192*2560 + 168*2561+115*2562+67*2563 = 1131653312 I find both variants online, and frankly it…
Stefan Steiger
  • 78,642
  • 66
  • 377
  • 442
6
votes
2 answers

Nginx proxy pass - disable ipv6

I have nginx conf as follows: server { listen 127.0.0.1:8080; server_name 127.0.0.1; client_max_body_size 20m; include /etc/nginx/conf.d/services/*.conf; # redirect server error pages to the static page /50x.html …
6
votes
2 answers

Socket listener for IPv6 and IPv4

I ported an application to support IPv6, using popular tutorials. I decided to use only one socket listener for both protocols. Now I realized I have to set IPV6_V6ONLY properly (it's only working on my x86 linux out of the box, but not on my…
duedl0r
  • 9,289
  • 3
  • 30
  • 45
6
votes
2 answers

Python urllib2 force IPv4

I am running a script using python that uses urllib2 to grab data from a weather api and display it on screen. I have had the problem that when I query the server, I get a "no address associated with hostname" error. I can view the output of the api…
TheDoctor
  • 1,450
  • 2
  • 17
  • 28
6
votes
4 answers

Python - parse IPv4 addresses from string (even when censored)

Objective: Write Python 2.7 code to extract IPv4 addresses from string. String content example: The following are IP addresses: 192.168.1.1, 8.8.8.8, 101.099.098.000. These can also appear as 192.168.1[.]1 or 192.168.1(.)1 or 192.168.1[dot]1 or…
nephos
  • 123
  • 1
  • 2
  • 8
6
votes
9 answers

get local IPv4 of computer using VB.net

I'm trying to get the ip address of my local PC, and one one of my other PCs it gets the v4 address fine, but on this one the code: Dns.GetHostEntry(Dns.GetHostName).AddressList(0).ToString() returns what I guess is a IPv6…
Jonathan.
  • 53,997
  • 54
  • 186
  • 290
6
votes
3 answers

the windows phone emulator wasn't able to create the virtual machine

I just installed it on my windows 8. It's NOT running on a VM but is running at a macbook with bootcamp. When I try to emulate my app, I get this first error: But then I click "Retry" and give the permission, so it runs normally. But then, when…
user1952219
6
votes
1 answer

Force InetAddress.getHostAddress() to return IPv4 address

I'm using a library that uses java.net.InetAddress.getLocalHost().getHostAddress() to get my local IP address. However, this always returns an IPv6 address on my computer (Gentoo Linux, JDK 1.6.0_37). The address is further used in a context which…
Bob
  • 5,510
  • 9
  • 48
  • 80
6
votes
2 answers

C# server that supports IPv6 and IPv4 on the same port

Is it possible to have a Socket that listens and accepts both IPv6 and IPv4 clients? I used a IPv6 socket in C# hoping that it would automatically be backwards compatible but IPv4 clients cause an invalid ip address exception.
Christopher Tarquini
  • 11,176
  • 16
  • 55
  • 73
6
votes
5 answers

Lua function check if ipv4 or ipv6 or string

I'd like to have a function that I can pass a whitespace trimmed string to and it will return 0 for error (not a string) 1 for ipv4 2 for ipv6 3 for a string thats not an ip. Ipv6 has these rules: Ipv6 is represented by 8 groups of 16-bit…
Col_Blimp
  • 779
  • 2
  • 8
  • 26