Groups | Search | Server Info | Keyboard shortcuts | Login | Register [http] [https] [nntp] [nntps]


Groups > comp.lang.php > #4937 > unrolled thread

PHP socket and NAT

Started by"SL" <sb5309@hotmail.com>
First post2012-02-23 16:58 +0800
Last post2012-02-23 13:50 +0000
Articles 8 on this page of 28 — 10 participants

Back to article view | Back to comp.lang.php


Contents

  PHP socket and NAT "SL" <sb5309@hotmail.com> - 2012-02-23 16:58 +0800
    Re: PHP socket and NAT Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-02-23 11:32 +0100
      Re: PHP socket and NAT Captain Paralytic <paul_lautman@yahoo.com> - 2012-02-23 02:41 -0800
        Re: PHP socket and NAT Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-02-23 11:53 +0100
      Re: PHP socket and NAT Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-02-23 11:52 +0100
        Re: PHP socket and NAT "sl@exabyte" <sb5309@hotmail.com> - 2012-02-23 21:04 +0800
          Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-23 13:37 +0000
    Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-23 11:40 +0000
    Re: PHP socket and NAT Jerry Stuckle <jstucklex@attglobal.net> - 2012-02-23 08:00 -0500
      Re: PHP socket and NAT "sl@exabyte" <sb5309@hotmail.com> - 2012-02-23 21:09 +0800
        Re: PHP socket and NAT Captain Paralytic <paul_lautman@yahoo.com> - 2012-02-23 05:19 -0800
          Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-23 13:53 +0000
            Re: PHP socket and NAT Captain Paralytic <paul_lautman@yahoo.com> - 2012-02-23 06:25 -0800
              Re: PHP socket and NAT Michael Fesser <netizen@gmx.de> - 2012-02-23 18:28 +0100
              Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-23 20:42 +0000
            Re: PHP socket and NAT "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-02-24 11:58 +0100
          Re: PHP socket and NAT "SL" <sb5309@hotmail.com> - 2012-02-24 00:03 +0800
            Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-23 20:44 +0000
            Re: PHP socket and NAT "M. Strobel" <sorry_no_mail_here@nowhere.dee> - 2012-02-24 12:07 +0100
              Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-24 13:22 +0000
                Re: PHP socket and NAT Tim Streater <timstreater@greenbee.net> - 2012-02-24 14:20 +0000
                  Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-24 15:39 +0000
                    Re: PHP socket and NAT Tim Streater <timstreater@greenbee.net> - 2012-02-24 18:53 +0000
                      Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-24 21:04 +0000
                        Re: PHP socket and NAT Tim Streater <timstreater@greenbee.net> - 2012-02-24 21:41 +0000
                      Re: PHP socket and NAT "Peter H. Coffin" <hellsop@ninehells.com> - 2012-02-26 12:50 -0600
        Re: PHP socket and NAT Erwin Moller <erwinmollerusenet@xs4all.nl> - 2012-02-23 14:37 +0100
        Re: PHP socket and NAT The Natural Philosopher <tnp@invalid.invalid> - 2012-02-23 13:50 +0000

Page 2 of 2 — ← Prev page 1 [2]


#4977

FromTim Streater <timstreater@greenbee.net>
Date2012-02-24 14:20 +0000
Message-ID<timstreater-240A5E.14201524022012@news.individual.net>
In reply to#4972
In article <ji82v9$jsa$2@news.albasani.net>,
 The Natural Philosopher <tnp@invalid.invalid> wrote:

> M. Strobel wrote:
> > Am 23.02.2012 17:03, schrieb SL:
> >>> No they don't, the local network will not allow it. They will have
> >>> different IP addresses.
> >> Sorry, folks. When  I say same IP, I mean the external IP.
> >>
> >> I am trying to add something to a chat application; a server is involved 
> >> here, eg user initiates connection to a chat server (via internet), where 
> >> the server routes the messages (I think you gurus know what I mean).
> >>
> >> Thanks. 
> >>
> >>
> > 
> > In the case where the clients connect to the server, there is absolutely no 
> > problem
> > with NAT, it is just transparent. The server responds to these connections 
> > like to
> > any other. Remember: HTTP establishes a TCP connection, and here the 
> > endpoints (=
> > sockets) are identified by ip-address and port number: IP address in the IP 
> > header,
> > port number in the TCP header.
> > 
> > A problem with NAT is to start a connection from the internet to a station 
> > on the LAN
> > through the NAT router. Many call this problem a security feature.
> > 
> 
> Probably because that is exactly what it is.
> 
> All arising out of the perception that SEVERS need connections but 
> DESKTOPS only make them.
> 
> Plus a global shortage of IP addresses...

