miniupnp.tuxfamily.org Forum Index miniupnp.tuxfamily.org
The forum about miniupnp and libnatpmp
 
 FAQFAQ   SearchSearch   MemberlistMemberlist   UsergroupsUsergroups   RegisterRegister 
 ProfileProfile   Log in to check your private messagesLog in to check your private messages   Log inLog in 

Support for cascading upnp routers

 
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Feature Request
View previous topic :: View next topic  
Author Message
ramytabet



Joined: 14 May 2007
Posts: 12

PostPosted: Tue May 15, 2007 8:29 am    Post subject: Support for cascading upnp routers Reply with quote

Hi all,

I was wondering if miniupnp supported port forwarding over multiple
cascading gateways, meaning that if you have a router behind another
router, making 2 layers between your pc and the internet can port
forwarding succeed on both routers ?

example figure:

public IP <-----> router1 <-----> router2 <-----> Desktop / Laptop
(internet) (my pc)

currently i am only able to detect router2 if i run the application
on my pc and GetExternalIP returns the external ip of router2.
Is there a way to detect router1 and map a port to it? if no is there
any planned work for it?

Once again, thanks for this great lib and keep up the good work !
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Tue May 15, 2007 8:32 am    Post subject: Reply with quote

Hello.
Hum I think controling cascading routers is NOT possible with UPnP.
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
ramytabet



Joined: 14 May 2007
Posts: 12

PostPosted: Tue May 15, 2007 9:39 am    Post subject: Reply with quote

Is it mentioned in the upnp protocol that cascading routers are not supported or is it just a hunch based on experience?

