networking - WCF consume web service and network architecture -


i'm getting start wcf soap web service. trying implement flexible, hot-plug featured, interoperable web service.

a device consumes server service (predefined ip address) means registering server, , service asks device returning configuration information of device. service remotely control registered devices later.

network architecture

please see diagram below. server-side service listening on 80 port. had router (router b) connects server, , set nat table 220.120.20.209:80 mapping 192.168.0.3:80. 220.120.20.209 public ip.

two clients connect router (router a) , have private ip addresses relatively(170.15.40.1/ 170.15.40.2) . clients host service (called deviceservice) listening on 80 port. , didn't set nat on router a. 68.250.250.1 public ip.

operation

  1. (request registration) client sends (request) message service.
  2. (response) service response message.
  3. (get config devices) service consumes client through calling http: //clientsip:80/deviceservice.

operation 1, 2 working me. understanding, incoming ip address of client#1 68.250.250.1 (i'm using remoteendpointmessageproperty caller's address).

my question "operation 3 not working". server can't access client's private ip because of router/firewall.only did server 68.250.250.1. how can solve kind of problem? problem have network architecture?

i googled day long found nothing problem. found websocket thing. websocket capable of full-duplex communication on tcp. mean once client built connection server, server can operation 3 (get config devices) anytime under network architecture?

enter image description here

updated 2014/4/24

thanks lot @vtortola. after studying references , still confused if it's possible allow call self-host service client during callback session?

try elaborate thought

  1. clients have self-host service @ first. e.g. providing configuration service
  2. let client drive interaction first, , built bi-direction channel between client , server.
  3. client requests, , server response. @ same time, server triggers callback procedure.
  4. server requests "providing configuration" message client via channel during period callback fired.

it won't work way if router doing nat. routera has tcp 80 port. if forward client#1, client#2 won't work. , assume routera doing nat because client ip addresses private, translating them public ip address.

i think messing 2 concepts. nat (network address translation) ip addresses, has nothing ports. nat allow client private ip addresses translated public ip address , therefore internet. port forwarding technique allows map tcp or udp port in public interface of router particular local ip address. router b doing nat allow server communicate internet through public interface, , port forwarding allow hosts in internet access server's tcp 80 port, accessing tcp 80 port.

let client drive interaction. in operation #3, client should send device configuration after getting server response in #2.

if need server lead of interactions, must use duplex wcf service. websocket 1 of duplex wcf bindings. again, channel must established client server first.


Comments

Popular posts from this blog

java - Intellij Synchronizing output directories .. -

git - Initial Commit: "fatal: could not create leading directories of ..." -