Wednesday 13 February 2013

OSI Model

What is OSI Model?

The Open Systems Interconnect Model (OSI) is a theoretical model of networking that organizes network functions into seven layers (physical layer, datalink layer, network layer, transport layer, session layer, presentation layer and application layer) and specifies the communication interfaces between the OSI Model's layers and between network endpoints utilizing an OSI Model-based protocol suite

THEORY : The OSI Model is a theoretical model
  • The OSI Model is not a technology.
  • The OSI Model is not a protocol.
  • The OSI Model is not a program or software

LAYERS :
  • The OSI Model sorts network communication functions into sevenlayers
  • Layer functions are not specified and should be transparent to other layers.
  • Layer Communications (how layers communicate with each other) ARE specified in the model
  • Layer behavior should be invisible other layers
    Physical Layer
      The OSI Model's layer 1, the Physical Layer, outlines the characteristics of the physical medium between networked devices--cabling, wiring, fiber strands and the air. Transmission and receipt of data from the physical medium (copper wire, fiber, radio frequencies, barbed wire, string etc.) is managed at this layer.

      The Physical Layer receives data from the data link Layer, and transmits it to the wire. The physical layer controls the electrical and mechanical functions related to the transmission and receipt of a communications signal. It also manages the encoding and decoding of data contained within the modulated signal.

      The physical layer is responsible for:
      • Communication with the Data Link Layer above it.
      • Fragmentation of data into frames
      • Reassembly of frames into data link protocol data units.
      • Transmission to the physical media
      • Receiving from the physical media

      Example Physical Protocols
      1. CSMA/CD - Carrier Sense Multiple Access / Collision Detect
      2. CSMA/CA - Carrier Sense Multiple Access / Collision Avoid
      3. FDMA - Frequency Division Multiple Access
      4. MSK - Minimum Shift Keying
      5. GFMSK - Gaussian-Fitered Minimum Shift Keying
      6. TDMA - Time Division Multiple Access
      7. CDMA - Code Division Multiple Access
      8. B8ZS - Binary 8 Zero Substitution
      9. 2B1Q - 2 Binary 1 Quaternary
      10. PCM - Pulse Code Modulation
      11. QAM - Quadrature Amplitude Modulation
      12. PSK - Phase Shift Keying
      13. SONET - Synchronous Optical NETworking



      Data Link Layer

      The data link Layer is the second layer of the OSI model. The data link layer performs various functions depending upon the hardware protocol used, but has four primary functions:

      • Communication with the Network layer above.
      • Segmentation of upper layer datagrams (also called packets) into frames in sizes that can be handled by the communications hardware.
      • Bit Ordering. The data link layer organizes the pattern of data bits into frames before transmission.
      • Communication with the Physical layer below
      • This layer provides reliable transit of data across a physical link. The Data Link Layer is concerned with physical addressing, network topology, physical link management, error notification, ordered delivery of frames, and flow control.


      Example

      Ethernet Network Adaptors uses a Media Access Control (MAC) address, which is a physical address that (somewhat) uniquely identifies a network card to the physical network. The Ethernet Adaptor's primary job at the data link layer is to transmit Ethernet frames onto the wire. It places its own MAC address in the frame, followed by the destination MAC address to which it wishes to communicate, sets various other values in the Ethernet frame (protocol type etc.) and then transmits on the wire. The CSMA/CD protocol that Ethernet uses to control access to the common network bus could be said to occur at the data link layer of the OSI model or could also be called a data link function.



      Network Layer

      It is the network layer's job to figure out the network topology, handle routing and to prepare data for transmission.

      The network layer is concerned with the following primary functions:
      • Communication with the Transport Layer above.
      • Encapsulation of Transport data into Network layer Protocol Data Units.
      • Management of connectivity and routing between hosts or networks.
      • Communication with the Data Link layer below.

      Examples of network layer protocols include:
      1. Internet Protocol
      2. Internet Control Message Protocol (ICMP or "ping")
      3. Internet Gateway Management Protocol (IGMP)
      4. IPX/SPX



      Transport Layer

      If networking software performs reliable data transfer functions, then the detection of errors, and re-transmission of data to recover those errors or lost data will occur in software managing this layer. The transport layer may use a variety of techniques such as a Cyclic Redundancy Check, windowing and acknowledgements. If data is lost or damaged it is the transport layer's responsibility to recover from that error.
      • Communicate with the Session layer above.
      • Reassemble transport Protocol Data Units into data streams
      • Reliable protocols operating at this layer will
      • Detect errors and lost data
      • Recover lost data
      • Manage re-transmission of data.
      • Segmentation of data streams into transport Protocol Data Units.
      • Communicate with the Network layer below.

      Examples of transport layer protocols include:
      1. Transmission Control Protocol (Reliable)
      2. User Datagram Protocol (Unreliable)



      Session Layer

      The session layer tracks connections, also called sessions. The session layer should keep track of multiple file downloads requested by a particiular FTP application, or multiple telnet connections from a single terminal client, or web page retrievals from a web server.

      With TCP/IP this functionality is handled by application software addressing a connection to a remote machine and using a different local port number for each connection.

      The session layer performs the following functions:
      • Communication with the Presentation layer above.
      • Organize and manage one or more connections per application, between hosts.
      • Communication with the Transport layer below.

      Example

      Sessions are used to keep track of individual connections to remote servers. Your web browser is an excellent example of the use of sessions.

      Your web browser (an application layer object) opens a web page. That page contains text, graphics, Macromedia Flash objects and perhaps a Java applet. The graphics, the Flash object and the Java applet are all stored as separate files on the web server. To access them, a separate download must be started. Your web browser opens a separate session to the web server to download each of the individual files. The session layer keeps track of which packets and data belong to which file and keeps track of where they go (in this case, to your web browser).

      In most modern Internet applications, the session, presentation and application layers are usually rolled together inside the application itself, thus, your web browser performs all functions of the session, presentation and application layers.





      Presentation Layer

      The presentation layer handles the conversion of data between a Standards-based or platform independent formats to a format understood by the local machine. This allows for data to be transported between devices and still be understood.

      The presentation layer performs the following functions:
      • Communication with the application layer above.
      • Translation of data conforming to cross-platform standards into formats understood by the local machine.
      • Communication with the session layer below.

      Examples of Presentation Layer Functions
      1. Conversion of a Sun .RAS raster graphic to JPG.
      2. Conversion of ASCII to IBM EBCDIC
      3. Conversion of .PICT on a MAC to .jpg
      4. Conversion of .wav to .mp3




      Application Layer

      The OSI model defines the application layer as being the user interface. The OSI application layer is responsible for displaying data and images to the user in a human-recognizable format and to interface with the presentation layer below it.


      Examples of applications that utilize the network are:
      1. Telnet
      2. FTP
      3. Instant Message software (AIM, MSN, ICQ, Yahoo)
      4. Microsoft Windows File Shares
      5. Web Browsers (Internet Explorer, Firefox, Google Chrome, Safari)
      6. Network games of Doom, Quake, Unreal (first-person 3D shooter video games)
      7. IRC (mIRC)




      Tuesday 12 February 2013

      IP Address


      What is Internet protocol?
               Internet Protocol Address (or IP Address) is an unique address that computing devices use to identify itself and communicate with other devices in the Internet Protocol network. Any device connected to the IP network must have an unique IP address within its network. An IP address is analogous to a street address or telephone number in that it is used to uniquely identify a network device to deliver mail message, or call ("view") a website.

      Dotted Decimals
               The traditional IP Addresses (IPv4) uses a 32-bit number to represent an IP address, and it defines both network and host address. Due to IPv4 addresses running out, a new version of the IP protocol (IPv6) has been invented to offer virtually limitless number of unique addresses. An IP address is written in "dotted decimal" notation, which is 4 sets of numbers separated by period each set representing 8-bit number ranging from (0-255). 

               An IPv4 address is divided into two parts: network and host address. The network address determines how many of the 32 bits are used for the network address, and remaining bits for the host address. The host address can further divided into subnetwork and host number.

      Class A, B, C and CIDR networks
               Traditionally IP network is classified as A, B or C network. The computers identified the class by the first 3 bits (A=000, B=100, C=110), while humans identify the class by first octet(8-bit) number. With scarcity of IP addresses, the class-based system has been replaced by Classless Inter-Domain Routing (CIDR) to more efficiently allocate IP addresses.

      Note: (1) 127 Network Address reserved for loopback test. (2) Class D (224-247, Multicast) and Class E (248-255, Experimental) are not intended to be used in public operation.

      Public and Private IP Addresses
      In order to maintain uniqueness within global namespace, the IP addresses are publicly registered with the Network Information Center (NIC) to avoid address conflicts. Devices that need to be publicly identified such as web or mail servers must have a globally unique IP address, and they are assigned a public IP address. Devices that do not require public access may be assigned a private IP address, and make it uniquely identifiable within one organization.



      What is loopback IP address?
      The loopback IP address is the address used to access itself. The IPv4 designated 127.0.0.1 as the loopback address with the 255.0.0.0 subnet mask. A loopback interface is also known as a virtual IP, which does not associate with hardware interface. On Linux systems, the loopback interface is commonly called lo or lo0. The corresponding hostname for this interface is called localhost.