Amit Kumar CN File
Amit Kumar CN File
GREATER NOIDA-201306
(An Autonomous Institute)
School of Computer Sciences & Engineering in Emerging Technologies
LAB FILE
ON
(ACSE-0552)
(5th Semester)
Affiliated to Dr. A.P.J Abdul Kalam Technical University, Uttar Pradesh, Lucknow
NOIDA INSTITUTE OF ENGINEERING AND TECHNOLOGY
GREATER NOIDA-201306
(An Autonomous Institute)
School of Computer Sciences & Engineering in Emerging Technologies
INDEX
PAGE Grade
S.NO PRACTICAL CONDUCTED DATE SIGN
NO
AIM- To make an UTP cable with RJ45 connector and built and test simple network using
UTP cable (crossover) and a hub based cable.
Theory-
Physical layer defines the cable or physical medium itself, e.g., thinnet, thicknet, unshielded
twisted pairs (UTP). It transmits raw bit stream over physical cable, defines cables, cards,
and physical aspects, defines NIC attachments to, hardware, how cable is attached to NIC,
defines techniques to transfer bit stream to cable. All media are functionally equivalent. The
main difference is in convenience and cost of installation and maintenance. Network
Cabling Cable 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 network's topology,
protocol, and size. Types of cables used in networks are:
3. Coaxial Cable
5. wireless media
Unshielded
100BaseTX Twisted 220 meters
Pair
Unshielded Twisted Pair Connector-The standard connector for unshielded twisted pair
cabling is an RJ-45 connector.
The T-568A standard is supposed to be used in new network installations. Most off-the-shelf
Ethernet cables are still of the T-568B standard; however, it makes no functional difference.
Both the T-568A and the T-568B standard Straight-Through cables are used most often as
patch cords for Ethernet connections. If we require a cable to connect two Ethernet devices
directly together without a hub or when connecting two hubs together, we need to use a
Crossover cable instead.
Crossover Ethernet cable is to wire one end using the T-568A standard and the other end
using the T-568B standard. Another way of remembering the color coding is to simply
switch the Green set of wires in place with the Orange set of wires. Specifically, switch the
solid Green (G) with the solid Orange, and switch the green/white with the orange/white.
By looking at a T-568A UTP Ethernet straight-thru cable and an Ethernet crossover cable
with a T-568B end, we see that the TX (transmitter) pins are connected to the corresponding
RX (receiver) pins, plus to plus and minus to minus. You can also see that both the blue and
brown wire pairs on pins 4, 5, 7, and 8 are not used in either standard. What you may not
realize is that, these same pins 4, 5, 7, and 8 are not used or required in 100BASE-TX as
well. So why bother using these wires, well for one thing its simply easier to make a
connection with all the wires grouped together. Otherwise you'll be spending time trying to
fit those tiny little wires into each of the corresponding holes in the RJ-45 connector.
straight through
computer to hub
cable
straight through
hub uplink to hub port
cable
straight through
computer to switch
cable
straight through
hub uplink to switch port
cable
OR
(b). Get a router (Connect it using a crossover cable to the cable modem and
connect the computers to the built in switch on the router. Some routers don't have built in
switches, in this case you will need to get a switch or hub.
If we have more than two hubs/switches, then connect all the hub/switches using uplink
ports and straight through cables, to regular ports on a main hub/switch.
OR
(b) Using a broadband router, connect a cable modem with a crossover cable to the WAN
port of the router, then connect the other computers to the router's LAN ports If you do not
have enough ports then get more hub/switches. Connect the uplink ports to the router's LAN
port with straight through cables and connect your computers to the hubs/switches.
1. Start on one end of cable and strip the cable jacket off using a stripper.
2. Spread, untwist the pairs, and arrange the wires in the order of the desired cable end.
Flatten the end between your thumb and forefinger. Trim the ends of the wires so
they are even with one another.
3. Hold the RJ-45 plug with the clip facing down.Push the wires firmly into the plug.
Inspect each wire is flat even at the front of the plug. Check the order of the
wires.Check that the jacket is fitted right against the stop of the plug.Carefully hold
the wire and firmly crimp the RJ-45 with the crimper.
4. Check the color orientation, check that the crimped connection is not about to come
apart, and check to see if the wires are flat against the front of the plug
5. Similarly make end 2 according to the color coding for straight through cable or
crossover cable on the basis of requirement.
3.restart both computers and both of them detect the network after logon.
Connecting PC to hub-
Result-
The study of an UTP cable with RJ-45 connector is completed, and build the simple
network using UTP cable and a hub based network successfully.
Precautions-
Theory:-
Repeater Fig.
2.1
Types of Hub
Active Hub:- These are the hubs which have their own
power supply and can clean, boost and relay the signal
Fig 2.2
Fig. 2.3
Types of Bridges
Fig. 2.5
Fig. 2.7
Results-
AIM- Test the Network connection using ping command and use of
ipconfig, netstat and tracert command provided by TCP/IP.
The ping command is a Command Prompt command 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 to 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.
For example, you might find that there are no responses when pinging a network printer, only
to find out that the printer is offline and its cable needs replaced. Or maybe you need to ping
a router to verify that your computer can connect to it, to eliminate it as a possible cause for a
networking issue.
Item Explanation
-t Using this option will ping the target until you force it to stop by using Ctrl-C.
- This option sets the number of ICMP Echo Requests to send, from 1 to 4294967295.
ncount The ping command will send 4 by default if -n isn't used.
-l size Use this option to set the size, in bytes, of the echo request packet from 32 to 65,527.
The ping command will send a 32-byte echo request if you don't use the -l option.
-f Use this ping command option to prevent ICMP Echo Requests from being
fragmented by routers between you and the target. The -f option is most often used
to troubleshoot Path Maximum Transmission Unit (PMTU) issues.
-i TTL This option sets the Time to Live (TTL) value, the maximum of which is 255.
-v TOS This option allows you to set a Type of Service (TOS) value. Beginning in Windows
7, this option no longer functions but still exists for compatibility reasons.
-rcount Use this ping command option to specify the number of hops between your
computer and the target computer or device that you'd like to be recorded and
displayed. The maximum value for count is 9, so use the tracert command instead if
you're interested in viewing all the hops between two devices.
-scount Use this option to report the time, in Internet Timestamp format, that each echo
request is received and echo reply is sent. The maximum value for count is 4,
meaning that only the first four hops can be time stamped.
- Specifying a timeout value when executing the ping command adjusts the amount of
wtimeo time, in milliseconds, that ping waits for each reply. If you don't use the -w option,
ut the default timeout value of 4000 is used, which is 4 seconds.
-R This option tells the ping command to trace the round trip path.
-4 This forces the ping command to use IPv4 only but is only necessary if target is a
hostname and not an IP address.
-6 This forces the ping command to use IPv6 only but as with the -4option, is only
necessary when pinging a hostname.
Target This is the destination you wish to ping, either an IP address or a hostname.
/? Use the help switch with the ping command to show detailed help about the
command's several options.
In the above example, we're pinging 127.0.0.1, also called the IPv4 localhost IP address or
IPv4 loopback IP address, without options.
Using the ping command to ping 127.0.0.1 is an excellent way to test that Windows' network
features are working properly but it says nothing about your own network hardware or your
connection to any other computer or device. The IPv6 version of this test would be ping ::1.
This command details how IP is setup on the machine you are logged into.
There are also a variety of switches for ipconfig that add functions. These are invoked by entering "ipconfig
/{switch}". To obtain a list of switches, enter "ipconfig /?" or "ipconfig -?".
For a detailed output of network parameters, use the command "ipconfig /all". Unless you are experienced
with networks, however, this may be more than we want to know.
At the command prompt, type: tracert xxx Where xxx is the IP address or URL of the machine that we are
trying to connect to.
Here is the result of tracert from college computer to yahoo.com ( DNS has resolved the name “yahoo.com”
to 129.64.99.33)
The netstat command is used to display the TCP/IP network protocol statistics and information
-a Displays all connections and listening ports. (Server-side connections are normally not shown).
Shows connections for the protocol specified by proto; proto may be tcp or udp. If used with
-p proto
the -s option to display per-protocol statistics, proto may be tcp, udp, or ip.
Displays per-protocol statistics. By default, statistics are shown for TCP, UDP and IP; the -p
-s
option may be used to specify a subset of the default.
Redisplays selected statistics, pausing interval seconds between each display. Press CTRL+C
interval to stop redisplaying statistics. If omitted, netstat will print the current configuration
information once.
Stands for “Name Server Lookup” is a useful command for getting information from DNS
server. It is a network administration tool for querying the Domain Name System (DNS) to
obtain domain name or IP address mapping or any other specific DNS record. It is also used
to troubleshoot DNS related problems.
nslookup google.com :
nslookup followed by the domain name will display the “A Record” (IP Address) of the
domain. Use this command to find the address record for a domain. It queries to domain
name servers and get the details.
nslookup 192.168.0.10 :
Reverse DNS lookup you can also do the reverse DNS look-up by providing the IP
Address as argument to nslookup.
Lookup for an soa record SOA record (start of authority), provides the authoritative
information about the domain, the e-mail address of the omain admin, the domain serial
number, etc
Lookup for an ns record NS (Name Server) record maps a domain name to a list of
DNS servers authoritative for that domain. It will output the name serves which are
associated with the given domain.
Lookup for an a record We can also view all the available DNS records for a particular
record using -type=a option.
Lookup for an mx record MX (Mail Exchange) record maps a domain name to a list of
mail exchange servers for that domain. The MX record tells that all the mails sent to
“google.com” should be routed to the Mail server in that domain.
Lookup for an txt record TXT records are useful for multiple types of records like
DKIM, SPF, etc. You can find all TXT records configured for any domain using below
command.
Outputs: -
Example:
>> ipconfig
>> ipconfig/all
(3)tracert command
Example:
>>tracert yahoo.com
(4)netstat command
>> netstat-n
>> netstat-a
>> netstat-?
(5)nslookup command
Example:
Result:-
All the required network commands are studied and successfully test the network connection
using ping command and use of ipconfig, netstat and tracert command provided by TCP/IP.
Aim - Implementation of data link layer framing method such as bit stuffing in any language
like C++ ,Java or Python.
Theory –
The data link layer is responsible for something called Framing, which is the division of
stream of bits from network layer into manageable units (called frames). Frames could be
of fixed size or variable size. In variable-size framing, we need a way to define the end of
the frame and the beginning of the next frame.
Bit stuffing is the insertion of non information bits into data. Note that stuffed bits should
not be confused with overhead bits.
Overhead bits are non-data bits that are necessary for transmission (usually as part of
headers, checksums etc.).
Example—
Bit sequence: 110101111101011111101011111110 (without bit stuffing)
Bit sequence: 110101111100101111101010111110110 (with bit stuffing)
After 5 consecutive 1-bits, a 0-bit is stuffed. Stuffed bits are marked bold.
Result-
The Implementation of data link layer framing method such as bit stuffing is done
successfully.
Aim - Implementation of CRC algorithm in any language like C++ , Java or Python.
Theory –
CRC (Cyclic Redundancy Check) is an error-checking technique used in network
communications to detect errors in transmitted data. It works by appending a fixed number of
bits to the data, called the "CRC checksum" or "CRC code," which is computed based on the
content of the data. At the receiver end, a CRC computation is performed on the received
data, including the CRC checksum. If the computed CRC code at the receiver matches the
received CRC code, it indicates that the data is likely free of errors. If the CRC codes don't
match, an error is detected.
Here's a Python implementation of CRC at the transmitter end and error detection at the
receiver end:
def generate_crc(data, divisor):
data = list(data)
divisor = list(divisor)
n = len(divisor) - 1
data += ['0'] * n # Append n zeros to the data
if __name__ == "__main__":
data = "1101101101" # Data to be transmitted
divisor = "1011" # CRC divisor
if error_detected:
print("Error detected in the received data.")
else:
print("No error detected in the received data.")
Code-
class CRC:
def __init__(self):
self.cdw = ''
def xor(self,a,b):
result = []
for i in range(1,len(b)):
if a[i] == b[i]:
result.append('0')
else:
result.append('1')
return ''.join(result)
tmp = message[:pick]
pick+=1
checkword = tmp
return checkword
def encodedData(self,data,key):
l_key = len(key)
append_data = data + '0'*(l_key-1)
remainder = self.crc(append_data,key)
codeword = data+remainder
self.cdw += codeword
print("Remainder: " ,remainder)
print("Data: " ,codeword)
def reciverSide(self,key,data):
r = self.crc(data,key)
size = len(key)
print(r)
if r == size*0:
print("No Error")
else:
print("Error")
data = '100100'
key = '1101'
c = CRC()
c.encodedData(data,key)
print('---------------')
c.reciverSide(c.cdw,key)
print('---------------')
print(c.cdw)
Result-
Aim -Implementation of Hamming code (7, 4) code to limit the noise in any language like
C++ , Java or Python.
Theory –
The Hamming Code method is a network technique designed by R.W.Hamming, for damage
and error detection during data transmission between multiple network channels. The
Hamming Code method is one of the most effective ways to detect single-data bit errors in
the original data at the receiver end. It is not only used for error detection but is also for
correcting errors in the data bit. The number of redundant bits can be calculated using the
following formula:
2^r ≥ m + r + 1
def calculate_hamming_code(data):
# Calculate the number of parity bits needed
r = 0
while 2**r < len(data) + r + 1:
r += 1
# Copy the data bits into the Hamming code, skipping the positions of
parity bits
data_bit_index = 0
for i in range(len(hamming_code)):
if (i + 1) & (i + 1 - 1) != 0:
hamming_code[i] = int(data[data_bit_index])
data_bit_index += 1
return hamming_code
Part-2: Detection and Correction of Hamming Code (7, 4) at the Receiver End
def detect_and_correct_hamming_code(received_code):
r = 0
while 2**r < len(received_code):
r += 1
error_position = 0
for i in range(r):
position = 2**i - 1
parity = 0
for j in range(1, len(received_code) + 1):
if (j >> i) & 1 == 1:
parity ^= received_code[j - 1]
if parity != 0:
error_position += position
if error_position > 0:
received_code[error_position - 1] ^= 1 # Correct the error
def hamming_encode(data):
# Ensure the input data is 4 bits long
if len(data) != 4:
raise ValueError("Input data must be 4 bits long")
return hamming_code
def hamming_decode(received_code):
# Check if the received code is 7 bits long
if len(received_code) != 7:
raise ValueError("Received code must be 7 bits long")
if __name__ == "__main__":
original_data = "1101" # 4-bit data
hamming_code = hamming_encode(original_data)
received_code = list(hamming_code) # Simulating reception of the Hamming
code
corrected_data = hamming_decode(received_code)
Result-
The implementation of Hamming code (7, 4) transmitter and receiver end is done
successfully.
Theory –
In this case, stop and wait means that the sender provides the recipient’s desired data. The
sender pauses after transferring the data and waits for the receiver to acknowledge his
transmission. The stop and wait protocol, which is a flow control protocol, uses the data link
layer’s flow control functionality. It is a DDL (data-link layer) protocol that is used to send
data through channels with no background noise. It offers unidirectional data transfer, which
means that only one of the two operations, data sending or receiving, can occur concurrently.
Although it offers a flow-control system, there is no error control mechanism. The concept
behind using this frame is that after sending one frame, the sender will wait for an
acknowledgement before sending another one.
For example, if there are 1000 data packets to be sent, then all the 1000 packets cannot be
sent at a time as in Stop and Wait protocol, one packet is sent at a time.
Result-
Code-
Result-
Aim -Write a program in java to find the IP address of the any site if
name is given.
Code-
Result-
AIM- Introduction to CISCO Packet Tracer. Design Bus, Star, Mesh, Ring Topology and
check the connectivity using ping command.
Theory-
A local area network (LAN) is a collection of devices connected together in one physical
location, such as a building, office, or home. A LAN can be small or large, ranging from
a home network with one user to an enterprise network with thousands of users and
devices in an office or school. Regardless of size, a LAN's single defining characteristic
is that it connects devices that are in a single, limited area. In contrast, a WAN or MAN
covers larger geographic areas. Some WANs and MANs connect many LANs together.
Types of topology: -
4. Star Topology-A star topology is a topology for a Local Area Network (LAN) in which all
nodes are individually connected to a central connection point, like a hub or a switch. A
star takes more cable than e.g. a bus, but the benefit is that if a cable fails, only one node will
be brought down.
Bus Topology
Mesh Topology
Star Topology
The study of CISCO Packet Tracer is completed, and designed the Bus, Star, Mesh, Ring
topology successfully.