
- Data Comm & Networks Home
- DCN - Overview
- DCN - What is Computer Network
- DCN - Uses of Computer Network
- DCN - Computer Network Types
- DCN - Network LAN Technologies
- DCN - Computer Network Models
- DCN - Computer Network Security
- DCN - Components
- DCN - Connectors
- DCN - Switches
- DCN - Repeaters
- DCN - Gateways
- DCN - Bridges
- DCN - Socket
- DCN - Network Interface Card
- DCN - NIC: Pros and Cons
- DCN - Network Hardware
- DCN - Network Port
- Computer Network Topologies
- DCN - Computer Network Topologies
- DCN - Point-to-point Topology
- DCN - Bus Topology
- DCN - Star Topology
- DCN - Ring Topology
- DCN - Mesh Topology
- DCN - Tree Topology
- DCN - Hybrid Topology
- Physical Layer
- DCN - Physical Layer Introduction
- DCN - Digital Transmission
- DCN - Analog Transmission
- DCN - Transmission media
- DCN - Wireless Transmission
- DCN - Transmission Impairments
- DCN - Multiplexing
- DCN - Network Switching
- Data Link Layer
- DCN - Data Link Layer Introduction
- DCN - Data Link Control & Protocols
- DCN - RMON
- DCN - Token Ring Network
- DCN - Hamming Code
- DCN - Byte Stuffing
- DCN - Channel Allocation
- DCN - MAC Address
- DCN - Cyclic Redundancy Checks
- DCN - Error Control
- DCN - Flow Control
- DCN - Framing
- DCN - Error Detection & Correction
- DCN - Error Correcting Codes
- DCN - Parity Bits
- Network Layer
- DCN - Network Layer Introduction
- DCN - Network Addressing
- DCN - Routing
- DCN - Internetworking
- DCN - Network Layer Protocols
- DCN - Routing Information Protocol
- DCN - Border Gateway Protocol
- DCN - OSPF Protocol
- DCN - Network Address Translation
- DCN - Network Address Translation Types
- Transport Layer
- DCN - Transport Layer Introduction
- DCN - Transmission Control Protocol
- DCN - User Datagram Protocol
- DCN - Congestion Control
- DCN - TCP Service Model
- DCN - TLS Handshake
- DCN - TCP Vs. UDP
- Application Layer
- DCN - Application Layer Introduction
- DCN - Client-Server Model
- DCN - Application Protocols
- DCN - Network Services
- DCN - Virtual Private Network
- DCN - Load Shedding
- DCN - Optimality Principle
- DCN - Service Primitives
- DCN - Services of Network Security
- DCN - Hypertext Transfer Protocol
- DCN - File Transfer Protocol
- DCN - Secure Socket Layer
- Network Protocols
- DCN - ALOHA Protocol
- DCN - Pure ALOHA Protocol
- DCN - Sliding Window Protocol
- DCN - Stop and Wait Protocol
- DCN - Link State Routing
- DCN - Link State Routing Protocol
- Network Algorithms
- DCN - Shortest Path Algorithm
- DCN - Routing Algorithm
- DCN - Leaky Bucket Algorithm
- Wireless Networks
- DCN - Wireless Networks
- DCN - Wireless LANs
- DCN - Wireless LAN & IEEE 802.11
- DCN - IEEE 802.11 Wireless LAN Standards
- DCN - IEEE 802.11 Networks
- Multiplexing
- DCN - Multiplexing & Its Types
- DCN - Time Division Multiplexing
- DCN - Synchronous TDM
- DCN - Asynchronous TDM
- DCN - Synchronous Vs. Asynchronous TDM
- DCN - Frequency Division Multiplexing
- DCN - TDM Vs. FDM
- DCN - Code Division Multiplexing
- DCN - Wavelength Division Multiplexing
- Miscellaneous
- DCN - Shortest Path Routing
- DCN - B-ISDN Reference Model
- DCN - Design Issues For Layers
- DCN - Selective-repeat ARQ
- DCN - Flooding
- DCN - E-Mail Format
- DCN - Cryptography
- DCN - Unicast, Broadcast, & Multicast
- DCN - Network Virtualization
- DCN - Flow Vs. Congestion Control
- DCN - Asynchronous Transfer Mode
- DCN - ATM Networks
- DCN - Synchronous Vs. Asynchronous Transmission
- DCN - Network Attacks
- DCN - WiMax
- DCN - Buffering
- DCN - Authentication
- DCN Useful Resources
- DCN - Quick Guide
- DCN - Useful Resources
Socket in Computer Network
Network Socket
A network socket is a software component within a computer network node that acts as an endpoint for delivering and receiving data. An application programming interface (API) for the networking architecture defines the structure and properties of a socket. Sockets are only produced over the lifespan of a process in a node-based application.
Because the TCP/IP protocols were standardized during the creation of the Internet, the word "network socket" is most often used in the context of the Internet Protocol suite, and it is hence referred to as an "Internet Socket". In this context, a socket's address, which is the triad of the transport protocol, IP address, and port number, is used to externally identify it to other hosts.
The software endpoint of node-internal inter-process communication (IPC), which frequently utilizes the same API as a network socket, is often referred to as a socket.
Pipes are formed using the 'Pipe' system call, and sockets are generated with the 'socket' system call. Over the network, the socket allows bidirectional FIFO communication. At either end of the connection, a socket connecting to the network is formed. Each socket has its unique address. An IP address plus a port number make up this address.
In most client-server applications, sockets are used. The server builds a socket, connects it to a network port, and waits for the client to connect to it. After creating a socket, the client tries to connect to the server socket. Data is transferred after the link is established.
Types of Sockets
1. Datagram Socket
A datagram socket is a type of network socket in which packets are sent and received without the use of a link. It resembles a mailbox. Letters (data) are gathered and delivered (transmitted) to a mailbox (receiving socket). It is a connection-less socket.
2. Stream Socket
A stream socket is a type of network socket in a computer operating system that provides a connection-oriented, sequenced, and unique flow of data without record boundaries, as well as well-defined mechanisms for creating and destroying connections and detecting errors. It is comparable to a telephone. Between the phones (two ends), a link is created.
Network Socket Client Server Interaction
The following diagram shows the complete Client and Server interaction

Function Call | Description |
---|---|
create() | To construct a socket |
bind() | It's a socket identifier, similar to a phone number for contacting someone. |
connect() | Are you ready to make a connection? |
listen() | Prepared to send a message |
accept() | Confirmation is similar to accepting a call from a sender. |
write() | To send data |
read() | To receive data |
close() | To make a relationship permanent |