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 20 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 1 of 2  [1] 2  Next page →


#4937 — PHP socket and NAT

From"SL" <sb5309@hotmail.com>
Date2012-02-23 16:58 +0800
SubjectPHP socket and NAT
Message-ID<ji4v4e$lnm$1@news.albasani.net>
This is not strictly a PHP question, it just springs into my mind while 
coding sockets in PHP.

Assuming that I am communicating with 2 persons who are in the same LAN, say 
A & B.

When I send some data to A, do I have to take care of the NAT (network 
address translation) ?

Will the sockets take care of it automatically ?

Thanks. 

[toc] | [next] | [standalone]


#4938

FromErwin Moller <erwinmollerusenet@xs4all.nl>
Date2012-02-23 11:32 +0100
Message-ID<4f4615aa$0$6915$e4fe514c@news2.news.xs4all.nl>
In reply to#4937
On 2/23/2012 9:58 AM, SL wrote:
> This is not strictly a PHP question, it just springs into my mind while
> coding sockets in PHP.
>
> Assuming that I am communicating with 2 persons who are in the same LAN, say
> A&  B.
>
> When I send some data to A, do I have to take care of the NAT (network
> address translation) ?
>
> Will the sockets take care of it automatically ?
>
> Thanks.
>
>

Hi,


NAT typically is used to change IP-addresses (and maybe port).
If A and B are in the same LAN I expect they can address each other 
directly.
For example:
A IP: 192.168.178.22
B IP: 192.168.178.25

Once you go outside your LAN, you (might) need NAT.

And sockets have little to do with NAT.
A IP package arrives at a certain IP on a certain port: If some socket 
is listening on that port on that machine, the package will be handled 
by the listening process.

NAT itself is performed by routers and such, not by some service 
listening to a port.

SO in short: No you have to care about it.

Disclaimer: If you are talking IP6, things are different.

Regards,
Erwin Moller

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

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


#4939

FromCaptain Paralytic <paul_lautman@yahoo.com>
Date2012-02-23 02:41 -0800
Message-ID<0f0be910-61b4-46a5-9fb2-8af3aa4e6968@p21g2000yqm.googlegroups.com>
In reply to#4938
On Feb 23, 10:32 am, Erwin Moller <erwinmolleruse...@xs4all.nl> wrote:
> SO in short: No you have to care about it.
I think you meant to say:
"No you do not have to care about it."

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


#4941

FromErwin Moller <erwinmollerusenet@xs4all.nl>
Date2012-02-23 11:53 +0100
Message-ID<4f461a9d$0$6942$e4fe514c@news2.news.xs4all.nl>
In reply to#4939
On 2/23/2012 11:41 AM, Captain Paralytic wrote:
> On Feb 23, 10:32 am, Erwin Moller<erwinmolleruse...@xs4all.nl>  wrote:
>> SO in short: No you have to care about it.
> I think you meant to say:
> "No you do not have to care about it."
>

Yes indeed!
Thanks for correcting.

Regards,
Erwin Moller

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

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


#4940

FromErwin Moller <erwinmollerusenet@xs4all.nl>
Date2012-02-23 11:52 +0100
Message-ID<4f461a60$0$6942$e4fe514c@news2.news.xs4all.nl>
In reply to#4938
On 2/23/2012 11:32 AM, Erwin Moller wrote:
> On 2/23/2012 9:58 AM, SL wrote:
>> This is not strictly a PHP question, it just springs into my mind while
>> coding sockets in PHP.
>>
>> Assuming that I am communicating with 2 persons who are in the same
>> LAN, say
>> A& B.
>>
>> When I send some data to A, do I have to take care of the NAT (network
>> address translation) ?
>>
>> Will the sockets take care of it automatically ?
>>
>> Thanks.
>>
>>
>
> Hi,
>
>
> NAT typically is used to change IP-addresses (and maybe port).
> If A and B are in the same LAN I expect they can address each other
> directly.
> For example:
> A IP: 192.168.178.22
> B IP: 192.168.178.25
>
> Once you go outside your LAN, you (might) need NAT.
>
> And sockets have little to do with NAT.
> A IP package arrives at a certain IP on a certain port: If some socket
> is listening on that port on that machine, the package will be handled
> by the listening process.
>
> NAT itself is performed by routers and such, not by some service
> listening to a port.
>
> SO in short: No you have to care about it.
>
> Disclaimer: If you are talking IP6, things are different.
>
> Regards,
> Erwin Moller
>

