7 Replies - 1185 Views - Last Post: 18 July 2012 - 05:36 PM

#1 jammmie999  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 117
  • Joined: 01-April 09

Push protocols - breaking through the NAT router

Posted 17 July 2012 - 11:02 AM

I don't see why the internet has evolved where almost all protocols in use today are client request based protocols (the client must ask for data, rather than server pushing data). I want to implement a protocol where the server pushes data to a client rather than waiting for a client to request it. Is this even possible today, most statefull home NAT routers will reject any incoming data, unless it is in response to an outgoing connection, as will most client firewalls. So is there anyway to achieve this, the only way I see is to forward a port via UPNP, I wouldn't like some app messing with my router settings though, and most people has explicitly disabled UPNP. How would be best to achieve a server push based communication?

Thanks

Is This A Good Question/Topic? 0
  • +

Replies To: Push protocols - breaking through the NAT router

#2 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9052
  • View blog
  • Posts: 33,984
  • Joined: 12-June 08

Re: Push protocols - breaking through the NAT router

Posted 17 July 2012 - 11:17 AM

Quote

I don't see why the internet has evolved where almost all protocols in use today are client request based protocols (the client must ask for data, rather than server pushing data).

Is this just a straw man argument to get you writing, or do you really not understand why client request is the preferred method?


Have you eyeballed how apple does it on their Push Notification service for the iOS?
https://developer.ap...ushService.html
Was This Post Helpful? 0
  • +
  • -

#3 jammmie999  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 117
  • Joined: 01-April 09

Re: Push protocols - breaking through the NAT router

Posted 17 July 2012 - 11:45 AM

View Postmodi123_1, on 17 July 2012 - 06:17 PM, said:

Quote

I don't see why the internet has evolved where almost all protocols in use today are client request based protocols (the client must ask for data, rather than server pushing data).

Is this just a straw man argument to get you writing, or do you really not understand why client request is the preferred method?


Have you eyeballed how apple does it on their Push Notification service for the iOS?
https://developer.ap...ushService.html


I think I can appreciate the need for both instances, when web browsing for example a client request method is really the only way, but in other instances such as email, instant messaging, VoIP etc. it seems counter intuitive to require a client to continually 'poll' for updates, if the server could simply push data to a client this seems a lot more efficient, e.g. notifying you of a new email, notifying you of a new IM chat etc.

Surely a simple "its USERNAME at 255.255.255.255 send me notifications" and not having to leave a TCP connection open (such as with IMAP) would be much more efficient. This does pose a few security issues I can see, when I get a new IP Address someone else is getting my notifications etc. But this could all be secured using public/private key crypto.

I'll have a read through the iOS link.
Thanks
Was This Post Helpful? 0
  • +
  • -

#4 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9052
  • View blog
  • Posts: 33,984
  • Joined: 12-June 08

Re: Push protocols - breaking through the NAT router

Posted 17 July 2012 - 12:16 PM

Quote

I think I can appreciate the need for both instances, when web browsing for example a client request method is really the only way, but in other instances such as email, instant messaging, VoIP etc. it seems counter intuitive to require a client to continually 'poll' for updates, if the server could simply push data to a client this seems a lot more efficient, e.g. notifying you of a new email, notifying you of a new IM chat etc.

That's the whole point of the interconnected jumble that is network traffic. Having the onus on the client to request info clears up things like: dropped connections, dynamically changing IPs, and pure cost of the server on the data. It empowers the individual to declare their data and deal with that aspect, but allows for a robust system that if that person drops off the server is not wasting time, bandwidth, spare cycles, and energy pushing data to a device that is no longer responding. Case in point - a news site. You have FoxNew's app installed on your phone.. do you want that app being flooded by every user comment, news story, redaction, retraction, or advertisement at all points in the day? No.. that would kill your battery and just be plain annoying.

Not to mention Foxnew's media pipes would be clogged sending not only you - but hundreds of millions of peoples devices their content.. Their bandwidth would go through the roof! Also what content do you auto send out? If I am reading a four page story and only care about the first page do you send the other three? Why would you? Why wouldn't you? You shouldn't predict the user's behavior - let them guide their own choices.

Speaking of bandwidth - when users connect it staggers requests, right? It is the nature of the beast. This allows for better resource management that will not be operating at peak 24/7. In your world where the content is pushed out all the time this would be gone.

Ultimately you only want the information when you specifically need it...


Quote

Surely a simple "its USERNAME at 255.255.255.255 send me notifications" and not having to leave a TCP connection open (such as with IMAP) would be much more efficient. This does pose a few security issues I can see, when I get a new IP Address someone else is getting my notifications etc. But this could all be secured using public/private key crypto.

Maybe but it doesn't allow for a robust system. I can walk through my work place and pickup various IP addresses depending on where I am. Instead of trying to play catch up with every.. single.. possible.. website/app/feed/server I visit for content I only need to tell them "Hey - here now!". Think about it.. if I am reading a story on my tablet, but Bill comes over and starts chatting with me as I walk. We hit the elevator and go up seven floors and perch near his desk in the south west corner. My ip could have changed a few times... I wasn't reading the story.. I wasn't even paying attention to my tablet. Does it make sense for the device having to yell at the server "I am here! Opps I am here now! Opps I am there!" - those meaningless updates would melt servers in unison. Instead I only tell it "I am there!" when I go back to reading the story and go to the next page.
Was This Post Helpful? 2
  • +
  • -

