computer network i lab manual.pdf · defining network geometry: the physical topology and the...

45
1 Jawaharlal Nehru Engineering College Laboratory Manual COMPUTER NETWORK I For Second year Students 20, Feb 2005 ISO 9000 Tech Document Author JNEC, Aurangabad

Upload: others

Post on 11-Aug-2020

5 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

1

Jawaharlal Nehru Engineering College

Laboratory Manual

COMPUTER NETWORK I

For

Second year Students

20, Feb 2005 – ISO 9000 Tech Document Author JNEC, Aurangabad

Page 2: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

2

FORWARD

It is my great pleasure to present this laboratory manual for final year engineering students for the subject of COMPUTER NETWORK I keeping in

view the vast coverage required for Computer network.

As a student, many of you may be wondering with some of the questions in

your mind regarding the subject and exactly what has been tried is to

answer through this manual.

As you may be aware that MGM has already been awarded with ISO

9000 certification and it is our endure to technically equip our students

taking the advantage of the procedural aspects of ISO 9000

Certification.

Faculty members are also advised that covering these aspects in initial stage itself, will greatly relived them in future as much of the load will be taken care

by the enthusiasm energies of the students once they are conceptually clear.

Prof.

S.D.Deshmukh.

Principal

Page 3: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

3

Vision of JNEC

College seeks to be the engineering college of choice in Maharashtra that can provide

the best learning experience, the most productive learning community, and the most

creative learning environment in Engineering Education and will be recognized as one of

the best Engineering Colleges in India.

Mission of JNEC

To develop innovative engineers with human values, well equipped to solve complex

technical problems, address the needs of modern society and pursue lifelong learning,

by providing them competent, caring and committed faculty.

IT Vision:

IT department is committed to ensure the quality education to students’ by providing

innovative resources & continuous up-gradation of the department. To achieve “Heights

of Excellence” in the world we strive to organize regular interaction with Industry and

Alumni.

IT Mission:

To impart core technical competency & knowledge in students through curriculum and

certification programs to fulfill the industry requirements which ultimately benefits

society at large.

Program Educational Objectives:

Preparation: To prepare students to excel in PG program or to succeed in Industry /Technical

profession through global, rigorous education.

I. Core Competence: To provide students with a solid foundation in mathematical, scientific and engineering fundamentals required to solve engineering problems and also to pursue higher studies.

II. Breadth: To train students with good scientific and engineering breadth so as to comprehend, analyze, design and create novel product and solution for the real life problems.

III. Professionalism: To inculcate in students’ professional and ethical attitude, effective communication skills, team work skills, multi-disciplinary approach and an ability to relate engineering issues to broader social context.

IV. Learning Environment: To provide students with academic environment aware of excellence, leadership, written ethical codes and guidelines and lifelong learning needed for successful professional career.

Page 4: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

4

LIST OF EXPERIMENTS:

1. Study of Data Communication and Networking. Identify five components of Data

communication system.

2. Study of computer network topology and OSI model layered architecture.

3. Installation of TC/IP protocol configuration and study the classification of addresses

employing TCP/IP protocols.

4. Write a C program to determine if the IP address is in Class A, B, C, D, or E.

5. Write a C program to translate dotted decimal IP address into 32 bit address.

6. Study of basic network commands: ipconfig, hostname, ping <ip_address>, tracert

<ip_address>, netstat<ip_address> etc..

7. To establish a straight over and a cross over cable in LAN

8. Study of multiplexing and switching.

9. Write a C program to generate Hamming code.

10. Study of IEEE 802.11 wireless standard

Page 5: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

5

EXPERIMENT NO. 1

AIM: STUDY OF DATA COMMUNICATION AND NETWORKING. IDENTIFY FIVE

COMPONENTS OF DATA COMMUNICATION SYSTEM.

THEORY:

Introduction:

Data communication is the moving or transferring of data between two electronic devices

using a transmission medium of some kind. Data Communication is a system consisting of

carries and related devices used to transport data from one point to another.

Communication means to convey a message, an idea, a picture or speech that is

received and understood clearly and correctly by the person for whom it is conveyed. Data

communication has five basic components: the message, the sender, the receiver, the medium

and the protocol.

Communication Systems:

A Communication system is the combination of hardware, software and data transfer

links that make up a communication facility for transferring data in a cost effective

Page 6: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

6

and efficient manner. A communication system itself can be either analog or digital. The

technique by which a digital signal is converted to its analog form is known as Modulation

The reverse process i.e. conversion of analog signal to digital signal is known as

Demodulation. These processes of conversions carried out by a special device called

Modem

Components of Data Communications:

Message

In a data communication system, the message is the information sent out through the

system. The message may include numbers, words, photos, other graphics, sounds, video