I guess you might be right as i have worked on 3 upnp frameworks
till now (Microsoft API, INTEL upnp SDK and finally miniupnp Smile and none
of them has been able to port map to more than 1 level or even discover
the second level of gateway.

However, my setup is as follow;
router1 = ICS (WIN XP SP2) and router2 = fedora6 and according to
msn 8.0 (live messenger) Options (go into Options->connection) ,
the application is able to detect the cascading architecture as it displays:

"you are connected to the internet through a cascading UPnP symmetric
NAT."

So even if port forwarding is impossible at least detection would be a
useful information to get. I am not sure but i guess MSN is using it's
own UPNP API to get this result.

I was wondering if this info is possible to get using miniupnp.

PS: How can i attach an image from my pc (not on the net) to my post

Thank you for your time.
[/url]
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Tue May 15, 2007 6:26 pm    Post subject: Reply with quote

ramytabet wrote:
Is it mentioned in the upnp protocol that cascading routers are not supported or is it just a hunch based on experience?

I have never seen any UPnP forum document describing cascading routers.
The multicast IP address used to discover UPnP devices is local to a LAN subnetwork, and is not routed by routers.

ramytabet wrote:
However, my setup is as follow;
router1 = ICS (WIN XP SP2) and router2 = fedora6 and according to
msn 8.0 (live messenger) Options (go into Options->connection) ,
the application is able to detect the cascading architecture as it displays:

"you are connected to the internet through a cascading UPnP symmetric
NAT."

Could you capture the communication between MSN and the UPnP router ?

ramytabet wrote:

So even if port forwarding is impossible at least detection would be a
useful information to get. I am not sure but i guess MSN is using it's
own UPNP API to get this result

Seeing that the "ExternalIPAddress" is a non routable LAN address is sufficient to detect such situation.

ramytabet wrote:

I was wondering if this info is possible to get using miniupnp.

PS: How can i attach an image from my pc (not on the net) to my post

You can't
Back to top
View user's profile Send private message Visit poster's website
ramytabet



Joined: 14 May 2007
Posts: 12

PostPosted: Wed May 30, 2007 9:08 am    Post subject: Reply with quote

I sniffed the communication between MSN and the UPnP router using
wireshark but couldn't find what i was looking for; however i noticed that
msn don't give me

[img]http://img181.imageshack.us/my.php?image=cascadingge7.png[/img]

this result unless i sign-in, meaning this result is not reached by the client
alone but based on some information sent by one of the MSN servers.
Now my question is : Do you think is it possible to detect the nature of a
NAT (support upnp or not) form the external interface of the NAT ?

Thanks
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Sun Jun 10, 2007 9:46 pm    Post subject: Reply with quote

ramytabet wrote:

Now my question is : Do you think is it possible to detect the nature of a
NAT (support upnp or not) form the external interface of the NAT ?


I dont think it is possible.
I think MSN gather information this way :
It detects from the LAN that a UPnP IGD is available and use GetExternalIPAddress method.
When it connects to the MSN server, the address is compared to the address detected by the MSN server. If the 2 addresses don't match, there is a Cascading NAT.
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
ramytabet



Joined: 14 May 2007
Posts: 12

PostPosted: Mon Jun 11, 2007 6:49 am    Post subject: Reply with quote

That's what i thought so too, but that means that MSN is making assumption
about both Gateways being UPnP enabled as all it can detect is :
2 cascading routers (based on the ip difference) and one of them UPnP
enabled.
So u think that MSN just making an assumption about having both
gateways UPnP enabled. (that's my opinion too).

Thank you for your answer.
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Mon Jun 11, 2007 11:49 am    Post subject: Reply with quote

I'm not sure MSN makes any assumption... Anyway, is MSN actualy USING the UPnP function on your setup ?
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
ramytabet



Joined: 14 May 2007
Posts: 12

PostPosted: Mon Jun 11, 2007 2:35 pm    Post subject: Reply with quote

Well i think it does, as i turned off upnp support (actually a service on
router1 running fedora core6) but msn from the laptop kept giving me
"cascading upnp routers".

Also (weird thing) Msn didn't even open a port on router2 (windows machine)
even during file transfers in both directions (send/recv) ...

So i don't really know what is happening here especially that other
applications (such as utorrent) are able to port forward using UPnP
(on router2) from the laptop ... Sad
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Tue Jun 12, 2007 2:12 pm    Post subject: Reply with quote

ramytabet wrote:
Also (weird thing) Msn didn't even open a port on router2 (windows machine)
even during file transfers in both directions (send/recv) ...

It what I supposed : MSN detects that NAT routers are cascaded so it doesn't even try to make any redirection (that would be useless indeed)
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
wondra



Joined: 28 Sep 2007
Posts: 2

PostPosted: Fri Sep 28, 2007 9:28 am    Post subject: Reply with quote

I'm in a different situation, but very similar to this one:

[ME] <transparent public network, at least 1 router> [UPnP IGd router] <internet>

Specifically, I'm on 10.x.y.0/33 and the router on 10.x.y.128/33.

I would like to use the UPnP capability of the ISP/friend's router to map me some ports, but I'm not on the same subnet.
How much is it possible to guess the required URLs and use upnpc manually?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Fri Sep 28, 2007 3:31 pm    Post subject: Reply with quote

wondra wrote:
I'm in a different situation, but very similar to this one:

[ME] <transparent public network, at least 1 router> [UPnP IGd router] <internet>

Specifically, I'm on 10.x.y.0/33 and the router on 10.x.y.128/33.

I would like to use the UPnP capability of the ISP/friend's router to map me some ports, but I'm not on the same subnet.
How much is it possible to guess the required URLs and use upnpc manually?

can't you set routers onyour network to forward SSDP broadcast packets ?
I will look if I can add a feature to miniupnpc to skip discovery process and directly provide XML root description URL.
_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
wondra



Joined: 28 Sep 2007
Posts: 2

PostPosted: Fri Sep 28, 2007 5:08 pm    Post subject: Reply with quote

It's a public network. I can only politely ask other people to do me a favor. And I know well that the next-hop guy doesn't know nearly anything about networks. That's why politely asking him to forward me some ports didn't work :-).

Is it possible to send a SSDP query directly to the router?
Back to top
View user's profile Send private message
miniupnp
Site Admin


Joined: 14 Apr 2007
Posts: 1442

PostPosted: Thu Jul 17, 2008 12:26 pm    Post subject: Reply with quote

miniupnp wrote:
I will look if I can add a feature to miniupnpc to skip discovery process and directly provide XML root description URL.

That was implemented as the -u option of upnpc test client :
Code:
$ ./upnpc-static
upnpc : miniupnpc library test client. (c) 2006-2008 Thomas Bernard
Go to http://miniupnp.free.fr/ or http://miniupnp.tuxfamily.org/
for more information.
Usage : ./upnpc-static [options] -a ip port external_port protocol
                Add port redirection
        ./upnpc-static [options] -d external_port protocol
                Delete port redirection
        ./upnpc-static [options] -s
                Get Connection status
        ./upnpc-static [options] -l
                List redirections
        ./upnpc-static [options] -r port1 protocol1 [port2 protocol2] [...]
                Add all redirections to the current host

protocol is UDP or TCP
Options:
  -u url : bypass discovery process by providing the XML root description url.
  -m address : provide ip address of the interface to use for sending SSDP multicast packets.
  -p path : use this path for MiniSSDPd socket.

_________________
Main miniUPnP author.
http://miniupnp.tuxfamily.org/
Back to top
View user's profile Send private message Visit poster's website
Display posts from previous:   
Post new topic   Reply to topic    miniupnp.tuxfamily.org Forum Index -> miniupnpc Feature Request All times are GMT
Page 1 of 1

 
Jump to:  
You cannot post new topics in this forum
You cannot reply to topics in this forum
You cannot edit your posts in this forum
You cannot delete your posts in this forum
You cannot vote in polls in this forum


Powered by phpBB © 2001, 2005 phpBB Group
Protected by Anti-Spam ACP
© 2007 Thomas Bernard, author of MiniUPNP.