In the mix column stage when multiplying the byte value by 2 the following gives the correct answer. If the MSB of the byte value is 1, then left shift the byte value by 1 bit and then XOR the resultant with 27. What is the logic behind this number 27. How was it arrived at.
It is because the values being calculated are the byte representation of a polynomial in a finite field, and if the polynomial is too large to be in the field it must be reduced.
The reduction polynomial for Rijndael is $x^8 + x^4 + x^3 + x + 1$, which has a byte representation of 0x11b, and after you have shifted the byte by 1 bit, the 0x100 is no longer required so 0x1b or 27 is XOR'd against the value to complete the reduction.
your question is unclear.
27 is represent as 0x1b. this is irreducible polynomial in GF(2^8).
what do you mean how was it arrived at? Do you the approach of choosing 0x1b as irreducible polynomial ? I suggest you read the book " The Design of Rijndael - AES - The Advanced Encryption Standard " to understand the multiplication in galois field.