Experiment - 1: Aim: Procedure

You might also like

Download as docx, pdf, or txt
Download as docx, pdf, or txt
You are on page 1of 13

Experiment -1

AIM : Connect the computers in Local Area Network. PROCEDURE :


On the host computer, follow these steps to share the Internet connection: 1. Log on to the host computer as Administrator or as Owner. 2. Click Start, and then click Control Panel. 3. Click Network and Internet Connections. 4. Click Network Connections. 5. Right-click the connection that you use to connect to the Internet. For example, if you connect to the Internet by using a modem, right-click the connection that you want under Dial-up / other network available. 6. Click Properties. 7. Click the Advanced tab. 8. Under Internet Connection Sharing, select the Allow other network users to connect through this computer's Internet connection check box. 9. If you are sharing a dial-up Internet connection, select the Establish a dial-up connection whenever a computer on my network attempts to access the Internet check box if you want to permit your computer to automatically connect to the Internet. 10. Click OK. You receive the following message:

When Internet Connection Sharing is enabled, your LAN adapter will be set to use IP address 192.168.0.1. Your computer may lose connectivity with other computers on your network. If these other computers have static IP addresses, it is a good idea to set them to obtain their IP address automatically. Are you sure you want to enable Internet Connection Sharing? 11. Click Yes. The connection to the Internet is shared to other computers on the local area network (LAN). The network adapter that is connected to the LAN is configured with a static IP address of 192.168.0.1 and a subnet mask of 255.255.255.0

On the client computer : To connect to the Internet by using the shared connection, you must confirm the LAN adapter IP configuration, and then configure the client computer. To confirm the LAN adapter IP configuration, follow these steps: 1. Log on to the client computer as Administrator or as Owner. 2. Click Start, and then click Control Panel. 3. Click Network and Internet Connections. 4. Click Network Connections. 5. Right-click Local Area Connection and then click Properties. 6. Click the General tab, click Internet Protocol (TCP/IP) in the connection uses the following items list, and then click Properties. 7. In the Internet Protocol (TCP/IP) Properties dialog box, click Obtain an IP address automatically (if it is not already selected), and then click OK.

Note: You can also assign a unique static IP address in the range of 192.168.0.2 to 192.168.0.254. For example, you can assign the following static IP address, subnet mask and default gateway: 8. 9. IP Address Subnet mask 192.168.31.202 255.255.255.0

10. Default gateway 192.168.31.1 11. In the Local Area Connection Properties dialog box, click OK. 12. Quit Control Panel.

Experiment -2
//AIM : program for bit stuffing.
#include<stdio.h> #include<string.h> main() { char a[20],fs[50]="",t[6],r[5]; int i,j,p=0,q=0; clrscr(); printf("enter bit string : "); scanf("%s",a); strcat(fs,"01111110"); if(strlen(a)<5) { strcat(fs,a); } else { for(i=0;i<strlen(a)-4;i++) { for(j=i;j<i+5;j++) { t[p++]=a[j]; } t[p]='\0'; if(strcmp(t,"11111")==0)

{ strcat(fs,"111110"); i=j-1; } else { r[0]=a[i]; r[1]='\0'; strcat(fs,r); } p=0; } for(q=i;q<strlen(a);q++) { t[p++]=a[q]; } t[p]='\0'; strcat(fs,t); } strcat(fs,"01111110"); printf("After stuffing : %s",fs); getch(); }

Experiment-3
//AIM: Program for character stuffing.
#include<stdio.h> #include<string.h> main() { char a[30],fs[50]="",t[3],sd,ed,x[3],s[3],d[3],y[3]; int i,j,p=0,q=0; clrscr(); printf("Enter characters to be stuffed : "); scanf("%s",a); printf("\nEnter a character that represents starting delimiter : "); scanf(" %c",&sd); printf("\nEnter a character that represents ending delimiter : "); scanf(" %c",&ed); x[0]=s[0]=s[1]=sd; x[1]=s[2]='\0'; y[0]=d[0]=d[1]=ed; d[2]=y[1]='\0'; strcat(fs,x);

for(i=0;i<strlen(a);i++) { t[0]=a[i]; t[1]='\0';

if(t[0]==sd) strcat(fs,s); else if(t[0]==ed) strcat(fs,d); else strcat(fs,t); } strcat(fs,y); printf("\nAfter stuffing : %s",fs); getch(); }

