0% found this document useful (0 votes)
39 views13 pages

Computer Networks Both Midsem Solution: Part A

Uploaded by

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

Computer Networks Both Midsem Solution: Part A

Uploaded by

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

Computer Networks both midsem solution

Part A
1. Explain TDMA and FDMA with a suitable graph and give practical examples for each.
Ans- TDMA divides a communication channel into time slots and assigns each user a specific time slot to
transmit data, while FDMA divides a communication channel into frequency bands and assigns each user a
specific frequency band to transmit data. Practical examples of TDMA include 2G and 3G cellular networks,
while practical examples of FDMA include analog radio and television broadcasting and some satellite
communication systems.

2. Describe the information a trailer of a frame does contain

Ans- A trailer of a frame contains error detection and control information, such as the Frame Check
Sequence (FCS), End of Frame (EOF) delimiter, and padding. The trailer is added to the end of a data frame
and is important for ensuring the accuracy and integrity of the data being transmitted. By adding error
detection and control information, the receiving device can verify that the data received is correct and can
request retransmission of any frames that contain errors.

3. With a suitable example, explain two cases where (1) simple parity check passes and (ii) simple
parity check fails.
Ans- Simple parity check is a basic error detection method that adds a single bit, called the parity bit, to a
block of data. Here are two examples:
Simple parity check passes: Suppose the sender wants to transmit the binary number 01101011 to the
receiver using simple parity check. The sender adds a 0 as the parity bit, since the number of 1s in the data
block is even. The receiver counts the number of 1s and checks the parity bit, which is correct. Simple
parity check passes.
Simple parity check fails: Suppose the sender wants to transmit the binary number 01101101 to the
receiver using simple parity check. The sender adds a 0 as the parity bit, since the number of 1s in the data
block is even. During transmission, one of the bits is flipped, resulting in the received block 011011110. The
receiver counts the number of 1s and checks the parity bit, which is incorrect. Simple parity check fails to
detect the error.
4. Discuss the differences between ISO OSI Reference model and TCP/IP Reference model.
Ans-

5. Explain how framing uses in the data link layer.


Ans- Framing is the process of breaking up a stream of data into small manageable chunks, called frames, at
the data link layer of the OSI model. Each frame is then transmitted individually over the physical medium,
and the receiver reassembles the frames into the original stream of data.
The main purpose of framing is to allow the receiver to identify the start and end of each frame, and to
distinguish between different frames in the same transmission. This is accomplished by adding header and
trailer information to each frame that includes control information such as the source and destination
addresses, sequence numbers, and error detection codes. By using framing, the data link layer can ensure
the reliable transmission of data over the physical medium.

6. Describe the limitation of the 2D Parity check code.


Ans- 2D parity check is an error detection code that adds an extra row and column of parity bits to a block
of data. The parity bits are used to detect errors that occur during transmission, but there are some
limitations to this code:
1. Limited error correction: The 2D parity check code can only detect errors, but cannot correct them. If
errors are detected, the receiver must request retransmission of the data block.
2. Limited error detection: The 2D parity check code can only detect errors that affect an odd number of
bits in the data block. If an even number of bits are in error, the code will not detect the errors.
3. Overhead: The 2D parity check code adds an extra row and column of parity bits to the data block, which
increases the overhead and reduces the effective data rate.

7. Which layer and sublayer is responsible for flow control?


Ans- The data link layer, specifically the Media Access Control (MAC) sublayer, is responsible for flow
control. The MAC sublayer ensures that the sender does not overwhelm the receiver with too much data by
implementing flow control mechanisms such as sliding window or token passing.

8. Can a receiver receive out of order frames in Go Back N ArQ mechanism?


Ans- In the Go-Back-N Automatic Repeat Request (ARQ) mechanism, the sender can transmit multiple
frames without waiting for an acknowledgment from the receiver. However, the receiver must acknowledge
each received frame with a positive acknowledgment (ACK) or a negative acknowledgment (NACK).
If the receiver receives an out-of-order frame, it cannot acknowledge that frame until all previous frames
have been received and acknowledged. In this case, the receiver may buffer the out-of-order frame until
the missing frames are received and acknowledged. Once all missing frames are received and
acknowledged, the receiver can acknowledge the out-of-order frame along with the other received frames

