You Are Here:

Community: Developer Discussion Boards

#1 Old Bluetooth: Master/Slave vs. Client/Server? - 2004-11-25, 10:14

Join Date: Jun 2003
Posts: 1
sighteer
Offline
Registered User
Im totally confused about the two pairs, could anybody here help me?
The question arises when I study the bluetooth socket API. In the API a device may advertise its service, listen and accept multiple connection requests simultaneously. However, all the connections are estiblished from other devices.

So there are two angles: 1) who initiate the connection 2) one-to-many

1) In a piconet a master initiates the connection to slave: "A master is a device that establishes the connections to remote devices, slaves. A slave cannot establish any connections; it will act as a listener to incoming connections from the master device. " This is pretty true in e.g. multiplayer gaming.
In a client-server paradigm, the client initiate the connection to server, where the server is listening for incoming connection request, like web browsing.
Conclusion: master is client, slave is server.

2) The master device is capable of connecting to multiple slaves and holding these connections active simultaneously.
A web server can serve multiple client browsers.
Conclusion: master is server, slave is client.

Which one is true? I just want to know the one listening on a socket's port is the master, or the slave?

Thanks in advance for any reply.

One further question:
Does OBEX supports one-to-many connection? For example one phone connects to many phones simultaneously to exchange some file.
Last edited by sighteer : 2004-11-25 at 10:26.
Reply With Quote

#2 Old It's not one2one mapping - 2004-11-25, 22:24

Join Date: Nov 2004
Posts: 79
aluckybird
Offline
Regular Contributor
Let's discuss this as an academic question.
-My point:
1. Client-server is from the role to offer service. Server is the one who offer service, if the slave access master's service, master is the server; if the master access the slave's service, the slave is the server.
It doesn't matter who initial the connection. sorry I correct this. Today I read an article talking about client-server. It said to discuss the role, we should stand on different levels of service. From the connection level, Server is the one who listens, and client is the one who connects in. So from the connection level (it's like TCP/IP layer), whoever initiate the connection is the server. From the top application level, it might be opposite (like Nokia's BTsppEcho). Anyway to name it server or client depending on where you stand. Common sense is from the high-level application service.

2. Slave-master is categorized from the role to control or be controlled.

Definition:
-Master is the one who commands or controls others, so that they work in tandem or in parallel. In piconet, the control is like the clock synchronization.
-Slave are those who are controlled by their owner(master).

-In computing, a server is: A computer software application (or the hardware who run this application) that carries out some task on behalf of users. This is usually divided into file serving, allowing users to store and access files on a common computer; and application serving, where the software runs a computer program to carry out some task for the users. This is the original meaning of the term. Web, mail, and database servers are what most people access when using the internet. ( http://www.wordiq.com/definition/Server)

-Client:
In computing, a client is a system that accesses a (remote) service on another computer by some kind of network. (http://www.wordiq.com/definition/Client_%28computing%29)

Conclusion:
>I just want to know the one listening on a socket's port is the >master, or the slave?
According to the theory, the one listening and ready to offer serive is a server. But it can be either a master or slave, depending on your configuration (clock synronization). Actually in the bluetooth stack, one option is that master-slave can switch roles.


>Does OBEX supports one-to-many connection? For example one >phone connects to many phones simultaneously to exchange >some file.

OBEX is based on bluetooth connection, one pair has one connection. On the high level you can design it one to many, but low level implementation, you will have many connections to handle this.

Personal idea. FYI
Last edited by aluckybird : 2004-12-01 at 15:50.
Reply With Quote

#3 Old 2004-11-30, 12:39

Join Date: Mar 2003
Posts: 1,200
seppo_fn's Avatar
seppo_fn
Offline
Forum Nokia Expert
This is indeed a difficult dilemma as Bluetooth does not currently support point-to-multipoint in the best possible way (at least from the user experience point-of-view).

To implement a multiplayer game, you could do it in two ways.
Option 1:
-set 1-7 devices listening for incoming connections
-one device runs device discovery and establishes connections to those devices

So from device point-of-view one client (master) creates connections to seven servers (slaves)!

But on the other hand, from the application point-of-view: the master has to have the intelligence to echo the events of the slaves to each other. All trafic goes through the master. So game developers see the master device as a traditional game server!

Option 2 to implement a multiplayer scenario:
One device starts as a game server; others connect to it one-by-one (not simultaenously!), the server disconnects every time, but collects needed device information. After all required devices have connected to the server, it then automatically reconnects to the 'clients' without bothering the users.
Note that this scenario takes a way longer than the option 1.

When master-slave switch becomes feasible, this gets a little easier :-)

Seppo
Forum Nokia
Reply With Quote
Reply « Previous Thread | Next Thread »
Display Modes
Thread Tools Search this Thread
Search this Thread:

Advanced Search

Posting Rules

You may not post new threads
You may not post replies
You may not post attachments
You may not edit your posts

vB code is On
Smilies are On
[IMG] code is Off
HTML code is Off
Forum Jump

Rate This

 
Bookmark this page: DeliciousDiggFacebookGoogleYahooStumbleUponRedditDiigoTechnocratiTwitter  Share this page Share this page Print this Page Print this page Invite a friend Invite a friend
京ICP备05048969号    Email Newsletters Press Terms & Conditions Privacy Policy Sitemap Contact Us © 2009 Nokia