Welcome to Experts Exchange

Add your voice to the tech community where 5M+ people, just like you, are talking about what matters.

  • Help others & share knowledge
  • Earn cash & points
  • Learn & ask questions
Solved

Server/Client Broadcast/Handshake

Posted on 2004-03-26
13
378 Views
Last Modified: 2010-04-15
Hey,

I was wondering if anyone could help me with the following.
I need a server which will broadcast its ip address over the subnet it is located on.
One or more Clients will be listening for the broadcasts, when received, the clients will reply to the broadcasts with their ip's.
The server/client will then perform a handshake and a connection will be established between the two nodes.

Once a connection is established, both the server and client will print a message saying "Connection Established to [Server/Client ip]

Any help will be greatly appreciated !

Thanks

Kevin
0
Comment
Question by:Kevin_R
  • 5
  • 4
  • 2
13 Comments
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10693465
sounds very much like a school project or homework assignment ...

www.ecst.csuchico.edu/~beej/guide/net/html/ 

follow this guide sincerely .... it is the best available on the web .... Once you are comfortable with socket programming and client server architecture (this guide covers it) , we can talk about subnets and multicasting

good luck
0
 

Expert Comment

by:namus
ID: 10695048
hey u cud as well read the book
UNIX Network Programming Volume-1 Networking API: Sockets & XTI
--- Richard Stevens.

this book gives u a lotta indepth knowledge abt the TCP connection establishment & various issues concerning with the TCP/IP, practically this is a fine guide. It wud b quite simple for u to do wat u wanna do.. after u read that book..
else u can also browse to the topics u want instead of reading the whole book..
He gives nice code snippets that u cud as well use in ur code.
Dont need to touch the XTI part. Jus read the sockets part in this book... that wud b enuf...

gud luck...
0
 

Author Comment

by:Kevin_R
ID: 10695894
This is for University, but it isnt assessed work.
Its simply to allow myself and friends to connect to one-another and send files over a wireless network as windows file sharing etc is unavailable as traffic can only be sent/received through port 1494 (citrix)
0
Portable, direct connect server access

The ATEN CV211 connects a laptop directly to any server allowing you instant access to perform data maintenance and local operations, for quick troubleshooting, updating, service and repair.

 

Expert Comment

by:namus
ID: 10696044
i dunno abt citrix systems, but the work seems to b quite easy... u jus need to get the specifications rite. & take a few things into consideration. like the traffic limitations or bandwidth considerations. Broadcasting wud add a lot of traffic to the existing one. Instead of that, if the IP's of the other hosts r known... u can jus ping or send some packets with icmp echo requests. so that u kno if ur friends r online... then u can start the connection.
if ur friends have dialup connections, ie with no fixed ip's then allowing one of the static ip system to b the server & remaining other systems can follow the procedure to kno if others r online, & proceed. gotta takecare of any firewalls in btwn too. 4 that u need to take the admin's permission....
anyway... gud luck 4 all ur future endevours....
0
 

Author Comment

by:Kevin_R
ID: 10696114
Ignore the citrix part, Im just saying what its used for.

Basically, Im looking to create a beacon server that will announce itself over the network by sending out a packet on the broadcast ip of the current subnet every few seconds.

Any ideas ?

Thanks
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10702020
yes it is possible and is quite simple ... Are you familiar with socket programming ?
0
 

Author Comment

by:Kevin_R
ID: 10704394
Its pretty good, Does anyone have any good code that is simple enough to alter if required?
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10704782
www.ecst.csuchico.edu/~beej/guide/net/html/

has skeletal code for client server architecture .... It can be easily adapted to your requirements
0
 

Author Comment

by:Kevin_R
ID: 10708452
How do I make the server broadcast over the subnet its run on, say every 5 seconds.

Also I cant see the string the server sends on client connect anywhere ?

Help !!

Thanks
0
 
LVL 45

Accepted Solution

by:
sunnycoder earned 500 total points
ID: 10710610
your clients need to be listening on a predefined port , say 3434

use UDP to broadcast

Broadcast on a network is netid followed by all 1s for host id
e.g. for 192.5.6 network, the boradcast address will be
192.5.6.255
0
 
LVL 45

Expert Comment

by:sunnycoder
ID: 10721469
also to receive a broadcast packet, you will have to set SO_BROADCAST using setsockopt at the receiver

man 7 socket
man setsockopt
0

Featured Post

PRTG Network Monitor: Intuitive Network Monitoring

Network Monitoring is essential to ensure that computer systems and network devices are running. Use PRTG to monitor LANs, servers, websites, applications and devices, bandwidth, virtual environments, remote systems, IoT, and many more. PRTG is easy to set up & use.

Question has a verified solution.

If you are experiencing a similar issue, please ask a related question

This tutorial is posted by Aaron Wojnowski, administrator at SDKExpert.net.  To view more iPhone tutorials, visit www.sdkexpert.net. This is a very simple tutorial on finding the user's current location easily. In this tutorial, you will learn ho…
Examines three attack vectors, specifically, the different types of malware used in malicious attacks, web application attacks, and finally, network based attacks.  Concludes by examining the means of securing and protecting critical systems and inf…
The goal of this video is to provide viewers with basic examples to understand and use structures in the C programming language.
Video by: Grant
The goal of this video is to provide viewers with basic examples to understand and use for-loops in the C programming language.

839 members asked questions and received personalized solutions in the past 7 days.

Join the community of 500,000 technology professionals and ask your questions.

Join & Ask a Question