473,386 Members | 1,795 Online
Bytes | Software Development & Data Engineering Community
Post Job

Home Posts Topics Members FAQ

Join Bytes to post your question to a community of 473,386 software developers and data experts.

.NEt remote event and DNS reverse lookup

Hi NG!
I have a problem in my remote application.
After calling a remote function the calculation will be done by the
service. The calculation result will be sent to the caller (client)
via remote event.
The following behavior can be observed:

1.) Right after the start of the server the first response via remote
event will take a long time.
2.) Calling the same function a second time will not be a problem.
3.) If I enter the IP address of the client (caller) into the host
file, the first call will not take this long time.
So does .NET remoting use DNS reverse look-up to obtain the client
address?
If yes, is it possible to change this behavior or do I have to permit
DNS reverse look-up ?
Thanks and Regards
Marcel

Sep 13 '07 #1
8 5006
On Sep 13, 5:35 am, schaf <sc...@2wire.chwrote:
Hi NG!
I have a problem in my remote application.
After calling a remote function the calculation will be done by the
service. The calculation result will be sent to the caller (client)
via remote event.
The following behavior can be observed:

1.) Right after the start of the server the first response via remote
event will take a long time.

2.) Calling the same function a second time will not be a problem.

3.) If I enter the IP address of the client (caller) into the host
file, the first call will not take this long time.

So does .NET remoting use DNS reverse look-up to obtain the client
address?
If yes, is it possible to change this behavior or do I have to permit
DNS reverse look-up ?
I think you have it backwards. The IP address is the final resolution
level, not the computer name. When you pass it a computer name, the
system must do an address resolution, NOT a DNS reverse lookup. A DNS
reverse lookup is when you give it the IP address and want to get the
corresponding machine name(s). The reason it is "faster" when you
give it the IP address is because it DOESN'T have to go to the address
resolution; the IP address is already assumed to be resolved (that
doesn't mean it's not a BAD IP address, just that you have an IP
address). The results of a lookup are cached, or saved locally so
that the DNS service doesn't have to be called EVERY time you want an
address. That's why it doesn't take as long the second time around.
I don't remember the caching rules offhand, but I think the default
DNS cache TTL is actually set by the server after a query...

IP Addressing can be thought of like a telephone system (generally).
Each person (computer) has a particular phone number (IP Address) that
it can be contacted on. If you already have the phone number (IP
Address) you don't have to do anything, you just dial it. But if you
don't have the phone number (IP Address), you have to look it up in
the phone book (DNS Service). You find the name and now have the
number. There also exists a REVERSE phone book (reverse DNS lookup)
that allows you to find out the name of the person (computer) that is
at a particular phone number (IP Address). (for pedants out there,
YES I know this is simplified but is a fairly decent analogy for a non
ip guru <g>)

Sep 13 '07 #2
Doug Semler wrote:
I think you have it backwards. The IP address is the final resolution
level, not the computer name. When you pass it a computer name, the
system must do an address resolution, NOT a DNS reverse lookup. A DNS
reverse lookup is when you give it the IP address and want to get the
corresponding machine name(s).
The OP does not have it backwards. What he explained is exactly what a
reverse lookup is.

Chris.
Sep 13 '07 #3
schaf wrote:
Hi NG!
I have a problem in my remote application.
After calling a remote function the calculation will be done by the
service. The calculation result will be sent to the caller (client)
via remote event.
The following behavior can be observed:

1.) Right after the start of the server the first response via remote
event will take a long time.

2.) Calling the same function a second time will not be a problem.

3.) If I enter the IP address of the client (caller) into the host
file, the first call will not take this long time.

So does .NET remoting use DNS reverse look-up to obtain the client
address?
If yes, is it possible to change this behavior or do I have to permit
DNS reverse look-up ?
Thanks and Regards
Marcel
Exactly how is your Remoting accomplished? TCP? HTTP?
Are you using IIS to host the remoting service?

More information will make it much simpler to answer your question.

Chris.
Sep 13 '07 #4
Hi Chris!
Thanks for your response!
Exactly how is your Remoting accomplished? TCP? HTTP?
TCP
Are you using IIS to host the remoting service?
NO

More information will make it much simpler to answer your question.
So we are using the .NET Remoting events with a shared callback
delegate. A class on the client derives from the shared class
RemoteDelegateObject. This class has a function (event handler) which
has the same interface like the remote callback delegate. This
function will be assigned to the event on the server. (like Ingo
Rammer recommend)

