KEMBAR78
CN1 | PDF | Ip Address | Network Switch
0% found this document useful (0 votes)
35 views10 pages

CN1

jhvvvvvvvvvvvvvvvvvvvvvvvvvv

Uploaded by

Praveena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
35 views10 pages

CN1

jhvvvvvvvvvvvvvvvvvvvvvvvvvv

Uploaded by

Praveena
Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as DOCX, PDF, TXT or read online on Scribd
You are on page 1/ 10

Date: Exp no: Page:

Aim: To study different types of Network cables (Copper and Fiber) and prepare cables (Straight and
Cross) to connect Two or more systems. Use crimping tool to connect jacks. Use LAN tester to connect the
cables.

- Install and configure Network Devices: HUB, Switch and Routers. Consider both manageable and
non-manageable switches. Do the logical configuration of the system. Set the bandwidth of different ports.

- Install and Configure Wired and Wireless NIC and transfer files between systems in Wired LAN and
Wireless LAN. Consider both adhoc and infrastructure mode of operation.

Theory:
1. Study of Different Types of Network Cables
1.1 Copper Cables
These use electrical signals for data transmission.
Cable Type Description Speed/Distance Usage
UTP (Unshielded Pairs of wires twisted to reduce Cat5e: up to 1 Gbps / 100mCat6:
LAN connections
Twisted Pair) interference. up to 10 Gbps / 55m
STP (Shielded Similar to UTP but with Industrial
Similar to UTP
Twisted Pair) shielding against interference. environments
Single copper core with Old Ethernet,
Coaxial Cable Up to 10 Mbps / 500m
shielding. CCTV

1.2 Fiber Optic Cables


These use light signals for transmission.
Type Core Size Mode Distance Usage
Single-mode 8–10 µm Laser Up to 40 km+ Long-distance telecom
Multi-mode 50–62.5 µm LED Up to 2 km LAN, data centers

2. Preparing Straight and Cross Cables


2.1 Cable Standards
 Straight-through cable: Used to connect different devices (PC → Switch, Switch → Router).
 Crossover cable: Used to connect similar devices (PC → PC, Switch → Switch).
Wiring Standards (TIA/EIA-568A & 568B):
 568A:
1. White/Green
2. Green
3. White/Orange
4. Blue
5. White/Blue
6. Orange
7. White/Brown
8. Brown
 568B:
1. White/Orange
2. Orange
3. White/Green
4. Blue
5. White/Blue
6. Green

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

7. White/Brown
8. Brown

2.2 Crimping Procedure


1. Strip about 1 inch of cable sheath using the crimping tool.
2. Untwist the wire pairs.
3. Arrange wires according to the standard (568B for both ends = Straight, 568A on one end & 568B
on other = Cross).
4. Insert into RJ-45 connector.
5. Crimp using crimping tool.
6. Test with a LAN tester.

3. Installing & Configuring Network Devices


3.1 HUB
 Simple device, broadcasts all packets to every port.
 No configuration required.
3.2 Switch
 Connects devices in LAN, forwards packets only to destination port.
 Manageable Switch: Has a web/CLI interface for settings (VLANs, bandwidth control, port
security).
 Non-manageable Switch: No configuration possible.
Configuration Steps for Manageable Switch:
1. Connect PC to switch via Ethernet.
2. Access web GUI or CLI.
3. Assign IP address to switch for management.
4. Configure VLANs if needed.
5. Set bandwidth limits per port (QoS settings).

3.3 Router
 Connects different networks (LAN to WAN, LAN to LAN).
 Assign IP addresses to interfaces.
 Configure DHCP, Static routes, or Dynamic routing.

4. Logical Configuration of Systems


1. Go to Control Panel → Network & Internet → Network Connections.
2. Select Ethernet → Properties → IPv4 Settings.
3. Assign:
o IP Address: Example 192.168.1.10
o Subnet Mask: 255.255.255.0
o Gateway: Router IP (e.g., 192.168.1.1)
4. Verify with:
5. ping 192.168.1.1

5. Installing & Configuring NICs


5.1 Wired NIC
 Usually built-in on motherboard.
 Install driver if not detected automatically.
