Sockets and Ports - The OS uses this 4 values to know what...

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

View Full Document Right Arrow Icon
Sockets and Ports A port defines an end-point (application) in the machine itself There are well-known ports: HTTP Port 80 SSH Port 22 FTP Port 21 If you are building an application that will be deployed globally, you may request your own port number. A socket is a file descriptor that can be used to receive incoming connections or to read/write data to a client or server.
Background image of page 1

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

View Full DocumentRight Arrow Icon
Sockets and Ports A TCP connection is defined uniquely in the entire Internet by four values: <src-ip-addr, src-port, dest-ip-addr, dest-port> Example: A runs an HTTP server in port 80 B connects to A’s HTTP server using source port 5000 The connection is <IB, 5000, IA, 80> C connects also to A’s HTTP server using src port 8000 The connection is <IC, 8000, IA, 80> Another browser in B using port 6000 connects to A The connection is <IB, 6000, IA, 80> Another browser in C using port 5000 connects to A The connection is <IC, 5000, IA, 80>
Background image of page 2
Background image of page 3

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

View Full DocumentRight Arrow Icon
Background image of page 4
This is the end of the preview. Sign up to access the rest of the document.

Unformatted text preview: The OS uses this 4 values to know what data corresponds to Sockets API They were introduced by UNIX BSD (Berkeley Standard Distribution). They provide a standard API for TCP/IP. A program that uses sockets can be easily ported to other OSs that implement sockets: Example: Windows. Sockets were designed general enough to be used for other platforms besides TCP/IP. That also makes sockets more difficult to use. Sockets API Sockets offer: Stream interface for TCP. Read/Write is similar to writing to a file or pipe. Message based interface for UDP Communication is done using messages. The first applications were written using sockets: FTP, mail, finger, DNS etc. Sockets are still used for applications where direct control of the network is required. Communication is programmed as a conversation between client and server mostly...
View Full Document

This note was uploaded on 01/30/2012 for the course CS 252 taught by Professor Gustavorodriguez during the Fall '11 term at Purdue University-West Lafayette.

Page1 / 4

Sockets and Ports - The OS uses this 4 values to know what...

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

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