9. How datagram will be encapsulated and decapsulated?


Ans- 5. Datagram encapsulation and decapsulation is done at the network layer of the OSI model.
Encapsulation involves adding a header and trailer to the original data to create a datagram that includes
information such as the source and destination IP addresses, protocol type, and error detection codes.
Decapsulation involves removing the header and trailer from the received datagram to extract the original
data and pass it up to the transport layer.

10. Explain burst error with an example.


Ans- A burst error is a type of error in which multiple bits in a data block are corrupted due to a physical
defect or interference in the transmission medium. Burst errors can be difficult to detect and correct using
simple error detection codes such as parity check or checksum.
For example, suppose a data block consisting of 100 bits is transmitted over a noisy channel, and a burst
error occurs that corrupts the last 10 bits of the block. If a simple parity check code is used to detect errors,
the code may not detect the burst error since the number of errors is still even (10). In contrast, a more
sophisticated error detection code such as cyclic redundancy check (CRC) can detect burst errors with a
high degree of accuracy.

11. What is the function of the TELNET?


Ans- TELNET is a protocol that provides a way for users to remotely access and control other computers
over a network. It allows users to log in and use a remote computer as if they were physically present at the
remote location. TELNET can be used to execute commands, transfer files, and access resources on remote
systems.

12. Write about the Country Domains in DNS?


Ans- Country domains in the Domain Name System (DNS) are top-level domains (TLDs) that are reserved
for specific countries or territories. These country-code TLDs (ccTLDs) are identified by a two-letter code
that represents the country or territory, such as .us for the United States, .uk for the United Kingdom, or .cn
for China. Each country or territory is responsible for managing and maintaining its ccTLD.

13. What is the role of IP addresses in the network layer, and how do they help in delivering data
packets to the correct destination?
Ans- IP addresses are unique identifiers assigned to devices on a network. In the network layer, IP
addresses are used to route data packets to the correct destination. Each data packet contains the source
and destination IP addresses, allowing routers to forward the packet from one network to another until it
reaches its intended destination. IP addresses also help to ensure that data packets are delivered in the
correct order and that each packet is delivered only once.

14. How does the transport layer ensure data reliability and integrity during transmission?
Ans- The transport layer ensures data reliability and integrity during transmission by using various protocols
such as Transmission Control Protocol (TCP) and User Datagram Protocol (UDP). TCP provides reliable
delivery of data by establishing a virtual connection between the sender and receiver, ensuring that all
packets are received and in the correct order. TCP also includes mechanisms for error detection and
correction, flow control, and congestion control. UDP, on the other hand, provides a lightweight transport
protocol that does not guarantee reliable delivery but can be faster and more efficient for certain types of
applications.
15. An IP machine Q has a path to another IP machine H via three IP routers R1, R2, and R3.
Q-R1-R2-R3-H
H acts as an HTTP server, and Q connects to H via HTTP and downloads a file. Session layer
encryption is used, with DES as the shared key encryption protocol. Consider the following four
pieces of information:
[11] The URL of the file downloaded by Q
[12] The TCP port numbers at Q and H
[13] The IP addresses of Q and H
[14] The link layer addresses of Q and H
Which of 11, 12, 13, and 14 can an intruder learn through sniffing at R2 alone? Explain.
Ans- An intruder sniffing at router R2 can potentially learn the IP addresses of both Q and H (information
13) as well as the link layer addresses of Q and R2, but not the link layer address of H. The URL of the file
downloaded by Q (information 11) and the TCP port numbers at Q and H (information 12) are encrypted at
the session layer using DES, so the intruder would not be able to read or understand this information.
16. Describe the differences between Subnetting and Supernetting.
Ans- Subnetting and supernetting are both techniques used in IP address management. Subnetting involves
dividing a single network into multiple smaller subnetworks, each with its own network address. This
allows for better utilization of IP addresses and can improve network performance and security.
Supernetting, on the other hand, involves combining multiple networks into a single larger network with a
single network address. This can simplify network management and reduce the size of routing tables.

17. What is time-to-live or packet lifetime?


