Search This Blog

Thursday, July 21, 2011

Computer Networks Chapter 1


Chapter 1 Introduction
Components of a network
                Sender
                Reciever
                Data
                Protocol
                Medium

Communication
                Simplex
                Half-Duplex
                Full-Duplex

Physical network topology (Refer Lecture 2  video of NPTEL  Computer Networks by IIT Kharagpur)
                Mesh
                Star
                Ring
                Bus
Need to understand the advantages and disadvantages of each topology and their applications.

Types of networks
                LAN
                MAN
                WAN

Internet(Evolution)
                ARPANET
                TCP/IP

Protocol and Standards
                Syntax
                Semantics
                Timing

Summary
  • Data communications are the transfer of data from one device to another via some form of transmission medium.
  •  A data communications system must transmit data to the correct destination in an accurate and timely manner.
  • The five components that make up a data communications system are the message, sender, receiver, medium, and protocol.
  •  Text, numbers, images, audio, and video are different forms of information.
  • Data flow between two devices can occur in one of three ways: simplex, half-duplex, or full-duplex.
  •  A network is a set of communication devices connected by media links.
  •  In a point-to-point connection, two and only two devices are connected by a dedicated link. In a multipoint connection, three or more devices share a link.
  •  Topology refers to the physical or logical arrangement of a network. Devices may be arranged in a mesh, star, bus, or ring topology.
  • A network can be categorized as a local area network or a wide area network.
  •  A LAN is a data communication system within a building, plant, or campus, or between nearby buildings.
  • A WAN is a data communication system spanning states, countries, or the whole world.
  • An internet is a network of networks.
  •  The Internet is a collection of many separate networks.
  • There are local, regional, national, and international Internet service providers.
  • A protocol is a set of rules that govern data communication; the key elements of a protocol are syntax, semantics, and timing.
  • Standards are necessary to ensure that products from different manufacturers can work together as expected.
  • The ISO, ITU-T, ANSI, IEEE, and EIA are some of the organizations involved in standards creation.
  • Forums are special-interest groups that quickly evaluate and standardize new technologies.
  •  A Request for Comment is an idea or concept that is a precursor to an Internet standard.

Wednesday, July 20, 2011

Starting with Computer Networks

As part of  my GATE preparation, I decided to start of with Computer networks.

The GATE syllabus is as follows
ISO/OSI stack, LAN technologies (Ethernet, Token ring), Flow and error control techniques, Routing algorithms, Congestion control, TCP/UDP and sockets, IP(v4), Application layer protocols (icmp, dns, smtp, pop, ftp, http); Basic concepts of hubs, switches, gateways, and routers.

My plan to cover the above mention topics are as follows
  1. Follow Data communication and networking by Ferouzan
  2. Refer Computer networking - a top down approach by James F. Kurose and Keith W. Ross  and Computer Networks - A Systems Approach
  3. Refer the GK publisher's book on GATE
  4. Refer the NPTEL lectures and videos
  5. Refer the ACE notes and materials
  6. Do some questions on the topic
The above mentioned textbooks can be found as ebooks at torrentz.eu and you can download via utorrent client.

Ram

Thursday, June 9, 2011

Reversing a queue without using any external datastructures

One thing that I learned today was the immense power of Recursion. Here is the problem definition.

Given a Queue and its basic operations Enqueue(item),Dequeue( ) and a method IsQEmpty( ) (Returns True if Empty else False). By using only these methods we need to reverse the given queue. No other data structure can be used.

Thought about the solution for a long time, but in vain. Struck my mind only when Mr.Suresh Lokhande revealed the secret. This can be achieved in 4 lines using the technique of recursion.

Find below the algorithm of the Recursive method for reversing a Queue.

Queue Q; (Globally declared)

void ReverseQueue( )
{
   Line 1:  if(!IsQEmpty( ))
    {
     Line 2:   int temp = Dequeue( );
     Line 3:   ReverseQueue( );
     Line 4:   Enqueue(temp);
     }
 }

main( )
{
   ReverseQueue( );
}

We will try to do a code trace taking a small queue
Consider Q has elements 1--2--3
ReverseQueue( ) is called.
Line 1: Queue is not empty, goes inside the if loop
Line 2: Dequeue( ), local variable temp = 1. Queue now contains 2--3
Line 3: ReverseQueue( ) is called. The entire activation record of this function call is pushed onto stack 
           internally
           Line 1 : Queue is not empty, goes inside the if loop
           Line 2 : Dequeue( ), local variable temp = 2. (Since temp is declared locally, this temp is different  
                        from  the temp in the previous method call). Queue now contains 3
           Line 3 : ReverseQueue is called
                       Line 1 : Queue is not empty, goes inside the if loop
                       Line 2 : Dequeue( ), local variable temp = 3.Queue is now empty.
                       Line 3 : ReverseQueue is called.
                                   Line 1 : Queue is empty. The call is returned.
                       Line 4 : Enqueue(temp), which is 3 is inserted into the Queue. Now the queue contains 3.
                                   The function call is returned.
           Line 4: Enqueue(temp), which is 2 is inserted into the Queue. Now the queue contains 3--2.                                       The function call is returned.
