CN Lab Manual
CN Lab Manual
3
To study various types of connectors.
6
Write a program to find Shortest Paths from Source
to all Vertices using Dijkstra’s Algorithm
7
To study TCL Commands
8
Study of network IP
Classification of IP address
Sub netting
Super netting
9 To implement various types of error detection and error
correcting techniques.
10 Case Study of Sliding Window Protocols
Q 1. Study of different types of Network cables and practically implement the cross-
Wired cable and straight through cable using crimping tool.
Network cables are essential components of any network setup, connecting various devices to enable
communication. The two main types of network cables are:
Twisted pair cables are the most common type used in Ethernet networks. They come in two primary
categories:
- Unshielded Twisted Pair (UTP): Widely used in LAN environments. They are cheaper and more flexible but
offer less protection against electromagnetic interference (EMI).
- Shielded Twisted Pair (STP): Includes a shielding to protect against EMI, making them more suitable for
environments with high interference.
- Category 5e (Cat 5e): Supports up to 1 Gbps at 100 MHz, commonly used for most LAN connections.
- Category 6 (Cat 6): Supports up to 10 Gbps at 250 MHz, suitable for faster networks.
- Category 6a (Cat 6a): Enhanced Cat 6, supports up to 10 Gbps at 500 MHz, better for long-distance high-
speed applications.
- Category 7 (Cat 7): Supports up to 10 Gbps at 600 MHz, with even better shielding.
Fiber optic cables transmit data as light signals, allowing for higher bandwidth and longer distances compared
to twisted pair cables.
- Single-mode Fiber (SMF): Suitable for long-distance communication, with a small core that transmits a
single light wave.
- Multi-mode Fiber (MMF): Suitable for shorter distances, with a larger core that transmits multiple light
waves simultaneously.
Straight-Through Cable:
- Used to connect different types of devices, like a computer to a switch or router.
- Both ends follow the same wiring standard (either T568A or T568B).
Crossover Cable:
- Used to connect similar devices directly, such as two computers or two switches.
- One end follows the T568A standard, and the other end follows the T568B standard.
Wiring Standards:
- T568A:
- Pin 1: White/Green
- Pin 2: Green
- Pin 3: White/Orange
- Pin 4: Blue
- Pin 5: White/Blue
- Pin 6: Orange
- Pin 7: White/Brown
- Pin 8: Brown
- T568B:
- Pin 1: White/Orange
- Pin 2: Orange
- Pin 3: White/Green
- Pin 4: Blue
- Pin 5: White/Blue
- Pin 6: Green
- Pin 7: White/Brown
- Pin 8: Brown
Materials Needed:
- Cat 5e or Cat 6 UTP cable
- RJ45 connectors
- Crimping tool
- Wire stripper/cutter
- Cable tester (optional, for verification)
Network topologies define the layout, arrangement, and structure of network connections. Different topologies
have unique characteristics, advantages, and drawbacks, making them suitable for various scenarios. This case
study examines five common network topologies: Bus, Star, Ring, Mesh, and Hybrid.
1. Bus Topology
Description:
- A single central cable (the bus) to which all network devices are connected.
Advantages:
- Easy to implement and extend.
- Requires less cable compared to other topologies.
- Cost-effective for small networks.
Disadvantages:
- Limited cable length and number of nodes.
- Difficult to troubleshoot.
- A failure in the central cable can bring down the entire network.
Use Case:
- Early LANs in Small Offices: Small offices with minimal networking needs often used bus topology due to
its simplicity and cost-effectiveness. For example, early versions of Ethernet networks, such as 10BASE-2,
utilized bus topology.
2. Star Topology
Description:
- All network devices are connected to a central hub or switch.
Advantages:
- Easy to install and manage.
- Failure of one node does not affect the rest of the network.
- Easy to troubleshoot and isolate issues.
Disadvantages:
- Higher cabling cost due to individual cables running to the central hub.
- The hub represents a single point of failure.
Use Case:
- Modern LANs: Star topology is prevalent in modern Local Area Networks (LANs) where each computer is
connected to a central switch or router. Schools, offices, and home networks commonly use this topology.
3. Ring Topology
Description:
- Each device is connected to two other devices, forming a circular data path.
Advantages:
- Equal access to resources because data travels in one direction.
- Can perform better than bus topology under heavy network load.
Disadvantages:
- Failure of a single device can affect the entire network.
- Difficult to install and reconfigure.
Use Case:
- Token Ring Networks: IBM's Token Ring network used ring topology, ensuring each computer had equal
access to the network. It was used in corporate environments requiring reliable and orderly network access.
4. Mesh Topology
Description:
- Every device is connected to every other device in the network.
Advantages:
- High redundancy and reliability.
- Data can be transmitted simultaneously from different devices.
Disadvantages:
- Very high cabling and hardware costs.
- Complex to install and manage.
Use Case:
- WANs and Military Networks: Mesh topology is often used in Wide Area Networks (WANs) and military
networks where reliability and redundancy are crucial. For instance, the Internet itself employs a mesh-like
structure to ensure robust communication.
5. Hybrid Topology
Description:
- Combination of two or more different topologies (e.g., star-bus, star-ring).
Advantages:
- Flexible and scalable.
- Can be designed to fit the specific needs of an organization.
Disadvantages:
- Complexity in design and implementation.
- Higher cost due to varied hardware and cabling requirements.
Use Case:
- Enterprise Networks: Large enterprises often use hybrid topologies to combine the strengths of different
configurations. For example, a company's network might use a star-bus topology where different star-
configured subnetworks are connected in a bus configuration.
Comparative Analysis
Q 3. To study various types of connectors.
Connectors are crucial components in networking and electronic systems, enabling the physical interface
between different devices. This study explores various types of connectors, their uses, and their specific
characteristics.
1. RJ45 Connectors
Description:
- Commonly used for Ethernet networking.
- 8-pin connector used with twisted-pair cables (Cat5e, Cat6, etc.).
Uses:
- Connecting computers to network switches, routers, and modems.
- Used in both home and office environments for network connectivity.
Characteristics:
- Supports high-speed data transfer.
- Widely standardized and easy to use.
2. RJ11 Connectors
Description:
- Smaller than RJ45, with 4 or 6 pins.
- Commonly used for telephone connections.
Uses:
- Connecting telephones to wall outlets.
- Used in both residential and commercial telephone systems.
Characteristics:
- Limited to lower data transmission speeds compared to RJ45.
- Simple and cost-effective for voice communication.
3. USB Connectors
Description:
- Universal Serial Bus (USB) connectors come in various types (USB-A, USB-B, USB-C, Mini-USB, Micro-
USB).
- Used for connecting a wide range of devices.
Uses:
- Connecting peripherals such as keyboards, mice, printers, and external storage to computers.
- Charging and data transfer for mobile devices.
Characteristics:
- Hot-swappable, allowing devices to be connected and disconnected without restarting.
- Supports power delivery and data transfer simultaneously.
4. HDMI Connectors
Description:
- High-Definition Multimedia Interface (HDMI) connectors for audio and video transmission.
- 19-pin connector used for high-definition video and audio.
Uses:
- Connecting TVs, monitors, and projectors to devices like computers, DVD players, and gaming consoles.
- Widely used in home entertainment systems.
Characteristics:
- Supports high-definition video and multi-channel audio.
- Can carry uncompressed video and audio signals.
5. D-Sub Connectors
Description:
- D-shaped metal shield with various pin configurations (e.g., DB9, DB25).
- Used for both analog and digital signals.
Uses:
- Connecting computers to peripherals like printers, monitors (VGA), and serial devices.
- Found in older computer systems and specialized industrial applications.
Characteristics:
- Robust and durable.
- Supports various signal types and configurations.
Description:
- Used for high-speed data transmission through optical fibers.
- Types include SC, ST, LC, and MTP/MPO connectors.
Uses:
- Connecting fiber optic cables in networking, telecommunications, and data centers.
- Used in environments requiring high bandwidth and long-distance communication.
Characteristics:
- Supports very high data transfer rates.
- Immune to electromagnetic interference.
7. Coaxial Connectors
Description:
- Connectors for coaxial cables, such as BNC, F-type, and RCA.
- Used for both analog and digital signals.
Q 4. Case study of OSI and TCP/IP reference models.(Define Each layer).
The OSI (Open Systems Interconnection) model is a conceptual framework used to understand and implement
interoperable network protocols. It has seven layers, each specifying particular network functions.
The TCP/IP model, also known as the Internet Protocol Suite, is a set of protocols used for the internet and
similar networks. It has four layers, each corresponding to specific functions in networking.
3. Transport Layer
- Function: Similar to the OSI transport layer. It provides end-to-end communication services for
applications.
- Examples: TCP (Transmission Control Protocol), UDP (User Datagram Protocol).
4. Application Layer
- Function: Encompasses the functionalities of the OSI session, presentation, and application layers. It
provides network services to end-user applications.
- Examples: HTTP, FTP, SMTP, DNS.
1. Application Layer
- OSI: The user's browser uses HTTP (Application Layer) to request a webpage.
- TCP/IP: The HTTP request is generated in the Application Layer.
2. Presentation Layer
- OSI: The data is formatted (e.g., HTML) and may be encrypted using SSL/TLS.
- TCP/IP: Handled within the Application Layer; SSL/TLS are also implemented here.
3. Session Layer
- OSI: The session between the user's browser and the web server is established.
- TCP/IP: Handled within the Application Layer; protocols manage sessions implicitly.
4. Transport Layer
- OSI: TCP ensures reliable data transmission, or UDP for faster, less reliable communication.
- TCP/IP: TCP segments the HTTP data and ensures delivery through acknowledgment.
5. Network Layer
- OSI: IP addresses are used to route the packets from the client to the web server.
- TCP/IP: The IP protocol routes the data packets.
7. Physical Layer
- OSI: The actual physical medium (cables, radio waves) transmits the binary data.
- TCP/IP: Network Interface Layer ensures physical data transmission.
Q 5. Study various software of Data Link Layer.
Soln.- The Data Link Layer (Layer 2) in the OSI model is responsible for node-to-node data transfer, error
detection, and handling of data frames. Various software and protocols operate at this layer to ensure the
reliable transmission of data over a physical medium. Here are some key software and protocols associated
with the Data Link Layer:
6. Frame Relay
- Function: A high-performance WAN protocol that operates at the physical and data link layers.
- Software Components: Frame Relay controllers and software that manage virtual circuits, frame
formatting, and congestion control.
- Example Software: Frame Relay configuration utilities in network equipment (e.g., Cisco IOS for Frame
Relay).
Conclusion:
Data link layer software is crucial for the functioning of network interfaces and the overall communication
process in a network. These software components ensure that data is correctly framed, addressed, and error-
checked before being transmitted over the physical layer.
Q 6. Write a program to find Shortest Paths from Source to all Vertices using Dijkstra’s Algorithm.
Soln.- Dijkstra's algorithm is a popular algorithm used for finding the shortest paths between nodes in a graph.
Below is a Python implementation of Dijkstra's algorithm using a priority queue for efficiency. This
implementation assumes that the graph is represented using an adjacency list.
```python
import heapq
# Distance array to store the shortest path from start to each vertex
distances = [float('inf')] * n
distances[start] = 0
while priority_queue:
current_distance, current_vertex = heapq.heappop(priority_queue)
# If the distance is greater than the stored distance, skip this node
if current_distance > distances[current_vertex]:
continue
# If found a shorter path to the neighbor, update the distance and push to the queue
if distance < distances[neighbor]:
distances[neighbor] = distance
heapq.heappush(priority_queue, (distance, neighbor))
return distances
# Example usage
if __name__ == "__main__":
# Graph represented as an adjacency list
# Each entry graph[u] contains a list of tuples (v, w) where
# v is the neighboring vertex and w is the weight of the edge u -> v
graph = [
[(1, 2), (2, 4)], # Edges from vertex 0
[(2, 1), (3, 7)], # Edges from vertex 1
[(4, 3)], # Edges from vertex 2
[(4, 1)], # Edges from vertex 3
[] # Edges from vertex 4
]
start_vertex = 0
shortest_paths = dijkstra(graph, start_vertex)
print(f"Shortest paths from vertex {start_vertex}: {shortest_paths}")
```
Explanation
1. Graph Representation: The graph is represented as an adjacency list where each index in the list
corresponds to a vertex, and each element is a list of tuples. Each tuple contains a neighboring vertex and the
weight of the edge connecting to that neighbor.
2. Initialization: We initialize the distances from the start vertex to all other vertices as infinity (`float('inf')`)
and set the distance to the start vertex itself as 0.
3. Priority Queue: We use a priority queue (min-heap) to explore the vertices. The priority queue stores
tuples of (current_distance, current_vertex), which ensures that we always explore the vertex with the shortest
known distance first.
4. Relaxation: For each vertex, we check its neighbors. If the new calculated distance to a neighbor is shorter
than the known distance, we update the distance and add this neighbor to the priority queue.
5. Termination: The algorithm terminates when the priority queue is empty, and we return the distances
array, which contains the shortest path distances from the start vertex to all other vertices.
This code should provide a clear understanding of how Dijkstra's algorithm works and can be used as a basis
for more complex graph problems.
Q 7. To study TCL Commands.
Soln.- To study TCL (Tool Command Language) commands, you can follow these steps:
5. Work on Projects:
- Start working on small projects or scripts using TCL.
- Gradually increase the complexity of your projects to gain more experience.
- Analyze and understand existing TCL codebases to learn best practices and techniques.
7. Stay Updated:
- Keep yourself updated with the latest developments and updates in TCL.
- Follow TCL-related blogs, news, and forums to stay informed about new features, tools, and libraries.
By following these steps and dedicating time to practice and experiment with TCL commands, you can
gradually become proficient in TCL programming.
Q 8. Study of network IP
Classification of IP address
Sub netting
Super netting
Soln.- Certainly! Let's dive into the study of network IP addressing, including the classification of IP
addresses, subnetting, and supernetting.
1. Classification of IP Address:
IP addresses are classified into several classes based on the range of addresses they cover and the network size
they support. The most commonly used classification is based on the first octet of the IP address:
2. Subnetting:
Subnetting is the process of dividing a larger network into smaller, manageable sub-networks (subnets). It
helps in optimizing network performance, improving security, and efficient resource utilization. In subnetting,
a portion of the host bits from the IP address is used to create a network ID and subnet ID, while the remaining
bits are used for host addresses.
Soln.- Implementing various types of error detection and error correcting techniques involves a range of
algorithms and methodologies, each suited for different types of errors and communication channels. Below,
I'll provide an overview of some common error detection and error correction techniques along with a brief
explanation of each:
1. Parity Check:
- Involves adding an additional parity bit to the data transmitted.
- Even parity: Ensures the total number of 1s in the data, including the parity bit, is even.
- Odd parity: Ensures the total number of 1s in the data, including the parity bit, is odd.
2. Checksum:
- Involves summing up all the data bytes and adding a checksum at the end.
- Receiver recalculates the checksum and compares it with the received checksum. If they don't match, an
error is detected.
1. Hamming Code:
- Adds redundant bits to the data to detect and correct errors.
- Hamming distance between code words determines the number of errors that can be corrected.
- Widely used for error correction in computer memory.
2. Reed-Solomon Code:
- A block code capable of correcting multiple errors in data transmission.
- Widely used in digital communications, CDs, DVDs, and QR codes.
4. Convolutional Coding:
- A technique that encodes data using shift registers and exclusive OR gates.
- Produces a continuous stream of coded symbols, allowing for continuous error correction at the receiver.
Soln.- Let's explore a case study of sliding window protocols in the context of computer networking.
Sliding window protocols are used in computer networks to manage the flow of data between sender and
receiver efficiently. They allow for the transmission of multiple packets without waiting for an
acknowledgment for each individual packet. Instead, a window of packets is sent, and acknowledgments are
received for packets within the window.
Scenario: Consider a scenario where a sender (S) wants to transmit data to a receiver (R) over an unreliable
network. Both sender and receiver are using the Go-Back-N protocol for reliable data transmission.
Key Components:
1. Sender (S): The entity responsible for sending data packets to the receiver.
2. Receiver (R): The entity responsible for receiving data packets from the sender.
3. Sequence Numbers: Each packet sent by the sender is assigned a sequence number.
4. Window Size (N): The maximum number of unacknowledged packets allowed in the network.
5. Timer**: A timer is set for each packet sent by the sender to handle timeouts.
6. Acknowledgment (ACK): A signal sent by the receiver to acknowledge successful receipt of a packet.
Protocol Workflow:
1. Sender Side:
- Maintain a send window of size N.
- Send N packets to the receiver and start a timer for each packet.
- Wait for acknowledgments from the receiver.
- If an acknowledgment is received for a packet with sequence number k, advance the window to include
packets k+1 to k+N.
- If a timeout occurs for any packet, retransmit all packets in the window starting from the timed-out packet.
2. Receiver Side:
- Maintain a receive window of size N.
- Receive packets from the sender and send acknowledgments.
- Accept packets only if they fall within the receive window.
- Discard duplicate or out-of-order packets.
- Send cumulative acknowledgments indicating the highest correctly received sequence number.
Example:
- Suppose the sender's window size (N) is 3, and the sequence numbers of packets are 0, 1, 2, 3, 4, ...
- Sender sends packets 0, 1, 2, and waits for acknowledgments.
- Receiver receives packets 0 and 1, acknowledges both.
- Sender receives acknowledgments, advances the window, and sends packets 3, 4, 5.
- If acknowledgment for packet 2 is lost, sender timeouts and resends packets 2, 3, 4.
- Receiver discards duplicate packets and sends acknowledgment for the last correctly received packet.
Advantages:
- Efficient utilization of network bandwidth by allowing multiple packets to be in transit simultaneously.
- Simple implementation and low overhead compared to other protocols.
Challenges:
- Increased complexity in handling out-of-order packets and duplicate acknowledgments.
- Limited by the window size, which affects throughput and latency.
Conclusion:
Sliding window protocols, such as the Go-Back-N protocol, play a crucial role in ensuring reliable data
transmission over unreliable networks. By allowing multiple packets to be in transit simultaneously, they
improve network efficiency while maintaining data integrity and reliability. However, proper tuning of
parameters such as window size and timeout values is essential for optimal performance in real-world
scenarios.