#5 jammmie999  Icon User is offline

  • D.I.C Head

Reputation: 3
  • View blog
  • Posts: 117
  • Joined: 01-April 09

Re: Push protocols - breaking through the NAT router

Posted 17 July 2012 - 12:49 PM

OK I can see your point for conventional, web traffic. But do you not think for something like an email client/server instead of asking every minuet "Hey got any new emails", a message can be pushed from server to client, "hey you've got mail", now instead of say 60 POP3 connections in an hour. I have only got 5 pushed connections say. This kind of data is directly related to you, and you would have requested it anyway, by pushing the data to clients you are getting it quicker and in most cases more efficiently.

I can see how this may not be the most efficient method for mobile devices, continually jumping from network to network. But a traditional desktop computer may retain the same IP address for several days, even weeks without change.
Was This Post Helpful? 0
  • +
  • -

#6 modi123_1  Icon User is online

  • Suitor #2
  • member icon



Reputation: 9052
  • View blog
  • Posts: 33,984
  • Joined: 12-June 08

Re: Push protocols - breaking through the NAT router

Posted 17 July 2012 - 12:55 PM

Quote

OK I can see your point for conventional, web traffic. But do you not think for something like an email client/server instead of asking every minuet "Hey got any new emails", a message can be pushed from server to client, "hey you've got mail", now instead of say 60 POP3 connections in an hour. I have only got 5 pushed connections say. This kind of data is directly related to you, and you would have requested it anyway, by pushing the data to clients you are getting it quicker and in most cases more efficiently.


Elaborate how it would be more efficient or quick?

In case of your email - that data is where? On the server, right? why does it make sense to try and transfer every bit of data to the device or client? That's a ton of traffic... when instead I have the client ping the web mail and transfer a small bit indicating I have mail.. hell I might not want to read it but damn if I don't want to know it's there. Again your suggestion buckles under the sheer weight of sending every piece of spam to every device, client, app, and web mail twenty four seven. It also fails at some sort of regulated traffic flow.


Quote

I can see how this may not be the most efficient method for mobile devices, continually jumping from network to network. But a traditional desktop computer may retain the same IP address for several days, even weeks without change.

Ah.. so we would then have two network layers? One you need to identify yourself as a desktop and one as a mobile device? ;)
Was This Post Helpful? 1
  • +
  • -

#7 blackcompe  Icon User is offline

  • D.I.C Lover
  • member icon

Reputation: 1152
  • View blog
  • Posts: 2,530
  • Joined: 05-May 05

Re: Push protocols - breaking through the NAT router

Posted 17 July 2012 - 02:20 PM

Quote

OK I can see your point for conventional, web traffic. But do you not think for something like an email client/server instead of asking every minuet "Hey got any new emails", a message can be pushed from server to client, "hey you've got mail", now instead of say 60 POP3 connections in an hour. I have only got 5 pushed connections say. This kind of data is directly related to you, and you would have requested it anyway, by pushing the data to clients you are getting it quicker and in most cases more efficiently.


If the server is responsible for getting the client its data, it must poll the client continuously until it accepts. What if the client isn't available? Wouldn't it still have to poll? In the client/server architecture, an inactive client doesn't take up bandwidth, because it's not polling the server. That's an insane increase in bandwidth efficiency.

Let's also suppose the issue above wasn't an issue. Still, to maintain the perception of an "instant email" the server must create 60 TCP connections per hour for polling the client. Basically, you could make either the client or server do the polling. So why not put this responsibility on the client, which has relatively very little work to do?

Just want to say also that Modi's point about pushing each and every post in a news forum is a great example of why you don't want to use a push/pull protocol. That's an insane decrease in bandwidth efficiency!

This post has been edited by blackcompe: 17 July 2012 - 02:22 PM

Was This Post Helpful? 1
  • +
  • -

#8 Skydiver  Icon User is offline

  • Code herder
  • member icon

Reputation: 3533
  • View blog
  • Posts: 10,937
  • Joined: 05-May 12

Re: Push protocols - breaking through the NAT router

Posted 18 July 2012 - 05:36 PM

I generally agree with the value of the general pull pattern, it is definitely more efficient.

I've got a question, though. Is this discussion only talking about the protocol for establishing a connection being push vs. pull, or does it also cover communications over an established link?

Right now, a major counter example that is coming to mind for me is various multi-player video games. Once the player is in the game world, isn't it the server's job to push out updates of what is happening in the game world from the authoritative view of the server? The server doesn't wait around for update requests while the clients are doing their own simulations. The client simulations can stray. The server tells the clients what state the local simulations should be based on the simulations that the server has computed. Or are real time gaming protocols a special case where there needs to be tight control of the entire environment?
Was This Post Helpful? 1
  • +
  • -

Page 1 of 1