Exercises


12.1

Start an IPv6 FTP client on a dual-stack host running IPv4 and IPv6. Connect to an IPv4 FTP server, make sure the client is in "active" mode (perhaps issuing the passive command to turn off "passive" mode), issue the debug command, and then the dir command. Next, perform the same operations, but to an IPv6 server, and compare the PORT commands issued as a result of the dir commands.

12.2

Write a program that requires one command-line argument that is an IPv4 dotted -decimal address. Create an IPv4 TCP socket and bind this address to the socket along with some port, say 9999. Call listen and then pause. Write a similar program that takes an IPv6 hex string as the command-line argument and creates a listening IPv6 TCP socket. Start the IPv4 program, specifying the wildcard address as the argument. Then, go to another window and start the IPv6 program, specifying the IPv6 wildcard address as the argument. Can you start the IPv6 program since the IPv4 program has already bound that port? Does the SO_REUSEADDR socket option make a difference? What if you start the IPv6 program first, and then try to start the IPv4 program?




UNIX Network Programming Volume 1, Third Edition
Unix Network Programming, Volume 1: The Sockets Networking API (3rd Edition)
ISBN: 0131411551
EAN: 2147483647
Year: 2003
Pages: 441

flylib.com © 2008-2017.
If you may any questions please contact us: flylib@qtcs.net