Until v6 at any rate - not that you hear ISPs talking about that.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#4982

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-24 15:39 +0000
Message-ID<ji8aun$5et$2@news.albasani.net>
In reply to#4977
Tim Streater wrote:
> In article <ji82v9$jsa$2@news.albasani.net>,
> The Natural Philosopher <tnp@invalid.invalid> wrote:
> 
>> M. Strobel wrote:
>> > Am 23.02.2012 17:03, schrieb SL:
>> >>> No they don't, the local network will not allow it. They will have
>> >>> different IP addresses.
>> >> Sorry, folks. When  I say same IP, I mean the external IP.
>> >>
>> >> I am trying to add something to a chat application; a server is 
>> involved >> here, eg user initiates connection to a chat server (via 
>> internet), where >> the server routes the messages (I think you gurus 
>> know what I mean).
>> >>
>> >> Thanks. >>
>> >>
>> > > In the case where the clients connect to the server, there is 
>> absolutely no > problem
>> > with NAT, it is just transparent. The server responds to these 
>> connections > like to
>> > any other. Remember: HTTP establishes a TCP connection, and here the 
>> > endpoints (=
>> > sockets) are identified by ip-address and port number: IP address in 
>> the IP > header,
>> > port number in the TCP header.
>> > > A problem with NAT is to start a connection from the internet to a 
>> station > on the LAN
>> > through the NAT router. Many call this problem a security feature.
>> >
>> Probably because that is exactly what it is.
>>
>> All arising out of the perception that SEVERS need connections but 
>> DESKTOPS only make them.
>>
>> Plus a global shortage of IP addresses...
> 
> Until v6 at any rate - not that you hear ISPs talking about that.
> 
You do, but *quietly*.

There are not a few IPV6 machines out there.

[toc] | [prev] | [next] | [standalone]


#4991

FromTim Streater <timstreater@greenbee.net>
Date2012-02-24 18:53 +0000
Message-ID<timstreater-24E9BB.18533624022012@news.individual.net>
In reply to#4982
In article <ji8aun$5et$2@news.albasani.net>,
 The Natural Philosopher <tnp@invalid.invalid> wrote:

> Tim Streater wrote:
> > In article <ji82v9$jsa$2@news.albasani.net>,
> > The Natural Philosopher <tnp@invalid.invalid> wrote:
> > 
> >> M. Strobel wrote:
> >> > Am 23.02.2012 17:03, schrieb SL:
> >> >>> No they don't, the local network will not allow it. They will have
> >> >>> different IP addresses.
> >> >> Sorry, folks. When  I say same IP, I mean the external IP.
> >> >>
> >> >> I am trying to add something to a chat application; a server is 
> >> involved >> here, eg user initiates connection to a chat server (via 
> >> internet), where >> the server routes the messages (I think you gurus 
> >> know what I mean).
> >> >>
> >> >> Thanks. >>
> >> >>
> >> > > In the case where the clients connect to the server, there is 
> >> absolutely no > problem
> >> > with NAT, it is just transparent. The server responds to these 
> >> connections > like to
> >> > any other. Remember: HTTP establishes a TCP connection, and here the 
> >> > endpoints (=
> >> > sockets) are identified by ip-address and port number: IP address in 
> >> the IP > header,
> >> > port number in the TCP header.
> >> > > A problem with NAT is to start a connection from the internet to a 
> >> station > on the LAN
> >> > through the NAT router. Many call this problem a security feature.
> >> >
> >> Probably because that is exactly what it is.
> >>
> >> All arising out of the perception that SEVERS need connections but 
> >> DESKTOPS only make them.
> >>
> >> Plus a global shortage of IP addresses...
> > 
> > Until v6 at any rate - not that you hear ISPs talking about that.
> > 
> You do, but *quietly*.
> 
> There are not a few IPV6 machines out there.

True, and the Europe-wide network we put together at my last job was all 
dual-stack. But trying to get native v6 connections from commodity IP 
providers such as COLT, Telia, Sprint, etc, was met with the equivalent 
of "Not much call for that round here, Squire!". Mind you that was in 
2008 and earlier, it may have improved since then. The fact that the 
last /8 blocks have now been handed out may concentrate their minds a 
bit.