Line 4 : Enqueue(temp), which is 1 is inserted into the Queue. Now the queue contains 3--2--1.

Done!!!

The queue is reversed. Here instead of using a stack externally we are making use of the internal stack.

Hope what I have understood is correct, if there is any mistake please let me know. I think this is only one of the ways in which this can be done. There might be other alternatives.

Happy recursion,


Ram





                       
                       

Tuesday, June 7, 2011

Entering the world of Recursion


While dealing with the applications of the data structure Stack, Recursion which is one of its important applications came into the picture.  Even though I have been doing coding for some time now (in small scale) I have never been able to grab my complete control over recursion. I think my brain is not designed to think recursive logic. Still I have decided that I will try to gain some experience in the art of recursion by going through some of the famous recursion problems and its solutions. Special thanks to Mr. Suresh Lokhande who gave great insight into this topic.
If you do a simple Google search on recursion, you will find lots and lots of materials by which you can master the art. Here are a few links which I have decided to read and understand recursion.

Will try to go step by step and learn the concepts clearly. Until next post.

Ram


Monday, May 9, 2011

Develop my own OS


09-05-11
            As I was starting to prepare for GATE, the first topic that I took up was Operating Systems. The text book that I am following is ‘Operating System Concepts’ by Silberschatz. Started reading the first chapter and got a firm grip on what an Operating system is, even though have been using one for the past 11 years. But still something was missing. It was purely theoretical and many of the concepts I had to visualize and be satisfied that it might be like this and that. Suddenly a thought came to my mind of developing an OS from scratch. Started Googling and found lots of resource on it. Decided to dive into the basics of Operating Systems and understand the concepts firmly. Hope my venture turns out to be a success.
The first site that caught my attention was the Bona Fide OS Developer site
I have with me an HP Pavillion dv2000 laptop with Windows Vista installed on it.
I am going through the provided tutorial
The definitions and stuff will be there in the tutorial I am following as I am trying to document whatever I did to learn OS Development. So if you find any term which you do not understand I urge you to Google and find more about it.
The first thing that needs to be done is to get an emulator so that you can try out and do experiments on it rather than the real system.
I downloaded BOSCHS emulator. http://bochs.sourceforge.net/
The programming languages that you need to know are ASM assembly language and a high level language (C,C++,Pascal...). I chose C, since I knew something about it. I have no clue about ASM language. Let’s see where it goes.
Downloaded NASM from the following location and installed it.
Installed Cygwin so that we can use gcc to compile our C Source code.
Now I have an emulator for testing, NASM compiler for assembly language and GCC for C compilation.

Thursday, November 4, 2010

Entering the Android world

Hi All,

On 1'st Nov, I bough myself a new HTC Wildfire Android phone. Its a very nice phone. Enjoying it completely.

But it gave me a big scare when I tried to connect it to my lappy. The system was able to detect the SD card but not the phone.

Installed latest version of HTC Sync 3.0, which installed the required drivers. In the device manager, the device My HTC showed up , but it showed a Error Code 37 after system restart.

On the device, it was not able to detect HTC Sync even though it is running on the system. Error message was shown on the device.

I bought this phone so that I can learn something about Android development. In Eclipse, while debugging it was not detecting the device.

I panicked a little. Had a wild google search. Found out that many have the same issue. Many solutions and fixes where there. Tried one by one the whole night. Fell asleep trying one.

After a long search, got a partial solution for it. Thanks to Simon Britton


The problem was with the driver which was installed. Went to device manager uninstalled the device along with the driver. Downloaded the driver provided in the above link. (32 bit version). Provided this driver when installing the device again. It worked perfectly. The device got installed successfully.

I opened HTC Sync, the phone was able to detect HTC Sync on the PC. Still had issues with syncing. Ignoring it as of now. When trying to sync, an error saying "Unknown error occurred" shows and sync terminates.

When I tried to debug in Eclipse, it showed the device in the list. On selecting the device, the application started running on my phone. I was very happy. :)

My first android application"HelloWorld" was successfully completed.

Now I have set the connection mode on my device as Charge Only and USB Debugging enabled. Able to debug the applications I try on Eclipse.

Hoping to have a nice learning experience with Wildfire.

Ram






Tuesday, February 16, 2010

Hello everyone,

My First post

Inspired by Ashish Derhgawen, I have also decided to blog my experiments and experience in coding. Hoping that I can post something and help someone.

Bye