Solved

IP confusion

Posted on 1998-08-14
5
171 Views
Last Modified: 2013-11-20

I am a little bit confused and I hope someone will kindly help me.
Please execuse me for the following simple questions cause  I am trying to write my first winsock program.


I have 2 PCs (WIN95)  connected to the Internet using ISP and modem. Here are the questions:

1. Is the IP address of each of them a local one and I cannot use it to send something directely to them from another machine on the Internet using WinSock?
2. Do they get a new IP address each time they connect to the Internet (Dial-up)?
3. Is there anyway that I can code a program that send a file or text from one of them to the other without using a server or broker?
4. What are the answers to the above 3 questions in case that these 2 clients are using NIC and behind a firewall or broxy?

Is there any example for client to client direct communications ?
0
Comment
Question by:kawa
[X]
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
  • 3
  • 2
5 Comments
 
LVL 6

Accepted Solution

by:
snoegler earned 100 total points
ID: 1320854
Hello,

I hope i this information is useful to you ...
>>1. Is the IP address of each of them a local one and I cannot use it to send >>somethingdirectely to them from another machine on the Internet using WinSock?
Usually a PC which is connected via dial-up networking to the internet receives a dynamically
assigned IP adress. This adress stays the same during one session. But there are exceptions:
a) Your provider uses statically assigned IP adresses (which is usually quite expensive)
b) Your winsock.dll is replaced by the AOL winsock. I am not totally sure about that, but i know
     that AOL uses *not* the standard dial-up networking, they have something proprietary
     instead.
That means, this adress is internet-wide valid during the session. So it is possible to send
data from one machine to the other, the only problem is to know about the adresses.
Maybe you could solve this by using a known FTP server you have write access for.
Each machine could store their adresses after login for example in some file
'/mydir/<machine>.txt' on the server, so you could retrieve the other one's IP automatically by
reading these files.
>> 2. Do they get a new IP address each time they connect to the Internet (Dial-up)?
Yes, usually (look above)
>> 3. Is there anyway that I can code a program that send a file or text from one of them to
>> the other without using a server or broker?
If you have both IP adresses of both machines, yes. But to get the IP adresses of each other
programmatically, i think you'll need a server (look under 1)
>> 4. What are the answers to the above 3 questions in case that these 2 clients are using NIC
>> and behind a firewall or broxy?
This depends on the implementation of the firewall/proxy.
a) firewall/proxy standing at the provider, both computers connected by modem
   - usually this should be the same as if the firewall/proxy wasn't there. Exceptions are that
     if it is a firewall, you can use only 'known' ports. Your provider should be able to give you
     a list with possible ports - safe are in each case the IPPORT_FTP and IPPORT_HTTP
     ports.
   - the proxy could also treat the users 'behind' it as an own IP net.
     If this is the case you should contact your provider - this is implementation depending.
b) firewall/proxy is the computer with the modem, computers connected via LAN.
   - In this case you could exchange data on a LAN basis without problems, but the firewall
     usually won't assign IP adresses to the machines behind it. If the LAN is using TCP/IP,
     this problem solves itself - each machine has (in the LAN) a well defined IP adress, so
     the way for exchanging data using winsock is totally transparent to your application.

>> Is there any example for client to client direct communications ?
Yes, on the Visual C++ CD are two examples:
- CHATSRVR, a chat server.
- CHATTER, a chat client.
CHATTER will ask you for the internet adress the 'CHATSRVR' app is running, this is the
only point which is a bit different to handle. Either you implement the method i mentioned
at the beginning of this message (storing both adresses somewhere in the net and fetching
it back) - or you add a message box to CHATSRVR which displays the CHATSRVR's
IP address before the program starts.

snoegler
0
 

Author Comment

by:kawa
ID: 1320855
Thanks for the explaination.
I will accept your answer but I hope you can tell me your idea if I have one  client behind a company firewall and the other is using modem through ISP . can I make them direcely send files to each other  ?
0
 
LVL 6

Expert Comment

by:snoegler
ID: 1320856
You need to know if the machines behind the firewall completely hidden to the internet.
If yes, that's bad luck.
If no you'll probably have to authentificate the incoming request, the protocol for that depends
on the type of firewall. You should be able to get a documentation on this (perhaps the
network administrator can explain this to you, or the docs on the firewall has information
about that - if not, you better ask some hackers, they'll know how to do it ;) )
I can't help you any further without information about the firewall. Perhaps someone other can,
but i think it would be helpful to all who read this question if you'd get this information and
post it here.
Good luck =o)
0
 

Author Comment

by:kawa
ID: 1320857
Thank you.
I was hoping to make a general solution that will work with _any_ firewall. It looks now more complicated that I thought. I will check what the hackers do and if I get something I will share it with all the peoples here. I also hope that some more experts can post additional information on that subject. Thanks again

0
 
LVL 6

Expert Comment

by:snoegler
ID: 1320858
If you want other experts to post additional information, you should not have accepted this
answer. Now anyone who tries to read it gets some points deducted from the account.
Thanks, though :)
0

Featured Post

Technology Partners: We Want Your Opinion!

We value your feedback.

Take our survey and automatically be enter to win anyone of the following:
Yeti Cooler, Amazon eGift Card, and Movie eGift Card!

Question has a verified solution.

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

This is to be the first in a series of articles demonstrating the development of a complete windows based application using the MFC classes.  I’ll try to keep each article focused on one (or a couple) of the tasks that one may meet.   Introductio…
Introduction: Dynamic window placements and drawing on a form, simple usage of windows registry as a storage place for information. Continuing from the first article about sudoku.  There we have designed the application and put a lot of user int…
This video will show you how to get GIT to work in Eclipse.   It will walk you through how to install the EGit plugin in eclipse and how to checkout an existing repository.
This tutorial will teach you the special effect of super speed similar to the fictional character Wally West aka "The Flash" After Shake : http://www.videocopilot.net/presets/after_shake/ All lightning effects with instructions : http://www.mediaf…

690 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