+ All Categories

CNS lab

Date post: 03-Dec-2014
Category:
Upload: dinesh-kumar-p
View: 111 times
Download: 1 times
Share this document with a friend
Popular Tags:
83
15054 COMPUTER NETWORK AND SECURITY LAB MANUAL
Transcript
Page 1: CNS lab

15054COMPUTER NETWORK AND SECURITY

LAB MANUAL

TABLE OF CONTENTS

Exp No Contents

1(a) Cable crimping

1(b) Standard cabling

1(c) Cross cabling

2 Bus Topology

3 Peer to Peer Network Connection

4 Interface PCrsquos Using Connectivity Devices

5(a) Configuring IP Address

5(b) Configuring DNS Server

6(a) FTP Configuration

6(b) Telnet Configuration

7(a) Configuring Network Interface Card in LAN

7(b) File and Printer Sharing

8 Firewall Configuration

9 User Rights

10(a) Configuring DHCP Server

10(b) Configuring DHCP Client

11 Wireless Communication

12 Configuring Mail Server

13 Error Checking Using CRC

14 Download A File From Server

15 Sliding Window Protocol

Aim To study about the cables need of cable crimping in network and the requirements ofthe cable crimping

CableCable is the medium through which information usually moves from

one network device to another There are several types of cable which are commonly used with LANs In some cases a network will utilize only one type of cable other networks will use a variety of cable types The type of cable chosen for a network is related to the networks topology protocol and size Understanding the characteristics of different types of cable and how they relate to other aspects of a network is necessary for the development of a successful network

The following are the two types of cables that can be used for network connection establishmentthrough a straight cable or cross over cable

1 Unshielded Twisted Pair (UTP) Cable2 Shielded Twisted Pair (STP) Cable

Unshielded Twisted Pair CableUnshielded twisted pair is the most common kind of copper telephone

wiring Twisted pair is the ordinary copper wire that connects home and many business computers to the telephone company To reduce crosstalk or electromagnetic induction between pairs of wires two insulated copper wires are twisted around each other Each signal on twisted pair requires both wires Since some telephone sets or desktop locations require multiple connections twisted pair is sometimes installed in two or more pairs all within a single cable

Shielded Twisted Pair CableShielded twisted pair is a special kind of copper telephone wiring used

in some business installations An outer covering or shield is added to the ordinary twisted pair telephone wires the shield functions as a groundCable Crimping

You will need the following tools and supplies to build your own Ethernet cables1 UTP cable (Category 5 or better)2 RJ-45 connectors3 Wire stripper4 RJ-45 crimping tool

Follow these steps for creating your own twisted-pair cables1 Determine how long your UTP cable should be Youll want to allow adequate slack for moving the computer and for avoiding strong interference sources Keep the maximum distances for UTP cables listed later in this chapter in mind2 Roll out the appropriate length of cable3 Cut the cable cleanly from the box of wire4 Use the wire stripper to strip the insulation jacket off the cable to expose the UTP wires

5 Check the outer jacket and inner UTP wires for nicks adjust the stripper tool and repeat steps 3 and 4 if you see damage6 Arrange the wires according to the EIA 568B standard listed earlier in EIATIA 568B UTP Standard

7 Trim the wire edges so the eight wires are even with one another and are slightly less than 12 inch past the end of the jacket If the wires are too long crosstalk (wire-to-wire interference) can result if the wires are too short they cannot make a good connection with the RJ-45 plug

8 With the clip side of the RJ-45 plug facing away from you push the cable into place Verify that the wires are arranged according to the EIATIA 568B standard before you crimp the plug onto the wires Adjust the connection as needed

9 Use the crimping tool to squeeze the RJ-45 plug onto the cable The end of the cable should be tight enough to resist being removed by hand10 Repeat steps 4-9 for the other end of the cable11 Label each cable with the following informationbull Wiring standardbull Lengthbull End with crossover (if any)bull _______________ (blank) for computer ID

ResultThus we have studied about the cable crimping in detailed

AimTo make a standard cabling for connecting a PC and Network device

with the help of unshielded twisted pair cableProcedure

1 Start with an approximately 1-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket

at each end of the cable3 Separate each pair of wires and put them in the correct order of

sequence according to the EIATIA specificationNote the TIA (Telecommunications Industry Association) and the EIA (Electronic Industries Association) began developing methods for cabling buildingswith the intent of developing a uniform wiring system that would

support multivendor products and environments In 1991 the TIAEIA released the TIAEIA568 Commercial Building Telecommunication Cabling standard

4 Trim the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 The connector should crimp each of the wires tightly and the connector should bind the outer jacket8 To make a complete cable repeat the steps above and add a connector to the other end of the cable9 The following figure can be representing the straight cabling

ResultThus we had made the standard cabling in unshielded twisted pair cable for the purposeof connecting PC and Network device

AimTo make a cross over cabling for connecting two PCrsquos with the help of unshielded twisted pair cable

Procedure1 Start with an approximately 2-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket at each end of the cable3 Separate each pair of wires on one end and put them in the correct order of sequence according to the EIATIA specification as shown in following table4 Snip the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point

6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 Each of the wires should be crimped tightly by the connector and the outer jacket should be bound by the connector8 On the end of the cable separate the wires and arrange them according to the EIATIA specification9 The following figure can be representing the cross over cabling method

ResultThus we had made the cross over cabling in unshielded twisted pair cable for the purpose of connecting two PCrsquos or two similar Network devices

Aim To connect three systems in a Local Area Network using bus topology

Requirements1048633 BNC Male Connector1048633 BNC terminator1048633 BNC T-Connector1048633 10 Base 2 Co-axial cable1048633 NIC with BNC Female ConnectorProcedure1 Install an appropriate NIC into your system2 Crimp the co axial cable with the BNC male connector3 Connect the BNC T-connector into a network interface card4 Connect one end of the T ndash Connector into the crimped BNC male connector and connect the other into a next T ndash Connector of another system5 And do the above for three systems6 Connect the terminator for both the starting and ending T ndash Connectors (ie) 1st and 3rd systems T - connectors7 Power on the system and do the followinga Open computer properties by right clicking my computer icon on the desktopb Select the Computer name tab and click change buttonc Now the system will shows the Computer name changes window

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 2: CNS lab

TABLE OF CONTENTS

Exp No Contents

1(a) Cable crimping

1(b) Standard cabling

1(c) Cross cabling

2 Bus Topology

3 Peer to Peer Network Connection

4 Interface PCrsquos Using Connectivity Devices

5(a) Configuring IP Address

5(b) Configuring DNS Server

6(a) FTP Configuration

6(b) Telnet Configuration

7(a) Configuring Network Interface Card in LAN

7(b) File and Printer Sharing

8 Firewall Configuration

9 User Rights

10(a) Configuring DHCP Server

10(b) Configuring DHCP Client

11 Wireless Communication

12 Configuring Mail Server

13 Error Checking Using CRC

14 Download A File From Server

15 Sliding Window Protocol

Aim To study about the cables need of cable crimping in network and the requirements ofthe cable crimping

CableCable is the medium through which information usually moves from

one network device to another There are several types of cable which are commonly used with LANs In some cases a network will utilize only one type of cable other networks will use a variety of cable types The type of cable chosen for a network is related to the networks topology protocol and size Understanding the characteristics of different types of cable and how they relate to other aspects of a network is necessary for the development of a successful network

The following are the two types of cables that can be used for network connection establishmentthrough a straight cable or cross over cable

1 Unshielded Twisted Pair (UTP) Cable2 Shielded Twisted Pair (STP) Cable

Unshielded Twisted Pair CableUnshielded twisted pair is the most common kind of copper telephone

wiring Twisted pair is the ordinary copper wire that connects home and many business computers to the telephone company To reduce crosstalk or electromagnetic induction between pairs of wires two insulated copper wires are twisted around each other Each signal on twisted pair requires both wires Since some telephone sets or desktop locations require multiple connections twisted pair is sometimes installed in two or more pairs all within a single cable

