Interprocess communication (IPC) allows processes to communicate through message passing. There are two main forms of IPC - synchronous which blocks sending and receiving processes, and asynchronous which is non-blocking for sending. IPC uses protocols like TCP and UDP, with TCP providing reliable, ordered streams and UDP providing unreliable datagram delivery. For communication, data must be serialized into a byte sequence and deserialized on the receiving end.
The document discusses interprocess communication (IPC) and protocols. It describes different IPC paradigms like message queues, semaphores, and shared memory. It also covers unicast and multicast communication, synchronous vs asynchronous operations, data representation for communication between processes, and examples of protocols like HTTP.
Pipes allow for inter-process communication by connecting the standard output of one process to the standard input of another. Named pipes, also called FIFOs, are similar to pipes but can be accessed using file names. The inode structure for pipes contains fields like wait queues, buffers, and counters for reading/writing processes. Ptrace is a system call that allows a process to debug another by controlling its execution and memory. Sockets provide communication via the network or locally using functions like socket, connect, listen, accept, and send/receive messages as datagrams or streams.
This document discusses interprocess communication and distributed systems. It covers several key topics:
- Application programming interfaces (APIs) for internet protocols like TCP and UDP, which provide building blocks for communication protocols.
- External data representation standards for transmitting objects between processes on different machines.
- Client-server communication models like request-reply that allow processes to invoke methods on remote objects.
- Group communication using multicast to allow a message from one client to be sent to multiple server processes simultaneously.
The document discusses various inter-process communication (IPC) mechanisms in Linux including pipes, FIFOs, messages, shared memory, and sockets. It provides detailed explanations of how pipes and FIFOs are implemented in the Linux kernel, including how they are created, read from, and written to via system calls. It also summarizes the use of System V IPC features like semaphores, messages, and shared memory for communication between processes.
Inter-Process communication using pipe in FPGA based adaptive communicationMayur Shah
This document discusses inter-process communication (IPC) using pipes in FPGA-based adaptive computing systems. It describes how pipes can be used to transfer data between hardware processes that time multiplex resources on an FPGA. Pipes provide a first-in, first-out communication channel that allows producer and consumer processes to exchange information without being synchronized. The document outlines how a static placement model and reconfigurable placement model using partial reconfiguration can implement IPC between processes using pipes. It concludes that intelligent pipe mechanisms could help reduce latency in adaptive computing applications.
Inter-Process Communication (IPC) techniques on Mac OS XHEM DUTT
Inter-process communication (IPC) refers to techniques for exchanging data between processes and threads. Common IPC methods include message passing, synchronization, shared memory, and remote procedure calls. IPC is useful for information sharing, increasing computational speed, modularity, convenience, and privilege separation. Common IPC techniques on Mac OS X include shared memory, Mach ports, sockets, Apple Events, distributed notifications, pasteboards, and distributed objects. Each method has advantages and disadvantages for different use cases.
The document discusses interprocess communication and summarizes the key points about client-server and group communication patterns. It describes the Java API for internet protocols, which provides datagram and stream communication using UDP and TCP. Specifically, it outlines how UDP supports message passing through datagrams, while TCP provides reliable, ordered streams between processes.
The document discusses interprocess communication (IPC) and protocols. It describes different IPC paradigms like message queues, semaphores, and shared memory. It also covers unicast and multicast communication, synchronous vs asynchronous operations, data representation for communication between processes, and examples of protocols like HTTP.
Pipes allow for inter-process communication by connecting the standard output of one process to the standard input of another. Named pipes, also called FIFOs, are similar to pipes but can be accessed using file names. The inode structure for pipes contains fields like wait queues, buffers, and counters for reading/writing processes. Ptrace is a system call that allows a process to debug another by controlling its execution and memory. Sockets provide communication via the network or locally using functions like socket, connect, listen, accept, and send/receive messages as datagrams or streams.
This document discusses interprocess communication and distributed systems. It covers several key topics:
- Application programming interfaces (APIs) for internet protocols like TCP and UDP, which provide building blocks for communication protocols.
- External data representation standards for transmitting objects between processes on different machines.
- Client-server communication models like request-reply that allow processes to invoke methods on remote objects.
- Group communication using multicast to allow a message from one client to be sent to multiple server processes simultaneously.
The document discusses various inter-process communication (IPC) mechanisms in Linux including pipes, FIFOs, messages, shared memory, and sockets. It provides detailed explanations of how pipes and FIFOs are implemented in the Linux kernel, including how they are created, read from, and written to via system calls. It also summarizes the use of System V IPC features like semaphores, messages, and shared memory for communication between processes.
Inter-Process communication using pipe in FPGA based adaptive communicationMayur Shah
This document discusses inter-process communication (IPC) using pipes in FPGA-based adaptive computing systems. It describes how pipes can be used to transfer data between hardware processes that time multiplex resources on an FPGA. Pipes provide a first-in, first-out communication channel that allows producer and consumer processes to exchange information without being synchronized. The document outlines how a static placement model and reconfigurable placement model using partial reconfiguration can implement IPC between processes using pipes. It concludes that intelligent pipe mechanisms could help reduce latency in adaptive computing applications.
Inter-Process Communication (IPC) techniques on Mac OS XHEM DUTT
Inter-process communication (IPC) refers to techniques for exchanging data between processes and threads. Common IPC methods include message passing, synchronization, shared memory, and remote procedure calls. IPC is useful for information sharing, increasing computational speed, modularity, convenience, and privilege separation. Common IPC techniques on Mac OS X include shared memory, Mach ports, sockets, Apple Events, distributed notifications, pasteboards, and distributed objects. Each method has advantages and disadvantages for different use cases.
The document discusses interprocess communication and summarizes the key points about client-server and group communication patterns. It describes the Java API for internet protocols, which provides datagram and stream communication using UDP and TCP. Specifically, it outlines how UDP supports message passing through datagrams, while TCP provides reliable, ordered streams between processes.
The document summarizes POSIX Inter-Process Communication (IPC) mechanisms, including POSIX message queues, semaphores, and shared memory. These IPC techniques use common functions and properties to access and identify objects. Message queues allow processes to exchange prioritized messages, semaphores coordinate access to shared resources, and shared memory allows direct read/write access to the same memory by multiple processes. The document describes the key functions and usage for each POSIX IPC method.
There are several mechanisms for inter-process communication (IPC) in UNIX systems, including message queues, shared memory, and semaphores. Message queues allow processes to exchange data by placing messages into a queue that can be accessed by other processes. Shared memory allows processes to communicate by declaring a section of memory that can be accessed simultaneously. Semaphores are used to synchronize processes so they do not access critical sections at the same time.
The document discusses interprocess communication and distributed systems, noting that distributed systems rely on defined communication protocols like interprocess communication using message passing over networks. It also covers topics like overhead in communication systems, different data storage and transfer formats between systems like XML, and Java object serialization for complex data transfer. Effective communication protocols aim to minimize overhead while maximizing throughput.
This document discusses various inter-process communication (IPC) types including shared memory, mapped memory, pipes, FIFOs, message queues, sockets, and signals. Shared memory allows processes to directly read and write to the same region of memory, requiring synchronization between processes. Mapped memory permits processes to communicate by mapping the same file into memory. Pipes and FIFOs allow for sequential data transfer between related and unrelated processes. Message queues provide a way for processes to exchange messages via a common queue. Signals are used to asynchronously notify processes of events.
The document discusses interprocess communication (IPC) and threads. It covers different IPC mechanisms like signals, message passing using pipes, and shared memory. It also covers different threading models including user-level threads managed by libraries, kernel-level threads with a one-to-one mapping to OS threads, and hybrid models. The document outlines the life cycle of a thread and considerations for thread implementation.
Inter process communication using Linux System Callsjyoti9vssut
This document discusses various methods of inter-process communication (IPC) in Linux using system calls and standard APIs. It describes pipes, FIFOs, message queues, and shared memory as common IPC methods. For each method, it provides details on the relevant system calls and functions, and includes code examples of producer-consumer implementations using message queues and shared memory.
IPC allows processes to communicate and share resources. There are several common IPC mechanisms, including message passing, shared memory, semaphores, files, signals, sockets, message queues, and pipes. Message passing involves establishing a communication link and exchanging fixed or variable sized messages using send and receive operations. Shared memory allows processes to access the same memory area. Semaphores are used to synchronize processes. Files provide durable storage that outlives individual processes. Signals asynchronously notify processes of events. Sockets enable two-way point-to-point communication between processes. Message queues allow asynchronous communication where senders and receivers do not need to interact simultaneously. Pipes create a pipeline between processes by connecting standard streams.
This document discusses various topics related to computer networking including protocols, sockets, IP addresses, URLs, reading web page source code, downloading files from the internet, TCP/IP and UDP servers and clients, file servers and clients, two-way communication between servers and clients, and sending simple emails. It provides information on networking hardware and software, protocols like TCP/IP and UDP, socket programming, parsing URLs, creating servers and clients, and sending/receiving data over networks.
This document discusses TCP/IP networking concepts in Java like sockets, datagrams, ports and protocols. It provides code examples for socket programming in Java using TCP for client-server applications and UDP for datagram transmissions. It also recommends books that cover Java networking topics in more detail.
nterprocess communication (IPC) is a set of programming interfaces that allow a programmer to coordinate activities among different program processes that can run concurrently in an operating system. This allows a program to handle many user requests at the same time. Since even a single user request may result in multiple processes running in the operating system on the user's behalf, the processes need to communicate with each other. The IPC interfaces make this possible. Each IPC method has its own advantages and limitations so it is not unusual for a single program to use all of the IPC methods.
IPC methods include pipes and named pipes; message queueing;semaphores; shared memory; and sockets.
The document discusses Java networking concepts including sockets, TCP, UDP, client-server programming, and key networking classes like InetAddress, ServerSocket, Socket, DatagramSocket, and DatagramPacket. It provides code examples for basic TCP and UDP client-server applications in Java using sockets to demonstrate sending and receiving data over a network.
This document provides an overview of network programming in Python. It discusses how Python allows both low-level socket access for building clients and servers as well as higher-level access to application protocols like FTP and HTTP. It then describes socket programming concepts like domains, types, protocols and functions for binding, listening, accepting, connecting, sending and receiving data. Simple client and server code examples are provided to demonstrate creating a basic socket connection between two programs. Finally, commonly used Python network modules for protocols like HTTP, FTP, SMTP and more are listed.
NTP Software Jan 2012 Monthly Meeting IPC PresentationMuhamad Hesham
This document discusses various interprocess communication (IPC) mechanisms available for Windows, including pipes, mailslots, and remote procedure calls (RPCs). It describes the properties and usage of each mechanism. Pipes can be anonymous or named, with anonymous pipes allowing communication between related processes via unidirectional byte streams, while named pipes allow bidirectional communication locally or over networks. Mailslots provide a way for multiple writers to send messages to single or multiple readers over local or remote systems. RPCs allow processes to call functions or procedures in other processes remotely.
The document discusses interprocess communication and provides examples of code for UDP and TCP clients and servers in Java. It introduces concepts like:
- UDP and TCP APIs provide message passing and stream abstractions
- Sockets and ports are used to identify processes for communication
- Java InetAddress class represents IP addresses
- Marshalling and unmarshalling are required to transmit data between processes
- Examples show UDP client/server and TCP client/server code in Java
Processes communicate through interprocess communication (IPC) using two main models: shared memory and message passing. Shared memory allows processes to access the same memory regions, while message passing involves processes exchanging messages through mechanisms like mailboxes, pipes, signals, and sockets. Common IPC techniques include semaphores, shared memory, message queues, and sockets that allow processes to synchronize actions and share data in both blocking and non-blocking ways. Deadlocks can occur if processes form a circular chain while waiting for resources held by other processes.
This presentation educates you about Python - Network Programming, What are Sockets?, Sockets have their own vocabulary, The socket Module, Server Socket Methods, Client Socket Methods and General Socket Methods.
For more info stay tuned with Learnbay.
The document discusses communication between layers in network protocols. It explains that when an upper layer requests services from the lower layer, it sends a protocol data unit (PDU) to the lower layer. The lower layer then encapsulates the upper layer PDU by adding a header and sending the entire packet to the corresponding lower layer in another machine. This process continues until the physical layer transmits the data. The document also provides details about the TCP/IP protocol stack and encapsulation process, and describes the header fields of IPv4 packets.
Unix message queues allow processes to communicate asynchronously through kernel-managed buffers. A message queue is identified by a message queue identifier and contains a linked list of messages. Each message contains a message type, byte count, and pointer to the actual message data. Processes use message queue APIs like msgget(), msgsnd(), msgrcv(), and msgctl() to open, send, receive, and manage messages on queues.
This document discusses various inter-process communication (IPC) mechanisms in Linux, including pipes, FIFOs, and message queues. Pipes allow one-way communication between related processes, while FIFOs (named pipes) allow communication between unrelated processes through named pipes that persist unlike anonymous pipes. Message queues provide more robust messaging between unrelated processes by allowing messages to be queued until received and optionally retrieved out-of-order or by message type. The document covers the key functions and system calls for creating and using each IPC mechanism in both shell and C programming.
The document discusses different types of computers based on their mode of use. It describes notebook computers, personal computers, workstations, mainframe systems, supercomputers, client and server computers, and handheld computers. For each type, it provides details on their key characteristics, components, uses, and differences between types. The document concludes with a comparison table of the different computer types.
The document summarizes POSIX Inter-Process Communication (IPC) mechanisms, including POSIX message queues, semaphores, and shared memory. These IPC techniques use common functions and properties to access and identify objects. Message queues allow processes to exchange prioritized messages, semaphores coordinate access to shared resources, and shared memory allows direct read/write access to the same memory by multiple processes. The document describes the key functions and usage for each POSIX IPC method.
There are several mechanisms for inter-process communication (IPC) in UNIX systems, including message queues, shared memory, and semaphores. Message queues allow processes to exchange data by placing messages into a queue that can be accessed by other processes. Shared memory allows processes to communicate by declaring a section of memory that can be accessed simultaneously. Semaphores are used to synchronize processes so they do not access critical sections at the same time.
The document discusses interprocess communication and distributed systems, noting that distributed systems rely on defined communication protocols like interprocess communication using message passing over networks. It also covers topics like overhead in communication systems, different data storage and transfer formats between systems like XML, and Java object serialization for complex data transfer. Effective communication protocols aim to minimize overhead while maximizing throughput.
This document discusses various inter-process communication (IPC) types including shared memory, mapped memory, pipes, FIFOs, message queues, sockets, and signals. Shared memory allows processes to directly read and write to the same region of memory, requiring synchronization between processes. Mapped memory permits processes to communicate by mapping the same file into memory. Pipes and FIFOs allow for sequential data transfer between related and unrelated processes. Message queues provide a way for processes to exchange messages via a common queue. Signals are used to asynchronously notify processes of events.
The document discusses interprocess communication (IPC) and threads. It covers different IPC mechanisms like signals, message passing using pipes, and shared memory. It also covers different threading models including user-level threads managed by libraries, kernel-level threads with a one-to-one mapping to OS threads, and hybrid models. The document outlines the life cycle of a thread and considerations for thread implementation.
Inter process communication using Linux System Callsjyoti9vssut
This document discusses various methods of inter-process communication (IPC) in Linux using system calls and standard APIs. It describes pipes, FIFOs, message queues, and shared memory as common IPC methods. For each method, it provides details on the relevant system calls and functions, and includes code examples of producer-consumer implementations using message queues and shared memory.
IPC allows processes to communicate and share resources. There are several common IPC mechanisms, including message passing, shared memory, semaphores, files, signals, sockets, message queues, and pipes. Message passing involves establishing a communication link and exchanging fixed or variable sized messages using send and receive operations. Shared memory allows processes to access the same memory area. Semaphores are used to synchronize processes. Files provide durable storage that outlives individual processes. Signals asynchronously notify processes of events. Sockets enable two-way point-to-point communication between processes. Message queues allow asynchronous communication where senders and receivers do not need to interact simultaneously. Pipes create a pipeline between processes by connecting standard streams.
This document discusses various topics related to computer networking including protocols, sockets, IP addresses, URLs, reading web page source code, downloading files from the internet, TCP/IP and UDP servers and clients, file servers and clients, two-way communication between servers and clients, and sending simple emails. It provides information on networking hardware and software, protocols like TCP/IP and UDP, socket programming, parsing URLs, creating servers and clients, and sending/receiving data over networks.
This document discusses TCP/IP networking concepts in Java like sockets, datagrams, ports and protocols. It provides code examples for socket programming in Java using TCP for client-server applications and UDP for datagram transmissions. It also recommends books that cover Java networking topics in more detail.
nterprocess communication (IPC) is a set of programming interfaces that allow a programmer to coordinate activities among different program processes that can run concurrently in an operating system. This allows a program to handle many user requests at the same time. Since even a single user request may result in multiple processes running in the operating system on the user's behalf, the processes need to communicate with each other. The IPC interfaces make this possible. Each IPC method has its own advantages and limitations so it is not unusual for a single program to use all of the IPC methods.
IPC methods include pipes and named pipes; message queueing;semaphores; shared memory; and sockets.
The document discusses Java networking concepts including sockets, TCP, UDP, client-server programming, and key networking classes like InetAddress, ServerSocket, Socket, DatagramSocket, and DatagramPacket. It provides code examples for basic TCP and UDP client-server applications in Java using sockets to demonstrate sending and receiving data over a network.
This document provides an overview of network programming in Python. It discusses how Python allows both low-level socket access for building clients and servers as well as higher-level access to application protocols like FTP and HTTP. It then describes socket programming concepts like domains, types, protocols and functions for binding, listening, accepting, connecting, sending and receiving data. Simple client and server code examples are provided to demonstrate creating a basic socket connection between two programs. Finally, commonly used Python network modules for protocols like HTTP, FTP, SMTP and more are listed.
NTP Software Jan 2012 Monthly Meeting IPC PresentationMuhamad Hesham
This document discusses various interprocess communication (IPC) mechanisms available for Windows, including pipes, mailslots, and remote procedure calls (RPCs). It describes the properties and usage of each mechanism. Pipes can be anonymous or named, with anonymous pipes allowing communication between related processes via unidirectional byte streams, while named pipes allow bidirectional communication locally or over networks. Mailslots provide a way for multiple writers to send messages to single or multiple readers over local or remote systems. RPCs allow processes to call functions or procedures in other processes remotely.
The document discusses interprocess communication and provides examples of code for UDP and TCP clients and servers in Java. It introduces concepts like:
- UDP and TCP APIs provide message passing and stream abstractions
- Sockets and ports are used to identify processes for communication
- Java InetAddress class represents IP addresses
- Marshalling and unmarshalling are required to transmit data between processes
- Examples show UDP client/server and TCP client/server code in Java
Processes communicate through interprocess communication (IPC) using two main models: shared memory and message passing. Shared memory allows processes to access the same memory regions, while message passing involves processes exchanging messages through mechanisms like mailboxes, pipes, signals, and sockets. Common IPC techniques include semaphores, shared memory, message queues, and sockets that allow processes to synchronize actions and share data in both blocking and non-blocking ways. Deadlocks can occur if processes form a circular chain while waiting for resources held by other processes.
This presentation educates you about Python - Network Programming, What are Sockets?, Sockets have their own vocabulary, The socket Module, Server Socket Methods, Client Socket Methods and General Socket Methods.
For more info stay tuned with Learnbay.
The document discusses communication between layers in network protocols. It explains that when an upper layer requests services from the lower layer, it sends a protocol data unit (PDU) to the lower layer. The lower layer then encapsulates the upper layer PDU by adding a header and sending the entire packet to the corresponding lower layer in another machine. This process continues until the physical layer transmits the data. The document also provides details about the TCP/IP protocol stack and encapsulation process, and describes the header fields of IPv4 packets.
Unix message queues allow processes to communicate asynchronously through kernel-managed buffers. A message queue is identified by a message queue identifier and contains a linked list of messages. Each message contains a message type, byte count, and pointer to the actual message data. Processes use message queue APIs like msgget(), msgsnd(), msgrcv(), and msgctl() to open, send, receive, and manage messages on queues.
This document discusses various inter-process communication (IPC) mechanisms in Linux, including pipes, FIFOs, and message queues. Pipes allow one-way communication between related processes, while FIFOs (named pipes) allow communication between unrelated processes through named pipes that persist unlike anonymous pipes. Message queues provide more robust messaging between unrelated processes by allowing messages to be queued until received and optionally retrieved out-of-order or by message type. The document covers the key functions and system calls for creating and using each IPC mechanism in both shell and C programming.
The document discusses different types of computers based on their mode of use. It describes notebook computers, personal computers, workstations, mainframe systems, supercomputers, client and server computers, and handheld computers. For each type, it provides details on their key characteristics, components, uses, and differences between types. The document concludes with a comparison table of the different computer types.
The document provides an introduction to the Common Object Request Broker Architecture (CORBA). It outlines the key components of CORBA including distributed computing, the Object Request Broker (ORB) which acts as a communication hub, the Interface Definition Language (IDL) which allows objects to communicate across different programming languages, and the General Inter-ORB Protocol (GIOP) and Internet Inter-ORB Protocol (IIOP) which define data representation and remote object references over TCP/IP. The document also provides an example of defining a simple "hello world" interface in IDL, implementing and running a client and server application.
This document discusses interprocess communication and synchronization. It describes race conditions that can occur when multiple processes access shared data concurrently. It introduces the concept of critical sections and mutual exclusion to prevent race conditions. Solutions to achieve mutual exclusion include semaphores and monitors. Semaphores use wait and signal operations while monitors provide mutual exclusion through language-level constructs. Condition variables allow processes to wait for and signal specific events within monitors.
UNIT II COMMUNICATION IN DISTRIBUTED SYSTEM 10
System Model – Inter process Communication – the API for internet protocols – External data representation and Multicast communication. Network virtualization: Overlay networks. Case study: MPI Remote Method Invocation And Objects: Remote Invocation – Introduction – Request-reply protocols – Remote procedure call – Remote method invocation. Case study: Java RMI – Group communication – Publish-subscribe systems – Message queues – Shared memory approaches – Distributed objects – Case study: Enterprise Java Beans -from objects to components.
Linux is an open-source operating system that originated as a personal project by Linus Torvalds in 1991. It can run on a variety of devices from servers and desktop computers to smartphones. Some key advantages of Linux include low cost, high performance, strong security, and versatility in being able to run on many system types. Popular Linux distributions include Red Hat Enterprise Linux, Debian, Ubuntu, and Mint. The document provides an overview of the history and development of Linux as well as common myths and facts about the operating system.
This document provides an overview of Linux including:
- Different pronunciations of Linux and the origins of each pronunciation.
- A definition of Linux as a generic term for Unix-like operating systems with graphical user interfaces.
- Why Linux is significant as a powerful, free, and customizable operating system that runs on multiple hardware platforms.
- An introduction to key Linux concepts like multi-user systems, multiprocessing, multitasking and open source software.
- Examples of common Linux commands for file handling, text processing, and system administration.
The document discusses Java network programming and communication between applications. It covers topics like Java source code compilation, client-server models, sockets, ports, TCP and UDP clients and servers in Java code. It provides examples of Java code for TCP client, TCP server, UDP client and UDP server. It also discusses Remote Procedure Calls (RPC) and gives an example of implementing average calculation using RPC.
Distributed systems have several advantages including resource sharing, increased computation speed through parallel processing, and reliability through independent memory in each processor. There are different types of distributed operating systems based on how data, computations, or processes are transferred between sites. Mutual exclusion in distributed systems aims to ensure that only one process executes in the critical section at a time, while still allowing every request to enter and exit to eventually be granted. This can be achieved through centralized, distributed, or token passing approaches.
The document discusses socket programming in Java. It covers key concepts like layers of protocols, ports, the client-server model, and socket classes. Example code is provided to demonstrate how to create simple client and server applications using sockets to connect two processes and exchange data between them. The examples show how to bind sockets, send/receive data over input/output streams, and handle multiple concurrent connections by spawning new threads.
The document discusses the TCP/IP protocol suite and its layers - application, transport, internet and link layer. It describes the functionality of each layer and the data encapsulation between layers. It also discusses protocols like TCP, UDP, IP, ICMP and their usage. Network concepts like routers, bridges, classes of networks and sockets are explained along with examples.
- Practical exercises on the use of UDP protocol using Java language
- References
YouTube link :
https://www.youtube.com/playlist?list=PLtDIUAtyP4lhV7CsYfLuIx26UeG4J-ujZ
GitHub :
https://github.com/Ghadeerof
The document discusses distributed programming using Java sockets and RMI. It describes UDP and TCP protocols, with UDP being connectionless and less reliable while TCP is connection-oriented. It then covers socket programming using DatagramSocket and DatagramPacket for UDP, and Socket and input/output streams for TCP. The document also discusses implementing a remote interface using RMI to allow method calls between JVMs.
The document provides an overview of object oriented programming and network programming concepts. It discusses topics like IP addresses, ports, sockets, client-server programming, and the java.net and java.util packages. The java.net package contains classes for network programming in Java like Socket, ServerSocket, URL, and InetAddress. The java.util package contains general-purpose utility classes like ArrayList, HashMap, Properties and Date.
This is all about socket programming in java using TCP and UDP socket and an example of simple Echo Server.
Also includes concepts of the socket, Socket class and methods and use of those.
The document discusses network programming and Java sockets. It introduces elements of client-server computing including networking basics like TCP, UDP and ports. It then covers Java sockets, explaining how to implement both a server and client using Java sockets. Code examples are provided of a simple server and client. The conclusion emphasizes that Java makes socket programming easier than other languages like C.
The document discusses network programming in Java using the java.net package. It covers using TCP and UDP for network communication. TCP provides reliable, ordered streams between hosts using sockets, while UDP provides simpler datagram transmission that is unreliable but can be broadcast. The InetAddress class represents IP addresses, and sockets are used for both TCP clients/servers and UDP communication.
The document discusses different types of sockets in Java network programming:
- TCP/IP client socket and TCP/IP server socket are used for reliable, bidirectional stream-based connections between hosts using TCP/IP. The client socket connects to the server socket.
- A Java DatagramSocket class represents a connectionless socket for sending and receiving datagram packets without reliability or sequencing. Commonly used DatagramSocket constructors are described.
- An example program is provided to demonstrate passing a message from a server to a client using sockets, showing the client and server code.
Socket programming allows applications on networked computers to communicate reliably using TCP or unreliably using UDP. A socket represents an open connection between two endpoints and has methods to get input/output streams, the remote host/port, and local port. A client socket connects to a server, while a server socket listens on a port and accepts connections from clients.
This document discusses network programming and Java sockets. It begins with an introduction to client-server computing and networking basics like TCP, UDP, and ports. It then covers Java sockets in detail, including how to implement a server that can accept multiple clients by creating a new thread for each, and how to implement a client. Sample code is provided for a simple single-threaded server and client. The document concludes that programming client-server applications in Java using sockets is easier than in other languages like C.
The Presentation given at Guru Gobind Singh Polytechnic, Nashik for Third Year Information Technology and Computer Engineering Students on 08/02/2011.
Topic: Java Network Programming
The presentation given at MSBTE sponsored content updating program on 'Advanced Java Programming' for Diploma Engineering teachers of Maharashtra. Venue: Guru Gobind Singh Polytechnic, Nashik
Date: 22/12/2010
Session: Java Network Programming
The document discusses socket programming and networking basics. It provides three key points:
1) Computers communicate over the internet using either TCP or UDP. TCP provides reliable, connection-based communication while UDP provides best-effort datagram delivery.
2) Ports allow multiple applications to communicate simultaneously on the same machine. Well-known ports are associated with common network services like HTTP and FTP.
3) Sockets represent a connection between hosts and can perform operations like connecting, sending/receiving data, and closing connections. The Socket and ServerSocket classes in Java implement client-server socket programming.
Networking.ppt(client/server, socket) uses in programgovindjha339843
The document outlines the course outcomes of an Advanced Java Programming course (C603). The 5 outcomes are:
1. Design GUI using AWT and Swing.
2. Develop programs using event handling.
3. Use network concepts like client/server and sockets in programs.
4. Develop programs using JDBC to connect to databases and execute queries.
5. Develop web programs using servlets and JSP.
Monitoring and Managing Anomaly Detection on OpenShift.pdfTosin Akinosho
Monitoring and Managing Anomaly Detection on OpenShift
Overview
Dive into the world of anomaly detection on edge devices with our comprehensive hands-on tutorial. This SlideShare presentation will guide you through the entire process, from data collection and model training to edge deployment and real-time monitoring. Perfect for those looking to implement robust anomaly detection systems on resource-constrained IoT/edge devices.
Key Topics Covered
1. Introduction to Anomaly Detection
- Understand the fundamentals of anomaly detection and its importance in identifying unusual behavior or failures in systems.
2. Understanding Edge (IoT)
- Learn about edge computing and IoT, and how they enable real-time data processing and decision-making at the source.
3. What is ArgoCD?
- Discover ArgoCD, a declarative, GitOps continuous delivery tool for Kubernetes, and its role in deploying applications on edge devices.
4. Deployment Using ArgoCD for Edge Devices
- Step-by-step guide on deploying anomaly detection models on edge devices using ArgoCD.
5. Introduction to Apache Kafka and S3
- Explore Apache Kafka for real-time data streaming and Amazon S3 for scalable storage solutions.
6. Viewing Kafka Messages in the Data Lake
- Learn how to view and analyze Kafka messages stored in a data lake for better insights.
7. What is Prometheus?
- Get to know Prometheus, an open-source monitoring and alerting toolkit, and its application in monitoring edge devices.
8. Monitoring Application Metrics with Prometheus
- Detailed instructions on setting up Prometheus to monitor the performance and health of your anomaly detection system.
9. What is Camel K?
- Introduction to Camel K, a lightweight integration framework built on Apache Camel, designed for Kubernetes.
10. Configuring Camel K Integrations for Data Pipelines
- Learn how to configure Camel K for seamless data pipeline integrations in your anomaly detection workflow.
11. What is a Jupyter Notebook?
- Overview of Jupyter Notebooks, an open-source web application for creating and sharing documents with live code, equations, visualizations, and narrative text.
12. Jupyter Notebooks with Code Examples
- Hands-on examples and code snippets in Jupyter Notebooks to help you implement and test anomaly detection models.
Essentials of Automations: The Art of Triggers and Actions in FMESafe Software
In this second installment of our Essentials of Automations webinar series, we’ll explore the landscape of triggers and actions, guiding you through the nuances of authoring and adapting workspaces for seamless automations. Gain an understanding of the full spectrum of triggers and actions available in FME, empowering you to enhance your workspaces for efficient automation.
We’ll kick things off by showcasing the most commonly used event-based triggers, introducing you to various automation workflows like manual triggers, schedules, directory watchers, and more. Plus, see how these elements play out in real scenarios.
Whether you’re tweaking your current setup or building from the ground up, this session will arm you with the tools and insights needed to transform your FME usage into a powerhouse of productivity. Join us to discover effective strategies that simplify complex processes, enhancing your productivity and transforming your data management practices with FME. Let’s turn complexity into clarity and make your workspaces work wonders!
Have you ever been confused by the myriad of choices offered by AWS for hosting a website or an API?
Lambda, Elastic Beanstalk, Lightsail, Amplify, S3 (and more!) can each host websites + APIs. But which one should we choose?
Which one is cheapest? Which one is fastest? Which one will scale to meet our needs?
Join me in this session as we dive into each AWS hosting service to determine which one is best for your scenario and explain why!
OpenID AuthZEN Interop Read Out - AuthorizationDavid Brossard
During Identiverse 2024 and EIC 2024, members of the OpenID AuthZEN WG got together and demoed their authorization endpoints conforming to the AuthZEN API
Climate Impact of Software Testing at Nordic Testing DaysKari Kakkonen
My slides at Nordic Testing Days 6.6.2024
Climate impact / sustainability of software testing discussed on the talk. ICT and testing must carry their part of global responsibility to help with the climat warming. We can minimize the carbon footprint but we can also have a carbon handprint, a positive impact on the climate. Quality characteristics can be added with sustainability, and then measured continuously. Test environments can be used less, and in smaller scale and on demand. Test techniques can be used in optimizing or minimizing number of tests. Test automation can be used to speed up testing.
Your One-Stop Shop for Python Success: Top 10 US Python Development Providersakankshawande
Simplify your search for a reliable Python development partner! This list presents the top 10 trusted US providers offering comprehensive Python development services, ensuring your project's success from conception to completion.
In his public lecture, Christian Timmerer provides insights into the fascinating history of video streaming, starting from its humble beginnings before YouTube to the groundbreaking technologies that now dominate platforms like Netflix and ORF ON. Timmerer also presents provocative contributions of his own that have significantly influenced the industry. He concludes by looking at future challenges and invites the audience to join in a discussion.
Ocean lotus Threat actors project by John Sitima 2024 (1).pptxSitimaJohn
Ocean Lotus cyber threat actors represent a sophisticated, persistent, and politically motivated group that poses a significant risk to organizations and individuals in the Southeast Asian region. Their continuous evolution and adaptability underscore the need for robust cybersecurity measures and international cooperation to identify and mitigate the threats posed by such advanced persistent threat groups.
Cosa hanno in comune un mattoncino Lego e la backdoor XZ?Speck&Tech
ABSTRACT: A prima vista, un mattoncino Lego e la backdoor XZ potrebbero avere in comune il fatto di essere entrambi blocchi di costruzione, o dipendenze di progetti creativi e software. La realtà è che un mattoncino Lego e il caso della backdoor XZ hanno molto di più di tutto ciò in comune.
Partecipate alla presentazione per immergervi in una storia di interoperabilità, standard e formati aperti, per poi discutere del ruolo importante che i contributori hanno in una comunità open source sostenibile.
BIO: Sostenitrice del software libero e dei formati standard e aperti. È stata un membro attivo dei progetti Fedora e openSUSE e ha co-fondato l'Associazione LibreItalia dove è stata coinvolta in diversi eventi, migrazioni e formazione relativi a LibreOffice. In precedenza ha lavorato a migrazioni e corsi di formazione su LibreOffice per diverse amministrazioni pubbliche e privati. Da gennaio 2020 lavora in SUSE come Software Release Engineer per Uyuni e SUSE Manager e quando non segue la sua passione per i computer e per Geeko coltiva la sua curiosità per l'astronomia (da cui deriva il suo nickname deneb_alpha).
CAKE: Sharing Slices of Confidential Data on BlockchainClaudio Di Ciccio
Presented at the CAiSE 2024 Forum, Intelligent Information Systems, June 6th, Limassol, Cyprus.
Synopsis: Cooperative information systems typically involve various entities in a collaborative process within a distributed environment. Blockchain technology offers a mechanism for automating such processes, even when only partial trust exists among participants. The data stored on the blockchain is replicated across all nodes in the network, ensuring accessibility to all participants. While this aspect facilitates traceability, integrity, and persistence, it poses challenges for adopting public blockchains in enterprise settings due to confidentiality issues. In this paper, we present a software tool named Control Access via Key Encryption (CAKE), designed to ensure data confidentiality in scenarios involving public blockchains. After outlining its core components and functionalities, we showcase the application of CAKE in the context of a real-world cyber-security project within the logistics domain.
Paper: https://doi.org/10.1007/978-3-031-61000-4_16
Fueling AI with Great Data with Airbyte WebinarZilliz
This talk will focus on how to collect data from a variety of sources, leveraging this data for RAG and other GenAI use cases, and finally charting your course to productionalization.
“An Outlook of the Ongoing and Future Relationship between Blockchain Technologies and Process-aware Information Systems.” Invited talk at the joint workshop on Blockchain for Information Systems (BC4IS) and Blockchain for Trusted Data Sharing (B4TDS), co-located with with the 36th International Conference on Advanced Information Systems Engineering (CAiSE), 3 June 2024, Limassol, Cyprus.
Full-RAG: A modern architecture for hyper-personalizationZilliz
Mike Del Balso, CEO & Co-Founder at Tecton, presents "Full RAG," a novel approach to AI recommendation systems, aiming to push beyond the limitations of traditional models through a deep integration of contextual insights and real-time data, leveraging the Retrieval-Augmented Generation architecture. This talk will outline Full RAG's potential to significantly enhance personalization, address engineering challenges such as data management and model training, and introduce data enrichment with reranking as a key solution. Attendees will gain crucial insights into the importance of hyperpersonalization in AI, the capabilities of Full RAG for advanced personalization, and strategies for managing complex data integrations for deploying cutting-edge AI solutions.
Threats to mobile devices are more prevalent and increasing in scope and complexity. Users of mobile devices desire to take full advantage of the features
available on those devices, but many of the features provide convenience and capability but sacrifice security. This best practices guide outlines steps the users can take to better protect personal devices and information.
Best 20 SEO Techniques To Improve Website Visibility In SERPPixlogix Infotech
Boost your website's visibility with proven SEO techniques! Our latest blog dives into essential strategies to enhance your online presence, increase traffic, and rank higher on search engines. From keyword optimization to quality content creation, learn how to make your site stand out in the crowded digital landscape. Discover actionable tips and expert insights to elevate your SEO game.
2. Exploring the Middleware Layers
Applications, services
RMI and RPC and
Request Reply Protocol
Marshalling and External Data Representation
UDP and TCP
Operating System
3. Characteristics of IPC
●
Message passing between a pair of processes
supported by SEND and RECEIVE operations
●
Synchronous sending and receiving processes
synchronize every message, and BLOCK
●
Asynchronous sending is NONBLOCKING,
receiving can be both BLOCKING and NON
BLOCKING
●
Nonblocking receives are complex, so most
systems employ the blocking form of receive
4. Other IPC Characteristics
●
Message destinations typically specified as
address/port pairs (endpoints)
●
Reliability both reliable and unreliable IPCs are
possible
●
Ordering often, applications require SENDER
ORDERING to be maintained
5. Example IPC Mechanism - Sockets
agreed port
socket any port socket
message
client server
other ports
Internet address = 138.37.94.248 Internet address = 138.37.88.249
6. UDP Datagram Communication
●
Datagrams sent without ACKs or retries
●
Message sizes are often prenegotiated
●
Fragmentation can occur
●
Blocking sends and receives are common
timeouts can be used, but these can be tricky
●
Datagram discarding occurs when no receiving
process is waiting
7. UDP's Failure Model
●
Omission Failures messages dropped,
checksum errors, lack of buffer space
●
Both sendomissions and receiveomissions can
occur
●
Ordering messages can arrive outoforder
●
Applications that use UDP need to provide their
own checks
8. Usages of UDP
●
Applications that do not suffer from the
overheads associated with guaranteed message
delivery
●
DNS
●
VoIP
9. Example UDP Client in Java
import java.net.*;
import java.io.*;
public class UDPClient{
public static void main(String args[]){
// args give message contents and server hostname
DatagramSocket aSocket = null;
try {
aSocket = new DatagramSocket();
byte [] m = args[0].getBytes();
InetAddress aHost = InetAddress.getByName(args[1]);
int serverPort = 6789;
DatagramPacket request = new DatagramPacket(m, args[0].length(), aHost,
serverPort);
aSocket.send(request);
byte[] buffer = new byte[1000];
DatagramPacket reply = new DatagramPacket(buffer, buffer.length);
aSocket.receive(reply);
System.out.println("Reply: " + new String(reply.getData()));
}catch (SocketException e){System.out.println("Socket: " + e.getMessage());
}catch (IOException e){System.out.println("IO: " + e.getMessage());}
}finally {if(aSocket != null) aSocket.close();}
}
}
10. Example UDP Server in Java
import java.net.*;
import java.io.*;
public class UDPServer{
public static void main(String args[]){
DatagramSocket aSocket = null;
try{
aSocket = new DatagramSocket(6789);
byte[] buffer = new byte[1000];
while(true){
DatagramPacket request = new DatagramPacket(buffer,
buffer.length);
aSocket.receive(request);
DatagramPacket reply = new DatagramPacket(request.getData(),
request.getLength(), request.getAddress(), request.getPort());
aSocket.send(reply);
}
}catch (SocketException e){System.out.println("Socket: " + e.getMessage());
}catch (IOException e) {System.out.println("IO: " + e.getMessage());}
}finally {if(aSocket != null) aSocket.close();}
}
}
11. TCP Streamed Communication
●
Stream of bytes transferred from sender to receiver
●
Characteristics of the network are hidden/transparent
to applications
●
Messages sizes can be small or large
●
An ACK scheme deals with lost messages
●
Flow control mechanisms throttle fast senders
●
Message duplication is handled, ordering is
maintained
●
Message destinations are "stream endpoints"
12. More of TCP
●
When establishing communication, one side is
the client, the other is the server
●
Thereafter, both can operate as peers, if needs
be
●
Pairs of sockets are connected by pairs of
streams, one for input, the other for output
13. TCP's Failure Model
●
Checksums detect and reject corrupt packets
●
Sequence numbers detect and reject duplicate
packets
●
Timeouts and retransmissions deal with lost
packets
●
TCP is not totally reliable, as it does not
guarantee delivery of messages in the face of all
possible difficulties
14. TCP's Unreliability
●
When a connection is broken, a process is
notified if it attempts to read or write
●
Has the network failed or has the process at the
other endpoint failed?
●
Where are previous sent messages actually
received?
15. Example TCP Client in Java
import java.net.*;
import java.io.*;
public class TCPClient {
public static void main (String args[]) {
// arguments supply message and hostname of destination
Socket s = null;
try{
int serverPort = 7896;
s = new Socket(args[1], serverPort);
DataInputStream in = new DataInputStream( s.getInputStream());
DataOutputStream out =
new DataOutputStream( s.getOutputStream());
out.writeUTF(args[0]); // UTF is a string encoding see Sn 4.3
String data = in.readUTF();
System.out.println("Received: "+ data) ;
}catch (UnknownHostException e){
System.out.println("Sock:"+e.getMessage());
}catch (EOFException e){System.out.println("EOF:"+e.getMessage());
}catch (IOException e){System.out.println("IO:"+e.getMessage());}
}finally {if(s!=null) try {s.close();}catch (IOException e)
{System.out.println("close:"+e.getMessage());}}
}
}
16. Example TCP Server in Java
import java.net.*;
import java.io.*;
public class TCPServer {
public static void main (String args[]) {
try{
int serverPort = 7896;
ServerSocket listenSocket = new ServerSocket(serverPort);
while(true) {
Socket clientSocket = listenSocket.accept();
Connection c = new Connection(clientSocket);
}
} catch(IOException e) {System.out.println("Listen :"+e.getMessage());}
}
}
class Connection extends Thread {
DataInputStream in;
DataOutputStream out;
Socket clientSocket;
public Connection (Socket aClientSocket) {
try {
clientSocket = aClientSocket;
in = new DataInputStream( clientSocket.getInputStream());
out =new DataOutputStream( clientSocket.getOutputStream());
this.start();
} catch(IOException e) {System.out.println("Connection:"+e.getMessage());}
}
public void run(){
try { // an echo server
String data = in.readUTF();
out.writeUTF(data);
} catch(EOFException e) {System.out.println("EOF:"+e.getMessage());
} catch(IOException e) {System.out.println("IO:"+e.getMessage());}
} finally{ try {clientSocket.close();}catch (IOException e){/*close failed*/}}
}
}
18. The Problem
●
Running programs (processes) are represented
as (binary) data structures
●
Information in messages is represented as a
sequence of bytes
●
How do we transform one into the other and vice
versa?
19. Flattening
●
Data structures must be flattened into a
sequence of bytes before transmission and
rebuilt on receipt
●
Byteordering (little or bigendian?) is an issue
●
Character encodings (ASCII, Unicode) are an
issue, too
20. Exchanging Binary Data
●
Values are converted to an agreed external
format
●
Values are transmitted in the sender's format; the
recipient converts that values if necessary
●
An agreed standard for the representation of data
structures and primitive values is called an
"external data representation"
21. Marshalling and Unmarshalling
●
Marshalling taking a collection of data items and
assembling them into a form suitable for
transmission in a message
●
Unmarshalling disassembling a message on
arrival to produce an equivalent collection of data
items at the destination
22. Three Alternative Approaches
●
CORBA's Common Data Representation (CDR)
can be used with a variety of programming
technologies
●
Java's Object Serialization works only within the
Java environment
●
XML (Extensible Markup Language) a textual
format for representing structured data that works
with any programming technology
23. CORBA's CDR
●
CDR can represent 15 primitive types and a
range of composite types
●
Both little and bigendian support is provided
senders indicate in which ordering the message
is transmitted
●
Floatingpoint numbers use the IEEE standard
●
Characters are represented in a codeset agreed
between the sender and receiver
●
Data type information is NOT transmitted
24. CORBA CDR's Composite Types
Type Representation
sequence length (unsigned long) followed by elements in order
string length (unsigned long) followed by characters in order (can also
can have wide characters)
array array elements in order (no length specified because it is fixed)
struct in the order of declaration of the components
enumerated unsigned long (the values are specified by the order declared)
union type tag followed by the selected member
25. CORBA CDR - Example Message
index in notes
sequence of bytes 4 bytes on representation
0–3 5 length of string
4–7 "Smit" ‘Smith’
8–11 "h___"
12–15 6 length of string
16–19 "Lond"
‘London’
2023 "on__"
24–27 1934 unsigned long
The flattened form represents a Person struct with value: {‘Smith’, ‘London’, 1934}
26. Marshalling in CORBA
●
CORBA's Interface Definition Language (IDL) is
used to "automatically" produce marshalling and
unmarshalling operations
●
The CORBA IDL compiler enables the generation
of the required components
27. Example CORBA IDL
struct Person
{
string name;
string place;
unsigned long year;
};
28. Java's Object Serialization
●
The term "serialization" refers to the activity of
flattening an object or a connected set of objects
into a serial form that is suitable for storing on
disk or transmitting in a message
●
Consider this code :
Person p = new Person( "Smith", "London", 1934 );
29. Serialized Form of "p"
Serialized values Explanation
Person 8byte version number h0 class name, version number
int year java.lang.String java.lang.String number, type and name of
3 name: place: instance variables
1934 5 Smith 6 London h1 values of instance variables
The true serialized form contains additional type markers; h0 and h1 are handles
30. Extensible Markup Language (XML)
●
A "markup language" refers to a textual encoding
that represents both a text and details as to its
structure or its appearance
●
HTML was designed to describe the appearance
of web pages
●
XML was designed to describe structured
documents and markup languages
31. XML Characteristics
●
XML is "extensible" in the sense that users can
define their own tags
●
XML is "selfdescribing"
●
XML was intended to be used by multiple
applications for different purposes
●
XML is "textual", so can be easily read by
humans and computers
32. Example XML (Elements and Attributes)
<person id="123456789">
<name>Smith</name>
<place>London</place>
<year>1934</year>
<! a comment >
</person >
33. More XML
●
The names used in XML are userdefined and
follow the normal naming conventions
●
Binary data is (typically) represented in "base64"
34. XML Parsing and Well Formed Documents
●
Every starttag has a matching endtag
●
All tags are nested correctly
●
All XML documents have a single root element
within which all other elements are enclosed
●
The CDATA notation allows for the inclusion of
special characters
36. XML Namespaces
●
A set of names for a collection of element types
and attributes
●
The namespace convention allows an application
to make use of multiple sets of external definitions
in different namespaces without the risk of name
clashes
38. XML Schemas
●
Defines the elements and attributes that can
appear in a document
●
Defines how the elements are nested, the order
and number of elements
●
Defines whether or not an element is empty or
can include text
●
For each element, the schema defines the type
and default value
39. XML Schema Example
<xsd:schema xmlns:xsd = URL of XML schema definitions >
<xsd:element name= "person" type ="personType" />
<xsd:complexType name="personType">
<xsd:sequence>
<xsd:element name = "name" type="xs:string"/>
<xsd:element name = "place" type="xs:string"/>
<xsd:element name = "year" type="xs:positiveInteger"/>
</xsd:sequence>
<xsd:attribute name= "id" type = "xs:positiveInteger"/>
</xsd:complexType>
</xsd:schema>
41. Client-Server Communication
●
Normally, requestreply communication is
synchronous because the client process blocks
until the reply arrives from the server
●
It can also be reliable as the reply from the server
is effectively an acknowledgment to the client
●
It is possible to build a clientserver protocol over
a reliable or unreliable protocol
42. Avoiding Unnecessary Overhead
●
ACKs are unnecessary when requests are
followed by replies
●
Establishing a connection involves (at least) two
extra pairs of messages in addition to the
requestreply messages
●
Flow control is overkill, as most invocations pass
only small arguments and results
44. The Request-Reply Protocol
public byte[] doOperation (RemoteObjectRef o, int methodId, byte[] arguments)
sends a request message to the remote object and returns the reply.
The arguments specify the remote object, the method to be invoked and the
arguments of that method.
public byte[] getRequest ();
acquires a client request via the server port.
public void sendReply (byte[] reply, InetAddress clientHost, int clientPort);
sends the reply message reply to the client at its Internet address and port.
45. The Request-Reply Message Structure
messageType int (0=Request, 1= Reply)
requestId int
objectReference RemoteObjectRef
methodId int or Method
arguments array of bytes
46. Request-Reply Communication
Characteristics
●
What is the failure model? (Can omissions occur?
Is message ordering maintained?)
●
Are timeouts employed on operations?
●
How are duplicate request messages handled?
●
How are lost reply messages handled?
●
Is a history of requests (and replies) maintained
on either end?
48. An Example Request-Reply
Protocol - HTTP
●
Allows for the invocation of methods on web
resources
●
Content negotiation is also supported
●
Passwordstyle authentication is available
49. How HTTP Works
●
Implemented over TCP
●
Initially employed a simple ConnectRequest
ReplyClose cycle
●
This proved to be expensive and inefficient
●
Latest version of HTTP supports "persistent
connections"
50. HTTP Requests and Replies
●
R'n'Rs are marshalled into ASCII strings
●
Resources can be byte sequences and may
be compressed
●
Multipurpose Internet Mail Extensions (MIME)
supports multipart messages of varying
formats
51. HTTP Methods
●
GET (which is generally idempotent)
●
HEAD, POST, PUT, DELETE, OPTIONS and
TRACE (are the most widely supported)
52. HTTP Request and Reply Messages
method URL or pathname HTTP version headers message body
GET //www.dcs.qmw.ac.uk/index.html HTTP/ 1.1
HTTP version status code reason headers message body
HTTP/1.1 200 OK resource data
54. Group Communication - Multicasting
●
The membership of the group is transparent to
the sender
●
Multicast messages provide a useful
infrastructure for constructing distributed systems
55. Uses of Multicasting
●
Fault tolerance based on replicated servers
●
Finding the discovery service in spontaneous
networking
●
Better performance through replicated data
●
Propagation of event notifications
56. Group Communications with
IP Multicasting
●
IP Multicast is built on top of IP
●
The sender transmits a single IP packet to a set
of computers that form a multicast group
●
The sender does not know the recipients
identities nor how big the group is
●
The class D address space within IP is reserved
for IP Multicast
57. Characteristics of IP Multicast
●
Available with UDP only
●
Identified by an IP address/portnumber “end
point”
●
Applications can join a multicast group by
opening a socket to the endpoint
●
Multicast address range 224.0.0.1 through
224.0.0.255
58. IP Multicast's Failure Model
●
Same as for UDP datagrams
●
Multicasts suffer from omission failures
●
Not all of the group members receive everything
●
Reliable multicasting is possible overheads are
high
59. Example Multicast Peer in Java
import java.net.*;
import java.io.*;
public class MulticastPeer{
public static void main(String args[]){
// args give message contents & destination multicast group (e.g. "228.5.6.7")
MulticastSocket s =null;
try {
InetAddress group = InetAddress.getByName(args[1]);
s = new MulticastSocket(6789);
s.joinGroup(group);
byte [] m = args[0].getBytes();
DatagramPacket messageOut =
new DatagramPacket(m, m.length, group, 6789);
s.send(messageOut);
// get messages from others in group
byte[] buffer = new byte[1000];
for(int i=0; i< 3; i++) {
DatagramPacket messageIn =
new DatagramPacket(buffer, buffer.length);
s.receive(messageIn);
System.out.println("Received:" + new String(messageIn.getData()));
}
s.leaveGroup(group);
}catch (SocketException e){System.out.println("Socket: " + e.getMessage());
}catch (IOException e){System.out.println("IO: " + e.getMessage());}
}finally {if(s != null) s.close();}
}
}
60. Multicasting Reliability and Ordering
●
Suffers from omission failures!
●
Recipients may drop messages due to full buffers
●
A datagram lost at one multicast router prevents
all those routers beyond from receiving the
datagram
●
A multicast router can fail
●
Message ordering "errors" can result in two
routers receiving a sequence of multicasts in a
very different order to that which was sent
61. Cast Study - UNIX IPC
The Socket system calls layered over the
Internet TCP and UDP protocols
62. Socket Datagram Communications
Sending a message Receiving a message
s = socket(AF_INET, SOCK_DGRAM, 0) s = socket(AF_INET, SOCK_DGRAM, 0)
bind(s, ClientAddress) bind(s, ServerAddress)
sendto(s, "message", ServerAddress) amount = recvfrom(s, buffer, from)
ServerAddress and ClientAddress are socket addresses
63. Socket Stream Communications
Requesting a connection Listening and accepting a connection
s = socket(AF_INET, SOCK_STREAM,0) s = socket(AF_INET, SOCK_STREAM,0)
bind(s, ServerAddress);
listen(s,5);
connect(s, ServerAddress)
sNew = accept(s, ClientAddress);
write(s, "message", length) n = read(sNew, buffer, amount)
ServerAddress and ClientAddress are socket addresses
64. IPC Summary - Exchange Protocols
●
The request (R) protocol no value need be
returned to the client
●
The requestreply (RR) protocol special ACKs
are not required, the reply and subsequent new
requests suffice as ACKs
●
The requestreplyackreply (RRA) protocol
used when the server maintains a history of
messages; the "ackreply" allows the server to
remove items from its history