30 January, 2015

Lecturer1(OSI,TCP/IP)

Introduction
Network:
The term network can refer to any interconnected group or system.
A computer network is composed of multiple computers connected together using a telecommunication system. Systems are
¨  PCs, workstations
¨  dedicated computers
¨  network components
Interconnection may be any medium capable of communicating information:
¨  Copper wire
¨  Lasers (optical fiber)
¨  Radio /Satellite link
¨  Cable (coax)
Example: Ethernet.

Why Network?
n  Sharing resources
n  Load Sharing/utilization
n  High reliability

What is internet?
n  Network of networks.

Types of Network
LAN: Local Area Network eg: Ethernet: Practical Labs.
MAN: Metropolitan Area Network eg: Intranet: University Campus.
WAN: Wide Area Networking: eg: Internet

Programming
A plan of action aimed at accomplishing a clear business objective, with details on what work is to be done, by whom, when, and what means or resources will be used.
Computer program is a sequence of instructions, written to perform a specified task or function with a computer.
Eg: program to implement factorial number.

Network Programming
The network programming involves writing computer programs that enable processes to communicate with each other across a computer network.
n  Client Server programming
n  Socket Programming



OSI Reference Model:
OSI reference model is a logical framework for standards for the network communication. OSI reference model is now considered as a primary standard for internetworking and inter computing. Today many network communication protocols are based on the standards of OSI model. In the OSI model the network/data communication is defined into seven layers. 
To remember the names of seven layers in order one common mnemonic used is -"All People Seem to Need Data Processing". i.e
All- Application
People-Presentation
Seem- Session
To- Transport
Need- Network
Data- Data Link

Processing- Physical.

Application Layer:
The application layer serves as the window for users and application processes to access network services. The application layer makes the interface between the program that is sending or is receiving data and the protocol stack.

Functions of Application  layer:
·         Resource sharing and device redirection.
·         Remote file access.
·         Remote printer access.
·         Inter-process communication.
·         Network management.
·         Directory services.
·         Electronic messaging (such as mail).

Presentation Layer
Presentation Layer is also called Translation layer. The presentation layer presents the data into a uniform format and masks the difference of data format between two dissimilar systems.

Functions of Presentation Layer:
·         Character code translation: for example, ASCII to EBCDIC.
·         Data conversion: bit order, CR-CR/LF, integer-floating point, and so on.
·         Data compression: reduces the number of bits that need to be transmitted on the network.
·         Data encryption: encrypt data for security purposes. For example, password encryption.

Session Layers:
Session layer has the primary responsibility of beginning, maintaining and ending the communication between two devices, which is called Session. It also provides for orderly communication between devices by regulating the flow of data.

The examples of session layers and the interactive logins.

Functions of Session Layer:
·          Session establishment, maintenance and termination.
·       Session support: performs the functions that allow these processes to communicate over the network, performing security, name recognition, logging and so on.
·      Dialog control: Dialog control is the function of session layer that determines which device will communicate first and the amount of data that will be sent.
·   Dialog separation or Synchronization: The session layer is also responsible for adding checkpoint or markers within the message. This process of inserting markers to the stream of data is known as dialog separation.
·    Protocols: The protocols that work on the session layer are NetBIOS, Mail Slots, Names Pipes, and RPC.


Transport Layer:
Transport layer manages end to end (source to destination) (process to process) message delivery in a network and also provides the error checking and hence guarantees that no duplication or errors are occurring in the data transfers across the network. It makes sure that all the packets of a message arrive intact and in order.

Functions of Transport Layer:
·         Segmentation of message into packet and reassembly of packets into message:
·         Message acknowledgment
·         Message traffic control
·         Session multiplexing
·         Service point addressing
·         Flow control


Network Layer:
This layer is in charge of packet addressing, converting logical addresses into physical addresses. It is responsible for the source-to-destination delivery of a packet across multiple networks (links). This layer is also in charge of setting the routing. The packets will use to arrive at their destination, based on factors like traffic and priorities. The network layer determines that how data transmits between the network devices.

Functions of Network Layer:
·        Subnet Traffic ControlRouters (network layer intermediate systems) can instruct a sending station to "throttle back" its frame transmission when the router's buffer fills up.
·         Logical-Physical Address Mapping
·         Subnet Usage Accounting
·         Internetworking
·         Logical Addressing
·         Routing
·         Packetizing
·         Fragmentation
      

Data Link Layer:
It is responsible for reliable node-to-node delivery of data. It receives the data from network layer and creates frames, add physical address to these frames and pass them to physical layer
The data link layer provides error-free transfer of data frames from one node to another over the physical layer, allowing layers above it to assume virtually error-free transmission over the link.

