Location via proxy:   [ UP ]  
[Report a bug]   [Manage cookies]                
0% found this document useful (0 votes)
22 views

Assignment 01 Computer Network

Uploaded by

Aamish Ali
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
22 views

Assignment 01 Computer Network

Uploaded by

Aamish Ali
Copyright
© © All Rights Reserved
Available Formats
Download as DOC, PDF, TXT or read online on Scribd
You are on page 1/ 11

Riphah International University FSD

Department of Computing
Subject: Computer Network

Submitted to:

Sir Ghulam Mustafa


Submitted by:

Aamish Ali (23925)

Class:
th
BSSE 6

Aamish Ali
BSSE 6th
23925
Q. 1: What is Stop and Wait protocol? Describe the two types of
delays while sending the frames. Also mention the difference
between Efficiency and Throughput.

Stop-and-Wait Protocol:
The Stop-and-Wait protocol is a simple flow control protocol used in data
communication systems. It ensures reliable transmission by sending one frame at
a time and waiting for an acknowledgment (ACK) from the receiver before
sending the next frame.
If the sender does not receive an acknowledgment within a specified time, it
resends the frame. This ensures that no data is lost due to transmission errors .

Types of Delays in Stop-and-Wait Protocol:


1) Propagation Delay:
 The time it takes for a signal to travel from the sender to the receiver
through the transmission medium.
 It depends on the distance between the sender and receiver and the speed
of signal propagation (typically close to the speed of light in the medium).

2) Transmission Delay:

 The time it takes to transmit all bits of a frame onto the communication
medium.
 It depends on the size of the frame and the bandwidth of the channel.

 Transmission Delay = Frame Size (in bits) /


Channel Bandwidth (in bits per second)

Efficiency vs. Throughput


1) Efficiency:
 Efficiency refers to the proportion of the total transmission time that is
effectively used to send the actual data (useful information), excluding the

Aamish Ali
BSSE 6th
23925
time spent on overheads like acknowledgments, retransmissions, or idle
periods.
 Mathematically:
Efficiency = Time spent sending data / Total time (including
waiting and overhead)

2) Throughput:
 Throughput is the actual rate of successful data delivery over the
communication channel, usually measured in bits per second (bps).
 It accounts for the total amount of data transmitted, including
retransmissions and overhead.
 Throughput is affected by factors like channel bandwidth, noise, and
protocol overhead.

Q. 2: Explain the following protocol and describe the working of these


protocols.

(I) DHCP - Dynamic Host Configuration Protocol:


Purpose: DHCP is used to dynamically assign IP addresses and other network
configuration details (e.g., subnet mask, gateway, DNS server) to devices in a
network.
How it Works:
1. DHCP Discovery: A client sends a broadcast message (DHCPDISCOVER) to
locate a DHCP server.
2. DHCP Offer: The server responds with an offer (DHCPOFFER) that includes
an IP address and configuration details.
3. DHCP Request: The client sends a request (DHCPREQUEST) to accept the
offered address.
4. DHCP Acknowledgment: The server confirms the allocation (DHCPACK),
and the client can now use the assigned IP address.

(II) ARP - Address Resolution Protocol:


Purpose: ARP is used to map an IP address to its corresponding MAC (Media
Access Control) address within the same local network.
How it Works:

Aamish Ali
BSSE 6th
23925
1. A device broadcasts an ARP request on the network asking, “Who has this
IP address? Tell me your MAC address.”
2. The device with the matching IP responds with an ARP reply, providing its
MAC address.
3. The requesting device caches the IP-to-MAC mapping for future use.

(III) RIP - Routing Information Protocol:


Purpose: RIP is a distance-vector routing protocol used to determine the best
route for data to travel across a network. It uses hop count as the metric to
measure distance.
How it Works:
1. Routers using RIP share their routing tables with neighboring routers at
regular intervals (default is every 30 seconds).
2. Each router updates its routing table based on the received information,
adding routes with the lowest hop count.
3. RIP has a maximum hop count of 15, meaning it is suitable for smaller
networks.

(IV) ICMP – Internet Control Message Protocol:


Purpose: ICMP is used for error reporting and diagnostic functions in network
communication. It helps detect issues like unreachable hosts or congestion.
How it Works:
1. ICMP messages are generated by devices (e.g., routers) when errors occur,
such as "Destination Unreachable" or "Time Exceeded."
2. These messages are sent back to the source to provide feedback about the
issue.
3. Tools like ping and traceroute rely on ICMP to test connectivity and
measure paths.

(V) IGMP - Internet Group Management Protocol:


Purpose: IGMP is used in IPv4 networks to manage multicast group memberships.
It enables efficient delivery of data to multiple devices (e.g., for streaming video).
How it Works:
1. A host sends an IGMP membership report to join a multicast group.
2. Routers track group memberships and ensure multicast data is sent only to
networks with active members of the group.

Aamish Ali
BSSE 6th
23925
3. When a host leaves the group, it sends a leave report, and routers update
their group membership records accordingly.

Q. 3: Describe the operation of the following error detection


techniques.

(I) Vertical Redundancy Check (VRC)


Also Known As: Parity Check
Purpose: To detect single-bit errors in transmitted data.
Operation:
1. In VRC, a parity bit is added to each data unit (e.g., a byte).
2. The parity bit ensures that the total number of 1s in the data unit is either:
o Even (even parity)
o Odd (odd parity)
3. At the receiver’s end, the parity is recalculated. If it does not match the
transmitted parity, an error is detected.
Example:
 Data: 1101
 Even Parity: Add 0 → 11010 (Total 1s = 2)
 Odd Parity: Add 1 → 11011 (Total 1s = 3)
Limitation: Cannot detect errors involving an even number of bit flips.

(II) Longitudinal Redundancy Check (LRC)


Purpose: To detect errors by adding a parity bit for each column of a data block.
Operation:
1. Data is organized in a table (rows and columns).
2. A parity bit is calculated for each column (Longitudinal Check Character or
LRC).
3. The LRC is appended to the data block as an additional row.
4. At the receiver, both VRC (row-wise parity) and LRC (column-wise parity)
are checked.
Example:
Original Data:
YAML
Copy code

Aamish Ali
BSSE 6th
23925
1101
1001
1110
LRC (Column Parity): 1010
Limitation: More effective than VRC but cannot detect all error types (e.g., burst
errors).

(III) Cyclic Redundancy Check (CRC)


Purpose: A robust method for detecting errors in large data blocks.
Operation:
1. A fixed-length binary sequence (the generator polynomial) is chosen.
2. The data block is treated as a long binary number.
3. The sender divides the data by the generator polynomial using binary
division and appends the remainder (CRC bits) to the data.
4. The receiver performs the same division:
o If the remainder is 0, the data is error-free.
o Otherwise, an error is detected.
Example:
 Data: 110101
 Generator Polynomial: 101
 CRC (Remainder): 10
 Transmitted Data: 11010110
Strength: Detects burst errors efficiently.

(IV) Checksum
Purpose: To detect errors in data transmitted over networks.
Operation:
1. The data is divided into fixed-size blocks.
2. Each block is treated as a number, and all numbers are summed using
binary addition.
3. The sum is complemented (1’s complement) to form the checksum, which
is appended to the data.
4. At the receiver, the data blocks and checksum are summed:
o If the result is all 1s (no carry), the data is error-free.
o Otherwise, an error is detected.
Example:
 Data Blocks: 1010, 0110, 1001

Aamish Ali
BSSE 6th
23925
 Binary Sum: 11011
 1’s Complement (Checksum): 00100
 Transmitted Data: 1010 0110 1001 00100
Limitation: Less robust than CRC for burst errors.

Q. 4: Explain the difference between the following multiplexing types.

(I) Frequency Division Multiplexing (FDM):


FDM divides the available bandwidth of a channel into multiple smaller frequency
bands. Each frequency band is assigned to a separate signal, and all signals are
transmitted simultaneously.
Working:
 Each signal is modulated to a different carrier frequency.
 The signals are combined and transmitted together.
 At the receiver, signals are demodulated and separated using bandpass
filters.
Applications:
 Radio and television broadcasting.
 Analog communication systems.
Advantages:
 All signals are transmitted simultaneously.
 Suitable for continuous data transmission.