Shielded Twisted Pair CableShielded twisted pair is a special kind of copper telephone wiring used

in some business installations An outer covering or shield is added to the ordinary twisted pair telephone wires the shield functions as a groundCable Crimping

You will need the following tools and supplies to build your own Ethernet cables1 UTP cable (Category 5 or better)2 RJ-45 connectors3 Wire stripper4 RJ-45 crimping tool

Follow these steps for creating your own twisted-pair cables1 Determine how long your UTP cable should be Youll want to allow adequate slack for moving the computer and for avoiding strong interference sources Keep the maximum distances for UTP cables listed later in this chapter in mind2 Roll out the appropriate length of cable3 Cut the cable cleanly from the box of wire4 Use the wire stripper to strip the insulation jacket off the cable to expose the UTP wires

5 Check the outer jacket and inner UTP wires for nicks adjust the stripper tool and repeat steps 3 and 4 if you see damage6 Arrange the wires according to the EIA 568B standard listed earlier in EIATIA 568B UTP Standard

7 Trim the wire edges so the eight wires are even with one another and are slightly less than 12 inch past the end of the jacket If the wires are too long crosstalk (wire-to-wire interference) can result if the wires are too short they cannot make a good connection with the RJ-45 plug

8 With the clip side of the RJ-45 plug facing away from you push the cable into place Verify that the wires are arranged according to the EIATIA 568B standard before you crimp the plug onto the wires Adjust the connection as needed

9 Use the crimping tool to squeeze the RJ-45 plug onto the cable The end of the cable should be tight enough to resist being removed by hand10 Repeat steps 4-9 for the other end of the cable11 Label each cable with the following informationbull Wiring standardbull Lengthbull End with crossover (if any)bull _______________ (blank) for computer ID

ResultThus we have studied about the cable crimping in detailed

AimTo make a standard cabling for connecting a PC and Network device

with the help of unshielded twisted pair cableProcedure

1 Start with an approximately 1-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket

at each end of the cable3 Separate each pair of wires and put them in the correct order of

sequence according to the EIATIA specificationNote the TIA (Telecommunications Industry Association) and the EIA (Electronic Industries Association) began developing methods for cabling buildingswith the intent of developing a uniform wiring system that would

support multivendor products and environments In 1991 the TIAEIA released the TIAEIA568 Commercial Building Telecommunication Cabling standard

4 Trim the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 The connector should crimp each of the wires tightly and the connector should bind the outer jacket8 To make a complete cable repeat the steps above and add a connector to the other end of the cable9 The following figure can be representing the straight cabling

ResultThus we had made the standard cabling in unshielded twisted pair cable for the purposeof connecting PC and Network device

AimTo make a cross over cabling for connecting two PCrsquos with the help of unshielded twisted pair cable

Procedure1 Start with an approximately 2-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket at each end of the cable3 Separate each pair of wires on one end and put them in the correct order of sequence according to the EIATIA specification as shown in following table4 Snip the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point

6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 Each of the wires should be crimped tightly by the connector and the outer jacket should be bound by the connector8 On the end of the cable separate the wires and arrange them according to the EIATIA specification9 The following figure can be representing the cross over cabling method

ResultThus we had made the cross over cabling in unshielded twisted pair cable for the purpose of connecting two PCrsquos or two similar Network devices

Aim To connect three systems in a Local Area Network using bus topology

Requirements1048633 BNC Male Connector1048633 BNC terminator1048633 BNC T-Connector1048633 10 Base 2 Co-axial cable1048633 NIC with BNC Female ConnectorProcedure1 Install an appropriate NIC into your system2 Crimp the co axial cable with the BNC male connector3 Connect the BNC T-connector into a network interface card4 Connect one end of the T ndash Connector into the crimped BNC male connector and connect the other into a next T ndash Connector of another system5 And do the above for three systems6 Connect the terminator for both the starting and ending T ndash Connectors (ie) 1st and 3rd systems T - connectors7 Power on the system and do the followinga Open computer properties by right clicking my computer icon on the desktopb Select the Computer name tab and click change buttonc Now the system will shows the Computer name changes window

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 3: CNS lab

Aim To study about the cables need of cable crimping in network and the requirements ofthe cable crimping

CableCable is the medium through which information usually moves from

one network device to another There are several types of cable which are commonly used with LANs In some cases a network will utilize only one type of cable other networks will use a variety of cable types The type of cable chosen for a network is related to the networks topology protocol and size Understanding the characteristics of different types of cable and how they relate to other aspects of a network is necessary for the development of a successful network

The following are the two types of cables that can be used for network connection establishmentthrough a straight cable or cross over cable

1 Unshielded Twisted Pair (UTP) Cable2 Shielded Twisted Pair (STP) Cable

Unshielded Twisted Pair CableUnshielded twisted pair is the most common kind of copper telephone

wiring Twisted pair is the ordinary copper wire that connects home and many business computers to the telephone company To reduce crosstalk or electromagnetic induction between pairs of wires two insulated copper wires are twisted around each other Each signal on twisted pair requires both wires Since some telephone sets or desktop locations require multiple connections twisted pair is sometimes installed in two or more pairs all within a single cable

Shielded Twisted Pair CableShielded twisted pair is a special kind of copper telephone wiring used

in some business installations An outer covering or shield is added to the ordinary twisted pair telephone wires the shield functions as a groundCable Crimping

You will need the following tools and supplies to build your own Ethernet cables1 UTP cable (Category 5 or better)2 RJ-45 connectors3 Wire stripper4 RJ-45 crimping tool

Follow these steps for creating your own twisted-pair cables1 Determine how long your UTP cable should be Youll want to allow adequate slack for moving the computer and for avoiding strong interference sources Keep the maximum distances for UTP cables listed later in this chapter in mind2 Roll out the appropriate length of cable3 Cut the cable cleanly from the box of wire4 Use the wire stripper to strip the insulation jacket off the cable to expose the UTP wires

5 Check the outer jacket and inner UTP wires for nicks adjust the stripper tool and repeat steps 3 and 4 if you see damage6 Arrange the wires according to the EIA 568B standard listed earlier in EIATIA 568B UTP Standard

7 Trim the wire edges so the eight wires are even with one another and are slightly less than 12 inch past the end of the jacket If the wires are too long crosstalk (wire-to-wire interference) can result if the wires are too short they cannot make a good connection with the RJ-45 plug

8 With the clip side of the RJ-45 plug facing away from you push the cable into place Verify that the wires are arranged according to the EIATIA 568B standard before you crimp the plug onto the wires Adjust the connection as needed

9 Use the crimping tool to squeeze the RJ-45 plug onto the cable The end of the cable should be tight enough to resist being removed by hand10 Repeat steps 4-9 for the other end of the cable11 Label each cable with the following informationbull Wiring standardbull Lengthbull End with crossover (if any)bull _______________ (blank) for computer ID

ResultThus we have studied about the cable crimping in detailed

AimTo make a standard cabling for connecting a PC and Network device

with the help of unshielded twisted pair cableProcedure

1 Start with an approximately 1-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket

at each end of the cable3 Separate each pair of wires and put them in the correct order of

sequence according to the EIATIA specificationNote the TIA (Telecommunications Industry Association) and the EIA (Electronic Industries Association) began developing methods for cabling buildingswith the intent of developing a uniform wiring system that would

support multivendor products and environments In 1991 the TIAEIA released the TIAEIA568 Commercial Building Telecommunication Cabling standard

4 Trim the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 The connector should crimp each of the wires tightly and the connector should bind the outer jacket8 To make a complete cable repeat the steps above and add a connector to the other end of the cable9 The following figure can be representing the straight cabling

ResultThus we had made the standard cabling in unshielded twisted pair cable for the purposeof connecting PC and Network device