or a combination of any of these. Messages in a data communication system are put

together in analog or digital form and broken into groups or segments of data called

packets. Each packet has a payload -- the actual data being sent -- and a header --

information about the type of data in the payload, where it came from , where it is going,

and how it should be reassembled so the message is clear and in order when it arrives at

the destination.

Sender

The sender in a data communication sequence is the device that generates the messages.

Sometimes these devices are called sources or transmitters instead of senders. Some

sending devices are desktop and laptop computers, netbooks, smartphones, video

cameras, workstations, telephones, fax machines and tablets. Television stations, radio

stations, short wave radios and walkie talkies are also considered senders -- or

transmitters -- in a data communication system.

Receiver

The receiver is the device on the other end of the data communication transmission that

gets the message and reassembles it. Many of the same devices that function as receivers

Page 7: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

7

also function as senders, such as computers, smart phones and telephone handsets. Some,

however, are only receivers, such as radios, printers, or televisions.

Medium

The medium is the means by which the message travels from the sender to the receiver.

In a data communication system this includes the wire, twisted wire, local area network

(LAN) cable, fiber optic cable, microwave signal, satellite signal or any other

transmission medium used in a network. A point to point connection is comprised of only

two devices connected by a dedicated medium. On the other hand, multiple devices may

be connected through mediums into networks. The Internet is a collection of many

different networks creating a distributed network. Other networks include LANs,

Metropolitan Area Networks (MANs) and Wide Area Networks (WANs).

Protocol

A protocol is a set of rules that guides how data communication is carried out. Every

device that wants to communicate with each other must use the same protocol in order to

exchange messages. Every device on the Internet, for example, uses the TCP/IP protocol.

AppleTalk is another protocol. The keys to protocol are syntax, semantics and timing. All

the rules and standards are necessary so that devices manufactured by many different

companies can still communicate with each other.

Computer network:

A computer network, or simply a network, is a collection of computers and other

hardware components interconnected by communication channels that allow sharing of resources

and information. Where at least one process in one device is able to send/receive data to/from at

least one process residing in a remote device, then the two devices are said to be in a network.

Simply, more than one computer interconnected through a communication medium for

information interchange is called a computer network.

Page 8: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

8

Networks may be classified according to a wide variety of characteristics, such as the medium

used to transport the data, communications protocol used, scale, topology, benefit, and

organizational scope.

Classification of Computer Network :

Judging from the geographical range covered by a network, usually divided into three types,

LAN, MAN, and WAN.

Local Area Network (LAN)

LAN is a computer network that covers an area in one room, one building, or several adjacent

buildings. For example, the network in a single integrated campus or at a company location is

classified as a LAN. LAN transmission media generally use a cable (UTP, coaxial cable, or fiber

optics). But some are not using a cable and is referred to as Wireless LAN (WLAN). LAN

speeds ranging from 10 Mbps to 1 Gbps.

According to the LAN type can be either a client / server (network model that has a client and

server) or peer-to-peer (network model that gives equal footing to all computers).

Metropolitan Area Network (MAN)

Page 9: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

9

MAN is a network that covers an area of one town or with a range of about 10-45 km. Network

connecting several banks located in one city or campus that is spread in several locations

classified as a MAN. Such networks generally use transmission media by micro waves or radio

waves. But there also are using leased lines (leased line).

Wide Area Network(WAN)

Network which includes inter-city, inter-provincial, inter-state, and even between continents

called the WAN. Example of a WAN is a network that connects the ATM (Automatic Teller

Machine). Another example is the internet.

CONCLUSION: In this experiment we studied simple data communication model along with

components, also seen computer network and different types of computer networks.

Page 10: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

10

EXPERIMENT NO. 2

AIM: STUDY OF COMPUTER NETWORK TOPOLOGY AND OSI MODEL LAYERED

ARCHITECTURE.

THEORY:

Network Topology:

In communication networks, a topology is a usually schematic description of the

arrangement of a network, including its nodes and connecting lines. There are two ways of

defining network geometry: the physical topology and the logical (or signal) topology.

The physical topology of a network is the actual geometric layout of workstations. There are

several common physical topologies, as described below and as shown in the illustration.

Bus Network

In the bus network topology, every workstation is connected to a main cable called the bus.

Therefore, in effect, each workstation is directly connected to every other workstation in the

network.

Page 11: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

11

Advantages

Easy to implement and extend

Well suited for temporary networks (quick setup)

Initially less expensive than other topologies

Cheap

Disadvantages

Difficult to administer/troubleshoot.

Limited cable length and number of stations.

If there is a problem with the cable, the entire network goes down.

Maintenance costs may be higher in the long run.

Performance degrades as additional computers are added or on heavy traffic.

