Docsity
Docsity

Prepare for your exams
Prepare for your exams

Study with the several resources on Docsity


Earn points to download
Earn points to download

Earn points by helping other students or get them with a premium plan


Guidelines and tips
Guidelines and tips

NP thapar question paper 3rd year, Exams of Network Programming

.....................................

Typology: Exams

2022/2023

Uploaded on 12/08/2023

ajiteshchandi
ajiteshchandi ๐Ÿ‡ฎ๐Ÿ‡ณ

1 document

1 / 2

Toggle sidebar

This page cannot be seen from the preview

Don't miss anything!

bg1
T" 3c1- A
0 โ€ข C
Roll Number:
๎˜‰
Thapar Institute of Engineering & Technology, Patiala
Department of Computer Science and Engineering
EST Examination
B. E. (Third Year): Semester-V (2022-23) ODD
๎˜‰
Course Code: IJCS413
Branch: CSE/COE
๎˜‰
Course Name: Network Programming
13 Dec, 2022 (Tuesday)
๎˜‰
Time: 9:00 A.M.
Duration: 3 Hours
๎˜‰
Max Marks: 40
Name of Instructors: Dr.
Sunlit,
Dr.
Ashima, Dr.
Jayendra, Dr. Shashank
Note:
ALL questions are compulsory. Attempt ALL questions in a proper sequence. Questions
having multiple parts should be attempted at one place. Without proper steps and justification
(wherever required), no marks will be awarded. Write your programs in C. Assume missing
data, if any, suitably.
Q
Describe the prototype/syntax (return type and parameters) of the following functions:
selectยฐ, FD_SETO, FD_ISSETO, recyfrum(), scip_sendmsg0, setp_recimsg(), gelsockoptยฐ
7
Q2
Write a date-time TCP Server program that returns current date and time to the client. Take the
help of the below program for retrieving date.
[No
need to write client-side code and header
files]
#include<time.h>
int main(){
๎˜‰
time_t t;
๎˜‰
time(&t);
๎˜‰
char *s = ctime(&t);
printf("\nCurrent date and time is %s", s);
๎˜‰
return 0;
๎˜‰
}
Q3
Write a program to implement IP broadcast packet sending process using connectionless socket
programming. Take the class
B
network segment 172.16.x.x as an example, where the smallest
address 172.16.0.0 represents the network segment; and the largest address 172.16.255.255 is the
broadcast address in the network segment. When we send a data packet to this address, all hosts
on the network segment will receive and process it. Broadcast packets are sent and received
through UDP sockets.
[No
need to write the receiving process code and header
.
files].
The steps to be followed are as follows:
a)
Create a UDP socket;
b)
Fill the broadcast information structure;
๎˜‰
struct
๎˜‰
sockaddr_in
c)
Set socket options to allow broadcast packets to be sent;
๎˜‰
setsockupt(
d)
Send data packet;
๎˜‰
sendtoO
4
Q4
a)
Explain why we can only create 4094 VLANs on one physical network?
๎˜‰
(0.5 marks)
b)
Why TPID is kept as the first field in VLAN tag?
(0.5 marks)
c)
Explain how VLANs reduces Broadcast domain on one physical network.
(2 marks)
d)
Explain the statement "Stations do not belong to VLANs, but packets do".
(1 mark)
e)
Why do we require SVIs'? What limitations VLANs will face in absence of SVIs'? (I
mark)
I)
๎˜‰
Given following network topology in
Fig. I :
๎˜‰
(2 marks)
7
Consider
๎˜‰
following
๎˜‰
information:
Interface
๎˜‰
are
๎˜‰
and
1,(
P,.4
๎˜‰
P2, P I
๎˜‰
in VLAN10
interface
๎˜‰
P3
๎˜‰
is
๎˜‰
in
๎˜‰
VLAN20.
๎˜‰
The
Gateway IP addresses of VLAN 10
and
๎˜‰
VLAN20 are
๎˜‰
192.168.1.1
๎˜‰
and
These
,
PI
P4
192.168.2.1
๎˜‰
respectively.
177
p:
,โ€ž,,,iโ€ž,
Ph
H.,โ€žโ€ž,โ€ž
I
Gateways are configured as SVIs at
Gateways
interface P7 of Router. The MAC
addresses of PC1, PC2, PC3 and P7
are MRI, MR2, MR3 and MR7
respectively.
๎˜‰
Suppose all
๎˜‰
the
๎˜‰
ARP
i.,
P5
requests
๎˜‰
are
๎˜‰
completed
๎˜‰
in
๎˜‰
this
PC3
p
scenario.
๎˜‰
Answer
๎˜‰
the
๎˜‰
following
question.
๎˜‰
Figure 1
pf2

Partial preview of the text

Download NP thapar question paper 3rd year and more Exams Network Programming in PDF only on Docsity!

T" 3c1- A

0 โ€ข C

Roll Number:

Thapar Institute of Engineering & Technology, Patiala

Department of Computer Science and Engineering EST Examination B. E. (Third Year): Semester-V (2022-23) ODD Course Code: IJCS

Branch: CSE/COE Course Name: Network Programming

13 Dec, 2022 (Tuesday) Time: 9:00 A.M.

Duration: 3 Hours Max Marks: 40

Name of Instructors: Dr. Sunlit, Dr.^ Ashima, Dr.^ Jayendra, Dr. Shashank

Note: ALL questions are compulsory. Attempt ALL questions in a proper sequence. Questions

having multiple parts should be attempted at one place. Without proper steps and justification (wherever required), no marks will be awarded. Write your programs in C. Assume missing data, if any, suitably.

Q Describe the prototype/syntax (return type and parameters) of the following functions: selectยฐ, FD_SETO, FD_ISSETO, recyfrum(), scip_sendmsg0, setp_recimsg(), gelsockoptยฐ

Q2 Write a date-time TCP Server program that returns current date and time to the client. Take the help of the below program for retrieving date. [No need to write client-side code and header files] #include<time.h> int main(){ time_t t; time(&t);^ char *s = ctime(&t); printf("\nCurrent date and time is %s", s); return 0; } Q3 Write a program to implement IP broadcast packet sending process using connectionless socket programming. Take the class B^ network segment 172.16.x.x as an example, where the smallest address 172.16.0.0 represents the network segment; and the largest address 172.16.255.255 is the broadcast address in the network segment. When we send a data packet to this address, all hosts on the network segment will receive and process it. Broadcast packets are sent and received through UDP sockets. [No need to write the receiving process code and header^ .files]. The steps to be followed are as follows: a) Create a UDP socket; b) Fill the broadcast information structure; struct^ sockaddr_in c) Set socket options to allow broadcast packets to be sent;^ setsockupt( d) Send data packet; sendtoO

Q4 a) Explain why we can only create 4094 VLANs on one physical network?^ (0.5 marks) b) Why TPID is kept as the first field in VLAN tag? (0.5 marks) c) Explain how VLANs reduces Broadcast domain on one physical network.^ (2 marks) d) Explain the statement "Stations do not belong to VLANs, but packets do". (1 mark) e) Why do we require SVIs'? What limitations VLANs will face in absence of SVIs'? (I^ mark) I) Given following network topology in Fig. I : (2 marks)

