Skip to main content

Posts

Sem 8 Practical Exam

Recent posts

Sem 7 Practical Exam

 ML LAB ASSIGNMENTS  LAB-1 https://colab.research.google.com/drive/1iQXKgk2nsysWXnO7xbajrSjGcYlReIhE LAB-2 https://colab.research.google.com/drive/1Ilmd52oXNojLpIUKNpVGkDiweL3smrvz LAB-3 https://colab.research.google.com/drive/1U6tD9lT7ktMxfDFVQRXTGGMh7sSA_-Sf LAB-4 https://colab.research.google.com/drive/1S3LFQdfJ0sodYIrNBIvCbuineHN5xRBs LAB-5 https://colab.research.google.com/drive/1u61o7jXxmqw4gnvF-YBKHElMDjHDwBSN LAB-6 https://colab.research.google.com/drive/1-LdxSoE2oKJr9Q84qWPH4Xo5uM7aDvLB QAI LAB ASSIGNMENTS  LAB-1 https://colab.research.google.com/drive/1w8j9LEK_ihcgc6QYhR-s_WQ0FZLbcF3t LAB-2 https://colab.research.google.com/drive/1l10kBvC7qNS2L17f3VBmpyDpNFlG2Mj7 LAB-3 https://colab.research.google.com/drive/1V2u0BZP63lZT9rMYRTcs88XnMNK0Uz6z LAB-4 https://colab.research.google.com/drive/1i7NJukPd-TQ5VAJP02TEOKCArEylmoGp LAB-6 https://colab.research.google.com/drive/1EvbH1DuDC06dkHCJi4XUd6iG87w3DhAl DMV LAB ASSIGNMENTS  LAB-1 https://colab.research.google.com/drive/1YHv4aatqmi

Computer networks lab 5 subnetting code

 def findClass(ip):     if (ip[0]>=0 and ip[0]<=126):         return "A"     elif(ip[0]>=128 and ip[0]<=191):         return "B"     elif(ip[0]>=192 and ip[0]<=223):         return "C"     elif(ip[0]>=224 and ip[0]<=239):         return "D"     else:         return "E"         def separate (ip, className):     if (className=="A"):         print("Network address is : " , ip[0])         print("Host address is : ",".".join(ip[1:4]))             elif(className=="B"):         print("Network address is : ",".".join(ip[0:2]))         print("Host address is : ",".".join(ip[2:4]))             elif(className=="C"):         print("network address is :" ,".".join(ip[1:3]))         print("Host address is :" ,ip[3])             else :         print("This ip cannot be divided in network and host

computer networks lab 6 tcp socket

 Write a program using TCP socket for wired network for following a. Say Hello to Each other b. File transfer. Server Program: /****************** SERVER CODE ****************/ #include <stdio.h> #include <sys/socket.h> #include <netinet/in.h> #include <string.h> int main(){ int welcomeSocket, newSocket; char buffer[1024]; struct sockaddr_in serverAddr; struct sockaddr_storage serverStorage; socklen_t addr_size; welcomeSocket = socket(PF_INET, SOCK_STREAM, 0); serverAddr.sin_family = AF_INET; serverAddr.sin_port = htons(7891); serverAddr.sin_addr.s_addr = inet_addr(“127.0.0.1”); memset(serverAddr.sin_zero, ‘\0’, sizeof serverAddr.sin_zero); bind(welcomeSocket, (struct sockaddr *) &serverAddr, sizeof(serverAddr)); if(listen(welcomeSocket,5)==0) printf(“Listening\n”); else printf(“Error\n”); addr_size = sizeof serverStorage; newSocket = accept(welcomeSocket, (struct sockaddr *) &serverStorage, &addr_size); strcpy(buff

Computer Networks lab 5 socket programming

 Socket Programming using C/C++/Java / python. a. TCP Client, TCP Server b. b. UDP Client, UDP Server. Example: UDP Server using Python import socket   localIP     = &quot;127.0.0.1&quot; localPort   = 20001 bufferSize  = 1024   msgFromServer       = &quot;Hello UDP Client&quot; bytesToSend         = str.encode(msgFromServer)   # Create a datagram socket UDPServerSocket = socket.socket(family=socket.AF_INET, type=socket.SOCK_DGRAM)   # Bind to address and ip UDPServerSocket.bind((localIP, localPort))   print(&quot;UDP server up and listening&quot;)   # Listen for incoming datagrams while(True):     bytesAddressPair = UDPServerSocket.recvfrom(bufferSize)     message = bytesAddressPair[0]     address = bytesAddressPair[1]     clientMsg = &quot;Message from Client:{}&quot;.format(message)     clientIP  = &quot;Client IP Address:{}&quot;.format(address)          print(clientMsg)     print(clientIP)         # Sending a reply to client     UDPServerSoc

IOT Experiment -5

   IOT Experiment -5 READ TEMPERATURE AND DISPLAY ON SERIAL MONITOR USING ARDUINO UNO IN DEGREE CELCUIS AND FAHREINHEIT SORCE CODE: const int sensor=A5; float tempc; float tempf; float vout; void setup(){   pinMode(sensor,INPUT);   Serial.begin(9600); } void loop(){   vout = analogRead(sensor);   vout=(vout *500)/1023; tempc=vout; tempf=(vout*1.8)+32; Serial.print("in DegreeC="); Serial.print("\t"); Serial.print(tempc); Serial.print("  "); Serial.print("in Fahrenheit=");   Serial.print("\t"); Serial.print(tempf); Serial.println(); delay(500); }

IOT Experiment -4

  IOT Experiment -4 READ TEMPERATURE AND DISPLAY ON SERIAL MONITOR USING ARDUINO UNO SORCE CODE: float temp; int temppin=0; void setup(){   Serial.begin(9600); } void loop(){   temp = analogRead(temppin);   temp=temp * 0.48828125;      Serial.print("temperature=");   Serial.print(temp);   Serial.print("*C");   Serial.println();   delay(1000); }