An additional example of NAT that makes things clear.
This is how it was explained to me when I wanted to know about NAT.

Suppose you have 10 computers on your LAN, and 1 internet gateway (some 
ADSL modem for example).
All you 10 computers can connect to the internet because they use the 
routers IP address as the gateway.

The router has an INTERNAL (LAN-side) IP address.
Let's say this LAN-IP is 192.168.178.1

The router also has an EXTERNAL (Internet-side) IP address.
Let's say internet-side IP is 69.147.94.94. (I made the numbers up)

Now, suppose a few people on the LAN are visiting some websites.
Suppose compA has IP address 192.168.178.22. (On the LAN)
Suppose compA has IP address 192.168.178.50. (On the LAN)

CompA (192.168.178.22): requests www.google.com
CompB: (192.168.178.50)requests www.php.net

The router receives these requests from the LAN side, and sends the 
requests to www.google.com and www.php.net.
The servers from Google and PHP answer the requests, and send them back 
to the router's IP address (being 69.147.94.94).

Now the problem: How should the router handle these answers? Should it 
send them to 192.168.178.22 or 192.168.178.50, or even another IP on the 
LAN?

This is where NAT comes into the picture.
It works like this:
1) Router receives request from 192.168.178.22 (=LAN)for www.google.com.
2) Router thinks up some random port that is not is use, eg 33000.
3) Router stores this portnumber (33000) in a table together with the 
requesting LAN IP-address (192.168.178.22).
4) Router sends the request to www.google.com TOGETHER with the 
instruction to answer on port 33000.
5) When Google answers, the router looks up the portnumber, ans sees 
what (internal) IP-address made this request. This way the router can 
see which internal IP-adress made what request because they all get 
random assigned portnumbers.

That is NAT in short.

So I don't expect you have to worry about that in your case.

Regards,
Erwin Moller

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

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


#4945

From"sl@exabyte" <sb5309@hotmail.com>
Date2012-02-23 21:04 +0800
Message-ID<ji5dhu$lfb$1@news.albasani.net>
In reply to#4940
>> NAT typically is used to change IP-addresses (and maybe port).
>> If A and B are in the same LAN I expect they can address each other
>> directly.
>> For example:
>> A IP: 192.168.178.22
>> B IP: 192.168.178.25
>>
>> Once you go outside your LAN, you (might) need NAT.
>>
>> And sockets have little to do with NAT.
>> A IP package arrives at a certain IP on a certain port: If some
>> socket is listening on that port on that machine, the package will
>> be handled by the listening process.
>>
>> NAT itself is performed by routers and such, not by some service
>> listening to a port.
>>
>> SO in short: No you have to care about it.
>>
>> Disclaimer: If you are talking IP6, things are different.
>>
>> Regards,
>> Erwin Moller
>>
>
> An additional example of NAT that makes things clear.
> This is how it was explained to me when I wanted to know about NAT.
>
> Suppose you have 10 computers on your LAN, and 1 internet gateway
> (some ADSL modem for example).
> All you 10 computers can connect to the internet because they use the
> routers IP address as the gateway.
>
> The router has an INTERNAL (LAN-side) IP address.
> Let's say this LAN-IP is 192.168.178.1
>
> The router also has an EXTERNAL (Internet-side) IP address.
> Let's say internet-side IP is 69.147.94.94. (I made the numbers up)
>
> Now, suppose a few people on the LAN are visiting some websites.
> Suppose compA has IP address 192.168.178.22. (On the LAN)
> Suppose compA has IP address 192.168.178.50. (On the LAN)
>
> CompA (192.168.178.22): requests www.google.com
> CompB: (192.168.178.50)requests www.php.net
>
> The router receives these requests from the LAN side, and sends the
> requests to www.google.com and www.php.net.
> The servers from Google and PHP answer the requests, and send them
> back to the router's IP address (being 69.147.94.94).
>
> Now the problem: How should the router handle these answers? Should it
> send them to 192.168.178.22 or 192.168.178.50, or even another IP on
> the LAN?
>
> This is where NAT comes into the picture.
> It works like this:
> 1) Router receives request from 192.168.178.22 (=LAN)for
> www.google.com. 2) Router thinks up some random port that is not is
> use, eg 33000. 3) Router stores this portnumber (33000) in a table
> together with the requesting LAN IP-address (192.168.178.22).
> 4) Router sends the request to www.google.com TOGETHER with the
> instruction to answer on port 33000.
> 5) When Google answers, the router looks up the portnumber, ans sees
> what (internal) IP-address made this request. This way the router can
> see which internal IP-adress made what request because they all get
> random assigned portnumbers.
>
> That is NAT in short.
>
> So I don't expect you have to worry about that in your case.
>