Consider following information: Interface are^ and^

1,( P,.

P2, P I in VLAN interface P3 is in VLAN20. The Gateway IP addresses of VLAN 10 and VLAN20 are 192.168.1.1 and These

PI P

192.168.2.1 respectively.

Gateways are configured as SVIs atGateways^177 p:^ ,โ€ž,,,iโ€ž,^ H.,โ€žโ€ž,โ€ž^ Ph I

interface P7 of Router. The MAC addresses of PC1, PC2, PC3 and P are MRI, MR2, MR3 and MR respectively. Suppose all the^ ARP

i., P

requests are completed^ in^ this^ PC3^ p scenario. Answer the following

question. Figure 1

It' PC I ( ip: 192.168.10.10/24 ) wants to (^) send a packet to PC3 (ip: 192.168.20.2(1/.24). Write down Destination IP, Destination MAC, and VLAN (^) ID (^) of packet/frame header at each node (including source and destination) in the path. Q5 (^) C:onsider the following network (^) (Fig. 2) (^) consisting of two routers and two host devices. Let Router (^) A wants to send packet to (^) Host machine C. (^) Explain the. routing strategy used at (^) Router B (^) when the destination fP is taken as: a). "10.168.1.3/24" b). "122.1.1.1/32"

L3 Router U^ N A

13 oa ni 2 โ€ž,, 13.168.1.1/ eth

L3 Router B

D

10.168.1 1/24 10.168.1.4/ eth1 j 0111

  • s (^) โ€ข

10.168.1 3124 I ethi C

Lo: 122.1.1.1/

Figure 2

Q6 a). Why (^) encapsulation and (^) decapsulation are needed? Explain the three transition strategies that are used in IP encapsulation. b). Which problems exists in the communicating machines that are solved by ILVs'? Explain the TLV components and procedure to solve the compatibility problem between different machines along with suitable example. LQ7 (^) Consider the following (^) DNS hierarchy (Fig.3) (^) and answer the following questions:

000i)

cow

Acme (^) Nax AAA

Sates (^) ' Mehl OA ,

( Retail

  • -_

(Wholesale') I Actg (^) ( Finance , Mktg )

Figure 3 a) State down the steps to resolve the DNS query to find the "retail.sales.qjcix.cum" (^) using iterative (^) mode. b) Explain the different components of (^) FQDN: (^) "Jinance.corp.ajox.com." c) What is the role of ILD "trip," (^) server in the DNS hierarchy. d) (^) What are (^) First Hop DNS (FH DNS) (^) servers? Why arc these servers hierarchy'?

IP address of (2 marks) (I mark) (I mark) required in DNS (1 marks)

rot