Experiment-4
//AIM: Program for CRC
#include<stdlib.h> #include<conio.h> #include<stdio.h> void main() { int i,j,n,g,a,arr[20],gen[20],b[20],q[20],s; clrscr(); printf("Transmitter side:"); printf("\nEnter no. of data bits:"); scanf("%d",&n); printf("Enter data:"); for(i=0;i<n;i++) scanf("%d",&arr[i]); printf("Enter size of generator:"); scanf("%d",&g); do { printf("Enter generator:"); for(j=0;j< g;j++) scanf("%d",&gen[j]); } while(gen[0]!=1); printf("\n\tThe generator matrix:"); for(j=0;j< g;j++) printf("%d",gen[j]);

a=n+(g-1); printf("\n\tThe appended matrix is:"); for(i=0;i< j;++i) arr[n+i]=0; for(i=0;i< a;++i) printf("%d",arr[i]); for(i=0;i< n;++i) q[i]= arr[i]; for(i=0;i< n;++i) { if(arr[i]==0) { for(j=i;j< g+i;++j) arr[j] = arr[j]^0; } else { arr[i] = arr[i]^gen[0]; arr[i+1]=arr[i+1]^gen[1]; arr[i+2]=arr[i+2]^gen[2]; arr[i+3]=arr[i+3]^gen[3]; } } printf("\n\tThe CRC is :"); for(i=n;i < a;++i) printf("%d",arr[i]); s=n+a; for(i=n;i< s;i++)

q[i]=arr[i]; printf("\n"); for(i=0;i< a;i++) printf("%d",q[i]); getch(); }

Experiment -5
AIM : Study of following network devices in detail.
1) Repeater : A network device used to regenerate or replicate a signal. Repeaters are used in transmission systems to regenerate analog or digital signals distorted by transmission loss. Analog repeaters frequently can only amplify the signal while digital repeaters can reconstruct a signal to near its original quality. In a data network, a repeater can relay messages between subnet works that use different protocols or cable types. Hubs can operate as repeaters by relaying messages to all connected computers. A repeater cannot do the intelligent routing performed by bridges and routers. 2) Hub : A common connection point for devices in a network. Hubs are commonly used to connect segments of a LAN. A hub contains multiple ports. When a packet arrives at one port, it is copied to the other ports so that all segments of the LAN can see all packets. A passive hub serves simply as a conduit for the data, enabling it to go from one device (or segment) to another. So-called intelligent hubs include additional features that enables an administrator to monitor the traffic passing through the hub and to configure each port in the hub. Intelligent hubs are also called manageable hubs. A third type of hub, called a switching hub, actually reads the destination address of each packet and then forwards the packet to the correct port. 3) Switch: In a telecommunications network, a switch is a device that channels incoming data from any of multiple input ports to the specific output port that will take the data toward its intended destination. In the traditional circuit-switched telephone network, one or more switches are used to set up a dedicated though temporary connection or circuit for an exchange between two or more parties. On an Ethernet local area network (LAN), a switch determines from the physical device (Media Access Control or MAC) address in each incoming message frame which output port to forward it to and out of. In a wide area packet-switched network such as the Internet, a switch determines from the IP address in each packet which output port to use for the next part of its trip to the intended destination. Bridge : In telecommunication networks, a bridge is a product that connects a local area network (LAN) to another local area network that uses the same protocol (for example, Ethernet or token ring). In bridging networks, computer or node addresses have no specific relationship to location. For this reason, messages are sent out to every address on the network and accepted only by the intended destination node. Bridges learn which addresses are on which network and develop a learning table so that subsequent messages can be forwarded to the right network. A bridge works at the data-link (physical network) level of a network, copying a data frame from one network to the next network along the communications path. A bridge is sometimes combined with a router in a product called a brouter. 5) Router : A device that forwards data packets along networks. A router is connected to at least two networks, commonly two LANs or WANs or a LAN and its IPs network. Routers are located at gateways, the places where two or more networks connect. Routers use headers and forwarding tables to determine the best path for forwarding the packets, and they use protocols such as ICMP to communicate with each other and configure the best route between any two hosts. 4)

10

6) Gateways : A node on a network that serves as an entrance to another network. In enterprises, the gateway is the computer that routes the traffic from a workstation to the outside network that is serving the Web pages. In homes, the gateway is the ISP that connects the user to the internet. In enterprises, the gateway node often acts as a proxy server and a firewall. The gateway is also associated with both a router, which use headers and forwarding tables to determine where packets are sent, and a switch, which provides the actual path for the packet in and out of the gateway.