Low security (all computers on the bus can see all data transmissions).

One virus in the network will affect all of them (but not as badly as a star or ring

network).

Proper termination is required.(loop must be in closed path).

If one node fails, the whole network will shut down.

If many computers are attached, the amount of data flowing causes the network to slow

down.

Ring Network

Page 12: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

12

In the ring network topology, the workstations are connected in a closed loop configuration.

Adjacent pairs of workstations are directly connected. Other pairs of workstations are indirectly

connected, the data passing through one or more intermediate nodes.

Advantages

Data is quickly transferred without a „bottle neck‟. (very fast, all data traffic is in the

same direction)

The transmission of data is relatively simple as packets travel in one direction only.

Adding additional nodes has very little impact on bandwidth

It prevents network collisions because of the media access method or architecture

required.

Disadvantages

Data packets must pass through every computer between the sender and recipient

therefore this makes it slower.

If any of the nodes fail then the ring is broken and data cannot be transmitted

successfully.

It is difficult to troubleshoot the ring.

Because all stations are wired together, to add a station you must shut down the network

temporarily.

In order for all computers to communicate with each other, all computers must be turned

on.

Total dependence upon the one cable

Star Network

Page 13: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

13

In the star network topology, there is a central computer or server to which all the workstations

are directly connected. Every workstation is indirectly connected to every other through the

central computer.

Advantages

Good performance

Easy to set up and to expand. Any non-centralized failure will have very little effect on

the network, whereas on a ring network it would all fail with one fault

Disadvantages

Expensive to install

Extra hardware required

Mesh Topology

In a mesh network topology, each of the network node, computer and other devices, are

interconnected with one another. Every node not only sends its own signals but also relays data

from other nodes. In fact a true mesh topology is the one where every node is connected to every

other node in the network. This type of topology is very expensive as there are many redundant

connections, thus it is not mostly used in computer networks. It is commonly used in wireless

networks. Flooding or routing technique is used in mesh topology.

Page 14: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

14

Advantages

Data can be transmitted from different devices simultaneously. This topology can

withstand high traffic.

Even if one of the components fails there is always an alternative present. So data transfer

doesn‟t get affected.

Expansion and modification in topology can be done without disrupting other nodes.

Disadvantages

There are high chances of redundancy in many of the network connections.

Overall cost of this network is way too high as compared to other network topologies.

Set-up and maintenance of this topology is very difficult. Even administration of the

network is tough.

OSI MODEL

Open Systems Interconnection (OSI) model is a reference model developed by ISO

(International Organization for Standardization) in 1984, as a conceptual framework of standards

for communication in the network across different equipment and applications by different

vendors. It is now considered the primary architectural model for inter-computing and

internetworking communications. Most of the network communication protocols used today

have a structure based on the OSI model. The OSI model defines the communications process

into 7 layers, which divides the tasks involved with moving information between networked

computers into seven smaller, more manageable task groups. A task or group of tasks is then

assigned to each of the seven OSI layers. Each layer is reasonably self-contained so that the tasks

assigned to each layer can be implemented independently. This enables the solutions offered by

one layer to be updated without adversely affecting the other layers.

The seven layers of the OSI model can be divided into two groups: upper layers (layers 7,

6 & 5) and lower layers (layers 4, 3, 2, 1). The upper layers of the OSI model deal with

application issues and generally are implemented only in software. The highest layer, the

Page 15: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

15

application layer, is closest to the end user. The lower layers of the OSI model handle data

transport issues. The physical layer and the data link layer are implemented in hardware and

software. The lowest layer, the physical layer, is closest to the physical network medium (the

wires, for example) and is responsible for placing data on the medium.

The specific description for each layer is as follows:

Layer 7: Application Layer

Defines interface to user processes for communication and data transfer in network

Provides standardized services such as virtual terminal, file and job transfer and operations

Layer 6: Presentation Layer

Masks the differences of data formats between dissimilar systems

Specifies architecture-independent data transfer format

Encodes and decodes data; Encrypts and decrypts data; Compresses and decompresses data

Page 16: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

16

Layer 5:Session Layer

Manages user sessions and dialogues

Controls establishment and termination of logic links between users

Reports upper layer errors

Layer 4:Transport Layer

Manages end-to-end message delivery in network

Provides reliable and sequential packet delivery through error recovery and flow control

mechanisms

Provides connectionless oriented packet delivery

Layer 3:Network Layer

Determines how data are transferred between network devices

Routes packets according to unique network device addresses

Provides flow and congestion control to prevent network resource depletion

Layer 2:Data Link Layer

Defines procedures for operating the communication links

Frames packets

Detects and corrects packets transmit errors

Layer 1:Physical Layer