Analysing the communication shows a DNS reverse lookup right after the
server fires this remote event the first time. So just after starting
the service. If the service is running and I call the same function, I
will not get this DNS reverse lookup.
Why? Is .NET caching the network information ?

Hope you can help me.

Sep 13 '07 #5
schaf wrote:
>More information will make it much simpler to answer your question.
So we are using the .NET Remoting events with a shared callback
delegate. A class on the client derives from the shared class
RemoteDelegateObject. This class has a function (event handler) which
has the same interface like the remote callback delegate. This
function will be assigned to the event on the server. (like Ingo
Rammer recommend)

Analysing the communication shows a DNS reverse lookup right after the
server fires this remote event the first time. So just after starting
the service. If the service is running and I call the same function, I
will not get this DNS reverse lookup.
Why? Is .NET caching the network information ?
In all likelihood yes, most DNS requests are temporarily cached, either
by your PC (very short duration) or by the DNS server on the LAN
(duration up to the expiry of the DNS record, normally).

As to why it is doing it, I'm going to guess it's related to the fact
that it has the ability to limit channel access to specific hosts. It
may not be anything you can suppress (I can't find anything on it in the
docs or via google).
How long is it taking on average to do the DNS query? It may be the real
problem lies elsewhere.

Chris.
Sep 13 '07 #6
"Chris Shepherd" <ch**@nospam.chsh.cawrote in message
news:e9**************@TK2MSFTNGP04.phx.gbl...
Doug Semler wrote:
>I think you have it backwards. The IP address is the final resolution
level, not the computer name. When you pass it a computer name, the
system must do an address resolution, NOT a DNS reverse lookup. A DNS
reverse lookup is when you give it the IP address and want to get the
corresponding machine name(s).

The OP does not have it backwards. What he explained is exactly what a
reverse lookup is.

Chris.

Huh? The OP asked why it was slower when he used a computer name rather
than an IP address. His "problem" is completely related to how DNS queries
are made and how fast they are and how they are cached. Nothing about
reverse lookups. A reverse lookup is NOT looking up in a hosts file. A
reverse lookup is getting the hostname from IP address. NOT what he was
describing. There is no reverse lookup going on. The delay is in the
transfer of information from the DNS service to the local machine. Windows
first checks the hosts file before it goes out to the "outside world". It
is faster when there is no need to go to the outside world. Regardless of
whether the query is IP to hostname or hostname to IP.

If you want more information on how and when a windows box looks up a
computer name to resolve an IP address (and the cache time to live by the
way), go to:
http://technet.microsoft.com/en-us/l.../bb727005.aspx

--
Doug Semler, MCPD
a.a. #705, BAAWA. EAC Guardian of the Horn of the IPU (pbuhh).
The answer is 42; DNRC o-
Gur Hfrarg unf orpbzr fb shyy bs penc gurfr qnlf, abbar rira
erpbtavmrf fvzcyr guvatf yvxr ebg13 nalzber. Fnq, vfa'g vg?

Sep 14 '07 #7
Doug Semler wrote:
Huh? The OP asked why it was slower when he used a computer name rather
than an IP address. His "problem" is completely related to how DNS
queries are made and how fast they are and how they are cached. Nothing
about reverse lookups. A reverse lookup is NOT looking up in a hosts
file. A reverse lookup is getting the hostname from IP address. NOT
what he was describing.
Yes, it is what he was describing. The *server* is being slow when
answering client connections because the *server* is looking up the
*client's ip address* in an attempt to resolve it to a hostname.

I see from your other post that you misread the OP, so the point is moot.

Chris.
Sep 14 '07 #8
On Sep 13, 12:02 pm, schaf <sc...@2wire.chwrote:
Hi Chris!
Thanks for your response!
Exactly how is your Remoting accomplished? TCP? HTTP?

TCP
Are you using IIS to host the remoting service?

NO
More information will make it much simpler to answer your question.

So we are using the .NET Remoting events with a shared callback
delegate. A class on the client derives from the shared class
RemoteDelegateObject. This class has a function (event handler) which
has the same interface like the remote callback delegate. This
function will be assigned to the event on the server. (like Ingo
Rammer recommend)

Analysing the communication shows a DNS reverse lookup right after the
server fires this remote event the first time. So just after starting
the service. If the service is running and I call the same function, I
will not get this DNS reverse lookup.
Why? Is .NET caching the network information ?

