Inter-Process Communication Flashcards

1
Q

What are the characteristics of IPC?

A
  • Message Passing
  • Possible synchronisation of two processes
  • Synchronous and Asynchronous communication
  • Queue associated with each message destination
  • Reliability
  • Ordering
  • Unicast/Multicast Communication
How well did you know this?
1
Not at all
2
3
4
5
Perfectly
2
Q

What is meant by message passing?

A

Passing message between two processes via send and receive

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

What is synchronous communication?

A

Sender and receiver synchronise (send and receive are blocking operations)

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

What is asynchronous communication?

A

Send is non-blocking, sender is allowed to continue

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

What does the sender and receiver processes do with regards to queues?

A

Sending process adds message to remote queue

Receiver process removes message from the remote queue

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

What is the destination of messages?

A

Sent to Internet Address, Local Port

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

What is meant by reliability?

A

The guaranteed delivery despite a ‘reasonable’ number of packets being dropped or lost

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

What is meant by integrity?

A

Messages arriving uncorrupted and without duplication

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

What is meant by ordering?

A

Some applications require sender order

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

What is unicast communication?

A

Communication from one process to a single other process e.g. socket communication

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

What is multicast communication?

A

Communication from one process to a group of processes e.g. publish/subscribe message model

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

What is IP?

A

Internet Protocol

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

What is the purpose of IP?

A

To deliver data packets to network devices

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

What type of address is used by IP to deliver data packets?

A

Logical IP addresses consisting of a network part and a host part
It is routable - can forward packets to another network

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

What is an internet?

A

2 or more connected TCP/IP networks that can be reached by routing

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

What is TCP?

A

Transmission Control Protocol

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

Is TCP connection- or connectionless- orientated?

A

Connection-orientated protocol

Ensures packet delivery is possibly by establishing connection first with receiving device

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

Does TCP resend packets if they don’t arrive?

A

Yes

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

When is the connection closed by TCP?

A

When packets have been successfully delivered

Unrecoverable error has occured

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

Is TCP unicast/multicast?

A

Unicast

Used for one-to-one connectioons

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

Which applications rely on TCP?

A

Web browser
FTP
SMTP - Simple Mail Transfer Protocol

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

What is UDP?

A

User Datagram Protocol

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

Is UDP connection- or connectionless-orientated?

A

Connectionless-orientated protocol
Used when the overhead of a connection isn’t required
Doesn’t guarantee delivery - places packet on the network via IP and forgets about it

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

How may a programmer deal with confirming delivery using UDP?

A

Applications can use expected replies

If no reply without a certain time, application either resends the packet or deals with packet loss

How well did you know this?
1
Not at all
2
3
4
5
Perfectly
25
What applications use UDP?
DNS, used to looks up domain names/IP addresses | Voice and video applications normally
26
What is a socket address?
Message destination are defined as socket addresses Consist of port number and internet address Data is transmitted between sockets
27
How do sockets work in Datagram Communication (UDP)?
Connectionless protocol Message-passing abstraction Each time a datagram is sent, also requires local socket descriptor and receiving sockets address
28
How do sockets work in Stream Communication (TCP)?
Connection protocol Stream abstraction Connection is established between two sockets - one listens for connection, other asks for connection Once connected, allows for two-way transmission
29
What is Stream communication used for?
Remote login File Transfer Building blocks for producer-consumer communication - produced, queued, and consumed
30
What is the size limit of UDP?
64kb
31
What is the size limit of TCP?
No size limit
32
Which (TCP or UDP) is more reliable?
TCP, guaranteed to be received in sent order
33
Which (TCP or UDP) is less complex?
UDP, less overheads | Often used for simple applications over LAN
34
What are the message size parameters for UDP? (3)
Receiver specifies an array of bytes of a size Large messages may be shortened (IP allows 2^16) Most environments have restrictions (8K)
35
What happens when UDP sends and receives?
Non-blocking sends | Blocking receives
36
Can timeouts be set on sockets using UDP
Yes, it is not always appropriate to wait indefintely
37
Can UDP receives receive from any or only a specific origin?
No specification of origin for messages | Receive method returns the Internet Address and Local Port of the sender (can check where it came from)
38
Can applications using UDP check to ensure for successful transmission?
Yes
39
What 2 main issues does UDP suffer from?
Omission issues (integrity) and ordering problems (validity)
40
What does the class DatagramPacket constructor require (2)?
DatagramPacket (byte[] buf, int length, InetAddress address, int port) - used for sending packets to specified port on specified host DatagramPacket (byte[] buf, int length) - used for receiving packets of specified length
41
What does the class DatagramSocket constructor require?
DatagramSocket(int port) - socket bound to specified port on localhost DatagramSocket() - socket bound to any available port
42
In TCP Stream Communication, how is the size of data for transmission determined?
Determined by the underlying TCP stream before transmission
43
How does TCP attempt to provide information regarding lost messages?
Uses an acknowledgement scheme
44
How does TCP attempt to deal with message duplication and ordering?
Message IDs associated with each IP packet | Recipient can detect and reject duplicates or reorder messages
45
What is involved in the TCP failure model? (2)
Integrity - Checksums to detect and reject corrupt packets and sequence numbers to detect and reject duplicate packets Validity - Times and retransmissions to deal with lost packets
46
In TCP, what is a ServerSocket?
A class, created for listening, accept method gets a connect request from the queue
47
In TCP, what is a Socket?
A class, used by the client to, specifying the DNS and port. | Provides methods getInputStream and getOutputStream
48
What are I/O Streams?
Input sources or output destination Some simply pass data, others modify data Input reads data, output sends data, one item at a time
49
What are Data Streams?
Support binary I/O of primitive data types and String values | Mostly used DataInputStream and DataOutputStream
50
If data items are mapped, what has happened to them?
Data items are then represented by agreed data structures before transmission
51
If computers are of the same type, does data mapping need to occur?
No, conversion can be omittted
52
What is the alternative to data mapping?
Can be transmitted in native form using architectural identifier
53
What happens to data items during marshalling?
Data items are collected and assembled into a suitable form for transmission
54
What is unmarshalling?
Disassembling the data items on arrival
55
What does marshalling consist of? (2)
Flattening of structured data into a sequence of basic data items Translation of those data items into the external data representation
56
How can marshalling be done 'by hand?'
Sending program explicitly converts items to external format
57
How can marshalling be done automatically?
Generated from a specification of data types
58
What is the object serialisation (binary representation) approach?
implements Serializable, which flattens, then sends???
59
What is the XML (textual representation) approach?
Tags used, describes logical structure of data and associated attribute-value pair
60
What is the request-reply protocol based on? (3)
doOperation getRequest sendReply
61
How can delivery failure occur? (3)
Messages can be dropped by senders, receives, network gateways Networks may become partitioned Processes may fail
62
What should doOperation do to allow for times of server failings?
Wait for a timeout
63
What are the 3 RPC exchange protocols?
R protocol - request RR protocol - request-reply RRA protocol - request-reply-acknowledge (client-server-client)
64
What can doOperation do after a timeout? (2)
Return and indicate it has failed - not usual since timeout may have been due to request or reply being lost Send repeatedly until it succeeds or reasonably sure delay is due to lack of response from server
65
With RPC protocols, what is designed to happened with duplicate messages?
If server receives message more than once, protocol is designed to recognise it and filter it out
66
With RPC protocols, what is designed to happen with lost reply messages?
If server has already sent reply when it receives duplicate requests it may need to execute the operation again to obtain the result
67
With RPC protocols, what is 'history'?
A history contains the structure of a reply already sent, and if retransmission is needed, it can be used rather than re-execution of the operation