lecture5 - CIS 525/725 Computer Networks Lecture 5 Berkeley...

Info iconThis preview shows pages 1–7. Sign up to view the full content.

View Full Document Right Arrow Icon
CIS 525/725 – Computer Networks Lecture 5: Berkeley Sockets API Mitch Neilsen [email protected]
Background image of page 1

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Host 1 TCP Host 2 TCP Server Client API Peer-to-peer interface Interfaces Peer-to-peer interface (Transport Layer Protocol) (Application Layer Protocol)
Background image of page 2
Application Programming Interface (API) z Interface between applications and lower layers in the protocol stack. z Allows applications to communicate between hosts. z Various different APIs exist, including: z Berkeley Sockets – gcc … -lsocket -lnsl z Windows Sockets – wsock32.dll z Transport Layer Interface (TLI) – gcc … -lnsl z Remote Procedure Call (RPC) – gcc … -lrpc z Remote Method Interface (RMI)
Background image of page 3

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
API Implementation z As part of the operating system z BSD Unix, Linux – sockets part of O.S. z As a library, either z static – linked at compile time z Solaris (SysV Unix) – sockets library (-lsocket) on top of TLI (network software) library (-lnsl) z dynamic – linked at run-time z Windows (wsock32.dll)
Background image of page 4
Sockets API z socket ( ) - create an endpoint for communication. z bind ( ) - associate an address with the socket. z listen ( ) - specify the maximum number of outstanding connection requests that can be pending (usually 5). z accept ( ) - wait for and accept a connection request. z connect ( ) - connect to a server. z write( ) or sendto( ) - send data to a peer. z read( ) or recvfrom( ) - receive data from a peer. z close( ) - close a socket. z shutdown( ) - close a socket in one direction.
Background image of page 5

Info iconThis preview has intentionally blurred sections. Sign up to view the full version.

View Full Document Right Arrow Icon
Client-Server Model z The Client-Server Model is a process model that can be used to describe the interaction between
Background image of page 6
Image of page 7
This is the end of the preview. Sign up to access the rest of the document.

{[ snackBarMessage ]}

Page1 / 21

lecture5 - CIS 525/725 Computer Networks Lecture 5 Berkeley...

This preview shows document pages 1 - 7. Sign up to view the full document.

View Full Document Right Arrow Icon
Ask a homework question - tutors are online