AimTo make a cross over cabling for connecting two PCrsquos with the help of unshielded twisted pair cable

Procedure1 Start with an approximately 2-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket at each end of the cable3 Separate each pair of wires on one end and put them in the correct order of sequence according to the EIATIA specification as shown in following table4 Snip the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point

6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 Each of the wires should be crimped tightly by the connector and the outer jacket should be bound by the connector8 On the end of the cable separate the wires and arrange them according to the EIATIA specification9 The following figure can be representing the cross over cabling method

ResultThus we had made the cross over cabling in unshielded twisted pair cable for the purpose of connecting two PCrsquos or two similar Network devices

Aim To connect three systems in a Local Area Network using bus topology

Requirements1048633 BNC Male Connector1048633 BNC terminator1048633 BNC T-Connector1048633 10 Base 2 Co-axial cable1048633 NIC with BNC Female ConnectorProcedure1 Install an appropriate NIC into your system2 Crimp the co axial cable with the BNC male connector3 Connect the BNC T-connector into a network interface card4 Connect one end of the T ndash Connector into the crimped BNC male connector and connect the other into a next T ndash Connector of another system5 And do the above for three systems6 Connect the terminator for both the starting and ending T ndash Connectors (ie) 1st and 3rd systems T - connectors7 Power on the system and do the followinga Open computer properties by right clicking my computer icon on the desktopb Select the Computer name tab and click change buttonc Now the system will shows the Computer name changes window

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 4: CNS lab

You will need the following tools and supplies to build your own Ethernet cables1 UTP cable (Category 5 or better)2 RJ-45 connectors3 Wire stripper4 RJ-45 crimping tool

Follow these steps for creating your own twisted-pair cables1 Determine how long your UTP cable should be Youll want to allow adequate slack for moving the computer and for avoiding strong interference sources Keep the maximum distances for UTP cables listed later in this chapter in mind2 Roll out the appropriate length of cable3 Cut the cable cleanly from the box of wire4 Use the wire stripper to strip the insulation jacket off the cable to expose the UTP wires

5 Check the outer jacket and inner UTP wires for nicks adjust the stripper tool and repeat steps 3 and 4 if you see damage6 Arrange the wires according to the EIA 568B standard listed earlier in EIATIA 568B UTP Standard

7 Trim the wire edges so the eight wires are even with one another and are slightly less than 12 inch past the end of the jacket If the wires are too long crosstalk (wire-to-wire interference) can result if the wires are too short they cannot make a good connection with the RJ-45 plug

8 With the clip side of the RJ-45 plug facing away from you push the cable into place Verify that the wires are arranged according to the EIATIA 568B standard before you crimp the plug onto the wires Adjust the connection as needed

9 Use the crimping tool to squeeze the RJ-45 plug onto the cable The end of the cable should be tight enough to resist being removed by hand10 Repeat steps 4-9 for the other end of the cable11 Label each cable with the following informationbull Wiring standardbull Lengthbull End with crossover (if any)bull _______________ (blank) for computer ID

ResultThus we have studied about the cable crimping in detailed

AimTo make a standard cabling for connecting a PC and Network device

with the help of unshielded twisted pair cableProcedure

1 Start with an approximately 1-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket

at each end of the cable3 Separate each pair of wires and put them in the correct order of

sequence according to the EIATIA specificationNote the TIA (Telecommunications Industry Association) and the EIA (Electronic Industries Association) began developing methods for cabling buildingswith the intent of developing a uniform wiring system that would

support multivendor products and environments In 1991 the TIAEIA released the TIAEIA568 Commercial Building Telecommunication Cabling standard

4 Trim the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 The connector should crimp each of the wires tightly and the connector should bind the outer jacket8 To make a complete cable repeat the steps above and add a connector to the other end of the cable9 The following figure can be representing the straight cabling

ResultThus we had made the standard cabling in unshielded twisted pair cable for the purposeof connecting PC and Network device

AimTo make a cross over cabling for connecting two PCrsquos with the help of unshielded twisted pair cable

Procedure1 Start with an approximately 2-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket at each end of the cable3 Separate each pair of wires on one end and put them in the correct order of sequence according to the EIATIA specification as shown in following table4 Snip the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point

6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 Each of the wires should be crimped tightly by the connector and the outer jacket should be bound by the connector8 On the end of the cable separate the wires and arrange them according to the EIATIA specification9 The following figure can be representing the cross over cabling method

ResultThus we had made the cross over cabling in unshielded twisted pair cable for the purpose of connecting two PCrsquos or two similar Network devices

Aim To connect three systems in a Local Area Network using bus topology

Requirements1048633 BNC Male Connector1048633 BNC terminator1048633 BNC T-Connector1048633 10 Base 2 Co-axial cable1048633 NIC with BNC Female ConnectorProcedure1 Install an appropriate NIC into your system2 Crimp the co axial cable with the BNC male connector3 Connect the BNC T-connector into a network interface card4 Connect one end of the T ndash Connector into the crimped BNC male connector and connect the other into a next T ndash Connector of another system5 And do the above for three systems6 Connect the terminator for both the starting and ending T ndash Connectors (ie) 1st and 3rd systems T - connectors7 Power on the system and do the followinga Open computer properties by right clicking my computer icon on the desktopb Select the Computer name tab and click change buttonc Now the system will shows the Computer name changes window

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 5: CNS lab

8 With the clip side of the RJ-45 plug facing away from you push the cable into place Verify that the wires are arranged according to the EIATIA 568B standard before you crimp the plug onto the wires Adjust the connection as needed

9 Use the crimping tool to squeeze the RJ-45 plug onto the cable The end of the cable should be tight enough to resist being removed by hand10 Repeat steps 4-9 for the other end of the cable11 Label each cable with the following informationbull Wiring standardbull Lengthbull End with crossover (if any)bull _______________ (blank) for computer ID

ResultThus we have studied about the cable crimping in detailed

AimTo make a standard cabling for connecting a PC and Network device

with the help of unshielded twisted pair cableProcedure

1 Start with an approximately 1-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket

at each end of the cable3 Separate each pair of wires and put them in the correct order of

sequence according to the EIATIA specificationNote the TIA (Telecommunications Industry Association) and the EIA (Electronic Industries Association) began developing methods for cabling buildingswith the intent of developing a uniform wiring system that would

support multivendor products and environments In 1991 the TIAEIA released the TIAEIA568 Commercial Building Telecommunication Cabling standard

4 Trim the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 The connector should crimp each of the wires tightly and the connector should bind the outer jacket8 To make a complete cable repeat the steps above and add a connector to the other end of the cable9 The following figure can be representing the straight cabling

ResultThus we had made the standard cabling in unshielded twisted pair cable for the purposeof connecting PC and Network device

AimTo make a cross over cabling for connecting two PCrsquos with the help of unshielded twisted pair cable

Procedure1 Start with an approximately 2-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket at each end of the cable3 Separate each pair of wires on one end and put them in the correct order of sequence according to the EIATIA specification as shown in following table4 Snip the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point

6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 Each of the wires should be crimped tightly by the connector and the outer jacket should be bound by the connector8 On the end of the cable separate the wires and arrange them according to the EIATIA specification9 The following figure can be representing the cross over cabling method

ResultThus we had made the cross over cabling in unshielded twisted pair cable for the purpose of connecting two PCrsquos or two similar Network devices

Aim To connect three systems in a Local Area Network using bus topology

Requirements1048633 BNC Male Connector1048633 BNC terminator1048633 BNC T-Connector1048633 10 Base 2 Co-axial cable1048633 NIC with BNC Female ConnectorProcedure1 Install an appropriate NIC into your system2 Crimp the co axial cable with the BNC male connector3 Connect the BNC T-connector into a network interface card4 Connect one end of the T ndash Connector into the crimped BNC male connector and connect the other into a next T ndash Connector of another system5 And do the above for three systems6 Connect the terminator for both the starting and ending T ndash Connectors (ie) 1st and 3rd systems T - connectors7 Power on the system and do the followinga Open computer properties by right clicking my computer icon on the desktopb Select the Computer name tab and click change buttonc Now the system will shows the Computer name changes window

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 6: CNS lab

