Socket Presentation
Socket Presentation
Socket Presentation
COMPUTER NETWORK
A
usually unique
Routing:
process of forwarding messages to the destination node based on its address. Protocol: set of rules used for communication.
Client
Server
Re su lt
Network
Client machine
Server machine
CLIENT-SERVER COMMUNICATION
SOCKETS
A socket is defined as an endpoint for communication. Concatenation of IP address and port A socket pair (local IP address, local port, foreign IP address, foreign port) uniquely identifies a communication. The socket 161.25.19.8:1625 refers to port 1625 on host 161.25.19.8
SOCK_STREAM TCP reliable delivery in-order guaranteed connection-oriented Bidirectional Stream flow of data
SOCK_DGRAM UDP unreliable delivery no order guarantees no notion of connection app indicates dest. for each packet can send or receive Datagram format
App D1
App
3 2 1
socket
Dest.
3 2 1
socket
D3
D2
Bind() Socket() Listen() Connection Establishmt. Block until connect Process request Send() Accept() Recv() Data (request) Bind() Connect() Send()
JAVA SOCKETS
ServerSocket(1254)
server
12
Client