ABES Engineering College, Ghaziabad
B. Tech Even Semester Sessional Test-3
Printed Pages:02
Session: 2023-24
Course Code: KCS - 603 Roll No.:
Course Name: Computer Networks Time: 1.30 Hrs.
Maximum Marks: 40
Instructions:
1. Attempt All sections.
2. If require any missing data, then choose suitably.
Section – A
1(a). Discuss UDP and TCP in context of header format.
Characteristics UDP TCP
Description
Acronym for User Datagram Transmission
Protocol or Control Protocol
Universal Datagram
General Description Simple High speed Full-featured
low functionality protocol that
"wrapper" that allows
interface applications to
applications to the send data
network layer and reliably without
does little else worrying about
network layer
issues.
Protocol connection Connection less; data Connection-
Setup is sent without setup oriented;
Connection must
be Established
prior to
transmission.
Characteristics UDP TCP
Description
Data interface to Message base-based is Stream-based; data
application sent in discrete is sent by the
packages by the application with
application. no particular
structure
Reliability and Unreliable best-effort Reliable delivery
Acknowledgements delivery without of message all
acknowledgements data is
acknowledged.
Retransmissions Not performed. Delivery of all
Application must data is managed,
detect lost data and and lost data is
retransmit if needed. retransmitted
automatically.
Features Provided to None Flow control using
Manage flow of sliding windows;
Data window size
adjustment
heuristics;
congestion
avoidance
algorithms
Overhead Very Low Low, but higher
than UDP
Transmission speed Very High High but not as
high as UDP
Data. Quantity Small to moderate Small to very large
Suitability amounts of data. amounts of data.
1(b) Discuss TCP window management in detail.
2(A) What do you understand by QoS parameters? List various quality of service
parameters.
Quality-of-Service (QoS) refers to traffic control mechanisms that seek to either differentiate performance
based on application or network-operator requirements or provide predictable or guaranteed performance to
applications, sessions, or traffic aggregates. Basic phenomenon for QoS means in terms of packet delay and
losses of various kinds.
Need for QoS –
Video and audio conferencing require bounded delay and loss rate.
Video and audio streaming requires bounded packet loss rate, it may not be so sensitive to delay.
Time-critical applications (real-time control) in which bounded delay is considered to be an important factor.
Valuable applications should be provided better services than less valuable applications.
QoS requirements can be specified as:
Goodput
Due to varying load from disparate users sharing the same network resources, the maximum throughput that
can be provided to a certain data stream may be too low for real-time multimedia services.
Packet loss
The network may fail to deliver (drop) some packets due to network congestion. The receiving application
may ask for this information to be retransmitted, possibly resulting in congestive collapse or unacceptable
delays in the overall transmission.
Errors
Sometimes packets are corrupted due to bit errors caused by noise and interference, especially in wireless
communications and long copper wires. The receiver has to detect this, and, just as if the packet was dropped,
may ask for this information to be retransmitted.
Latency
It might take a long time for each packet to reach its destination because it gets held up in long queues, or it
takes a less direct route to avoid congestion. In some cases, excessive latency can render an application such
as VoIP or online gaming unusable.
Packet delay variation
Packets from the source will reach the destination with different delays. A packet's delay varies with its
position in the queues of the routers along the path between source and destination, and this position can vary
unpredictably. Delay variation can be absorbed at the receiver, but in so doing increases the overall latency
for the stream.
Out-of-order delivery
When a collection of related packets is routed through a network, different packets may take different routes,
each resulting in a different delay. The result is that the packets arrive in a different order than they were sent.
This problem requires special additional protocols for rearranging out-of-order packets. The reordering
process requires additional buffering at the receiver, and, as with packet delay variation, increases the overall
latency for the stream.
2(b) Define traffic shaping. Elaborate leaky bucket and token bucket algorithm used
for congestion control.
Traffic shaping is used to control bandwidth of the network to ensure quality of service to business-critical
applications. It can be validated at:
Port group level
Virtual or distributed virtual switch
This technique uses three parameters to shape the flow of network traffic:
1. Burst size
2. Average bandwidth
3. Peak bandwidth
Token bucket algorithm is one of the techniques for congestion control algorithms. When too many packets
are present in the network it causes packet delay and loss of packet which degrades the performance of the
system. This situation is called congestion.
The network layer and transport layer share the responsibility for handling congestions. One of the most
effective ways to control congestion is trying to reduce the load that transport layer is placing on the network.
To maintain this network and transport layers have to work together. The Token Bucket Algorithm is
diagrammatically represented as follows –
Token Bucket Algorithm
The leaky bucket algorithm enforces output patterns at the average rate, no matter how busy the traffic is. So,
to deal with the more traffic, we need a flexible algorithm so that the data is not lost. One such approach is
the token bucket algorithm.
Let us understand this algorithm step wise as given below −
• Step 1 − In regular intervals tokens are thrown into the bucket f.
• Step 2 − The bucket has a maximum capacity f.
• Step 3 − If the packet is ready, then a token is removed from the bucket, and the packet is sent.
• Step 4 − Suppose, if there is no token in the bucket, the packet cannot be sent.
In figure (a) the bucket holds two tokens, and three packets are waiting to be sent out of the interface.
In Figure (b) two packets have been sent out by consuming two tokens, and 1 packet is still left.
When compared to Leaky bucket the token bucket algorithm is less restrictive that means it allows more
traffic. The limit of busyness is restricted by the number of tokens available in the bucket at a particular
instant of time.
The implementation of the token bucket algorithm is easy − a variable is used to count the tokens. For every
t seconds the counter is incremented and then it is decremented whenever a packet is sent. When the counter
reaches zero, no further packet is sent out.
This is shown in below given diagram −
Leaky Bucket Algorithm
Let see the working condition of Leaky Bucket Algorithm −
Leaky Bucket Algorithm mainly controls the total amount and the rate of the traffic sent to the network.
Step 1 − Let us imagine a bucket with a small hole at the bottom where the rate at which water is poured into
the bucket is not constant and can vary but it leaks from the bucket at a constant rate.
Step 2 − So (up to water is present in the bucket), the rate at which the water leaks does not depend on the
rate at which the water is input to the bucket.
Step 3 − If the bucket is full, additional water that enters into the bucket that spills over the sides and is lost.
Step 4 − Thus the same concept applied to packets in the network. Consider that data is coming from the
source at variable speeds. Suppose that a source sends data at 10 Mbps for 4 seconds. Then there is no data
for 3 seconds. The source again transmits data at a rate of 8 Mbps for 2 seconds. Thus, in a time span of 8
seconds, 68 Mb data has been transmitted.
That’s why if a leaky bucket algorithm is used, the data flow would be 8 Mbps for 9 seconds. Thus, the
constant flow is maintained.
3(a) The following is a dump of a UDP header in hexadecimal form:
04 47 00 0F 00 5E F2 19
What is the:
(a) Source port number
(b) Destination port number
(c) Total length of the UDP
(d) Length of data
(e) Is the packet directed from a client of a server or vice versa?
(f) What is the client process?
a) The source port number is the first four hexadecimal digits (0447), which means that the
source port number is 1095.
b) The destination port number is the second four hexadecimal digits (000F), which means
that the destination port number is 15
c) The third four hexadecimal digits (005E) defines the length of the whole UDP packet as
94 bytes.
d) The length of the data is the length of the whole packet minus the length of the header,
or 94 – 8 = 86 bytes.
e) Packet is directed from client to server.
f) no defined client process.
3(b) The following is a dump of TCP header in hexadecimal format:
00CD0018 00000EF1 00000D5D 502200D1 01BF0010
a) What is the source port number?
b) What is the destination port number?
c) What is the acknowledgment number?
d) What is the length of the header?
e) Which control bits are set and what do they represent?
f) What is the window size?
a) source port is 2 bytes take 00 CD = 205
b) next 2 bytes as destination address 00 18 == 24
next 4 bytes as sequence number 00 00 0E F1
c) next 4 bytes as ack 00 00 0D 5D == 3421
d) next 4 bits as HLEN 5 ==5 -- this indicates number of sets of 4 bytes which makes
the header length = 20 bytes.
e) next 6 bits are reserved i.e.0 =0000and 2 bits from hex 0
next 6 bits are control bits = remaining 2 bits from hex 0 and 4 bits of 2
control bits are: 100010 hence URG and SYN flags are valid.
f) next 2 bytes indicate the window length 00 D1 == 209 bytes
SECTION - B
4(a) Explain Symmetric and Asymmetric cryptography. Also, write the steps used in
RSA algorithm, demonstrate the transmission of character “F” using RSA.
Symmetric cryptography relies on algorithms that use a single key to encrypt and
decrypt information. In other words, the sender uses a secret key to encrypt the message.
Then, the recipients use the same key to decrypt and read the data. So, the key needs to be
shared across all parties that are authorized to decrypt the message.
Asymmetric cryptography relies on a pair of two separate but mathematically
connected keys. The first of them is called a public key. It’s used to encrypt the message
and it can be publicly shared. The second one is the private key. Its job is to decrypt the
data. The private key should be securely stored and shouldn’t be transferred at all.
Calculating the private key based on the public one is theoretically possible but practically
nearly unachievable.
RSA algorithm uses the following procedure to generate public and private keys:
1)Select p, q; p and q both prime, p≠ q.
2)Calculate n = p × q.
3)Calculate 𝜙 (n) = (p - 1) *(q - 1).
4) Select integer e; gcd (𝜙 (n), e) = 1; 1 < e < 𝜙 (n).
5) Calculate d; (d*e) mod𝜙 (n) ≡ 1.
Public key; PU = {e, n}. Private key: PR = {d, n}.
6) Cipher Text, C=Pe mod n
7) Plaintext, P = Cd mod n
Let p=3, q=11 and e= 7
n = p x q = 3 x 11 = 33
phi(n) = (p-1) x (q-1) = 2 x 10 = 20
gcd(phi(n), e) = gcd (20, 7) = 1
de=1mod(phi(n))
d7=1mod20
d=3
Public Key: (7,33)
Private Key: (3, 33)
Plaintext: F i.e., 6
C = 67 mod 33 = 27
4(b) Generate the public key and secret key for the following prime numbers using
RSA algorithm: P=3, Q=11 and E= 7.
RSA Algorithm:
1)Select p, q; p and q both prime, p≠ q.
2)Calculate n = p × q.
3)Calculate 𝜙 (n) = (p - 1) *(q - 1).
4) Select integer e; gcd(𝜙 (n), e) = 1; 1 < e < 𝜙 (n).
5) Calculate d; (d*e) mod𝜙 (n) ≡ 1.
Public key; PU = {e, n}. Private key: PR = {d, n}.
n = p x q = 3 x 11 = 33
phi(n) = (p-1) x (q-1) = 2 x 10 = 20
gcd(phi(n), e) = gcd (20, 7) = 1
de=1mod(phi(n))
d7=1mod20
d=3
Public Key: (7,33)
Private Key: (3, 33)
5 (a)
(i) Calculate the minimum positive integer p such that (3P modulo 17) = 1 [GATE CSE
2007]
(ii) Anarkali digitally signs a message and sends it to Salim. Verification of the signature
by Salim requires which key?
We know that in the digital signature, the sender encrypts the message by using her private key and
receiver decrypts the message by using the sender's public key. Hence verification of the signature by Salim
requires Anarkali's public key.
5(b) Consider different activities related to email:
m1: Send an email from a mail client to a mail server
m2: Download an email from mailbox server to a mail client
m3: Checking email in a web browser
Which is the application layer protocol used in each activity? Discuss each protocol in brief.
[GATE CSE 2011]
1. Sending an email from a mail client to a mail server (m1): - In this activity, the mail client
(such as Microsoft Outlook or Apple Mail) is used to compose an email and send it to the mail server.
- The application-level protocol used for this activity is SMTP (Simple Mail Transfer Protocol). -
SMTP is responsible for the transmission of email messages over the internet. It is used by the mail
client to establish a connection with the mail server and send the email.
2. Downloading an email from a mailbox server to a mail client (m2): - In this activity, the mail client
connects to the mailbox server to retrieve new emails. - The application-level protocol used for this
activity is POP (Post Office Protocol). - POP allows the mail client to access the mailbox server and
download emails. It is commonly used for retrieving emails from the server and storing them locally
on the client's device.
3. Checking email in a web browser (m3): - In this activity, the user accesses their emails using
a web browser, without the need for a separate mail client. - The application-level protocol used
for this activity is HTTP (Hypertext Transfer Protocol). - HTTP is the protocol used for
communication between web browsers and web servers. When checking email in a web browser,
the user interacts with a webmail interface provided by the email service provider, which uses
HTTP to retrieve and display emails.
6 (a) Answer the following questions related to DNS:
(i) How does DNS perform name resolution?
(ii) What are the different types of name servers?
(iii) Mention the DNS message format for query and reply messages?
(i) DNS performs name resolution by mapping human-readable domain names to IP addresses.
This is done through DNS resolution, which involves querying DNS servers for the IP address
associated with a given domain name.
(ii) There are several types of DNS servers, including:
• Root Name Servers
• Top-Level Domain (TLD) Name Servers
• Authoritative Name Servers
• Recursive DNS Servers
• (iii) DNS message format consists of a header section followed by question, answer, authority,
and additional sections. The format differs slightly for query and reply messages, but both
contain similar fields such as ID, flags, question count, answer count, etc.
6 (b) Write short note on:
(i) IMAP4
(ii) FTP
(iii) MIME
(iv) SNMP