support multivendor products and environments In 1991 the TIAEIA released the TIAEIA568 Commercial Building Telecommunication Cabling standard

4 Trim the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 The connector should crimp each of the wires tightly and the connector should bind the outer jacket8 To make a complete cable repeat the steps above and add a connector to the other end of the cable9 The following figure can be representing the straight cabling

ResultThus we had made the standard cabling in unshielded twisted pair cable for the purposeof connecting PC and Network device

AimTo make a cross over cabling for connecting two PCrsquos with the help of unshielded twisted pair cable

Procedure1 Start with an approximately 2-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket at each end of the cable3 Separate each pair of wires on one end and put them in the correct order of sequence according to the EIATIA specification as shown in following table4 Snip the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point

6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 Each of the wires should be crimped tightly by the connector and the outer jacket should be bound by the connector8 On the end of the cable separate the wires and arrange them according to the EIATIA specification9 The following figure can be representing the cross over cabling method

ResultThus we had made the cross over cabling in unshielded twisted pair cable for the purpose of connecting two PCrsquos or two similar Network devices

Aim To connect three systems in a Local Area Network using bus topology

Requirements1048633 BNC Male Connector1048633 BNC terminator1048633 BNC T-Connector1048633 10 Base 2 Co-axial cable1048633 NIC with BNC Female ConnectorProcedure1 Install an appropriate NIC into your system2 Crimp the co axial cable with the BNC male connector3 Connect the BNC T-connector into a network interface card4 Connect one end of the T ndash Connector into the crimped BNC male connector and connect the other into a next T ndash Connector of another system5 And do the above for three systems6 Connect the terminator for both the starting and ending T ndash Connectors (ie) 1st and 3rd systems T - connectors7 Power on the system and do the followinga Open computer properties by right clicking my computer icon on the desktopb Select the Computer name tab and click change buttonc Now the system will shows the Computer name changes window

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 7: CNS lab

AimTo make a cross over cabling for connecting two PCrsquos with the help of unshielded twisted pair cable

Procedure1 Start with an approximately 2-meter length of CAT5 UTP cable2 Using wire strippers remove about 3 cm of the outer insulating jacket at each end of the cable3 Separate each pair of wires on one end and put them in the correct order of sequence according to the EIATIA specification as shown in following table4 Snip the wires to about 15 cm from the outer insulating jacket5 With the hook side of the RJ45 connector facing down slide the wires all the way into the connector Push the outer insulating jacket into the connector just past the first crimping point

6 Place the RJ45 connector into the crimping tool Firmly pull the handle of the tool until the wires are crimped into place7 Each of the wires should be crimped tightly by the connector and the outer jacket should be bound by the connector8 On the end of the cable separate the wires and arrange them according to the EIATIA specification9 The following figure can be representing the cross over cabling method

ResultThus we had made the cross over cabling in unshielded twisted pair cable for the purpose of connecting two PCrsquos or two similar Network devices

Aim To connect three systems in a Local Area Network using bus topology

Requirements1048633 BNC Male Connector1048633 BNC terminator1048633 BNC T-Connector1048633 10 Base 2 Co-axial cable1048633 NIC with BNC Female ConnectorProcedure1 Install an appropriate NIC into your system2 Crimp the co axial cable with the BNC male connector3 Connect the BNC T-connector into a network interface card4 Connect one end of the T ndash Connector into the crimped BNC male connector and connect the other into a next T ndash Connector of another system5 And do the above for three systems6 Connect the terminator for both the starting and ending T ndash Connectors (ie) 1st and 3rd systems T - connectors7 Power on the system and do the followinga Open computer properties by right clicking my computer icon on the desktopb Select the Computer name tab and click change buttonc Now the system will shows the Computer name changes window

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 8: CNS lab

ResultThus we had made the cross over cabling in unshielded twisted pair cable for the purpose of connecting two PCrsquos or two similar Network devices

Aim To connect three systems in a Local Area Network using bus topology

Requirements1048633 BNC Male Connector1048633 BNC terminator1048633 BNC T-Connector1048633 10 Base 2 Co-axial cable1048633 NIC with BNC Female ConnectorProcedure1 Install an appropriate NIC into your system2 Crimp the co axial cable with the BNC male connector3 Connect the BNC T-connector into a network interface card4 Connect one end of the T ndash Connector into the crimped BNC male connector and connect the other into a next T ndash Connector of another system5 And do the above for three systems6 Connect the terminator for both the starting and ending T ndash Connectors (ie) 1st and 3rd systems T - connectors7 Power on the system and do the followinga Open computer properties by right clicking my computer icon on the desktopb Select the Computer name tab and click change buttonc Now the system will shows the Computer name changes window

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 9: CNS lab

d Give the computer name and the work group name in the respective text boxes and click oke Now the system will require rebooting the systemf The above steps will be done in the all three systemsg After restarting the computer open my network places and click view work group computers under the networks tasksh In here the window will contain the above mentioned systems icon with their shared documents8 Assign the IP address with the help of TCPIP properties from network connections

ResultThus the three systems are connected through bus topology

AimTo establish a peer to peer network connection using two systems in a LAN

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 10: CNS lab

Procedure1 To connect the two computers with the help of cross over cable2 Then assign the computer name and workgroup for both the computers3 The following steps are used to done the above problem a Open the Network Setup Wizard by clicking Start Accessories and Communications b Now the wizard will be opened c From the wizard click next

d Now you will select the connection method such as internet connection or other network connection Normally we are choosing ldquootherrdquo for local area connection And click next

e After the clicking of next the wizard will show the some other internet connections In here we should select the option as ldquothis computer belongs to the network but not have an internet connectionrdquo and clicknext

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 11: CNS lab

f In here we should give the Computer name and its description and click next

g Give the workgroup name and click next

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 12: CNS lab

h Now the wizard will show the options about File and Printer sharingand select whatever you want and click next

i Finally the wizard will display all the setting and ready to apply thatsettings Click next at now and the settings will be applied to the particularcomputer

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 13: CNS lab

j Finish the network setup wizard

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 14: CNS lab

k Now the windows will demand to the user for restarting the computer

4 In the other hand we can also use the following procedure for the above problema Right click my computer on the desktopb Select properties from the context menuc Now the properties window will be openedd Select Computer name tab from the same window and also select the change button belongs to the same tabe The new window will be opened now give the computer name and the workgroup name to the respective textboxes and click okf Now the windows will demand to the user for restarting a computer

5 After restarting the computer to assign the IP address for both the systems with the help of following procedurea Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area Connection

Double click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 15: CNS lab

f After double clicking you will find Internet Protocol (TCPIP) Properties

g At last click on OK and finished configuring the IP address6 Now the peer to peer communication has been established in two computersResultThus we have established the peer to peer connection between the two systems

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 16: CNS lab

AimTo installing a network with the help of network interface card and either switch orhub or router via guided media such as twisted pair cableProcedure1 Installing cablea Do the standard cabling and make the connection between computer and connectivity deviceb Insert the cable with the RJ45 connector into a respective port on the back panel of the computer

2 Installing a Huba Place the hub or switch in a centralized area of the network placeb Connect all the other end of the network cable into the respective ports in the hub or switchc Give the power supply to the connectivity device with the help of power adapterd After that the connectivity device LEDrsquos will glow for indicate the signal is receivede Normally the device drivers for the connectivity device will be automatically installed otherwise you should install the driver manually with the help of Add Hardware from control panel3 After installing a cable and the connectivity device we should do the following stepsa Clicking Start buttonb Choose All Programsc Choose Accessoriesd Choose Communicationse Click Network Setup Wizardf Follow the steps to be explained by the wizard and click finishg Restart the computerh After restarting the computer to assign the IP address for an individualsystemResultThus the PCrsquos are interfaced with the help connectivity device such as hub or switch

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 17: CNS lab

