0% found this document useful (0 votes)
114 views4 pages

R23 New CN Manual

The document outlines a series of experiments related to computer networks and internet protocols, focusing on data link layer methods, routing algorithms, and network simulations. Key tasks include implementing framing methods, calculating CRC codes, and using tools like Wireshark and Nmap. Additionally, it provides sample code for character count framing, character stuffing, and bit stuffing techniques.

Uploaded by

tejasree allam
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)
114 views4 pages

R23 New CN Manual

The document outlines a series of experiments related to computer networks and internet protocols, focusing on data link layer methods, routing algorithms, and network simulations. Key tasks include implementing framing methods, calculating CRC codes, and using tools like Wireshark and Nmap. Additionally, it provides sample code for character count framing, character stuffing, and bit stuffing techniques.

Uploaded by

tejasree allam
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/ 4

R23 – Computer Networks & Internet Protocols (23A05501P)

List of Experiments:

1. Implement the data link layer framing methods such as character, character-
stuffing and bit
stuffing.
2. Write a program to compute CRC code for the polynomials CRC-12, CRC-16
and CRC
CCIP
3. Develop a simple data link layer that performs the flow control using the
sliding window
protocol, and loss recovery using the Go-Back-N mechanism.
4. Implement Dijkastra‘s algorithm to compute the shortest path through a
network
5. Take an example subnet of hosts and obtain a broadcast tree for the subnet.
6. Implement distance vector routing algorithm for obtaining routing tables at
each node.
7. Implement data encryption and data decryption
8. Write a program for congestion control using Leaky bucket algorithm.
9. Write a program for frame sorting technique used in buffers.
10. Programs using Wireshark
i. Packet Capture Using Wire shark
ii. Starting Wire shark
iii. Viewing Captured Traffic
iv. Analysis and Statistics & Filters.
11. How to run Nmap scan
12. Operating System Detection using Nmap
13. Do the following using NS2 Simulator
i. NS2 Simulator-Introduction
ii. Simulate to Find the Number of Packets Dropped
iii. Simulate to Find the Number of Packets Dropped by TCP/UDP
iv. Simulate to Find the Number of Packets Dropped due to Congestion
v. Simulate to Compare Data Rate& Throughput.
vi. Simulate to Plot Congestion for Different Source/Destination
vii. Simulate to Determine the Performance with respect to transmission of
Packets

III CSE ,VITS,PDTR


Program – 1:Implement the data link layer framing methods such as character,
character-stuffing and bit stuffing in computer networks

Data Link Layer Framing methods:

 Character Count Framing


 Character Stuffing
 Bit Stuffing

# Data Link Layer Framing Methods Implementation

A) def character_count_framing(data_list):

print("\n--- Character Count Framing ---")

frames = []

for data in data_list:

count = len(data) + 1 # +1 for the count byte itself

frame = f"{count}{data}"

frames.append(frame)

print(f"Original: {data} -> Framed: {frame}")

return frames

B) def character_stuffing(data_list, flag='F', esc='E'):

print("\n--- Character Stuffing ---")

stuffed_frames = []

for data in data_list:

stuffed_data = ''

for char in data:

if char == flag or char == esc:

stuffed_data += esc # add escape before flag or esc

stuffed_data += char

III CSE ,VITS,PDTR


frame = flag + stuffed_data + flag

stuffed_frames.append(frame)

print(f"Original: {data} -> Stuffed: {frame}")

return stuffed_frames

C) def bit_stuffing(data, flag='01111110'):

print("\n--- Bit Stuffing ---")

stuffed = ''

count = 0

for bit in data:

stuffed += bit

if bit == '1':

count += 1

if count == 5:

stuffed += '0'

count = 0

else:

count = 0

final_frame = flag + stuffed + flag

print(f"Original: {data} -> Stuffed: {final_frame}")

return final_frame

# Sample usage

if __name__ == "__main__":

# Sample data for character methods

character_data = ["Hello", "NetFwork", "DaEta"]

III CSE ,VITS,PDTR


# Sample binary data for bit stuffing

binary_data = "011111101111110111110"

# Apply all three methods

character_count_framing(character_data)

character_stuffing(character_data)

bit_stuffing(binary_data)

Explanation:

 Character Count: Adds a count byte at the beginning of each frame.


 Character Stuffing: Escapes special characters using an escape character.
 Bit Stuffing: Inserts 0 after five consecutive 1s to avoid confusion with frame
delimiter (01111110).

Output :

--- Character Count Framing ---

Original: Hello -> Framed: 6Hello

Original: NetFwork -> Framed: 9NetFwork

Original: DaEta -> Framed: 6DaEta

--- Character Stuffing ---

Original: Hello -> Stuffed: FHelloF

Original: NetFwork -> Stuffed: FNetEFworkF

Original: DaEta -> Stuffed: FDaEEtaF

--- Bit Stuffing ---

Original: 011111101111110111110 -> Stuffed:


0111111001111100101111100111110010111110

III CSE ,VITS,PDTR

You might also like