Ch. 7 - Message Passing Flashcards

1
Q

What steps must be taken for a server to communicate with a client?

A
  1. socket()
  2. bind()
  3. listen()
  4. accept()
  5. read()/write() (until transaction complete)
  6. shutdown()/close()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What steps must be taken for a client to communicate with a server?

A
  1. socket()
  2. connect()
  3. write()/read() (until transaction is complete)
  4. shutdown()/close()
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
3
Q

Why is message passing generally easy to implement?

A

Reading/writing messages between sockets works in the same way that read()/write() work for files (easy to implement for files)! In fact, a socket is just a file descriptor.

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

Why does TCP/IP break data into packets?

A

Packet size is well defined. Thus, no assumptions have to be made about the size of the message since the message can be partitioned into many small packets.

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

Does TCP/IP ensure that messages arrive in order?

A

No, TCP/IP cannot guarantee that messages arrive in order. TCP/IP reassembles the packets received so that the entire message is in the correct order.

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

If we want fast message passing and are willing to accept some errors, should we use TCP or UDP?

A

Use UDP. UDP requires less overhead because it does not do error checking. Thus, UDP is faster than TCP.

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

socket()

A

Create a socket used for message passing

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

Ports

A

Determine which process to send a message to. Required to send a message since there are many processes that receive messages.

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

bind()

A

Declares address where messages sent to socket should go.

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

listen()

A

Allow incoming connections and set a limit for the maximum incoming connections.

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

accept()

A

Wait for a message and accept the connection

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

close()

A

Deallocate the file descriptor specified

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

select()

A

Monitor multiple file descriptors waiting until one or more of the file descriptors become “ready” for some I/O operation.

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