PYTHON NETWORK PROGRAMMING QUIZ DESCRIPTION

Choose from the following in which one forwarding, the mask, and destination addresses are both 0.0.0.0 in the routing table.

  • next-hop
     

  • default
     

  •  host-specific
     

  • network-specific

______is the Central Computer more powerful than other computers in the network.

  •  Server
     

  • Hub
     

  • Client

  • Switch

Select the uses of the switch in a datagram network.

  • destination address
     

  • routing table
     

  •  sender address
     

  •  header

What protocol can be used to retrieve web pages using python?

  • urllib
     

  • bs4
     

  • HTTP

  • GET

Optical Fiber transmit______.

  • light signal
     

  • radio signal

  • electrical signal

  • Both A and B

One of the following classes are used for connection-less socket programming?
 

  • Datagram Socket
     

  •  Datagram Packet
     

  • Both Datagram Socket
     

  • Datagram Packet

one of the following is a path vector routing?

  • exterior gateway protocol
     

  • inter-domain routing
     

  • network routing protocol

  • All of these

172.31.25.151 is an example of which one?

  • Public
     

  •  Private
     

  •  Class A
     

  • Class E

What happens if you fail to stop the stream before closing the socket?

  • Data loss
     

  • Nothing
     

  •  Logic error
     

  • Socket lockup

 

What does the following block of code do?

url = "https://www.nytimes.com"
html = urllib.request.urlopen(url, context=ctx).read()
soup = BeautifulSoup(html, 'html.parser')

  • retrieves and displays the webpage
     

  •  parses the html content of the "https://www.nytimes.com" webpage.
     

  • downloads the webpage
     

  •  it does nothing

Which of the following net is the combination of two or more networks?

  • MAN
    B. WAN
    C. Internetwork
    D. None of these

  • WAN

  • Internetwork

  • None of these

In networks protocol TCP/ IP stands for.

  • Transaction control protocol
     

  • Transmission control protocol

  • Transmission contribution protocol

  • None of these

 

What does the following block of code do?

import urllib.request, urllib.parse, urllib.error
img = urllib.request.urlopen('http://data.pr4e.org/cover3.jpg').read()
fhand = open('cover3.jpg', 'wb')
fhand.write(img)
fhand.close()

  • It retrieves 'cover3.jpg' and saves it to your computer.
     

  •  It displays the image 'cover3.jpg'.
     

  • It retrieves the url to download 'cover3.jpg'
     

  • It doesn't retrieves anything.

High speed connectivity providing through_______network.

  • LAN
     

  • MAN
     

  •  WAN
     

  • All of these

In the communication pathway data transfers from one point to another through_____.

  • Medium
     

  • Node

  • Link

  •  All of these

______ Net Ware protocol provides link-state routing.
 

  • SAP

  • RIP

  • NLSP

  • NCP

_______is the Machine that places the request to access the data
 

  • Client Machine
     

  • Server Machine
     

  •  Request Machine
     

  •  None of these

Sockets are different from ports because ?

  • They included IP addresses
     

  • They are in the Application Layer
     

  • They use the OSI model
     

  • They are just another term for the same thing

What must be done before disconnecting a socket?

  • Ending the data stream
     

  • . Telling the server good-bye
     

  •  Flushing the cache
     

  • Nothing, you can simply "unplug" with no ill effects

 

What does the following block of code do?

import urllib.request
fhand = urllib.request.urlopen('http://data.pr4e.org/romeo.txt')
for line in fhand:
    print(line.decode().strip())

  • It creates a file named 'romeo.txt' in 'data.pr4e.org'
     

  •  It finds the urls linked to 'data.pr4e.org' and prints it.
     

  •  It opens a file named 'http://data.pr4e.org/romeo.txt' in local storage
     

  •  It prints the contents of 'romeo.txt' after retrieving it from 'data.pr4e.org'

Select the subset of a network that contains all the routers but has no loops is known as

  • spider tree
     

  • spider structure
     

  •  spanning-tree
     

  • none of the mentioned

HTTP port number used is______.

  • 43
     

  • 441

  • 443

  • 449

One of the following is a path vector routing?

  • exterior gateway protocol
     

  • inter-domain routing
     

  •  network routing protocol
     

  •  All of these

Select the size of the Source and Destination IP address in the IP header.

  • 4 bits
     

  •  32 bits
     

  • 16 bits
     

  • . 8 bits

How does the pack() function work on the tkinter widget ?
 

  • According to x,y coordinate
     

  •  According to row and column vise
     

  •  According to left,right,up,down
     

  •  None of the above

Choose the function of a router

  • changing the data from one format to another
     

  •  error detection in data
     

  •  send the packet to the uplinks
     

  • None of the above

 ______ are the advantages of hierarchical routing.
 

  • Flexibility
     

  •  Reliability
     

  • Scalability
     

  • Portability

How many S – boxes used in DES algorithm?

  • 6

  • 24

  • 8

  • 42

IDEA algorithm generates ______keys.

  • 56

  • 28

  • 52

  • 72

What does the following block of code do?
mysock = socket.socket(socket.AF_INET, socket.SOCK_STREAM)
mysock.connect(('data.pr4e.org', 80))
cmd = 'GET http://data.pr4e.org/romeo.txt HTTP/1.0\r\n\r\n'.encode()
mysock.send(cmd)

  • It sends a request to extract 'romeo.txt' from 'data.pr4e.org'
     

  • It sends the 'romeo.txt' file to 'data.pr4e.org'
     

  •  It creates a file named 'romeo.txt'
     

  •  It throws an error because a socket cannot use HTTP.