BlackFriday 2024! Hurry Up, Grab the Special Discount - Save 25% - Ends In 00:00:00 Coupon code: SAVE25
Welcome to Pass4Success

- Free Preparation Discussions

Python Institute Exam PCPP-32-101 Topic 9 Question 28 Discussion

Actual exam question for Python Institute's PCPP-32-101 exam
Question #: 28
Topic #: 9
[All PCPP-32-101 Questions]

Select the true statements about the connection-oriented and connectionless types of communication. (Select two answers.)

Show Suggested Answer Hide Answer
Suggested Answer: A, D

1. In the context of TCP/IP networks, the communication side that initiates a connection is called the client, whereas the side that answers the client is called the server.

This statement is true because TCP/IP networks use a client-server model to establish connection-oriented communications. The client is the device or application that requests a service or resource from another device or application, which is called the server. The server responds to the client's request and provides the service or resource. For example, when you browse a website using a web browser, the browser acts as a client and sends a request to the web server that hosts the website.The web server acts as a server and sends back the requested web page to the browser1.

2. Connectionless communications are usually built on top of TCP.

This statement is false because TCP (Transmission Control Protocol) is a connection-oriented protocol that requires establishing and terminating a connection before and after sending data. Connectionless communications are usually built on top of UDP (User Datagram Protocol), which is a connectionless protocol that does not require any connection setup or teardown.UDP simply sends data packets to the destination without checking if they are received or not2.

3. Using walkie-talkies is an example of a connection-oriented communication.

This statement is false because using walkie-talkies is an example of a connectionless communication. Walkie-talkies do not establish a dedicated channel or connection between the sender and receiver before transmitting data. They simply broadcast data over a shared frequency without ensuring that the receiver is ready or available to receive it.The sender does not know if the receiver has received the data or not3.

4. A phone call is an example of a connection-oriented communication.

This statement is true because a phone call is an example of a connection-oriented communication. A phone call requires setting up a circuit or connection between the caller and callee before exchanging voice data. The caller and callee can hear each other's voice and know if they are connected or not.The phone call also requires terminating the connection when the conversation is over4.


1: https://www.techtarget.com/searchnetworking/definition/client-server2: https://www.javatpoint.com/connection-oriented-vs-connectionless-service3: https://en.wikipedia.org/wiki/Walkie-talkie4: https://en.wikipedia.org/wiki/Telephone_call

A is true because in the context of TCP/IP networks, the communication side that initiates a connection is called the client, and the side that answers the client is called the server. This is the basis for establishing a connection-oriented communication.

D is true because a phone call is an example of a connection-oriented communication. Like TCP/IP, a phone call establishes a connection between two devices (in this case, two phones) before communication can occur.

A is true because in the context of TCP/IP networks, the communication side that initiates a connection is called the client, and the side that answers the client is called the server. This is the basis for establishing a connection-oriented communication.

D is true because a phone call is an example of a connection-oriented communication. Like TCP/IP, a phone call establishes a connection between two devices (in this case, two phones) before communication can occur.

B is false because connectionless communications are usually built on top of UDP, not TCP. UDP is a connectionless protocol that does not establish a connection before sending data.

C is false because using walkie-talkies is an example of a connectionless communication. Walkie-talkies do not establish a connection before communication begins, and messages are simply broadcasted to all devices within range.

Here is a sample code in Python using thesocketmodule to create a TCP server and client to demonstrate the connection-oriented communication:

Server-side code:

import socket

HOST = '127.0.0.1'

PORT = 8080

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:

s.bind((HOST, PORT))

s.listen()

conn, addr = s.accept()

with conn:

print('Connected by', addr)

while True:

data = conn.recv(1024)

if not data:

break

conn.sendall(data)

Client-side code:

import socket

HOST = '127.0.0.1'

PORT = 8080

with socket.socket(socket.AF_INET, socket.SOCK_STREAM) as s:

s.connect((HOST, PORT))

s.sendall(b'Hello, world')

data = s.recv(1024)

print('Received', repr(data))

The server listens for incoming connections on port 8080, and when a connection is established, it prints the address of the client that has connected. The server then continuously receives data from the client and sends it back to the client until the connection is closed.

The client establishes a connection with the server and sends the message 'Hello, world' encoded as bytes. It then waits for a response from the server and prints the data it receives.

Contribute your Thoughts:

Wai
4 months ago
I'm not sure about B. Can someone explain why connectionless communications are usually built on top of TCP?
upvoted 0 times
...
Dyan
4 months ago
I agree with A. And I think D is also true because a phone call is a connection-oriented communication.
upvoted 0 times
...
Ivan
4 months ago
I think A is true because the client initiates the connection.
upvoted 0 times
...
Ling
5 months ago
Aha, got it! A and D are the way to go. Although, I have to say, if you're using a walkie-talkie, the only 'connection' you have is to your own hearing. *laughs*
upvoted 0 times
Filiberto
3 months ago
Yeah, and D is also true, like a phone call.
upvoted 0 times
...
Matt
3 months ago
I think A is correct, the client initiates the connection.
upvoted 0 times
...
...
Aliza
5 months ago
I'm gonna go with A and D. Walkie-talkies are definitely not connection-oriented, that's more like a party line. *chuckles*
upvoted 0 times
Karol
4 months ago
I agree, walkie-talkies are definitely not connection-oriented. Good choices with A and D.
upvoted 0 times
...
Karol
5 months ago
Actually, A and D are correct. Walkie-talkies are connectionless, not connection-oriented.
upvoted 0 times
...
...
Shawn
5 months ago
Hmm, I'm not sure about B. Isn't TCP itself connection-oriented? Connectionless would be more like UDP, right?
upvoted 0 times
...
Billye
5 months ago
A and D seem like the correct answers here. TCP/IP is connection-oriented, and a phone call is a classic example of that.
upvoted 0 times
Marva
4 months ago
D) A phone call is an example of a connection-oriented communication
upvoted 0 times
...
Corazon
4 months ago
A) In the context of TCP/IP networks, the communication side that initiates a connection is called the client, whereas the side that answers the client is called the server
upvoted 0 times
...
...

Save Cancel