Ans- Time-to-live (TTL) or packet lifetime is a field in the IP header that specifies the maximum number of
routers a packet can pass through before being discarded. This helps to prevent packets from circulating
indefinitely in a network and wasting network resources.

18. What is the use of routing table?


Ans- A routing table is a data structure used by routers to determine the best path for forwarding data
packets to their destination. It contains a list of network destinations, the associated next hop router, and
the corresponding cost or metric of the path.

19. What is a virtual circuit?


Ans- A virtual circuit is a logical connection that is established between two network devices to facilitate
communication. It can be thought of as a virtual pipe that carries data between the devices, similar to a
physical circuit. Virtual circuits are often used in packet-switched networks such as Frame Relay and ATM.

20. Does the wraparound situation create a problem in a network.


Ans- The wraparound situation can create a problem in a network when the value of a packet's TTL field
reaches zero and the packet is discarded by a router. If a packet is unable to reach its destination because it
has travelled too many hops, it may be discarded by a router and never reach its intended destination.

Part B
1. What is an IP address? Compare classful address and classless address.
Ans- An IP address (Internet Protocol address) is a unique numerical identifier assigned to each device
connected to a computer network that uses the Internet Protocol for communication. It is used to identify
and locate devices on a network and enable data communication between them.
An IP address consists of a series of four numbers separated by periods, each number ranging from 0 to
255. For example, 192.168.1.1 is an example of an IP address.
2. Explain the Recursive Resolution and Iterative Resolution with proper analysis?
Ans- Recursive Resolution and Iterative Resolution are two methods used by the Domain Name System
(DNS) to resolve domain names into IP addresses.

• Recursive Resolution:
In Recursive Resolution, the DNS resolver client sends a request to the DNS server, asking for the IP address
of a domain name. If the DNS server does not know the IP address, it sends the request to another DNS
server until it finds the IP address or reaches the root DNS server. The root DNS server is the highest-level
DNS server in the hierarchy of DNS servers. Once the root DNS server finds the IP address, it sends the
response back to the DNS server that made the request, which in turn sends it back to the DNS resolver
client. This process is called recursive resolution because the DNS server resolves the entire query on behalf
of the DNS resolver client.
The recursive resolution method is used when the DNS resolver client wants to receive the final answer
from the DNS server without having to send multiple queries.

• Iterative Resolution:
In Iterative Resolution, the DNS resolver client sends a request to the DNS server, asking for the IP address
of a domain name. If the DNS server does not know the IP address, it sends a referral response to the DNS
resolver client, containing the IP address of another DNS server that may be able to resolve the domain
name. The DNS resolver client then sends a query to the new DNS server, and the process continues until
the IP address is found. This process is called iterative resolution because the DNS server only provides the
IP address of another DNS server, and the DNS resolver client has to iterate through multiple servers until it
gets the final answer.
The iterative resolution method is used when the DNS resolver client wants to control the query process
and get multiple answers from different DNS servers.
3. What are the different types of routing algorithms used in the network layer, and how do they
differ in terms of their complexity, efficiency, and suitability for different network topologies?
Ans- There are three main types of routing algorithms used in the network layer:

• Distance vector algorithm:


It is a simple algorithm that calculates the distance between nodes based on the number of hops to
the destination. Each node maintains a table that contains the distance to all other nodes in the
network. The algorithm updates the table by exchanging information with its neighbors. The main
disadvantage of this algorithm is the slow convergence time, as it takes a long time for the tables to
converge. It is suitable for small networks with simple topologies.
• Link-state algorithm:
It is a more complex algorithm that calculates the shortest path to the destination based on the
complete topology of the network. Each node maintains a database that contains the status of all
links in the network. The algorithm updates the database by flooding the network with link-state
packets. The main advantage of this algorithm is the fast convergence time, as the tables converge
quickly. It is suitable for large networks with complex topologies.
• Path-vector algorithm:
It is an advanced algorithm that is used in border gateway protocol (BGP) to route traffic between
autonomous systems. It uses a combination of distance vector and link-state algorithms to calculate
the best path to the destination. Each node maintains a table that contains the path to all other
nodes in the network. The algorithm updates the table by exchanging information with its
neighbours. The main advantage of this algorithm is its scalability and flexibility. It is suitable for
large networks with complex topologies.

