Networking Flashcards
What is an IP address?
An Internet Protocol (IP) address uniquely identifies the computer on the computer’s address. An IP address consists of four dotted decimal numbers between 0 and 255, such as 130.254.204.33. Since it is not easy to remember so many numbers, they are often mapped to meaningful names called domain names, such as liang.armstrong.edu.
What is a DNS?
Special servers called Domain Name Servers (DNS) on the Internet translate host names into IP addresses. When a computer contacts liang.armstrong.edu, it first asks the DNS to translate this domain name into a numeric IP address and then sends the request using the IP address.
What is the “Internet Protocol”?
The Internet Protocol is a low-level protocol for delivering data from one computer to another across the Internet in packets.
What is TCP?
The Transmission Control Protocol (TCP) is a higher-level protocol used in conjunction with the Internet Protocol.
TCP enables two hosts to establish a connection and exchange streams of data. TCP guarantees delivery of data and also guarantees that packets will be delivered in the same order in which they were sent.
What is UDP?
The User Datagram Protocol (UDP) is a higher-level protocol used in conjunction with the Internet Protocol. 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.
What protocol is used for stream-based communications, and what protocol is used for packet-based communication?
Stream-based communications used TCP for data transmission, whereas packet-based communications use UDP.
What is the difference between TCP and UDP?
TCP is stream-based, UDP is packet-based. Since TCP can detect lost transmissions and resubmit them, transmissions are lossless and reliable. UDP, in contrast, cannot guarantee lossless transmission.
What is a socket?
Sockets are the endpoints 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.
What is the relationship between clients and servers?
Network programming usually involves a server and one or more clients. The client sends requests to the server, and the server responds. The client begins by attempting to establish a connection to the server. The server can accept or deny the connection. Once a connection is established, the client and the server communicate through sockets.
What is a server socket, and what is a port?
To establish a server, you need to create a server socket and attach it to a port, which is where the server listens for connections. The port identifies the TCP service on the socket. Port numbers range from 0 to 65536, but port numbers 0 to 1024 are reserved fro privileged services.
Describe how a server and client connects, in three steps.
Step 1: Create a server socket on a port, e.g., 8000, using the following statement: ServerSocket serverSocket = new ServerSocket(8000);
Step 2: Create a socket to connect to a client, using the following statement:
Socket socket = serverSocket.accept();
Step 3: A client program uses the following statement to connect to the server: Socket socket = new Socket(serverHost, 8000);
How to you create a server socket?
ServerSocket serverSocket = new ServerSocket(port);
What will happen if you try to create a server socket on a port already in use?
Attempting to create a server socket on a port already in use would cause the java.net.BindException.
After a server socket is created, the server can use the following statement to listen for connections ____
Socket socket = serverSocket.accept();
This statement waits until a client connects to the server socket.
What statement does the client issue to request a connection to a server?
Socket socket = new Socket(serverName, port);
This statement opens a socket so that the client program can communicate with the server. ‘serverName’ is the server’s Internet host name or IP address.