Sunday, November 27, 2016

Data Encapsulation

          After reading about OSI and TCP/IP model, we need to know what this models do. For this, we first know about data encapsulation process.

          The term ENCAPSULATION describes a process of putting  headers and sometimes trailers around some data. Each layer adds its own header and Data Link Layer protocols also add a trailer to the data supplied by the higher layer.

          Consider the following example. Let's say that you are browsing a web site. The we server on which the web site is hosted will create and encapsulate the application data with the Application layer header. For example, the HTTP OK message will be stored in the header, followed by the requested content of the web page. The encapsulated data will then be forwarded to the next layer - the Network Layer. The Network layer will store the source and destination IP address in its header and forward the data to the Data Link layer.

          The data link layer is the only layer that uses both header and trailer. The data is then sent through a physical network link.



          Data Encapsulation illustration

          Each data packets (header + data + trailer) defined by a particular layer has a specific name:

  • Frame : Encapsulated data defined by the Data Link layer. A frame can have both header and trailer.
  • Packets : Encapsulated data defined by the Internet/Network layer. A header contains the source and destination IP addresses.
  • Segment : Encapsulated data defined by the Transport Layer. The information such as the source and destination ports or sequence and acknowledgement numbers are included in the header.
          Note :-  The term decapsulation describes a process of removing header and trailers as data passes from a lower to higher layers. This process transpires on a computer that is receiving data.


Data Encapsulation in the OSI model

We read about data encapsulation in TCP/IP model, and now we will see how data encapsulation is done in OSI model. Like with the TCP/IP layer, each OSI layer ask for services from the next lower layer. The lower layer encapsulate the higher layer's data between header and trailer. While the TCP/IP model uses the terms like Segment, Packets and Frames to refer to a data packets defined by the particular layer, the OSI model uses the different term : Protocol Data Unit (PDU).

          A PDU represent a unit of data with headers and trailers for the particular layers, as well as theencapsulated data. Since the OSI model has 7 layers, PDUs are numbered from 1 to 7, with the physical layer being the first. For example, the term layer 3 PDU refers to the data encapsulated at the Network Layer of the OSI model. 


Graphical representation of the PDUs inthe OSI model.

TCP/IP reference model

           The TCP/IP model is the network model used by computer networks today. it was developed in 1970s by DARPA as an open, vendor-neutral, public networking model.The Transmission Control Protocol (TCP) is intended for use as a highly reliable host-to-host protocol between hosts in packet-switched computer communication networks, and in interconnected systems of such networks.

Just like the OSI reference model, the TCP/IP model provides general guidelines for designing and implementing networking protocols. The TCP/IP model has fewer layers than the OSI model. OSI model is made of seven layers, where the TCP/IP model is made of four layers only. These layers describe their different network functions and have their own standards and protocols.


The figure below illustrates difference between OSI model and TCP/IP model layers.



OSI vs TCP/IP model

          TCP/IP model is consist of only four layers from top to bottom Application, Transport, Interface  and Network Interface layer.

          As you can see from the above picture, the Application, Presentation and Session layers of OSI model are merged in only one layer of TCP/IP layer - the Application Layer. The Physical and Data Link layer of OSI model are also merged into the single layer of the TCP/IP  model - the Network Interface layer.

          The Network Interface Layer is sometimes referred as the Link layer. And the Transport layer is sometimes called the Host-to-Host layer.

Now, Why we need TCP/IP  reference model over OSI model?

Because there is some merits/advantages of TCP/IP model as below...


  1. It operated Independently.
  2. It is scalable
  3. Client/server architecture.
  4. it supports many routing protocols.
  5. Can be used to establish connection between two computers.
Be halve of this advantages, TCI/IP has some disadvantages written below,
  1. In this, Transport layer does not guarantee of delivery of packets.
  2. The model cannot be used in any other application.
  3. Replacing protocols is not easy.
  4. It has not clearly separated its services, interfaces and protocols.

