|   NetProg 2002 HW6 FAQ |
|     Project Description     |    Submission Instructions |
| Question: | The project description says "your client should be capable of using either IPv4 or IPv6, depending on the server address specified on the command line". does it mean I need to tell the client to use a IPv4 or IPv6 address for itself to connect to the server? for example, when I specify the command like this: ./client <serverhost> <server port> 4the client should use a IPv4 address for itself, and when the command line is like: ./client <server host> <server port> 6client should choose IPv6 address instead? is that what you mean? |
|
| Answer: | You should not need a command line parameter that specifies what kind of address is being used. The whole idea is to write a generic client that could use any kind of address. Your client should use IPv4 if the server address specified on the command line is an IPv4 address. So if you see this: ./client 128.213.4.1 3456the client should create an IPv4 socket and give connect (or sendto) a sockaddr_in. If you see this:
./client fe80::a00:20ff:fe82:fa21 3456the client should create an IPv6 socket and give connect (or sendto) a sockaddr_in6. Note that if you use getaddrinfo to
create the sockaddr and determine the value of the
parameters you need to create the right socket, you don't need to do anything
special to distinguish between the 2 types of addresses - getaddrinfo
does all the work! The code could now also work (in the future)
with any new address family supported by sockets.
|
|
| Question: | How do I find out the IPv6 address of a machine? |
|
| Answer: | On the CS suns you type the comand
This shows that the IPv6 address of eggbeater is
|
|
| Question: | How do I tell bind to give me any IPv6 address? I tried using INADDR_ANY but it doesn't work with an IPv6 address. |
|
| Answer: |
You can initialize a struct in6_addr foo=IN6ADDR_ANY_INIT; struct sockaddr_in6 skadr; ... skadr.sin6_addr = foo; ... Note that IN6ADDR_ANY_INIT is legal as an initialization of a
variable only, you can't assign it directly to
|
|
| Question: | The project description doesn't say what to do about <insert name of some implementation detail here>. How are we supposed to handle this? |
|
| Answer: | You are given lots of freedom to make these decisions yourself, go for it! Just make sure you tell us whatever we need to know to be able to build and run your system! |
|
| Question: | Is there a demonstration system? |
|
| Answer: | No. Dave knows from experience that if a demonstration system was provided, too many people would simply copy his design (instead of coming up with their own). |
|
| Question: | What happened with Brittney? |
|
| Answer: | I have no idea. Feel free to make up the rest, send it to me and I'll make it available to others. |
|