×

Welcome to the Slashdot Beta site -- learn more here. Use the link in the footer or click here to return to the Classic version of Slashdot.

Thank you!

Before you choose to head back to the Classic look of the site, we'd appreciate it if you share your thoughts on the Beta; your feedback is what drives our ongoing development.

Beta is different and we value you taking the time to try it out. Please take a look at the changes we've made in Beta and  learn more about it. Thanks for reading, and for making the site better!

Question: Define "Client-Server" and "Peer to Peer"

Chacham (981) writes | more than 10 years ago

User Journal 7

Can you define "Client-Server" and "Peer to Peer". What's the difference inbetween them. Which is AIM, X, a web server, or other applications?

Can you define "Client-Server" and "Peer to Peer". What's the difference inbetween them. Which is AIM, X, a web server, or other applications?

Someone I know is working on some protocol and needed a definition. I need to ask him again what his definition was, because it got me thinking and I forgot exactly what he said. :P So I came up with something, which he mentioned was too shaky allowing many things to be classified as both. So I came up with others. I need to bounce them off him when I see him again. I found the thought alone somewhat intriguing, and decided to ask here.

Regardless of what other people say it is, what do you think it is?

7 comments

My definition (1)

Cyberdyne (104305) | more than 10 years ago | (#6204090)

Can you define "Client-Server" and "Peer to Peer". What's the difference inbetween them. Which is AIM, X, a web server, or other applications?

Client-server: Two programs performing distinct functions, the server providing a service to the client but not vice-versa. AIM, X and web servers are all in this category: you have distinct clients and servers.

Peer-to-peer: A single program (or type of program) communicating with other such programs, each providing services to the other. A fax machine could be in this category (each fax machine sends and receives faxes to and from other fax machines).

Most applications classed as P2P actually combine both. Napster had a client-server search system, coupled with P2P file transfer, BitTorrent does the same.

Incidentally, this is a big problem with SMTP documentation: when one mail server is relaying mail to another, what do you call the two? (The solution chosen was that a 'client' is the end uploading mail to the other, which becomes the 'server'; rather than 'server', programs such as Exim, Qmail and Sendmail are then referred to as MTAs - Mail Transfer Agents. In a sense, they could be regarded as P2P of a sort...)

Re:My definition (1)

heliocentric (74613) | more than 10 years ago | (#6204660)

Don't forget the sometimes-considered backwards client/server of X. Here the user is running the server and the backend machine is the client. Then toss in XDMCP broadcasts and you've got a really intersting mix of servers and clients.

There's another thing I'd like to point out that yes your napster view is a correct mix of p2p and client server, but sometimes people confuse the napster hirarchy with a game server (for example the new Wolfenstein: Enemy Territory). Here there two client/server setups, one where a user connects to a single large gaming server that lists information about locally hosted games, a user then selects which host to connect to for a game. This local server is still a server in a client server relationship.

Re:My definition (1)

Cyberdyne (104305) | more than 10 years ago | (#6204708)

Don't forget the sometimes-considered backwards client/server of X. Here the user is running the server and the backend machine is the client. Then toss in XDMCP broadcasts and you've got a really intersting mix of servers and clients.

Yep, X's terminology gets a lot of people confused. It makes sense with the right viewpoint, though: the server is the program which sits around waiting for network traffic asking it for a service, the client is the program which appears and starts talking to an existing server. One of those things which made sense to the original creators, but seems pretty wacky to everyone else ;-)

There's another thing I'd like to point out that yes your napster view is a correct mix of p2p and client server, but sometimes people confuse the napster hirarchy with a game server (for example the new Wolfenstein: Enemy Territory). Here there two client/server setups, one where a user connects to a single large gaming server that lists information about locally hosted games, a user then selects which host to connect to for a game. This local server is still a server in a client server relationship.

To confuse things further, you could have a P2P game: especially for two-player games, the "server" would just act as a directory to locate your opponent's IP, then the game traffic would be P2P...

Re:My definition (1)

heliocentric (74613) | more than 10 years ago | (#6205019)

To confuse things further, you could have a P2P game: especially for two-player games, the "server" would just act as a directory to locate your opponent's IP, then the game traffic would be P2P...

I've designed and implemented true P2P games, the traditional approach is that one machine is acting as the central control, but any client could be promoted to do such a thing. Thus, each applicaiton running contains all of the tools needed to entirely support the system and take and relinquish control on the fly. This reduces network traffic so each peer does not need to constantly check in with each other peer, however each peer is aware of and can contact each other peer. This is necessary since the acting central control could disappear unexpectidly and the others need to elect a new central controler, or to improve the overall peer system they may wish to periodically poll ping times, load, or other criteria and elect a new central creature. Another important feature is that since each system can act as the central thing and peer cross talk is expected each system is capable of recieving messages and handling them within the system as well as generating messages (broadcast or specific to other peers).

In a peer system, even if there is a dynamic central message handler, the hirarchy is a flat one, in a true client/server system there is more of a tree hirarchy.

Here's the quick and dirty (1)

FortKnox (169099) | more than 10 years ago | (#6206904)

Client server, draw a circle in the middle of a piece of paper. Make it medium sized. Now draw a bunch of small circles everywhere else. Connect each small circle to the medium server by drawing a line between them. That is client server (its just a simple example, you can put a few more medium circles, but lines are small circle to medium circle, or medium to medium; no small to small).

Now, draw the same circles, but connect any two types of circles to one another. You can connect one small to five smalls, pretty much random. This is peer-to-peer.

With client server, everything has to go through a server, with peer-to-peer, everything can be connected to everything.

Now, to confuse you, most programs are a little of both. Like, with AIM, you connect to a server, but if you do a 'direct connect' to a buddy, you are now peer-to-peer (no talking to the server is required).

The internet, itself, is defined as peer-to-peer, but its actually a combo. You connect to your isp, making it client server, and you need a DNS server to determine the IP of a site you go to, but in all theory, everything is peer-to-peer.

Resource/consumer (1)

sql*kitten (1359) | more than 10 years ago | (#6232978)

We prefer the terms "resource" and "consumer" to "server" and "client", and we apply them at the process level, not the machine. Thinking about it that way makes it a lot cleaner - no need to tie yourself in knots trying to remember its the opposite way round for X for example. A consumer connects to a resource. A process that is both a consumer and a resource is a "filter". A "peer" in our application is an identical resource or filter used for load balancing. I don't think we have any circular relationships.
Check for New Comments
Slashdot Account

Need an Account?

Forgot your password?

Don't worry, we never post anything without your permission.

Submission Text Formatting Tips

We support a small subset of HTML, namely these tags:

  • b
  • i
  • p
  • br
  • a
  • ol
  • ul
  • li
  • dl
  • dt
  • dd
  • em
  • strong
  • tt
  • blockquote
  • div
  • quote
  • ecode

"ecode" can be used for code snippets, for example:

<ecode>    while(1) { do_something(); } </ecode>
Sign up for Slashdot Newsletters
Create a Slashdot Account

Loading...