OSI model
TCP/IP model
1. OSI is a generic, protocol independent standard, acting as a communication gateway between the network and end user.
1. TCP/IP model is based on standard protocols around which the Internet has developed. It is a communication protocol, which allows connection of hosts over a network.
2. In OSI model the transport layer guarantees the delivery of packets.
2. In TCP/IP model the transport layer does not guarantees delivery of packets. Still the TCP/IP model is more reliable.
3. Follows vertical approach.
3. Follows horizontal approach.
4. OSI is a reference model around which the networks are built. Generally it is used as a guidance tool.
4. TCP/IP model is, in a way implementation of the OSI model.
5. Network layer of OSI model provides both connection oriented and connectionless service.
5. The Network layer in TCP/IP model provides connectionless service.
6.OSI model has a problem of fitting the protocols into the model.
6. TCP/IP model does not fit any protocol.


Saturday, November 26, 2016

Getting Started of Basics.

In order to network work perfectly, there is predefined reffernce model for purpose.

The Open System Interconnection (OSI) model was created by the International Organization of Standardization (ISO). It was layered model that was created to enable different networks to communicate reliably between disparate systems. The OSI model porvides a framework for creating and implimentingnetworking standardsand devices and describe how network applications on different computers can communicate through the network media.




The OSI model has seven hierarchical layers. Each layers describe the different network function. The layers are as show in above picture.

The layers are usually numbered from the last one, which means the Physical lyer is the first layer and the Application layer is the seventh layer.

A  mnemonic can be used to remember the seven layers in order: 

Please Do Not Throw Sausage Pizza Away

Or you can just try to remember first alphabet of each layer from top to bottom, i.e.
A P S T N D P

Here is a description of each layer in the OSI model in brief.

1. Physical Layer:
Defines how to move bits from one device to another. It deals with the physical characteristict of the transmission medium - either wired or wireless, describing connectors, pins, cables and network interface cards. In other words, this layer deals with hardware of network.

2. Datalink Layer:
Creates packets into bytes and byte into frames. Each frames has a header and trailer. A header contains a source MAC address and destination MAC address. ( MAC is Media Access Contol, the Physical address of network device. It is hard-burned by manufacturer. MAC is mad of 48 bits and splits of two parts. First part is manufacturer id and second part is individual device id. In networking term it is called second layer or data link layer address.) A trailer contains the frame Check Sequence Field, used for error detection.

3. Network Layer:
This layer provides logical addressing used by routers for path determination. Logical addressing is used to identify a host on a network. Each devices are seperated by IP address, which is 32 bit logical addressing shceme. IP address must be unique in the network.

4. Transport Layer:
This layer is responsible for establishing reliable or unreliable delivery and error recovery and flow control. The transport layer is sometimes said to be responsible for end-to-end or host-to-host transport. Transport layer is multifunction layer performing, Process-level addressing, Multiplexing and Demultiplexing, Segmentation, Packing, Reassembly, Connection Establishment, Management and Termination, Acknowledgement and Retransmission and Flow Control.

5. Session Layer:
Determines how to establish, control and terminate a session between the two systems. Session layer also authenticates user and provides time slot.

6. Presentation Layer:
This layer is responsible for Data encryption/decryption, Character/string conversion, data compression and graphics handling.The presentation layer mainly translates data between the application layer and the network format. Data can be communicated in different formats via different sources. Thus, the presentation layer is responsible for integrating all formats into a standard format for efficient and effective communication. 

7. Application Layer:
This layer is 7th layer of OSI model and directly connected with user. This layer is responsible for providing a UI (user interface) to user and enables network applications to communicate with other applications. The application layer provides many services, including SMTP, File Transfer, Web Surfing, Web Chat, Email Client, Data Sharing, Virtual Terminals, Various files and data sharing.

So here's brief details of OSI layer and its layers. Now we will move to TCP/IP reference model. 

Thursday, October 27, 2016

What is Computer Networks?

A computer network is a telecommunications networks that enables sharing of resources and informations. Different devices are connected in a network wiwth each other using either cable or other wireless medium. Networks may use analog or digital rules for data exchange, but mostly new networks are using digital rules for communication.

Now days, the Internet is the biggest network in the world. While browsing Internet using PC, laptop or smartphone we are connected with the internet.








This image illustrate the concept of network. Various devices are connected with server and then further connected with the internet cloud followed the router. In the network, we use different types of protocols to make data transfer happens. Such as HTTP, DNS, RSTP, FTP etc.