We'll need new ADSL routers or hopefully just firmware upgrades, though.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#4993

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-24 21:04 +0000
Message-ID<ji8u1p$f4n$1@news.albasani.net>
In reply to#4991
Tim Streater wrote:
> In article <ji8aun$5et$2@news.albasani.net>,
> The Natural Philosopher <tnp@invalid.invalid> wrote:
> 
>> Tim Streater wrote:
>> > In article <ji82v9$jsa$2@news.albasani.net>,
>> > The Natural Philosopher <tnp@invalid.invalid> wrote:
>> > >> M. Strobel wrote:
>> >> > Am 23.02.2012 17:03, schrieb SL:
>> >> >>> No they don't, the local network will not allow it. They will have
>> >> >>> different IP addresses.
>> >> >> Sorry, folks. When  I say same IP, I mean the external IP.
>> >> >>
>> >> >> I am trying to add something to a chat application; a server is 
>> >> involved >> here, eg user initiates connection to a chat server 
>> (via >> internet), where >> the server routes the messages (I think 
>> you gurus >> know what I mean).
>> >> >>
>> >> >> Thanks. >>
>> >> >>
>> >> > > In the case where the clients connect to the server, there is 
>> >> absolutely no > problem
>> >> > with NAT, it is just transparent. The server responds to these >> 
>> connections > like to
>> >> > any other. Remember: HTTP establishes a TCP connection, and here 
>> the >> > endpoints (=
>> >> > sockets) are identified by ip-address and port number: IP address 
>> in >> the IP > header,
>> >> > port number in the TCP header.
>> >> > > A problem with NAT is to start a connection from the internet 
>> to a >> station > on the LAN
>> >> > through the NAT router. Many call this problem a security feature.
>> >> >
>> >> Probably because that is exactly what it is.
>> >>
>> >> All arising out of the perception that SEVERS need connections but 
>> >> DESKTOPS only make them.
>> >>
>> >> Plus a global shortage of IP addresses...
>> > > Until v6 at any rate - not that you hear ISPs talking about that.
>> > You do, but *quietly*.
>>
>> There are not a few IPV6 machines out there.
> 
> True, and the Europe-wide network we put together at my last job was all 
> dual-stack. But trying to get native v6 connections from commodity IP 
> providers such as COLT, Telia, Sprint, etc, was met with the equivalent 
> of "Not much call for that round here, Squire!". Mind you that was in 
> 2008 and earlier, it may have improved since then. The fact that the 
> last /8 blocks have now been handed out may concentrate their minds a bit.
> 
There's a lot of action on it..most new machines can handle the stack 
and the rest of it..many but not all ISPs are routing it.

Its a bit like digital telly. When that started you had to get a sky 
dish, then you COULD bolt a set top box on the side, now its de rigeur..

I would say we will all be IPv6 within 10 years except a few islands 
behind NAT firewalls


> We'll need new ADSL routers or hopefully just firmware upgrades, though.
> 

Not sure. I think a lot of DNS things will return IPV6 stuff 
already..the core internet is offering it in parallel.

[toc] | [prev] | [next] | [standalone]


#4996

FromTim Streater <timstreater@greenbee.net>
Date2012-02-24 21:41 +0000
Message-ID<timstreater-5CFE20.21414624022012@news.individual.net>
In reply to#4993
In article <ji8u1p$f4n$1@news.albasani.net>,
 The Natural Philosopher <tnp@invalid.invalid> wrote:

> Tim Streater wrote:

> > We'll need new ADSL routers or hopefully just firmware upgrades, though.
> 
> Not sure. I think a lot of DNS things will return IPV6 stuff 
> already..the core internet is offering it in parallel.

Actually even my DG834 is a linux box so I imagine its all there really, 
just needs turning on. But there's nothing in any of the displays about 
it.

-- 
Tim

"That excessive bail ought not to be required, nor excessive fines imposed,
nor cruel and unusual punishments inflicted"  --  Bill of Rights 1689

[toc] | [prev] | [next] | [standalone]


#5015

From"Peter H. Coffin" <hellsop@ninehells.com>
Date2012-02-26 12:50 -0600
Message-ID<slrnjkkvmp.rcn.hellsop@nibelheim.ninehells.com>
In reply to#4991
On Fri, 24 Feb 2012 18:53:36 +0000, Tim Streater wrote:
> True, and the Europe-wide network we put together at my last job was all 
> dual-stack. But trying to get native v6 connections from commodity IP 
> providers such as COLT, Telia, Sprint, etc, was met with the equivalent 
> of "Not much call for that round here, Squire!". Mind you that was in 
> 2008 and earlier, it may have improved since then. 

Nope. Hasn't.

> The fact that the last /8 blocks have now been handed out may
> concentrate their minds a bit.
>
> We'll need new ADSL routers or hopefully just firmware upgrades,
> though.

