-4

I know what is peer to peer and what is client server. But I'm little bit confusing when I think that server is also another computer same as another peer. Then why NAT or something other not make an issue during CLIENT/SERVER communication? which is actually same as peer to peer because both are two computers/devices as in peer to peer. So what standards applied in server which allows easy and secure communication even there is NAT?

In peer to peer, one peer send request 2nd accept. So once the connection established both works as client-server. But why communication here is difficult than the client-server like NAT problems and so on?

In the client server, client send request and server can easily connect. No NAT issues etc?

Please note I'm not even new which can't understand what is Peer to Peer & Client Server. I'm just asking why client-server works easily compare to Peer to peer? Both are two peers and computer/devices.

  • @downvoter? would you like to elaborate the reason? – Asif Mushtaq Oct 03 '17 at 21:15
  • The answer is Sessions – Jacob Evans Oct 03 '17 at 21:29
  • @JacobEvans I know all about the sessions and cookies, but main problem is that how the servers accessible easily rather than peer in peer-to-peer? – Asif Mushtaq Oct 03 '17 at 21:31
  • No, I'm afraid you don't understand session state, ephemeral ports vs service ports, how RCP works. – Jacob Evans Oct 03 '17 at 21:34
  • 1
    https://serverfault.com/help/on-topic "Server Fault is for questions about managing information technology systems in a business environment." – mfinni Oct 03 '17 at 21:36
  • Let me summarize, PC-A is peer. PC-B is also peer. then Server-A is server. SO PC-A can easily connect with Server-A rather than PC-B why? is Server-A will be differently configured in the routers than the PC-B? in the Server-A there will be no concept like NAT and so on? – Asif Mushtaq Oct 03 '17 at 21:37

1 Answers1

3

No, it's not the same.

A client-server architecture expects that the server will always be listening for connections, and the client will always initiate the connection. You don't expect (and will not have) Google web servers connecting to your computer to deliver data.

On a peer to peer, any computer on the P2P network can act as a client, as a server, or both at the same time. A bittorrent swarm works like this. Every computer on the network can establish a connection to another, or accept a connection request.

The NAT problem is not where P2P or Client-Server differs. It's just that a server usually have enough resources to buy a dedicated IP address, and a P2P network don't. A server will usually have a domain name, and is easly acessible, while on P2P networks, the nodes are usually behind a home router, or WiFi AP, or enterprise proxy. They usually are not direct connected to the internet.

By using IPv6 (and getting rid of NAT) you still have the same differences: Client-Server have defined roles for each computer, and P2P have both capability for initiating and accepting connections on the same computer.

ThoriumBR
  • 5,302
  • 2
  • 24
  • 34
  • So servers are not behind the NAT? that's why it is easily to figure/connect to them and securing them(servers) with the applications/os and so on? – Asif Mushtaq Oct 03 '17 at 21:27
  • 1
    Servers are usually not behind NAT. Even when they are physically behind NAT, the firewall/router/proxy routes the packets to them so they behave as if they had direct connection. – ThoriumBR Oct 03 '17 at 21:41
  • So let me confirm, Server are configured to handle such request and works openly? all about the configuration and we can't configure every new peer in the peer-to-peer connection that's it? – Asif Mushtaq Oct 03 '17 at 21:45
  • No, they are very different architectures. A server is deployed on a network prepared to host a server, unlike a P2P node. A server have a different software stack, with different capabilities, and different expectations. It's like comparing a car with a train: both have wheels and carry people around, but they are vastly different. – ThoriumBR Oct 03 '17 at 21:53