Functions of Data Link Layer:
·         Link Establishment and Termination
·         Physical addressing
·         Frame Traffic Control
·         Frame Sequencing
·         Frame Acknowledgment
·         Frame Error Checking: 
·         Media Access Management
·         Flow control 
·         Error control 
·         Access control 

Physical Layer:
The physical layer, the lowest layer of the OSI model, is concerned with the transmission and reception of the unstructured raw bit stream over a physical medium. It describes the electrical/optical, mechanical, and functional interfaces to the physical medium, and carries the signals for all of the higher layers. Physical layer defines the cables, network cards and physical aspects.


Functions of Physical Layer:
·         Data Encoding: 
·         Transmission Technique:
·         Physical Medium
·         Protocols : ISDN, IEEE 802 and IEEE 802.2.
·         Bit synchronization
·         Provides physical characteristics of interfaces and medium
·         Bit rate control
·         Line configuration
·         Transmission mode
·         Physical topologies
·         Multiplexing
·         Circuit switching

Why Layering?
·         Divide a task into pieces and then solve each piece independently (or nearly so).
·         Establishing a well defined interface between layers  makes porting easier.
·         Functions of each layer are independent of functions of other layers
    • Thus each layer is like a module and can be developed independently
·         Each layer builds on services provided by lower layers
    • Thus no need to worry about details of lower layers -- transparent to this layer

Major Advantages
n  Code Reuse
n  Eases maintenance, updating of system




TCP/IP
TCP/ IP stands for Transmission Control Protocol/ Internet Protocol. If this leads you to think that it is not just one protocol, you’re right. In fact, it is not just two protocols, either. TCP/ IP is a suite of protocols.

TCP/IP is a family of protocols. A few provide "low- level" functions needed for many applications. These include IP, TCP, and UDP. Others are protocols for doing specific tasks, e.g. transferring files between computers, sending mail, or finding out who is logged in on another computer. Initially TCP/IP was used mostly between minicomputers or mainframes. These machines had their own disks, and generally were self contained.

 

Application Layer

The application layer is provided by the program that uses TCP/IP for communication. An application is a user process cooperating with another process usually on a different host (there is also a benefit to application communication within a single host). Examples of applications include Telnet and the File Transfer Protocol (FTP).
The Process Layer contains protocols that implement user-level functions, such as mail delivery, file transfer and remote login.

Transport Layer

The transport layer provides the end-to-end data transfer by delivering data from an application to its remote peer. Multiple applications can be supported simultaneously. The most-used transport layer protocol is the Transmission Control Protocol (TCP), which provides connection-oriented reliable data delivery, duplicate data suppression, congestion control, and flow control.
Another transport layer protocol is the User Datagram Protocol It provides connectionless, unreliable, best-effort service. As a result, applications using UDP as the transport protocol have to provide their own end-to-end integrity, flow control, and congestion control, if desired. Usually, UDP is used by applications that need a fast transport mechanism and can tolerate the loss of some data.

 

Internetwork Layer

The internetwork layer also called the internet layer or the network layer, provides the “virtual network” image of an internet this layer shields the higher levels from the physical network architecture below it. Internet Protocol (IP) is the most important protocol in this layer. It is a connectionless protocol that does not assume reliability from lower layers. IP does not provide reliability, flow control, or error recovery.
 These functions must be provided at a higher level. IP provides a routing function that attempts to deliver transmitted messages to their destination. A message unit in an IP network is called an IP datagram. 
This is the basic unit of information transmitted across TCP/IP networks. Other internetwork-layer protocols are IP, ICMP, IGMP, ARP, and RARP.

 

Network Interface Layer(PL n DLL)

The network interface layer, also called the link layer or the data-link layer or Host to Network Layer, is the interface to the actual network hardware. This interface may or may not provide reliable delivery, and may be packet or stream oriented.

In fact, TCP/IP does not specify any protocol here, but can use almost any network interface available, which illustrates the flexibility of the IP layer. Examples are IEEE 802.2, X.25,ATM, FDDI, and even SNA.TCP/IP specifications do not describe or standardize any network-layer protocols, they only standardize ways of accessing those protocols from the internet work layer.

29 January, 2015

Lecturer-2(UNIX OS)

