23 May, 2015

Review on Final Paper

Section-B
Q2. What is a Protocol? Explain TCP/IP model? Compare TCP/IP and OSI.
Ans: Protocol is set of rules for communication (1M).
TCP/IP Model: Application, Transport, Internet, Host-to-Network (NW access layer). (overview of each layer-2M)
Comparison: TCP layers and OSI layer, Diagram only or six difference (2M).

Q3. Briefly explain interprocess communication.
Ans: it is used to communication b/w two process (1M).
Types: Message passing (block & non blocking) and Shared Memory(Just overview-2M)
Mechanism: Pipes, Fifo, Message Queue and Signals(Just overview-2M)

Q4. Diff b/w IPV4 & IPV6.
Ans: Diagram and 4 difference (4M)
          Inter….(1M)

Q5. Computer Network? Benefits? Daily Use
Ans: A network is a group of two or more computer systems linked together. There are many types of computer networks, including the following: LAN, MAN, WAN (1M).
Benefits: (2M):
Networking helps in sharing of hardware. Data Sharing. Helps to enhance connectivity. improve communication. Eases out management of data
Daily Use: E-Bill, Net banking, Digital Library, Social sites, E-Newspaper, Communication through Email etc (2M)

Q6.
Shared Memory:  Definition (1M). Three diagram (0.5 for each)
Semaphore: it is used to synchronized the process(1M)
                      Types and P&V (1.5)
                     


Section-C
7Q. What is socket? How to create for TCP & UDP ? Diff b/w TCP & UDP?
Ans:
Socket: It is used to connect or communication b/w two process. It is a combination of IP address and Port Address (Small description of address-2M).
TCP: Diagram only(2M):
        Server side: Socket(), Bind(), Listen(), Accept(), Read()/Recv()/Sendto()/write(), close().
      Client side: Socket(), Connect(),Read()/Recv()/Sendto()/write(), close().
UDP: Diagram only (2M):
        Server side: Socket(), Bind(),Recv()/Sendto(), close().
       Client side: Socket(),Sendto()/Recv(), close().
Diff b/w tcp and udp (4M)
        At least six difference


8a). Communication Protocol.
Ans: Protocol is a set of rule for communication between two devices. (1M)
Protocol: XNS, SNA, TCP, IP (Diagram/Overview, 1 marks for each protocol=4)
8b). RPC
Ans: Diagram and ten steps (diagram-4, description-1 )
8c) Shell programming
Ans: Definition(1M)
        As your choice/Know (2M)
        Commands/program (2M)



9Q:
Diagram(4M):
Functions with prototype: At least 8 Function (6M)
Socket()
Bind()
Listen()
Accept()
Recv()/Sendto()
Close().


18 May, 2015

Notice...

I will upload anserws(Overview only) of Your final exam within few days, Part B&C.
So before you check your marks/exam etc, you have to know that how i  evaluate your paper.

05 May, 2015

Syallabus for Final exam

OSI model, client server model, TCP/IP protocols, Introduction to UNIX; Process, groups, reliable and unreliable signals, shell Programming.

Inter process communication in Unix, pipes, half duplex and full duplex pipes, FIFOs, properties of pipes and FIFOs, POSIX message queues, system V message queues, semaphores, shared memory, map function and its use, RPC, authentication, timeout and retransmission, cal semantics, XDR.


Communication Protocol – Introduction, TCP, IP, XNS, SNA, NetBIOS, OSI protocols, comparisons.


Introduction to Berkeley sockets, socket addressing, TCP and UDP socket functions, sockets and Unix signals, socket implementation, client and server examples for TCP and UDP and their behavior under abnormal conditions.


Socket options, IPv4, IPv6, TCP, I/O multiplexing, Unix I/O models, select and poll functionsSystem V Transport Layer, interface – Introduction Transport End Point address, TLI. 

21 April, 2015

MCQ Review (MST-III)

Questions
Answer
1Q. XTI stands for
a) Transport Layer Interface   b)  Xerox Layer Interface   c) Transaport Layer Interface   d) Xearox Layer Interface  
A
2Q. POSIX stands for
a) Poratable Operating System Interface       c) Portable Operataing System     
b) Portable Operating System Interaface        d) Portable Operating System Interface
D
3Q MQ_OPEN function is used for?
     a) Create POSIX msg queue b) Create System V msg queue   c) Both a & b     d) None
A
4Q. What is rpcgen?
    a) is a compiler                  b)is a assempler  c)is a compiler that generates stub                  d) is a assembler that generates stub
C
5Q. In shell programming, the comments are defined by?
     a) !                     b)#                          c) #!                        d) none of the above
