Os and networking Lab programs

June 4, 2010

TCP communication

Filed under: Networking — osandnetworkingcslab @ 10:51 am

UDP is known as user datagram protocol. It is a connection less protocol. TCP is known as transmission control protocol and it is a connection oriented protocol. Both protocols are used for the communication between two ends. TCP has following advantages over UDP. (1) TCP gives guarantee that a packet will reach on the destination without any duplication and the order of data will be same. On the other hand UDP does not give guarantee that data will reach on destination. it does not gives guarantee that data will be in the same order and it also does not give guarantee that data will reached on destination without any duplication. (2) TCP is a reliable protocol but UDP is unreliable protocol. (3) Data transmission is more dependable on TCP than UDP. (4) As TCP is connection oriented protocol, it means that connection must be open between two ends before sending data. So both ends know all the things between a session as when the connection is closed and when it is opened. But in UDP when you send the data from one end then we cannot know whether data is reaching on the other end or not. As we just hope that it will reach on destination.

Threads

Filed under: Operating Systems,Theory needed for implementing OS related problems — osandnetworkingcslab @ 1:23 am

  • GNU/Linux implements the POSIX standard thread API (known as pthreads). All thread functions and data types are declared in the header file <pthread.h>.

Pthreads defines a set of programming C language types, functions and constants. It is implemented with a header and a thread library. Programmers can use Pthreads to create, manipulate and manage threads, as well as between threads using mutex. Mutex variables are one of the primary means of implementing thread synchronization and for protecting shared data when multiple writes occur. A mutex variable acts like a “lock” protecting access to a shared data resource. The basic concept of a mutex as used in Pthreads is that only one thread can lock (or own) a mutex variable at any given time. Thus, even if several threads try to lock a mutex only one thread will beĀ  successful. No other thread can own that mutex until the owning thread unlocks that mutex. Threads must “take turns” accessing protected data.

    June 3, 2010

    Threads

    Filed under: Operating Systems,Theory needed for implementing OS related problems — osandnetworkingcslab @ 5:40 pm

    • A thread of execution results from a fork of a computer program into two or more concurrently running tasks
    • The Linux kernel schedules threads asynchronously
    • A thread exists within a process.
    • Threads are a finer-grained unit of execution than processes. When you invoke a program, Linux creates a new process and in that process creates a single thread, which runs the program sequentially.
    • Thread can create additional threads; all these threads run the same program in the same process, but each thread may be executing a different part of the program at any given time.
    • All threads within a process share the same address space.
    • The creating and the created thread share the same memory space, file descriptors, and other system resources as the original. If one thread changes the value of a variable, for instance, the other thread subsequently will see the modified value.Similarly, if one thread closes a file descriptor, other threads may not read from or write to that file descriptor

    June 1, 2010

    Programs to be implemented as given in kerala university syllabus

    Filed under: Syllabus — osandnetworkingcslab @ 4:37 pm

    • Implementation of dining philosophers using threads
    • Implementation of dining philosophers using semaphores
    • Program to generate disk usage report for a given Unix,Dos formatted floppy disk giving details like free space availability etc
    • Implementation of Bankers Algorithm
    • Inter process communication using Mail boxes and Pipes
    • MAC protocols-1)Go Back N 2)Selective Repeat 3)Sliding Window
    • Implementation of SMTP using UDP
    • Implementation of FTP using TCP
    • Implementation of finger utility using Remote procedure call(RPC)
    • Generation and processing of HTML forms using CGI

    Create a free website or blog at WordPress.com.