AimTo configure an IP address in system in a Local Area NetworkProcedureBy using ipconfig you can see the IP address of your PC in Windows XP This IP address is configured by any person If you want to use Internet you must have to configure IP address Moreover if you want to share some files or want to copy some files from other PC into your office or campus LAN you must have to configure the IP addressIP address can be configured by two ways They arebull Manual configurationbull Dynamic configurationManual ConfigurationIn manual configuration you have to assign all the IP address manually To configureIP address manually follow the following steps1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Window5 After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on it

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 18: CNS lab

6 After double clicking you will find Internet Protocol (TCPIP) Properties7 Now select Use the following IP address and put the IP address Subnet maskFor example my PC is connected to my campus LAN The IP may be192168131 Subnet mask may be 2552552550

8 At last click on OK and finished configuring the IP addressAfter doing all these steps check whether you successfully configured the IP address For this go to Start then click on Run type cmd and hit Enter Now a black window will be open and write ipconfig all and hit Enter Now check whether all the IP related information matches properly If not please correct them by configuring the above steps againDynamic configurationDynamic configuration is very easy to configure Remember dynamic configuration is only possible if you have a DHCP server If there is a DHCP server IP address can be configured dynamically by following the steps

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 19: CNS lab

1 Click on Start menu2 Now go to Control Panel3 From the control Panel go to Network Connections4 Double click on Local Area Connection and select Properties and then doubleclick on Internet Protocol (TCPIP)

5 Form the Internet Protocol (TCPIP) Properties window select Obtain an IP address automatically Later select Obtain DNS server address automatically

6 At last click on OK and finished configuring your computers IP addressResultThus the IP address was configured in a system in Local Area Network

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 20: CNS lab

AimTo configure DNS for establish the interconnection between the systemsProcedureServer side1 Choose start All Programs Administrative Tools Configure your server wizard

2 Click Next on the Welcome screen3 Make sure the listed prerequisites have been satisfied and click Next to continue To configure your Server Wizard will then perform a network test

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 21: CNS lab

4 Select the Domain Controller component and click Next

5 Verify that the Install Active Directory and Run configure an Active Directory Wizard to configure Active Directory options are selected and click Next

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 22: CNS lab

6 After Active Directory is installed you may be prompted for your Windows Server 2003 CD If so insert it and click OK when prompted7 The configuration of a DNS Server Wizard is then started automatically as illustrated in the following figure

8 On the Welcome screen for install Active Directory services Wizard click Next to continue9 Select Domain controller for a new domain and click Next

10 At this window select an option as Domain in a new forest for new domaincreation and click Next

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 23: CNS lab

11 Now the Active Directory wizard will require the complete DNS name and click Next For example shanmugha polylocal

12 At this point you will give the name for NetBIOS for your new domain The default name for the NetBIOS is domain name Click Next to continue

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 24: CNS lab

13 Now the active directory wizard will create the Database folder and the log folder The default folder names will be shown in the respective text boxes you can also change these names whatever you want

14 The next screen allows for the creation of a shared system volume for share the files through the DNS server to the connected clients

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 25: CNS lab

15 Now the wizard will diagnostics the DNS registration and displays the summery report And select the option as Install and Configure the DNS server on this computer To continue click next

16 Give the permission for network operating system compatible

17 In here the wizard will require the directory services restore administrator password for the DNS server

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 26: CNS lab

18 Again the wizard will shown the summary report for the DNS server configuration and click next

19 The next screen deals with the setup of DNS server through the Active directory

20 The final window shown in figure displays the Active Directory installation is completed In addition click Finish and the system will demand to reboot the computer21 After rebooting the following window will shown the following figure with the information is ldquoThis server is now the domain controllerrdquo

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 27: CNS lab

22 Click Finish to end the installation wizard and open the DNS Manager by clicking the Start Administrative Tools and click DNS In other hand select Manage your Server from the start menu and click Manage this DNS Sever on the window23 In the DNS manager right click the Reverse Lookup Zone and click New Zonehellip from the context menu

24 Click next on the Welcome to New Zone setup Wizard

25 In here you should select the type of the zone Usually we will select the zone type as Primary zone

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 28: CNS lab

26 Select the active directory zone replication scope

27 At this point we should enter the Network ID for the Reverse Lookup Zone as follows That is the first three octet of the domain IP address

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 29: CNS lab

28 Next you should give the option for dynamic updating of the DNS server Normally we will select allow only secure dynamic updates

29 Finally click finish to end the session

30 After that right click the mouse pointer on the working area of reverse look up zone subnet and select New Pointer from the context menu

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 30: CNS lab

31 The following window will be appeared and put the host IP number (ie the DNS server host number) and click Browse for include the host name and click OK

Client side1 If you are going to configuring your XP Professional system as a DNS client then you need to go to the Control Panel and double click the Network connections icon In other hand you may go to my network places from the start menu and right click it to open the network connections window2 From the network connections window right click the Local Area Connection icon and select properties from the appeared context menu3 Now the Local Area Connection Properties window will be appeared and select the Internet Protocol (TCPIP) from the list and double click on it Otherwise click Properties button after the selection of Internet Protocol

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 31: CNS lab

4 Now the Internet Protocol (TCPIP) Properties window will be appeared and click the radio button as Use the following IP address and type the IP address The subnet mask address will be assigned automatically5 In a next part you must click the option as Use the following DNS server address and type the DNS server address in the preferred DNS address text box

6 Finally click Ok to end the process and close the properties window7 Open the System Properties by right clicking my computer from the start menu8 Select Computer Name tab and Click Change button9 From the Computer changes window select the Domain radio button and type the domain name in the respective text box (Ex ldquomspvlpolylocalrdquo) and click ok10 Now the computer requests the user name and the password for the domain After type the requests the message box will be appeared with the text as ldquoWelcome to mspvlpolyrdquo and click ok Now the system is demand to restart your computer

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 32: CNS lab

11 After the system restarting you must enter into the system via domain name and the allocated user name with their respective passwordResultThus the DNS was configured in windows server 2003 and Windows XP Professionaland logon the system into the DNS server successfully

AimTo transfer a files between systems in Local Area Network using File Transfer Protocol ConfigurationProcedureServer SideInstall Internet Information Services and the FTP ServicesBecause FTP depends on Microsoft Internet Information Services IIS and FTP services must be installed on the computer To install IIS and FTP services follow these steps1 Click start point to control panel and then click Add or Remove Programs2 Click AddRemove windows components3 In the components list click Application Server click Internet Information Services (IIS) and then click Details4 Click to select the following check boxes(if they are not already selected)a Common Filesb File Transfer Protocol (FTP) service

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 33: CNS lab

c Internet Information Services Manager5 Click to select the check boxes next to any other IIS related service or subcomponent that you want to install and then click ok6 Click next7 When you are prompted insert the Windows server 2003 CD - ROM into the computers CD ndash ROM drive or provide a path to the location of the files and then click ok8 Click Finish9 Now the IIS and FTP services are installedConfigure the FTP services1 You must configure the FTP services before you can use it2 Start Internet Information Services Manager3 Expand Server name4 Right click Default FTP site and then click Properties5 Click the Security Accounts tab6 Click to select the Allow Anonymous Connections check box and then click to select the Allow only Anonymous Connections check box7 Click the Home Directory tab8 Click to select the Read and Log visits check boxes and then click to clear the Write check box9 Click Ok10 Quit Internet Information Services ManagerNote The default folder is drive InetpubFtprootClient Side1 Open command prompt with the help of Run from the Start menu2 In the command prompt type ftp Ex Cgtftp and hit Enter3 Now the command prompt will show the prompt as ftpgt4 In the ftp the following commands are used to execute the processa ftpgtopen IP address server computer nameexftpgtopen 192168501orftpgtopen murugamspvlnetlocalb ftpgtlsc ftpgtdir ndash These commands are used to view the list of directories are available in the default directoryd ftpgtget and ftpgtput ndash These command are used to respectively copy the file from the remote computer to working computer and copy the file from working computer to remote computere ftpgtquit ndash This command is used to exit from the ftp command promptf ftpgtclose IP address server computer name ndash This command is used to close the FTP connection between the remote computersResultThus the FTP connection was configured in the windows server 2003 and connects the systems remotely

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 34: CNS lab