5.2 Wireless NIC
 Plug in USB adapter or install internal card.
 Install drivers.

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

 Connect to Wi-Fi (Adhoc or Infrastructure).

6. Adhoc vs. Infrastructure Mode


Mode Description Usage
Adhoc Direct wireless connection between PCs without AP. Temporary sharing, no router.
Infrastructure Uses Access Point/Router to connect devices. Home/office networks.

7. File Transfer Between Systems


7.1 Wired LAN
 Share a folder in Windows File Sharing or use FTP.
 Access via \\IP-Address\SharedFolder.
7.2 Wireless LAN
 Same as wired, but connect via Wi-Fi (Adhoc or Infrastructure).

✅ Tools Required:
 Crimping tool
 RJ-45 connectors
 LAN cable (Cat5e/Cat6)
 LAN tester
 Switch/Router
 PCs/Laptops
 Wireless NICs

Result:
Hence, the program to study different types of network cables,install and configure network devices and
Wired and Wireless NIC and transfer files between systems in Wired LAN and Wireless LAN has been
executed successfully.

Aim: To work with the commands Ping, Tracert, Ipconfig, pathping, telnet, ftp, getmac, ARP, Hostname,
Nbtstat, netdiag, and Nslook up.

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

Program:
import subprocess
commands = {
"1. Ping Google": ["ping", "-n", "4", "google.com"],
"2. Tracert to Google": ["tracert", "google.com"],
"3. IP Configuration": ["ipconfig"],
"4. Pathping Google": ["pathping", "-n", "google.com"],
"5. Telnet to towel.blinkenlights.nl": ["telnet", "towel.blinkenlights.nl"],
"6. FTP to dlptest.com": ["ftp", "-n", "ftp.dlptest.com"],
"7. Get MAC Address": ["getmac"],
"8. ARP Table": ["arp", "-a"],
"9. Hostname": ["hostname"],
"10. Nbtstat": ["nbtstat", "-n"],
"11. Net diag (may be unavailable)": ["net diag"],
"12. Nslookup for google.com": ["nslookup", "google.com"]
}
def run_command(name, command):
print(f"\n{'='*10} {name} {'='*10}")
try:
result = subprocess.run(command, capture_output=True, text=True, shell=True)
print(result.stdout)
if result.stderr:
print("ERROR:", result.stderr)
except Exception as e:
print("Exception occurred:", e)
for name, command in commands.items():
run_command(name, command)

output:
========== 1. Ping Google ==========
Pinging google.com [2404:6800:4009:822::200e] with 32 bytes of data:
Reply from 2404:6800:4009:822::200e: time=82ms
Reply from 2404:6800:4009:822::200e: time=493ms
Reply from 2404:6800:4009:822::200e: time=893ms
Reply from 2404:6800:4009:822::200e: time=773ms
Ping statistics for 2404:6800:4009:822::200e:
Packets: Sent = 4, Received = 4, Lost = 0 (0% loss),
Approximate round trip times in milli-seconds:
Minimum = 82ms, Maximum = 893ms, Average = 560ms

========== 2. Tracert to Google ==========


Tracing route to google.com [2404:6800:4009:822::200e]
over a maximum of 30 hops:

1 3 ms 4 ms 8 ms 2401:4900:4e1e:3a5d::17
2 * * * Request timed out.
3 310 ms 195 ms 31 ms 2401:4900:d0:4001::1271
4 988 ms 781 ms * 2401:4900:d0:4001::1447
5 419 ms 377 ms 389 ms 2401:4900:0:6f8::11

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

6 81 ms 308 ms 324 ms 2404:a800:3a00:2::2c1


7 780 ms 205 ms 44 ms 2404:a800::92
8 77 ms 60 ms 369 ms 2404:6800:8201:180::1
9 409 ms 85 ms 52 ms 2404:6800:8201:180::1
10 * 1158 ms 812 ms 2001:4860:0:1::55fe
11 456 ms 57 ms 95 ms 2001:4860:0:1::17d6
12 * 1100 ms 244 ms 2001:4860::9:4001:7733
13 112 ms 400 ms 430 ms 2001:4860:0:1::8767
14 280 ms 70 ms 329 ms 2001:4860:0:1::50f9
15 171 ms 77 ms 82 ms bom12s12-in-x0e.1e100.net [2404:6800:4009:822::200e]