Defines physical means of sending data over network devices

Interfaces between network medium and devices

Defines optical, electrical and mechanical characteristics

CONCLUSION: In this experiment we have studied network topologies & OSI Model in

detail.

Page 17: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

17

EXPERIMENT NO. 3

AIM: INSTALLATION OF TC/IP PROTOCOL CONFIGURATION AND STUDY THE

CLASSIFICATION OF ADDRESSES EMPLOYING TCP/IP PROTOCOLS.

THEORY:

TCP/IP

TCP/IP is the communication protocol for communication between computers on the

Internet.TCP/IP stands for Transmission Control Protocol / Internet Protocol.TCP/IP defines

how electronic devices (like computers) should be connected to the Internet, and how data

should be transmitted between them.

Inside TCP/IP

Inside the TCP/IP standard there are several protocols for handling data communication:

TCP (Transmission Control Protocol) communication between applications

UDP (User Datagram Protocol) simple communication between applications

IP (Internet Protocol) communication between computers

ICMP (Internet Control Message Protocol) for errors and statistics

DHCP (Dynamic Host Configuration Protocol) for dynamic addressing

IP is Connection-Less

IP is for communication between computers.

IP is a "connection-less" communication protocol.

IP does not occupy the communication line between two computers. IP reduces the need

for network lines. Each line can be used for communication between many different

computers at the same time.

With IP, messages (or other data) are broken up into small independent "packets" and

sent between computers via the Internet.

IP is responsible for "routing" each packet to the correct destination.

Page 18: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

18

TCP/IP

TCP/IP is TCP and IP working together.

TCP takes care of the communication between your application software (i.e. your browser) and

your network software.

IP takes care of the communication with other computers.

TCP is responsible for breaking data down into IP packets before they are sent, and for

assembling the packets when they arrive.

IP is responsible for sending the packets to the correct destination.

To configure TCP/IP, you must be logged on as a member of the Administrators group on the

local computer.

Complete the following steps to install and configure the TCP/IP protocol.

1. Open the Network utility.

2. Right-click the connection to which you want to add a network component, and then

click Properties.

3. If Internet Protocol (TCP/IP) is listed, skip to Step 6. If Internet Protocol (TCP/IP) is

not listed, click Install.

4. In the Select Network Component Type dialog box, click Protocol, and then click Add.

5. From the Network Protocol list, select TCP/IP Protocol and click OK.

6. From the General tab (for local area connections) or the Networking tab (for all other

connections), select Internet Protocol (TCP/IP), and then click Properties.

7. Configure TCP/IP either automatically or manually.

Contact your network administrator to find out if there is a DHCP server installed on your

network.

Automatically – You can automatically configure TCP/IP services if you have a DHCP

server on your network. This automatic process ensures easy and accurate installation of

TCP/IP because your local computer is configured with the correct IP address, subnet

mask, and default gateway.

Page 19: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

19

To configure automatically, select Obtain an IP address automatically, and then click

OK.

Manually – You must configure TCP/IP manually if you do not have a DHCP server on

your network, or if you are configuring a Windows server to be a DHCP server. In this

case, you must manually enter valid addressing information after the TCP/IP protocol

software is installed on your computer. To avoid duplicate addresses, be sure to use the

values for IP addresses and subnet masks that are supplied by your network

administrator.

addresses employing TCP/IP protocols

Page 20: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

20

Through logical address the system identify a network (source to destination). After

identifying the network physical address is used to identify the host on that network. The port

address is used to identify the particular application running on the destination machine.

Logical Address:

An IP address of the system is called logical address. This address is the combination of

Net ID and Host ID. This address is used by network layer to identify a particular network

(source to destination) among the networks. This address can be changed by changing the host

position on the network. So it is called logical address.

Physical address:

Each system having a NIC (Network Interface Card) through which two systems

physically connected with each other with cables. The address of the NIC is called Physical

address or MAC address. This is specified by the manufacture company of the card. This address

is used by data link layer.

Page 21: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

21

Port Address:

There are many applications running on the computer. Each application run with a port

no.(logically) on the computer. This port no. for application is decided by the Kernel of the OS.

This port no. is called port address.

CONCLUSION: In this way we had studied TCP/IP in detailed.

Page 22: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

22

EXPERIMENT NO. 4

AIM: WRITE A C PROGRAM TO DETERMINE IF THE IP ADDRESS IS IN CLASS A,

B, C, D, OR E.

THEORY:

Internet Protocol address

IP address is a numerical label assigned to each device (e.g., computer, printer)

participating in a computer network that uses the Internet Protocol for communication. An IP

address serves two principal functions: host or network interface identification and location

addressing. Its role has been characterized as follows: "A name indicates what we seek. An