AimTo connect a system remotely with the help telnet protocolProcedureServer Side1 Open command prompt by slicking Start menu and RunType the following command in the cgttlntadmn [remote server] [start][stop][pause][continue][-u user name -p password]2 Now the system will start as the telnet server In other hand we can start the telnet server from services in the Administrative tools3 Open service from the Administrative tools in the Start menu4 There are so many system services are list out In their select the Telnet and right click on it5 From the context menu click Start to enable the telnet servicesClient Side1 Click start open Run and type cmd2 The command prompt window will be appeared3 Type telnet and hit enter4 Now the prompt will be shown like this telnetgt5 On that prompt you must use the following commandsa Open server_name IP addressb Close server_name IP addressc Statusd Displaye helpf Quit6 The following command will be type for making connection between systems a telnetgtopen 192168501 or telnetgtmurugamspvlnetlocalb Now the system will demand the user name and passwordc After that it will be connected directly to the remote computerd In here you can use the primary DOS command for the data manipulatione The primary DOS commands arei mkdirii cdiii copy coniv typev renamevi del

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 35: CNS lab

f After finishing the process you must close the connection with the help of telnetgtclose server_name IP addressResultThus the system was connected remotely with the help of telnet protocol

AimTo install and configure a network interface card in a Local Area NetworkProcedure1 Installing NICa Shout down the PC and remove the power cable from the cabinetb Remove the outer cover of the cabinetc Insert the NIC firmly to seat in the respective slot in completelyd Screw the card and fit the cabinet and screw ite Plug the power supplyf Insert the network cable with the RJ45 connector into a respective portg Power on the computer and entering into the administrator desktoph Select Add Hardware from the control paneli And do the steps as follows in the add hardware wizard2 Assigning IP addressa Click on Start menub Now go to Control Panelc From the control Panel go to Network Connectionsd From the Network Connections window you will see Local Area ConnectionDouble click on that icon or click right mouse and go to the properties Now you will click the Properties from the Local Area Connection Status Windowe After clicking Properties options another Local Area Connection Properties window will be opened From the Local Area Connection Properties window selects Internet Protocol (TCPIP) and double clicks on itf After double clicking you will find Internet Protocol (TCPIP) Propertiesg Now select Use the following IP address and put the IP address Subnet mask For example my PC is connected to my campus LAN The IP may be 1921681010 Subnet mask may be 2552552550h At last click on OK and finished configuring the IP address3 Setting up Workgroup and Computer namea Select Properties from the right click of my computer on the Desktopb From the system properties window select Computer name tab and clickChange command button

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 36: CNS lab

c Now the Computer name changes window will be opened and select Workgroup option from the ldquoMember ofrdquo And give the computer name into the respective text boxd Click Ok and the message box will shown containing the text as Welcome to the -------------Workgroup and click oke Now the system will demand to restart your computerResultThus we had installed and configured a network interface card in Local Area Networks

AimTo share a file and printer in a local area networkProcedureFile Sharing In Server1 In windows server 2003 the default share folder is available The folder name issysvol2 This sysvol folder is available in the location of cwindowssysvol3 You can use this folder as a sharing point for the files That means you will copy and paste the file or folder in this folder and use in the other client systems using My Network Places from the Start menu4 In other hand we can also use the following method for file sharing

a Right click the folder whatever you want to share on a networkb Select properties from the context menuc Select sharing tab from the folder property window

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 37: CNS lab

d Check share this folder on network under network sharing and security option and give the share name if you are needed

e Click ok and the folder will be appeared with the shared hand symbolPrinter sharing1 Open Printer and Faxes by clicking Start menu and Control panel And click Add Printer icon the new window

2 Click next on the welcome screen of the add printer wizard

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 38: CNS lab

3 Now the wizard needs to know which type of the printer you are going to set up If you are going add a printer in server then select the option as Local Printer attached to this computer

4 Then select the type of the port for establish the connection between the system and printer

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 39: CNS lab

5 At this point you must give the diver software for the printer Normally the windows having the most of the printer driver from the popular manufacturer If your printer driver is not available the list then you should click the button as Have Diskhellip

6 Select the location of the driver with the help of Browse button select the location and click ok to continue

7 Give the name for the printer and click next

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 40: CNS lab

8 In here the printer sharing option will be given If your printer will be installed in server and use as a network printer then select Share and give the share name

9 In here you must give the location of the printer The location means where is the printer is placed And click next

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 41: CNS lab

10 Now the test page is required This will be used to identify the printer is working properly Select Yes and click next to continue

11 Finally the wizard will display the summery of the printer installation and click finish to close the wizard

ResultThus the file and printer was shared in a local area network

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 42: CNS lab

AimTo establish a security in a system using firewall configurationProcedure1 You can configure a firewall settings in two waysa Using Control Panelb Using Group Policy2 Using Control Panela Open control panel by clicking Start menub Double Click the Windows Firewall to open

c In a General Tab we can do only on off the firewall settingsd The Exceptions tab is used block the incoming programs except the listed programs under the exceptions tab If you want to block the particular program then clear the check box in front of the particular program

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 43: CNS lab

e You can also add the program and port number for blocking the incoming data in a networkf The next tab is Advanced Under the advanced tab there are four parts are available They are Network Connection Settings Security Logging ICMP and Default Settings

3 Using Group Policya From the Windows XP desktop click Start click Run type mmc and then click OK

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 44: CNS lab

b On the File menu click AddRemove Snap-in

c On the Standalone tab click Add

d In the Available Standalone Snap-ins list click Group Policy Object Editor and then click Add

e In the above window select Group Policy Object Editor and then Click Addf Click Finish to complete the Group Policy Wizard

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 45: CNS lab

g In the Add Standalone Snap-in dialog box click Closeh In the AddRemove Snap-in dialog box click OK

i In the console tree open Computer Configuration Administrative Templates Network Network Connections and then Windows Firewall

ResultThus the firewall was configured in a system

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 46: CNS lab

AimTo create and share a user rights by accessing a server for a specific user groupsProcedure1 First you must install gpmcmsi into your server2 Now open Group Policy Management by clicking Start menu and Administrative Tools3 Expand the list from the polylocal and right click on Group Policy Objects4 From the context menu select the option as New

5 The following figure will be shown and give the name for new GPO

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 47: CNS lab

6 Now the new Group Policy Object was added into the list and gives the user name for setting a user rights with the help of Add button under the tab asScope

7 In here select the New GPO and right click on it and also select Edit from the context menu

8 Now the system will shown the Group Policy Object Editor window

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 48: CNS lab

9 This window can be used to assigning rights for a particular user and user groups And close the editor window

10 Return back to the Group Policy Management window and delete the default domain policy under the polylocal

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 49: CNS lab

11 Select polylocal and right click on it Now select the option as Link an Existing GPO and select the GPO as whatever you have created newly from the opened window12 Now right click on the added GPO under the polylocal and select Enforced from the context menuResultThus the user rights were assigned in the server for a specific user groups

