Results 1 to 4 of 4

Thread: UDP Port 137 Questions

  1. #1

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    20

    UDP Port 137 Questions

    Im stuck on a problem where I need to get the computer name of a user where who will recieve the message. I need this to use the computer name on the mailslot (//computername/mailslot/messngr). I've been searching for weeks and and nearest possible solution that I can see as of the moment is to make broadcast on udp port 137 on Netbios Name query.

    problem is I don't know anything about it. I saw, using ethereal, that whenever a user send a message it creates an entry where the destination is the broadcast address (192.168.0.255).

    what is the concept behind this ?
    how can I use UDP port 137 to send message (winpopup concept using mailslot) ?
    is it possible to get the computer name using this port ?
    or is it the server who queries every workstation ?

    Thank you very much in advance.

    -= Environment =-
    Network OS: Linux 9 + Samba 3
    Workstations : Windows 98
    VB Ver. : VB6

  2. #2
    Lively Member BradBrening's Avatar
    Join Date
    Oct 2001
    Location
    Gillespie, IL
    Posts
    102

    Re: UDP Port 137 Questions

    It has been a while since I've done this, but can't you simply send a broadcast message to an IP address?

    In any case, here is a good reference on just these types of things:
    http://vbnet.mvps.org/code/network/index.html

  3. #3

    Thread Starter
    Junior Member
    Join Date
    Sep 2005
    Posts
    20

    Re: UDP Port 137 Questions

    Just recently I opened again my old program that has this problem and after searching over and over again on the net I found something that might solve this problem so I am resurrecting this thread to help others that might have the same problem.

    One possible solution for this is to use UDP port, in my case I used 27010 (half-life) for local port socket and 27011 for remote port socket. The program listen to the port 27010 so all the computers in the network listens to it. If I want to send a message using username, the program broadcast the username. Since every computer is listening on the same port, it ask a question if that username is logged in on that computer. The computer who matches the username reply with the computername to the sender of the message then it will be used in the mailslot portion (\\computername\mailslot\messngr) to send the message.

    I got the idea from a program written by Michael Ciurescu (CVMichael) - Autofind a client-server simple chat program that locates a chat server by issuing a UDP broadcast then giving the IP address to the client to connect. Thanks to him.

    Now I am thinking of what could be the effect of opening that port if there are around 200 computers in the network, will that cause too much traffic on the network ? Should I just use UDP port 137 ?

    I am also thinking about Realpopup where everytime a user logged in, it informs everybody on the net. Does it also use the same concept ?

  4. #4
    PowerPoster dilettante's Avatar
    Join Date
    Feb 2006
    Posts
    24,487

    Re: UDP Port 137 Questions

    Yes there are performance issues. One possibility is to use either a UDP port (or better a mailslot) that everyone listens on.

    When a peer wants to know where a user is, he can do a broadcast "ping" requesting the user's location and get back a response (or time out) on the same "channel" himself:

    Broadcast: ?<requesting host name>;<requested user>
    Narrow reply to requesting host: !<replying hostname>;<requested user>

    To keep traffic down each peer could cache these.

    One could also arrange to have a new peer starting up broadcast the ! message to all peers. Maybe even have a # message sent out when a peer terminates (user not here anymore). If a peer tries to use a cached destination and fails or times out it can delete the cached entry.

Posting Permissions

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



Click Here to Expand Forum to Full Width