0
0
Computer Networksknowledge~5 mins

Socket programming basics in Computer Networks - Cheat Sheet & Quick Revision

Choose your learning style9 modes available
Recall & Review
beginner
What is a socket in computer networking?
A socket is an endpoint for sending or receiving data across a computer network. It allows two programs to communicate over the internet or a local network.
Click to reveal answer
beginner
What are the two main types of sockets?
The two main types of sockets are TCP sockets, which provide reliable, connection-oriented communication, and UDP sockets, which provide faster, connectionless communication without guaranteed delivery.
Click to reveal answer
beginner
What is the role of an IP address and port number in socket programming?
An IP address identifies a device on the network, and a port number identifies a specific application or service on that device. Together, they direct data to the right place.
Click to reveal answer
intermediate
What does it mean to 'bind' a socket?
Binding a socket means assigning it a specific IP address and port number so it can listen for incoming data on that address and port.
Click to reveal answer
beginner
Explain the difference between a server socket and a client socket.
A server socket waits and listens for incoming connection requests from clients. A client socket initiates a connection to the server to communicate.
Click to reveal answer
What type of socket provides reliable, ordered communication?
ATCP socket
BUDP socket
CRaw socket
DMulticast socket
Which of the following is NOT part of a socket's address?
AIP address
BMAC address
CProtocol type
DPort number
What does the 'listen' operation do in socket programming?
AAssigns an IP address
BSends data to a client
CCloses the socket
DStarts waiting for incoming connections
Which socket type is faster but does not guarantee delivery?
ATCP socket
BStream socket
CUDP socket
DReliable socket
What is the purpose of a port number in socket programming?
ATo identify the application or service on the device
BTo identify the device on the network
CTo encrypt data
DTo route data between networks
Describe what a socket is and how it is used in network communication.
Think about how two programs talk over the internet.
You got /4 concepts.
    Explain the difference between TCP and UDP sockets and when you might use each.
    Consider reliability versus speed.
    You got /4 concepts.