By using this site, you agree to our updated Privacy Policy and our Terms of Use. Manage your Cookies Settings.
445,931 Members | 1,514 Online
Bytes IT Community
+ Ask a Question
Need help? Post your question and get tips & solutions from a community of 445,931 IT Pros & Developers. It's quick & easy.

Is there any way to know the computer is connected to a router?

P: n/a
Is there any way to know the computer is connected to a router?

I know using WebRequest is one of the method,
but WebRequest need router's URL , username and password.
I don't know those information.

Is there any other way to know the existence of router?

Thanks.
Jun 27 '08 #1
Share this Question
Share on Google+
5 Replies


P: n/a
On Tue, 10 Jun 2008 00:28:12 -0700, garks <ze*********@gmail.comwrote:
Is there any way to know the computer is connected to a router?

I know using WebRequest is one of the method,
but WebRequest need router's URL , username and password.
I don't know those information.
That's not really a way to know if you're connected to a router anyway.
Is there any other way to know the existence of router?
If the router supports UPnP, that is the most reliable way. I don't
recall if that's directly supported in .NET or not.

If there is no UPnP support, then there are other less reliable ways based
on heuristics dependent on network behavior. I would not pursue those
kinds of methods though, especially if you're at a point in your network
experience where you have to ask the question in the first place. :)

The piece of information most likely applicable to whatever you're doing
is that you probably don't need to know whether you're connected to a
router, especially if it doesn't support UPnP.

Pete
Jun 27 '08 #2

P: n/a
Thank you for your reply.

I am a newbie to networking.
I search it over the internet very long time, but cannot find the clue
to solve the problem.
Could you explain more?

I am doing a project which writing a small window app.
It determines the computer that runs this app have a router connected
or not.
If yes, it will invoke event A. Otherwise invoke event B.

Thanks in advanced
Jun 27 '08 #3

P: n/a
On Jun 10, 10:50 am, garks <zenkiche...@gmail.comwrote:
Thank you for your reply.

I am a newbie to networking.
I search it over the internet very long time, but cannot find the clue
to solve the problem.
Could you explain more?

I am doing a project which writing a small window app.
It determines the computer that runs this app have a router connected
or not.
If yes, it will invoke event A. Otherwise invoke event B.

Thanks in advanced
Perhaps, if you traceroute an IP and if the path is greater than 2
hops, then the traffic is being routed. I am not sure if you determine
if the device routing your traffic is a router though. ??
Jun 27 '08 #4

P: n/a
"cs****@elfware.za.net" <el*****@gmail.comwrote in news:653b4e2e-ca41-
45********************@8g2000hse.googlegroups.com:
Perhaps, if you traceroute an IP and if the path is greater than 2
hops, then the traffic is being routed. I am not sure if you determine
if the device routing your traffic is a router though. ??
Only a router would decrement the TTL, which is what traceroute uses.

I'm still interested in knowing why the OP wants to know if the router is
present.

Another approach is to just ping the default gateway. If ping isn't
firewalled by the router, one should get a response. One could also port-
scan the firewall, in hopes that one of the ports is an administrative
interface and will respond to a connection request. Only a high-end router
with a very sophisticated firewall would totally obscure such an interface.
(For example, a very paranoid router might use port knocking to hide its
administrative interface, or it might not be available via the subnet that
the querying host is attached to.)

This isn't really a C# question, though. The best expertise would be found
at comp.protocols.tcp-ip. But frame the question in generic programming
terms, not as a C# question.
Jun 27 '08 #5

P: n/a
On Jun 10, 4:50*am, garks <zenkiche...@gmail.comwrote:
Thank you for your reply.

I am a newbie to networking.
We can see that
I search it over the internet very long time, but cannot find the clue
to solve the problem.
What is your problem to start with? You just asked a question but you
did not described your problem

>
I am doing a project which writing a small window app.
It determines the computer that runs this app have a router connected
or not.
You need to be more especific, start with explaning what you consider
a "router"
Jun 27 '08 #6

This discussion thread is closed

Replies have been disabled for this discussion.