AimTo configuring a DHCP server in windows server 2003 with IP address ranging from19216811 to 1921681100Procedure1 Before you are going to configuring a DHCP server you must add the DHCP server role with the help of Manage Your Server wizard2 After that open DHCP from Administrative tools on the Start menu3 From the DHCP management window right click on the domain name and select New Scope from the context menu

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 50: CNS lab

4 From the new scope welcome wizard click next to continue

5 In here give the name for Scope and their description and Click next

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 51: CNS lab

6 At this point you must give the starting and ending IP address for the purpose of distributing to the clients and the Length and Subnet mask address will be assigned automatically

7 In here you must give the IP address ranges for the exclusions These excluded IP addresses are used for the servers and other components Click Add and Next to continue

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 52: CNS lab

8 The lease duration value is used to specify the scope duration of IP address assigned by a DHCP is available for a particular client

9 The wizard will ask the confirmation for the DHCP configuration You must select the option as Yes and Click Next

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 53: CNS lab

10 The scope wizard is also required the Default gateway address for server and client communication to distributing this scope leases Normally you must give the server IP address for default gateway

11 Now the scope wizard will require the domain name and server name for applying a DHCP server scope to a particular DNS

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 54: CNS lab

12 In here you must give the WINS server name for the purpose of NetBIOS processing The WINS server name is the same as the DNS server name and gives the respective IP address

13 At this point the scope wizard will demand the option as whenever you are going to activate this scope configuration

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 55: CNS lab

14 At finally Click Finish to complete the New Scope Wizard

15 Now the DHCP was configured and ready to assigning as IP address to the clients on a network

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 56: CNS lab

ResultThus the DHCP was configured in the Windows Server 2003 with the IP address ranges from 19216811 to 1921681100

AimTo configuring a client for access a DHCP sever on a local area networkProcedure1 Open Network Connections from the Control Panel on the Start menu

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 57: CNS lab

2 Right click on a Local Area Connection icon and select Properties Now the Local area connection properties window will be appeared

3 Select Internet Protocol (TCPIP) and click Properties button

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 58: CNS lab

4 Now the Internet Protocol (TCPIP) properties window will appear and select the option as Obtain IP address automatically and also select Obtain DNS server address automatically and click OkResultThus the DHCP client was configured and accesses the DHCP server

AimTo transfer a file between two systems using wireless communicationHardware Requirement1048633 Wireless Adapter1048633 Wireless Router1048633 Resource CD (Router)Procedure1 Insert the wireless adapter into the USB port on both systems2 Give the power supply for wireless router3 Now the wireless adapter require the driver from the user4 Now you must restart your system5 Create the workgroup and IP address as per the procedure6 Open Wireless Network Connection Properties from the Network connection window

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 59: CNS lab

7 Choose Wireless Networks tab and check the option as Use Windows to configure my wireless network settings then click Ok8 Now you can access your remote computer with the help of wireless networkResultThus the Wireless connection was established successfully

AimTo configuring a mail server in windows server 2003 and access the mail through outlook express from clientsProcedureServer Side1 Open Manage Your Server from the Start menu and Click Add Remove Role from the window2 Before you configure your mail server the installation wizard will ask the preliminary requirements for the installation

3 Now the wizard will show the list of server roles and select Mail Server (POP3SMTP) from the list and Click Next

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 60: CNS lab

4 In here you must enroll the authentication method for the client interaction to the mail server and give the domain name for a mail server and click next

5 At this point the wizard will show the summary report of the installation and click next to continue

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 61: CNS lab

6 Now the wizard is going to installing the POP3 services and other configuration of the mail server

7 During the time of installation the wizard will require the windows server 2003 CD In here we must select the path of the location Finally click Finish to complete the installation

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 62: CNS lab

8 After completing the mail server installation you must add the mail box in the mail server domain9 For adding the mail box in the mail server you must open the POP3 services from the Administrative Tools10 In the POP3 Services window right click the mail server domain name and select Mailbox under the New menu

11 Now the add mail box window will be appeared and enroll the mailbox nameIf you want to add your mail box name to the user group then check the Create associated user for this mail box and provide the password for the particular user and click Ok

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 63: CNS lab

12 Now your new mail box will be added into your mail server domain

Client Side1 Open Microsoft Office Outlook from the Start menu The following welcome screen wizard will appear and Click next to continue

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 64: CNS lab

2 At this point click yes to configure your outlook for the purpose of e-mailmessage transfer And Click next

3 Here type your name email address with your mail server domain name respective passwords These all are informationrsquos are given by your internet service except your name And also check the check box Manually configure Server Settings or Additional Server types and Click next

4 Select Internet E ndash Mail for mail exchange and click next

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 65: CNS lab

5 At this point give the details of User information server information and Logon information And click Test Account Testing button on the left side of the wizard

6 If your information is correct then the test page will shown like this And close to continue

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 66: CNS lab

7 Now the outlook express was configured successfully and Click Finish

8 After that the following account will be shown If you want to send an e-mail to the other user then click New from the Tool box Fill the To address and subject and type the content of the e-mail and click send9 Now the message will be sent to another address and open the other account and view the received message from the InboxResultThus the mail server was configured and sent the mail through Microsoft office outlook express

AimTo write a C Program that takes a binary file as input and finds error check using CRCAlgorithm1 Start the Program and includes the header files2 Initialize the CRC table in an array3 Define the error checking mechanism function4 Get the input file from the user and Open it5 Check the input file with the help of checking function6 Display the Errors if found7 Terminate the ProgramProgramincludeltstdiohgt

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 67: CNS lab

includeltstdlibhgtincludeltcrctablehgtstatic unsigned short crc_table[256]unsigned short CRCCCITT(unsigned char datasize_t lengthunsigned short seedunsigned short final)size_t countunsigned int crc=seedunsigned int tempfor(count=0countltlength++count)temp=(data++ ^ (crcgtgt8)) amp0xffcrc=crc_table[temp] ^(crcltlt8)return(unsigned short)(crc ^ final)define TEST_SIZE 256int main(int argc char argv)FILE finsize_t how_manyunsigned short the_crcunsigned char buff[TEST_SIZE + 2]int ifor(i=0ilt256i++)crc_table[i]=read_table ()if(argclt2)puts(ldquousage crcccitt filenamerdquo)return EXIT_FAILUREelse if(NULL==(fin=fopen(argv[1] ldquorbrdquo)))printf(ldquocrcccitt canrsquot open snrdquo argv[1])return EXIT_FAILUREhow_many=fread(buff 1 TEST_SIZE fin)fclose(fin)if(how_many =TEST_SIZE)printf(ldquocrcccitt error reading s nrdquoargv[1])return EXIT_FAILURE

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 68: CNS lab

the_crc=CRCCCITT(buff TEST_SIZE 0xffff 0)printf(ldquoInitial CRC value is 0x04xnrdquo the_crc)buff[TEST_SIZE]=(unsigned char)((the_crcgtgt8)amp 0xff)buff[TEST_SIZE+1]=(unsigned char)(the_crc amp 0xff)the_crc=CRCCCITT(buff TEST_SIZE + 2 0xffff 0)printf(ldquoFinal CRC value is ox04xnrdquothe_crc)return EXIT_SUCCESSOutput[rootlocalhost]cc ndasho crcout crcc[rootlocalhost]crcout sampleexeInitial CRC value is 0Xf30cFinal CRC value is 0X0000ResultThus the above program was executed and the error checking of the binary file in asuccessful manner

AimTo write a client C program for download a file from the HTTP serverAlgorithm1 Start the Program2 Declare the necessary variables3 Create the structure for the server socket with the port of the host for communication4 After creating the server socket the client initiates the communication5 Create the socket with the specified host and port6 Client is then connected with server7 After getting the source filename and destination file name send the messageto the server8 Finally the process is terminatedProgramServercincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgt

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 69: CNS lab

