• Home
  • Textbooks
  • Internetworking with TCP/IP: Pearson New International Edition
  • The Socket API

Internetworking with TCP/IP: Pearson New International Edition

Douglas E. Comer

Chapter 21

The Socket API - all with Video Answers

Educators


Chapter Questions

Problem 1

Download the example client and server from comerbooks.com and run them on your local system.

Check back soon!

Problem 2

Build a simple server that accepts multiple concurrent TCP connections. To test your server, have the process that handles a connection print a short message, delay a random time, print another message, and exit.

Check back soon!

Problem 3

When is the listen call important?

Check back soon!
00:51

Problem 4

What functions does your local system provide to access the Domain Name System?

Suman Saurav Thakur
Suman Saurav Thakur
Numerade Educator

Problem 5

Devise a server that uses a single Linux process (i.e., a single thread of execution), but handles multiple concurrent TCP connections. (Hint: think of select.)

Check back soon!
01:21

Problem 6

Read about alternatives to the socket interface, such as the Transport Library Interface (TLI) and compare them to sockets. What are the major conceptual differences?

Pankaj Jain
Pankaj Jain
Numerade Educator
01:12

Problem 7

Each operating system limits the number of sockets a given program can use at any time. How many sockets can a program create on your local system?

Shelby Mohamed
Shelby Mohamed
Numerade Educator

Problem 8

Can the socket/file descriptor mechanism and associated read and write operations be considered a form of object-oriented design? Explain why or why not.

Check back soon!
01:14

Problem 9

Consider an alternative API design that provides an interface for each layer of protocol software (e.g., the API allows an application program to send and receive raw frames without using IP, or to send and receive IP datagrams without using UDP or TCP). What are the advantages of having such an interface? The disadvantages?

Jennifer Stoner
Jennifer Stoner
Numerade Educator

Problem 10

A client and server can both run on the same computer and use a TCP socket to communicate. Explain how it is possible to build a client and server that can communicate on a single machine without learning the host's IP address.

Check back soon!

Problem 11

Experiment with the sample server in this chapter to see if you can generate TCP connections sufficiently fast to exceed the backlog the server specifies. Do you expect incoming connection requests to exceed the backlog faster if the server operates on a computer that has one core than on a computer that has four cores? Explain.

Check back soon!

Problem 12

Some of the functions in the original socket API are now irrelevant. Make a list of socket functions that are no longer useful.

Check back soon!

Problem 13

Read more about IPv6 address scope. If a server binds a socket to an address with linklocal scope, which computers can contact the server?

Check back soon!

Problem 14

If a programmer wants to create a server that can be reached either via IPv4 or IPv6, what socket functions should the programmer use and how should addresses be specified?

Check back soon!