IPC Flashcards
(20 cards)
What is Inter-process communication?
- Allows for the exchange of data between multiple processes (or threads within processes)
- The processes can reside and run on different computers (but connected by a network)
List 4 Reasons for using IPC
- Sharing data
- Accessing remote services
- Computational efficiency
- Distributed applications
e. g. iCloud, iTunes, mobile games, social networking, Skype, Facetime, shared whiteboards, etc.
List some characteristics of inter-process communication
- Message passing between two processes via send and receive
- May involve the synchronisation of the two processes
- Synchronous and Asynchronous communication
What is synchronous communication?
Sender and receiver synchronise (send and receive are blocking operations)
What is asynchronous communication?
Send is non-blocking; sender is allowed to continue
What is meant by reliability?
- Guaranteed delivery despite a ‘reasonable’ number of packets being dropped or lost
- Integrity - messages must arrive uncorrupted and without duplication
What is the difference between unicast and multicast communication?
- Unicast communication is from one process to a single other process (e.g. socket communication)
- Multicast is communication from one process to a group of processes (e.g. publish / subscribe message model)
List 4 characteristics of Internet Protocol (IP)
- Delivers data packets to network devices
- Uses logical IP addresses for devices (rather than physical MAC, Media Access Control, addresses)
- IP address consists of a network part and a host part and is a ‘routable’ protocol – can forward packets to another network (i.e. inter-networking)
- An internet - two or more connected TCP/IP networks that can be reached by routing
List 6 characteristics of Transmission Control Protocol (TCP)
- Connection-oriented ‘Transport layer’ protocol.
- Allows data packets to be sent reliably between devices (on same or different network).
- Ensures packet delivery if at all possible by establishing a connection with the receiving device and then sending the packets.
- Resends packets if they don’t arrive.
- Connection closed only after packet has been successfully delivered or an unrecoverable error has occurred.
- Used for one-to-one communications. (User Datagram Protocol (UDP) is used for multicast / broadcast).
Give examples of applications that rely on TCP
- Web browser / server uses HTTP to send request / replies via TCP
- Telnet (terminal emulation)
- FTP (file transfer protocol – used for file exchange)
- SMTP (simple mail transfer protocol).
List 4 characteristics of User Datagram Protocol (UDP)
- Connectionless Transport layer protocol
- Used when the overhead of a connection isn’t required.
- Doesn’t guarantee delivery - UDP places a packet on the network (via the IP protocol) and forgets about it.
- Programmer may have to deal with confirming delivery
Give examples of applications that rely on UDP
- DNS, the Domain Name System; used to lookup domain names / ip addresses. DNS sends a UDP packet to a DNS server to look up the domain and the domain’s IP address is returned in another UDP packet.
- SNMP (Simple Network Management Protocol)
- DHCP (Dynamic Host Configuration Protocol)
- Voice and video applications normally use UDP
What is a socket address?
A socket address is a communication identifier that consists of a port number and an Internet address
Describe datagram communication?
- Connectionless protocol – message-passing abstraction
- Enables a sending process to transmit a single message to a receiving process
- Each time you send datagrams, you also need to send local socket descriptor and the receiving socket’s address. - Additional data must be sent each time a communication is made
Describe Stream Communication
- Connection-oriented protocol – stream abstraction
- A connection must first be established between pair of sockets. Two-way stream between sender and receiver.
- One socket (the server) listens for a connection request, the other (a client) asks for a connection.
- Once the sockets have been connected, data can be transmitted in one or both directions.
- Information communication consists of a stream of data items with no message boundaries.
- Used to implement some services such as remote login and file transfer.
- Streams provide building blocks for producer-consumer communication - items ‘produced’, ‘queued’ and ‘consumed’.
Is UDP reliable?
No, there is no guarantee that the datagrams sent will be received in the same order by the receiving socket.
Is TCP reliable?
Yes, it is guaranteed that packets will be received in the order in which they were sent.
What are the size limits of data packages that can be sent via UDP or TCP?
UDP - 64KB
TCP - Unlimited
What is the Java API for internet addresses?
InetAddress aComputer = InetAddress.getByName(“php.infc.ulst.ac.uk”);
Describe an I/O stream?
- An I/O Stream represents an input source or an output destination.
- Supports different kinds of data:
- bytes, primitive data types, localized characters, and objects.
- some streams simply pass on data; others might modify the data. - All streams have the same simple model for programs that use them: a stream is a sequence of data.
- A program uses an input stream to read data from a source, one item at a time
- A program uses an output stream to write data to a destination, one item at time