address indicates where it is. A route indicates how to get there."

The designers of the Internet Protocol defined an IP address as a 32-bit number and this system,

known as Internet Protocol Version 4 (IPv4), is still in use today. However, due to the enormous

growth of the Internet and the predicted depletion of available addresses, a new version of IP

(IPv6), using 128 bits for the address, was developed in 1995.

IPv4 addresses

In IPv4 an address consists of 32 bits which limits the address space to 4294967296 (232

)

possible unique addresses.

Address classes

The first class, designated as Class A, contained all addresses in which the most

significant bit is zero. The network number for this class is given by the next 7 bits, therefore

accommodating 128 networks in total, including the zero network, and including the existing IP

networks already allocated. A Class B network was a network in which all addresses had the two

most-significant bits set to 1 and 0. For these networks, the network address was given by the

next 14 bits of the address, thus leaving 16 bits for numbering host on the network for a total of

65536 addresses per network. Class C was defined with the 3 high-order bits set to 1, 1, and 0,

Page 23: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

23

and designating the next 21 bits to number the networks, leaving each network with 256 local

addresses.The leading bit sequence 111 designated an "escape to extended addressing mode",

which was later subdivided in to Class D (1110) for multicast addressing, while leaving as

reserved for future use the 1111 block designated as Class E.

This addressing scheme is illustrated in the following table:

ALGORITHM:

1. Start

2. Display menu

1. Binary IP

2. Dotted Decimal IP

3. Exit

3. Read users option

4. For Case1:

Read IP as 32 bits

If first bit is 0, display entered IP belongs to Class A

Page 24: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

24

If first 2 bits are 10, display entered IP belongs to Class B

If first 3 bits are 110, display entered IP belongs to Class C

If first 4 bits are 1110, display entered IP belongs to Class D

If first 5 bits are 1111, display entered IP belongs to Class E

5. Case 2:

Read IP in dotted decimal form

Check IP is in correct form

If the first value is in between 0-127, display Class A

If the first value is in between 128-191, display Class B

If the first value is in between 192-223, display Class C

If the first value is in between 224-239, display Class D

If the first value is in between 240-255, display Class E

6. Exit

7. Stop.

Input: Enter IP in dotted decimal 45.121.0.0

Output: Entered IP belongs to Class A

CONCLUSION: Hence we have successfully performed the program to display the class of

entered IP address.

Page 25: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

25

EXPERIMENT NO. 5

AIM: WRITE A C PROGRAM TO TRANSLATE DOTTED DECIMAL IP ADDRESS

INTO 32 BIT ADDRESS.

THEORY:

Two versions of the Internet Protocol (IP) are in use: IP Version 4 and IP Version 6. Each

version defines an IP address differently. Because of its prevalence, the generic term IP address

typically still refers to the addresses defined by IPv4. In IPv4 an address consists of 32 bits

which limits the address space to 4294967296 (232

) possible unique addresses. IPv4 reserves

some addresses for special purposes such as private networks (~18 million addresses) or

multicast addresses (~270 million addresses).

IPv4 addresses are canonically represented in dot-decimal notation, which consists of

four decimal numbers, each ranging from 0 to 255, separated by dots, e.g., 172.16.254.1. Each

part represents a group of 8 bits (octet) of the address. In some cases of technical writing, IPv4

addresses may be presented in various hexadecimal, octal, or binary representations.

IPv4 addresses

Decomposition of an IPv4 address from dot-decimal notation to its binary value.

Page 26: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

26

ALGORITHM:

1. Start

2. Read IP Address in dotted decimal format

3. Check IP ,whether it is correct or incorrect

4. If incorrect IP , display message for wrong IP

5. For correct IP

Convert each decimal number into 8-bit binary format

6. display the conversion i.e. 32 bit binary format

7. Stop.

Input:

Enter IP in dotted decimal format

172.16.254.1

Output:

Binary conversion

10101100 00010000 11111110 00000001

CONCLUSION: Hence we have successfully performed the program to convert entered

dotted decimal IP address into 32-bit binary format.

Page 27: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

27

EXPERIMENT NO. 6

AIM: STUDY OF BASIC NETWORK COMMANDS: IPCONFIG, HOSTNAME, PING

<IP_ADDRESS>, TRACERT <IP_ADDRESS>, NETSTAT<IP_ADDRESS> ETC..

THEORY:

HOSTNAME

The hostname command displays the host name of the Windows XP computer currently logged

into.

Syntax:

IPCONFIG

Ipconfig is used to display the network settings currently assigned and given by a network. This

command can be utilized to verify a network connection as well as to verify your network

settings.

Page 28: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

28

PING

The ping command is used to test the ability of the source computer to reach a specified

destination computer. The ping command is usually used as a simple way verify that a computer