4. What are the subnet addresses of the respective subnets if an address of 17.12.14.29 arrives in
the first subnet, an address of 17.12.14.34 arrives in the second subnet and an address of
17.12.14.50 arrives in the third subnet.
Ans-

5. A pure ALOHA network transmits 200-bit frames on a shared channels of 200kbps. What is the
throughput if the system (all stations together) produces
a. 1000 frames per second?
b. 500 frames per second?
c. 250 frames per second?
Ans- The throughput of a pure ALOHA network can be calculated using the following formula:
Throughput = G * e^(-2G)
Where G is the offered load, i.e., the rate at which frames are generated by all stations together.
a. For 1000 frames per second, the offered load (G) is 1000 * 200 = 200000 bits per second.
Throughput = 200000 * e^(-2*200000) = 14.85 kbps
b. For 500 frames per second, the offered load (G) is 500 * 200 = 100000 bits per second.
Throughput = 100000 * e^(-2*100000) = 9.34 kbps
c. For 250 frames per second, the offered load (G) is 250 * 200 = 50000 bits per second.
Throughput = 50000 * e^(-2*50000) = 3.69 kbps
Therefore, as the offered load decreases, the throughput of the pure ALOHA network also decreases.

6. List the various risks faced by messages that are transmitted over internet.
Ans- There are various risks faced by messages that are transmitted over the internet, including:
1. Eavesdropping: This refers to the unauthorized interception of messages being transmitted over the
internet, which can compromise the confidentiality of the message.
2. Data Modification: This involves unauthorized modification of data as it is transmitted over the internet,
which can lead to the message being tampered with.
3. Denial of Service (DoS) Attacks: This type of attack involves overwhelming a network or website with
traffic in order to make it unavailable to users, preventing them from accessing the information they need.
4. Malware: Malware is any type of malicious software that can be used to compromise a computer or
network, including viruses, trojan horses, and spyware.
5. Phishing: This is a type of social engineering attack where attackers use deceptive emails, websites, or
other means to trick users into revealing sensitive information such as passwords, credit card numbers, or
other personal data.
6. Man-in-the-Middle Attacks: This involves intercepting communication between two parties and
impersonating one or both of them in order to steal sensitive information.
7. IP Spoofing: This involves falsifying IP addresses to conceal the identity of the attacker or to impersonate
someone else on the network.
8. Password Attacks: Password attacks involve trying to guess or steal passwords in order to gain access to a
system or network. This can be done through brute force attacks, social engineering, or other means.
9. DNS Spoofing: This involves redirecting users to fake websites or other destinations by altering the DNS
(Domain Name System) settings on a network.
10. Packet Sniffing: This refers to the interception and analysis of network traffic in order to extract
information from it, which can be used to compromise the security of the network or steal sensitive data.

7. Contrast between Pure ALOHA and Slotted ALOHA and discuss about their vulnerable time.
Ans- Pure ALOHA and Slotted ALOHA are two types of random access protocols used for sharing a
communication channel in a network.
Pure ALOHA was the first random access protocol developed for sharing a communication channel, and
Slotted ALOHA is an improvement over Pure ALOHA. The key difference between the two is the way they
handle the transmission of frames.
In Pure ALOHA, a station transmits a frame as soon as it has data to send. There is no coordination between
the stations, which can lead to collisions if two or more stations transmit at the same time. If a collision
occurs, the stations involved must wait for a random period before attempting to transmit again. This
results in wasted bandwidth and reduced throughput. The vulnerable time in Pure ALOHA is equal to the
time required to transmit a frame.
In Slotted ALOHA, the transmission time is divided into fixed time slots, and each station is allowed to
transmit only at the beginning of a time slot. This ensures that there are no collisions within a time slot.
However, collisions can still occur between time slots. If a collision occurs, the stations involved must wait
for a random number of time slots before attempting to transmit again. The vulnerable time in Slotted
ALOHA is equal to the time required to transmit one time slot.

8. Contrast between non-persistent CSMA, 1-persistent CSMA, and p-persistent CSMA.