Trace complete.

========== 3. IP Configuration ==========


Windows IP Configuration
Ethernet adapter Ethernet 2:

Connection-specific DNS Suffix . :


Link-local IPv6 Address . . . . . : fe80::a3ba:16de:d93c:ce%6
IPv4 Address. . . . . . . . . . . : 192.168.56.1
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . :

Wireless LAN adapter Local Area Connection* 1:

Media State . . . . . . . . . . . : Media disconnected


Connection-specific DNS Suffix . :

Wireless LAN adapter Local Area Connection* 2:

Media State . . . . . . . . . . . : Media disconnected


Connection-specific DNS Suffix . :

Wireless LAN adapter Wi-Fi:

Connection-specific DNS Suffix . :


IPv6 Address. . . . . . . . . . . : 2401:4900:4e1e:3a5d:7a5:8377:8af1:a94b
Temporary IPv6 Address. . . . . . : 2401:4900:4e1e:3a5d:a896:9417:1685:f015
Link-local IPv6 Address . . . . . : fe80::3b30:b26:7ebf:6676%16
IPv4 Address. . . . . . . . . . . : 10.11.102.47
Subnet Mask . . . . . . . . . . . : 255.255.255.0
Default Gateway . . . . . . . . . : fe80::24d0:f8ff:fe90:680b%16
10.11.102.43

========== 4. Pathping Google ==========


Tracing route to google.com [2404:6800:4009:822::200e]
over a maximum of 30 hops:
0 2401:4900:4e1e:3a5d:a896:9417:1685:f015
1 2401:4900:4e1e:3a5d::17
2 * * *

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

Computing statistics for 25 seconds...


Source to Here This Node/Link
Hop RTT Lost/Sent = Pct Lost/Sent = Pct Address
0 2401:4900:4e1e:3a5d:a896:9417:1685:f015
0/ 100 = 0% |
1 10ms 0/ 100 = 0% 0/ 100 = 0% 2401:4900:4e1e:3a5d::17

Trace complete.

========== 5. Telnet to towel.blinkenlights.nl ==========


