PC Review


Reply
Thread Tools Rate Thread

Client Server application with a NAT??

 
 
Grant Schenck
Guest
Posts: n/a
 
      20th Oct 2009
Hello,

I have a strange issue with a client server application I developed in C#
..NET. It uses sockets but I don't see a news group that specific. If this
would be better posted in different news group then please let me know...

The problem we have is that our server is on one subnet and our clients are
on another subnet. I track the connected clients by IP address. The
problem I have is that all clients come in with the IP address of the
gateway where the NAT is running. The result is that one client can connect
but when a second client connects I see the same IP address and assume that
somehow the previous connection was not torn down and disconnect the
previous connection. The result is that only one client can connect at a
time.

This is an area I know virtually nothing about but I thought the whole point
of a NAT is to virtualize connections in such a way that applications just
work. I shouldn't have to code specially to work with clients connected via
NAT, should I?

I'm thinking this is an issue with the configuration of their NAT but I
don't know. My other concern is that somehow this is just a limitation of
client/server software where the client and server connect via a NAT and
while I assume most companies run NATs, they probably run those between the
public internet and their network, not between subnets of their network.

Any and all advice would be very much appreciated!

Thanks in advance.
--
Grant Schenck


 
Reply With Quote
 
 
 
 
Peter Duniho
Guest
Posts: n/a
 
      20th Oct 2009
Grant Schenck wrote:
> Hello,
>
> I have a strange issue with a client server application I developed in C#
> ..NET. It uses sockets but I don't see a news group that specific. If this
> would be better posted in different news group then please let me know...


There are in fact newsgroups specific to Winsock, and even TCP/IP. The
latter being more directly topical, but even the former being more
topical than a general purpose .NET newsgroup.

That said:

> The problem we have is that our server is on one subnet and our clients are
> on another subnet. I track the connected clients by IP address. The
> problem I have is that all clients come in with the IP address of the
> gateway where the NAT is running. The result is that one client can connect
> but when a second client connects I see the same IP address and assume that
> somehow the previous connection was not torn down and disconnect the
> previous connection. The result is that only one client can connect at a
> time.


Your main problem here is that you are tracking only by IP address.
You'd have the same bug without the NAT, if you had two different
clients running from the same computer (e.g. via Terminal Server, or as
an automated process, etc.).

> This is an area I know virtually nothing about but I thought the whole point
> of a NAT is to virtualize connections in such a way that applications just
> work. I shouldn't have to code specially to work with clients connected via
> NAT, should I?


No, usually you shouldn't. There are exceptions, but this isn't one of
them.

> I'm thinking this is an issue with the configuration of their NAT but I
> don't know.


It's a bug in your program. You need to use both the IP address and
port number as the unique identifier for your client.

Pete
 
Reply With Quote
 
Grant Schenck
Guest
Posts: n/a
 
      20th Oct 2009
Thanks! I coded up based on that and am waiting to see if the fix worked.

Great tip, thanks!
--
Grant Schenck


"Peter Duniho" <(E-Mail Removed)> wrote in message
news:%238TL$(E-Mail Removed)...
> Grant Schenck wrote:
>> Hello,
>>
>> I have a strange issue with a client server application I developed in C#
>> ..NET. It uses sockets but I don't see a news group that specific. If
>> this would be better posted in different news group then please let me
>> know...

>
> There are in fact newsgroups specific to Winsock, and even TCP/IP. The
> latter being more directly topical, but even the former being more topical
> than a general purpose .NET newsgroup.
>
> That said:
>
>> The problem we have is that our server is on one subnet and our clients
>> are on another subnet. I track the connected clients by IP address. The
>> problem I have is that all clients come in with the IP address of the
>> gateway where the NAT is running. The result is that one client can
>> connect but when a second client connects I see the same IP address and
>> assume that somehow the previous connection was not torn down and
>> disconnect the previous connection. The result is that only one client
>> can connect at a time.

>
> Your main problem here is that you are tracking only by IP address. You'd
> have the same bug without the NAT, if you had two different clients
> running from the same computer (e.g. via Terminal Server, or as an
> automated process, etc.).
>
>> This is an area I know virtually nothing about but I thought the whole
>> point of a NAT is to virtualize connections in such a way that
>> applications just work. I shouldn't have to code specially to work with
>> clients connected via NAT, should I?

>
> No, usually you shouldn't. There are exceptions, but this isn't one of
> them.
>
>> I'm thinking this is an issue with the configuration of their NAT but I
>> don't know.

>
> It's a bug in your program. You need to use both the IP address and port
> number as the unique identifier for your client.
>
> Pete



 
Reply With Quote
 
 
 
Reply

Thread Tools
Rate This Thread
Rate This Thread:

Posting Rules
You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

BB code is On
Smilies are On
[IMG] code is On
HTML code is Off
Trackbacks are On
Pingbacks are On
Refbacks are Off


Similar Threads
Thread Thread Starter Forum Replies Last Post
RPC and Client Server Application Maurizio Microsoft VB .NET 0 31st May 2008 10:36 AM
What is the diffference between the thin client server application and SmartClient application ? Karthik D V Microsoft C# .NET 1 31st Jul 2007 06:06 AM
Server application control client application =?Utf-8?B?UnVkeQ==?= Microsoft Dot NET 0 16th Nov 2004 06:44 PM
client server application running slow on 2003 server Tom Chandler Microsoft Windows 2000 Advanced Server 0 1st Nov 2004 05:27 PM
application Client X Server '[] WiRaN Microsoft C# .NET 0 23rd Oct 2003 03:06 PM


Features
 

Advertising
 

Newsgroups
 


All times are GMT +1. The time now is 06:25 PM.