Ans-
Part C
1. What is the use of ARP? Discuss ARP operation and packet format.
Ans- ARP (Address Resolution Protocol) is a protocol used to map an IP address to a physical (MAC) address
in a local network. The primary function of ARP is to provide a mapping between IP addresses and MAC
addresses to enable communication between devices on the same local network. ARP operates at the Data
Link Layer (Layer 2) of the OSI model.
ARP Operation:
The ARP protocol operates using two types of messages: ARP request and ARP reply.
1. ARP Request: When a device (host) wants to send data to another device on the same network, it first
checks its ARP cache to see if it already has the MAC address of the destination device. If it does not have
the MAC address, it sends an ARP request message to all devices on the network asking for the MAC
address of the destination device.
2. ARP Reply: The device that has the requested IP address responds with an ARP reply message containing
the MAC address. The source device then updates its ARP cache with the MAC address of the destination
device.
ARP Packet Format:
An ARP packet consists of four fields:
1. Hardware Type: This field specifies the type of hardware used by the network (Ethernet, Wi-Fi, etc.).
2. Protocol Type: This field specifies the type of protocol used by the network (IPv4, IPv6, etc.).
3. Hardware Address Length: This field specifies the length of the hardware address (MAC address) in bytes.
4. Protocol Address Length: This field specifies the length of the protocol address (IP address) in bytes.
In addition to the above fields, the ARP packet also contains the following fields:
1. Sender Hardware Address: This field contains the MAC address of the device sending the ARP packet.
2. Sender Protocol Address: This field contains the IP address of the device sending the ARP packet.
3. Target Hardware Address: This field contains the MAC address of the device being queried.
4. Target Protocol Address: This field contains the IP address of the device being queried.
The ARP packet is encapsulated in a Data Link Layer (Layer 2) frame and transmitted on the network.
Overall, ARP is a crucial protocol for enabling communication between devices on the same local network
by providing a mapping between IP addresses and MAC addresses.

2. Analyse the different aspects of following segments with respect to TCP. Also find the correlation
of ISN and 3-way handshake with this block.
Ans-
3. Explain Sliding Window protocol and use it to show how Go- back-N ARQ works. Also judge how
Go-back-N ARQ is better than Stop-and-Wait ARQ.
Ans- Sliding Window protocol is a flow control protocol used in data communication networks. It is a
method of controlling the flow of data between the sender and the receiver. In this protocol, the sender
can send multiple packets to the receiver without waiting for the acknowledgment of each packet. The
receiver sends an acknowledgment to the sender for the packets received successfully.
Go-Back-N ARQ (Automatic Repeat Request) is a protocol used in data communication networks for error
control. It uses Sliding Window protocol for flow control. It is a sender-based error recovery protocol,
where the sender retransmits the lost packets without waiting for the acknowledgment of the receiver. The
receiver discards the out of order packets and sends a negative acknowledgment (NAK) to the sender to
request the retransmission of the missing packets.
In Go-Back-N ARQ, the sender maintains a window of size N, which is the maximum number of packets that
can be transmitted without acknowledgment. The receiver sends an acknowledgment for each packet
received successfully. If the sender does not receive the acknowledgment within a specified time period, it
assumes that the packet is lost and retransmits all the packets in the window. The receiver buffers the out
of order packets until it receives the missing packets.
The following steps are involved in Go-Back-N ARQ protocol:
1. Sender sends N packets and starts a timer.
2. Receiver sends an acknowledgment for each packet received successfully.
3. If the sender receives the acknowledgment for all N packets within the timer period, it sends the next N
packets.
4. If the sender does not receive the acknowledgment for any packet within the timer period, it retransmits
all the packets in the window and restarts the timer.
5. If the receiver receives an out of order packet, it buffers the packet until it receives the missing packets.
6. If the receiver detects an error in a packet, it discards the packet and sends a NAK to the sender for the
missing packets.
Go-Back-N ARQ is better than Stop-and-Wait ARQ because in Stop-and-Wait ARQ, the sender has to wait
for the acknowledgment of each packet before sending the next packet, which reduces the bandwidth
utilization. In Go-Back-N ARQ, the sender can send multiple packets without waiting for the
acknowledgment, which increases the bandwidth utilization. Also, Go-Back-N ARQ is more efficient in
networks with high error rates because it reduces the number of retransmissions compared to Stop-and-
Wait ARQ.

