Download LAB MANUAL FOR COMPUTER NETWORKS and more Lab Reports Computer Networks in PDF only on Docsity!
1 Computer Networks Lab Manual
- EXPERIMENT 1 – INTRODUCTION TO NETWORK DEVICE AND CABLING LIST OF EXPERIMENTS
- EXPERIMENT 2 – NETWORK TOPOLOGIES AND LAN SETUP
- EXPERIMENT 3 – INTRODUCTION TO PACKET TRACER AND DESIGNING TOPOLOGY
- EXPERIMENT 4 – NETWORK DIAGNOSTIC COMMANDs / TOOLS
- EXPERIMENT 5 – NETWORK MONITORING USING WIRESHARK
- EXPERIMENT 6 – JAVA CONCEPTS AND SOCKET PROGRAMMING
- EXPERIMENT 7 – UDP SOCKET PROGRAMMING
- EXPERIMENT 8 – TCP SOCKET PROGRAMMING
- EXPERIMENT 9 – A COMPLETE CLIENT-SERVER APPLICATION
- EXPERIMENT 10 – DHCP CONFIGURATION / IP SUBNETTING
- EXPERIMENT 11 – ROUTER CONFIGURATION AND ROUTING (STATIC & DYNAMIC USING RIP)
- EXPERIMENT 12 – DYNAMIC ROUTING USING OSPF...............................................................................................
- EXPERIMENT 13 – ESTABLISHMENT OF ROUTED WAN
- EXPERIMENT 14 – ACCESS CONTROL LIST
(^2) Computer Networks – Introduction to Network Device and Cabling
EXPERIMENT 1 – INTRODUCTION TO NETWORK DEVICE AND CABLING
Objective
- Lab structure orientation
- Study of different types of Network cables and practically implement the cross-wired cable and straight through cable using clamping tool.
- Study Network Devices in Detail Time Required : 3 hrs Programming Language : NIL Software Required : NIL Hardware Required :
- UTP Wire
- Crimping Tool
- Connector
- Network Devices (Router, Switch, Hub, etc) Structure of the lab
- Network Lab consists of 33 computers connected each other using start topology. Further this Lab is connected with central point (MIS Cell) through fiber Optical cable.
- IP addresses used in this lab are Class B IP Address i.e. [172.23.x.x] and the subnet mask for this lab is [255.255.252.0].
- Internet service is accessible round the clock which is shared from the central point (MIS Cell). Network Cable There are many types of network cables used in the real-world applications. Some of them are given below: Unshielded twisted pair: As the name indicates, the wires are twisted with one another and there is no shield. Shielded twisted pair: Shield with twisted pair.
(^4) Computer Networks – Introduction to Network Device and Cabling Crossover cable: The crossover cable can be used to connect
- Switch to switch
- Hub to hub
- Host to host
- Hub to switch
- Router direct to host Note:- Other two pairs are used for Power on Ethernet
- PoE +VDC: 4 & 5
- PoE - VDC: 7 & 8 Roll over cable: Here, the connections are made in reverse order. This type of cable is used to connect the router/switch to the PC via console port for management purposes. Network Devices Repeater: Functioning at Physical Layer. A repeater is an electronic device that receives a signal and retransmits it at a higher level and/or higher power, or onto the other side of an obstruction, so that the signal can cover longer distances. Repeater has two ports, so cannot be use to connect for more than two devices. Hub: An Ethernet hub or concentrator is a device for connecting multiple twisted pair or fiber optic Ethernet devices together and making them act as a single network segment. Hubs work at the physical layer (layer 1) of the OSI model. The device is a form of multiport repeater. Repeater hubs also participate in collision detection, forwarding a jam signal to all ports if it detects a collision.
(^5) Computer Networks – Introduction to Network Device and Cabling Switch: A network switch or switching hub is a computer networking device that connects network segments. It routes data at the data link layer (layer 2) of the OSI model. Switches that additionally process data at the network layer (layer 3 and above) are often referred to as Layer 3 switches or multilayer switches. Router: A router is an electronic device that interconnects two or more computer networks, and selectively interchanges packets of data between them. Each data packet contains address information that a router can use to determine if the source and destination are on the same network, or if the data packet must be transferred from one network to another. Where multiple routers are used in a large collection of interconnected networks, the routers exchange information about target system addresses, so that each router can build up a table showing the preferred paths between any two systems on the interconnected networks. Gate Way: In a communications network, a network node equipped for interfacing with another network that uses different protocols. Summary In this lab practical students understand the fundamental terminologies and concepts of computer networks. Further they will be able to define topologies of network.
(^7) Computer Networks – Network Topologies and LAN Setup Disadvantages
- Network operation depends on the functioning of the central hub. Hence, central hub failure leads to failure of the entire network.
- Also, the number of nodes that can be added, depends on the capacity of the central hub.
- The setup cost is quite high. Bus topology Advantages
- It is easy to set up, handle, and implement.
- It is best-suited for small networks.
- It costs very less. Disadvantages
- The cable length is limited. This limits the number of network nodes that can be connected.
- This network topology can perform well only for a limited number of nodes. When the number of devices connected to the bus increases, the efficiency decreases.
- It is suitable for networks with low traffic. High traffic increases load on the bus, and the network efficiency drops.
- It is heavily dependent on the central bus. A fault in the bus leads to network failure.
- It is not easy to isolate faults in the network nodes.
- Each device on the network "sees" all the data being transmitted, thus posing a security risk. Ring topology Advantages
- The data being transmitted between two nodes passes through all the intermediate nodes. A central server is not required for the management of this topology.
- The traffic is unidirectional and the data transmission is high-speed.
- In comparison to a bus, a ring is better at handling load.
- The adding or removing of network nodes is easy, as the process requires changing only two connections.
- The configuration makes it easy to identify faults in network nodes.
- In this topology, each node has the opportunity to transmit data. Thus, it is a very organized network topology.
- It is less costly than a star topology. Disadvantages
- The failure of a single node in the network can cause the entire network to fail.
- The movement or changes made to network nodes affect the entire network's performance.
- Data sent from one node to another has to pass through all the intermediate nodes. This makes the transmission slower in comparison to that in a star topology. The transmission speed drops with an increase in the number of nodes.
- There is heavy dependency on the wire connecting the network nodes in the ring.
(^8) Computer Networks – Network Topologies and LAN Setup Introduction to IP addressing Each Network Interface Card (NIC or Network card) present in a PC is assigned one Network address called as IP address [or Network address or Logical address]. This IP address is assigned by the administrator of the network. No two PCs can have the same IP address. There is a burned-in address on the NIC called as Physical Address [or MAC address or Hardware address]. The MAC address of a network card indicates the vendor of that card and a unique serial number. Rules of IPv4 addressing IP address format: IPv4 is made up of four parts, in the pattern as w. x. y. z. Each part has 8 binary bits and the values in decimal can range from 0 to 255. IP address classes: IP addresses are divided into different classes. These classes determine the maximum number of hosts per network ID. Only three classes are actually used for network connectivity. The following table lists all of the address class. Grouping of IP addresses into different classes.
- Class A, B, C, D, E
- Class A: first bit in w is 0 and others can be anything ▪ 0.0.0.0 to 127.255.255. ▪ ii. First bits are used for network part and the remaining for host part.
- Class B: First bit in w is1 and second bit is 0. ▪ 128.0.0.0 to 191.255.255. ▪ ii. First 16 bits for network part and remaining host part
- Class C: first bit in w is 1, second bit in w is 1 and third bit is 0 ▪ 192.0.0.0 to 223.255.255. ▪ ii. First 24 bits for network part and last 8 bits for host part.
- Class D: first, second, third bits in w are 1 and fourth bit is 0; used for multicast. ▪ i. 224.0.0.0 to 247.255.255.
- Class E: future use or experimental purposes. Default Subnet mask: It is used to identify the network part from the host part. Put binary one for the parts that represent network part and zero for the part that represent host part.
- Class A: 255.0.0.
- Class B: 255.255.0.
- Class C: 255.255.255. Note: - We can’t have mix of 1s and 0s in subnet mask. Only consecutive 1s is followed by consecutive 0s The following table lists the default subnet masks for each available class of TCP/IP networks.
(^10) Computer Networks – Network Topologies and LAN Setup The IP addresses can be set to anything as long as they are compatible and on the same network. Record the existing settings before making any changes in case they need to be set back (for instance, they may be DHCP clients now). For this lab, use the Class C IP network address of 192.168.230.0 and set workstation 1 to static IP address 192.168.230.1 and set workstation 2 to 192.168.230.2. Set the default subnet mask on each workstation to 255.255.0.0. For the purpose of this lab, you can leave the Gateway and DNS Server entries blank. Check the TCP/IP Settings with the IPCONFIG Utility Use the ipconfig.exe command to see your TCP/IP settings on one screen. Click on Start - > Command Prompt. Enter ipconfig /all command to see all TCP/IP related settings for your workstation. Fill in the blanks below using the results of the IPCONFIG command from each workstation: Check the network connection with the Ping Utility Use the Ping Command to check for basic TCP/IP connectivity. Click on Start-> Command Prompt. Enter the Ping command followed by the IP address of the other workstation (Example - ping 192.168.230.1 or 192.168.230.2). Summary In this lab practical students understand the how to set up a small network and diagnose network problems. Further they will be able to view the Network statistics using command line.
11 Computer Networks – Introduction to Packet Tracer and Designing Topology
EXPERIMENT 3 – INTRODUCTION TO PACKET TRACER AND DESIGNING TOPOLOGY
Objective
- Introduction to Packet Tracer interface.
- Learn how to use existing topologies and build your own. Time Required : 3 hrs Programming Language : NIL Software Required : Packet Tracer Hardware Required : NIL Introduction to Packet Tracer What is Packet Tracer? Packet Tracer is a protocol simulator developed by Dennis Frezzo and his team at Cisco Systems. Packet Tracer (PT) is a powerful and dynamic tool that displays the various protocols used in networking, in either Real Time or Simulation mode. This includes layer 2 protocols such as Ethernet and PPP, layer 3 protocols such as IP, ICMP, and ARP, and layer 4 protocols such as TCP and UDP. Routing protocols can also be traced. Introduction to the Packet Tracer Interface using a Hub Topology Step 1: Start Packet Tracer and Entering Simulation Mode and Launch Packet Tracer program from the program list. Step 2: Open an existing topology and Perform the following steps to open the 2c1 topology. By default, the topology opens in Realtime mode. We will examine the difference between Real-time and Simulation modes in a moment. To view the IP address, subnet mask, default gateway, and MAC address of a host, move the cursor over that computer. Be sure the Select box is checked at the top of the tool box. Viewing PC0 information using the Select tool:
13 Computer Networks – Introduction to Packet Tracer and Designing Topology Packet Tracer allows us to either issue the command from the command prompt or to use the Add Simple PDU tool. We will look at both ways to do this. In order to view only the “pings”, in the Event List Filter, click on SHOW ALL/NONE to clear all protocols, and then click on ICMP to select only that protocol. Using the Simple PDU Tool One method for pinging a device from another device is to use the Simple PDU tool. This tool performs the ping without having to issue the ping command. Choose the Add Simple PDU tool from the tool box: Click once on PC0, the device issuing the ping (ICMP Echo Request) and then click once on PC1 (the destination of the ICMP Echo Request).
14 Computer Networks – Introduction to Packet Tracer and Designing Topology By clicking on the Auto Capture/Play button, this will capture all events in interval of 0.001 second. For example, the first event is the building of the ICMP packet and encapsulating it in an Ethernet frame. The next event will send this Ethernet frame from the Ethernet NIC in PC0 to the Hub. Notice that the hub floods all of the frames out all ports except the port incoming port. Normally, before the ICMP Echo Request, ping, is sent out by PC0, an ARP Request might first be sent. We will discuss this later, but we disabled the display of ARP in the Event List earlier. Note: Using this tool, only a single ping, ICMP Echo Request is sent by PC0, instead of the four pings when using the command prompt.
16 Computer Networks – Introduction to Packet Tracer and Designing Topology The default is the OSI Model view with a brief description with what is occurring with this packet. Click on the Outbound PDU Details tab to see the protocol details including the layer 2 Ethernet frame, the layer 3 IP packet and ICMP message.
(^17) Computer Networks – Network Diagnostic Commands / Tools
EXPERIMENT 4 – NETWORK DIAGNOSTIC COMMANDs / TOOLS
Objective
- Students are able to Learn and Understand Network diagnostic tools
- Learn about various network related commands Time Required : 3 hrs Programming Language : NIL Software Required : Windows Command line Utility Hardware Required : NIL PING Command Ping is a basic Internet program that lets you verify that a particular IP address exists and can accept requests. The verb ping means the act of using the ping utility or command. Ping is used diagnostically to ensure that a host computer you are trying to reach is actually operating. Various options available in the ping command:
- t repetitively sends packets.
- n number of echo to be sent
- l sending buffer size [Max: 65500 bytes]
- r countr record route for count hops [3rd layer device] Activity 4. 1 In order to send a packet to a host [192.168.230.1] with size of 60000 bytes each. We wish to send the packets repetitively. ping - t - l 60000 192.168.230. TRACERT Command If someone would like to know how he goes from his house to his office he could just tell the list of the crossroads where he passes. The same way we can ask the data sent over from your computer to the web server which way does it go, through which devices? We ask it by using the utility called trace route. In most computers today you can use this tool from the command line: In MS Windows machines it is called tracert. Various options available in the tracert command:
- d Don’t resolve addresses to hostnames.
- h maximum_hops Maximum number of hops to search for target
- w time-out wait timeout milliseconds for each reply. Activity 4. To check the trace from your PC to a server tracert 172.23.16. PATHPING Command This command is used as IP trace utility and so it is similar to the tracert command. It has some extra features compared to tracert command. It also has various options to perform.
- n Don't resolve addresses to hostnames
- h max_hops Max number of hops to search
- p period Wait between pings (milliseconds)
- q num_queries Number of queries per hop
- w timeout Wait timeout for each reply (milliseconds) NETSTAT Command This command is used to get information about the open connections on your system
(^19) Computer Networks – Network Diagnostic Commands / Tools The address resolution protocol (ARP) is a protocol used by the Internet Protocol (IP), specifically IPv4, to map IP network addresses to the hardware addresses used by a data link protocol. Various options available in the ARP command:
- a Displays current ARP entries by interrogating the current protocol data. If inet_addr is specified, the IP and Physical addresses for only the specified computer are displayed. If more than one network interface uses ARP, entries for each ARP table are displayed.
- d Deletes the host specified by inet_addr. Activity 4. To display the entries in ARP cache arp - a To delete an ARP entry in the cache arp – d 192.168.50. IPCONFIG Command This command is used to get IP configurations present in your PC. IPCONFIG /all Display full configuration information. IPCONFIG /renew [adapter] Renew the IP address for the specified adapter. IPCONFIG /flushdns Purge the DNS Resolver cache. IPCONFIG /displaydns Display the contents of the DNS Resolver Cache. ## Activity 4.
ipconfig ... Show information. ipconfig /all ... Show detailed information ipconfig /renew ... renew all adapters
(^20) Computer Networks – Network Monitoring using Wireshark
EXPERIMENT 5 – NETWORK MONITORING USING WIRESHARK
Objective
- Configure FTP Server using XLight Software
- Capture FTP traffic using Wireshark
- Monitor FTP packets Time Required : 3 hrs Programming Language : NIL Software Required : Wireshark Software, XLight Software Hardware Required : NIL Configure the FTP Service
- To configure the FTP Service to allow only anonymous connections, follow these steps:
- Start Start - > Administrative Tools - > Internet Information Services Manager.
- Expand Server_name, where Server_nameis the name of the server.
- Expand FTP Sites
- Right-click Default FTP Site, and then right-click and select Properties.
- Click the Security Accounts tab.
- Click to select the Allow Anonymous Connections check box (if it is not already selected), and then click to select the Allow only anonymous connections check box.
- When you click to select the Allow only anonymous connections check box, you configure the FTP Service to allow only anonymous connections. Users cannot log on by using user names and passwords.
- Click the Home Directory tab. The default home directory is c:\inetpup\ftproot.
- You may change it if you wish.
- Click to select the Read and Log visits check boxes (if they are not already selected), and then click to clear the Write check box (if it is not already cleared).
- Quit Internet Information Services Manager.
- The FTP server is now configured to accept incoming FTP requests. Copy or move the files that you want to make available to the FTP publishing folder for access. Analysis of TCP Session Step 1: Open Wireshark and go to Capture→Interfaces. Select an appropriate Network Interface Card and press start to begin capturing packets. Wireshark will start capturing all the packets on LAN, whether these are destined for or originating from your PC or not! Step 2: Now apply a filter to capture TCP packets only. Also apply another filter so that you can see only the traffic destined for or originating from your PC. Here is the composite filter string (ip.src==your_ip_addr|| ip.dst==your_ip_addr) && tcp Note: Here “||” stands for logical OR and “&&” stands for logical AND. Step 3: Open command prompt and establish an ftp session to an FTP server. For this lab, an FTP server has been established at Server_name. At home, you can use ftp.mozilla.orgas FTP server. Coming back to FTP session, type following commands in command prompt to setup a session:
- Type ftp Server_name, where Server_nameis the name of the server.
- Enter your first name as username
- Give an arbitrary password. You will not be authenticated with these credentials; however this is sufficient for analyzing a TCP session.
- Type bye to end up the ftp session. Step 4: Now go back to Wireshark and stop capturing packets by going to Capture → Stop.