can communicate over the network with another computer or network device.

The ping command operates by sending Internet Control Message Protocol (ICMP) Echo

Request messages to the destination computer and waiting for a response. How many of those

responses are returned, and how long it takes for them to return, are the two major pieces of

information that the ping command provides.

Ping Command Syntax:

ping -a 192.168.1.22

In this example I'm asking the ping command to find the hostname assigned to the 192.168.1.22

IP address but otherwise ping it as normal.

Pinging J3RTY22 [192.168.1.22] with 32 bytes of data:

Reply from 192.168.1.22: bytes=32 time<1ms TTL=64

Reply from 192.168.1.22: bytes=32 time<1ms TTL=64

Reply from 192.168.1.22: bytes=32 time=1ms TTL=64

Reply from 192.168.1.22: bytes=32 time<1ms TTL=64

Ping statistics for 192.168.1.22:

Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),

Approximate round trip times in milli-seconds:

Minimum = 0ms, Maximum = 1ms, Average = 0ms

TRACERT

The tracert command is used to show several details about the path that a packet takes

from the computer or device you're on to whatever destination you specify.

Page 29: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

29

You might also sometimes see the tracert command referred to as the trace route command or

traceroute command.

Tracert Command Syntax:

Tracing route to 192.168.1.1 over a maximum of 30 hops

1 <1 ms <1 ms <1 ms 192.168.1.254

2 <1 ms <1 ms <1 ms 192.168.1.1

Trace complete.

In this example, you can see that tracert found a network device using the IP address of

192.168.1.254, let's say a network switch, followed by the destination, 192.168.1.1, the router.

tracert www.google.com

Using the tracert command as shown above, we're asking tracert to show us the path from the

local computer all the way to the network device with the hostname www.google.com.

Tracing route to www.l.google.com [209.85.225.104]

over a maximum of 30 hops:

1 <1 ms <1 ms <1 ms 10.1.0.1

2 35 ms 19 ms 29 ms 98.245.140.1

3 11 ms 27 ms 9 ms te-0-3.dnv.comcast.net [68.85.105.201]

...

13 81 ms 76 ms 75 ms 209.85.241.37

14 84 ms 91 ms 87 ms 209.85.248.102

15 76 ms 112 ms 76 ms iy-f104.1e100.net [209.85.225.104]

Trace complete.

In this example we can see that tracert identified fifteen network devices including our router at

10.1.0.1 and all the way through to the target of www.google.com which we now know uses the

public IP address of 209.85.225.104.

Page 30: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

30

NETSTAT

The netstat command is used to display very detailed information about how your

computer is communicating with other computers or network devices.Specifically, the netstat

command can show details about individual network connections, overall and protocol-specific

networking statistics, and much more, all of which could help troubleshoot certain kinds of

networking issues.

Netstat Command Syntax:

netstat -f

In this first example, I execute netstat to show all active TCP connections. However, I do want to

see the computers I'm connected to in FQDN format [-f] instead of a simple IP address.

Here's an example of what you might see:Active Connections

Proto Local Address Foreign Address State

TCP 127.0.0.1:5357 VM-Windows-7:49229 TIME_WAIT

TCP 127.0.0.1:49225 VM-Windows-7:12080 TIME_WAIT

TCP 192.168.1.14:49194 75.125.212.75:http CLOSE_WAIT

TCP 192.168.1.14:49196 a795sm.avast.com:http CLOSE_WAIT

TCP 192.168.1.14:49197 a795sm.avast.com:http CLOSE_WAIT

TCP 192.168.1.14:49230 TIM-PC:wsd TIME_WAIT

TCP 192.168.1.14:49231 TIM-PC:icslap ESTABLISHED

TCP 192.168.1.14:49232 TIM-PC:netbios-ssn TIME_WAIT

TCP 192.168.1.14:49233 TIM-PC:netbios-ssn TIME_WAIT

TCP [::1]:2869 VM-Windows-7:49226 ESTABLISHED

TCP [::1]:49226 VM-Windows-7:icslap ESTABLISHED

As you can see, I had 11 active TCP connections at the time I executed netstat. The only protocol

(in the Proto column) listed is TCP, which was expected because I did not use -a.

Page 31: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

31

You can also see three sets of IP addresses in the Local Address column - my actual IP address

of 192.168.1.14 and both IPv4 and IPv6 versions of my loopback addresses, along with the port

each connection is using. The Foreign Address column lists the FQDN (75.125.212.75 didn't

resolve for some reason) along with that port as well.

Finally, the State column lists the TCP state of that particular connection.

netstat –o :- In this example, I want to run netstat normally so it only shows active TCP

connections, but I also want to see the corresponding process identifier [-o] for each connection