Hope you can help me.
Regardless of what's going on behind the scenes, you need to be aware
of some potential pitfalls of switching the roles of the client and
server (since when you fire an event, the server is becoming a client
and the client is becoming a server). It introduces a lot of
potential issues (one that we ran into was with multihomed systems and
the client sending the wrong IP address and/or unresolvable hostname
to the server with which it was communicating). That being said, is
there any particular reason that you are using an event fire from the
server to client when the remote calculation is completed rather than
allowing the client to control whether the function is called
synchronously or asynchronously? Also, ensure that your remote events
are set up properly. It has to do with what happens if the event
can't fire over the channel and the non-removal of the remote event
handler on the server side...I think Ingo Rammer's book on
Advanced .NET Remoting goes into this (and I'm sure there are sites
out there that cover it as well...)

Sep 14 '07 #9

This thread has been closed and replies have been disabled. Please start a new discussion.

Similar topics

4
by: Pjotr Wedersteers | last post by:
Hi PHP buddies, I want to include a reverse DNS lookup (find host/domain for a given IP) in my pagetracker scripts. Is there anything prefab in the PHP world I am overlooking I could put to use...
59
by: Raymond Hettinger | last post by:
Please comment on the new PEP for reverse iteration methods. Basically, the idea looks like this: for i in xrange(10).iter_backwards(): # 9,8,7,6,5,4,3,2,1,0 <do something with i> The...
2
by: dthmtlgod | last post by:
I am attempting to retrieve the computer name of a remote user accessing our websever. I have tried the following and both don't work. Any ideas? Returns the webserver computer name Set...
47
by: Kapil Khosla | last post by:
Hi, I am trying to reverse a byte eg. 11010000 should look like 00001011 Plz note, it is not a homework problem and I do not need the c code for it. Just give me an idea how should I proceed...
1
by: News-West | last post by:
Hi, I have foolishly got myself caught up in coding a pretty simple app in c#, on the back of very little experience of the language. At the heart of the app, is a remote server, which fires...
12
by: rudysanford | last post by:
I just started messing with programming and started with Python. Part of my first project deals with translating numerical values to letters. I would like to be able to do the reverse as well,...
8
by: rh0dium | last post by:
Hi all, I have a dict which looks like this.. dict={'130nm': {'umc': }, '180nm': {'chartered': , 'tsmc': }, '250nm': {'umc': , 'tsmc': } }
1
by: Screenbert | last post by:
I have a web page that displays and creates DNS entries. It displays DNS entries if they exist for certain IP ranges. (Usually about 20 IP address at a time) If a DNS entry needs to be created then...
1
by: abhipro | last post by:
Hi all, I am trying to know more about Reverse ip lookup. The results vary from tool to tool.. I wanted to know what exactly happens behind the scenes when we do the reverese lookup.. and why some...
0
by: taylorcarr | last post by:
A Canon printer is a smart device known for being advanced, efficient, and reliable. It is designed for home, office, and hybrid workspace use and can also be used for a variety of purposes. However,...
0
by: Charles Arthur | last post by:
How do i turn on java script on a villaon, callus and itel keypad mobile phone
0
by: aa123db | last post by:
Variable and constants Use var or let for variables and const fror constants. Var foo ='bar'; Let foo ='bar';const baz ='bar'; Functions function $name$ ($parameters$) { } ...
0
by: ryjfgjl | last post by:
If we have dozens or hundreds of excel to import into the database, if we use the excel import function provided by database editors such as navicat, it will be extremely tedious and time-consuming...
0
by: ryjfgjl | last post by:
In our work, we often receive Excel tables with data in the same format. If we want to analyze these data, it can be difficult to analyze them because the data is spread across multiple Excel files...
0
by: emmanuelkatto | last post by:
Hi All, I am Emmanuel katto from Uganda. I want to ask what challenges you've faced while migrating a website to cloud. Please let me know. Thanks! Emmanuel
0
BarryA
by: BarryA | last post by:
What are the essential steps and strategies outlined in the Data Structures and Algorithms (DSA) roadmap for aspiring data scientists? How can individuals effectively utilize this roadmap to progress...
0
by: Hystou | last post by:
There are some requirements for setting up RAID: 1. The motherboard and BIOS support RAID configuration. 2. The motherboard has 2 or more available SATA protocol SSD/HDD slots (including MSATA, M.2...
0
by: Hystou | last post by:
Most computers default to English, but sometimes we require a different language, especially when relocating. Forgot to request a specific language before your computer shipped? No problem! You can...

By using Bytes.com and it's services, you agree to our Privacy Policy and Terms of Use.

To disable or enable advertisements and analytics tracking please visit the manage ads & tracking page.