Networking Flashcards

1
Q

What is the Internet Protocol (IP)?

A

The principal communications protocol in the Internet protocol suite for relaying datagrams across network boundaries.

IP delivers packets from the source host to the destination host based on IP addresses in packet headers.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What are the two types of Internet Protocol addressing?

A

IPv4 and IPv6

IPv4 addresses are 32 bits, while IPv6 addresses are 128 bits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

What is the main advantage of IPv6 over IPv4?

A

Larger address space with approximately 3.4×10^38 addresses.

IPv6 has a length of 128 bits compared to IPv4’s 32 bits.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
4
Q

Define Domain Name Server (DNS).

A

Special servers that translate host names into IP addresses.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
5
Q

What are the two higher-level protocols used in conjunction with IP?

A
  • Transmission Control Protocol (TCP)
  • User Datagram Protocol (UDP)
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
6
Q

What is the function of TCP?

A

Enables two hosts to establish a connection and exchange streams of data while guaranteeing delivery and order of packets.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
7
Q

What is the function of UDP?

A

A connectionless, low-overhead protocol that allows an application program on one computer to send a datagram to an application program on another computer.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
8
Q

What is the client/server model?

A

A model where one process (the client) connects to another process (the server) to request information.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
9
Q

What is a socket?

A

One end of an interprocess communication channel.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
10
Q

What classes does Java provide for socket communication?

A
  • ServerSocket class for creating server sockets
  • Socket class for creating client sockets
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
11
Q

What is the range of port numbers?

A

0 to 65536, with 0 to 1024 reserved for privileged services.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
12
Q

Fill in the blank: The statement to create a server socket is _______.

A

[serverSocket]

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
13
Q

What methods are used to get input and output streams from a socket?

A
  • getInputStream()
  • getOutputStream()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
14
Q

What is multithreading?

A

The ability for multiple tasks in a program to be executed concurrently.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
15
Q

What must a task class implement to run in a thread?

A

Runnable interface.

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
16
Q

What method must be implemented in the Runnable interface?

A

run method.

17
Q

What class is used to create threads in Java?

A

Thread class.

18
Q

What is the purpose of the start() method in a thread?

A

To tell the JVM that the thread is ready to run.

19
Q

True or False: The Thread class implements the Runnable interface.

A

True.

20
Q

What is the purpose of the DataInputStream and DataOutputStream classes?

A

To read and write primitive data values.

21
Q

What does the following code do? new Thread(new Runnable() {…}).start()

A

Creates and starts a new thread that runs the specified Runnable.

22
Q

What is the purpose of the ServerSocket in a server implementation?

A

To listen for connections on a specified port.

23
Q

What happens when a server accepts a connection?

A

Communication between the server and client is established through I/O streams.

24
Q

What is the role of the ThreadForClient class in the example?

A

Handles the connection to each client in a separate thread.