so I can determine which program on my computer initiated each one.

Here's what my computer displayed:

Active Connections

Proto Local Address Foreign Address State PID

TCP 192.168.1.14:49194 75.125.212.75:http CLOSE_WAIT 2948

TCP 192.168.1.14:49196 a795sm:http CLOSE_WAIT 2948

TCP 192.168.1.14:49197 a795sm:http CLOSE_WAIT 2948

You probably noticed the new PID column. In this case, the PIDs are all the same, meaning that

the same program on my computer opened these connections.

CONCLUSION: In this way we have performed the basic networking commands

successfully.

Page 32: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

32

EXPERIMENT NO. 7

AIM: TO ESTABLISH A STRAIGHT OVER AND A CROSS OVER CABLE IN LAN.

THEORY:

Common Ethernet network cable are straight and crossover cable. This Ethernet network

cable is made of 4 pair high performance cable that consists twisted pair conductors that used for

data transmission. Both end of cable is called RJ45 connector.

The cable can be categorized as Cat 5, Cat 5e, Cat 6 UTP cable. Cat 5 UTP cable can

support 10/100 Mbps Ethernet network, whereas Cat 5e and Cat 6 UTP cable can support

Ethernet network running at 10/100/1000 Mbps. You might heard about Cat 3 UTP cable, it's not

popular anymore since it can only support 10 Mbps Ethernet network.

Straight and crossover cable can be Cat3, Cat 5, Cat 5e or Cat 6 UTP cable, the only

difference is each type will have different wire arrangement in the cable for serving different

purposes.

Straight Cable

You usually use straight cable to connect different type of devices. This type of cable will be

used most of the time and can be used to:

Page 33: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

33

1) Connect a computer to a switch/hub's normal port.

2) Connect a computer to a cable/DSL modem's LAN port.

3) Connect a router's WAN port to a cable/DSL modem's LAN port.

4) Connect a router's LAN port to a switch/hub's uplink port.(normally used for expanding

network)

5) Connect 2 switches/hubs with one of the switch/hub using an uplink port and the other one

using normal port.

If you need to check how straight cable looks like, it's easy. Both side (side A and side B) of

cable have wire arrangement with same color. Check out different types of straight cable that

are available in the market here.

Crossover Cable

Sometimes you will use crossover cable, it's usually used to connect same type of devices. A

crossover cable can be used to:

Page 34: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

34

1) Connect 2 computers directly.

2) Connect a router's LAN port to a switch/hub's normal port. (normally used for expanding

network)

3) Connect 2 switches/hubs by using normal port in both switches/hubs.

In you need to check how crossover cable looks like, both side (side A and side B) of cable

have wire arrangement with following different color .

Step 1:

Cut the shielding off the cable, which will expose the 4 pairs of wires. Blue, Green, Orange and

Brown. When it comes to creating a straight through cable the color combination does not

matter. What ever the color of the first end is, make the second end the same.

Page 35: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

35

When it comes to RJ45 Standards its different. The standard rj45 colors are:

White Orange

Orange

White Green

Blue

White Blue

Green

White Brown

Brown

Step 2:

Line the wires according to the image below. This is the rj45 Straight through standard colors.

This will be the same color on both ends of the cable.

Cut the excess wire off, i usually leave half inch. This usually fits in the head perfect.

Page 36: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

36

Above is the final cut. The White Orange is Pin 1 and Brown is Pin 8.

Pin Outs ( tab facing down and pins away from you )

Step 3:

RJ45 Head, When placing the wires into the head try to line it up length wise. Similar to what is

shown couple images above.

Page 37: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

37

In the image above you can see how the wires are inserted into the rj45 head.

Make sure the wires reach the copper / gold pins. This is important because its what connect the

wires to whatever you plug the cable into.

Now, use the crimper can crimp the wires and you are finished.

CONCLUSION: In this experiment we have learned how to create LAN cable.

Page 38: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

38

EXPERIMENT NO. 8

AIM: STUDY OF MULTIPLEXING AND SWITCHING.

THEORY:

Most communication systems require the sharing of channels

• Shared media is common in cable television, telephone systems, and data

communications

• Two types of combining signals are:

– Multiplexing - combining signals from the same sources

– Multiple-access - combining signals from multiple sources

• A communications medium can be shared equally by dividing either quantity among

users

• The frequency spectrum can be divided by using:

– FDM (frequency-division multiplexing)