Disadvantages:
 Cross-talk between channels can occur.
 Bandwidth allocation is fixed, even if a channel is idle.

(II) Time Division Multiplexing (TDM):


TDM divides the time available in the communication channel into time slots.
Each signal is assigned a unique time slot to use the channel sequentially.
Working:
 Signals are sampled and interleaved in time slots.
 At the receiver, the signals are de-multiplexed by assigning the
corresponding time slots back to their respective signals.
Types:
1. Synchronous TDM: Time slots are pre-allocated and fixed.

Aamish Ali
BSSE 6th
23925
2. Asynchronous TDM (Statistical TDM): Time slots are dynamically assigned
based on demand.
Applications:
 Digital telecommunication systems.
 Computer networks.
Advantages:
 More efficient than FDM for digital signals.
 No need for separate frequency bands.
Disadvantages:
 Delays can occur if demand exceeds channel capacity.
 Time slots may be wasted if a channel is idle.

(III) Wavelength Division Multiplexing (WDM):


WDM is used in optical fiber communication to multiplex multiple data streams
on different wavelengths (colors) of light within the same optical fiber.
Working:
 Data is transmitted using lasers of different wavelengths (frequencies of
light).
 These signals are combined and transmitted through the same optical fiber.
 At the receiver, signals are separated using optical filters.
Types:
1. CWDM (Coarse WDM): Uses fewer, widely spaced wavelengths.
2. DWDM (Dense WDM): Uses more, closely spaced wavelengths for higher
capacity.
Applications:
 High-speed optical communication.
 Long-distance and high-capacity data transmission.
Advantages:
 Very high data transmission rates.
 Efficient use of the optical fiber.
Disadvantages:
 Expensive equipment required (e.g., lasers, optical filters).
 Complex setup and maintenance.

Aamish Ali
BSSE 6th
23925
Q. 5: A Multinational company requires its IPv4 private address range
192.168.0.0/16 to cover a minimum of 6 sites covering a minimum of
6012 devices/users per site.

(A) Design an IP addressing scheme which will accommodate these


requirements.

The company needs to cover a minimum of 6 sites. Therefore, we need a


minimum of 6 subnets.

 Each site requires a minimum of 6012 devices/users.


 To accommodate this, we need to find a subnet mask that allows for at
least 6012 hosts per subnet.
 Add 2 IPs for the network address and broadcast address, so we need
6012+2=60146012 + 2 = 60146012+2=6014 IPs per subnet.
 The closest power of 2 greater than 6014 is 213=81922^{13} =
8192213=8192.
 Subnet mask: /19 (13 bits for hosts).

Clearly identify, showing your work, the subnet mask used.

 Subnet Mask: 255.255.224.0 (/19).


 This provides 232−19=81922^{32 - 19} = 8192232−19=8192 total addresses per
subnet.
 Usable hosts: 8192−2=81908192 - 2 = 81908192−2=8190 (sufficient for 6012
devices/users).

For the first TWO subnets and the last TWO subnets detail the following
i. Network address;
ii. First host IP address;
iii. Final host IP address
iv. Broadcast address
v. Actual number of available hosts
Aamish Ali
BSSE 6th
23925
First Two Subnets
Subnet 1:
 Network Address: 192.168.0.0
 First Host IP: 192.168.0.1
 Final Host IP: 192.168.31.254
 Broadcast Address: 192.168.31.255
 Available Hosts: 8190
Subnet 2:
 Network Address: 192.168.32.0
 First Host IP: 192.168.32.1
 Final Host IP: 192.168.63.254
 Broadcast Address: 192.168.63.255
 Available Hosts: 8190

Last Two Subnets


Subnet 7:
 Network Address: 192.168.192.0
 First Host IP: 192.168.192.1
 Final Host IP: 192.168.223.254
 Broadcast Address: 192.168.223.255
 Available Hosts: 8190
Subnet 8:
 Network Address: 192.168.224.0
 First Host IP: 192.168.224.1
 Final Host IP: 192.168.255.254
 Broadcast Address: 192.168.255.255
 Available Hosts: 8190

Aamish Ali
BSSE 6th
23925
Aamish Ali
BSSE 6th
23925

You might also like