This example clears the air. So the key is the router comes up with random 
port number, and the reply specifies that port number.

Thanks a lot. 

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


#4952

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-23 13:37 +0000
Message-ID<ji5feq$q0e$1@news.albasani.net>
In reply to#4945
sl@exabyte wrote:

>> That is NAT in short.
>>
>> So I don't expect you have to worry about that in your case.
>>
> 
> This example clears the air. So the key is the router comes up with random 
> port number, and the reply specifies that port number.
> 

Yes, and the router maintains a state table that associates that port 
with an internal machine IP address and original originating port, and 
sends the packet back correctly.

There are a few wrinkles with some protocols that expect to be able to 
open a connection back to the original machine - ftp is/can be one such.

There a bit more intelligence is required by the router. It sees there 
is an existing outbound ftp link and therefore knows what to do with 
incoming requests to open the 'back channel'..as long as only one 
machine on the LAN is ftp-ing that remote machine.;-)




> Thanks a lot. 
> 
> 

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


#4942

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-23 11:40 +0000
Message-ID<ji58ji$abr$3@news.albasani.net>
In reply to#4937
SL wrote:
> This is not strictly a PHP question, it just springs into my mind while 
> coding sockets in PHP.
> 
> Assuming that I am communicating with 2 persons who are in the same LAN, say 
> A & B.
> 
> When I send some data to A, do I have to take care of the NAT (network 
> address translation) ?
> 
> Will the sockets take care of it automatically ?
> 

the router will if it is going through a NAT router, but if its on the 
same LAN chances are it wont be.


In short just connect to an IP address and let the routing 
infrastructure take care of everything else.

> Thanks. 
> 
> 

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


#4944

FromJerry Stuckle <jstucklex@attglobal.net>
Date2012-02-23 08:00 -0500
Message-ID<ji5daf$nqa$1@dont-email.me>
In reply to#4937
On 2/23/2012 3:58 AM, SL wrote:
> This is not strictly a PHP question, it just springs into my mind while
> coding sockets in PHP.
>
> Assuming that I am communicating with 2 persons who are in the same LAN, say
> A&  B.
>
> When I send some data to A, do I have to take care of the NAT (network
> address translation) ?
>
> Will the sockets take care of it automatically ?
>
> Thanks.
>
>

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.

-- 
==================
Remove the "x" from my email address
Jerry Stuckle
JDS Computer Training Corp.
jstucklex@attglobal.net
==================

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


#4946

From"sl@exabyte" <sb5309@hotmail.com>
Date2012-02-23 21:09 +0800
Message-ID<ji5dr2$lru$1@news.albasani.net>
In reply to#4944
>
> 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.

Thanks. 

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


#4949

FromCaptain Paralytic <paul_lautman@yahoo.com>
Date2012-02-23 05:19 -0800
Message-ID<7cab1d55-1251-4ef7-8c5a-b66bfd75f8e0@t15g2000yqi.googlegroups.com>
In reply to#4946
On Feb 23, 1:09 pm, "sl@exabyte" <sb5...@hotmail.com> 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.
No they don't, the local network will not allow it. They will have
different IP addresses.

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


#4956

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-23 13:53 +0000
Message-ID<ji5gd3$ro1$2@news.albasani.net>
In reply to#4949
Captain Paralytic wrote:
> On Feb 23, 1:09 pm, "sl@exabyte" <sb5...@hotmail.com> 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.

> No they don't, the local network will not allow it. They will have
> different IP addresses.

They do as far as the outside world is concerned.

And the network doesn't *disallow* it inside the NAT area either, it 
simply stops things working for those two machines :-)

As anyone who has done it in the olden days of static IP addresses will 
tell you.

How we sobbed for joy when DHCP  on PC's arrived...try managing upwards 
of 100 machines on the same LAN..with static IP addresses..

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


#4958

FromCaptain Paralytic <paul_lautman@yahoo.com>
Date2012-02-23 06:25 -0800
Message-ID<b7e0e67f-77c7-4a11-bc66-f3e3c9fa1b03@r20g2000yqn.googlegroups.com>
In reply to#4956
On Feb 23, 1:53 pm, The Natural Philosopher <t...@invalid.invalid>
wrote:
> Captain Paralytic wrote:
> > On Feb 23, 1:09 pm, "sl@exabyte" <sb5...@hotmail.com> 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.
> > No they don't, the local network will not allow it. They will have
> > different IP addresses.
>
> They do as far as the outside world is concerned.
But that is as far as the outside world is concerned. They will still
not have the same IP addresses.