– TDM (time-division multiplexing

Frequency-Division Multiplexing

• FDM/FDMA is the most basic form of multiplexing and has been used since the first

days of radio

• Each transmission is assigned a band of frequencies on a full-time basis

• FDM/FDMA is versatile, being used in radio, all types of cable, and optical fiber

Time-Division Multiplexing

• TDM is used mainly for digital communication

• Each information signal is allowed all the available bandwidth, but only for part of the

time

• In theory, it is possible to divide the bandwidth among all users of a channel

• Continuously varying signals are not well suited to TDM

• Many signals can be sent on one channel by sending a sample from each signal in

rotation

TDM in Telephony

• TDM is used extensively in telephony

Page 39: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

39

• Many different standards for TDM exist

• On arrangement is the DS-1 signal

– Consists of 24 PCM voice channels

– Each channel is sampled at 8 kHz with 8 bits per sample

– Each channel therefore has 64 kb/s

– Consists of frames which contain the bits representing one sample from each of

the 24 channels

– The multiplexed signal is sent at 8000 frames/sec, giving a total of 1.544 Mb/s

transmission rate

The Network Core

• mesh of interconnected routers

• the fundamental question: how is data transferred through net?

circuit switching: dedicated circuit per call e.g. telephone net

packet-switching: data sent through net in discrete “chunks”

Circuit Switching

End-end resources reserved for “call”

link bandwidth, switch capacity

dedicated resources: no sharing

circuit-like (guaranteed) performance

call setup required

must divide link between into pieces...

Page 40: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

40

Packet Switching

each end-end data stream divided into packets

user A, B packets share network resources

each packet uses full link bandwidth

resources used as needed

resource contention:

aggregate resource demand can exceed amount available

what happens if bandwidth is not available?

congestion: packets queue, wait for link use

store and forward: packets move one hop at a time

Node receives complete packet before forwarding

CONCLUSION: Hence we have studied multiplexing and switching techniques in

networking.

Page 41: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

41

EXPERIMENT NO. 9

AIM: WRITE A C PROGRAM TO GENERATE HAMMING CODE.

THEORY:

Data can be corrupted during transmission. Some applications require that errors be

detected and corrupted.

Errors are of two types:

1. Single bit error – In a single bit error, only one bit in the data unit has changed.

2. Burst error – A burst error means that 2 or more bits in the data unit have changed.

To detect or correct errors, we need to send extra bits with data.

Hamming code is used to detect or correct errors.

Page 42: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

42

Fig. Structure of encoder and decoder

Fig. structure of encoder and decoder for a Hamming Code

Example 1:

Dataword=> 0100

Codeword=> 0100111

If the codeword received by receiver as 0100111

The syndrome is 000 means NO ERROR

Page 43: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

43

Example 2:

Dataword=> 0111

Codeword=> 0111001

If the codeword received by receiver as 0011001

The syndrome is 011 means ERROR in b2

Algorithm:

(Sender Site)

8. Start

9. Read 4 bit dataword as input

10. Generate 7-bit codeword (dataword + 3 parity bits)

r0= a2 + a1 + a0

r1= a3 + a2 + a1

r0= a1 + a0 + a3

(Receiver Site)

11. Read 7-bit codeword

12. Calculate 3 syndrome bits ( S0,S1 ,S2 )

S0= b2 + b1 + b0 + q0

S1= b3 + b2 + b1+ q1

S2= b1 + b0 + b3+ q2

13. Check values of syndrome bits

If S2= S1 =S0=0, No error

If S2=0 S1 =0 S0=1, Error in q0

If S2=0 S1 =1 S0=0, Error in q1

If S2=0 S1 =1 S0=1, Error in b2

If S2=1 S1 =0 S0=0, Error in q2

If S2=1 S1 =0 S0=1, Error in b0

If S2=1 S1 =1 S0=0, Error in b3

If S2=1 S1 =1 S0=1, Error in b1

14. To correct the error , flip the value of error bit

Page 44: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

44

15. Display the corrected codeword

16. Stop.

(Sender Site)

Input:

Dataword=> 0100

Output:

Codeword=> 0100111

(Receiver Site)

Input:

If the codeword received by receiver as 0100111

Output:

The syndrome is 000 means NO ERROR

CONCLUSION: In this way we successfully performed the detection and correction of error

bit using Hamming code technique.

Page 45: COMPUTER NETWORK I lab manual.pdf · defining network geometry: the physical topology and the logical (or signal) topology. The physical topology of a network is the actual geometric

45

EXPERIMENT NO. 10

AIM: STUDY OF IEEE 802.11 WIRELESS STANDARDS.

THEORY:

In 1997, the Institute of Electrical and Electronics Engineers (IEEE) created the first

WLAN standard. They called it 802.11 after the name of the group formed to oversee its

development. The original Ethernet was created in 1976 at Xerox‟s Palo Alto Research Center

(PARC). Since then, it has gone through four generations. We briefly discuss the Standard (or

traditional) Ethernet in this section.

Ethernet evolution through four generations