includeltsyssockethgtint main( )int sd nsd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquostruct sockaddr_in ser cliFILE fpif((sd=socket(AF_INET SOCK_STREAMIPPROTO_TCP))==-1printf(ldquon Error in Socket Creation Problem check the parametersnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port Address is drdquo port)sersin_family=AF_INETsersin_port=htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(bind(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error Binding Problem Port BusyndashPlease change port addressnrdquo)return 0i=sizeof(cli)listen(sd 1)printf(ldquoServer Modulenrdquo)printf(ldquonrdquo)nsd=accept(sd (struct sockaddr)ampcli ampi)if(nsd==-1)printf(ldquon Error Client Accepting Problemnrdquo)return 0printf(ldquoClient acceptedrdquo)i=recv(nsd fname 300)fname[i]=rsquo0rsquofp=fopen(fnamerdquorbrdquo)while(1)i=fread(ampcontent130fp)content[i]=rsquo0rsquosend(nsdcontent300)strcpy(content ldquo0rdquo)if(ilt30)breaksend(nsd ldquoEOFrdquo 40)printf(ldquoFile transferred to destinationrdquo)

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 70: CNS lab

fclose(fp)close(sd)close(nsd)return 0Clientcincludeltstdiohgtincludeltunistdhgtincludeltsystypeshgtincludeltnetinetinhgtincludeltstringhgtincludeltsyssockethgtincludeltarpainethgtvoid main( )int sd i port=3000char content[30]=rdquo0rdquo fname[30]=rdquo0rdquo file[30]=rdquo0rdquostruct sockaddr_in serFILE fpif((sd=socket(AF_INET SOCK_STREAM IPPROTO_TCP))==-1)printf(ldquon Error socket creation problemnrdquo)return 0bzero((char )ampser sizeof(ser))printf(ldquon Port address is drdquo port)sersin_family=AF_INETsersin_port =htons(port)sersin_addrs_addr=htonl(INADDR_ANY)if(connect(sd (struct sockaddr)ampser sizeof(ser))==-1)printf(ldquon Error canrsquot connect to servernrdquo)return 0printf(ldquon Client module ask the server to transfer a filenrdquo)printf(ldquon Enter the path name of source filenrdquo)scanf(ldquosrdquo fname)printf(ldquon Enter the path name of destination filenrdquo)scanf(ldquosrdquo file)send(sdfname300)fp=fopen(file ldquowbrdquo)while(1)i=recv(sdcontent300)content[i]=rsquo0rsquoif(strcmp(contentrdquoEOFrdquo))break

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 71: CNS lab

fwrite(ampcontent strlen(content)1fp)strcpy(contentrdquo0rdquo)printf(ldquon File Receivednrdquo)fclose(fp)close(sd)return 0

OutputServerc[rootlocalhost]cc tcpserverc[rootlocalhost] aoutPort address is 3000Server ModuleClient accepted File transferred to destinationClientc[rootlocalhost]cc tcpclientc[rootlocalhost] aoutPort address is 3000This is the client module and this module ask the server to transfer a fileEnter the path name of source fileacEnter the path name of destination filedcFile receivedResultThus the above program was executed and the file was downloaded from a server in asuccessful manner

AimTo write a C program to simulate sliding window protocolAlgorithm1 Start the Program2 Specify the necessary variables

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 72: CNS lab

3 Sliding window is only an imaginary window The size of the window is declared4 The client is sending one bit and the receiver is received5 The same procedure is repeated6 If any acknowledgement received means the sliding window refreshed by n-17 The same procedure was continued8 Finally the program is terminatedProgramUDP Server Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtdefine MYPORT 3000 the port users will be connecting todefine MAXBUFLEN 100int main(void)int isockfdnstruct sockaddr_in my_addr my address informationstruct sockaddr_in their_addr connectorrsquos address informationsocklen_t addr_lenint numbyteschar buf[MAXBUFLEN]if((sockfd=socket(PF_INETSOCK_DGRAM0)) == -1)perror(ldquosocketrdquo)exit(1)my_addrsin_family=AF_INET host byte ordermy_addrsin_port=htons(MYPORT) short network byte ordermy_addrsin_addrs_addr=INADDR_ANY automatically fill with my IPmemset(amp(my_addrsin_zero)rsquo0rsquo8) zero the rest of the structif(bind(sockfd(struct sockaddr)ampmy_addrsizeof(struct sockaddr)) == -1)perror(ldquobindrdquo)exit(1)i=0printf(ldquoEnter the frames to sendrdquo)scanf(ldquodrdquoampn)while(iltn)

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 73: CNS lab

addr_len=sizeof(struct sockaddr)if((numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0(struct sockaddr)amptheir_addr ampaddr_len))==-1)perror(ldquorecvfromrdquo)exit(1)if(numbytes==0)sendto(sockfd ldquoNot Sentrdquo 15 0 (struct sockaddr)amptheir_addrsizeof(struct sockaddr))elsesendto(sockfd ldquo1rdquo 25 0 (struct sockaddr)amptheir_addr sizeof(struct sockaddr))printf(ldquoPacket fromtsnrdquoinet_ntoa(their_addrsin_addr))printf(ldquoSizettd bytesnrdquonumbytes)buf[numbytes]=rsquo0rsquoprintf(ldquoDatattsnnrdquobuf)i++strcpy(bufrdquo0rdquo)end whileclose(sockfd)return 0

UDP Client Programincludeltstdiohgtincludeltstdlibhgtincludeltunistdhgtincludelterrnohgtincludeltstringhgtincludeltsystypeshgtincludeltsyssockethgtincludeltnetinetinhgtincludeltarpainethgtincludeltnetdbhgtdefine SERVERPORT 3000define MAXBUFLEN 100int main(int argc char argv[])int sockfdinchar data[5][30]char buf[MAXBUFLEN]

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 74: CNS lab

struct sockaddr_in their_addrstruct hostent heint numbytessocklen_t addr_lenif(argc=2)fprintf(stderrrdquousagetalker hostname messagenrdquo)exit(1)if((he=gethostbyname(argv[1]))==NULL)perror(ldquogethostbynamerdquo)exit(1)if((sockfd=socket(AF_INETSOCK_DGRAM0))==-1)perror(ldquosocketrdquo)exit(1)their_addrsin_family=AF_INETtheir_addrsin_port=htons(SERVERPORT)their_addrsin_addr=((struct in_addr)he_addr)memset(amp(their_addrsin_zero)rsquo0rsquo8)printf(ldquoEnter the number of frames to sendrdquo)scanf(ldquodrdquoampn)for(i=0iltni++)printf(ldquoEnter the d datardquoi)scanf(ldquosrdquodata[i])i=0while(iltn)if((numbytes=sendto(sockfd data[i] 30 0(struct sockaddr)amptheir_addr sizeof(struct sockaddr)))==-1)addr_len=sizeof(struct sockaddr)exit(1)addr_len=sizeof(struct sockaddr)numbytes=recvfrom(sockfd buf MAXBUFLEN-1 0 (struct sockaddr)amptheir_addr ampaddr_len)printf(ldquoAcknowledgement Received for framedsnrdquoibuf)if(strcmp(bufrdquo1rdquo)==0)i++

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed

Page 75: CNS lab

close(sockfd)return 0OUTPUTServer Side[rootlocalhost]cc sliserc[rootlocalhost]aoutEnter the frames to send3Packet from 19816211Size 30 bytesData ThisPacket from 19816211Size 30 bytesData isPacket from 19816211Size 30 bytesData SlidingPacket from 19816211Size 30 bytesData WindowProtocolClient Side[rootlocalhost]cc sliclic[rootlocalhost]aout 19216811Enter the number of frames to send 4Enter the 0 data ThisEnter the 1 data isEnter the 2 data SlidingEnter the 3 data WindowProtocolAcknowledgement Received for frame 0 1Acknowledgement Received for frame 1 1Acknowledgement Received for frame 2 1Acknowledgement Received for frame 3 1ResultThus the sliding window protocol program was written and executed


Recommended