Expect problems and eat them for breakfast.
--Your friends at LectureNotes

Network Programming

by Remya Sasi
Type: PracticalInstitute: Christ The King Engineering College Specialization: Computer Science EngineeringViews: 6Uploaded: 13 days agoAdd to Favourite

Share it with your friends

Suggested Materials

Leave your Comments


Remya Sasi
Remya Sasi
Christ College of Engineering Laboratory Manual NETWORK PROGRAMMING LAB Submitted By Branch Roll No : K A Ashik Moosa : CSE S6 : 2015019 1
CONTENTS S.NO EXPERIMENT Page No 1 Getting started with Basics of Network configuration files and Networking 3 Commands in Linux 2 To Design and configure a network with multiple subnets with wired and wireless LANs using required network devices. Configure the following services in the network- TELNET,SSH, FTP server, Web server, File server, DHCP server and DNS server. 6 3 Using Wireshark observe data transferred in client server communication using UDP and identify the UDP datagram. 9 4 Implement and simulate algorithm for Distance vector routing protocol. 11 5 To Implement Client-Server communication using Socket Programming and TCP as transport layer protocol. 15 6 To Implement Client-Server communication using Socket Programming and UDP as User Datagram Protocol. 17 7 To Implement a multi user chat server using TCP as transport layer protocol. 19 8 To Implement Concurrent Time Server application using UDP to execute the program at remote server. Client sends a time request to the server, server sends its system time back to the client. Client displays the result. 23 9 10 11 12 2
EXPERIMENT NUMBER: 1 AIM: To Familiarise with Basics of Network configuration files and Networking Commands in Linux. IFCONFIG The Unix command ifconfig (short for interface configurator) serves to configure and control TCP/IP network interfaces from a command line interface (CLI). Common uses for ifconfig include setting an interface's IP address and netmask, and disabling or enabling a given interface. Enable or Disable specific interface To enable specific interface, 1. ifup eth0 To disable specific interface, 1. ifdown eth0 NETSTAT Netstat (network statistics) is a command-line tool that displays network connections (both incoming and outgoing), routing tables, and a number of network interface statistics. It is used for finding problems in the network and to determine the amount of traffic on the network as a performance measurement. Parameters: Parameters used with this command must be prefixed with a hyphen (-) rather than a slash (/). -a : Displays all active TCP connections and the TCP and UDP ports on which the computer is listening. -e : Displays ethernet statistics, such as the number of bytes and packets sent and received. This parameter can be combined with -s. -f : Displays fully qualified domain names <FQDN> for foreign addresses. -i : Displays network interfaces and their statistics (not available under Windows) -n : Displays active TCP connections, however, addresses and port numbers are expressed numerically and no attempt is made to determine names. -o : Displays active TCP connections and includes the process ID (PID) for each connection. -p Linux: Process : Show which processes are using which sockets PING Ping is a computer network tool used to test whether a particular host is reachable across an IP network; it is also used to self test the network interface card of the computer, or as a speed test. It works by sending ICMP “echo request” packets to the target host and listening for ICMP “echo response” replies. Ping does not estimate the round-trip time, as it does not factor in the user's connection speed, but instead is used to record any packet loss, and print a statistical summary when finished. The word ping is also frequently used as a verb or noun, where it is usually incorrectly used to refer to the round-trip time, or measuring the round-trip time. 3
ARP In computer networking, the Address Resolution Protocol (ARP) is the method for finding a host's link layer (hardware) address when only its Internet Layer (IP) or some other Network Layer address is known. ARP has been implemented in many types of networks; it is not an IP-only or Ethernet-only protocol. It can be used to resolve many different network layer protocol addresses to interface hardware addresses, although, due to the overwhelming prevalence of IPv4 and Ethernet, ARP is primarily used to translate IP addresses to Ethernet MAC addresses. TELNET Telnet (Telecommunication network) is a network protocol used on the Internet or local area network (LAN) connections. Typically, telnet provides access to a command-line interface on a remote machine. The term telnet also refers to software which implements the client part of the protocol. Telnet clients are available for virtually all platforms Protocol details: Telnet is a client-server protocol, based on a reliable connection-oriented transport. Typically this protocol is used to establish a connection to TCP port 23 FTP File Transfer Protocol (FTP): FTP is a network protocol used to transfer data from one computer to another through a network such as the Internet. FTP is a file transfer protocol for exchanging and manipulating files over a TCP computer network. An FTP client may connect to an FTP server to manipulate files on that server. FTP runs over TCP. It defaults to listen on port 21 for incoming connections from FTP clients. A connection to this port from the FTP Client forms the control stream on which commands are passed from the FTP client to the FTP server and on occasion from the FTP server to the FTP client. FTP uses out-of-band control, which means it uses a separate connection for control and data. Thus, for the actual file transfer to take place, a different connection is required which is called the data stream. FINGER In computer networking, the Name/Finger protocol and the Finger user information protocol are simple network protocols for the exchange of human-oriented status and user information. TRACEROUTE Traceroute is a computer network tool used to determine the route taken by packets across an IP network . An IPv6 variant, traceroute6, is also widely available. Traceroute is often used for network troubleshooting. By showing a list of routers traversed, it allows the user to identify the path taken to reach a particular destination on the network. This can help identify routing problems or firewalls that may be blocking access to a site. Traceroute is also used by penetration testers to gather information about network infrastructure and IP ranges around a given host. It can also be used when downloading data, and if there are multiple mirrors available for the same piece of data, one can trace each mirror to get a good idea of which mirror would be the fastest to use. 4

Lecture Notes