Posts

Showing posts from February, 2025

RMI

Understanding RMI (Remote Method Invocation) Understanding RMI (Remote Method Invocation) Remote Method Invocation (RMI) is a Java-based API that enables objects in different JVMs to communicate over a network. How RMI Works 1. Client Request: A client invokes a remote method through a stub. 2. Stub & Skeleton: The stub (client-side) serializes the request and sends it over the network, while the skeleton (server-side) deserializes it and calls the method. 3. Network Communication: The request travels over TCP/IP using Java Remote Method Protocol (JRMP). 4. Execution & Response: The server processes the request and sends the result back to the client. Key Components of RMI Stub: A proxy on the client side that sends method calls to the remote object. Skeleton: The server-side component th...

Proxy

Understanding Proxy Servers Understanding Proxy Servers A proxy server acts as an intermediary between a client and a destination server, handling requests and responses to improve security, performance, or privacy. How a Proxy Functions 1. Client Request: The client sends a request to the proxy instead of the destination server. 2. Proxy Server: Intercepts, inspects, and forwards the request to the destination. 3. Destination Server: Processes the request and sends a response. 4. Proxy Response: The proxy may modify, cache, or simply forward the response back to the client. Types of Proxies Forward Proxy: Used by clients to access external resources. Reverse Proxy: Used by servers to manage incoming traffic. Transparent Proxy: Passes requests/responses unchanged but may log or filt...

TCP IP Model

TCP/IP Layer Breakdown Detailed TCP/IP Layer Breakdown Sending the Request (Client to Server) Application Layer (Client Side): The client application (browser, API client, etc.) initiates the request for a service or resource. Protocol Choice: The application decides the protocol (HTTP, HTTPS, FTP, etc.) and breaks the URL into components (protocol, host, port, etc.). TLS Security: If using HTTPS, the data is encrypted using TLS. Transport Layer (Client Side): The data is segmented using TCP or UDP, depending on the service. Internet Layer (Client Side): IP headers are added for routing. Link Layer (Client Side): The data is framed for local network transmission. Client LAN Router to Internet Client LAN Router: The router ...

HTTP vs Sockets

HTTP vs Sockets HTTP vs Sockets Understanding the Differences between HTTP and Sockets HTTP Level: Application Layer (Layer 7) Communication: Request-Response (one-way) Connection: Short-lived (stateless) Protocol: HTTP (TCP-based) Use Cases: Web requests, APIs State: Stateless (unless using sessions) Scalability: Scalable for large requests Socket Level: Transport Layer (Layer 4) Communication: Full-duplex (two-way) Connection: Long-lived (persistent) Protocol: TCP/UDP (lower-level protocols) Use Cases: Real-time apps, custom protocols State: Stateful (persistent connection) Scalability: Scalable for real-time, long-term comm. Created by Your Name. 2025. ...

Network programming in Java

Java Network Programming Roadmap Java Network Programming Roadmap Phase 1: Foundations of Networking Networking Basics (OSI, TCP/IP, Protocols, Sockets, Ports) Java Networking Essentials (`java.net` package, URL, Proxy, etc.) Phase 2: Core Socket Programming TCP Programming (Client-Server, Multi-threading, Streaming) UDP Programming (DatagramSocket, Broadcasting, Multicasting) Hands-on: Chat Application, UDP Notification System Phase 3: Advanced Networking Concepts Asynchronous & Non-Blocking I/O (NIO, Selector, Buffers) Java RMI (Remote Method Invocation) Hands-on: Scalable Echo Server, Remote Object System ...