Marshalling and Serialization

08 Mar 2011

Marshal object to a file

Marshal object to a file

In practice, the terms marshalling and serialization are used interchangeably to describe the process of squashing data types into a well-defined intermediate format that is suitable for transmission on a network or for storage in a file. You might be familiar with Remote Procedure Call (RPC) as the core stub function needs to marshal the argument and return value of a method before they are actually transmitted over the network.

This article, I will show you with an example of marshalling and unmarshalling a Java object. Be reminded that:

  • Not all data types can be serialized
  • User-defined class must implement Serializable interface
  • Attempt to marshal or serialize a non-serializable object will throw an Exception in Java

Continue Reading »

No responses yet

Remote Procedure Call (RPC)

07 Mar 2011

RPC Overview

RPC Overview

RPC is the middle which allows client to call remote functions located on the server side. RPC is designed bearing in mind to combat the main disadvantage in inter-process communication (UDP and TCP) as it is hard in developing protocol. Moreover, we want to make distributed systems more transparent.

In order to call remote functions or methods, client depends on Stub function stimulating client as a real functions or methods locally.

Continue Reading »

No responses yet

TCP Object Transmission in Java

07 Mar 2011

Marshaling or Serialization

Marshaling or Serialization

A special feature in UDP is multicast. In TCP, object transmission is its special feature. This feature enables programmers to create an instantiated object in the server and then marshalling before it is actually transmitted to client for execution.

The processes of object transmission are:

  • Marshalling object to be transmitted
  • Send marshalled object over the network
  • Unmarshalling object and the execute

What is marshalling?

Marshalling and Serialization can be used interchangeably. It is the process of squashing object into a standard format in order to store in a file or be transmitted over the network.

Continue Reading »

4 responses so far

Multicast Programming with Java

06 Mar 2011

Multicast Overview

Multicast Overview

Multicast is a special feature of UDP protocol that enable programmer to send message to a group of receivers on a specific multicast IP address and port. Multicast has advantage in this scenario.

Let us say I want to send “Hello” message to 100 computers on my network. Perhaps, my first solution is to send the “Hello” message to each of them via UDP or TCP.

What a problem is this scenario?

There are 3 generic problems:

  • Consume a lot of processing power on sender as it needs to send to every receiver
  • Bandwidth flooding
  • The arrival time is not the same for every receiver

Continue Reading »

10 responses so far

Distributed Systems False Assumption

06 Mar 2011

Distributed Systems Component

Distributed Systems Component

Usually distributed systems consists of 3 main components namely Server, Network and Software. Server contains operating systems for providing network services or middleware on which distributed systems software relies. Network is the connectivity among those servers serving as the super high way for information sharing. Software refers anything soft platform that makes distributed system works and serves for clients as a coherent system. Software involves from ground up to user interface that users normally interact.

At each component, there is a generally common false assumption made by several system designers. These assumptions cannot be negligible; otherwise distributed systems cannot run smoothly.

Continue Reading »

One response so far

Pros and Cons of Distributed Systems

06 Mar 2011

What is distributed systems and why do we need it have been discussed in this blog. So now I will discuss the pros and cons of distributed systems in general. Understanding this pros and cons shapes the designing the distributed systems.

Pros

  • Cost
    • Mainframe is too expensive compares to buying several commodity servers. Commodity servers refer to a server with Intel Xeon architecture or AMD Opteron or Mac architecture.
  • Performance
    • By combining thousands of servers processing power and storage capacity, distributed systems is extremely powerful compares to mainframe or super computer.
  • Scalability
    • Resources such as processing and storage capacity can be increased incrementally. In other words, if distributed systems is better designed, adding nodes and storage and just plug-and-play.
  • Reliability
    • By having redundant components, the impact of hardware and software faults on users can be reduced. The fault components just simply be added to scale it up.
  • Inherent distribution
    • Some applications like the web, email, instant messaging, social network, etc. are naturally distributed.

Cons

  • Network
    • Current network capacity might be limited by 10 Gbps. And network is needed to connect thousands of independent computers and is subjected to performance bottleneck.
  • Security
    • Security is the most concerning issue in every computing. Distributed systems also needs to be designed not to be easily compromised.
  • Software complexity
    • Developing software for distributed systems is the hardest part. It requires a lot of expertises with different software platforms to build very large interactive software stack.

No responses yet

Why do we need distributed systems?

05 Mar 2011

According to Moore’s Law, the processing power of CPU gains double for every 18 months. This should be pretty enough for today computing. However, it is not and there is a demanding on deploying distributed systems. What is the distributed systems anyway? There are several definitions around it. I would like to quote from 2 main editors.

Coulouris et al

A distributed system is one in which components located at networked computers communicate and coordinate their actions only by passing messages

Tanenbaum, Van Steen

A distributed system is a collection of independent computers that appears to its users as a single coherent system

Continue Reading »

5 responses so far

TCP Programming with Java

04 Mar 2011

TCP Programming has been developed for the sake of reliability in data transmission. Unique feature of TCP is Acknowledgment scheme, Packet ordering and congestion control. These make TCP more popular in network transmission control protocol. Nowadays, the protocol dominant in the Internet is HTTP but be remembered that it relies on TCP architecture. There are several variant of TCP protocols that have been extensively researched. For example, TCP Tahoe, TCP Reno, TCP New Reno, TCP Westwood, TCP Vegas, etc. In contrast with UDP Programming, TCP is much easier.

Continue Reading »

4 responses so far

UDP Programming with Java

02 Mar 2011

Resource on UDP Programming is limited and even rare for some programming languages. For TCP Programming, I guess, there is a lot and many languages support it. For example, Java, C, C++, C#, WinSock, etc. So this article is to contribute to those limitation by taking an advantage of java.net package that supports UDP programming interface. The understanding of UDP and TCP is required.

Continue Reading »

6 responses so far

UDP and TCP

02 Mar 2011

UDP and TCP are modest communication protocols in TCP/IP protocol stack. UDP and TCP are located on the Transport layer. It is the lowest level of starting writing distributed systems. It is not about computer network but it is about distributed systems. Every distributed systems programmer needs to understand the distinguish between them very clearly. This article will show you the difference to clear all your doubt.

Continue Reading »

2 responses so far