More likely to get routers that can handle much larger state tables for
v4 routing instead. (; The "worldwide shortage of IP addresses" fails to
account for that big enough state tables can put 10.*.*.* behind every
enpoint IP addess out there, especially if most of the traffic is
internal anyway.

-- 
For every subject you can think of there are at least 3 web sites.
The owners of these web sites know each other and at least one of
them hates at least one of the others.
                -- mnlooney's view of Skif's Internet Theorem

[toc] | [prev] | [next] | [standalone]


#4953

FromErwin Moller <erwinmollerusenet@xs4all.nl>
Date2012-02-23 14:37 +0100
Message-ID<4f464120$0$6863$e4fe514c@news2.news.xs4all.nl>
In reply to#4946
On 2/23/2012 2:09 PM, sl@exabyte wrote:
>>
>> I'm assuming you're talking about talking to two people on a remote
>> LAN, and that LAN uses NAT to connect to the internet.
>>
>> The first question is - who's connecting to whom?
>>
>> If the remote systems are connecting to you, then there's no problem.
>> However, if you are trying to connect to them, there's a lot more work
>> involved.  The router must be set up with port forwarding and you have
>> to connect to the correct port to forward to the proper machine.
>>
>> You can find more information in a TCP/IP newsgroup.
>
> I am thinking of the scenario where I am talking to 2 persons via the
> internet, and these 2 persons are in the same LAN, something like chatting.
> So the problem in my mind is that these 2 persons have the same IP.

You don't have to worry about that.
On the same LAN you will have a problem when 2 persons have the same IP 
address.
It is forbidden and the Bit-police will find you and throw you into the 
Valley of the Lost Bits!

I think you better tell us exactly what your situation is and how these 
clients are connected (VPN? Internet? Plain LAN?).
It is a little confusing (for me) you keep talking about the internet 
and LAN as if they are interchangeable.
You CAN set up a LAN that connects remote locations and make them act as 
if they were in the same physical location/LAN, but then you still 
cannot have 2 identical IP address.

Regards,
Erwin Moller

>
> Thanks.
>
>


-- 
"That which can be asserted without evidence, can be dismissed without 
evidence."
-- Christopher Hitchens

[toc] | [prev] | [next] | [standalone]


#4955

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-23 13:50 +0000
Message-ID<ji5g7l$ro1$1@news.albasani.net>
In reply to#4946
sl@exabyte wrote:
>> I'm assuming you're talking about talking to two people on a remote
>> LAN, and that LAN uses NAT to connect to the internet.
>>
>> The first question is - who's connecting to whom?
>>
>> If the remote systems are connecting to you, then there's no problem.
>> However, if you are trying to connect to them, there's a lot more work
>> involved.  The router must be set up with port forwarding and you have
>> to connect to the correct port to forward to the proper machine.
>>
>> You can find more information in a TCP/IP newsgroup.
> 
> I am thinking of the scenario where I am talking to 2 persons via the 
> internet, and these 2 persons are in the same LAN, something like chatting. 
> So the problem in my mind is that these 2 persons have the same IP.
> 

Well the whole point of NAT security wise is that you CANNOT talk to 
them  directly from OUTSIDE. THEY must open a dialogue from inside that 
NAT firewall. Then you can respond to them on whatever port they picked 
- or their router picked for them.

Unless you set things up so they will answer on different PORT numbers.

using passthrough on the router etc.

The way you normally do chat is to have a server in the middle, so that 
everybody 'connects' to that server, and the server then maintains a 
table of who is on what ip address and port..and can send the data back 
to them.

But a web server is not the way to do that in real time - rather you 
need a purpose built daemon to vector chat messages to people. If you 
want real time.

If you are happy to have the client poll, well then its pretty simple - 
they connect to your web server using  a cookie or GET  or POST variable 
   to ID themselves, and any messages for them get added to their view 
when next they poll the server. You can speed that up and make it more 
efficient with javascript or i-frames and so on.

I am still unclear as to what you want to do, but the key thing is you 
cant 'push' unsolicited data to a NAT  translated machine from outside. 
That machine MUST request the data.

And that means that the person you want to talk to must have an active 
live running connection that he has initiated, to your server. And keep 
polling it.

Because web BROWSERS don't accept data they haven't requested either. 
They only 'listen' for as long as it takes to get a response they 
expect. They may keep the TCP/IP connection alive between times, but 
they are not necessarily listening on it. And in any case its not 
reliable behaviour.

Because they may not.






	



> Thanks. 
> 
> 

[toc] | [prev] | [standalone]


Page 2 of 2 — ← Prev page 1 [2]

Back to top | Article view | comp.lang.php


csiph-web