> And the network doesn't *disallow* it inside the NAT area either, it
> simply stops things working for those two machines :-)
The local network will not allow 2 machines with the same IP address
to function on it (communication wise)

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


#4962

FromMichael Fesser <netizen@gmx.de>
Date2012-02-23 18:28 +0100
Message-ID<6ktck7tre4m0u3p55i082hfgnu1ketda2m@mfesser.de>
In reply to#4958
.oO(Captain Paralytic)

>On Feb 23, 1:53 pm, The Natural Philosopher <t...@invalid.invalid>
>wrote:
>> Captain Paralytic wrote:
>>
>> > No they don't, the local network will not allow it. They will have
>> > different IP addresses.
>>
>> They do as far as the outside world is concerned.
>>
>But that is as far as the outside world is concerned. They will still
>not have the same IP addresses.

Inside the LAN, correct. But from the outside only the router's IP
address is visible, and that is the same for all that are behind it.

Micha

-- 
http://mfesser.de/blickwinkel

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


#4965

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-23 20:42 +0000
Message-ID<ji68bu$fn5$3@news.albasani.net>
In reply to#4958
Captain Paralytic wrote:
> On Feb 23, 1:53 pm, The Natural Philosopher <t...@invalid.invalid>
> wrote:
>> Captain Paralytic wrote:
>>> On Feb 23, 1:09 pm, "sl@exabyte" <sb5...@hotmail.com> 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.
>>> No they don't, the local network will not allow it. They will have
>>> different IP addresses.
>> They do as far as the outside world is concerned.
> But that is as far as the outside world is concerned. They will still
> not have the same IP addresses.
> 
>> And the network doesn't *disallow* it inside the NAT area either, it
>> simply stops things working for those two machines :-)


> The local network will not allow 2 machines with the same IP address
> to function on it (communication wise)
> 

No, nothing disallows  anything. It is just that any machine on that 
network will not know which of two competing RARP responses to honour.

In short its perfectly possible to have two different MAC addresses tied 
to the same IP address BUT other IP machines on that ethernet can't then 
tell which one to direct packets to.

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


#4968

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-02-24 11:58 +0100
Message-ID<9qp8qnFig8U1@mid.uni-berlin.de>
In reply to#4956
Am 23.02.2012 14:53, schrieb The Natural Philosopher:
> Captain Paralytic wrote:
>> On Feb 23, 1:09 pm, "sl@exabyte" <sb5...@hotmail.com> 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.
> 
>> No they don't, the local network will not allow it. They will have
>> different IP addresses.
> 
> They do as far as the outside world is concerned.
> 
> And the network doesn't *disallow* it inside the NAT area either, it simply stops
> things working for those two machines :-)
> 
> As anyone who has done it in the olden days of static IP addresses will tell you.
> 
> How we sobbed for joy when DHCP  on PC's arrived...try managing upwards of 100
> machines on the same LAN..with static IP addresses..

This is easier than setting the dip switches of arcnet NICs to the mac address...

/Str.

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


#4959

From"SL" <sb5309@hotmail.com>
Date2012-02-24 00:03 +0800
Message-ID<ji5o1g$d7m$1@news.albasani.net>
In reply to#4949
> 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. 

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


#4966

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-23 20:44 +0000
Message-ID<ji68fs$fn5$4@news.albasani.net>
In reply to#4959
SL wrote:
>> 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)

so that is all you need to know. Just add the data to what he is already 
downloading.



, where
> the server routes the messages (I think you gurus know what I mean).
> 

It sends them into net land back to the clients router.

THAT knows that any response it gets for such and such a port belongs to 
the machine that opened the connection.


> Thanks. 
> 
> 

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


#4969

From"M. Strobel" <sorry_no_mail_here@nowhere.dee>
Date2012-02-24 12:07 +0100
Message-ID<9qp9brFp80U1@mid.uni-berlin.de>
In reply to#4959
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.

/Str.

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


#4972

FromThe Natural Philosopher <tnp@invalid.invalid>
Date2012-02-24 13:22 +0000
Message-ID<ji82v9$jsa$2@news.albasani.net>
In reply to#4969
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...

> /Str.

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


Page 1 of 2  [1] 2  Next page →

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


csiph-web