B
6Q. Which signal will issue if an illegal mathematical operation is attempted?
     a)  SIGQUIT                    b)SIGFPE                                     c) SIGTERM                      d) both a & b        
B
7Q. Which signal will issue if the user sends an interrupt signal.
    a) SIGQUIT      b) SIGHUP            c) SIGINT             d) SIGFPE
C
8. Is select and poll, both functions are same?
     a) FALSE     b) TRUE   c) Both a & b   d) None of the above
A

25 March, 2015

MCQ REVIEW (MST-II)

                                                                    SET-I
Questions (8M)
Ans
1Q. SPP stands for
a) Sequence Packet protocol   b)  Sequenced Packet Protocol  c) Sequened Packet Protocol d) Seqence Packet Protol
B
2Q. SNA stands for
a) System Network Architectre    b) System Network Architecture        c) System Network Architeture
d) System Network Architeture
B
3Q. How many layers in XNS and SNA protocol respectively?
     a) 6&5                                b) 5&6                     c) 5&5                     d)6&6
B
4Q. Which protocols need services from other protocols
    a) XNS                                b)SNA                  c)NetBIOS              d)XNS & SNA         e) all  of the above
D
5Q. At least how many arguments are required for Memset() functions?
     a) 2                     b) 3                          c) 4                          d) 5
B
6Q. How many bit of  IP or port  address will be converted by using htons functions?
     a)  16bit                             b)32bit                    c) both a & b           d) None of the above
A
7. Which functions are used for both connectionless and conncetion mode.
    a) Sendto()          b) recvfrom()          c) Sendto & rcvfrom()             d) sendto()&recvfrom().
D
8. Socklen_t is
a) Unsigned integral length of atleast of 32 bit    b) Unsigned integral length of atleast of 16 bit
c) Signed integral length of atleast of 32 bit.        d) Signed integral length of atleast of 16 bit
A
9. After how many hours the KEEPALIVE option is trigger
       a)     1               b)2                           c)3            d)4 
B
10. How many ways to get and set the socket option that affect a socket.
      a) 3                   b)2                             c)4          d)1
A
11. How many arguments are required for setsocket() and getsocket() function respectively.
      a)3&3                                b)5&5                      c)3&5                      d) 5&3
B
12.  IP level is used to indicate
    a) Generic option                        b) IPv4             c) IPv6     d) Both IPV4 and IPV6
B
13. What is difference between TYPE ad TOS.
a) TYPE is used with IPv6  and TOS used with IPV4    b) TYPE is used with generic option and TOS used with IPV4
c) TYPE is used with IPV4 and TOS used with generic option.       d) All of the above
B
14Q. In which function the EOF is by default available ?
     a) printf()                 b) putc ()             c) Snprintf()            d) all of the above
C
15Q. Ctime is a
        a) Function           b) Data type            c) both a & b        d) None
A
16Q. VTAM stands for
   a) Virtual Telecommunication Access Method                b) Virtual Telecomunication Acess Method
   c) Virtual Telecomunication Access Method                   d) Virtual Telecommunication Acces Method
A
                                                                    SET-II
Questions (8M)
Ans
1Q. Which protocols need services from other protocols
       a) XNS                             b)SNA                        c)XNS & SNA            d)NetBIOS                           e) all of above
C
2Q. which one is a connectionless?
     a) TCP and UDP                     b) TCP & IP           c )UDP & IP             d) UDP only
C
3Q. SDLC stands for
       a) Synchrnous Data Link Control                      b) Synchronous Data Link Control
       c) Synchronous data lnk Control                        d) Synchronous Data Lnk Control
B
4Q. VTAM stands for
      a) Virtual Telecomunication Access Method                b) Virtual Telecomunication Acess Method
      c) Virtual Telecommunication Access Method                             d) Virtual Telecommunication Acces Method
C
Q5. Which function is used to convert IPv4 and IPv6 addresses from text to binary form
      a) Inet_pton()                       b) htons()                              c)htonl()                                d) Inet_Addr()
A
Q6. In which function the EOF is by default available ?
       a) getc ()                              b) putc()                               c ) Snprintf()          d) all of the above
C
Q7. Ctime is a
        a) Function                           b) Datatype                             c) both a & b              d) None
A
Q8. SO level is used with
       a) Generic socket option   b) TCP                                      c )IPv4                     d) IPv6
A
Q9.  IP level is used to indicate
      a) Generic option                                    b) IPv6                           c) IPv4                         d) Both IPV4 and IPV6