/ _ \ ====
//|/.\|\\ o o~~ || \_/ ||
_\- /_ || |\ /| || ___ /\/ \
# \_ _/ # / ()\ //| | |\\ |||
_|_____|_ // | | |// ===================
| | === | | // | | // | | |_| O |_|(' |
===(| |_________________| || O || | || |
| | ||__*__|| (_)(_) | |
|~ \___/ ~| |_||_| | | /=\ /=\ /=\
|_||_| ______|_________________|
_______[_]_[_]_[_]____/__][__\____________

========== 6. FTP to dlptest.com ==========


Connected to ftp.dlptest.com.
220 Welcome to the DLP Test FTP Server
200 Always in UTF8 mode.
User (ftp.dlptest.com:(none)): dlpuser
331 Please specify the password.
Password:

230 Login successful.


ftp> ls
200 PORT command successful. Consider using PASV.
425 Failed to establish connection.
ftp>
ftp> bye
221 Goodbye.

========== 7. Get MAC Address ==========


Physical Address Transport Name
===================
==========================================================
10-91-D1-ED-83-4D \Device\Tcpip_{C1EDAE82-F8D5-4B3E-8719-FAD261F2D834}
0A-00-27-00-00-06 \Device\Tcpip_{55AE824B-4FA1-4FD1-97D2-06910844CD25}

========== 8. ARP Table ==========

Interface: 192.168.56.1 --- 0x6


Internet Address Physical Address Type
192.168.56.255 ff-ff-ff-ff-ff-ff static

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

224.0.0.22 01-00-5e-00-00-16 static


224.0.0.251 01-00-5e-00-00-fb static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static

Interface: 10.11.102.47 --- 0x10


Internet Address Physical Address Type
10.11.102.43 26-d0-f8-90-68-0b dynamic
10.11.102.255 ff-ff-ff-ff-ff-ff static
224.0.0.22 01-00-5e-00-00-16 static
224.0.0.251 01-00-5e-00-00-fb static
224.0.0.252 01-00-5e-00-00-fc static
239.255.255.250 01-00-5e-7f-ff-fa static
255.255.255.255 ff-ff-ff-ff-ff-ff static

========== 9. Hostname ==========


LAPTOP-G6INSCJ7

========== 10. Nbtstat ==========


Ethernet 2:
Node IpAddress: [192.168.56.1] Scope Id: []

NetBIOS Local Name Table

Name Type Status


---------------------------------------------
LAPTOP-G6INSCJ7<00> UNIQUE Registered
WORKGROUP <00> GROUP Registered
LAPTOP-G6INSCJ7<20> UNIQUE Registered

Bluetooth Network Connection:


Node IpAddress: [0.0.0.0] Scope Id: []

No names in cache

Wi-Fi:
Node IpAddress: [10.11.102.47] Scope Id: []

NetBIOS Local Name Table

Name Type Status


---------------------------------------------
LAPTOP-G6INSCJ7<00> UNIQUE Registered
WORKGROUP <00> GROUP Registered
LAPTOP-G6INSCJ7<20> UNIQUE Registered

Local Area Connection* 1:


Node IpAddress: [0.0.0.0] Scope Id: []

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

No names in cache

Local Area Connection* 2:


Node IpAddress: [0.0.0.0] Scope Id: []

No names in cache

========== 11. Net diag (may be unavailable) ==========

ERROR: '"net diag"' is not recognized as an internal or external command,


operable program or batch file.

========== 12. Nslookup for google.com ==========


Server: UnKnown
Address: 10.11.102.43

Name: google.com
Addresses: 2404:6800:4009:822::200e
142.250.183.78

ERROR: Non-authoritative answer:

Result:
Hence, the program to work with the commands Ping, Tracert, Ipconfig, pathping, telnet, ftp, getmac, ARP,
Hostname, Nbtstat, netdiag, and Nslook up has been executed successfully.

Aim: To find all the IP addresses on your network. Unicast, Multicast, and Broadcast on your network.
Program:

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

import subprocess
import ipaddress
def get_ip_and_subnet():
output = subprocess.check_output("ipconfig", text=True)
ip = None
subnet = None
for line in output.splitlines():
if "IPv4 Address" in line:
ip = line.split(":")[1].strip()
elif "Subnet Mask" in line:
subnet = line.split(":")[1].strip()
if ip and subnet:
break
return ip, subnet
def is_active(ip):
result = subprocess.run(["ping", "-n", "1", ip], stdout=subprocess.DEVNULL)
return result.returncode == 0
def main():
ip, subnet = get_ip_and_subnet()
if not ip or not subnet:
print("Could not detect IP or subnet mask.")
return
print(f"Your IP Address: {ip}")
print(f"Subnet Mask: {subnet}")
network = ipaddress.IPv4Network(f"{ip}/{subnet}", strict=False)
print(f"Network Address: {network.network_address}")
print(f"Broadcast Address: {network.broadcast_address}")
print(f"Unicast IP Range: {network.network_address + 1} to {network.broadcast_address - 1}")
print(f"Multicast Range: 224.0.0.0 to 239.255.255.255")
print("\nScanning first 5 unicast IPs...")
count = 0
for host_ip in network.hosts():
if count >= 5:
break
if is_active(str(host_ip)):
print(f"✅ Active: {host_ip}")
else:
print(f"❌ No response: {host_ip}")
count += 1
if __name__ == "__main__":
main()

Output:
Your IP Address: 192.168.56.1
Subnet Mask: 255.255.255.0
Network Address: 192.168.56.0
Broadcast Address: 192.168.56.255
Unicast IP Range: 192.168.56.1 to 192.168.56.254
Multicast Range: 224.0.0.0 to 239.255.255.255

CSE Dept. Computer Networks Lab


Date: Exp no: Page:

Scanning first 5 unicast IPs...


✅ Active: 192.168.56.1
❌ No response: 192.168.56.2
❌ No response: 192.168.56.3
❌ No response: 192.168.56.4
❌ No response: 192.168.56.5

Result:
Hence, the program to find all the IP addresses on your network. Unicast, Multicast, and Broadcast on your
network has been executed successfully.

CSE Dept. Computer Networks Lab

You might also like