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
Q

What applications use UDP?

A

DNS, used to looks up domain names/IP addresses

Voice and video applications normally

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

What is a socket address?

A

Message destination are defined as socket addresses
Consist of port number and internet address
Data is transmitted between sockets

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

How do sockets work in Datagram Communication (UDP)?

A

Connectionless protocol
Message-passing abstraction
Each time a datagram is sent, also requires local socket descriptor and receiving sockets address

28
Q

How do sockets work in Stream Communication (TCP)?

A

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
Q

What is Stream communication used for?

A

Remote login
File Transfer
Building blocks for producer-consumer communication - produced, queued, and consumed

30
Q

What is the size limit of UDP?

A

64kb

31
Q

What is the size limit of TCP?

A

No size limit

32
Q

Which (TCP or UDP) is more reliable?

A

TCP, guaranteed to be received in sent order

33
Q

Which (TCP or UDP) is less complex?

A

UDP, less overheads

Often used for simple applications over LAN

34
Q

What are the message size parameters for UDP? (3)

A

Receiver specifies an array of bytes of a size
Large messages may be shortened (IP allows 2^16)
Most environments have restrictions (8K)

35
Q

What happens when UDP sends and receives?

A

Non-blocking sends

Blocking receives

36
Q

Can timeouts be set on sockets using UDP

A

Yes, it is not always appropriate to wait indefintely

37
Q

Can UDP receives receive from any or only a specific origin?

A

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
Q

Can applications using UDP check to ensure for successful transmission?

A

Yes

39
Q

What 2 main issues does UDP suffer from?

A

Omission issues (integrity) and ordering problems (validity)

40
Q

What does the class DatagramPacket constructor require (2)?

A

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
Q

What does the class DatagramSocket constructor require?

A

DatagramSocket(int port) - socket bound to specified port on localhost

DatagramSocket() - socket bound to any available port

42
Q

In TCP Stream Communication, how is the size of data for transmission determined?

A

Determined by the underlying TCP stream before transmission

43
Q

How does TCP attempt to provide information regarding lost messages?

A

Uses an acknowledgement scheme

44
Q

How does TCP attempt to deal with message duplication and ordering?

A

Message IDs associated with each IP packet

Recipient can detect and reject duplicates or reorder messages

45
Q

What is involved in the TCP failure model? (2)

A

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
Q

In TCP, what is a ServerSocket?

A

A class, created for listening, accept method gets a connect request from the queue

47
Q

In TCP, what is a Socket?

A

A class, used by the client to, specifying the DNS and port.

Provides methods getInputStream and getOutputStream

48
Q

What are I/O Streams?

A

Input sources or output destination
Some simply pass data, others modify data
Input reads data, output sends data, one item at a time

49
Q

What are Data Streams?

A

Support binary I/O of primitive data types and String values

Mostly used DataInputStream and DataOutputStream

50
Q

If data items are mapped, what has happened to them?

A

Data items are then represented by agreed data structures before transmission

51
Q

If computers are of the same type, does data mapping need to occur?

A

No, conversion can be omittted

52
Q

What is the alternative to data mapping?

A

Can be transmitted in native form using architectural identifier

53
Q

What happens to data items during marshalling?

A

Data items are collected and assembled into a suitable form for transmission

54
Q

What is unmarshalling?

A

Disassembling the data items on arrival

55
Q

What does marshalling consist of? (2)

A

Flattening of structured data into a sequence of basic data items
Translation of those data items into the external data representation

56
Q

How can marshalling be done ‘by hand?’

A

Sending program explicitly converts items to external format

57
Q

How can marshalling be done automatically?

A

Generated from a specification of data types

58
Q

What is the object serialisation (binary representation) approach?

A

implements Serializable, which flattens, then sends???

59
Q

What is the XML (textual representation) approach?

A

Tags used, describes logical structure of data and associated attribute-value pair

60
Q

What is the request-reply protocol based on? (3)

A

doOperation
getRequest
sendReply

61
Q

How can delivery failure occur? (3)

A

Messages can be dropped by senders, receives, network gateways
Networks may become partitioned
Processes may fail

62
Q

What should doOperation do to allow for times of server failings?

A

Wait for a timeout

63
Q

What are the 3 RPC exchange protocols?

A

R protocol - request
RR protocol - request-reply
RRA protocol - request-reply-acknowledge

(client-server-client)

64
Q

What can doOperation do after a timeout? (2)

A

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
Q

With RPC protocols, what is designed to happened with duplicate messages?

A

If server receives message more than once, protocol is designed to recognise it and filter it out

66
Q

With RPC protocols, what is designed to happen with lost reply messages?

A

If server has already sent reply when it receives duplicate requests it may need to execute the operation again to obtain the result

67
Q

With RPC protocols, what is ‘history’?

A

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