C
Q10. What is difference between TYPE ad TOS.
a) TYPE is used with IPv6  and TOS used with IPV4         b) TYPE is used with generic option and TOS used with IPV4
c) TYPE is used with IPV4 and TOS used with generic option.              d) All of the above
B
Q11. How many layers in XNS and SNA protocol respectively?
         a) 6&5                                  b)6&6                             c) 5&5                     d) 5&6
D
Q12.  How many arguments are required for setsocket() and getsocket() function respectively.
          a)3&3                               b) 5&3                     c)3&5                 d)5&5
D
Q13. Socklen_t is
        a) Signed integral length of atleast of 32 bit.              b) Unsigned integral length of atleast of 16 bit
        c) Unsigned integral length of atleast of 32 bit           d) Signed integral length of atleast of 16 bit
C
Q14. SNA stands for
       a) System Network Architecture                                 b) System Network Architectre         
       c) System Network Architeture                                   d) System Network Architeture
A
Q15.   Accept system calls used in
a)        Server side                       b) Client side                     c) Both a & b                d) intermediate side
A
Q16. How many bit of  IP or port  address will be converted by using htonl functions?
               a)32bit                              b)  16bit                        c) both a & b                d) None of the above
A


22 March, 2015

NWP-Practical-6

                                                                                     Practical-6

AIM: WAP to send date and time by server to client by using TCP socket.
Theory: RHS
#include “sys/socket.h> “
#include “netinet/in.h”
#include “arpa/inet.h”
#include “stdio.h”
#include “stdlib.h”
#include “unistd.h”
#include “errno.h”
#include “string.h”
#include “sys/types.h”
#include “time.h”
int main(int argc, char *argv[])
{
    int listenfd = 0, connfd = 0;
    struct sockaddr_in serv_addr;
    char sendBuff[1025];
    time_t ticks;
    listenfd = socket(AF_INET, SOCK_STREAM, 0);
    memset(&serv_addr, '0', sizeof(serv_addr));
    memset(sendBuff, '0', sizeof(sendBuff));
    serv_addr.sin_family = AF_INET;
    serv_addr.sin_addr.s_addr = htonl(INADDR_ANY);
    serv_addr.sin_port = htons(5000);
    bind(listenfd, (struct sockaddr*)&serv_addr, sizeof(serv_addr));
    listen(listenfd, 10);
    while(1)
    {
        connfd = accept(listenfd, (struct sockaddr*)NULL, NULL);
        ticks = time(NULL);
        snprintf(sendBuff, sizeof(sendBuff), "%.24s\r\n", ctime(&ticks));
        write(connfd, sendBuff, strlen(sendBuff));
        close(connfd);
        sleep(1);
     }
}



TCP Client Socket
#include “sys/socket.h> “
#include “netinet/in.h”
#include “arpa/inet.h”
#include “stdio.h”
#include “stdlib.h”
#include “unistd.h”
#include “errno.h”
#include “string.h”
#include “sys/types.h”
#include “time.h”
int main(int argc, char *argv[])
{
    int sockfd = 0, n = 0;
    char recvBuff[1024];
    struct sockaddr_in serv_addr;
    if(argc != 2)
    {
        printf("\n Usage: %s \n",argv[0]);
        return 1;
    }
    memset(recvBuff, '0',sizeof(recvBuff));
    if((sockfd = socket(AF_INET, SOCK_STREAM, 0)) < 0)
    {
        printf("\n Error : Could not create socket \n");
        return 1;
    }
   memset(&serv_addr, '0', sizeof(serv_addr));
    serv_addr.sin_family = AF_INET;
    serv_addr.sin_port = htons(5000);
    if(inet_pton(AF_INET, argv[1], &serv_addr.sin_addr)<=0)
    {
        printf("\n inet_pton error occured\n");
        return 1;
    }
    if( connect(sockfd, (struct sockaddr *)&serv_addr, sizeof(serv_addr)) < 0)
    {
       printf("\n Error : Connect Failed \n");
       return 1;
    }
    while ( (n = read(sockfd, recvBuff, sizeof(recvBuff)-1)) > 0)
    {
        recvBuff[n] = 0;
        if(fputs(recvBuff, stdout) == EOF)
        {
            printf("\n Error : Fputs error\n");
        }
    }
    if(n < 0)
    {
       printf("\n Read error \n");
    }
    return 0;
}

Output: LHS
Compile and Run
Firstly Compile and Run the server file on Terminal 1.
Now Compile and Run the client file in Terminal 2, with server IP address.
Now Run client on Terminal 2
$ ./a.out 127.0.0.1 (For same M/C)
Output:
Sun Dec  18 22:22:14 2011on the its socket descriptor.