Data representation and marshalling



  • At language-level data are stored in data structures
  • At TCP/UDP-level data are communicated as ‘messages’ or streams of bytes – hence, conversion/flattening is needed
  • Converted to a sequence of bytes
  • Problem? Different machines have different primitive data reps,
  • Integers: big-endian and little-endian order
  • float-type: representation differs between architectures
  • char codes: ASCII, Unicode
  • Either both machines agree on a format type (included in parameter list) or an intermediate external standard is used:
  • External data representation: an agreed standard for the representation of data structures and primitive values
  • Marshalling: process of taking a collection of data items and assembling them into a form suitable for transmission.
  • Unmarshalling: disassembling (restoring) to original on arrival
  • Three alter. approaches to external data representation and marshelling:
  • XML (Extensible Markup Language) : defines a textual format for rep. structured data
  • First two: marshalling & unmarshalling carried out by middleware layer
  • First two: primitive data types are marshalled into a binary form.


Marshalling is a data presentation conversion, performed according to special rules, usually for network transfer. The following data presentation factors have to be took into account to perform marshalling.
Different platforms use their own character formats (ASCII or EBCDIC), integers and floats formats (IEEE, VAX, Cray, IBM). For example, the scheme is acceptable - the native numeric representation is two's complement for integers, ANSI/IEEE single/double for floats and also that characters are in ISO Latin/1 (an ASCII superset addressing Western European characters). Byte order is basically dependent on processor. But some processors support different byte orders as required for different software environments. There are different alignment strategies. “Natural alignment” is a policy that the processor controls the alignment of data based on its type. It means that the data of basic types are located in memory from the boundaries divisible by their size. Some CPUs have a maximum alignment requirement of two or four bytes, others have some type-specific exceptions to the normal "alignment ==size" rule. “Fixed alignment” ignores data type when establishing alignment; not all processors support such policies. Also, realignment is required for the components of record or structure types, since different CPU’s use different rules for positioning structures fields in memory. Linearization is required for data structures that are stored in non-contiguous memory sections, such as dynamically allocated tree structures. So, marshalling procedures have to have information on data format for current platform, convert it into some standard format used for network transfer, get data from network and be able to decode them back from standard network format into this platform one. In this way, marshalling includes two mutually reverse procedures - encode and decode.They have symmetrical algorithms, whose differ just by basic primitives ‘put’ into and ‘get’ from some buffer. But decode procedures are always more complex due to the requirement for error-checking and some memory allocation. Further we shall call those procedures marshalling and unmarshalling, respectively.

Python Programming ↓ 👆
Java Programming ↓ 👆
JAVA covered following topics in these notes.
JAVA Programs
Principles of Programming Languages ↓ 👆
Principles of Programming Languages covered following topics in these notes.

Previous years solved papers:
A list of Video lectures References:
  1. Sebesta,”Concept of programming Language”, Pearson Edu 
  2. Louden, “Programming Languages: Principles & Practices” , Cengage Learning 
  3. Tucker, “Programming Languages: Principles and paradigms “, Tata McGraw –Hill. 
  4. E Horowitz, "Programming Languages", 2nd Edition, Addison Wesley

    Computer Organization and Architecture ↓ 👆

    Computer Organization and Architecture covered following topics in these notes.

    1. Structure of desktop computers
    2. Logic gates
    3. Register organization
    4. Bus structure
    5. Addressing modes
    6. Register transfer language
    7. Direct mapping numericals
    8. Register in Assembly Language Programming
    9. Arrays in Assembly Language Programming


    1. William stalling ,“Computer Architecture and Organization” PHI
    2. Morris Mano , “Computer System Organization ”PHI

    Computer Network ↓ 👆
    Computer Network covered following topics in these notes.
    1. Data Link Layer
    2. Framing
    3. Byte count framing method
    4. Flag bytes with byte stuffing framing method
    5. Flag bits with bit stuffing framing method
    6. Physical layer coding violations framing method
    7. Error control in data link layer
    8. Stop and Wait scheme
    9. Sliding Window Protocol
    10. One bit sliding window protocol
    11. A protocol Using Go-Back-N
    12. Selective repeat protocol
    13. Application layer
    1. Andrew S. Tanenbaum, David J. Wetherall, “Computer Networks” Pearson Education.
    2. Douglas E Comer, “Internetworking with TCP/IP Principles, Protocols, And Architecture",Pearson Education
    3. KavehPahlavan, Prashant Krishnamurthy, “Networking Fundamentals”, Wiley Publication.
    4. Ying-Dar Lin, Ren-Hung Hwang, Fred Baker, “Computer Networks: An Open Source Approach”, McGraw Hill.