chapter 33: Networking Flashcards Preview

Java: Basic concepts > chapter 33: Networking > Flashcards

Flashcards in chapter 33: Networking Deck (29):
1

Internet Protocol (IP)

A numeric address that uniquely identifies a computer on the internet. ex: 130.254.204.33

The IP is a low-level protocol for delivering data from one computer to another across the internet in packets.

2

What makes an IP address?

four dotted decimal numbers between 0 and 255

ex: 130.254.204.33

3

What is a domain name?

An identification string ... Domain names serve as humanly memorable names for Internet participants, like computers, networks, and services.

www.google.com

".com" is the top-level domain name. "google.com" is the domain name registered to google, and "google" is considered a second-level domain name. the "www" is the name of the web server (web host server) at the google.com domain.

www.google.com is a "fully qualified domain name (FQDN)"

4

what is a domain name server? (DNS)

a domain name server on the internet translates host names into IP addresses.

when a computer contacts google.com, it first asks the DNS to translate this domain name into a numeric IP address and then sends the request using the IP address.

5

What two higher-level protocols are using in conjunction with the Internet Protocol (IP) used to deliver data from one computer to another?

-Transmission Control Protocol (TCP)

-User Datagram Protocol (UDP)

6

What does TCP stand for and what does it do?

-Transmission Control Protocol (TCP)


enables two hosts to establish a connection and exchange streams of data

guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent.

stream-based communcations use TCP

7

What does UDP stand for and what does it do?

-User Datagram Protocol (UDP)


UDP is a standard, low-overhead, connectionless, host-to-host protocol that is used over the IP.

UDP allows an application program on one computer to send a datagram to an application program on another computer.

packet-based communications use UDP

8

What kinds of communication does java support, stream or packet?

java supports stream-based and packet-based.

however, TCP can detect lost transmissions and resubmit them. UDP cannot guarantee lossless transmission, so stream-based communication (TCP) is usually used.

9

What java class enables us to create a server socket?

ServerSocket

10

What java class enables us to create a client socket?

Socket

11

How do two programs on the Internet communicate with one another?

Two programs on the internet communicate through a server socket and a client socket using I/O streams.

12

What is a socket?

A socket is an endpoint of logical connections between two hosts and can be used to send and receive data.

java treats socket communications much as it treats I/O operations; thus, programs can read from or write to sockets as easily as they can read from or write to files.

13

How do the client and server communicate?

the client and the server communicate through sockets

14

How do we establish a server?

We must create a server socket and attach it to a port.

15

What is a port?

A port is where the server listens for connections.

It identifies the TCP server on the socket.

16

What do port numbers range from?

0 - 65,536

17

What port numbers are reserved for privileged services?

0 - 1024

18

After the server accepts the connection, how is communication between server and client conducted?

It is the same as for I/O streams.

19

Is it better to use text I/O or binary I/O? Why?

It is better to use binary I/O because text I/O requires encoding and encoding. Binary I/O improves performance.

20

what java package should you import when writing java network programs?

java.net

21

When a client connects to the server, a socket is created on the client. The socket has its own local port. How do we select the port number?

The JVM automatically chooses an available port to create a socket for the client.

22

What class can we use to find out who is connecting to the server?

InetAddress

23

How does java handle more than one client?

The connection to each client is handled by one thread.

A while loop creates a thread for each connection. pg. 1185

This makes it a multi-thread server.

24

What classes do we use to send and receive objects?

ObjectOutputStream

ObjectInputStream

25

What must we do to an object in order to enable passing?

The object must be serializable

implements java.io.Serializable

26

What method enables a server Socket to listen for client connections?

accept()

27

How does the client request a connection to a server?

the client requests a connection to a server by using

new Socket(serverName, port) to create a client socket.

28

What classes can we use to get information about a web resource?

URL

URLConnection

29

Break down this web address into its parts:

http://games.yahoo.com:80/games/login2?page=ch

protocol: http

host address: games.yahoo.com

server port number: 80

path to the resource file: games/login2?page=ch