UNIX:
UNIX is an operating system which was first developed in the 1960s, and has been under constant development ever since. By operating system, we mean the suite of programs which make the computer work. It is a stable, multi-user, multi-tasking system for servers, desktops and laptops.
UNIX systems also have a graphical user interface (GUI) similar to Microsoft Windows which provides an easy to use environment. However, knowledge of UNIX is required for operations which aren't covered by a graphical program, or for when there is no windows interface available, for example, in a telnet session.

Types of UNIX:
There are many different versions of UNIX, although they share common similarities. The most popular varieties of UNIX are Sun Solaris, GNU/Linux, and MacOS X.

Parts of UNIX:
The UNIX operating system is made up of three parts; the kernel, the shell and the programs.
Kernel:
The kernel of UNIX is the hub of the operating system: it allocates time and memory to programs and handles the file store and communications in response to system calls.
Shell:
The shell acts as an interface between the user and the kernel. When a user logs in, the login program checks the username and password, and then starts another program called the shell. The shell is a command line interpreter (CLI). It interprets the commands the user types in and arranges for them to be carried out. The commands are themselves programs: when they terminate, the shell gives the user another prompt (% on our systems).
The adept user can customize his/her own shell, and users can use different shells on the same machine. Staff and students in the school have the tcsh shell by default
History - The shell keeps a list of the commands you have typed in. If you need to repeat a command, use the cursor keys to scroll up and down the list or type history for a list of previous commands.
Program:
Set of instruction to perform particular function is called program.

Fundamentals of UNIX
Unix Users - In order to make use of a UNIX system, you must first log in. This requires a user account, which consists of:
Username:
This is your login name and is how you are identified to the system itself and to other users of the system.
Password:
Along with your username, your password grants you access to the system. Don't forget or lose your password. If you write your password down, keep it in a safe place.
Default group:
The default group that your username belongs to.
Contact info:
So that system administrators and other users can contact you if necessary.
Home directory:
A directory or "folder" assigned to your username. This grants you access to disk storage. This is where you will keep your files and data.
Default shell:
The program which manages your login and command line sessions .
Unix Groups
A UNIX group is a collection of users - i.e. a list of usernames. Groups provide a mechanism to assign permissions  to a list of users all at once. Each user can belong to more than one group.
UNIX Processes
When a program is started on UNIX, it creates what is known as a "process" on the system. Every process is assigned a unique serial number called its process id or PID for short. Processes can be created by any user, but can only be destroyed by someone with the permissions to do so - usually the user that created the process or the system administrator. This ensures that the compute jobs you start on the system will not be disturbed by any other user of the system until they complete or you decide to stop them yourself.
Processes and process management becomes important on UNIX systems that are shared between a number of users. The concept of users and PIDs is the main tool by which the available system resources are shared fairly among everybody who needs access to them. Processes can be suspended or given lower priority in cases where one or more users should step out of the way for someone else, but wish to do so without losing their work up to that point.



Signals:
Signals are a complex flow-of-control operation. A signal is an interruption of the program of some sort. To fully and properly understand signals, one must ALWAYS remember signals are classic examples of asynchronous events. For example, when you hit CNTL-C, that sends the SIGINT signal to your program. When you hit CNTL-\, that sends the SIGQUIT signal to your program.
n  Signals are software interrupts
n  Used to handle asynchronous events
n  Each signal is a positive integer, defined by standardized names
n  All the signals start with SIG
n  SIGKILL = 9
n  SIGTERM = 15 (Software termination signal (sent by kill by default).)
n  SIGCHLD = 17
n  SIGINT = 2 (Issued if the user sends an interrupt signal)

Under unreliable signal, system calls are not restarted automatically when interrupted by a signal. Therefore, in order for a program to account for all cases, the program would need to check the value of errno after every system call, and reissue the system call if its value is EINTR.
Along similar lines, unreliable signal semantics don't provide an easy way to get an atomic pause operation (put the process to sleep until a signal arrives). Because of the unreliable nature of reinstalling signal handlers, there are cases in which a signal can arrive without the program realizing this.
n  In older versions of UNIX, signals could be lost and the process would never know
n  Processes had little control over signals. It could catch or ignore the signal
n  Sometimes we want to temporarily block signals and process them later to protect a critical section of code

Under reliable signal semantics, on the other hand, the signal handler remains installed when called, and the race condition for reinstallation is avoided. Also, certain system calls can be restarted, and an atomic pause operation is available via the POSIX sigsuspend function.

n  A signal is said to be generated or raised for a process when an event happens that causes the signal to occur
n  A signal is delivered to a process when it takes action based on that signal
n  During the time between generation and delivery, a signal is said to be pending

n  A process may block some signals using a signal mask that defines which signals are currently blocked for the process.