4. How would you analyse and apply your knowledge of advanced digital communication techniques
to draw the data 101110001010 in the following line coding schemes: a) Differential Manchester
coding, b) Manchester coding, c) Bipolar NRZ, and d) Unipolar, with the goal of differentiating the
advantages and disadvantages of each scheme in terms of efficiency, reliability,
and noise immunity.
Ans- Line coding is a method used to convert digital data into a format suitable for transmission over
communication channels. Different line coding schemes have different characteristics, such as efficiency,
reliability, and noise immunity. In this case, we will analyze four different line coding schemes, namely
Differential Manchester coding, Manchester coding, Bipolar NRZ, and Unipolar, to encode the data
101110001010.
1. Differential Manchester Coding:
In Differential Manchester coding, a transition in the middle of a bit indicates a binary 0, whereas no
transition in the middle of a bit indicates a binary 1. The encoded data for the given sequence is shown
below:
Data: 1 0 1 1 1 0 0 0 1 0 1 0
Encoding: 10 01 10 10 10 01 01 01 10 01 10 01
Advantages:
- The encoding is self-synchronizing, which means that the receiver can easily synchronize with the
incoming data.
- It has a DC component of zero, which means that the signal does not have a constant component and is
easier to transmit over long distances.
Disadvantages:
- It requires more bandwidth than other coding schemes as each bit requires two transitions.
- It is more complex than other coding schemes and requires more processing power to decode.
2. Manchester Coding:
In Manchester coding, each bit is divided into two halves, and a transition in the middle of the bit indicates
a binary 1, whereas no transition in the middle of the bit indicates a binary 0. The encoded data for the
given sequence is shown below:
Data: 1 0 1 1 1 0 0 0 1 0 1 0
Encoding: 01 10 01 01 01 10 10 10 01 10 01 10
Advantages:
- It has a constant DC component of zero, which makes it easier to transmit over long distances.
- It has a higher data rate than Differential Manchester coding, as each bit requires only one transition.
Disadvantages:
- It requires more bandwidth than other coding schemes as each bit requires two signal changes.
- It is more complex than other coding schemes and requires more processing power to decode.
3. Bipolar NRZ:
In Bipolar NRZ, a binary 1 is represented by a positive or negative pulse, whereas a binary 0 is represented
by no change in the signal level. The encoded data for the given sequence is shown below:

Data: 1 0 1 1 1 0 0 0 1 0 1 0
Encoding: + - + + + - - - + - + -
Advantages:
- It has a DC component of zero, which means that the signal does not have a constant component and is
easier to transmit over long distances.
- It is simpler than other coding schemes and requires less processing power to decode.
Disadvantages:
- It requires more bandwidth than other coding schemes as each bit requires two signal changes.
- It is not self-synchronizing, which means that the receiver must be synchronized with the incoming data.
4. Unipolar:
In Unipolar encoding, a binary 1 is represented by a positive pulse, whereas a binary 0 is represented by no
change in the signal level. The encoded data for the given sequence is shown below:
Data: 1 0 1 1 1 0 0 0 1 0 1 0
Encoding: + 0 + + + 0 0 0 + 0 + 0
Advantages:
- It is the simplest coding scheme as each bit requires only one signal change.
- It requires less bandwidth than other coding schemes.
Disadvantages:
- It has a constant DC component, which means that the signal may be affected by noise and interference.
- It is not self-synchronizing, which means that the receiver must be synchronized with the incoming data.

Comparing the four line coding schemes in terms of efficiency, reliability, and noise immunity, it can be
seen that Differential Manchester and Manchester coding schemes have higher efficiency and reliability
than Bipolar NRZ and Unipolar schemes. However, Bipolar NRZ and Unipolar schemes have better noise
immunity than Differential Manchester and Manchester coding schemes. Additionally, Differential
Manchester and Manchester coding schemes require more bandwidth than Bipolar NRZ and Unipolar
schemes. Overall, the choice of line coding scheme depends on the specific requirements of the
communication system, such as data rate, transmission distance, noise immunity, and available bandwidth.

You might also like