none
How to implement Peer-to-Peer in WCF RRS feed

  • Question

  • i have seen lots of example exist for p2p with wcf. i like to know how two wcf client talk to each without any intermediate server. i need a working such sample of p2p with wcf which will interact each other without server in LAN and also guide me what else we need to do to run the apps over the internet. thanks
    Wednesday, February 5, 2014 6:54 PM

Answers

  • Hi,

    P2P computing is a term that has gained a lot of popularity in recent times. Today, organizations and businesses increasingly depend on collaboration between individuals and groups to perform essential tasks. P2P applications form more ad hoc online groups for business, entertainment, and cultural purposes. As a result, collaboration has become more essential at an individual level.

    Essentially, P2P computing is a set of networked computers that rely on the computing power and bandwidth of the individual computers on the network, as opposed to the traditional approach of relying on a smaller number of more powerful server computers on the network. A computer that is connected to a P2P network can be categorized as a node or peer. The nodes in a P2P network are usually connected on an ad hoc basis. This is where the real power in a P2P network lies, because the peers are responsible for uploading and downloading data among themselves without the need for a server.

    Two types of P2P network exist: a pure network and a hybrid network. A pure P2P network has no concept of a client or a server; it has only nodes, which act in the capacity of both a server and a client, as needed. A hybrid P2P network, on the other hand, has a central server that keeps track of the various peers on the network. This server responds to requests from the peers for information only and does not store any data. The peers are responsible for hosting the information. For example, in a file-sharing P2P application, the files are stored by the peer, and the server is aware of the files that are stored at each peer.

    Most P2P solutions rely on some nonpeer elements in the solution, such as Domain-Name System (DNS, used to translate computer host names to IP addresses). Some P2P solutions also have the notion of a superpeer, in which other peers are connected to this superpeer in a star-like fashion. Over time, these superpeers could also be used as local servers.

     

    For a working example, pleas try to check this article:

    #Peer to Peer File Sharing Through WCF:
    http://www.codeproject.com/Articles/614028/Peer-to-Peer-File-Sharing-Through-WCF .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Mou_kolkata Friday, February 7, 2014 8:24 AM
    Friday, February 7, 2014 2:14 AM
    Moderator
  • u gave me the link http://www.codeproject.com/Articles/614028/Peer-to-Peer-File-Sharing-Through-WCF

    i must go through the link but like to know how a p2p apps can exchange data to other p2p over the internet if there would be no server in between?

    how a p2p apps can reach to other p2p over internet? can u point me to any good sample code which i can run one p2p in one pc and other p2p on another pc and communicate over internet not LAN.

    • Marked as answer by Mou_kolkata Sunday, February 9, 2014 8:53 AM
    Friday, February 7, 2014 8:24 AM
  • Hi,

    >>know how a p2p apps can exchange data to other p2p over the internet if there would be no server in between?

    In traditional client–server model where the consumption and supply of resources is always divided. The client will ask a request to the server, and the server will post a response to the client. But in the p2p, each of the Peer are both suppliers and consumers of resources. In other words is that each of the Peer are the client and server. So they can work.

    >>how a p2p apps can reach to other p2p over internet? can u point me to any good sample code which i can run one p2p in one pc and other p2p on another pc and communicate over internet not LAN.

    In general, there is no way to connect to a computer behind NAT without some configuration on the router that does the NATing.

    What most P2P networks do in those situations is to use supernodes – computers that are not behind NAT (or that have properly configured port forwarding) that are used to help connect other computers (that are behind NAT).

    An example:
    http://www.codeproject.com/Articles/17321/A-simple-peer-to-peer-chat-application-using-WCF-n .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, February 7, 2014 8:51 AM
    Moderator

All replies

  • Hi,

    P2P computing is a term that has gained a lot of popularity in recent times. Today, organizations and businesses increasingly depend on collaboration between individuals and groups to perform essential tasks. P2P applications form more ad hoc online groups for business, entertainment, and cultural purposes. As a result, collaboration has become more essential at an individual level.

    Essentially, P2P computing is a set of networked computers that rely on the computing power and bandwidth of the individual computers on the network, as opposed to the traditional approach of relying on a smaller number of more powerful server computers on the network. A computer that is connected to a P2P network can be categorized as a node or peer. The nodes in a P2P network are usually connected on an ad hoc basis. This is where the real power in a P2P network lies, because the peers are responsible for uploading and downloading data among themselves without the need for a server.

    Two types of P2P network exist: a pure network and a hybrid network. A pure P2P network has no concept of a client or a server; it has only nodes, which act in the capacity of both a server and a client, as needed. A hybrid P2P network, on the other hand, has a central server that keeps track of the various peers on the network. This server responds to requests from the peers for information only and does not store any data. The peers are responsible for hosting the information. For example, in a file-sharing P2P application, the files are stored by the peer, and the server is aware of the files that are stored at each peer.

    Most P2P solutions rely on some nonpeer elements in the solution, such as Domain-Name System (DNS, used to translate computer host names to IP addresses). Some P2P solutions also have the notion of a superpeer, in which other peers are connected to this superpeer in a star-like fashion. Over time, these superpeers could also be used as local servers.

     

    For a working example, pleas try to check this article:

    #Peer to Peer File Sharing Through WCF:
    http://www.codeproject.com/Articles/614028/Peer-to-Peer-File-Sharing-Through-WCF .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.

    • Marked as answer by Mou_kolkata Friday, February 7, 2014 8:24 AM
    Friday, February 7, 2014 2:14 AM
    Moderator
  • u gave me the link http://www.codeproject.com/Articles/614028/Peer-to-Peer-File-Sharing-Through-WCF

    i must go through the link but like to know how a p2p apps can exchange data to other p2p over the internet if there would be no server in between?

    how a p2p apps can reach to other p2p over internet? can u point me to any good sample code which i can run one p2p in one pc and other p2p on another pc and communicate over internet not LAN.

    • Marked as answer by Mou_kolkata Sunday, February 9, 2014 8:53 AM
    Friday, February 7, 2014 8:24 AM
  • Hi,

    >>know how a p2p apps can exchange data to other p2p over the internet if there would be no server in between?

    In traditional client–server model where the consumption and supply of resources is always divided. The client will ask a request to the server, and the server will post a response to the client. But in the p2p, each of the Peer are both suppliers and consumers of resources. In other words is that each of the Peer are the client and server. So they can work.

    >>how a p2p apps can reach to other p2p over internet? can u point me to any good sample code which i can run one p2p in one pc and other p2p on another pc and communicate over internet not LAN.

    In general, there is no way to connect to a computer behind NAT without some configuration on the router that does the NATing.

    What most P2P networks do in those situations is to use supernodes – computers that are not behind NAT (or that have properly configured port forwarding) that are used to help connect other computers (that are behind NAT).

    An example:
    http://www.codeproject.com/Articles/17321/A-simple-peer-to-peer-chat-application-using-WCF-n .

    Best Regards,
    Amy Peng


    We are trying to better understand customer views on social support experience, so your participation in this interview project would be greatly appreciated if you have time. Thanks for helping make community forums a great place.
    Click HERE to participate the survey.


    Friday, February 7, 2014 8:51 AM
    Moderator