11

Experiment-6
AIM : Study of network IPs and how subnetting and supernetting takes place.
1) Ipv4 : Internet Protocol version four, or IPv4, is a system of addresses used to identify devices on a network. Originally described in 1981 in RFC791, IPv4 is the most widely used Internet layer protocol, and at this point is used by the vast majority of users to connect to the Internet. IPv4 addresses are actually 32-bit numbers. This means that there are 2 , or just over four billion, possible addresses. Over time, however, it has become clear that more addresses than this will be required to ensure ongoing growth of the Internet. The unused pool of IPv4 addresses is predicted run out in the next two years, so an alternative is required. Ipv6 : Internet Protocol version 6 (IPv6) is a version of the Internet Protocol (IP) that is designed to succeed Internet Protocol version 4 (IPv4). The Internet operates by transferring data in small packets that are independently routed across networks as specified by an international communications protocol known as the Internet Protocol. Each data packet contains two numeric addresses that are the packet's origin and destination devices. Since 1981, IPv4 has been the publicly used version of the Internet Protocol, and it is currently the foundation for most Internet communications. The Internet's growth has created a need for more addresses than IPv4 is capable of. IPv6 allows for vastly more numerical addresses, but switching from IPv4 to IPv6 may be a difficult process. Here is an example of a full IPv6 address: FE80:0000:0000:0000:0202:B3FF:FE1E:8329 It shows a 128-bit address in eight 16-bit blocks in the format global:subnet:interface. Here is an example of a collapsed IPv6 address: FE80::0202:B3FF:FE1E:8329 The :: (consecutive colons) notation can be used to represent four successive 16-bit blocks that contain zeros. When SAS software encounters a collapsed IP address, it reconstitutes the address to the required 128-bit address in eight 16-bit blocks. Subnetting : Subnetting an IP Network can be done for a variety of reasons, including organization, use of different physical media (such as Ethernet, FDDI, WAN, etc.), preservation of address space, and security. The most common reason is to control network traffic. In an Ethernet network, all nodes on a segment see all the packets transmitted by all the other nodes on that segment. Performance can be adversely affected under heavy traffic loads, due to collisions and the resulting retransmissions. A router is used to connect IP networks to minimize the amount of traffic each segment must receive.
32

12

Subnet Masking Applying a subnet mask to an IP address allows you to identify the network and node parts of the address. The network bits are represented by the 1s in the mask, and the node bits are represented by the 0s. Performing a bitwise logical AND operation between the IP address and the subnet mask results Starting Network ID Ending Network ID 220.78.168.0 220.78.175.0 11011100 01001110 10101 000 00000000 11011100 01001110 10101 111 00000000 Number.

in the Network Address or For example, using our test IP address and the default Class B subnet mask, we get: 10001100.10110011.11110000.11001000 11111111.11111111.00000000.00000000 -------------------------------------------------------10001100.10110011.00000000.00000000 Default subnet masks: Class A - 255.0.0.0 - 11111111.00000000.00000000.00000000 Class B - 255.255.0.0 - 11111111.11111111.00000000.00000000 Class C - 255.255.255.0 - 11111111.11111111.11111111.00000000 140.179.240.200 Class B IP Address 255.255.000.000 Default Class B Subnet Mask 140.179.000.000 Network Address

Supernetting : Supernetting, also known as Classless InterDomain Routing (CIDR), is another awesome subject. It exists thanks to the wide adoption of the Internet, which lead to the exhaustion of the available IP Addresses. More specifically, supernetting was invented in 1993 with the purpose of extending the 32 bit IP address lifetime until the adoption of IPv6 was complete. Putting it as simply as possible, supernets are used to combine multiple Class C networks into groups, which the router, in turn, treats as one big network. Supernets are the opposite of Subnets in that they combine multiple Class C networks into blocks rather than dividing them into segments. When Subnetting, we borrow bits from the Host ID portion, which increases the number of bits used for the Network ID portion. With Supernetting we do exactly the opposite, meaning we take the bits from the Network ID portion and give them to the Host ID portion illustrated in example below: Note that the first 21 bits (underlined) of all the above Class C network IDs are the same. The last three bits of the third octet vary from 000 to 111. The CIDR entry in the routing tables of the Internet routers becomes:

Network ID 220.78.168.0

Subnet Mask 255.255.248.0

Subnet Mask (binary) 11111111 11111111 11111000 0000000

13

You might also like